Skip to content

Commit 50ba3a7

Browse files
authored
Merge pull request #4635 from RalfJung/rustup
Rustup
2 parents 7d4e2b9 + afceaa0 commit 50ba3a7

File tree

15 files changed

+85
-90
lines changed

15 files changed

+85
-90
lines changed

rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
235a4c083eb2a2bfe8779d211c3232f39396de00
1+
28d0a4a205f9e511ad2f51ee79a4aa19a704a455

src/bin/log/setup.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use std::env::{self, VarError};
22
use std::str::FromStr;
33
use std::sync::{Mutex, OnceLock};
44

5+
use rustc_log::tracing;
56
use rustc_middle::ty::TyCtxt;
67
use rustc_session::{CtfeBacktrace, EarlyDiagCtxt};
78

@@ -72,8 +73,8 @@ fn init_logger_once(early_dcx: &EarlyDiagCtxt) {
7273
early_dcx,
7374
rustc_logger_config(),
7475
|| {
75-
tracing_subscriber::layer::SubscriberExt::with(
76-
tracing_subscriber::Registry::default(),
76+
rustc_log::tracing_subscriber::layer::SubscriberExt::with(
77+
rustc_log::tracing_subscriber::Registry::default(),
7778
chrome_layer,
7879
)
7980
},

src/bin/log/tracing_chrome.rs

Lines changed: 31 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,9 @@
2424
#![allow(warnings)]
2525
#![cfg(feature = "tracing")]
2626

27-
// This is here and not in src/lib.rs since it is a direct dependency of tracing_chrome.rs and
28-
// should not be included if the "tracing" feature is disabled.
29-
extern crate tracing_core;
30-
31-
use tracing_core::{field::Field, span, Event, Subscriber};
32-
use tracing_subscriber::{
27+
use rustc_log::tracing_core::{field::Field, span, Event, Subscriber};
28+
use rustc_log::tracing_subscriber::{
29+
self,
3330
layer::Context,
3431
registry::{LookupSpan, SpanRef},
3532
Layer,
@@ -526,16 +523,16 @@ where
526523
}
527524
},
528525
TraceStyle::Async => Some(
529-
span.scope()
530-
.from_root()
531-
.take(1)
532-
.next()
533-
.unwrap_or(span)
534-
.id()
535-
.into_u64()
526+
span.scope()
527+
.from_root()
528+
.take(1)
529+
.next()
530+
.unwrap_or(span)
531+
.id()
532+
.into_u64()
536533
.cast_signed() // the comment above explains the cast
537534
),
538-
}
535+
}
539536
}
540537

541538
fn enter_span(&self, span: SpanRef<S>, ts: f64, tid: usize, out: &Sender<Message>) {
@@ -570,11 +567,11 @@ where
570567
Some(thread_data) => (thread_data, false),
571568
None => {
572569
let tid = self.max_tid.fetch_add(1, Ordering::SeqCst);
573-
let out = self.out.lock().unwrap().clone();
570+
let out = self.out.lock().unwrap().clone();
574571
let start = TracingChromeInstant::setup_for_thread_and_start(tid);
575572
*thread_data = Some(ThreadData { tid, out, start });
576573
(thread_data.as_mut().unwrap(), true)
577-
}
574+
}
578575
};
579576

580577
start.with_elapsed_micros_subtracting_tracing(|ts| {
@@ -586,7 +583,7 @@ where
586583
let _ignored = out.send(Message::NewThread(*tid, name));
587584
}
588585
f(ts, *tid, out);
589-
});
586+
});
590587
});
591588
}
592589
}
@@ -608,15 +605,15 @@ where
608605
fn on_record(&self, id: &span::Id, values: &span::Record<'_>, ctx: Context<'_, S>) {
609606
if self.include_args {
610607
self.with_elapsed_micros_subtracting_tracing(|_, _, _| {
611-
let span = ctx.span(id).unwrap();
612-
let mut exts = span.extensions_mut();
608+
let span = ctx.span(id).unwrap();
609+
let mut exts = span.extensions_mut();
613610

614-
let args = exts.get_mut::<ArgsWrapper>();
611+
let args = exts.get_mut::<ArgsWrapper>();
615612

616-
if let Some(args) = args {
617-
let args = Arc::make_mut(&mut args.args);
618-
values.record(&mut JsonVisitor { object: args });
619-
}
613+
if let Some(args) = args {
614+
let args = Arc::make_mut(&mut args.args);
615+
values.record(&mut JsonVisitor { object: args });
616+
}
620617
});
621618
}
622619
}
@@ -639,16 +636,16 @@ where
639636

640637
fn on_new_span(&self, attrs: &span::Attributes<'_>, id: &span::Id, ctx: Context<'_, S>) {
641638
self.with_elapsed_micros_subtracting_tracing(|ts, tid, out| {
642-
if self.include_args {
643-
let mut args = Object::new();
644-
attrs.record(&mut JsonVisitor { object: &mut args });
645-
ctx.span(id).unwrap().extensions_mut().insert(ArgsWrapper {
646-
args: Arc::new(args),
647-
});
648-
}
649-
if let TraceStyle::Threaded = self.trace_style {
650-
return;
651-
}
639+
if self.include_args {
640+
let mut args = Object::new();
641+
attrs.record(&mut JsonVisitor { object: &mut args });
642+
ctx.span(id).unwrap().extensions_mut().insert(ArgsWrapper {
643+
args: Arc::new(args),
644+
});
645+
}
646+
if let TraceStyle::Threaded = self.trace_style {
647+
return;
648+
}
652649

653650
self.enter_span(ctx.span(id).expect("Span not found."), ts, tid, out);
654651
});

src/bin/miri.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@
88
rustc::untranslatable_diagnostic
99
)]
1010

11-
// Some "regular" crates we want to share with rustc
12-
extern crate tracing;
13-
#[cfg(feature = "tracing")]
14-
extern crate tracing_subscriber;
15-
1611
// The rustc crates we need
1712
extern crate rustc_abi;
1813
extern crate rustc_data_structures;
@@ -48,6 +43,7 @@ use rustc_hir::def_id::LOCAL_CRATE;
4843
use rustc_hir::{self as hir, Node};
4944
use rustc_hir_analysis::check::check_function_signature;
5045
use rustc_interface::interface::Config;
46+
use rustc_log::tracing::debug;
5147
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags;
5248
use rustc_middle::middle::exported_symbols::{
5349
ExportedSymbol, SymbolExportInfo, SymbolExportKind, SymbolExportLevel,
@@ -60,7 +56,6 @@ use rustc_session::EarlyDiagCtxt;
6056
use rustc_session::config::{CrateType, ErrorOutputType, OptLevel};
6157
use rustc_session::search_paths::PathKind;
6258
use rustc_span::def_id::DefId;
63-
use tracing::debug;
6459

6560
use crate::log::setup::{deinit_loggers, init_early_loggers, init_late_loggers};
6661

src/borrow_tracker/stacked_borrows/stack.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
use std::ops::Range;
33

44
use rustc_data_structures::fx::FxHashSet;
5-
use tracing::trace;
5+
use rustc_log::tracing::trace;
66

77
use crate::borrow_tracker::stacked_borrows::{Item, Permission};
88
use crate::borrow_tracker::{AccessKind, BorTag};

src/concurrency/data_race.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ use rustc_abi::{Align, HasDataLayout, Size};
4848
use rustc_ast::Mutability;
4949
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
5050
use rustc_index::{Idx, IndexVec};
51+
use rustc_log::tracing;
5152
use rustc_middle::mir;
5253
use rustc_middle::ty::Ty;
5354
use rustc_span::Span;

src/concurrency/genmc/global_allocations.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use rand::SeedableRng;
66
use rand::rngs::StdRng;
77
use rustc_const_eval::interpret::{AllocId, AllocInfo, InterpResult, interp_ok};
88
use rustc_data_structures::fx::FxHashMap;
9-
use tracing::debug;
9+
use rustc_log::tracing::debug;
1010

1111
use crate::alloc_addresses::AddressGenerator;
1212

src/concurrency/genmc/run.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use std::sync::Arc;
33
use std::time::Instant;
44

55
use genmc_sys::EstimationResult;
6+
use rustc_log::tracing;
67
use rustc_middle::ty::TyCtxt;
78

89
use super::GlobalState;

src/concurrency/genmc/scheduling.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use genmc_sys::{ActionKind, ExecutionState};
2+
use rustc_data_structures::either::Either;
23
use rustc_middle::mir::TerminatorKind;
34
use rustc_middle::ty::{self, Ty};
45

@@ -38,7 +39,7 @@ fn get_next_instruction_kind<'tcx>(
3839
let Some(frame) = thread_manager.active_thread_stack().last() else {
3940
return interp_ok(NonAtomic);
4041
};
41-
let either::Either::Left(loc) = frame.current_loc() else {
42+
let Either::Left(loc) = frame.current_loc() else {
4243
// We are unwinding, so the next step is definitely not atomic.
4344
return interp_ok(NonAtomic);
4445
};

src/concurrency/thread.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ use std::sync::atomic::Ordering::Relaxed;
55
use std::task::Poll;
66
use std::time::{Duration, SystemTime};
77

8-
use either::Either;
98
use rand::seq::IteratorRandom;
109
use rustc_abi::ExternAbi;
1110
use rustc_const_eval::CTRL_C_RECEIVED;
11+
use rustc_data_structures::either::Either;
1212
use rustc_data_structures::fx::FxHashMap;
1313
use rustc_hir::def_id::DefId;
1414
use rustc_index::{Idx, IndexVec};

0 commit comments

Comments
 (0)