Skip to content

Commit

Permalink
upgrade to proc-macro-error2
Browse files Browse the repository at this point in the history
  • Loading branch information
sundy-li committed Sep 23, 2024
1 parent 9ac29ba commit dda11e0
Show file tree
Hide file tree
Showing 15 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion fastrace-jaeger/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ use std::net::UdpSocket;
use fastrace::collector::Reporter;
use fastrace::prelude::*;
use thrift::Log;
use thrift_codec::message::Message;
use thrift_codec::CompactEncode;
use thrift_codec::message::Message;

use crate::thrift::Batch;
use crate::thrift::EmitBatchNotification;
Expand Down
12 changes: 6 additions & 6 deletions fastrace-opentelemetry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ use std::time::UNIX_EPOCH;
use fastrace::collector::EventRecord;
use fastrace::collector::Reporter;
use fastrace::prelude::*;
use opentelemetry::InstrumentationLibrary;
use opentelemetry::Key;
use opentelemetry::KeyValue;
use opentelemetry::StringValue;
use opentelemetry::Value;
use opentelemetry::trace::Event;
use opentelemetry::trace::SpanContext;
use opentelemetry::trace::SpanKind;
use opentelemetry::trace::Status;
use opentelemetry::trace::TraceFlags;
use opentelemetry::trace::TraceState;
use opentelemetry::InstrumentationLibrary;
use opentelemetry::Key;
use opentelemetry::KeyValue;
use opentelemetry::StringValue;
use opentelemetry::Value;
use opentelemetry_sdk::Resource;
use opentelemetry_sdk::export::trace::SpanData;
use opentelemetry_sdk::export::trace::SpanExporter;
use opentelemetry_sdk::trace::SpanEvents;
use opentelemetry_sdk::trace::SpanLinks;
use opentelemetry_sdk::Resource;

/// [OpenTelemetry](https://github.com/open-telemetry/opentelemetry-rust) reporter for `fastrace`.
///
Expand Down
2 changes: 1 addition & 1 deletion fastrace/benches/compare.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright 2020 TiKV Project Authors. Licensed under Apache-2.0.

use criterion::Criterion;
use criterion::criterion_group;
use criterion::criterion_main;
use criterion::Criterion;

fn init_opentelemetry() {
use tracing_subscriber::prelude::*;
Expand Down
4 changes: 2 additions & 2 deletions fastrace/benches/object_pool.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright 2020 TiKV Project Authors. Licensed under Apache-2.0.

use criterion::criterion_group;
use criterion::criterion_main;
use criterion::BatchSize;
use criterion::Criterion;
use criterion::criterion_group;
use criterion::criterion_main;
use fastrace::util::object_pool::Pool;

fn bench_alloc_vec(c: &mut Criterion) {
Expand Down
2 changes: 1 addition & 1 deletion fastrace/benches/spsc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
use std::time::Duration;
use std::time::Instant;

use criterion::Criterion;
use criterion::criterion_group;
use criterion::criterion_main;
use criterion::Criterion;

fn spsc_comparison(c: &mut Criterion) {
let mut bgroup = c.benchmark_group("spsc channel");
Expand Down
2 changes: 1 addition & 1 deletion fastrace/benches/trace.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright 2020 TiKV Project Authors. Licensed under Apache-2.0.

use criterion::Criterion;
use criterion::black_box;
use criterion::criterion_group;
use criterion::criterion_main;
use criterion::Criterion;
use fastrace::local::LocalCollector;
use fastrace::prelude::*;

Expand Down
2 changes: 1 addition & 1 deletion fastrace/src/collector/console_reporter.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2020 TiKV Project Authors. Licensed under Apache-2.0.

use crate::collector::global_collector::Reporter;
use crate::collector::SpanRecord;
use crate::collector::global_collector::Reporter;

/// A console reporter that prints span records to the stderr.
pub struct ConsoleReporter;
Expand Down
14 changes: 7 additions & 7 deletions fastrace/src/collector/global_collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,35 @@
use std::borrow::Cow;
use std::cell::UnsafeCell;
use std::collections::HashMap;
use std::sync::Arc;
use std::sync::atomic::AtomicBool;
use std::sync::atomic::AtomicUsize;
use std::sync::atomic::Ordering;
use std::sync::Arc;

use minstant::Anchor;
use minstant::Instant;
use parking_lot::Mutex;

use crate::collector::command::CollectCommand;
use crate::collector::command::CommitCollect;
use crate::collector::command::DropCollect;
use crate::collector::command::StartCollect;
use crate::collector::command::SubmitSpans;
use crate::collector::Config;
use crate::collector::EventRecord;
use crate::collector::SpanContext;
use crate::collector::SpanId;
use crate::collector::SpanRecord;
use crate::collector::SpanSet;
use crate::collector::TraceId;
use crate::collector::command::CollectCommand;
use crate::collector::command::CommitCollect;
use crate::collector::command::DropCollect;
use crate::collector::command::StartCollect;
use crate::collector::command::SubmitSpans;
use crate::local::local_collector::LocalSpansInner;
use crate::local::raw_span::RawKind;
use crate::local::raw_span::RawSpan;
use crate::util::CollectToken;
use crate::util::object_pool;
use crate::util::spsc::Receiver;
use crate::util::spsc::Sender;
use crate::util::spsc::{self};
use crate::util::CollectToken;

static NEXT_COLLECT_ID: AtomicUsize = AtomicUsize::new(0);
static GLOBAL_COLLECTOR: Mutex<Option<GlobalCollector>> = Mutex::new(None);
Expand Down
2 changes: 1 addition & 1 deletion fastrace/src/collector/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ pub use id::TraceId;
#[doc(hidden)]
pub use test_reporter::TestReporter;

use crate::Span;
use crate::local::local_collector::LocalSpansInner;
use crate::local::local_span_stack::LOCAL_SPAN_STACK;
use crate::local::raw_span::RawSpan;
use crate::Span;
#[cfg(test)]
pub(crate) type GlobalCollect = Arc<MockGlobalCollect>;

Expand Down
2 changes: 1 addition & 1 deletion fastrace/src/collector/test_reporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use std::sync::Arc;

use parking_lot::Mutex;

use crate::collector::global_collector::Reporter;
use crate::collector::SpanRecord;
use crate::collector::global_collector::Reporter;

pub struct TestReporter {
pub spans: Arc<Mutex<Vec<SpanRecord>>>,
Expand Down
2 changes: 1 addition & 1 deletion fastrace/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

use std::borrow::Cow;

use crate::Span;
use crate::local::local_span_stack::LOCAL_SPAN_STACK;
use crate::local::raw_span::RawKind;
use crate::Span;

/// An event that represents a single point in time during the execution of a span.
pub struct Event;
Expand Down
2 changes: 1 addition & 1 deletion fastrace/src/future.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
use std::borrow::Cow;
use std::task::Poll;

use crate::local::LocalSpan;
use crate::Span;
use crate::local::LocalSpan;

impl<T: std::future::Future> FutureExt for T {}

Expand Down
2 changes: 1 addition & 1 deletion fastrace/src/local/local_collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ use std::sync::Arc;

use minstant::Instant;

use crate::local::local_span_stack::LOCAL_SPAN_STACK;
use crate::local::local_span_stack::LocalSpanStack;
use crate::local::local_span_stack::SpanLineHandle;
use crate::local::local_span_stack::LOCAL_SPAN_STACK;
use crate::prelude::SpanContext;
use crate::prelude::SpanRecord;
use crate::util::CollectToken;
Expand Down
2 changes: 1 addition & 1 deletion fastrace/src/local/local_span.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ use std::cell::RefCell;
use std::rc::Rc;

use crate::local::local_span_line::LocalSpanHandle;
use crate::local::local_span_stack::LocalSpanStack;
use crate::local::local_span_stack::LOCAL_SPAN_STACK;
use crate::local::local_span_stack::LocalSpanStack;

/// An optimized [`Span`] for tracing operations within a single thread.
///
Expand Down
12 changes: 6 additions & 6 deletions fastrace/src/span.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ use std::time::Duration;

use minstant::Instant;

use crate::collector::global_collector::reporter_ready;
use crate::collector::CollectTokenItem;
use crate::collector::GlobalCollect;
use crate::collector::SpanContext;
use crate::collector::SpanId;
use crate::collector::SpanSet;
use crate::collector::global_collector::reporter_ready;
use crate::local::LocalCollector;
use crate::local::LocalSpans;
use crate::local::local_collector::LocalSpansInner;
use crate::local::local_span_stack::LocalSpanStack;
use crate::local::local_span_stack::LOCAL_SPAN_STACK;
use crate::local::local_span_stack::LocalSpanStack;
use crate::local::raw_span::RawKind;
use crate::local::raw_span::RawSpan;
use crate::local::LocalCollector;
use crate::local::LocalSpans;
use crate::util::CollectToken;

/// A thread-safe span.
Expand Down Expand Up @@ -561,12 +561,12 @@ fn current_collect() -> GlobalCollect {

#[cfg(test)]
mod tests {
use std::sync::Mutex;
use std::sync::atomic::AtomicUsize;
use std::sync::atomic::Ordering;
use std::sync::Mutex;

use mockall::predicate;
use mockall::Sequence;
use mockall::predicate;
use rand::seq::SliceRandom;
use rand::thread_rng;

Expand Down

0 comments on commit dda11e0

Please sign in to comment.