diff --git a/Cargo.lock b/Cargo.lock index ec976b69016..bbfda0fa2c8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3067,6 +3067,7 @@ name = "rustbook" version = "0.1.0" dependencies = [ "clap", + "codespan", "codespan-reporting", "failure", "mdbook", diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index 18f6fda7608..d12ee2935eb 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -847,7 +847,13 @@ impl<'a> Builder<'a> { rustflags.arg("-Zforce-unstable-if-unmarked"); } - rustflags.arg("-Zexternal-macro-backtrace"); + // cfg(bootstrap): the flag was renamed from `-Zexternal-macro-backtrace` + // to `-Zmacro-backtrace`, keep only the latter after beta promotion. + if stage == 0 { + rustflags.arg("-Zexternal-macro-backtrace"); + } else { + rustflags.arg("-Zmacro-backtrace"); + } let want_rustdoc = self.doc_tests != DocTests::No; diff --git a/src/doc/rustc-guide b/src/doc/rustc-guide index 92baf7293dd..5bd60bc51ef 160000 --- a/src/doc/rustc-guide +++ b/src/doc/rustc-guide @@ -1 +1 @@ -Subproject commit 92baf7293dd2d418d2ac4b141b0faa822075d9f7 +Subproject commit 5bd60bc51efaec04e69e2e18b59678e2af066433 diff --git a/src/doc/unstable-book/src/language-features/generators.md b/src/doc/unstable-book/src/language-features/generators.md index 97cf58e57e6..8bc62418b39 100644 --- a/src/doc/unstable-book/src/language-features/generators.md +++ b/src/doc/unstable-book/src/language-features/generators.md @@ -37,11 +37,11 @@ fn main() { return "foo" }; - match Pin::new(&mut generator).resume() { + match Pin::new(&mut generator).resume(()) { GeneratorState::Yielded(1) => {} _ => panic!("unexpected value from resume"), } - match Pin::new(&mut generator).resume() { + match Pin::new(&mut generator).resume(()) { GeneratorState::Complete("foo") => {} _ => panic!("unexpected value from resume"), } @@ -71,9 +71,9 @@ fn main() { }; println!("1"); - Pin::new(&mut generator).resume(); + Pin::new(&mut generator).resume(()); println!("3"); - Pin::new(&mut generator).resume(); + Pin::new(&mut generator).resume(()); println!("5"); } ``` @@ -92,10 +92,10 @@ The `Generator` trait in `std::ops` currently looks like: # use std::ops::GeneratorState; # use std::pin::Pin; -pub trait Generator { +pub trait Generator { type Yield; type Return; - fn resume(self: Pin<&mut Self>) -> GeneratorState; + fn resume(self: Pin<&mut Self>, resume: R) -> GeneratorState; } ``` @@ -152,10 +152,6 @@ closure-like semantics. Namely: * Whenever a generator is dropped it will drop all captured environment variables. -Note that unlike closures, generators at this time cannot take any arguments. -That is, generators must always look like `|| { ... }`. This restriction may be -lifted at a future date, the design is ongoing! - ### Generators as state machines In the compiler, generators are currently compiled as state machines. Each @@ -179,8 +175,8 @@ fn main() { return ret }; - Pin::new(&mut generator).resume(); - Pin::new(&mut generator).resume(); + Pin::new(&mut generator).resume(()); + Pin::new(&mut generator).resume(()); } ``` @@ -205,7 +201,7 @@ fn main() { type Yield = i32; type Return = &'static str; - fn resume(mut self: Pin<&mut Self>) -> GeneratorState { + fn resume(mut self: Pin<&mut Self>, resume: ()) -> GeneratorState { use std::mem; match mem::replace(&mut *self, __Generator::Done) { __Generator::Start(s) => { @@ -228,8 +224,8 @@ fn main() { __Generator::Start(ret) }; - Pin::new(&mut generator).resume(); - Pin::new(&mut generator).resume(); + Pin::new(&mut generator).resume(()); + Pin::new(&mut generator).resume(()); } ``` diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs index 7e5efbe3078..d65aee09232 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -1104,6 +1104,7 @@ impl AsMut for Box { #[stable(feature = "pin", since = "1.33.0")] impl Unpin for Box {} +#[cfg(bootstrap)] #[unstable(feature = "generator_trait", issue = "43122")] impl Generator for Box { type Yield = G::Yield; @@ -1114,6 +1115,7 @@ impl Generator for Box { } } +#[cfg(bootstrap)] #[unstable(feature = "generator_trait", issue = "43122")] impl Generator for Pin> { type Yield = G::Yield; @@ -1124,6 +1126,28 @@ impl Generator for Pin> { } } +#[cfg(not(bootstrap))] +#[unstable(feature = "generator_trait", issue = "43122")] +impl + Unpin, R> Generator for Box { + type Yield = G::Yield; + type Return = G::Return; + + fn resume(mut self: Pin<&mut Self>, arg: R) -> GeneratorState { + G::resume(Pin::new(&mut *self), arg) + } +} + +#[cfg(not(bootstrap))] +#[unstable(feature = "generator_trait", issue = "43122")] +impl, R> Generator for Pin> { + type Yield = G::Yield; + type Return = G::Return; + + fn resume(mut self: Pin<&mut Self>, arg: R) -> GeneratorState { + G::resume((*self).as_mut(), arg) + } +} + #[stable(feature = "futures_api", since = "1.36.0")] impl Future for Box { type Output = F::Output; diff --git a/src/libcore/ops/generator.rs b/src/libcore/ops/generator.rs index 5401fff860e..4e43561996c 100644 --- a/src/libcore/ops/generator.rs +++ b/src/libcore/ops/generator.rs @@ -50,11 +50,11 @@ pub enum GeneratorState { /// return "foo" /// }; /// -/// match Pin::new(&mut generator).resume() { +/// match Pin::new(&mut generator).resume(()) { /// GeneratorState::Yielded(1) => {} /// _ => panic!("unexpected return from resume"), /// } -/// match Pin::new(&mut generator).resume() { +/// match Pin::new(&mut generator).resume(()) { /// GeneratorState::Complete("foo") => {} /// _ => panic!("unexpected return from resume"), /// } @@ -67,7 +67,7 @@ pub enum GeneratorState { #[lang = "generator"] #[unstable(feature = "generator_trait", issue = "43122")] #[fundamental] -pub trait Generator { +pub trait Generator<#[cfg(not(bootstrap))] R = ()> { /// The type of value this generator yields. /// /// This associated type corresponds to the `yield` expression and the @@ -110,9 +110,13 @@ pub trait Generator { /// been returned previously. While generator literals in the language are /// guaranteed to panic on resuming after `Complete`, this is not guaranteed /// for all implementations of the `Generator` trait. - fn resume(self: Pin<&mut Self>) -> GeneratorState; + fn resume( + self: Pin<&mut Self>, + #[cfg(not(bootstrap))] arg: R, + ) -> GeneratorState; } +#[cfg(bootstrap)] #[unstable(feature = "generator_trait", issue = "43122")] impl Generator for Pin<&mut G> { type Yield = G::Yield; @@ -123,6 +127,7 @@ impl Generator for Pin<&mut G> { } } +#[cfg(bootstrap)] #[unstable(feature = "generator_trait", issue = "43122")] impl Generator for &mut G { type Yield = G::Yield; @@ -132,3 +137,25 @@ impl Generator for &mut G { G::resume(Pin::new(&mut *self)) } } + +#[cfg(not(bootstrap))] +#[unstable(feature = "generator_trait", issue = "43122")] +impl, R> Generator for Pin<&mut G> { + type Yield = G::Yield; + type Return = G::Return; + + fn resume(mut self: Pin<&mut Self>, arg: R) -> GeneratorState { + G::resume((*self).as_mut(), arg) + } +} + +#[cfg(not(bootstrap))] +#[unstable(feature = "generator_trait", issue = "43122")] +impl + Unpin, R> Generator for &mut G { + type Yield = G::Yield; + type Return = G::Return; + + fn resume(mut self: Pin<&mut Self>, arg: R) -> GeneratorState { + G::resume(Pin::new(&mut *self), arg) + } +} diff --git a/src/libcore/option.rs b/src/libcore/option.rs index ad0491f888c..e35c91206b8 100644 --- a/src/libcore/option.rs +++ b/src/libcore/option.rs @@ -455,6 +455,12 @@ impl Option { /// Applies a function to the contained value (if any), /// or returns the provided default (if not). /// + /// Arguments passed to `map_or` are eagerly evaluated; if you are passing + /// the result of a function call, it is recommended to use [`map_or_else`], + /// which is lazily evaluated. + /// + /// [`map_or_else`]: #method.map_or_else + /// /// # Examples /// /// ``` diff --git a/src/libcore/result.rs b/src/libcore/result.rs index bc70dbd62eb..809d4bace8e 100644 --- a/src/libcore/result.rs +++ b/src/libcore/result.rs @@ -524,6 +524,12 @@ impl Result { /// Applies a function to the contained value (if any), /// or returns the provided default (if not). /// + /// Arguments passed to `map_or` are eagerly evaluated; if you are passing + /// the result of a function call, it is recommended to use [`map_or_else`], + /// which is lazily evaluated. + /// + /// [`map_or_else`]: #method.map_or_else + /// /// # Examples /// /// ``` diff --git a/src/librustc/infer/opaque_types/mod.rs b/src/librustc/infer/opaque_types/mod.rs index fe3a5d149f6..d28507f6eb2 100644 --- a/src/librustc/infer/opaque_types/mod.rs +++ b/src/librustc/infer/opaque_types/mod.rs @@ -744,6 +744,7 @@ where substs.as_generator().return_ty(def_id, self.tcx).visit_with(self); substs.as_generator().yield_ty(def_id, self.tcx).visit_with(self); + substs.as_generator().resume_ty(def_id, self.tcx).visit_with(self); } _ => { ty.super_visit_with(self); diff --git a/src/librustc/mir/mod.rs b/src/librustc/mir/mod.rs index 4e9835a52b7..f6c7174649f 100644 --- a/src/librustc/mir/mod.rs +++ b/src/librustc/mir/mod.rs @@ -1120,6 +1120,8 @@ pub enum TerminatorKind<'tcx> { value: Operand<'tcx>, /// Where to resume to. resume: BasicBlock, + /// The place to store the resume argument in. + resume_arg: Place<'tcx>, /// Cleanup to be done if the generator is dropped at this suspend point. drop: Option, }, @@ -2645,9 +2647,12 @@ impl<'tcx> TypeFoldable<'tcx> for Terminator<'tcx> { target, unwind, }, - Yield { ref value, resume, drop } => { - Yield { value: value.fold_with(folder), resume: resume, drop: drop } - } + Yield { ref value, resume, ref resume_arg, drop } => Yield { + value: value.fold_with(folder), + resume, + resume_arg: resume_arg.fold_with(folder), + drop, + }, Call { ref func, ref args, ref destination, cleanup, from_hir_call } => { let dest = destination.as_ref().map(|&(ref loc, dest)| (loc.fold_with(folder), dest)); diff --git a/src/librustc/mir/visit.rs b/src/librustc/mir/visit.rs index 4c5db1b07d2..2f094516a35 100644 --- a/src/librustc/mir/visit.rs +++ b/src/librustc/mir/visit.rs @@ -516,8 +516,14 @@ macro_rules! make_mir_visitor { TerminatorKind::Yield { value, resume: _, + resume_arg, drop: _, } => { + self.visit_place( + resume_arg, + PlaceContext::MutatingUse(MutatingUseContext::Store), + source_location, + ); self.visit_operand(value, source_location); } diff --git a/src/librustc/traits/util.rs b/src/librustc/traits/util.rs index ae1a5e3efa2..d4c3518260c 100644 --- a/src/librustc/traits/util.rs +++ b/src/librustc/traits/util.rs @@ -643,8 +643,10 @@ pub fn generator_trait_ref_and_outputs( self_ty: Ty<'tcx>, sig: ty::PolyGenSig<'tcx>, ) -> ty::Binder<(ty::TraitRef<'tcx>, Ty<'tcx>, Ty<'tcx>)> { - let trait_ref = - ty::TraitRef { def_id: fn_trait_def_id, substs: tcx.mk_substs_trait(self_ty, &[]) }; + let trait_ref = ty::TraitRef { + def_id: fn_trait_def_id, + substs: tcx.mk_substs_trait(self_ty, &[sig.skip_binder().resume_ty.into()]), + }; ty::Binder::bind((trait_ref, sig.skip_binder().yield_ty, sig.skip_binder().return_ty)) } diff --git a/src/librustc/ty/layout.rs b/src/librustc/ty/layout.rs index bda42db40b0..0a5ab790adb 100644 --- a/src/librustc/ty/layout.rs +++ b/src/librustc/ty/layout.rs @@ -2350,8 +2350,9 @@ impl<'tcx> ty::Instance<'tcx> { ]); let ret_ty = tcx.mk_adt(state_adt_ref, state_substs); - tcx.mk_fn_sig(iter::once(env_ty), - ret_ty, + tcx.mk_fn_sig( + [env_ty, sig.resume_ty].iter(), + &ret_ty, false, hir::Unsafety::Normal, rustc_target::spec::abi::Abi::Rust diff --git a/src/librustc/ty/structural_impls.rs b/src/librustc/ty/structural_impls.rs index c1ae4d9fe17..9d00d272263 100644 --- a/src/librustc/ty/structural_impls.rs +++ b/src/librustc/ty/structural_impls.rs @@ -598,8 +598,8 @@ impl<'a, 'tcx> Lift<'tcx> for ty::adjustment::AutoBorrow<'a> { impl<'a, 'tcx> Lift<'tcx> for ty::GenSig<'a> { type Lifted = ty::GenSig<'tcx>; fn lift_to_tcx(&self, tcx: TyCtxt<'tcx>) -> Option { - tcx.lift(&(self.yield_ty, self.return_ty)) - .map(|(yield_ty, return_ty)| ty::GenSig { yield_ty, return_ty }) + tcx.lift(&(self.resume_ty, self.yield_ty, self.return_ty)) + .map(|(resume_ty, yield_ty, return_ty)| ty::GenSig { resume_ty, yield_ty, return_ty }) } } diff --git a/src/librustc/ty/sty.rs b/src/librustc/ty/sty.rs index dffe86d9462..0d30395d250 100644 --- a/src/librustc/ty/sty.rs +++ b/src/librustc/ty/sty.rs @@ -346,9 +346,17 @@ static_assert_size!(TyKind<'_>, 24); /// ## Generators /// /// Generators are handled similarly in `GeneratorSubsts`. The set of -/// type parameters is similar, but the role of CK and CS are -/// different. CK represents the "yield type" and CS represents the -/// "return type" of the generator. +/// type parameters is similar, but `CK` and `CS` are replaced by the +/// following type parameters: +/// +/// * `GS`: The generator's "resume type", which is the type of the +/// argument passed to `resume`, and the type of `yield` expressions +/// inside the generator. +/// * `GY`: The "yield type", which is the type of values passed to +/// `yield` inside the generator. +/// * `GR`: The "return type", which is the type of value returned upon +/// completion of the generator. +/// * `GW`: The "generator witness". #[derive(Copy, Clone, Debug, TypeFoldable)] pub struct ClosureSubsts<'tcx> { /// Lifetime and type parameters from the enclosing function, @@ -442,6 +450,7 @@ pub struct GeneratorSubsts<'tcx> { } struct SplitGeneratorSubsts<'tcx> { + resume_ty: Ty<'tcx>, yield_ty: Ty<'tcx>, return_ty: Ty<'tcx>, witness: Ty<'tcx>, @@ -453,10 +462,11 @@ impl<'tcx> GeneratorSubsts<'tcx> { let generics = tcx.generics_of(def_id); let parent_len = generics.parent_count; SplitGeneratorSubsts { - yield_ty: self.substs.type_at(parent_len), - return_ty: self.substs.type_at(parent_len + 1), - witness: self.substs.type_at(parent_len + 2), - upvar_kinds: &self.substs[parent_len + 3..], + resume_ty: self.substs.type_at(parent_len), + yield_ty: self.substs.type_at(parent_len + 1), + return_ty: self.substs.type_at(parent_len + 2), + witness: self.substs.type_at(parent_len + 3), + upvar_kinds: &self.substs[parent_len + 4..], } } @@ -485,6 +495,11 @@ impl<'tcx> GeneratorSubsts<'tcx> { }) } + /// Returns the type representing the resume type of the generator. + pub fn resume_ty(self, def_id: DefId, tcx: TyCtxt<'_>) -> Ty<'tcx> { + self.split(def_id, tcx).resume_ty + } + /// Returns the type representing the yield type of the generator. pub fn yield_ty(self, def_id: DefId, tcx: TyCtxt<'_>) -> Ty<'tcx> { self.split(def_id, tcx).yield_ty @@ -505,10 +520,14 @@ impl<'tcx> GeneratorSubsts<'tcx> { ty::Binder::dummy(self.sig(def_id, tcx)) } - /// Returns the "generator signature", which consists of its yield + /// Returns the "generator signature", which consists of its resume, yield /// and return types. pub fn sig(self, def_id: DefId, tcx: TyCtxt<'_>) -> GenSig<'tcx> { - ty::GenSig { yield_ty: self.yield_ty(def_id, tcx), return_ty: self.return_ty(def_id, tcx) } + ty::GenSig { + resume_ty: self.resume_ty(def_id, tcx), + yield_ty: self.yield_ty(def_id, tcx), + return_ty: self.return_ty(def_id, tcx), + } } } @@ -1072,6 +1091,7 @@ impl<'tcx> ProjectionTy<'tcx> { #[derive(Clone, Debug, TypeFoldable)] pub struct GenSig<'tcx> { + pub resume_ty: Ty<'tcx>, pub yield_ty: Ty<'tcx>, pub return_ty: Ty<'tcx>, } @@ -1079,6 +1099,9 @@ pub struct GenSig<'tcx> { pub type PolyGenSig<'tcx> = Binder>; impl<'tcx> PolyGenSig<'tcx> { + pub fn resume_ty(&self) -> ty::Binder> { + self.map_bound_ref(|sig| sig.resume_ty) + } pub fn yield_ty(&self) -> ty::Binder> { self.map_bound_ref(|sig| sig.yield_ty) } diff --git a/src/librustc_ast_lowering/expr.rs b/src/librustc_ast_lowering/expr.rs index 5dc855e935c..dd3316979f6 100644 --- a/src/librustc_ast_lowering/expr.rs +++ b/src/librustc_ast_lowering/expr.rs @@ -688,12 +688,12 @@ impl<'hir> LoweringContext<'_, 'hir> { ) -> Option { match generator_kind { Some(hir::GeneratorKind::Gen) => { - if !decl.inputs.is_empty() { + if decl.inputs.len() > 1 { struct_span_err!( self.sess, fn_decl_span, E0628, - "generators cannot have explicit parameters" + "too many parameters for a generator (expected 0 or 1 parameters)" ) .emit(); } diff --git a/src/librustc_data_structures/box_region.rs b/src/librustc_data_structures/box_region.rs index 94abb89503c..dbc54291f40 100644 --- a/src/librustc_data_structures/box_region.rs +++ b/src/librustc_data_structures/box_region.rs @@ -25,6 +25,7 @@ pub struct PinnedGenerator { } impl PinnedGenerator { + #[cfg(bootstrap)] pub fn new, Return = R> + 'static>( generator: T, ) -> (I, Self) { @@ -39,6 +40,22 @@ impl PinnedGenerator { (init, result) } + #[cfg(not(bootstrap))] + pub fn new, Return = R> + 'static>( + generator: T, + ) -> (I, Self) { + let mut result = PinnedGenerator { generator: Box::pin(generator) }; + + // Run it to the first yield to set it up + let init = match Pin::new(&mut result.generator).resume(()) { + GeneratorState::Yielded(YieldType::Initial(y)) => y, + _ => panic!(), + }; + + (init, result) + } + + #[cfg(bootstrap)] pub unsafe fn access(&mut self, closure: *mut dyn FnMut()) { BOX_REGION_ARG.with(|i| { i.set(Action::Access(AccessAction(closure))); @@ -50,6 +67,19 @@ impl PinnedGenerator { } } + #[cfg(not(bootstrap))] + pub unsafe fn access(&mut self, closure: *mut dyn FnMut()) { + BOX_REGION_ARG.with(|i| { + i.set(Action::Access(AccessAction(closure))); + }); + + // Call the generator, which in turn will call the closure in BOX_REGION_ARG + if let GeneratorState::Complete(_) = Pin::new(&mut self.generator).resume(()) { + panic!() + } + } + + #[cfg(bootstrap)] pub fn complete(&mut self) -> R { // Tell the generator we want it to complete, consuming it and yielding a result BOX_REGION_ARG.with(|i| i.set(Action::Complete)); @@ -57,6 +87,15 @@ impl PinnedGenerator { let result = Pin::new(&mut self.generator).resume(); if let GeneratorState::Complete(r) = result { r } else { panic!() } } + + #[cfg(not(bootstrap))] + pub fn complete(&mut self) -> R { + // Tell the generator we want it to complete, consuming it and yielding a result + BOX_REGION_ARG.with(|i| i.set(Action::Complete)); + + let result = Pin::new(&mut self.generator).resume(()); + if let GeneratorState::Complete(r) = result { r } else { panic!() } + } } #[derive(PartialEq)] diff --git a/src/librustc_error_codes/error_codes/E0511.md b/src/librustc_error_codes/error_codes/E0511.md index 2d6ff8241e6..4f6644f3582 100644 --- a/src/librustc_error_codes/error_codes/E0511.md +++ b/src/librustc_error_codes/error_codes/E0511.md @@ -1,7 +1,7 @@ Invalid monomorphization of an intrinsic function was used. Erroneous code example: -```ignore (error-emitted-at-codegen-which-cannot-be-handled-by-compile_fail) +```compile_fail,E0511 #![feature(platform_intrinsics)] extern "platform-intrinsic" { diff --git a/src/librustc_error_codes/error_codes/E0534.md b/src/librustc_error_codes/error_codes/E0534.md index e50b84764b4..0afa4a8c958 100644 --- a/src/librustc_error_codes/error_codes/E0534.md +++ b/src/librustc_error_codes/error_codes/E0534.md @@ -2,7 +2,7 @@ The `inline` attribute was malformed. Erroneous code example: -```ignore (compile_fail not working here; see Issue #43707) +```compile_fail,E0534 #[inline()] // error: expected one argument pub fn something() {} diff --git a/src/librustc_error_codes/error_codes/E0535.md b/src/librustc_error_codes/error_codes/E0535.md index e9abfe5dda1..035d395b76f 100644 --- a/src/librustc_error_codes/error_codes/E0535.md +++ b/src/librustc_error_codes/error_codes/E0535.md @@ -2,7 +2,7 @@ An unknown argument was given to the `inline` attribute. Erroneous code example: -```ignore (compile_fail not working here; see Issue #43707) +```compile_fail,E0535 #[inline(unknown)] // error: invalid argument pub fn something() {} diff --git a/src/librustc_error_codes/error_codes/E0565.md b/src/librustc_error_codes/error_codes/E0565.md index 1faedf45932..d5bba941c1d 100644 --- a/src/librustc_error_codes/error_codes/E0565.md +++ b/src/librustc_error_codes/error_codes/E0565.md @@ -2,9 +2,11 @@ A literal was used in a built-in attribute that doesn't support literals. Erroneous code example: -```ignore (compile_fail not working here; see Issue #43707) -#[inline("always")] // error: unsupported literal -pub fn something() {} +```compile_fail,E0565 +#[repr("C")] // error: meta item in `repr` must be an identifier +struct Repr {} + +fn main() {} ``` Literals in attributes are new and largely unsupported in built-in attributes. @@ -12,6 +14,8 @@ Work to support literals where appropriate is ongoing. Try using an unquoted name instead: ``` -#[inline(always)] -pub fn something() {} +#[repr(C)] // ok! +struct Repr {} + +fn main() {} ``` diff --git a/src/librustc_error_codes/error_codes/E0626.md b/src/librustc_error_codes/error_codes/E0626.md index db50bd7ac4f..cc6e03d1ca7 100644 --- a/src/librustc_error_codes/error_codes/E0626.md +++ b/src/librustc_error_codes/error_codes/E0626.md @@ -12,7 +12,7 @@ let mut b = || { yield (); // ...is still in scope here, when the yield occurs. println!("{}", a); }; -Pin::new(&mut b).resume(); +Pin::new(&mut b).resume(()); ``` At present, it is not permitted to have a yield that occurs while a @@ -31,7 +31,7 @@ let mut b = || { yield (); println!("{}", a); }; -Pin::new(&mut b).resume(); +Pin::new(&mut b).resume(()); ``` This is a very simple case, of course. In more complex cases, we may @@ -50,7 +50,7 @@ let mut b = || { yield x; // ...when this yield occurs. } }; -Pin::new(&mut b).resume(); +Pin::new(&mut b).resume(()); ``` Such cases can sometimes be resolved by iterating "by value" (or using @@ -66,7 +66,7 @@ let mut b = || { yield x; // <-- Now yield is OK. } }; -Pin::new(&mut b).resume(); +Pin::new(&mut b).resume(()); ``` If taking ownership is not an option, using indices can work too: @@ -83,7 +83,7 @@ let mut b = || { yield x; // <-- Now yield is OK. } }; -Pin::new(&mut b).resume(); +Pin::new(&mut b).resume(()); // (*) -- Unfortunately, these temporaries are currently required. // See . diff --git a/src/librustc_error_codes/error_codes/E0633.md b/src/librustc_error_codes/error_codes/E0633.md index 65cdf90036a..7f488cde664 100644 --- a/src/librustc_error_codes/error_codes/E0633.md +++ b/src/librustc_error_codes/error_codes/E0633.md @@ -2,7 +2,9 @@ The `unwind` attribute was malformed. Erroneous code example: -```ignore (compile_fail not working here; see Issue #43707) +```compile_fail,E0633 +#![feature(unwind_attributes)] + #[unwind()] // error: expected one argument pub extern fn something() {} diff --git a/src/librustc_error_codes/error_codes/E0668.md b/src/librustc_error_codes/error_codes/E0668.md index 2621a31a9e0..f5d26244fb9 100644 --- a/src/librustc_error_codes/error_codes/E0668.md +++ b/src/librustc_error_codes/error_codes/E0668.md @@ -6,7 +6,7 @@ assembly call. In particular, it can happen if you forgot the closing bracket of a register constraint (see issue #51430): -```ignore (error-emitted-at-codegen-which-cannot-be-handled-by-compile_fail) +```compile_fail,E0668 #![feature(asm)] fn main() { diff --git a/src/librustc_errors/annotate_snippet_emitter_writer.rs b/src/librustc_errors/annotate_snippet_emitter_writer.rs index 009ab6ac5b1..d83175694f4 100644 --- a/src/librustc_errors/annotate_snippet_emitter_writer.rs +++ b/src/librustc_errors/annotate_snippet_emitter_writer.rs @@ -23,7 +23,7 @@ pub struct AnnotateSnippetEmitterWriter { /// If true, will normalize line numbers with `LL` to prevent noise in UI test diffs. ui_testing: bool, - external_macro_backtrace: bool, + macro_backtrace: bool, } impl Emitter for AnnotateSnippetEmitterWriter { @@ -32,12 +32,12 @@ impl Emitter for AnnotateSnippetEmitterWriter { let mut children = diag.children.clone(); let (mut primary_span, suggestions) = self.primary_span_formatted(&diag); - self.fix_multispans_in_std_macros( + self.fix_multispans_in_extern_macros_and_render_macro_backtrace( &self.source_map, &mut primary_span, &mut children, &diag.level, - self.external_macro_backtrace, + self.macro_backtrace, ); self.emit_messages_default( @@ -172,9 +172,9 @@ impl AnnotateSnippetEmitterWriter { pub fn new( source_map: Option>, short_message: bool, - external_macro_backtrace: bool, + macro_backtrace: bool, ) -> Self { - Self { source_map, short_message, ui_testing: false, external_macro_backtrace } + Self { source_map, short_message, ui_testing: false, macro_backtrace } } /// Allows to modify `Self` to enable or disable the `ui_testing` flag. diff --git a/src/librustc_errors/emitter.rs b/src/librustc_errors/emitter.rs index 1fcb36a2a30..f3653da4be6 100644 --- a/src/librustc_errors/emitter.rs +++ b/src/librustc_errors/emitter.rs @@ -14,7 +14,6 @@ use rustc_span::{MultiSpan, SourceFile, Span}; use crate::snippet::{Annotation, AnnotationType, Line, MultilineAnnotation, Style, StyledString}; use crate::styled_buffer::StyledBuffer; -use crate::Level::Error; use crate::{ pluralize, CodeSuggestion, Diagnostic, DiagnosticId, Level, SubDiagnostic, SuggestionStyle, }; @@ -27,6 +26,7 @@ use std::borrow::Cow; use std::cmp::{max, min, Reverse}; use std::io; use std::io::prelude::*; +use std::iter; use std::path::Path; use termcolor::{Ansi, BufferWriter, ColorChoice, ColorSpec, StandardStream}; use termcolor::{Buffer, Color, WriteColor}; @@ -54,19 +54,11 @@ impl HumanReadableErrorType { source_map: Option>, teach: bool, terminal_width: Option, - external_macro_backtrace: bool, + macro_backtrace: bool, ) -> EmitterWriter { let (short, color_config) = self.unzip(); let color = color_config.suggests_using_colors(); - EmitterWriter::new( - dst, - source_map, - short, - teach, - color, - terminal_width, - external_macro_backtrace, - ) + EmitterWriter::new(dst, source_map, short, teach, color, terminal_width, macro_backtrace) } } @@ -280,10 +272,7 @@ pub trait Emitter { } } - // This does a small "fix" for multispans by looking to see if it can find any that - // point directly at <*macros>. Since these are often difficult to read, this - // will change the span to point at the use site. - fn fix_multispans_in_std_macros( + fn fix_multispans_in_extern_macros_and_render_macro_backtrace( &self, source_map: &Option>, span: &mut MultiSpan, @@ -291,127 +280,187 @@ pub trait Emitter { level: &Level, backtrace: bool, ) { - let mut spans_updated = self.fix_multispan_in_std_macros(source_map, span, backtrace); - for child in children.iter_mut() { - spans_updated |= - self.fix_multispan_in_std_macros(source_map, &mut child.span, backtrace); - } - let msg = if level == &Error { - "this error originates in a macro outside of the current crate \ - (in Nightly builds, run with -Z external-macro-backtrace \ - for more info)" - .to_string() - } else { - "this warning originates in a macro outside of the current crate \ - (in Nightly builds, run with -Z external-macro-backtrace \ - for more info)" - .to_string() - }; + // Check for spans in macros, before `fix_multispans_in_extern_macros` + // has a chance to replace them. + let has_macro_spans = iter::once(&*span) + .chain(children.iter().map(|child| &child.span)) + .flat_map(|span| span.primary_spans()) + .copied() + .flat_map(|sp| { + sp.macro_backtrace().filter_map(|expn_data| { + match expn_data.kind { + ExpnKind::Root => None, - if spans_updated { - children.push(SubDiagnostic { - level: Level::Note, - message: vec![(msg, Style::NoStyle)], - span: MultiSpan::new(), - render_span: None, - }); + // Skip past non-macro entries, just in case there + // are some which do actually involve macros. + ExpnKind::Desugaring(..) | ExpnKind::AstPass(..) => None, + + ExpnKind::Macro(macro_kind, _) => Some(macro_kind), + } + }) + }) + .next(); + + if !backtrace { + self.fix_multispans_in_extern_macros(source_map, span, children); + } + + self.render_multispans_macro_backtrace(span, children, backtrace); + + if !backtrace { + if let Some(macro_kind) = has_macro_spans { + let msg = format!( + "this {} originates in {} {} \ + (in Nightly builds, run with -Z macro-backtrace for more info)", + level, + macro_kind.article(), + macro_kind.descr(), + ); + + children.push(SubDiagnostic { + level: Level::Note, + message: vec![(msg, Style::NoStyle)], + span: MultiSpan::new(), + render_span: None, + }); + } } } - // This "fixes" MultiSpans that contain Spans that are pointing to locations inside of - // <*macros>. Since these locations are often difficult to read, we move these Spans from - // <*macros> to their corresponding use site. - fn fix_multispan_in_std_macros( + fn render_multispans_macro_backtrace( &self, - source_map: &Option>, span: &mut MultiSpan, - always_backtrace: bool, - ) -> bool { - let sm = match source_map { - Some(ref sm) => sm, - None => return false, - }; + children: &mut Vec, + backtrace: bool, + ) { + for span in iter::once(span).chain(children.iter_mut().map(|child| &mut child.span)) { + self.render_multispan_macro_backtrace(span, backtrace); + } + } - let mut before_after: Vec<(Span, Span)> = vec![]; + fn render_multispan_macro_backtrace(&self, span: &mut MultiSpan, always_backtrace: bool) { let mut new_labels: Vec<(Span, String)> = vec![]; - // First, find all the spans in <*macros> and point instead at their use site - for sp in span.primary_spans() { + for &sp in span.primary_spans() { if sp.is_dummy() { continue; } - let call_sp = sm.call_span_if_macro(*sp); - if call_sp != *sp && !always_backtrace { - before_after.push((*sp, call_sp)); - } + + // FIXME(eddyb) use `retain` on `macro_backtrace` to remove all the + // entries we don't want to print, to make sure the indices being + // printed are contiguous (or omitted if there's only one entry). let macro_backtrace: Vec<_> = sp.macro_backtrace().collect(); - let backtrace_len = macro_backtrace.len(); for (i, trace) in macro_backtrace.iter().rev().enumerate() { - // Only show macro locations that are local - // and display them like a span_note if trace.def_site.is_dummy() { continue; } + if always_backtrace { new_labels.push(( trace.def_site, format!( "in this expansion of `{}`{}", trace.kind.descr(), - if backtrace_len > 2 { - // if backtrace_len == 1 it'll be pointed - // at by "in this macro invocation" + if macro_backtrace.len() > 2 { + // if macro_backtrace.len() == 1 it'll be + // pointed at by "in this macro invocation" format!(" (#{})", i + 1) } else { String::new() - } + }, ), )); } - // Check to make sure we're not in any <*macros> - if !sm.span_to_filename(trace.def_site).is_macros() - && matches!(trace.kind, ExpnKind::Macro(MacroKind::Bang, _)) + + // Don't add a label on the call site if the diagnostic itself + // already points to (a part of) that call site, as the label + // is meant for showing the relevant invocation when the actual + // diagnostic is pointing to some part of macro definition. + // + // This also handles the case where an external span got replaced + // with the call site span by `fix_multispans_in_extern_macros`. + // + // NB: `-Zmacro-backtrace` overrides this, for uniformity, as the + // "in this expansion of" label above is always added in that mode, + // and it needs an "in this macro invocation" label to match that. + let redundant_span = trace.call_site.contains(sp); + + if !redundant_span && matches!(trace.kind, ExpnKind::Macro(MacroKind::Bang, _)) || always_backtrace { new_labels.push(( trace.call_site, format!( "in this macro invocation{}", - if backtrace_len > 2 && always_backtrace { + if macro_backtrace.len() > 2 && always_backtrace { // only specify order when the macro // backtrace is multiple levels deep format!(" (#{})", i + 1) } else { String::new() - } + }, ), )); - if !always_backtrace { - break; - } + } + if !always_backtrace { + break; } } } + for (label_span, label_text) in new_labels { span.push_span_label(label_span, label_text); } - for sp_label in span.span_labels() { - if sp_label.span.is_dummy() { - continue; - } - if sm.span_to_filename(sp_label.span.clone()).is_macros() && !always_backtrace { - if let Some(use_site) = sp_label.span.macro_backtrace().last() { - before_after.push((sp_label.span, use_site.call_site)); - } - } - } - // After we have them, make sure we replace these 'bad' def sites with their use sites - let spans_updated = !before_after.is_empty(); - for (before, after) in before_after { - span.replace(before, after); - } + } - spans_updated + // This does a small "fix" for multispans by looking to see if it can find any that + // point directly at <*macros>. Since these are often difficult to read, this + // will change the span to point at the use site. + fn fix_multispans_in_extern_macros( + &self, + source_map: &Option>, + span: &mut MultiSpan, + children: &mut Vec, + ) { + for span in iter::once(span).chain(children.iter_mut().map(|child| &mut child.span)) { + self.fix_multispan_in_extern_macros(source_map, span); + } + } + + // This "fixes" MultiSpans that contain Spans that are pointing to locations inside of + // <*macros>. Since these locations are often difficult to read, we move these Spans from + // <*macros> to their corresponding use site. + fn fix_multispan_in_extern_macros( + &self, + source_map: &Option>, + span: &mut MultiSpan, + ) { + let sm = match source_map { + Some(ref sm) => sm, + None => return, + }; + + // First, find all the spans in <*macros> and point instead at their use site + let replacements: Vec<(Span, Span)> = span + .primary_spans() + .iter() + .copied() + .chain(span.span_labels().iter().map(|sp_label| sp_label.span)) + .filter_map(|sp| { + if !sp.is_dummy() && sm.span_to_filename(sp).is_macros() { + let maybe_callsite = sp.source_callsite(); + if sp != maybe_callsite { + return Some((sp, maybe_callsite)); + } + } + None + }) + .collect(); + + // After we have them, make sure we replace these 'bad' def sites with their use sites + for (from, to) in replacements { + span.replace(from, to); + } } } @@ -424,12 +473,12 @@ impl Emitter for EmitterWriter { let mut children = diag.children.clone(); let (mut primary_span, suggestions) = self.primary_span_formatted(&diag); - self.fix_multispans_in_std_macros( + self.fix_multispans_in_extern_macros_and_render_macro_backtrace( &self.sm, &mut primary_span, &mut children, &diag.level, - self.external_macro_backtrace, + self.macro_backtrace, ); self.emit_messages_default( @@ -508,7 +557,7 @@ pub struct EmitterWriter { ui_testing: bool, terminal_width: Option, - external_macro_backtrace: bool, + macro_backtrace: bool, } #[derive(Debug)] @@ -525,7 +574,7 @@ impl EmitterWriter { short_message: bool, teach: bool, terminal_width: Option, - external_macro_backtrace: bool, + macro_backtrace: bool, ) -> EmitterWriter { let dst = Destination::from_stderr(color_config); EmitterWriter { @@ -535,7 +584,7 @@ impl EmitterWriter { teach, ui_testing: false, terminal_width, - external_macro_backtrace, + macro_backtrace, } } @@ -546,7 +595,7 @@ impl EmitterWriter { teach: bool, colored: bool, terminal_width: Option, - external_macro_backtrace: bool, + macro_backtrace: bool, ) -> EmitterWriter { EmitterWriter { dst: Raw(dst, colored), @@ -555,7 +604,7 @@ impl EmitterWriter { teach, ui_testing: false, terminal_width, - external_macro_backtrace, + macro_backtrace, } } diff --git a/src/librustc_errors/json.rs b/src/librustc_errors/json.rs index 3ddf9b09893..ffdff6acec5 100644 --- a/src/librustc_errors/json.rs +++ b/src/librustc_errors/json.rs @@ -36,7 +36,7 @@ pub struct JsonEmitter { pretty: bool, ui_testing: bool, json_rendered: HumanReadableErrorType, - external_macro_backtrace: bool, + macro_backtrace: bool, } impl JsonEmitter { @@ -45,7 +45,7 @@ impl JsonEmitter { source_map: Lrc, pretty: bool, json_rendered: HumanReadableErrorType, - external_macro_backtrace: bool, + macro_backtrace: bool, ) -> JsonEmitter { JsonEmitter { dst: Box::new(io::stderr()), @@ -54,14 +54,14 @@ impl JsonEmitter { pretty, ui_testing: false, json_rendered, - external_macro_backtrace, + macro_backtrace, } } pub fn basic( pretty: bool, json_rendered: HumanReadableErrorType, - external_macro_backtrace: bool, + macro_backtrace: bool, ) -> JsonEmitter { let file_path_mapping = FilePathMapping::empty(); JsonEmitter::stderr( @@ -69,7 +69,7 @@ impl JsonEmitter { Lrc::new(SourceMap::new(file_path_mapping)), pretty, json_rendered, - external_macro_backtrace, + macro_backtrace, ) } @@ -79,7 +79,7 @@ impl JsonEmitter { source_map: Lrc, pretty: bool, json_rendered: HumanReadableErrorType, - external_macro_backtrace: bool, + macro_backtrace: bool, ) -> JsonEmitter { JsonEmitter { dst, @@ -88,7 +88,7 @@ impl JsonEmitter { pretty, ui_testing: false, json_rendered, - external_macro_backtrace, + macro_backtrace, } } @@ -245,13 +245,7 @@ impl Diagnostic { let buf = BufWriter::default(); let output = buf.clone(); je.json_rendered - .new_emitter( - Box::new(buf), - Some(je.sm.clone()), - false, - None, - je.external_macro_backtrace, - ) + .new_emitter(Box::new(buf), Some(je.sm.clone()), false, None, je.macro_backtrace) .ui_testing(je.ui_testing) .emit_diagnostic(diag); let output = Arc::try_unwrap(output.0).unwrap().into_inner().unwrap(); diff --git a/src/librustc_errors/lib.rs b/src/librustc_errors/lib.rs index 17b293401f8..97667febc3c 100644 --- a/src/librustc_errors/lib.rs +++ b/src/librustc_errors/lib.rs @@ -336,9 +336,9 @@ pub struct HandlerFlags { /// If true, immediately print bugs registered with `delay_span_bug`. /// (rustc: see `-Z report-delayed-bugs`) pub report_delayed_bugs: bool, - /// show macro backtraces even for non-local macros. - /// (rustc: see `-Z external-macro-backtrace`) - pub external_macro_backtrace: bool, + /// Show macro backtraces. + /// (rustc: see `-Z macro-backtrace`) + pub macro_backtrace: bool, /// If true, identical diagnostics are reported only once. pub deduplicate_diagnostics: bool, } @@ -385,7 +385,7 @@ impl Handler { false, false, None, - flags.external_macro_backtrace, + flags.macro_backtrace, )); Self::with_emitter_and_flags(emitter, flags) } diff --git a/src/librustc_mir/borrow_check/invalidation.rs b/src/librustc_mir/borrow_check/invalidation.rs index bb56c11872a..392f164d314 100644 --- a/src/librustc_mir/borrow_check/invalidation.rs +++ b/src/librustc_mir/borrow_check/invalidation.rs @@ -159,7 +159,7 @@ impl<'cx, 'tcx> Visitor<'tcx> for InvalidationGenerator<'cx, 'tcx> { self.consume_operand(location, index); } } - TerminatorKind::Yield { ref value, resume, drop: _ } => { + TerminatorKind::Yield { ref value, resume, resume_arg, drop: _ } => { self.consume_operand(location, value); // Invalidate all borrows of local places @@ -170,6 +170,8 @@ impl<'cx, 'tcx> Visitor<'tcx> for InvalidationGenerator<'cx, 'tcx> { self.all_facts.invalidates.push((resume, i)); } } + + self.mutate_place(location, resume_arg, Deep, JustWrite); } TerminatorKind::Resume | TerminatorKind::Return | TerminatorKind::GeneratorDrop => { // Invalidate all borrows of local places diff --git a/src/librustc_mir/borrow_check/mod.rs b/src/librustc_mir/borrow_check/mod.rs index 717359d75c3..e528159fcef 100644 --- a/src/librustc_mir/borrow_check/mod.rs +++ b/src/librustc_mir/borrow_check/mod.rs @@ -684,7 +684,7 @@ impl<'cx, 'tcx> DataflowResultsConsumer<'cx, 'tcx> for MirBorrowckCtxt<'cx, 'tcx } } - TerminatorKind::Yield { ref value, resume: _, drop: _ } => { + TerminatorKind::Yield { ref value, resume: _, ref resume_arg, drop: _ } => { self.consume_operand(loc, (value, span), flow_state); if self.movable_generator { @@ -697,6 +697,8 @@ impl<'cx, 'tcx> DataflowResultsConsumer<'cx, 'tcx> for MirBorrowckCtxt<'cx, 'tcx } }); } + + self.mutate_place(loc, (resume_arg, span), Deep, JustWrite, flow_state); } TerminatorKind::Resume | TerminatorKind::Return | TerminatorKind::GeneratorDrop => { diff --git a/src/librustc_mir/borrow_check/universal_regions.rs b/src/librustc_mir/borrow_check/universal_regions.rs index 6e36508ed60..f6e3ca2f809 100644 --- a/src/librustc_mir/borrow_check/universal_regions.rs +++ b/src/librustc_mir/borrow_check/universal_regions.rs @@ -581,9 +581,11 @@ impl<'cx, 'tcx> UniversalRegionsBuilder<'cx, 'tcx> { DefiningTy::Generator(def_id, substs, movability) => { assert_eq!(self.mir_def_id, def_id); + let resume_ty = substs.as_generator().resume_ty(def_id, tcx); let output = substs.as_generator().return_ty(def_id, tcx); let generator_ty = tcx.mk_generator(def_id, substs, movability); - let inputs_and_output = self.infcx.tcx.intern_type_list(&[generator_ty, output]); + let inputs_and_output = + self.infcx.tcx.intern_type_list(&[generator_ty, resume_ty, output]); ty::Binder::dummy(inputs_and_output) } diff --git a/src/librustc_mir/dataflow/impls/storage_liveness.rs b/src/librustc_mir/dataflow/impls/storage_liveness.rs index 6a48d1e9803..040c13e8210 100644 --- a/src/librustc_mir/dataflow/impls/storage_liveness.rs +++ b/src/librustc_mir/dataflow/impls/storage_liveness.rs @@ -31,10 +31,12 @@ impl<'a, 'tcx> BitDenotation<'tcx> for MaybeStorageLive<'a, 'tcx> { self.body.local_decls.len() } - fn start_block_effect(&self, _on_entry: &mut BitSet) { - // Nothing is live on function entry (generators only have a self - // argument, and we don't care about that) - assert_eq!(1, self.body.arg_count); + fn start_block_effect(&self, on_entry: &mut BitSet) { + // The resume argument is live on function entry (we don't care about + // the `self` argument) + for arg in self.body.args_iter().skip(1) { + on_entry.insert(arg); + } } fn statement_effect(&self, trans: &mut GenKillSet, loc: Location) { @@ -100,10 +102,12 @@ impl<'mir, 'tcx> BitDenotation<'tcx> for RequiresStorage<'mir, 'tcx> { self.body.local_decls.len() } - fn start_block_effect(&self, _sets: &mut BitSet) { - // Nothing is live on function entry (generators only have a self - // argument, and we don't care about that) - assert_eq!(1, self.body.arg_count); + fn start_block_effect(&self, on_entry: &mut BitSet) { + // The resume argument is live on function entry (we don't care about + // the `self` argument) + for arg in self.body.args_iter().skip(1) { + on_entry.insert(arg); + } } fn before_statement_effect(&self, sets: &mut GenKillSet, loc: Location) { diff --git a/src/librustc_mir/dataflow/move_paths/builder.rs b/src/librustc_mir/dataflow/move_paths/builder.rs index 62af196174f..6f8caca5e21 100644 --- a/src/librustc_mir/dataflow/move_paths/builder.rs +++ b/src/librustc_mir/dataflow/move_paths/builder.rs @@ -380,7 +380,9 @@ impl<'b, 'a, 'tcx> Gatherer<'b, 'a, 'tcx> { self.gather_operand(discr); } - TerminatorKind::Yield { ref value, .. } => { + TerminatorKind::Yield { ref value, resume_arg: ref place, .. } => { + self.create_move_path(place); + self.gather_init(place.as_ref(), InitKind::Deep); self.gather_operand(value); } diff --git a/src/librustc_mir/transform/generator.rs b/src/librustc_mir/transform/generator.rs index 1c86d6f3f65..a6fc6573178 100644 --- a/src/librustc_mir/transform/generator.rs +++ b/src/librustc_mir/transform/generator.rs @@ -192,9 +192,10 @@ const RETURNED: usize = GeneratorSubsts::RETURNED; /// Generator has been poisoned const POISONED: usize = GeneratorSubsts::POISONED; -struct SuspensionPoint { +struct SuspensionPoint<'tcx> { state: usize, resume: BasicBlock, + resume_arg: Place<'tcx>, drop: Option, storage_liveness: liveness::LiveVarSet, } @@ -216,7 +217,7 @@ struct TransformVisitor<'tcx> { storage_liveness: FxHashMap, // A list of suspension points, generated during the transform - suspension_points: Vec, + suspension_points: Vec>, // The original RETURN_PLACE local new_ret_local: Local, @@ -303,8 +304,8 @@ impl MutVisitor<'tcx> for TransformVisitor<'tcx> { Operand::Move(Place::from(self.new_ret_local)), None, )), - TerminatorKind::Yield { ref value, resume, drop } => { - Some((VariantIdx::new(0), Some(resume), value.clone(), drop)) + TerminatorKind::Yield { ref value, resume, resume_arg, drop } => { + Some((VariantIdx::new(0), Some((resume, resume_arg)), value.clone(), drop)) } _ => None, }; @@ -319,13 +320,14 @@ impl MutVisitor<'tcx> for TransformVisitor<'tcx> { self.make_state(state_idx, v), )), }); - let state = if let Some(resume) = resume { + let state = if let Some((resume, resume_arg)) = resume { // Yield let state = 3 + self.suspension_points.len(); self.suspension_points.push(SuspensionPoint { state, resume, + resume_arg, drop, storage_liveness: self.storage_liveness.get(&block).unwrap().clone(), }); @@ -378,28 +380,35 @@ fn make_generator_state_argument_pinned<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body PinArgVisitor { ref_gen_ty, tcx }.visit_body(body); } -fn replace_result_variable<'tcx>( - ret_ty: Ty<'tcx>, +/// Allocates a new local and replaces all references of `local` with it. Returns the new local. +/// +/// `local` will be changed to a new local decl with type `ty`. +/// +/// Note that the new local will be uninitialized. It is the caller's responsibility to assign some +/// valid value to it before its first use. +fn replace_local<'tcx>( + local: Local, + ty: Ty<'tcx>, body: &mut BodyAndCache<'tcx>, tcx: TyCtxt<'tcx>, ) -> Local { let source_info = source_info(body); - let new_ret = LocalDecl { + let new_decl = LocalDecl { mutability: Mutability::Mut, - ty: ret_ty, + ty, user_ty: UserTypeProjections::none(), source_info, internal: false, is_block_tail: None, local_info: LocalInfo::Other, }; - let new_ret_local = Local::new(body.local_decls.len()); - body.local_decls.push(new_ret); - body.local_decls.swap(RETURN_PLACE, new_ret_local); + let new_local = Local::new(body.local_decls.len()); + body.local_decls.push(new_decl); + body.local_decls.swap(local, new_local); - RenameLocalVisitor { from: RETURN_PLACE, to: new_ret_local, tcx }.visit_body(body); + RenameLocalVisitor { from: local, to: new_local, tcx }.visit_body(body); - new_ret_local + new_local } struct StorageIgnored(liveness::LiveVarSet); @@ -792,6 +801,10 @@ fn compute_layout<'tcx>( (remap, layout, storage_liveness) } +/// Replaces the entry point of `body` with a block that switches on the generator discriminant and +/// dispatches to blocks according to `cases`. +/// +/// After this function, the former entry point of the function will be bb1. fn insert_switch<'tcx>( body: &mut BodyAndCache<'tcx>, cases: Vec<(usize, BasicBlock)>, @@ -885,10 +898,11 @@ fn create_generator_drop_shim<'tcx>( drop_clean: BasicBlock, ) -> BodyAndCache<'tcx> { let mut body = body.clone(); + body.arg_count = 1; // make sure the resume argument is not included here let source_info = source_info(&body); - let mut cases = create_cases(&mut body, transform, |point| point.drop); + let mut cases = create_cases(&mut body, transform, Operation::Drop); cases.insert(0, (UNRESUMED, drop_clean)); @@ -1006,7 +1020,7 @@ fn create_generator_resume_function<'tcx>( } } - let mut cases = create_cases(body, &transform, |point| Some(point.resume)); + let mut cases = create_cases(body, &transform, Operation::Resume); use rustc::mir::interpret::PanicInfo::{ResumedAfterPanic, ResumedAfterReturn}; @@ -1056,14 +1070,27 @@ fn insert_clean_drop(body: &mut BodyAndCache<'_>) -> BasicBlock { drop_clean } -fn create_cases<'tcx, F>( +/// An operation that can be performed on a generator. +#[derive(PartialEq, Copy, Clone)] +enum Operation { + Resume, + Drop, +} + +impl Operation { + fn target_block(self, point: &SuspensionPoint<'_>) -> Option { + match self { + Operation::Resume => Some(point.resume), + Operation::Drop => point.drop, + } + } +} + +fn create_cases<'tcx>( body: &mut BodyAndCache<'tcx>, transform: &TransformVisitor<'tcx>, - target: F, -) -> Vec<(usize, BasicBlock)> -where - F: Fn(&SuspensionPoint) -> Option, -{ + operation: Operation, +) -> Vec<(usize, BasicBlock)> { let source_info = source_info(body); transform @@ -1071,12 +1098,19 @@ where .iter() .filter_map(|point| { // Find the target for this suspension point, if applicable - target(point).map(|target| { + operation.target_block(point).map(|target| { let block = BasicBlock::new(body.basic_blocks().len()); let mut statements = Vec::new(); // Create StorageLive instructions for locals with live storage for i in 0..(body.local_decls.len()) { + if i == 2 { + // The resume argument is live on function entry. Don't insert a + // `StorageLive`, or the following `Assign` will read from uninitialized + // memory. + continue; + } + let l = Local::new(i); if point.storage_liveness.contains(l) && !transform.remap.contains_key(&l) { statements @@ -1084,6 +1118,18 @@ where } } + if operation == Operation::Resume { + // Move the resume argument to the destination place of the `Yield` terminator + let resume_arg = Local::new(2); // 0 = return, 1 = self + statements.push(Statement { + source_info, + kind: StatementKind::Assign(box ( + point.resume_arg, + Rvalue::Use(Operand::Move(resume_arg.into())), + )), + }); + } + // Then jump to the real target body.basic_blocks_mut().push(BasicBlockData { statements, @@ -1138,7 +1184,29 @@ impl<'tcx> MirPass<'tcx> for StateTransform { // We rename RETURN_PLACE which has type mir.return_ty to new_ret_local // RETURN_PLACE then is a fresh unused local with type ret_ty. - let new_ret_local = replace_result_variable(ret_ty, body, tcx); + let new_ret_local = replace_local(RETURN_PLACE, ret_ty, body, tcx); + + // We also replace the resume argument and insert an `Assign`. + // This is needed because the resume argument `_2` might be live across a `yield`, in which + // case there is no `Assign` to it that the transform can turn into a store to the generator + // state. After the yield the slot in the generator state would then be uninitialized. + let resume_local = Local::new(2); + let new_resume_local = + replace_local(resume_local, body.local_decls[resume_local].ty, body, tcx); + + // When first entering the generator, move the resume argument into its new local. + let source_info = source_info(body); + let stmts = &mut body.basic_blocks_mut()[BasicBlock::new(0)].statements; + stmts.insert( + 0, + Statement { + source_info, + kind: StatementKind::Assign(box ( + new_resume_local.into(), + Rvalue::Use(Operand::Move(resume_local.into())), + )), + }, + ); // Extract locals which are live across suspension point into `layout` // `remap` gives a mapping from local indices onto generator struct indices @@ -1162,9 +1230,9 @@ impl<'tcx> MirPass<'tcx> for StateTransform { }; transform.visit_body(body); - // Update our MIR struct to reflect the changed we've made + // Update our MIR struct to reflect the changes we've made body.yield_ty = None; - body.arg_count = 1; + body.arg_count = 2; // self, resume arg body.spread_arg = None; body.generator_layout = Some(layout); diff --git a/src/librustc_mir_build/build/expr/as_rvalue.rs b/src/librustc_mir_build/build/expr/as_rvalue.rs index 16795b459b6..6f5c5f0dd4c 100644 --- a/src/librustc_mir_build/build/expr/as_rvalue.rs +++ b/src/librustc_mir_build/build/expr/as_rvalue.rs @@ -230,18 +230,8 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { block = unpack!(this.stmt_expr(block, expr, None)); block.and(this.unit_rvalue()) } - ExprKind::Yield { value } => { - let value = unpack!(block = this.as_operand(block, scope, value)); - let resume = this.cfg.start_new_block(); - let cleanup = this.generator_drop_cleanup(); - this.cfg.terminate( - block, - source_info, - TerminatorKind::Yield { value: value, resume: resume, drop: cleanup }, - ); - resume.and(this.unit_rvalue()) - } - ExprKind::Literal { .. } + ExprKind::Yield { .. } + | ExprKind::Literal { .. } | ExprKind::StaticRef { .. } | ExprKind::Block { .. } | ExprKind::Match { .. } diff --git a/src/librustc_mir_build/build/expr/category.rs b/src/librustc_mir_build/build/expr/category.rs index c4d340953c9..cc139dee63f 100644 --- a/src/librustc_mir_build/build/expr/category.rs +++ b/src/librustc_mir_build/build/expr/category.rs @@ -50,6 +50,7 @@ impl Category { | ExprKind::Adt { .. } | ExprKind::Borrow { .. } | ExprKind::AddressOf { .. } + | ExprKind::Yield { .. } | ExprKind::Call { .. } => Some(Category::Rvalue(RvalueFunc::Into)), ExprKind::Array { .. } @@ -63,7 +64,6 @@ impl Category { | ExprKind::Repeat { .. } | ExprKind::Assign { .. } | ExprKind::AssignOp { .. } - | ExprKind::Yield { .. } | ExprKind::InlineAsm { .. } => Some(Category::Rvalue(RvalueFunc::AsRvalue)), ExprKind::Literal { .. } | ExprKind::StaticRef { .. } => Some(Category::Constant), diff --git a/src/librustc_mir_build/build/expr/into.rs b/src/librustc_mir_build/build/expr/into.rs index 5ef338c624d..51b0b5bc7cb 100644 --- a/src/librustc_mir_build/build/expr/into.rs +++ b/src/librustc_mir_build/build/expr/into.rs @@ -365,6 +365,24 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { block.unit() } + ExprKind::Yield { value } => { + let scope = this.local_scope(); + let value = unpack!(block = this.as_operand(block, scope, value)); + let resume = this.cfg.start_new_block(); + let cleanup = this.generator_drop_cleanup(); + this.cfg.terminate( + block, + source_info, + TerminatorKind::Yield { + value, + resume, + resume_arg: destination.clone(), + drop: cleanup, + }, + ); + resume.unit() + } + // these are the cases that are more naturally handled by some other mode ExprKind::Unary { .. } | ExprKind::Binary { .. } @@ -376,8 +394,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { | ExprKind::Tuple { .. } | ExprKind::Closure { .. } | ExprKind::Literal { .. } - | ExprKind::StaticRef { .. } - | ExprKind::Yield { .. } => { + | ExprKind::StaticRef { .. } => { debug_assert!(match Category::of(&expr.kind).unwrap() { // should be handled above Category::Rvalue(RvalueFunc::Into) => false, diff --git a/src/librustc_mir_build/build/mod.rs b/src/librustc_mir_build/build/mod.rs index 7e51f7aafe4..32b1f2b6e13 100644 --- a/src/librustc_mir_build/build/mod.rs +++ b/src/librustc_mir_build/build/mod.rs @@ -68,6 +68,12 @@ fn mir_build(tcx: TyCtxt<'_>, def_id: DefId) -> BodyAndCache<'_> { let fn_sig = cx.tables().liberated_fn_sigs()[id]; let fn_def_id = tcx.hir().local_def_id(id); + let safety = match fn_sig.unsafety { + hir::Unsafety::Normal => Safety::Safe, + hir::Unsafety::Unsafe => Safety::FnUnsafe, + }; + + let body = tcx.hir().body(body_id); let ty = tcx.type_of(fn_def_id); let mut abi = fn_sig.abi; let implicit_argument = match ty.kind { @@ -75,21 +81,25 @@ fn mir_build(tcx: TyCtxt<'_>, def_id: DefId) -> BodyAndCache<'_> { // HACK(eddyb) Avoid having RustCall on closures, // as it adds unnecessary (and wrong) auto-tupling. abi = Abi::Rust; - Some(ArgInfo(liberated_closure_env_ty(tcx, id, body_id), None, None, None)) + vec![ArgInfo(liberated_closure_env_ty(tcx, id, body_id), None, None, None)] } ty::Generator(..) => { let gen_ty = tcx.body_tables(body_id).node_type(id); - Some(ArgInfo(gen_ty, None, None, None)) + + // The resume argument may be missing, in that case we need to provide it here. + // It will always be `()` in this case. + if body.params.is_empty() { + vec![ + ArgInfo(gen_ty, None, None, None), + ArgInfo(tcx.mk_unit(), None, None, None), + ] + } else { + vec![ArgInfo(gen_ty, None, None, None)] + } } - _ => None, + _ => vec![], }; - let safety = match fn_sig.unsafety { - hir::Unsafety::Normal => Safety::Safe, - hir::Unsafety::Unsafe => Safety::FnUnsafe, - }; - - let body = tcx.hir().body(body_id); let explicit_arguments = body.params.iter().enumerate().map(|(index, arg)| { let owner_id = tcx.hir().body_owner(body_id); let opt_ty_info; diff --git a/src/librustc_session/config.rs b/src/librustc_session/config.rs index ad1a6c4906e..75b5e37b2df 100644 --- a/src/librustc_session/config.rs +++ b/src/librustc_session/config.rs @@ -624,7 +624,7 @@ impl DebuggingOptions { treat_err_as_bug: self.treat_err_as_bug, dont_buffer_diagnostics: self.dont_buffer_diagnostics, report_delayed_bugs: self.report_delayed_bugs, - external_macro_backtrace: self.external_macro_backtrace, + macro_backtrace: self.macro_backtrace, deduplicate_diagnostics: self.deduplicate_diagnostics.unwrap_or(true), } } diff --git a/src/librustc_session/options.rs b/src/librustc_session/options.rs index d6b71641da5..0250c40bcdc 100644 --- a/src/librustc_session/options.rs +++ b/src/librustc_session/options.rs @@ -776,8 +776,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options, "treat error number `val` that occurs as bug"), report_delayed_bugs: bool = (false, parse_bool, [TRACKED], "immediately print bugs registered with `delay_span_bug`"), - external_macro_backtrace: bool = (false, parse_bool, [UNTRACKED], - "show macro backtraces even for non-local macros"), + macro_backtrace: bool = (false, parse_bool, [UNTRACKED], + "show macro backtraces"), teach: bool = (false, parse_bool, [TRACKED], "show extended diagnostic help"), terminal_width: Option = (None, parse_opt_uint, [UNTRACKED], diff --git a/src/librustc_session/session.rs b/src/librustc_session/session.rs index 70984917d7c..648dd6ad32a 100644 --- a/src/librustc_session/session.rs +++ b/src/librustc_session/session.rs @@ -858,7 +858,7 @@ fn default_emitter( source_map: &Lrc, emitter_dest: Option>, ) -> Box { - let external_macro_backtrace = sopts.debugging_opts.external_macro_backtrace; + let macro_backtrace = sopts.debugging_opts.macro_backtrace; match (sopts.error_format, emitter_dest) { (config::ErrorOutputType::HumanReadable(kind), dst) => { let (short, color_config) = kind.unzip(); @@ -867,7 +867,7 @@ fn default_emitter( let emitter = AnnotateSnippetEmitterWriter::new( Some(source_map.clone()), short, - external_macro_backtrace, + macro_backtrace, ); Box::new(emitter.ui_testing(sopts.debugging_opts.ui_testing())) } else { @@ -878,7 +878,7 @@ fn default_emitter( short, sopts.debugging_opts.teach, sopts.debugging_opts.terminal_width, - external_macro_backtrace, + macro_backtrace, ), Some(dst) => EmitterWriter::new( dst, @@ -887,7 +887,7 @@ fn default_emitter( false, // no teach messages when writing to a buffer false, // no colors when writing to a buffer None, // no terminal width - external_macro_backtrace, + macro_backtrace, ), }; Box::new(emitter.ui_testing(sopts.debugging_opts.ui_testing())) @@ -899,7 +899,7 @@ fn default_emitter( source_map.clone(), pretty, json_rendered, - external_macro_backtrace, + macro_backtrace, ) .ui_testing(sopts.debugging_opts.ui_testing()), ), @@ -910,7 +910,7 @@ fn default_emitter( source_map.clone(), pretty, json_rendered, - external_macro_backtrace, + macro_backtrace, ) .ui_testing(sopts.debugging_opts.ui_testing()), ), diff --git a/src/librustc_span/source_map.rs b/src/librustc_span/source_map.rs index c250df43a27..45c4d6dbc6c 100644 --- a/src/librustc_span/source_map.rs +++ b/src/librustc_span/source_map.rs @@ -945,14 +945,6 @@ impl SourceMap { _ => None, }) } - pub fn call_span_if_macro(&self, sp: Span) -> Span { - if self.span_to_filename(sp.clone()).is_macros() { - if let Some(use_site) = sp.macro_backtrace().last() { - return use_site.call_site; - } - } - sp - } } #[derive(Clone)] diff --git a/src/librustc_traits/dropck_outlives.rs b/src/librustc_traits/dropck_outlives.rs index bc4d03cca7f..346d2a931d1 100644 --- a/src/librustc_traits/dropck_outlives.rs +++ b/src/librustc_traits/dropck_outlives.rs @@ -227,8 +227,8 @@ fn dtorck_constraint_for_ty<'tcx>( // In particular, skipping over `_interior` is safe // because any side-effects from dropping `_interior` can // only take place through references with lifetimes - // derived from lifetimes attached to the upvars, and we - // *do* incorporate the upvars here. + // derived from lifetimes attached to the upvars and resume + // argument, and we *do* incorporate those here. constraints.outlives.extend( substs @@ -236,6 +236,7 @@ fn dtorck_constraint_for_ty<'tcx>( .upvar_tys(def_id, tcx) .map(|t| -> ty::subst::GenericArg<'tcx> { t.into() }), ); + constraints.outlives.push(substs.as_generator().resume_ty(def_id, tcx).into()); } ty::Adt(def, substs) => { diff --git a/src/librustc_typeck/check/closure.rs b/src/librustc_typeck/check/closure.rs index 084e6c8d083..26777b3b010 100644 --- a/src/librustc_typeck/check/closure.rs +++ b/src/librustc_typeck/check/closure.rs @@ -92,8 +92,14 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { .into(), GenericParamDefKind::Const => span_bug!(expr.span, "closure has const param"), }); - if let Some(GeneratorTypes { yield_ty, interior, movability }) = generator_types { + if let Some(GeneratorTypes { resume_ty, yield_ty, interior, movability }) = generator_types + { let generator_substs = substs.as_generator(); + self.demand_eqtype( + expr.span, + resume_ty, + generator_substs.resume_ty(expr_def_id, self.tcx), + ); self.demand_eqtype( expr.span, yield_ty, @@ -259,8 +265,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { _ => return None, } } else { - // Generators cannot have explicit arguments. - vec![] + // Generators with a `()` resume type may be defined with 0 or 1 explicit arguments, + // else they must have exactly 1 argument. For now though, just give up in this case. + return None; }; let ret_param_ty = projection.skip_binder().ty; diff --git a/src/librustc_typeck/check/expr.rs b/src/librustc_typeck/check/expr.rs index b4c2b85241f..9ce89bd6363 100644 --- a/src/librustc_typeck/check/expr.rs +++ b/src/librustc_typeck/check/expr.rs @@ -1796,9 +1796,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { expr: &'tcx hir::Expr<'tcx>, src: &'tcx hir::YieldSource, ) -> Ty<'tcx> { - match self.yield_ty { - Some(ty) => { - self.check_expr_coercable_to_type(&value, ty); + match self.resume_yield_tys { + Some((resume_ty, yield_ty)) => { + self.check_expr_coercable_to_type(&value, yield_ty); + + resume_ty } // Given that this `yield` expression was generated as a result of lowering a `.await`, // we know that the yield type must be `()`; however, the context won't contain this @@ -1806,6 +1808,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { // value's type against `()` (this check should always hold). None if src == &hir::YieldSource::Await => { self.check_expr_coercable_to_type(&value, self.tcx.mk_unit()); + self.tcx.mk_unit() } _ => { struct_span_err!( @@ -1815,9 +1818,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { "yield expression outside of generator literal" ) .emit(); + self.tcx.mk_unit() } } - self.tcx.mk_unit() } } diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index d0275429747..0b87d3adcb5 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -573,7 +573,7 @@ pub struct FnCtxt<'a, 'tcx> { /// First span of a return site that we find. Used in error messages. ret_coercion_span: RefCell>, - yield_ty: Option>, + resume_yield_tys: Option<(Ty<'tcx>, Ty<'tcx>)>, ps: RefCell, @@ -1251,6 +1251,9 @@ impl<'a, 'tcx> Visitor<'tcx> for GatherLocalsVisitor<'a, 'tcx> { /// includes yield), it returns back some information about the yield /// points. struct GeneratorTypes<'tcx> { + /// Type of generator argument / values returned by `yield`. + resume_ty: Ty<'tcx>, + /// Type of value that is yielded. yield_ty: Ty<'tcx>, @@ -1311,7 +1314,11 @@ fn check_fn<'a, 'tcx>( let yield_ty = fcx .next_ty_var(TypeVariableOrigin { kind: TypeVariableOriginKind::TypeInference, span }); fcx.require_type_is_sized(yield_ty, span, traits::SizedYieldType); - fcx.yield_ty = Some(yield_ty); + + // Resume type defaults to `()` if the generator has no argument. + let resume_ty = fn_sig.inputs().get(0).map(|ty| *ty).unwrap_or_else(|| tcx.mk_unit()); + + fcx.resume_yield_tys = Some((resume_ty, yield_ty)); } let outer_def_id = tcx.closure_base_def_id(hir.local_def_id(fn_id)); @@ -1364,8 +1371,11 @@ fn check_fn<'a, 'tcx>( let interior = fcx .next_ty_var(TypeVariableOrigin { kind: TypeVariableOriginKind::MiscVariable, span }); fcx.deferred_generator_interiors.borrow_mut().push((body.id(), interior, gen_kind)); + + let (resume_ty, yield_ty) = fcx.resume_yield_tys.unwrap(); Some(GeneratorTypes { - yield_ty: fcx.yield_ty.unwrap(), + resume_ty, + yield_ty, interior, movability: can_be_generator.unwrap(), }) @@ -2767,7 +2777,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { err_count_on_creation: inh.tcx.sess.err_count(), ret_coercion: None, ret_coercion_span: RefCell::new(None), - yield_ty: None, + resume_yield_tys: None, ps: RefCell::new(UnsafetyState::function(hir::Unsafety::Normal, hir::CRATE_HIR_ID)), diverges: Cell::new(Diverges::Maybe), has_errors: Cell::new(false), diff --git a/src/librustc_typeck/collect.rs b/src/librustc_typeck/collect.rs index 4d812d2621c..dc089c90456 100644 --- a/src/librustc_typeck/collect.rs +++ b/src/librustc_typeck/collect.rs @@ -1189,7 +1189,7 @@ fn generics_of(tcx: TyCtxt<'_>, def_id: DefId) -> &ty::Generics { // and we don't do that for closures. if let Node::Expr(&hir::Expr { kind: hir::ExprKind::Closure(.., gen), .. }) = node { let dummy_args = if gen.is_some() { - &["", "", ""][..] + &["", "", "", ""][..] } else { &["", ""][..] }; diff --git a/src/libstd/future.rs b/src/libstd/future.rs index 9c7422c2b20..f74c84e6dfd 100644 --- a/src/libstd/future.rs +++ b/src/libstd/future.rs @@ -40,7 +40,10 @@ impl> Future for GenFuture { // Safe because we're !Unpin + !Drop mapping to a ?Unpin value let gen = unsafe { Pin::map_unchecked_mut(self, |s| &mut s.0) }; let _guard = unsafe { set_task_context(cx) }; - match gen.resume() { + match gen.resume( + #[cfg(not(bootstrap))] + (), + ) { GeneratorState::Yielded(()) => Poll::Pending, GeneratorState::Complete(x) => Poll::Ready(x), } diff --git a/src/test/debuginfo/generator-locals.rs b/src/test/debuginfo/generator-locals.rs index 59dbfecc39f..fd46c1a8b4d 100644 --- a/src/test/debuginfo/generator-locals.rs +++ b/src/test/debuginfo/generator-locals.rs @@ -78,9 +78,9 @@ fn main() { _zzz(); // #break a = c; }; - Pin::new(&mut b).resume(); - Pin::new(&mut b).resume(); - Pin::new(&mut b).resume(); + Pin::new(&mut b).resume(()); + Pin::new(&mut b).resume(()); + Pin::new(&mut b).resume(()); _zzz(); // #break } diff --git a/src/test/debuginfo/generator-objects.rs b/src/test/debuginfo/generator-objects.rs index bfa7a05cad0..f19a3c71dd8 100644 --- a/src/test/debuginfo/generator-objects.rs +++ b/src/test/debuginfo/generator-objects.rs @@ -57,11 +57,11 @@ fn main() { println!("{} {} {}", a, c, d); }; _zzz(); // #break - Pin::new(&mut b).resume(); + Pin::new(&mut b).resume(()); _zzz(); // #break - Pin::new(&mut b).resume(); + Pin::new(&mut b).resume(()); _zzz(); // #break - Pin::new(&mut b).resume(); + Pin::new(&mut b).resume(()); _zzz(); // #break } diff --git a/src/test/debuginfo/issue-57822.rs b/src/test/debuginfo/issue-57822.rs index f18e41db0e6..4de88e9dae6 100644 --- a/src/test/debuginfo/issue-57822.rs +++ b/src/test/debuginfo/issue-57822.rs @@ -45,7 +45,7 @@ fn main() { yield; }; let mut b = move || { - Pin::new(&mut a).resume(); + Pin::new(&mut a).resume(()); yield; }; diff --git a/src/test/mir-opt/generator-drop-cleanup.rs b/src/test/mir-opt/generator-drop-cleanup.rs index f97e1ba6c89..278dc49c926 100644 --- a/src/test/mir-opt/generator-drop-cleanup.rs +++ b/src/test/mir-opt/generator-drop-cleanup.rs @@ -13,12 +13,12 @@ fn main() { // START rustc.main-{{closure}}.generator_drop.0.mir // bb0: { -// _5 = discriminant((*_1)); -// switchInt(move _5) -> [0u32: bb4, 3u32: bb7, otherwise: bb8]; +// _7 = discriminant((*_1)); +// switchInt(move _7) -> [0u32: bb4, 3u32: bb7, otherwise: bb8]; // } // bb1: { +// StorageDead(_4); // StorageDead(_3); -// StorageDead(_2); // goto -> bb5; // } // bb2: { @@ -37,8 +37,8 @@ fn main() { // goto -> bb3; // } // bb7: { -// StorageLive(_2); // StorageLive(_3); +// StorageLive(_4); // goto -> bb1; // } // bb8: { diff --git a/src/test/mir-opt/generator-storage-dead-unwind.rs b/src/test/mir-opt/generator-storage-dead-unwind.rs index ecce0a08c7b..4442fa5f521 100644 --- a/src/test/mir-opt/generator-storage-dead-unwind.rs +++ b/src/test/mir-opt/generator-storage-dead-unwind.rs @@ -31,81 +31,81 @@ fn main() { // START rustc.main-{{closure}}.StateTransform.before.mir // ... -// let _2: Foo; +// let _3: Foo; // ... -// let mut _7: Foo; +// let mut _8: Foo; // ... -// let mut _9: Bar; +// let mut _10: Bar; // scope 1 { -// debug a => _2; -// let _3: Bar; +// debug a => _3; +// let _4: Bar; // scope 2 { -// debug b => _3; +// debug b => _4; // } // } // bb0: { -// StorageLive(_2); -// _2 = Foo(const 5i32,); // StorageLive(_3); -// _3 = Bar(const 6i32,); +// _3 = Foo(const 5i32,); +// StorageLive(_4); +// _4 = Bar(const 6i32,); // ... -// _1 = suspend(move _5) -> [resume: bb2, drop: bb4]; +// _1 = suspend(move _6) -> [resume: bb2, drop: bb4]; // } // bb1 (cleanup): { // resume; // } // bb2: { // ... -// StorageLive(_6); // StorageLive(_7); -// _7 = move _2; -// _6 = const take::(move _7) -> [return: bb7, unwind: bb9]; +// StorageLive(_8); +// _8 = move _3; +// _7 = const take::(move _8) -> [return: bb7, unwind: bb9]; // } // bb3 (cleanup): { -// StorageDead(_2); +// StorageDead(_3); // drop(_1) -> bb1; // } // bb4: { // ... -// StorageDead(_3); -// drop(_2) -> [return: bb5, unwind: bb3]; +// StorageDead(_4); +// drop(_3) -> [return: bb5, unwind: bb3]; // } // bb5: { -// StorageDead(_2); +// StorageDead(_3); // drop(_1) -> [return: bb6, unwind: bb1]; // } // bb6: { // generator_drop; // } // bb7: { +// StorageDead(_8); // StorageDead(_7); -// StorageDead(_6); -// StorageLive(_8); // StorageLive(_9); -// _9 = move _3; -// _8 = const take::(move _9) -> [return: bb10, unwind: bb11]; +// StorageLive(_10); +// _10 = move _4; +// _9 = const take::(move _10) -> [return: bb10, unwind: bb11]; // } // bb8 (cleanup): { +// StorageDead(_4); // StorageDead(_3); -// StorageDead(_2); // drop(_1) -> bb1; // } // bb9 (cleanup): { +// StorageDead(_8); // StorageDead(_7); -// StorageDead(_6); // goto -> bb8; // } // bb10: { +// StorageDead(_10); // StorageDead(_9); -// StorageDead(_8); // ... +// StorageDead(_4); // StorageDead(_3); -// StorageDead(_2); // drop(_1) -> [return: bb12, unwind: bb1]; // } // bb11 (cleanup): { +// StorageDead(_10); // StorageDead(_9); -// StorageDead(_8); // goto -> bb8; // } // bb12: { diff --git a/src/test/run-fail/generator-resume-after-panic.rs b/src/test/run-fail/generator-resume-after-panic.rs index 910b4903bf6..1a7c2e80629 100644 --- a/src/test/run-fail/generator-resume-after-panic.rs +++ b/src/test/run-fail/generator-resume-after-panic.rs @@ -16,7 +16,7 @@ fn main() { yield; }; panic::catch_unwind(panic::AssertUnwindSafe(|| { - let x = Pin::new(&mut g).resume(); + let x = Pin::new(&mut g).resume(()); })); - Pin::new(&mut g).resume(); + Pin::new(&mut g).resume(()); } diff --git a/src/test/rustdoc-ui/intra-links-warning.stderr b/src/test/rustdoc-ui/intra-links-warning.stderr index 5f1c9cfbc36..91b1fff5a3a 100644 --- a/src/test/rustdoc-ui/intra-links-warning.stderr +++ b/src/test/rustdoc-ui/intra-links-warning.stderr @@ -175,4 +175,5 @@ LL | f!("Foo\nbar [BarF] bar\nbaz"); bar [BarF] bar ^^^^ = help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]` + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/src/test/ui-fulldeps/hash-stable-is-unstable.stderr b/src/test/ui-fulldeps/hash-stable-is-unstable.stderr index e2dc0c3be72..73b48013de6 100644 --- a/src/test/ui-fulldeps/hash-stable-is-unstable.stderr +++ b/src/test/ui-fulldeps/hash-stable-is-unstable.stderr @@ -42,6 +42,7 @@ LL | #[derive(HashStable)] | = note: for more information, see https://github.com/rust-lang/rust/issues/27812 = help: add `#![feature(rustc_private)]` to the crate attributes to enable + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 5 previous errors diff --git a/src/test/ui-fulldeps/internal-lints/lint_pass_impl_without_macro.stderr b/src/test/ui-fulldeps/internal-lints/lint_pass_impl_without_macro.stderr index 966a747a1c9..fe920dba397 100644 --- a/src/test/ui-fulldeps/internal-lints/lint_pass_impl_without_macro.stderr +++ b/src/test/ui-fulldeps/internal-lints/lint_pass_impl_without_macro.stderr @@ -21,6 +21,7 @@ LL | custom_lint_pass_macro!(); | -------------------------- in this macro invocation | = help: try using `declare_lint_pass!` or `impl_lint_pass!` instead + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 2 previous errors diff --git a/src/test/ui/allocator/not-an-allocator.stderr b/src/test/ui/allocator/not-an-allocator.stderr index dd2cf36ff1b..0d52a23c1f3 100644 --- a/src/test/ui/allocator/not-an-allocator.stderr +++ b/src/test/ui/allocator/not-an-allocator.stderr @@ -5,6 +5,7 @@ LL | static A: usize = 0; | ^^^^^^^^^^^^^^^^^^^^ the trait `std::alloc::GlobalAlloc` is not implemented for `usize` | = note: required by `std::alloc::GlobalAlloc::alloc` + = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied --> $DIR/not-an-allocator.rs:2:1 @@ -13,6 +14,7 @@ LL | static A: usize = 0; | ^^^^^^^^^^^^^^^^^^^^ the trait `std::alloc::GlobalAlloc` is not implemented for `usize` | = note: required by `std::alloc::GlobalAlloc::dealloc` + = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied --> $DIR/not-an-allocator.rs:2:1 @@ -21,6 +23,7 @@ LL | static A: usize = 0; | ^^^^^^^^^^^^^^^^^^^^ the trait `std::alloc::GlobalAlloc` is not implemented for `usize` | = note: required by `std::alloc::GlobalAlloc::realloc` + = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied --> $DIR/not-an-allocator.rs:2:1 @@ -29,6 +32,7 @@ LL | static A: usize = 0; | ^^^^^^^^^^^^^^^^^^^^ the trait `std::alloc::GlobalAlloc` is not implemented for `usize` | = note: required by `std::alloc::GlobalAlloc::alloc_zeroed` + = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 4 previous errors diff --git a/src/test/ui/allocator/two-allocators.stderr b/src/test/ui/allocator/two-allocators.stderr index da636a5a567..1b46825c542 100644 --- a/src/test/ui/allocator/two-allocators.stderr +++ b/src/test/ui/allocator/two-allocators.stderr @@ -6,6 +6,8 @@ LL | static A: System = System; LL | #[global_allocator] LL | static B: System = System; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot define a new global allocator + | + = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/async-await/issues/issue-65419/issue-65419-generator-resume-after-completion.rs b/src/test/ui/async-await/issues/issue-65419/issue-65419-generator-resume-after-completion.rs index 23e3483e01c..9fc5667d684 100644 --- a/src/test/ui/async-await/issues/issue-65419/issue-65419-generator-resume-after-completion.rs +++ b/src/test/ui/async-await/issues/issue-65419/issue-65419-generator-resume-after-completion.rs @@ -19,7 +19,7 @@ fn main() { let mut g = || { yield; }; - Pin::new(&mut g).resume(); // Yields once. - Pin::new(&mut g).resume(); // Completes here. - Pin::new(&mut g).resume(); // Panics here. + Pin::new(&mut g).resume(()); // Yields once. + Pin::new(&mut g).resume(()); // Completes here. + Pin::new(&mut g).resume(()); // Panics here. } diff --git a/src/test/ui/borrowck/borrowck-borrowed-uniq-rvalue-2.stderr b/src/test/ui/borrowck/borrowck-borrowed-uniq-rvalue-2.stderr index 1dd18c12fc8..bdb073cdcbc 100644 --- a/src/test/ui/borrowck/borrowck-borrowed-uniq-rvalue-2.stderr +++ b/src/test/ui/borrowck/borrowck-borrowed-uniq-rvalue-2.stderr @@ -9,7 +9,7 @@ LL | x.x[0]; | ------ borrow later used here | = note: consider using a `let` binding to create a longer lived value - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/borrowck/issue-64453.stderr b/src/test/ui/borrowck/issue-64453.stderr index 0b66426aa2a..edc496aa2f8 100644 --- a/src/test/ui/borrowck/issue-64453.stderr +++ b/src/test/ui/borrowck/issue-64453.stderr @@ -6,7 +6,7 @@ LL | static settings_dir: String = format!(""); | = note: for more information, see https://github.com/rust-lang/rust/issues/49146 = help: add `#![feature(const_if_match)]` to the crate attributes to enable - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/borrowck/move-error-snippets.stderr b/src/test/ui/borrowck/move-error-snippets.stderr index 77463c48591..e0acd459571 100644 --- a/src/test/ui/borrowck/move-error-snippets.stderr +++ b/src/test/ui/borrowck/move-error-snippets.stderr @@ -9,6 +9,8 @@ LL | aaa!(D); ... LL | sss!(); | ------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/codemap_tests/bad-format-args.stderr b/src/test/ui/codemap_tests/bad-format-args.stderr index 17d4df2a223..96d7b07b0e2 100644 --- a/src/test/ui/codemap_tests/bad-format-args.stderr +++ b/src/test/ui/codemap_tests/bad-format-args.stderr @@ -4,7 +4,7 @@ error: requires at least a format string argument LL | format!(); | ^^^^^^^^^^ | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: expected token: `,` --> $DIR/bad-format-args.rs:3:16 diff --git a/src/test/ui/codemap_tests/issue-28308.stderr b/src/test/ui/codemap_tests/issue-28308.stderr index d44c157003d..f8820b9efed 100644 --- a/src/test/ui/codemap_tests/issue-28308.stderr +++ b/src/test/ui/codemap_tests/issue-28308.stderr @@ -3,6 +3,8 @@ error[E0600]: cannot apply unary operator `!` to type `&'static str` | LL | assert!("foo"); | ^^^^^^^^^^^^^^^ cannot apply unary operator `!` + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/conditional-compilation/cfg-attr-syntax-validation.stderr b/src/test/ui/conditional-compilation/cfg-attr-syntax-validation.stderr index 5bfe9e902da..44063dd1d65 100644 --- a/src/test/ui/conditional-compilation/cfg-attr-syntax-validation.stderr +++ b/src/test/ui/conditional-compilation/cfg-attr-syntax-validation.stderr @@ -60,6 +60,8 @@ LL | #[cfg(feature = $expr)] ... LL | generate_s10!(concat!("nonexistent")); | -------------------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 10 previous errors diff --git a/src/test/ui/conditional-compilation/cfg-attr-unknown-attribute-macro-expansion.stderr b/src/test/ui/conditional-compilation/cfg-attr-unknown-attribute-macro-expansion.stderr index ef434ec8261..330ce2bd2e1 100644 --- a/src/test/ui/conditional-compilation/cfg-attr-unknown-attribute-macro-expansion.stderr +++ b/src/test/ui/conditional-compilation/cfg-attr-unknown-attribute-macro-expansion.stderr @@ -6,6 +6,8 @@ LL | #[cfg_attr(all(), unknown)] ... LL | foo!(); | ------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/const-generics/array-impls/core-traits-no-impls-length-33.stderr b/src/test/ui/const-generics/array-impls/core-traits-no-impls-length-33.stderr index d885c98dcb2..cba71db86a9 100644 --- a/src/test/ui/const-generics/array-impls/core-traits-no-impls-length-33.stderr +++ b/src/test/ui/const-generics/array-impls/core-traits-no-impls-length-33.stderr @@ -6,6 +6,7 @@ LL | println!("{:?}", [0_usize; 33]); | = note: required because of the requirements on the impl of `std::fmt::Debug` for `[usize; 33]` = note: required by `std::fmt::Debug::fmt` + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: arrays only have std trait implementations for lengths 0..=32 --> $DIR/core-traits-no-impls-length-33.rs:10:16 diff --git a/src/test/ui/const-generics/broken-mir-2.stderr b/src/test/ui/const-generics/broken-mir-2.stderr index b72bc6a46a0..7d95b46790d 100644 --- a/src/test/ui/const-generics/broken-mir-2.stderr +++ b/src/test/ui/const-generics/broken-mir-2.stderr @@ -15,6 +15,7 @@ LL | struct S([T; N]); = note: required because of the requirements on the impl of `std::fmt::Debug` for `[T; _]` = note: required because of the requirements on the impl of `std::fmt::Debug` for `&[T; _]` = note: required for the cast to the object type `dyn std::fmt::Debug` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/const-generics/derive-debug-array-wrapper.stderr b/src/test/ui/const-generics/derive-debug-array-wrapper.stderr index 08a9037a207..c4aef4c9d47 100644 --- a/src/test/ui/const-generics/derive-debug-array-wrapper.stderr +++ b/src/test/ui/const-generics/derive-debug-array-wrapper.stderr @@ -15,6 +15,7 @@ LL | a: [u32; N], = note: required because of the requirements on the impl of `std::fmt::Debug` for `[u32; _]` = note: required because of the requirements on the impl of `std::fmt::Debug` for `&[u32; _]` = note: required for the cast to the object type `dyn std::fmt::Debug` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/consts/const-eval/const_fn_ptr_fail2.stderr b/src/test/ui/consts/const-eval/const_fn_ptr_fail2.stderr index f99505c3090..4c3ebece0a8 100644 --- a/src/test/ui/consts/const-eval/const_fn_ptr_fail2.stderr +++ b/src/test/ui/consts/const-eval/const_fn_ptr_fail2.stderr @@ -12,7 +12,7 @@ LL | assert_eq!(Y, 4); | | | referenced constant has errors | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0080]: evaluation of constant expression failed --> $DIR/const_fn_ptr_fail2.rs:22:5 @@ -22,7 +22,7 @@ LL | assert_eq!(Z, 4); | | | referenced constant has errors | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 2 previous errors diff --git a/src/test/ui/consts/const-eval/const_panic.stderr b/src/test/ui/consts/const-eval/const_panic.stderr index 1b006c69cfd..679d8f280cc 100644 --- a/src/test/ui/consts/const-eval/const_panic.stderr +++ b/src/test/ui/consts/const-eval/const_panic.stderr @@ -7,7 +7,7 @@ LL | pub const Z: () = panic!("cheese"); | the evaluated program panicked at 'cheese', $DIR/const_panic.rs:4:19 | = note: `#[deny(const_err)]` on by default - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: any use of this value will cause an error --> $DIR/const_panic.rs:7:19 @@ -17,7 +17,7 @@ LL | pub const Y: () = unreachable!(); | | | the evaluated program panicked at 'internal error: entered unreachable code', $DIR/const_panic.rs:7:19 | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: any use of this value will cause an error --> $DIR/const_panic.rs:10:19 @@ -27,7 +27,7 @@ LL | pub const X: () = unimplemented!(); | | | the evaluated program panicked at 'not implemented', $DIR/const_panic.rs:10:19 | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 3 previous errors diff --git a/src/test/ui/consts/const-eval/const_panic_libcore.stderr b/src/test/ui/consts/const-eval/const_panic_libcore.stderr index abc844e9842..2abf158aade 100644 --- a/src/test/ui/consts/const-eval/const_panic_libcore.stderr +++ b/src/test/ui/consts/const-eval/const_panic_libcore.stderr @@ -7,7 +7,7 @@ LL | const Z: () = panic!("cheese"); | the evaluated program panicked at 'cheese', $DIR/const_panic_libcore.rs:5:15 | = note: `#[deny(const_err)]` on by default - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: any use of this value will cause an error --> $DIR/const_panic_libcore.rs:8:15 @@ -17,7 +17,7 @@ LL | const Y: () = unreachable!(); | | | the evaluated program panicked at 'internal error: entered unreachable code', $DIR/const_panic_libcore.rs:8:15 | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: any use of this value will cause an error --> $DIR/const_panic_libcore.rs:11:15 @@ -27,7 +27,7 @@ LL | const X: () = unimplemented!(); | | | the evaluated program panicked at 'not implemented', $DIR/const_panic_libcore.rs:11:15 | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 3 previous errors diff --git a/src/test/ui/consts/const-eval/const_panic_libcore_main.stderr b/src/test/ui/consts/const-eval/const_panic_libcore_main.stderr index 24ddefe01b5..c5887ff8c56 100644 --- a/src/test/ui/consts/const-eval/const_panic_libcore_main.stderr +++ b/src/test/ui/consts/const-eval/const_panic_libcore_main.stderr @@ -7,7 +7,7 @@ LL | const Z: () = panic!("cheese"); | the evaluated program panicked at 'cheese', $DIR/const_panic_libcore_main.rs:9:15 | = note: `#[deny(const_err)]` on by default - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: any use of this value will cause an error --> $DIR/const_panic_libcore_main.rs:12:15 @@ -17,7 +17,7 @@ LL | const Y: () = unreachable!(); | | | the evaluated program panicked at 'internal error: entered unreachable code', $DIR/const_panic_libcore_main.rs:12:15 | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: any use of this value will cause an error --> $DIR/const_panic_libcore_main.rs:15:15 @@ -27,7 +27,7 @@ LL | const X: () = unimplemented!(); | | | the evaluated program panicked at 'not implemented', $DIR/const_panic_libcore_main.rs:15:15 | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 3 previous errors diff --git a/src/test/ui/consts/const-eval/feature-gate-const_panic.stderr b/src/test/ui/consts/const-eval/feature-gate-const_panic.stderr index ac0ff7025d1..82edcefb86e 100644 --- a/src/test/ui/consts/const-eval/feature-gate-const_panic.stderr +++ b/src/test/ui/consts/const-eval/feature-gate-const_panic.stderr @@ -6,7 +6,7 @@ LL | const Z: () = panic!("cheese"); | = note: for more information, see https://github.com/rust-lang/rust/issues/51999 = help: add `#![feature(const_panic)]` to the crate attributes to enable - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0658]: panicking in constants is unstable --> $DIR/feature-gate-const_panic.rs:9:15 @@ -16,7 +16,7 @@ LL | const X: () = unimplemented!(); | = note: for more information, see https://github.com/rust-lang/rust/issues/51999 = help: add `#![feature(const_panic)]` to the crate attributes to enable - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0658]: panicking in constants is unstable --> $DIR/feature-gate-const_panic.rs:6:15 @@ -26,7 +26,7 @@ LL | const Y: () = unreachable!(); | = note: for more information, see https://github.com/rust-lang/rust/issues/51999 = help: add `#![feature(const_panic)]` to the crate attributes to enable - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 3 previous errors diff --git a/src/test/ui/consts/const-eval/panic-assoc-never-type.stderr b/src/test/ui/consts/const-eval/panic-assoc-never-type.stderr index d09a295264c..ea4eba89eb7 100644 --- a/src/test/ui/consts/const-eval/panic-assoc-never-type.stderr +++ b/src/test/ui/consts/const-eval/panic-assoc-never-type.stderr @@ -11,7 +11,7 @@ note: the lint level is defined here | LL | #![warn(const_err)] | ^^^^^^^^^ - = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0080]: erroneous constant used --> $DIR/panic-assoc-never-type.rs:16:13 diff --git a/src/test/ui/consts/const-eval/panic-never-type.stderr b/src/test/ui/consts/const-eval/panic-never-type.stderr index 3daad0a2fdd..28333c511dc 100644 --- a/src/test/ui/consts/const-eval/panic-never-type.stderr +++ b/src/test/ui/consts/const-eval/panic-never-type.stderr @@ -11,7 +11,7 @@ note: the lint level is defined here | LL | #![warn(const_err)] | ^^^^^^^^^ - = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0080]: erroneous constant used --> $DIR/panic-never-type.rs:12:13 diff --git a/src/test/ui/consts/const-external-macro-const-err.stderr b/src/test/ui/consts/const-external-macro-const-err.stderr index 237c4d792c9..06a630d82d8 100644 --- a/src/test/ui/consts/const-external-macro-const-err.stderr +++ b/src/test/ui/consts/const-external-macro-const-err.stderr @@ -5,7 +5,7 @@ LL | static_assert!(2 + 2 == 5); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ index out of bounds: the len is 1 but the index is 1 | = note: `#[deny(const_err)]` on by default - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/consts/control-flow/assert.both.stderr b/src/test/ui/consts/control-flow/assert.both.stderr index 44769175f0e..7dd60cfb545 100644 --- a/src/test/ui/consts/control-flow/assert.both.stderr +++ b/src/test/ui/consts/control-flow/assert.both.stderr @@ -7,7 +7,7 @@ LL | const _: () = assert!(false); | the evaluated program panicked at 'assertion failed: false', $DIR/assert.rs:12:15 | = note: `#[deny(const_err)]` on by default - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/consts/control-flow/assert.if_match.stderr b/src/test/ui/consts/control-flow/assert.if_match.stderr index 9c8963f6c7b..476cf89edf0 100644 --- a/src/test/ui/consts/control-flow/assert.if_match.stderr +++ b/src/test/ui/consts/control-flow/assert.if_match.stderr @@ -6,7 +6,7 @@ LL | const _: () = assert!(true); | = note: for more information, see https://github.com/rust-lang/rust/issues/51999 = help: add `#![feature(const_panic)]` to the crate attributes to enable - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0658]: panicking in constants is unstable --> $DIR/assert.rs:12:15 @@ -16,7 +16,7 @@ LL | const _: () = assert!(false); | = note: for more information, see https://github.com/rust-lang/rust/issues/51999 = help: add `#![feature(const_panic)]` to the crate attributes to enable - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 2 previous errors diff --git a/src/test/ui/consts/control-flow/assert.panic.stderr b/src/test/ui/consts/control-flow/assert.panic.stderr index 11550bf801a..043efa038aa 100644 --- a/src/test/ui/consts/control-flow/assert.panic.stderr +++ b/src/test/ui/consts/control-flow/assert.panic.stderr @@ -6,6 +6,7 @@ LL | const _: () = assert!(true); | = note: for more information, see https://github.com/rust-lang/rust/issues/49146 = help: add `#![feature(const_if_match)]` to the crate attributes to enable + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0658]: `if` is not allowed in a `const` --> $DIR/assert.rs:12:15 @@ -15,6 +16,7 @@ LL | const _: () = assert!(false); | = note: for more information, see https://github.com/rust-lang/rust/issues/49146 = help: add `#![feature(const_if_match)]` to the crate attributes to enable + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 2 previous errors diff --git a/src/test/ui/consts/control-flow/assert.stock.stderr b/src/test/ui/consts/control-flow/assert.stock.stderr index 11550bf801a..043efa038aa 100644 --- a/src/test/ui/consts/control-flow/assert.stock.stderr +++ b/src/test/ui/consts/control-flow/assert.stock.stderr @@ -6,6 +6,7 @@ LL | const _: () = assert!(true); | = note: for more information, see https://github.com/rust-lang/rust/issues/49146 = help: add `#![feature(const_if_match)]` to the crate attributes to enable + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0658]: `if` is not allowed in a `const` --> $DIR/assert.rs:12:15 @@ -15,6 +16,7 @@ LL | const _: () = assert!(false); | = note: for more information, see https://github.com/rust-lang/rust/issues/49146 = help: add `#![feature(const_if_match)]` to the crate attributes to enable + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 2 previous errors diff --git a/src/test/ui/consts/control-flow/issue-50577.if_match.stderr b/src/test/ui/consts/control-flow/issue-50577.if_match.stderr index 6771224e6cf..831360d5652 100644 --- a/src/test/ui/consts/control-flow/issue-50577.if_match.stderr +++ b/src/test/ui/consts/control-flow/issue-50577.if_match.stderr @@ -9,7 +9,7 @@ LL | Drop = assert_eq!(1, 1) | = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/consts/control-flow/issue-50577.stock.stderr b/src/test/ui/consts/control-flow/issue-50577.stock.stderr index 7d637f5aa96..523bd23258f 100644 --- a/src/test/ui/consts/control-flow/issue-50577.stock.stderr +++ b/src/test/ui/consts/control-flow/issue-50577.stock.stderr @@ -6,7 +6,7 @@ LL | Drop = assert_eq!(1, 1) | = note: for more information, see https://github.com/rust-lang/rust/issues/49146 = help: add `#![feature(const_if_match)]` to the crate attributes to enable - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0658]: `if` is not allowed in a `const` --> $DIR/issue-50577.rs:7:16 @@ -16,7 +16,7 @@ LL | Drop = assert_eq!(1, 1) | = note: for more information, see https://github.com/rust-lang/rust/issues/49146 = help: add `#![feature(const_if_match)]` to the crate attributes to enable - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0658]: `match` is not allowed in a `const` --> $DIR/issue-50577.rs:7:16 @@ -26,7 +26,7 @@ LL | Drop = assert_eq!(1, 1) | = note: for more information, see https://github.com/rust-lang/rust/issues/49146 = help: add `#![feature(const_if_match)]` to the crate attributes to enable - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0317]: `if` may be missing an `else` clause --> $DIR/issue-50577.rs:7:16 @@ -39,7 +39,7 @@ LL | Drop = assert_eq!(1, 1) | = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 4 previous errors diff --git a/src/test/ui/consts/control-flow/short-circuit.stock.stderr b/src/test/ui/consts/control-flow/short-circuit.stock.stderr index cf0de929593..f32f248af45 100644 --- a/src/test/ui/consts/control-flow/short-circuit.stock.stderr +++ b/src/test/ui/consts/control-flow/short-circuit.stock.stderr @@ -7,7 +7,7 @@ LL | const _: bool = true || panic!(); | the evaluated program panicked at 'explicit panic', $DIR/short-circuit.rs:10:25 | = note: `#[deny(const_err)]` on by default - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: any use of this value will cause an error --> $DIR/short-circuit.rs:11:26 @@ -17,7 +17,7 @@ LL | const _: bool = false && panic!(); | | | the evaluated program panicked at 'explicit panic', $DIR/short-circuit.rs:11:26 | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 2 previous errors diff --git a/src/test/ui/consts/enum-discr-type-err.stderr b/src/test/ui/consts/enum-discr-type-err.stderr index 9935f88e5b5..492b79e2e60 100644 --- a/src/test/ui/consts/enum-discr-type-err.stderr +++ b/src/test/ui/consts/enum-discr-type-err.stderr @@ -10,6 +10,7 @@ LL | | B = T, LL | | } | |_- in this macro invocation | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) help: you can convert an `i32` to `isize` and panic if the converted value wouldn't fit | LL | $( $v = $s::V.try_into().unwrap(), )* @@ -27,6 +28,7 @@ LL | | B = T, LL | | } | |_- in this macro invocation | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) help: you can convert an `i32` to `isize` and panic if the converted value wouldn't fit | LL | $( $v = $s::V.try_into().unwrap(), )* diff --git a/src/test/ui/consts/min_const_fn/bad_const_fn_body_ice.stderr b/src/test/ui/consts/min_const_fn/bad_const_fn_body_ice.stderr index ecfd30e7b44..2c68ddd8c9a 100644 --- a/src/test/ui/consts/min_const_fn/bad_const_fn_body_ice.stderr +++ b/src/test/ui/consts/min_const_fn/bad_const_fn_body_ice.stderr @@ -6,7 +6,7 @@ LL | vec![1, 2, 3] | = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563 = help: add `#![feature(const_fn)]` to the crate attributes to enable - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/cross/cross-crate-macro-backtrace/main.stderr b/src/test/ui/cross/cross-crate-macro-backtrace/main.stderr index b6ebe0ff1fc..9f58f16c1a0 100644 --- a/src/test/ui/cross/cross-crate-macro-backtrace/main.stderr +++ b/src/test/ui/cross/cross-crate-macro-backtrace/main.stderr @@ -4,7 +4,7 @@ error: 1 positional argument in format string, but no arguments were given LL | myprintln!("{}"); | ^^^^^^^^^^^^^^^^^ | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/cross/cross-file-errors/main.stderr b/src/test/ui/cross/cross-file-errors/main.stderr index 7fd91eb1d66..f9101d8a583 100644 --- a/src/test/ui/cross/cross-file-errors/main.stderr +++ b/src/test/ui/cross/cross-file-errors/main.stderr @@ -8,6 +8,8 @@ LL | _ | LL | underscore!(); | -------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/custom_test_frameworks/mismatch.stderr b/src/test/ui/custom_test_frameworks/mismatch.stderr index 9e2688c6393..420ddbc3def 100644 --- a/src/test/ui/custom_test_frameworks/mismatch.stderr +++ b/src/test/ui/custom_test_frameworks/mismatch.stderr @@ -5,6 +5,7 @@ LL | fn wrong_kind(){} | ^^^^^^^^^^^^^^^^^ the trait `example_runner::Testable` is not implemented for `test::TestDescAndFn` | = note: required for the cast to the object type `dyn example_runner::Testable` + = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/deprecation/deprecation-lint-2.stderr b/src/test/ui/deprecation/deprecation-lint-2.stderr index e8c2156742f..65152a2f9ab 100644 --- a/src/test/ui/deprecation/deprecation-lint-2.stderr +++ b/src/test/ui/deprecation/deprecation-lint-2.stderr @@ -9,7 +9,7 @@ note: the lint level is defined here | LL | #![deny(deprecated)] | ^^^^^^^^^^ - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/deprecation/deprecation-lint-3.stderr b/src/test/ui/deprecation/deprecation-lint-3.stderr index 7cc06a23b0f..b450f74d7f3 100644 --- a/src/test/ui/deprecation/deprecation-lint-3.stderr +++ b/src/test/ui/deprecation/deprecation-lint-3.stderr @@ -9,7 +9,7 @@ note: the lint level is defined here | LL | #![deny(deprecated)] | ^^^^^^^^^^ - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/deref-suggestion.stderr b/src/test/ui/deref-suggestion.stderr index 226f6fb620f..89fd7aae3be 100644 --- a/src/test/ui/deref-suggestion.stderr +++ b/src/test/ui/deref-suggestion.stderr @@ -42,6 +42,8 @@ LL | ($x:expr) => { &$x } ... LL | foo3(borrow!(0)); | ---------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0308]: mismatched types --> $DIR/deref-suggestion.rs:36:5 @@ -49,7 +51,7 @@ error[E0308]: mismatched types LL | assert_eq!(3i32, &3i32); | ^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `&i32` | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0308]: mismatched types --> $DIR/deref-suggestion.rs:39:17 diff --git a/src/test/ui/derives/derives-span-Clone-enum-struct-variant.stderr b/src/test/ui/derives/derives-span-Clone-enum-struct-variant.stderr index 5ddc5b5708c..8ef2d3d3023 100644 --- a/src/test/ui/derives/derives-span-Clone-enum-struct-variant.stderr +++ b/src/test/ui/derives/derives-span-Clone-enum-struct-variant.stderr @@ -5,6 +5,7 @@ LL | x: Error | ^^^^^^^^ the trait `std::clone::Clone` is not implemented for `Error` | = note: required by `std::clone::Clone::clone` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/derives/derives-span-Clone-enum.stderr b/src/test/ui/derives/derives-span-Clone-enum.stderr index 80ef9238f47..8c740733e2f 100644 --- a/src/test/ui/derives/derives-span-Clone-enum.stderr +++ b/src/test/ui/derives/derives-span-Clone-enum.stderr @@ -5,6 +5,7 @@ LL | Error | ^^^^^ the trait `std::clone::Clone` is not implemented for `Error` | = note: required by `std::clone::Clone::clone` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/derives/derives-span-Clone-struct.stderr b/src/test/ui/derives/derives-span-Clone-struct.stderr index 17f3925107b..75a59fbf035 100644 --- a/src/test/ui/derives/derives-span-Clone-struct.stderr +++ b/src/test/ui/derives/derives-span-Clone-struct.stderr @@ -5,6 +5,7 @@ LL | x: Error | ^^^^^^^^ the trait `std::clone::Clone` is not implemented for `Error` | = note: required by `std::clone::Clone::clone` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/derives/derives-span-Clone-tuple-struct.stderr b/src/test/ui/derives/derives-span-Clone-tuple-struct.stderr index e98212f3618..1860c5f2ff6 100644 --- a/src/test/ui/derives/derives-span-Clone-tuple-struct.stderr +++ b/src/test/ui/derives/derives-span-Clone-tuple-struct.stderr @@ -5,6 +5,7 @@ LL | Error | ^^^^^ the trait `std::clone::Clone` is not implemented for `Error` | = note: required by `std::clone::Clone::clone` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/derives/derives-span-Debug-enum-struct-variant.stderr b/src/test/ui/derives/derives-span-Debug-enum-struct-variant.stderr index 233c4c54983..ab3c5ef3c1d 100644 --- a/src/test/ui/derives/derives-span-Debug-enum-struct-variant.stderr +++ b/src/test/ui/derives/derives-span-Debug-enum-struct-variant.stderr @@ -8,6 +8,7 @@ LL | x: Error = note: add `#[derive(Debug)]` or manually implement `std::fmt::Debug` = note: required because of the requirements on the impl of `std::fmt::Debug` for `&Error` = note: required for the cast to the object type `dyn std::fmt::Debug` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/derives/derives-span-Debug-enum.stderr b/src/test/ui/derives/derives-span-Debug-enum.stderr index fbda3980cfc..e0a76d52515 100644 --- a/src/test/ui/derives/derives-span-Debug-enum.stderr +++ b/src/test/ui/derives/derives-span-Debug-enum.stderr @@ -8,6 +8,7 @@ LL | Error = note: add `#[derive(Debug)]` or manually implement `std::fmt::Debug` = note: required because of the requirements on the impl of `std::fmt::Debug` for `&Error` = note: required for the cast to the object type `dyn std::fmt::Debug` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/derives/derives-span-Debug-struct.stderr b/src/test/ui/derives/derives-span-Debug-struct.stderr index b56d223b34b..2f5cba09e4c 100644 --- a/src/test/ui/derives/derives-span-Debug-struct.stderr +++ b/src/test/ui/derives/derives-span-Debug-struct.stderr @@ -8,6 +8,7 @@ LL | x: Error = note: add `#[derive(Debug)]` or manually implement `std::fmt::Debug` = note: required because of the requirements on the impl of `std::fmt::Debug` for `&Error` = note: required for the cast to the object type `dyn std::fmt::Debug` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/derives/derives-span-Debug-tuple-struct.stderr b/src/test/ui/derives/derives-span-Debug-tuple-struct.stderr index 76dd6e31e60..58ec131d541 100644 --- a/src/test/ui/derives/derives-span-Debug-tuple-struct.stderr +++ b/src/test/ui/derives/derives-span-Debug-tuple-struct.stderr @@ -8,6 +8,7 @@ LL | Error = note: add `#[derive(Debug)]` or manually implement `std::fmt::Debug` = note: required because of the requirements on the impl of `std::fmt::Debug` for `&Error` = note: required for the cast to the object type `dyn std::fmt::Debug` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/derives/derives-span-Default-struct.stderr b/src/test/ui/derives/derives-span-Default-struct.stderr index 784be7fede3..b97dda719ab 100644 --- a/src/test/ui/derives/derives-span-Default-struct.stderr +++ b/src/test/ui/derives/derives-span-Default-struct.stderr @@ -5,6 +5,7 @@ LL | x: Error | ^^^^^^^^ the trait `std::default::Default` is not implemented for `Error` | = note: required by `std::default::Default::default` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/derives/derives-span-Default-tuple-struct.stderr b/src/test/ui/derives/derives-span-Default-tuple-struct.stderr index a93fa058f8d..d976891f41f 100644 --- a/src/test/ui/derives/derives-span-Default-tuple-struct.stderr +++ b/src/test/ui/derives/derives-span-Default-tuple-struct.stderr @@ -5,6 +5,7 @@ LL | Error | ^^^^^ the trait `std::default::Default` is not implemented for `Error` | = note: required by `std::default::Default::default` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/derives/derives-span-Eq-enum-struct-variant.stderr b/src/test/ui/derives/derives-span-Eq-enum-struct-variant.stderr index bad0ce31f70..f886c29c4db 100644 --- a/src/test/ui/derives/derives-span-Eq-enum-struct-variant.stderr +++ b/src/test/ui/derives/derives-span-Eq-enum-struct-variant.stderr @@ -5,6 +5,7 @@ LL | x: Error | ^^^^^^^^ the trait `std::cmp::Eq` is not implemented for `Error` | = note: required by `std::cmp::AssertParamIsEq` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/derives/derives-span-Eq-enum.stderr b/src/test/ui/derives/derives-span-Eq-enum.stderr index a7cc19d4c0f..0b5470138a5 100644 --- a/src/test/ui/derives/derives-span-Eq-enum.stderr +++ b/src/test/ui/derives/derives-span-Eq-enum.stderr @@ -5,6 +5,7 @@ LL | Error | ^^^^^ the trait `std::cmp::Eq` is not implemented for `Error` | = note: required by `std::cmp::AssertParamIsEq` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/derives/derives-span-Eq-struct.stderr b/src/test/ui/derives/derives-span-Eq-struct.stderr index 10631cb12bf..76904d67235 100644 --- a/src/test/ui/derives/derives-span-Eq-struct.stderr +++ b/src/test/ui/derives/derives-span-Eq-struct.stderr @@ -5,6 +5,7 @@ LL | x: Error | ^^^^^^^^ the trait `std::cmp::Eq` is not implemented for `Error` | = note: required by `std::cmp::AssertParamIsEq` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/derives/derives-span-Eq-tuple-struct.stderr b/src/test/ui/derives/derives-span-Eq-tuple-struct.stderr index 117ed62cf7a..ff94b989d26 100644 --- a/src/test/ui/derives/derives-span-Eq-tuple-struct.stderr +++ b/src/test/ui/derives/derives-span-Eq-tuple-struct.stderr @@ -5,6 +5,7 @@ LL | Error | ^^^^^ the trait `std::cmp::Eq` is not implemented for `Error` | = note: required by `std::cmp::AssertParamIsEq` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/derives/derives-span-Hash-enum-struct-variant.stderr b/src/test/ui/derives/derives-span-Hash-enum-struct-variant.stderr index 00b033004ec..889c725c843 100644 --- a/src/test/ui/derives/derives-span-Hash-enum-struct-variant.stderr +++ b/src/test/ui/derives/derives-span-Hash-enum-struct-variant.stderr @@ -8,6 +8,8 @@ LL | x: Error | LL | fn hash(&self, state: &mut H); | - required by this bound in `std::hash::Hash::hash` + | + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/derives/derives-span-Hash-enum.stderr b/src/test/ui/derives/derives-span-Hash-enum.stderr index 004cabf207a..70b8a85d107 100644 --- a/src/test/ui/derives/derives-span-Hash-enum.stderr +++ b/src/test/ui/derives/derives-span-Hash-enum.stderr @@ -8,6 +8,8 @@ LL | Error | LL | fn hash(&self, state: &mut H); | - required by this bound in `std::hash::Hash::hash` + | + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/derives/derives-span-Hash-struct.stderr b/src/test/ui/derives/derives-span-Hash-struct.stderr index 27b8ff3d114..61897392a72 100644 --- a/src/test/ui/derives/derives-span-Hash-struct.stderr +++ b/src/test/ui/derives/derives-span-Hash-struct.stderr @@ -8,6 +8,8 @@ LL | x: Error | LL | fn hash(&self, state: &mut H); | - required by this bound in `std::hash::Hash::hash` + | + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/derives/derives-span-Hash-tuple-struct.stderr b/src/test/ui/derives/derives-span-Hash-tuple-struct.stderr index f1142bc5033..fb929ad985b 100644 --- a/src/test/ui/derives/derives-span-Hash-tuple-struct.stderr +++ b/src/test/ui/derives/derives-span-Hash-tuple-struct.stderr @@ -8,6 +8,8 @@ LL | Error | LL | fn hash(&self, state: &mut H); | - required by this bound in `std::hash::Hash::hash` + | + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/derives/derives-span-Ord-enum-struct-variant.stderr b/src/test/ui/derives/derives-span-Ord-enum-struct-variant.stderr index 1d9d1332b57..7e73392fd51 100644 --- a/src/test/ui/derives/derives-span-Ord-enum-struct-variant.stderr +++ b/src/test/ui/derives/derives-span-Ord-enum-struct-variant.stderr @@ -5,6 +5,7 @@ LL | x: Error | ^^^^^^^^ the trait `std::cmp::Ord` is not implemented for `Error` | = note: required by `std::cmp::Ord::cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/derives/derives-span-Ord-enum.stderr b/src/test/ui/derives/derives-span-Ord-enum.stderr index acc8b0c6948..68df309e046 100644 --- a/src/test/ui/derives/derives-span-Ord-enum.stderr +++ b/src/test/ui/derives/derives-span-Ord-enum.stderr @@ -5,6 +5,7 @@ LL | Error | ^^^^^ the trait `std::cmp::Ord` is not implemented for `Error` | = note: required by `std::cmp::Ord::cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/derives/derives-span-Ord-struct.stderr b/src/test/ui/derives/derives-span-Ord-struct.stderr index e4dcf29545f..5e1ed335094 100644 --- a/src/test/ui/derives/derives-span-Ord-struct.stderr +++ b/src/test/ui/derives/derives-span-Ord-struct.stderr @@ -5,6 +5,7 @@ LL | x: Error | ^^^^^^^^ the trait `std::cmp::Ord` is not implemented for `Error` | = note: required by `std::cmp::Ord::cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/derives/derives-span-Ord-tuple-struct.stderr b/src/test/ui/derives/derives-span-Ord-tuple-struct.stderr index c21dfc26cb0..d9692e56431 100644 --- a/src/test/ui/derives/derives-span-Ord-tuple-struct.stderr +++ b/src/test/ui/derives/derives-span-Ord-tuple-struct.stderr @@ -5,6 +5,7 @@ LL | Error | ^^^^^ the trait `std::cmp::Ord` is not implemented for `Error` | = note: required by `std::cmp::Ord::cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/derives/derives-span-PartialEq-enum-struct-variant.stderr b/src/test/ui/derives/derives-span-PartialEq-enum-struct-variant.stderr index eb4b1c84a60..c669636c850 100644 --- a/src/test/ui/derives/derives-span-PartialEq-enum-struct-variant.stderr +++ b/src/test/ui/derives/derives-span-PartialEq-enum-struct-variant.stderr @@ -5,6 +5,7 @@ LL | x: Error | ^^^^^^^^ | = note: an implementation of `std::cmp::PartialEq` might be missing for `Error` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0369]: binary operation `!=` cannot be applied to type `Error` --> $DIR/derives-span-PartialEq-enum-struct-variant.rs:13:6 @@ -13,6 +14,7 @@ LL | x: Error | ^^^^^^^^ | = note: an implementation of `std::cmp::PartialEq` might be missing for `Error` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 2 previous errors diff --git a/src/test/ui/derives/derives-span-PartialEq-enum.stderr b/src/test/ui/derives/derives-span-PartialEq-enum.stderr index b63e374d89b..ff98edea4dc 100644 --- a/src/test/ui/derives/derives-span-PartialEq-enum.stderr +++ b/src/test/ui/derives/derives-span-PartialEq-enum.stderr @@ -5,6 +5,7 @@ LL | Error | ^^^^^ | = note: an implementation of `std::cmp::PartialEq` might be missing for `Error` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0369]: binary operation `!=` cannot be applied to type `Error` --> $DIR/derives-span-PartialEq-enum.rs:13:6 @@ -13,6 +14,7 @@ LL | Error | ^^^^^ | = note: an implementation of `std::cmp::PartialEq` might be missing for `Error` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 2 previous errors diff --git a/src/test/ui/derives/derives-span-PartialEq-struct.stderr b/src/test/ui/derives/derives-span-PartialEq-struct.stderr index a147f409639..200b8e2d503 100644 --- a/src/test/ui/derives/derives-span-PartialEq-struct.stderr +++ b/src/test/ui/derives/derives-span-PartialEq-struct.stderr @@ -5,6 +5,7 @@ LL | x: Error | ^^^^^^^^ | = note: an implementation of `std::cmp::PartialEq` might be missing for `Error` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0369]: binary operation `!=` cannot be applied to type `Error` --> $DIR/derives-span-PartialEq-struct.rs:12:5 @@ -13,6 +14,7 @@ LL | x: Error | ^^^^^^^^ | = note: an implementation of `std::cmp::PartialEq` might be missing for `Error` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 2 previous errors diff --git a/src/test/ui/derives/derives-span-PartialEq-tuple-struct.stderr b/src/test/ui/derives/derives-span-PartialEq-tuple-struct.stderr index fefbf5f9ec9..9e3d1309c22 100644 --- a/src/test/ui/derives/derives-span-PartialEq-tuple-struct.stderr +++ b/src/test/ui/derives/derives-span-PartialEq-tuple-struct.stderr @@ -5,6 +5,7 @@ LL | Error | ^^^^^ | = note: an implementation of `std::cmp::PartialEq` might be missing for `Error` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0369]: binary operation `!=` cannot be applied to type `Error` --> $DIR/derives-span-PartialEq-tuple-struct.rs:12:5 @@ -13,6 +14,7 @@ LL | Error | ^^^^^ | = note: an implementation of `std::cmp::PartialEq` might be missing for `Error` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 2 previous errors diff --git a/src/test/ui/derives/derives-span-PartialOrd-enum-struct-variant.stderr b/src/test/ui/derives/derives-span-PartialOrd-enum-struct-variant.stderr index 80b896f4f04..6433d1f5e27 100644 --- a/src/test/ui/derives/derives-span-PartialOrd-enum-struct-variant.stderr +++ b/src/test/ui/derives/derives-span-PartialOrd-enum-struct-variant.stderr @@ -6,6 +6,7 @@ LL | x: Error | = help: the trait `std::cmp::PartialOrd` is not implemented for `Error` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `Error` with `Error` --> $DIR/derives-span-PartialOrd-enum-struct-variant.rs:13:6 @@ -15,6 +16,7 @@ LL | x: Error | = help: the trait `std::cmp::PartialOrd` is not implemented for `Error` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `Error` with `Error` --> $DIR/derives-span-PartialOrd-enum-struct-variant.rs:13:6 @@ -24,6 +26,7 @@ LL | x: Error | = help: the trait `std::cmp::PartialOrd` is not implemented for `Error` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `Error` with `Error` --> $DIR/derives-span-PartialOrd-enum-struct-variant.rs:13:6 @@ -33,6 +36,7 @@ LL | x: Error | = help: the trait `std::cmp::PartialOrd` is not implemented for `Error` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `Error` with `Error` --> $DIR/derives-span-PartialOrd-enum-struct-variant.rs:13:6 @@ -42,6 +46,7 @@ LL | x: Error | = help: the trait `std::cmp::PartialOrd` is not implemented for `Error` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 5 previous errors diff --git a/src/test/ui/derives/derives-span-PartialOrd-enum.stderr b/src/test/ui/derives/derives-span-PartialOrd-enum.stderr index f12038fb867..b1be7dd05f9 100644 --- a/src/test/ui/derives/derives-span-PartialOrd-enum.stderr +++ b/src/test/ui/derives/derives-span-PartialOrd-enum.stderr @@ -6,6 +6,7 @@ LL | Error | = help: the trait `std::cmp::PartialOrd` is not implemented for `Error` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `Error` with `Error` --> $DIR/derives-span-PartialOrd-enum.rs:13:6 @@ -15,6 +16,7 @@ LL | Error | = help: the trait `std::cmp::PartialOrd` is not implemented for `Error` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `Error` with `Error` --> $DIR/derives-span-PartialOrd-enum.rs:13:6 @@ -24,6 +26,7 @@ LL | Error | = help: the trait `std::cmp::PartialOrd` is not implemented for `Error` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `Error` with `Error` --> $DIR/derives-span-PartialOrd-enum.rs:13:6 @@ -33,6 +36,7 @@ LL | Error | = help: the trait `std::cmp::PartialOrd` is not implemented for `Error` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `Error` with `Error` --> $DIR/derives-span-PartialOrd-enum.rs:13:6 @@ -42,6 +46,7 @@ LL | Error | = help: the trait `std::cmp::PartialOrd` is not implemented for `Error` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 5 previous errors diff --git a/src/test/ui/derives/derives-span-PartialOrd-struct.stderr b/src/test/ui/derives/derives-span-PartialOrd-struct.stderr index dbb014752ec..064c91fd7dd 100644 --- a/src/test/ui/derives/derives-span-PartialOrd-struct.stderr +++ b/src/test/ui/derives/derives-span-PartialOrd-struct.stderr @@ -6,6 +6,7 @@ LL | x: Error | = help: the trait `std::cmp::PartialOrd` is not implemented for `Error` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `Error` with `Error` --> $DIR/derives-span-PartialOrd-struct.rs:12:5 @@ -15,6 +16,7 @@ LL | x: Error | = help: the trait `std::cmp::PartialOrd` is not implemented for `Error` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `Error` with `Error` --> $DIR/derives-span-PartialOrd-struct.rs:12:5 @@ -24,6 +26,7 @@ LL | x: Error | = help: the trait `std::cmp::PartialOrd` is not implemented for `Error` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `Error` with `Error` --> $DIR/derives-span-PartialOrd-struct.rs:12:5 @@ -33,6 +36,7 @@ LL | x: Error | = help: the trait `std::cmp::PartialOrd` is not implemented for `Error` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `Error` with `Error` --> $DIR/derives-span-PartialOrd-struct.rs:12:5 @@ -42,6 +46,7 @@ LL | x: Error | = help: the trait `std::cmp::PartialOrd` is not implemented for `Error` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 5 previous errors diff --git a/src/test/ui/derives/derives-span-PartialOrd-tuple-struct.stderr b/src/test/ui/derives/derives-span-PartialOrd-tuple-struct.stderr index f6f1694bbf0..5b627022cca 100644 --- a/src/test/ui/derives/derives-span-PartialOrd-tuple-struct.stderr +++ b/src/test/ui/derives/derives-span-PartialOrd-tuple-struct.stderr @@ -6,6 +6,7 @@ LL | Error | = help: the trait `std::cmp::PartialOrd` is not implemented for `Error` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `Error` with `Error` --> $DIR/derives-span-PartialOrd-tuple-struct.rs:12:5 @@ -15,6 +16,7 @@ LL | Error | = help: the trait `std::cmp::PartialOrd` is not implemented for `Error` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `Error` with `Error` --> $DIR/derives-span-PartialOrd-tuple-struct.rs:12:5 @@ -24,6 +26,7 @@ LL | Error | = help: the trait `std::cmp::PartialOrd` is not implemented for `Error` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `Error` with `Error` --> $DIR/derives-span-PartialOrd-tuple-struct.rs:12:5 @@ -33,6 +36,7 @@ LL | Error | = help: the trait `std::cmp::PartialOrd` is not implemented for `Error` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `Error` with `Error` --> $DIR/derives-span-PartialOrd-tuple-struct.rs:12:5 @@ -42,6 +46,7 @@ LL | Error | = help: the trait `std::cmp::PartialOrd` is not implemented for `Error` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 5 previous errors diff --git a/src/test/ui/derives/deriving-no-inner-impl-error-message.stderr b/src/test/ui/derives/deriving-no-inner-impl-error-message.stderr index 3b480f00df6..d4995c1d50c 100644 --- a/src/test/ui/derives/deriving-no-inner-impl-error-message.stderr +++ b/src/test/ui/derives/deriving-no-inner-impl-error-message.stderr @@ -5,6 +5,7 @@ LL | x: NoCloneOrEq | ^^^^^^^^^^^^^^ | = note: an implementation of `std::cmp::PartialEq` might be missing for `NoCloneOrEq` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0369]: binary operation `!=` cannot be applied to type `NoCloneOrEq` --> $DIR/deriving-no-inner-impl-error-message.rs:5:5 @@ -13,6 +14,7 @@ LL | x: NoCloneOrEq | ^^^^^^^^^^^^^^ | = note: an implementation of `std::cmp::PartialEq` might be missing for `NoCloneOrEq` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `NoCloneOrEq: std::clone::Clone` is not satisfied --> $DIR/deriving-no-inner-impl-error-message.rs:10:5 @@ -21,6 +23,7 @@ LL | x: NoCloneOrEq | ^^^^^^^^^^^^^^ the trait `std::clone::Clone` is not implemented for `NoCloneOrEq` | = note: required by `std::clone::Clone::clone` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 3 previous errors diff --git a/src/test/ui/derives/deriving-with-repr-packed.stderr b/src/test/ui/derives/deriving-with-repr-packed.stderr index 8ab2e4cba74..d739257c8de 100644 --- a/src/test/ui/derives/deriving-with-repr-packed.stderr +++ b/src/test/ui/derives/deriving-with-repr-packed.stderr @@ -11,6 +11,7 @@ LL | #![deny(safe_packed_borrows)] | ^^^^^^^^^^^^^^^^^^^ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #46043 + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: `#[derive]` can't be used on a `#[repr(packed)]` struct with type or const parameters (error E0133) --> $DIR/deriving-with-repr-packed.rs:8:23 @@ -20,6 +21,7 @@ LL | #[derive(Copy, Clone, PartialEq, Eq)] | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #46043 + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: `#[derive]` can't be used on a `#[repr(packed)]` struct that does not derive Copy (error E0133) --> $DIR/deriving-with-repr-packed.rs:16:10 @@ -29,6 +31,7 @@ LL | #[derive(PartialEq, Eq)] | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #46043 + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: `#[derive]` can't be used on a `#[repr(packed)]` struct that does not derive Copy (error E0133) --> $DIR/deriving-with-repr-packed.rs:25:10 @@ -38,6 +41,7 @@ LL | #[derive(PartialEq)] | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #46043 + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 4 previous errors diff --git a/src/test/ui/did_you_mean/bad-assoc-expr.stderr b/src/test/ui/did_you_mean/bad-assoc-expr.stderr index 2024564b911..fe3fb43730a 100644 --- a/src/test/ui/did_you_mean/bad-assoc-expr.stderr +++ b/src/test/ui/did_you_mean/bad-assoc-expr.stderr @@ -54,6 +54,8 @@ LL | ($ty: ty) => ($ty::clone(&0)) ... LL | expr!(u8); | ---------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 9 previous errors diff --git a/src/test/ui/did_you_mean/bad-assoc-pat.stderr b/src/test/ui/did_you_mean/bad-assoc-pat.stderr index 3f1946b94f6..924a5d75643 100644 --- a/src/test/ui/did_you_mean/bad-assoc-pat.stderr +++ b/src/test/ui/did_you_mean/bad-assoc-pat.stderr @@ -36,6 +36,8 @@ LL | ($ty: ty) => ($ty::AssocItem) ... LL | pat!(u8) => {} | -------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0599]: no associated item named `AssocItem` found for slice `[u8]` in the current scope --> $DIR/bad-assoc-pat.rs:3:15 @@ -69,6 +71,8 @@ LL | ($ty: ty) => ($ty::AssocItem) ... LL | pat!(u8) => {} | -------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0599]: no associated item named `AssocItem` found for type `u8` in the current scope --> $DIR/bad-assoc-pat.rs:32:16 diff --git a/src/test/ui/did_you_mean/bad-assoc-ty.stderr b/src/test/ui/did_you_mean/bad-assoc-ty.stderr index 7d3c99bda6b..64e49934d87 100644 --- a/src/test/ui/did_you_mean/bad-assoc-ty.stderr +++ b/src/test/ui/did_you_mean/bad-assoc-ty.stderr @@ -54,6 +54,8 @@ LL | ($ty: ty) => ($ty::AssocTy); ... LL | type J = ty!(u8); | ------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0223]: ambiguous associated type --> $DIR/bad-assoc-ty.rs:1:10 @@ -111,6 +113,8 @@ LL | ($ty: ty) => ($ty::AssocTy); ... LL | type J = ty!(u8); | ------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0223]: ambiguous associated type --> $DIR/bad-assoc-ty.rs:44:10 diff --git a/src/test/ui/did_you_mean/recursion_limit_macro.stderr b/src/test/ui/did_you_mean/recursion_limit_macro.stderr index 18d321c24d8..4935c698f20 100644 --- a/src/test/ui/did_you_mean/recursion_limit_macro.stderr +++ b/src/test/ui/did_you_mean/recursion_limit_macro.stderr @@ -8,6 +8,7 @@ LL | recurse!(0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9); | -------------------------------------------------- in this macro invocation | = help: consider adding a `#![recursion_limit="20"]` attribute to your crate (`recursion_limit_macro`) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/dollar-crate/dollar-crate-is-keyword-2.stderr b/src/test/ui/dollar-crate/dollar-crate-is-keyword-2.stderr index 55261a5e6ae..2aad57dee7d 100644 --- a/src/test/ui/dollar-crate/dollar-crate-is-keyword-2.stderr +++ b/src/test/ui/dollar-crate/dollar-crate-is-keyword-2.stderr @@ -6,6 +6,8 @@ LL | use a::$crate::b; ... LL | m!(); | ----- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0432]: unresolved import `a::$crate` --> $DIR/dollar-crate-is-keyword-2.rs:5:13 @@ -15,6 +17,8 @@ LL | use a::$crate; ... LL | m!(); | ----- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0433]: failed to resolve: `$crate` in paths can only be used in start position --> $DIR/dollar-crate-is-keyword-2.rs:7:21 @@ -24,6 +28,8 @@ LL | type A = a::$crate; ... LL | m!(); | ----- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 3 previous errors diff --git a/src/test/ui/dollar-crate/dollar-crate-is-keyword.stderr b/src/test/ui/dollar-crate/dollar-crate-is-keyword.stderr index f5a5f13f912..d424bd2f285 100644 --- a/src/test/ui/dollar-crate/dollar-crate-is-keyword.stderr +++ b/src/test/ui/dollar-crate/dollar-crate-is-keyword.stderr @@ -6,6 +6,8 @@ LL | struct $crate {} ... LL | m!(); | ----- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: expected identifier, found reserved identifier `$crate` --> $DIR/dollar-crate-is-keyword.rs:10:23 @@ -15,6 +17,8 @@ LL | use $crate as $crate; ... LL | m!(); | ----- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: `$crate` may not be imported --> $DIR/dollar-crate-is-keyword.rs:9:9 @@ -24,6 +28,8 @@ LL | use $crate; ... LL | m!(); | ----- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: `$crate` may not be imported --> $DIR/dollar-crate-is-keyword.rs:10:9 @@ -33,6 +39,8 @@ LL | use $crate as $crate; ... LL | m!(); | ----- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 4 previous errors diff --git a/src/test/ui/drop/dynamic-drop.rs b/src/test/ui/drop/dynamic-drop.rs index b4406204a5d..659e520d4cd 100644 --- a/src/test/ui/drop/dynamic-drop.rs +++ b/src/test/ui/drop/dynamic-drop.rs @@ -184,7 +184,7 @@ fn generator(a: &Allocator, run_count: usize) { ); }; for _ in 0..run_count { - Pin::new(&mut gen).resume(); + Pin::new(&mut gen).resume(()); } } diff --git a/src/test/ui/editions/edition-imports-2015.stderr b/src/test/ui/editions/edition-imports-2015.stderr index 4aba5323cc5..ec8b88ecba2 100644 --- a/src/test/ui/editions/edition-imports-2015.stderr +++ b/src/test/ui/editions/edition-imports-2015.stderr @@ -4,7 +4,7 @@ error: cannot glob-import all possible crates LL | gen_glob!(); | ^^^^^^^^^^^^ | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/editions/edition-imports-2018.stderr b/src/test/ui/editions/edition-imports-2018.stderr index 6ef49b62560..087d2e33954 100644 --- a/src/test/ui/editions/edition-imports-2018.stderr +++ b/src/test/ui/editions/edition-imports-2018.stderr @@ -4,7 +4,7 @@ error: cannot glob-import all possible crates LL | gen_glob!(); | ^^^^^^^^^^^^ | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/editions/edition-imports-virtual-2015-gated.stderr b/src/test/ui/editions/edition-imports-virtual-2015-gated.stderr index e6d0f18a677..56cbd882cca 100644 --- a/src/test/ui/editions/edition-imports-virtual-2015-gated.stderr +++ b/src/test/ui/editions/edition-imports-virtual-2015-gated.stderr @@ -4,7 +4,7 @@ error[E0432]: unresolved import `E` LL | gen_gated!(); | ^^^^^^^^^^^^^ could not find `E` in `{{root}}` | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/editions/edition-keywords-2015-2018-expansion.stderr b/src/test/ui/editions/edition-keywords-2015-2018-expansion.stderr index 04a70cf9830..f44f81fce71 100644 --- a/src/test/ui/editions/edition-keywords-2015-2018-expansion.stderr +++ b/src/test/ui/editions/edition-keywords-2015-2018-expansion.stderr @@ -4,7 +4,7 @@ error: expected identifier, found keyword `async` LL | produces_async! {} | ^^^^^^^^^^^^^^^^^^ expected identifier, found keyword | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) help: you can escape reserved keywords to use them as identifiers | LL | () => (pub fn r#async () { }) diff --git a/src/test/ui/editions/edition-keywords-2018-2018-expansion.stderr b/src/test/ui/editions/edition-keywords-2018-2018-expansion.stderr index fb12051eed4..a8fc58fc0cb 100644 --- a/src/test/ui/editions/edition-keywords-2018-2018-expansion.stderr +++ b/src/test/ui/editions/edition-keywords-2018-2018-expansion.stderr @@ -4,7 +4,7 @@ error: expected identifier, found keyword `async` LL | produces_async! {} | ^^^^^^^^^^^^^^^^^^ expected identifier, found keyword | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) help: you can escape reserved keywords to use them as identifiers | LL | () => (pub fn r#async () { }) diff --git a/src/test/ui/error-codes/E0184.stderr b/src/test/ui/error-codes/E0184.stderr index b4128b95606..591ea29ff8c 100644 --- a/src/test/ui/error-codes/E0184.stderr +++ b/src/test/ui/error-codes/E0184.stderr @@ -3,6 +3,8 @@ error[E0184]: the trait `Copy` may not be implemented for this type; the type ha | LL | #[derive(Copy)] | ^^^^ Copy not allowed on types with destructors + | + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/error-codes/E0665.stderr b/src/test/ui/error-codes/E0665.stderr index 2c2b498e39a..3cb69492eb7 100644 --- a/src/test/ui/error-codes/E0665.stderr +++ b/src/test/ui/error-codes/E0665.stderr @@ -3,6 +3,8 @@ error[E0665]: `Default` cannot be derived for enums, only structs | LL | #[derive(Default)] | ^^^^^^^ + | + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/exclusive-drop-and-copy.stderr b/src/test/ui/exclusive-drop-and-copy.stderr index 9983aac4f9c..f1e725ec342 100644 --- a/src/test/ui/exclusive-drop-and-copy.stderr +++ b/src/test/ui/exclusive-drop-and-copy.stderr @@ -3,12 +3,16 @@ error[E0184]: the trait `Copy` may not be implemented for this type; the type ha | LL | #[derive(Copy, Clone)] | ^^^^ Copy not allowed on types with destructors + | + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0184]: the trait `Copy` may not be implemented for this type; the type has a destructor --> $DIR/exclusive-drop-and-copy.rs:10:10 | LL | #[derive(Copy, Clone)] | ^^^^ Copy not allowed on types with destructors + | + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 2 previous errors diff --git a/src/test/ui/feature-gates/feature-gate-allow-internal-unsafe-nested-macro.stderr b/src/test/ui/feature-gates/feature-gate-allow-internal-unsafe-nested-macro.stderr index 72f5642e72a..89c99b89ca8 100644 --- a/src/test/ui/feature-gates/feature-gate-allow-internal-unsafe-nested-macro.stderr +++ b/src/test/ui/feature-gates/feature-gate-allow-internal-unsafe-nested-macro.stderr @@ -8,6 +8,7 @@ LL | bar!(); | ------- in this macro invocation | = help: add `#![feature(allow_internal_unsafe)]` to the crate attributes to enable + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/feature-gates/feature-gate-allow-internal-unstable-nested-macro.stderr b/src/test/ui/feature-gates/feature-gate-allow-internal-unstable-nested-macro.stderr index 71005943362..935b95668e8 100644 --- a/src/test/ui/feature-gates/feature-gate-allow-internal-unstable-nested-macro.stderr +++ b/src/test/ui/feature-gates/feature-gate-allow-internal-unstable-nested-macro.stderr @@ -8,6 +8,7 @@ LL | bar!(); | ------- in this macro invocation | = help: add `#![feature(allow_internal_unstable)]` to the crate attributes to enable + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/feature-gates/feature-gate-concat_idents2.stderr b/src/test/ui/feature-gates/feature-gate-concat_idents2.stderr index 14519622c05..1c319c6dad4 100644 --- a/src/test/ui/feature-gates/feature-gate-concat_idents2.stderr +++ b/src/test/ui/feature-gates/feature-gate-concat_idents2.stderr @@ -12,6 +12,8 @@ error[E0425]: cannot find value `ab` in this scope | LL | concat_idents!(a, b); | ^^^^^^^^^^^^^^^^^^^^^ not found in this scope + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 2 previous errors diff --git a/src/test/ui/generator-yielding-or-returning-itself.rs b/src/test/ui/generator-yielding-or-returning-itself.rs index fd526679818..30788e3c186 100644 --- a/src/test/ui/generator-yielding-or-returning-itself.rs +++ b/src/test/ui/generator-yielding-or-returning-itself.rs @@ -13,7 +13,7 @@ pub fn want_cyclic_generator_return(_: T) fn supply_cyclic_generator_return() { want_cyclic_generator_return(|| { - //~^ ERROR closure/generator type that references itself + //~^ ERROR type mismatch if false { yield None.unwrap(); } None.unwrap() }) diff --git a/src/test/ui/generator-yielding-or-returning-itself.stderr b/src/test/ui/generator-yielding-or-returning-itself.stderr index c9a71e03858..1572219cf4a 100644 --- a/src/test/ui/generator-yielding-or-returning-itself.stderr +++ b/src/test/ui/generator-yielding-or-returning-itself.stderr @@ -1,13 +1,13 @@ -error[E0644]: closure/generator type that references itself - --> $DIR/generator-yielding-or-returning-itself.rs:15:34 +error[E0271]: type mismatch resolving `<[generator@$DIR/generator-yielding-or-returning-itself.rs:15:34: 19:6 _] as std::ops::Generator>::Return == [generator@$DIR/generator-yielding-or-returning-itself.rs:15:34: 19:6 _]` + --> $DIR/generator-yielding-or-returning-itself.rs:15:5 | -LL | want_cyclic_generator_return(|| { - | __________________________________^ -LL | | -LL | | if false { yield None.unwrap(); } -LL | | None.unwrap() -LL | | }) - | |_____^ cyclic type of infinite size +LL | pub fn want_cyclic_generator_return(_: T) + | ---------------------------- +LL | where T: Generator + | ---------- required by this bound in `want_cyclic_generator_return` +... +LL | want_cyclic_generator_return(|| { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cyclic type of infinite size | = note: closures cannot capture themselves or take themselves as argument; this error may be the result of a recent compiler bug-fix, @@ -30,5 +30,4 @@ LL | want_cyclic_generator_yield(|| { error: aborting due to 2 previous errors -Some errors have detailed explanations: E0271, E0644. -For more information about an error, try `rustc --explain E0271`. +For more information about this error, try `rustc --explain E0271`. diff --git a/src/test/ui/generator/auxiliary/xcrate-reachable.rs b/src/test/ui/generator/auxiliary/xcrate-reachable.rs index 33337f8038f..2dd5ea67523 100644 --- a/src/test/ui/generator/auxiliary/xcrate-reachable.rs +++ b/src/test/ui/generator/auxiliary/xcrate-reachable.rs @@ -6,7 +6,7 @@ fn msg() -> u32 { 0 } -pub fn foo() -> impl Generator { +pub fn foo() -> impl Generator<(), Yield=(), Return=u32> { || { yield; return msg(); diff --git a/src/test/ui/generator/auxiliary/xcrate.rs b/src/test/ui/generator/auxiliary/xcrate.rs index 613c495832f..d07abd0918c 100644 --- a/src/test/ui/generator/auxiliary/xcrate.rs +++ b/src/test/ui/generator/auxiliary/xcrate.rs @@ -3,7 +3,7 @@ use std::marker::Unpin; use std::ops::Generator; -pub fn foo() -> impl Generator { +pub fn foo() -> impl Generator<(), Yield = (), Return = ()> { || { if false { yield; @@ -11,7 +11,7 @@ pub fn foo() -> impl Generator { } } -pub fn bar(t: T) -> Box + Unpin> { +pub fn bar(t: T) -> Box + Unpin> { Box::new(|| { yield t; }) diff --git a/src/test/ui/generator/borrowing.rs b/src/test/ui/generator/borrowing.rs index 6234b738048..d36592583cd 100644 --- a/src/test/ui/generator/borrowing.rs +++ b/src/test/ui/generator/borrowing.rs @@ -6,7 +6,7 @@ use std::pin::Pin; fn main() { let _b = { let a = 3; - Pin::new(&mut || yield &a).resume() + Pin::new(&mut || yield &a).resume(()) //~^ ERROR: `a` does not live long enough }; diff --git a/src/test/ui/generator/borrowing.stderr b/src/test/ui/generator/borrowing.stderr index 3d58873f826..83987e19839 100644 --- a/src/test/ui/generator/borrowing.stderr +++ b/src/test/ui/generator/borrowing.stderr @@ -1,7 +1,7 @@ error[E0597]: `a` does not live long enough --> $DIR/borrowing.rs:9:33 | -LL | Pin::new(&mut || yield &a).resume() +LL | Pin::new(&mut || yield &a).resume(()) | ----------^ | | | | | borrowed value does not live long enough diff --git a/src/test/ui/generator/conditional-drop.rs b/src/test/ui/generator/conditional-drop.rs index 907f7a3c06d..990d94e6efc 100644 --- a/src/test/ui/generator/conditional-drop.rs +++ b/src/test/ui/generator/conditional-drop.rs @@ -35,9 +35,9 @@ fn t1() { }; let n = A.load(Ordering::SeqCst); - Pin::new(&mut a).resume(); + Pin::new(&mut a).resume(()); assert_eq!(A.load(Ordering::SeqCst), n + 1); - Pin::new(&mut a).resume(); + Pin::new(&mut a).resume(()); assert_eq!(A.load(Ordering::SeqCst), n + 1); } @@ -51,8 +51,8 @@ fn t2() { }; let n = A.load(Ordering::SeqCst); - Pin::new(&mut a).resume(); + Pin::new(&mut a).resume(()); assert_eq!(A.load(Ordering::SeqCst), n); - Pin::new(&mut a).resume(); + Pin::new(&mut a).resume(()); assert_eq!(A.load(Ordering::SeqCst), n + 1); } diff --git a/src/test/ui/generator/control-flow.rs b/src/test/ui/generator/control-flow.rs index df70e013bd3..9d4c217b76e 100644 --- a/src/test/ui/generator/control-flow.rs +++ b/src/test/ui/generator/control-flow.rs @@ -7,10 +7,10 @@ use std::ops::{GeneratorState, Generator}; use std::pin::Pin; fn finish(mut amt: usize, mut t: T) -> T::Return - where T: Generator + Unpin, + where T: Generator<(), Yield = ()> + Unpin, { loop { - match Pin::new(&mut t).resume() { + match Pin::new(&mut t).resume(()) { GeneratorState::Yielded(()) => amt = amt.checked_sub(1).unwrap(), GeneratorState::Complete(ret) => { assert_eq!(amt, 0); diff --git a/src/test/ui/generator/drop-and-replace.rs b/src/test/ui/generator/drop-and-replace.rs index bb33502815b..a9a50a122a1 100644 --- a/src/test/ui/generator/drop-and-replace.rs +++ b/src/test/ui/generator/drop-and-replace.rs @@ -37,7 +37,7 @@ fn main() { }; loop { - match Pin::new(&mut a).resume() { + match Pin::new(&mut a).resume(()) { GeneratorState::Complete(()) => break, _ => (), } diff --git a/src/test/ui/generator/drop-env.rs b/src/test/ui/generator/drop-env.rs index ac4e0665628..7ba71188104 100644 --- a/src/test/ui/generator/drop-env.rs +++ b/src/test/ui/generator/drop-env.rs @@ -30,7 +30,7 @@ fn t1() { }; let n = A.load(Ordering::SeqCst); - drop(Pin::new(&mut foo).resume()); + drop(Pin::new(&mut foo).resume(())); assert_eq!(A.load(Ordering::SeqCst), n); drop(foo); assert_eq!(A.load(Ordering::SeqCst), n + 1); @@ -43,7 +43,7 @@ fn t2() { }; let n = A.load(Ordering::SeqCst); - drop(Pin::new(&mut foo).resume()); + drop(Pin::new(&mut foo).resume(())); assert_eq!(A.load(Ordering::SeqCst), n + 1); drop(foo); assert_eq!(A.load(Ordering::SeqCst), n + 1); diff --git a/src/test/ui/generator/dropck-resume.rs b/src/test/ui/generator/dropck-resume.rs new file mode 100644 index 00000000000..4c18077f335 --- /dev/null +++ b/src/test/ui/generator/dropck-resume.rs @@ -0,0 +1,33 @@ +#![feature(generators, generator_trait)] + +use std::ops::{Generator, GeneratorState}; +use std::pin::Pin; + +struct SetToNone<'a: 'b, 'b>(&'b mut Option<&'a i32>); + +impl<'a, 'b> Drop for SetToNone<'a, 'b> { + fn drop(&mut self) { + *self.0 = None; + } +} + +fn drop_using_generator() -> i32 { + let mut y = Some(&0); + let z = &mut y; + let r; + { + let mut g = move |r| { + let _s = SetToNone(r); + yield; + }; + let mut g = Pin::new(&mut g); + g.as_mut().resume(z); + r = y.as_ref().unwrap(); + //~^ ERROR cannot borrow `y` as immutable because it is also borrowed as mutable + } + **r +} + +fn main() { + println!("{}", drop_using_generator()); +} diff --git a/src/test/ui/generator/dropck-resume.stderr b/src/test/ui/generator/dropck-resume.stderr new file mode 100644 index 00000000000..ecf92e7e3ae --- /dev/null +++ b/src/test/ui/generator/dropck-resume.stderr @@ -0,0 +1,15 @@ +error[E0502]: cannot borrow `y` as immutable because it is also borrowed as mutable + --> $DIR/dropck-resume.rs:25:13 + | +LL | let z = &mut y; + | ------ mutable borrow occurs here +... +LL | r = y.as_ref().unwrap(); + | ^ immutable borrow occurs here +LL | +LL | } + | - mutable borrow might be used here, when `g` is dropped and runs the destructor for generator + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0502`. diff --git a/src/test/ui/generator/dropck.rs b/src/test/ui/generator/dropck.rs index 65c61fbaac4..da00b230d9f 100644 --- a/src/test/ui/generator/dropck.rs +++ b/src/test/ui/generator/dropck.rs @@ -15,6 +15,6 @@ fn main() { let _d = ref_.take(); //~ ERROR `ref_` does not live long enough yield; }; - Pin::new(&mut gen).resume(); + Pin::new(&mut gen).resume(()); // drops the RefCell and then the Ref, leading to use-after-free } diff --git a/src/test/ui/generator/generator-region-requirements.rs b/src/test/ui/generator/generator-region-requirements.rs index 41cb339f459..5f0a6bb09b7 100644 --- a/src/test/ui/generator/generator-region-requirements.rs +++ b/src/test/ui/generator/generator-region-requirements.rs @@ -8,7 +8,7 @@ fn dangle(x: &mut i32) -> &'static mut i32 { x }; loop { - match Pin::new(&mut g).resume() { + match Pin::new(&mut g).resume(()) { GeneratorState::Complete(c) => return c, //~^ ERROR explicit lifetime required GeneratorState::Yielded(_) => (), diff --git a/src/test/ui/generator/issue-44197.rs b/src/test/ui/generator/issue-44197.rs index 6efaff50c1e..389b9d13969 100644 --- a/src/test/ui/generator/issue-44197.rs +++ b/src/test/ui/generator/issue-44197.rs @@ -2,14 +2,14 @@ #![feature(generators, generator_trait)] -use std::ops::{ Generator, GeneratorState }; +use std::ops::{Generator, GeneratorState}; use std::pin::Pin; fn foo(_: &str) -> String { String::new() } -fn bar(baz: String) -> impl Generator { +fn bar(baz: String) -> impl Generator<(), Yield = String, Return = ()> { move || { yield foo(&baz); } @@ -19,7 +19,7 @@ fn foo2(_: &str) -> Result { Err(()) } -fn bar2(baz: String) -> impl Generator { +fn bar2(baz: String) -> impl Generator<(), Yield = String, Return = ()> { move || { if let Ok(quux) = foo2(&baz) { yield quux; @@ -28,6 +28,9 @@ fn bar2(baz: String) -> impl Generator { } fn main() { - assert_eq!(Pin::new(&mut bar(String::new())).resume(), GeneratorState::Yielded(String::new())); - assert_eq!(Pin::new(&mut bar2(String::new())).resume(), GeneratorState::Complete(())); + assert_eq!( + Pin::new(&mut bar(String::new())).resume(()), + GeneratorState::Yielded(String::new()) + ); + assert_eq!(Pin::new(&mut bar2(String::new())).resume(()), GeneratorState::Complete(())); } diff --git a/src/test/ui/generator/issue-61442-stmt-expr-with-drop.rs b/src/test/ui/generator/issue-61442-stmt-expr-with-drop.rs index e3d19029348..187c374021d 100644 --- a/src/test/ui/generator/issue-61442-stmt-expr-with-drop.rs +++ b/src/test/ui/generator/issue-61442-stmt-expr-with-drop.rs @@ -18,12 +18,12 @@ fn drop_and_yield() { String::new(); yield; }; - Box::pin(x).as_mut().resume(); + Box::pin(x).as_mut().resume(()); let y = static || { String::new(); yield; }; - Box::pin(y).as_mut().resume(); + Box::pin(y).as_mut().resume(()); } fn main() { diff --git a/src/test/ui/generator/iterator-count.rs b/src/test/ui/generator/iterator-count.rs index ac7e122dd58..90eefe02f66 100644 --- a/src/test/ui/generator/iterator-count.rs +++ b/src/test/ui/generator/iterator-count.rs @@ -10,18 +10,18 @@ struct W(T); // This impl isn't safe in general, but the generator used in this test is movable // so it won't cause problems. -impl + Unpin> Iterator for W { +impl + Unpin> Iterator for W { type Item = T::Yield; fn next(&mut self) -> Option { - match Pin::new(&mut self.0).resume() { + match Pin::new(&mut self.0).resume(()) { GeneratorState::Complete(..) => None, GeneratorState::Yielded(v) => Some(v), } } } -fn test() -> impl Generator + Unpin { +fn test() -> impl Generator<(), Return=(), Yield=u8> + Unpin { || { for i in 1..6 { yield i diff --git a/src/test/ui/generator/live-upvar-across-yield.rs b/src/test/ui/generator/live-upvar-across-yield.rs index a1064165b2f..6a2e42a5573 100644 --- a/src/test/ui/generator/live-upvar-across-yield.rs +++ b/src/test/ui/generator/live-upvar-across-yield.rs @@ -10,5 +10,5 @@ fn main() { let mut a = || { b(yield); }; - Pin::new(&mut a).resume(); + Pin::new(&mut a).resume(()); } diff --git a/src/test/ui/generator/nested_generators.rs b/src/test/ui/generator/nested_generators.rs index b56cce1dc44..45519150eec 100644 --- a/src/test/ui/generator/nested_generators.rs +++ b/src/test/ui/generator/nested_generators.rs @@ -11,7 +11,7 @@ fn main() { yield 2; }; - match Pin::new(&mut sub_generator).resume() { + match Pin::new(&mut sub_generator).resume(()) { GeneratorState::Yielded(x) => { yield x; } diff --git a/src/test/ui/generator/no-parameters-on-generators.rs b/src/test/ui/generator/no-parameters-on-generators.rs deleted file mode 100644 index 6b5a5579339..00000000000 --- a/src/test/ui/generator/no-parameters-on-generators.rs +++ /dev/null @@ -1,8 +0,0 @@ -#![feature(generators)] - -fn main() { - let gen = |start| { //~ ERROR generators cannot have explicit parameters - //~^ ERROR type inside generator must be known in this context - yield; - }; -} diff --git a/src/test/ui/generator/no-parameters-on-generators.stderr b/src/test/ui/generator/no-parameters-on-generators.stderr deleted file mode 100644 index 5e8e043a391..00000000000 --- a/src/test/ui/generator/no-parameters-on-generators.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0628]: generators cannot have explicit parameters - --> $DIR/no-parameters-on-generators.rs:4:15 - | -LL | let gen = |start| { - | ^^^^^^^ - -error[E0698]: type inside generator must be known in this context - --> $DIR/no-parameters-on-generators.rs:4:16 - | -LL | let gen = |start| { - | ^^^^^ cannot infer type - | -note: the type is part of the generator because of this `yield` - --> $DIR/no-parameters-on-generators.rs:6:9 - | -LL | yield; - | ^^^^^ - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0698`. diff --git a/src/test/ui/generator/panic-drops-resume.rs b/src/test/ui/generator/panic-drops-resume.rs new file mode 100644 index 00000000000..29f4788b275 --- /dev/null +++ b/src/test/ui/generator/panic-drops-resume.rs @@ -0,0 +1,37 @@ +//! Tests that panics inside a generator will correctly drop the initial resume argument. + +// run-pass +// ignore-wasm no unwind support +// ignore-emscripten no unwind support + +#![feature(generators, generator_trait)] + +use std::ops::Generator; +use std::panic::{catch_unwind, AssertUnwindSafe}; +use std::pin::Pin; +use std::sync::atomic::{AtomicUsize, Ordering}; + +static DROP: AtomicUsize = AtomicUsize::new(0); + +struct Dropper {} + +impl Drop for Dropper { + fn drop(&mut self) { + DROP.fetch_add(1, Ordering::SeqCst); + } +} + +fn main() { + let mut gen = |_arg| { + if true { + panic!(); + } + yield (); + }; + let mut gen = Pin::new(&mut gen); + + assert_eq!(DROP.load(Ordering::Acquire), 0); + let res = catch_unwind(AssertUnwindSafe(|| gen.as_mut().resume(Dropper {}))); + assert!(res.is_err()); + assert_eq!(DROP.load(Ordering::Acquire), 1); +} diff --git a/src/test/ui/generator/panic-drops.rs b/src/test/ui/generator/panic-drops.rs index f88687858fd..c9a201725ae 100644 --- a/src/test/ui/generator/panic-drops.rs +++ b/src/test/ui/generator/panic-drops.rs @@ -35,7 +35,7 @@ fn main() { assert_eq!(A.load(Ordering::SeqCst), 0); let res = panic::catch_unwind(panic::AssertUnwindSafe(|| { - Pin::new(&mut foo).resume() + Pin::new(&mut foo).resume(()) })); assert!(res.is_err()); assert_eq!(A.load(Ordering::SeqCst), 1); @@ -50,7 +50,7 @@ fn main() { assert_eq!(A.load(Ordering::SeqCst), 1); let res = panic::catch_unwind(panic::AssertUnwindSafe(|| { - Pin::new(&mut foo).resume() + Pin::new(&mut foo).resume(()) })); assert!(res.is_err()); assert_eq!(A.load(Ordering::SeqCst), 1); diff --git a/src/test/ui/generator/panic-safe.rs b/src/test/ui/generator/panic-safe.rs index 5f6778674dc..500a3c9c295 100644 --- a/src/test/ui/generator/panic-safe.rs +++ b/src/test/ui/generator/panic-safe.rs @@ -17,13 +17,13 @@ fn main() { }; let res = panic::catch_unwind(panic::AssertUnwindSafe(|| { - Pin::new(&mut foo).resume() + Pin::new(&mut foo).resume(()) })); assert!(res.is_err()); for _ in 0..10 { let res = panic::catch_unwind(panic::AssertUnwindSafe(|| { - Pin::new(&mut foo).resume() + Pin::new(&mut foo).resume(()) })); assert!(res.is_err()); } diff --git a/src/test/ui/generator/resume-after-return.rs b/src/test/ui/generator/resume-after-return.rs index 71a68ff684a..efed08bd470 100644 --- a/src/test/ui/generator/resume-after-return.rs +++ b/src/test/ui/generator/resume-after-return.rs @@ -16,12 +16,12 @@ fn main() { yield; }; - match Pin::new(&mut foo).resume() { + match Pin::new(&mut foo).resume(()) { GeneratorState::Complete(()) => {} s => panic!("bad state: {:?}", s), } - match panic::catch_unwind(move || Pin::new(&mut foo).resume()) { + match panic::catch_unwind(move || Pin::new(&mut foo).resume(())) { Ok(_) => panic!("generator successfully resumed"), Err(_) => {} } diff --git a/src/test/ui/generator/resume-arg-late-bound.rs b/src/test/ui/generator/resume-arg-late-bound.rs new file mode 100644 index 00000000000..87b1f1a065b --- /dev/null +++ b/src/test/ui/generator/resume-arg-late-bound.rs @@ -0,0 +1,17 @@ +//! Tests that we cannot produce a generator that accepts a resume argument +//! with any lifetime and then stores it across a `yield`. + +#![feature(generators, generator_trait)] + +use std::ops::Generator; + +fn test(a: impl for<'a> Generator<&'a mut bool>) {} + +fn main() { + let gen = |arg: &mut bool| { + yield (); + *arg = true; + }; + test(gen); + //~^ ERROR type mismatch in function arguments +} diff --git a/src/test/ui/generator/resume-arg-late-bound.stderr b/src/test/ui/generator/resume-arg-late-bound.stderr new file mode 100644 index 00000000000..7719d5123f4 --- /dev/null +++ b/src/test/ui/generator/resume-arg-late-bound.stderr @@ -0,0 +1,15 @@ +error[E0631]: type mismatch in function arguments + --> $DIR/resume-arg-late-bound.rs:15:10 + | +LL | fn test(a: impl for<'a> Generator<&'a mut bool>) {} + | ---- ------------------------------- required by this bound in `test` +... +LL | test(gen); + | ^^^ + | | + | expected signature of `for<'a> fn(&'a mut bool) -> _` + | found signature of `fn(&mut bool) -> _` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0631`. diff --git a/src/test/ui/generator/resume-live-across-yield.rs b/src/test/ui/generator/resume-live-across-yield.rs new file mode 100644 index 00000000000..4c4cf117a55 --- /dev/null +++ b/src/test/ui/generator/resume-live-across-yield.rs @@ -0,0 +1,45 @@ +// run-pass + +#![feature(generators, generator_trait)] + +use std::ops::{Generator, GeneratorState}; +use std::pin::Pin; +use std::sync::atomic::{AtomicUsize, Ordering}; + +static DROP: AtomicUsize = AtomicUsize::new(0); + +#[derive(PartialEq, Eq, Debug)] +struct Dropper(String); + +impl Drop for Dropper { + fn drop(&mut self) { + DROP.fetch_add(1, Ordering::SeqCst); + } +} + +fn main() { + let mut g = |mut _d| { + _d = yield; + _d + }; + + let mut g = Pin::new(&mut g); + + assert_eq!( + g.as_mut().resume(Dropper(String::from("Hello world!"))), + GeneratorState::Yielded(()) + ); + assert_eq!(DROP.load(Ordering::Acquire), 0); + match g.as_mut().resume(Dropper(String::from("Number Two"))) { + GeneratorState::Complete(dropper) => { + assert_eq!(DROP.load(Ordering::Acquire), 1); + assert_eq!(dropper.0, "Number Two"); + drop(dropper); + assert_eq!(DROP.load(Ordering::Acquire), 2); + } + _ => unreachable!(), + } + + drop(g); + assert_eq!(DROP.load(Ordering::Acquire), 2); +} diff --git a/src/test/ui/generator/retain-resume-ref.rs b/src/test/ui/generator/retain-resume-ref.rs new file mode 100644 index 00000000000..0606ea71cdf --- /dev/null +++ b/src/test/ui/generator/retain-resume-ref.rs @@ -0,0 +1,25 @@ +//! This test ensures that a mutable reference cannot be passed as a resume argument twice. + +#![feature(generators, generator_trait)] + +use std::marker::Unpin; +use std::ops::{ + Generator, + GeneratorState::{self, *}, +}; +use std::pin::Pin; + +fn main() { + let mut thing = String::from("hello"); + + let mut gen = |r| { + if false { + yield r; + } + }; + + let mut gen = Pin::new(&mut gen); + gen.as_mut().resume(&mut thing); + gen.as_mut().resume(&mut thing); + //~^ cannot borrow `thing` as mutable more than once at a time +} diff --git a/src/test/ui/generator/retain-resume-ref.stderr b/src/test/ui/generator/retain-resume-ref.stderr new file mode 100644 index 00000000000..bc715c7030e --- /dev/null +++ b/src/test/ui/generator/retain-resume-ref.stderr @@ -0,0 +1,14 @@ +error[E0499]: cannot borrow `thing` as mutable more than once at a time + --> $DIR/retain-resume-ref.rs:23:25 + | +LL | gen.as_mut().resume(&mut thing); + | ---------- first mutable borrow occurs here +LL | gen.as_mut().resume(&mut thing); + | ^^^^^^^^^^ second mutable borrow occurs here +LL | +LL | } + | - first borrow might be used here, when `gen` is dropped and runs the destructor for generator + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0499`. diff --git a/src/test/ui/generator/sized-yield.rs b/src/test/ui/generator/sized-yield.rs index f64849b3149..c6dd738d6ac 100644 --- a/src/test/ui/generator/sized-yield.rs +++ b/src/test/ui/generator/sized-yield.rs @@ -9,6 +9,6 @@ fn main() { //~^ ERROR the size for values of type yield s[..]; }; - Pin::new(&mut gen).resume(); + Pin::new(&mut gen).resume(()); //~^ ERROR the size for values of type } diff --git a/src/test/ui/generator/sized-yield.stderr b/src/test/ui/generator/sized-yield.stderr index c2caac7ebe2..79aeec2ec02 100644 --- a/src/test/ui/generator/sized-yield.stderr +++ b/src/test/ui/generator/sized-yield.stderr @@ -15,7 +15,7 @@ LL | | }; error[E0277]: the size for values of type `str` cannot be known at compilation time --> $DIR/sized-yield.rs:12:23 | -LL | Pin::new(&mut gen).resume(); +LL | Pin::new(&mut gen).resume(()); | ^^^^^^ doesn't have a size known at compile-time | = help: the trait `std::marker::Sized` is not implemented for `str` diff --git a/src/test/ui/generator/smoke-resume-args.rs b/src/test/ui/generator/smoke-resume-args.rs new file mode 100644 index 00000000000..32f3ee32d77 --- /dev/null +++ b/src/test/ui/generator/smoke-resume-args.rs @@ -0,0 +1,97 @@ +// run-pass + +#![feature(generators, generator_trait)] + +use std::fmt::Debug; +use std::marker::Unpin; +use std::ops::{ + Generator, + GeneratorState::{self, *}, +}; +use std::pin::Pin; +use std::sync::atomic::{AtomicUsize, Ordering}; + +fn drain + Unpin, R, Y>( + gen: &mut G, + inout: Vec<(R, GeneratorState)>, +) where + Y: Debug + PartialEq, + G::Return: Debug + PartialEq, +{ + let mut gen = Pin::new(gen); + + for (input, out) in inout { + assert_eq!(gen.as_mut().resume(input), out); + } +} + +static DROPS: AtomicUsize = AtomicUsize::new(0); + +#[derive(Debug, PartialEq)] +struct DropMe; + +impl Drop for DropMe { + fn drop(&mut self) { + DROPS.fetch_add(1, Ordering::SeqCst); + } +} + +fn expect_drops(expected_drops: usize, f: impl FnOnce() -> T) -> T { + DROPS.store(0, Ordering::SeqCst); + + let res = f(); + + let actual_drops = DROPS.load(Ordering::SeqCst); + assert_eq!(actual_drops, expected_drops); + res +} + +fn main() { + drain( + &mut |mut b| { + while b != 0 { + b = yield (b + 1); + } + -1 + }, + vec![(1, Yielded(2)), (-45, Yielded(-44)), (500, Yielded(501)), (0, Complete(-1))], + ); + + expect_drops(2, || drain(&mut |a| yield a, vec![(DropMe, Yielded(DropMe))])); + + expect_drops(6, || { + drain( + &mut |a| yield yield a, + vec![(DropMe, Yielded(DropMe)), (DropMe, Yielded(DropMe)), (DropMe, Complete(DropMe))], + ) + }); + + #[allow(unreachable_code)] + expect_drops(2, || drain(&mut |a| yield return a, vec![(DropMe, Complete(DropMe))])); + + expect_drops(2, || { + drain( + &mut |a: DropMe| { + if false { yield () } else { a } + }, + vec![(DropMe, Complete(DropMe))], + ) + }); + + expect_drops(4, || { + drain( + #[allow(unused_assignments, unused_variables)] + &mut |mut a: DropMe| { + a = yield; + a = yield; + a = yield; + }, + vec![ + (DropMe, Yielded(())), + (DropMe, Yielded(())), + (DropMe, Yielded(())), + (DropMe, Complete(())), + ], + ) + }); +} diff --git a/src/test/ui/generator/smoke.rs b/src/test/ui/generator/smoke.rs index 533f2399084..9289710b34b 100644 --- a/src/test/ui/generator/smoke.rs +++ b/src/test/ui/generator/smoke.rs @@ -17,7 +17,7 @@ fn simple() { } }; - match Pin::new(&mut foo).resume() { + match Pin::new(&mut foo).resume(()) { GeneratorState::Complete(()) => {} s => panic!("bad state: {:?}", s), } @@ -33,7 +33,7 @@ fn return_capture() { a }; - match Pin::new(&mut foo).resume() { + match Pin::new(&mut foo).resume(()) { GeneratorState::Complete(ref s) if *s == "foo" => {} s => panic!("bad state: {:?}", s), } @@ -45,11 +45,11 @@ fn simple_yield() { yield; }; - match Pin::new(&mut foo).resume() { + match Pin::new(&mut foo).resume(()) { GeneratorState::Yielded(()) => {} s => panic!("bad state: {:?}", s), } - match Pin::new(&mut foo).resume() { + match Pin::new(&mut foo).resume(()) { GeneratorState::Complete(()) => {} s => panic!("bad state: {:?}", s), } @@ -62,11 +62,11 @@ fn yield_capture() { yield b; }; - match Pin::new(&mut foo).resume() { + match Pin::new(&mut foo).resume(()) { GeneratorState::Yielded(ref s) if *s == "foo" => {} s => panic!("bad state: {:?}", s), } - match Pin::new(&mut foo).resume() { + match Pin::new(&mut foo).resume(()) { GeneratorState::Complete(()) => {} s => panic!("bad state: {:?}", s), } @@ -79,11 +79,11 @@ fn simple_yield_value() { return String::from("foo") }; - match Pin::new(&mut foo).resume() { + match Pin::new(&mut foo).resume(()) { GeneratorState::Yielded(ref s) if *s == "bar" => {} s => panic!("bad state: {:?}", s), } - match Pin::new(&mut foo).resume() { + match Pin::new(&mut foo).resume(()) { GeneratorState::Complete(ref s) if *s == "foo" => {} s => panic!("bad state: {:?}", s), } @@ -97,11 +97,11 @@ fn return_after_yield() { return a }; - match Pin::new(&mut foo).resume() { + match Pin::new(&mut foo).resume(()) { GeneratorState::Yielded(()) => {} s => panic!("bad state: {:?}", s), } - match Pin::new(&mut foo).resume() { + match Pin::new(&mut foo).resume(()) { GeneratorState::Complete(ref s) if *s == "foo" => {} s => panic!("bad state: {:?}", s), } @@ -149,11 +149,11 @@ fn send_and_sync() { fn send_over_threads() { let mut foo = || { yield }; thread::spawn(move || { - match Pin::new(&mut foo).resume() { + match Pin::new(&mut foo).resume(()) { GeneratorState::Yielded(()) => {} s => panic!("bad state: {:?}", s), } - match Pin::new(&mut foo).resume() { + match Pin::new(&mut foo).resume(()) { GeneratorState::Complete(()) => {} s => panic!("bad state: {:?}", s), } @@ -162,11 +162,11 @@ fn send_over_threads() { let a = String::from("a"); let mut foo = || { yield a }; thread::spawn(move || { - match Pin::new(&mut foo).resume() { + match Pin::new(&mut foo).resume(()) { GeneratorState::Yielded(ref s) if *s == "a" => {} s => panic!("bad state: {:?}", s), } - match Pin::new(&mut foo).resume() { + match Pin::new(&mut foo).resume(()) { GeneratorState::Complete(()) => {} s => panic!("bad state: {:?}", s), } diff --git a/src/test/ui/generator/static-generators.rs b/src/test/ui/generator/static-generators.rs index 965d3c61c22..3980766c428 100644 --- a/src/test/ui/generator/static-generators.rs +++ b/src/test/ui/generator/static-generators.rs @@ -15,6 +15,6 @@ fn main() { // Safety: We shadow the original generator variable so have no safe API to // move it after this point. let mut generator = unsafe { Pin::new_unchecked(&mut generator) }; - assert_eq!(generator.as_mut().resume(), GeneratorState::Yielded(())); - assert_eq!(generator.as_mut().resume(), GeneratorState::Complete(())); + assert_eq!(generator.as_mut().resume(()), GeneratorState::Yielded(())); + assert_eq!(generator.as_mut().resume(()), GeneratorState::Complete(())); } diff --git a/src/test/ui/generator/too-many-parameters.rs b/src/test/ui/generator/too-many-parameters.rs new file mode 100644 index 00000000000..7a353ea298b --- /dev/null +++ b/src/test/ui/generator/too-many-parameters.rs @@ -0,0 +1,8 @@ +#![feature(generators)] + +fn main() { + |(), ()| { + //~^ error: too many parameters for a generator + yield; + }; +} diff --git a/src/test/ui/generator/too-many-parameters.stderr b/src/test/ui/generator/too-many-parameters.stderr new file mode 100644 index 00000000000..a297ee43de9 --- /dev/null +++ b/src/test/ui/generator/too-many-parameters.stderr @@ -0,0 +1,8 @@ +error[E0628]: too many parameters for a generator (expected 0 or 1 parameters) + --> $DIR/too-many-parameters.rs:4:5 + | +LL | |(), ()| { + | ^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/generator/type-mismatch-error.rs b/src/test/ui/generator/type-mismatch-error.rs new file mode 100644 index 00000000000..d39c788a84b --- /dev/null +++ b/src/test/ui/generator/type-mismatch-error.rs @@ -0,0 +1,22 @@ +//! Test that we get the expected type mismatch error instead of "closure is expected to take 0 +//! arguments" (which got introduced after implementing resume arguments). + +#![feature(generators, generator_trait)] + +use std::ops::Generator; + +fn f(_: G, _: G::Return) {} + +fn main() { + f( + |a: u8| { + if false { + yield (); + } else { + a + //~^ error: `if` and `else` have incompatible types + } + }, + 0u8, + ); +} diff --git a/src/test/ui/generator/type-mismatch-error.stderr b/src/test/ui/generator/type-mismatch-error.stderr new file mode 100644 index 00000000000..8f5949533e2 --- /dev/null +++ b/src/test/ui/generator/type-mismatch-error.stderr @@ -0,0 +1,19 @@ +error[E0308]: `if` and `else` have incompatible types + --> $DIR/type-mismatch-error.rs:16:17 + | +LL | / if false { +LL | | yield (); + | | --------- + | | | | + | | | help: consider removing this semicolon + | | expected because of this +LL | | } else { +LL | | a + | | ^ expected `()`, found `u8` +LL | | +LL | | } + | |_____________- `if` and `else` have incompatible types + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/generator/type-mismatch-signature-deduction.rs b/src/test/ui/generator/type-mismatch-signature-deduction.rs index b9c6bc5d079..7774ff48f56 100644 --- a/src/test/ui/generator/type-mismatch-signature-deduction.rs +++ b/src/test/ui/generator/type-mismatch-signature-deduction.rs @@ -2,15 +2,15 @@ use std::ops::Generator; -fn foo() -> impl Generator { +fn foo() -> impl Generator { //~ ERROR type mismatch || { if false { - return Ok(6); //~ ERROR mismatched types [E0308] + return Ok(6); } yield (); - 5 + 5 //~ ERROR mismatched types [E0308] } } diff --git a/src/test/ui/generator/type-mismatch-signature-deduction.stderr b/src/test/ui/generator/type-mismatch-signature-deduction.stderr index 8606ecd33da..8de77798ff4 100644 --- a/src/test/ui/generator/type-mismatch-signature-deduction.stderr +++ b/src/test/ui/generator/type-mismatch-signature-deduction.stderr @@ -1,12 +1,23 @@ error[E0308]: mismatched types - --> $DIR/type-mismatch-signature-deduction.rs:8:20 + --> $DIR/type-mismatch-signature-deduction.rs:13:9 | -LL | return Ok(6); - | ^^^^^ expected `i32`, found enum `std::result::Result` +LL | 5 + | ^ expected enum `std::result::Result`, found integer | - = note: expected type `i32` - found enum `std::result::Result<{integer}, _>` + = note: expected type `std::result::Result<{integer}, _>` + found type `{integer}` -error: aborting due to previous error +error[E0271]: type mismatch resolving `<[generator@$DIR/type-mismatch-signature-deduction.rs:6:5: 14:6 _] as std::ops::Generator>::Return == i32` + --> $DIR/type-mismatch-signature-deduction.rs:5:13 + | +LL | fn foo() -> impl Generator { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `std::result::Result`, found `i32` + | + = note: expected enum `std::result::Result<{integer}, _>` + found type `i32` + = note: the return type of a function must have a statically known size -For more information about this error, try `rustc --explain E0308`. +error: aborting due to 2 previous errors + +Some errors have detailed explanations: E0271, E0308. +For more information about an error, try `rustc --explain E0271`. diff --git a/src/test/ui/generator/xcrate-reachable.rs b/src/test/ui/generator/xcrate-reachable.rs index 9483ad7395e..1b1cff3387d 100644 --- a/src/test/ui/generator/xcrate-reachable.rs +++ b/src/test/ui/generator/xcrate-reachable.rs @@ -10,5 +10,5 @@ use std::ops::Generator; use std::pin::Pin; fn main() { - Pin::new(&mut foo::foo()).resume(); + Pin::new(&mut foo::foo()).resume(()); } diff --git a/src/test/ui/generator/xcrate.rs b/src/test/ui/generator/xcrate.rs index febf5c3583f..40986bbeb65 100644 --- a/src/test/ui/generator/xcrate.rs +++ b/src/test/ui/generator/xcrate.rs @@ -12,18 +12,18 @@ use std::pin::Pin; fn main() { let mut foo = xcrate::foo(); - match Pin::new(&mut foo).resume() { + match Pin::new(&mut foo).resume(()) { GeneratorState::Complete(()) => {} s => panic!("bad state: {:?}", s), } let mut foo = xcrate::bar(3); - match Pin::new(&mut foo).resume() { + match Pin::new(&mut foo).resume(()) { GeneratorState::Yielded(3) => {} s => panic!("bad state: {:?}", s), } - match Pin::new(&mut foo).resume() { + match Pin::new(&mut foo).resume(()) { GeneratorState::Complete(()) => {} s => panic!("bad state: {:?}", s), } diff --git a/src/test/ui/generator/yield-while-iterating.rs b/src/test/ui/generator/yield-while-iterating.rs index e42781d1279..985e5d8bdc8 100644 --- a/src/test/ui/generator/yield-while-iterating.rs +++ b/src/test/ui/generator/yield-while-iterating.rs @@ -43,7 +43,7 @@ fn yield_during_iter_borrowed_slice_3() { yield p; } }; - Pin::new(&mut b).resume(); + Pin::new(&mut b).resume(()); } fn yield_during_iter_borrowed_slice_4() { @@ -56,7 +56,7 @@ fn yield_during_iter_borrowed_slice_4() { } }; println!("{}", x[0]); //~ ERROR - Pin::new(&mut b).resume(); + Pin::new(&mut b).resume(()); } fn yield_during_range_iter() { @@ -69,7 +69,7 @@ fn yield_during_range_iter() { yield x; } }; - Pin::new(&mut b).resume(); + Pin::new(&mut b).resume(()); } fn main() { } diff --git a/src/test/ui/generator/yield-while-iterating.stderr b/src/test/ui/generator/yield-while-iterating.stderr index 6a96b25b19f..b6563475235 100644 --- a/src/test/ui/generator/yield-while-iterating.stderr +++ b/src/test/ui/generator/yield-while-iterating.stderr @@ -16,7 +16,7 @@ LL | for p in &mut x { ... LL | println!("{}", x[0]); | ^ immutable borrow occurs here -LL | Pin::new(&mut b).resume(); +LL | Pin::new(&mut b).resume(()); | ------ mutable borrow later used here error: aborting due to 2 previous errors diff --git a/src/test/ui/generator/yield-while-local-borrowed.rs b/src/test/ui/generator/yield-while-local-borrowed.rs index b643bbf3376..061a64dbc36 100644 --- a/src/test/ui/generator/yield-while-local-borrowed.rs +++ b/src/test/ui/generator/yield-while-local-borrowed.rs @@ -15,7 +15,7 @@ fn borrow_local_inline() { yield(); println!("{}", a); }; - Pin::new(&mut b).resume(); + Pin::new(&mut b).resume(()); } fn borrow_local_inline_done() { @@ -26,7 +26,7 @@ fn borrow_local_inline_done() { } yield(); }; - Pin::new(&mut b).resume(); + Pin::new(&mut b).resume(()); } fn borrow_local() { @@ -43,7 +43,7 @@ fn borrow_local() { println!("{}", b); } }; - Pin::new(&mut b).resume(); + Pin::new(&mut b).resume(()); } fn main() { } diff --git a/src/test/ui/generator/yield-while-ref-reborrowed.rs b/src/test/ui/generator/yield-while-ref-reborrowed.rs index f54a4f468f6..a03ef945dd2 100644 --- a/src/test/ui/generator/yield-while-ref-reborrowed.rs +++ b/src/test/ui/generator/yield-while-ref-reborrowed.rs @@ -12,7 +12,7 @@ fn reborrow_shared_ref(x: &i32) { yield(); println!("{}", a); }; - Pin::new(&mut b).resume(); + Pin::new(&mut b).resume(()); } fn reborrow_mutable_ref(x: &mut i32) { @@ -23,7 +23,7 @@ fn reborrow_mutable_ref(x: &mut i32) { yield(); println!("{}", a); }; - Pin::new(&mut b).resume(); + Pin::new(&mut b).resume(()); } fn reborrow_mutable_ref_2(x: &mut i32) { @@ -34,7 +34,7 @@ fn reborrow_mutable_ref_2(x: &mut i32) { println!("{}", a); }; println!("{}", x); //~ ERROR - Pin::new(&mut b).resume(); + Pin::new(&mut b).resume(()); } fn main() { } diff --git a/src/test/ui/generator/yield-while-ref-reborrowed.stderr b/src/test/ui/generator/yield-while-ref-reborrowed.stderr index 4c37cd35173..fd885660d09 100644 --- a/src/test/ui/generator/yield-while-ref-reborrowed.stderr +++ b/src/test/ui/generator/yield-while-ref-reborrowed.stderr @@ -8,7 +8,7 @@ LL | let a = &mut *x; ... LL | println!("{}", x); | ^ second borrow occurs here -LL | Pin::new(&mut b).resume(); +LL | Pin::new(&mut b).resume(()); | ------ first borrow later used here error: aborting due to previous error diff --git a/src/test/ui/half-open-range-patterns/half-open-range-pats-inclusive-dotdotdot-bad-syntax.stderr b/src/test/ui/half-open-range-patterns/half-open-range-pats-inclusive-dotdotdot-bad-syntax.stderr index ba2e7ea8b53..3a9c918cd37 100644 --- a/src/test/ui/half-open-range-patterns/half-open-range-pats-inclusive-dotdotdot-bad-syntax.stderr +++ b/src/test/ui/half-open-range-patterns/half-open-range-pats-inclusive-dotdotdot-bad-syntax.stderr @@ -30,6 +30,8 @@ LL | let ...$e; ... LL | mac!(0); | -------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 5 previous errors diff --git a/src/test/ui/half-open-range-patterns/half-open-range-pats-inclusive-no-end.stderr b/src/test/ui/half-open-range-patterns/half-open-range-pats-inclusive-no-end.stderr index 2bdb8ea5766..871c9b57e54 100644 --- a/src/test/ui/half-open-range-patterns/half-open-range-pats-inclusive-no-end.stderr +++ b/src/test/ui/half-open-range-patterns/half-open-range-pats-inclusive-no-end.stderr @@ -40,6 +40,7 @@ LL | mac!(0); | -------- in this macro invocation | = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0586]: inclusive range with no end --> $DIR/half-open-range-pats-inclusive-no-end.rs:21:19 @@ -51,6 +52,7 @@ LL | mac!(0); | -------- in this macro invocation | = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 6 previous errors diff --git a/src/test/ui/hr-subtype/hr-subtype.bound_a_b_ret_a_vs_bound_a_ret_a.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_a_b_ret_a_vs_bound_a_ret_a.stderr index c8521a54e6c..b91798fa123 100644 --- a/src/test/ui/hr-subtype/hr-subtype.bound_a_b_ret_a_vs_bound_a_ret_a.stderr +++ b/src/test/ui/hr-subtype/hr-subtype.bound_a_b_ret_a_vs_bound_a_ret_a.stderr @@ -10,6 +10,7 @@ LL | | for<'a> fn(&'a u32, &'a u3 | = note: expected enum `std::option::Option fn(&'a u32, &'b u32) -> &'a u32>` found enum `std::option::Option fn(&'a u32, &'a u32) -> &'a u32>` + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/hr-subtype/hr-subtype.bound_a_b_vs_bound_a.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_a_b_vs_bound_a.stderr index 3ad802c5450..45f53d4fe99 100644 --- a/src/test/ui/hr-subtype/hr-subtype.bound_a_b_vs_bound_a.stderr +++ b/src/test/ui/hr-subtype/hr-subtype.bound_a_b_vs_bound_a.stderr @@ -10,6 +10,7 @@ LL | | for<'a> fn(&'a u32, &'a u32)) } | = note: expected enum `std::option::Option fn(&'a u32, &'b u32)>` found enum `std::option::Option fn(&'a u32, &'a u32)>` + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/hr-subtype/hr-subtype.bound_a_vs_free_x.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_a_vs_free_x.stderr index 3d09633367c..c3e4f6d2ed0 100644 --- a/src/test/ui/hr-subtype/hr-subtype.bound_a_vs_free_x.stderr +++ b/src/test/ui/hr-subtype/hr-subtype.bound_a_vs_free_x.stderr @@ -10,6 +10,7 @@ LL | | fn(&'x u32)) } | = note: expected enum `std::option::Option fn(&'a u32)>` found enum `std::option::Option` + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/hr-subtype/hr-subtype.bound_co_a_b_vs_bound_co_a.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_co_a_b_vs_bound_co_a.stderr index 8b623a4c0be..4d7b86027f5 100644 --- a/src/test/ui/hr-subtype/hr-subtype.bound_co_a_b_vs_bound_co_a.stderr +++ b/src/test/ui/hr-subtype/hr-subtype.bound_co_a_b_vs_bound_co_a.stderr @@ -10,6 +10,7 @@ LL | | for<'a> fn(Co<'a>, Co<'a>)) } | = note: expected enum `std::option::Option fn(Co<'a>, Co<'b>)>` found enum `std::option::Option fn(Co<'a>, Co<'a>)>` + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/hr-subtype/hr-subtype.bound_co_a_co_b_ret_contra_a.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_co_a_co_b_ret_contra_a.stderr index f12bff69691..7f0a4197dd7 100644 --- a/src/test/ui/hr-subtype/hr-subtype.bound_co_a_co_b_ret_contra_a.stderr +++ b/src/test/ui/hr-subtype/hr-subtype.bound_co_a_co_b_ret_contra_a.stderr @@ -10,6 +10,7 @@ LL | | for<'a> fn(Co<'a>, Co<'a>) -> | = note: expected enum `std::option::Option fn(Co<'a>, Co<'b>) -> Contra<'a>>` found enum `std::option::Option fn(Co<'a>, Co<'a>) -> Contra<'a>>` + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/hr-subtype/hr-subtype.bound_contra_a_contra_b_ret_co_a.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_contra_a_contra_b_ret_co_a.stderr index 37ba44cf2e9..c12e543a44e 100644 --- a/src/test/ui/hr-subtype/hr-subtype.bound_contra_a_contra_b_ret_co_a.stderr +++ b/src/test/ui/hr-subtype/hr-subtype.bound_contra_a_contra_b_ret_co_a.stderr @@ -10,6 +10,7 @@ LL | | for<'a> fn(Contra<'a>, Con | = note: expected enum `std::option::Option fn(Contra<'a>, Contra<'b>) -> Co<'a>>` found enum `std::option::Option fn(Contra<'a>, Contra<'a>) -> Co<'a>>` + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/hr-subtype/hr-subtype.bound_inv_a_b_vs_bound_inv_a.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_inv_a_b_vs_bound_inv_a.stderr index a00bbea6d18..460356856bd 100644 --- a/src/test/ui/hr-subtype/hr-subtype.bound_inv_a_b_vs_bound_inv_a.stderr +++ b/src/test/ui/hr-subtype/hr-subtype.bound_inv_a_b_vs_bound_inv_a.stderr @@ -10,6 +10,7 @@ LL | | for<'a> fn(Inv<'a>, Inv<'a>)) | = note: expected enum `std::option::Option fn(Inv<'a>, Inv<'b>)>` found enum `std::option::Option fn(Inv<'a>, Inv<'a>)>` + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.nll.stderr b/src/test/ui/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.nll.stderr index 9b0c987c054..6b5e7a5a634 100644 --- a/src/test/ui/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.nll.stderr +++ b/src/test/ui/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.nll.stderr @@ -13,6 +13,7 @@ LL | | fn(Inv<'y>)) } | |__________________________________________________- in this macro invocation | = help: consider adding the following bound: `'x: 'y` + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: lifetime may not live long enough --> $DIR/hr-subtype.rs:39:13 @@ -29,6 +30,7 @@ LL | | fn(Inv<'y>)) } | |__________________________________________________- in this macro invocation | = help: consider adding the following bound: `'x: 'y` + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 2 previous errors diff --git a/src/test/ui/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.stderr b/src/test/ui/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.stderr index 561f3519176..fc3643306e6 100644 --- a/src/test/ui/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.stderr +++ b/src/test/ui/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.stderr @@ -28,6 +28,7 @@ LL | fn subtype<'x,'y:'x,'z:'y>() { LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>), LL | | fn(Inv<'y>)) } | |__________________________________________________- in this macro invocation + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0308]: mismatched types --> $DIR/hr-subtype.rs:39:26 @@ -59,6 +60,7 @@ LL | fn supertype<'x,'y:'x,'z:'y>() { LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>), LL | | fn(Inv<'y>)) } | |__________________________________________________- in this macro invocation + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 2 previous errors diff --git a/src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_y.nll.stderr b/src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_y.nll.stderr index 48558fad005..7c0770924da 100644 --- a/src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_y.nll.stderr +++ b/src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_y.nll.stderr @@ -13,6 +13,7 @@ LL | | fn(&'y u32)) } | |__________________________________________- in this macro invocation | = help: consider adding the following bound: `'x: 'y` + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_y.stderr b/src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_y.stderr index 082627050b3..0dde27788f6 100644 --- a/src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_y.stderr +++ b/src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_y.stderr @@ -28,6 +28,7 @@ LL | fn supertype<'x,'y:'x,'z:'y>() { LL | / check! { free_x_vs_free_y: (fn(&'x u32), LL | | fn(&'y u32)) } | |__________________________________________- in this macro invocation + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/hygiene/assoc_item_ctxt.stderr b/src/test/ui/hygiene/assoc_item_ctxt.stderr index 0d1c73eef0e..dec1bd62ca9 100644 --- a/src/test/ui/hygiene/assoc_item_ctxt.stderr +++ b/src/test/ui/hygiene/assoc_item_ctxt.stderr @@ -6,6 +6,8 @@ LL | fn method() {} ... LL | mac_trait_impl!(); | ------------------ in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0046]: not all trait items implemented, missing: `method` --> $DIR/assoc_item_ctxt.rs:34:9 @@ -18,6 +20,8 @@ LL | impl Tr for u8 { ... LL | mac_trait_impl!(); | ------------------ in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 2 previous errors diff --git a/src/test/ui/hygiene/duplicate_lifetimes.stderr b/src/test/ui/hygiene/duplicate_lifetimes.stderr index 7aaea6ff24e..04f5bed5e05 100644 --- a/src/test/ui/hygiene/duplicate_lifetimes.stderr +++ b/src/test/ui/hygiene/duplicate_lifetimes.stderr @@ -9,6 +9,8 @@ LL | m!('a); | | | | | previous declaration here | in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0263]: lifetime name `'a` declared twice in the same scope --> $DIR/duplicate_lifetimes.rs:13:14 @@ -21,6 +23,8 @@ LL | n!('a); | | | | | previous declaration here | in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 2 previous errors diff --git a/src/test/ui/hygiene/extern-prelude-from-opaque-fail.stderr b/src/test/ui/hygiene/extern-prelude-from-opaque-fail.stderr index 65133eb1e18..b9e05c84a8a 100644 --- a/src/test/ui/hygiene/extern-prelude-from-opaque-fail.stderr +++ b/src/test/ui/hygiene/extern-prelude-from-opaque-fail.stderr @@ -15,6 +15,8 @@ LL | use my_core; ... LL | a!(); | ----- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0433]: failed to resolve: use of undeclared type or module `my_core` --> $DIR/extern-prelude-from-opaque-fail.rs:11:18 @@ -24,6 +26,8 @@ LL | fn f() { my_core::mem::drop(0); } ... LL | a!(); | ----- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0433]: failed to resolve: use of undeclared type or module `my_core` --> $DIR/extern-prelude-from-opaque-fail.rs:24:14 diff --git a/src/test/ui/hygiene/fields-definition.stderr b/src/test/ui/hygiene/fields-definition.stderr index a30650d88e2..8070ffdfdeb 100644 --- a/src/test/ui/hygiene/fields-definition.stderr +++ b/src/test/ui/hygiene/fields-definition.stderr @@ -8,6 +8,8 @@ LL | $a: u8, ... LL | legacy!(a); | ----------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/hygiene/fields-move.stderr b/src/test/ui/hygiene/fields-move.stderr index 562f60e31b5..5ce786dce83 100644 --- a/src/test/ui/hygiene/fields-move.stderr +++ b/src/test/ui/hygiene/fields-move.stderr @@ -10,6 +10,7 @@ LL | assert_two_copies(copy_legacy!(foo), foo.x); | ----------------- in this macro invocation | = note: move occurs because `foo.x` has type `NonCopy`, which does not implement the `Copy` trait + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0382]: use of moved value: `foo.x` --> $DIR/fields-move.rs:28:42 diff --git a/src/test/ui/hygiene/fields.stderr b/src/test/ui/hygiene/fields.stderr index 20ea4e91067..89deef49202 100644 --- a/src/test/ui/hygiene/fields.stderr +++ b/src/test/ui/hygiene/fields.stderr @@ -6,6 +6,8 @@ LL | let s = S { x: 0 }; ... LL | let s = foo::m!(S, x); | ------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `foo::S` is private --> $DIR/fields.rs:16:17 @@ -15,6 +17,8 @@ LL | let _ = s.x; ... LL | let s = foo::m!(S, x); | ------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `foo::T` is private --> $DIR/fields.rs:18:17 @@ -24,6 +28,8 @@ LL | let t = T(0); ... LL | let s = foo::m!(S, x); | ------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `foo::T` is private --> $DIR/fields.rs:19:17 @@ -33,6 +39,8 @@ LL | let _ = t.0; ... LL | let s = foo::m!(S, x); | ------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 4 previous errors diff --git a/src/test/ui/hygiene/generate-mod.stderr b/src/test/ui/hygiene/generate-mod.stderr index 5e2c56d4bf4..073e1527b2e 100644 --- a/src/test/ui/hygiene/generate-mod.stderr +++ b/src/test/ui/hygiene/generate-mod.stderr @@ -18,6 +18,8 @@ LL | type A = FromOutside; ... LL | genmod_transparent!(); | ---------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0412]: cannot find type `Outer` in this scope --> $DIR/generate-mod.rs:20:22 @@ -27,6 +29,8 @@ LL | type Inner = Outer; ... LL | genmod_transparent!(); | ---------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0412]: cannot find type `FromOutside` in this scope --> $DIR/generate-mod.rs:28:18 @@ -36,6 +40,8 @@ LL | type A = FromOutside; ... LL | genmod_legacy!(); | ----------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0412]: cannot find type `Outer` in this scope --> $DIR/generate-mod.rs:29:22 @@ -45,6 +51,8 @@ LL | type Inner = Outer; ... LL | genmod_legacy!(); | ----------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 6 previous errors diff --git a/src/test/ui/hygiene/globs.stderr b/src/test/ui/hygiene/globs.stderr index f9fbf295aec..153ad8cbecf 100644 --- a/src/test/ui/hygiene/globs.stderr +++ b/src/test/ui/hygiene/globs.stderr @@ -22,6 +22,7 @@ LL | | f(); LL | | } | |_____- in this macro invocation | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) help: possible candidates are found in other modules, you can import them into scope | LL | use bar::g; @@ -42,6 +43,7 @@ LL | n!(f); | = note: possible candidate is found in another module, you can import it into scope: foo::f + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0425]: cannot find function `f` in this scope --> $DIR/globs.rs:65:17 @@ -54,6 +56,7 @@ LL | f | = note: possible candidate is found in another module, you can import it into scope: foo::f + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 4 previous errors diff --git a/src/test/ui/hygiene/hygienic-label-1.stderr b/src/test/ui/hygiene/hygienic-label-1.stderr index d61c0687c16..60df494e131 100644 --- a/src/test/ui/hygiene/hygienic-label-1.stderr +++ b/src/test/ui/hygiene/hygienic-label-1.stderr @@ -6,6 +6,8 @@ LL | () => { break 'x; } ... LL | 'x: loop { foo!() } | ------ in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/hygiene/hygienic-label-3.stderr b/src/test/ui/hygiene/hygienic-label-3.stderr index 0c4173a61aa..dbec71fcaa4 100644 --- a/src/test/ui/hygiene/hygienic-label-3.stderr +++ b/src/test/ui/hygiene/hygienic-label-3.stderr @@ -6,6 +6,8 @@ LL | () => { break 'x; } ... LL | foo!() | ------ in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/hygiene/hygienic-labels-in-let.stderr b/src/test/ui/hygiene/hygienic-labels-in-let.stderr index 4acb34f2dce..7c82a08753a 100644 --- a/src/test/ui/hygiene/hygienic-labels-in-let.stderr +++ b/src/test/ui/hygiene/hygienic-labels-in-let.stderr @@ -9,6 +9,8 @@ LL | 'x: loop { LL | // this 'x should refer to the outer loop, lexically LL | loop_x!(break 'x); | ------------------ in this macro invocation + | + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) warning: label name `'x` shadows a label name that is already in scope --> $DIR/hygienic-labels-in-let.rs:64:9 @@ -39,6 +41,8 @@ LL | 'x: loop { ... LL | loop_x!(break 'x); | ------------------ in this macro invocation + | + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) warning: label name `'x` shadows a label name that is already in scope --> $DIR/hygienic-labels-in-let.rs:16:9 @@ -51,6 +55,8 @@ LL | 'x: loop { $e } ... LL | loop_x!(break 'x); | ------------------ in this macro invocation + | + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) warning: label name `'x` shadows a label name that is already in scope --> $DIR/hygienic-labels-in-let.rs:16:9 @@ -63,6 +69,8 @@ LL | 'x: for _ in 0..1 { ... LL | loop_x!(break 'x); | ------------------ in this macro invocation + | + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) warning: label name `'x` shadows a label name that is already in scope --> $DIR/hygienic-labels-in-let.rs:76:9 @@ -111,6 +119,8 @@ LL | 'x: loop { ... LL | while_true!(break 'x); | ---------------------- in this macro invocation + | + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) warning: label name `'x` shadows a label name that is already in scope --> $DIR/hygienic-labels-in-let.rs:27:9 @@ -123,6 +133,8 @@ LL | 'x: while 1 + 1 == 2 { $e } ... LL | while_true!(break 'x); | ---------------------- in this macro invocation + | + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) warning: label name `'x` shadows a label name that is already in scope --> $DIR/hygienic-labels-in-let.rs:27:9 @@ -135,6 +147,8 @@ LL | 'x: for _ in 0..1 { ... LL | while_true!(break 'x); | ---------------------- in this macro invocation + | + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) warning: label name `'x` shadows a label name that is already in scope --> $DIR/hygienic-labels-in-let.rs:27:9 @@ -147,6 +161,8 @@ LL | 'x: while 1 + 1 == 2 { $e } ... LL | while_true!(break 'x); | ---------------------- in this macro invocation + | + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) warning: label name `'x` shadows a label name that is already in scope --> $DIR/hygienic-labels-in-let.rs:27:9 @@ -159,6 +175,8 @@ LL | 'x: for _ in 0..1 { ... LL | while_true!(break 'x); | ---------------------- in this macro invocation + | + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) warning: label name `'x` shadows a label name that is already in scope --> $DIR/hygienic-labels-in-let.rs:90:9 @@ -225,6 +243,8 @@ LL | 'x: loop { ... LL | run_once!(continue 'x); | ----------------------- in this macro invocation + | + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) warning: label name `'x` shadows a label name that is already in scope --> $DIR/hygienic-labels-in-let.rs:39:9 @@ -237,6 +257,8 @@ LL | 'x: for _ in 0..1 { $e } ... LL | run_once!(continue 'x); | ----------------------- in this macro invocation + | + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) warning: label name `'x` shadows a label name that is already in scope --> $DIR/hygienic-labels-in-let.rs:39:9 @@ -249,6 +271,8 @@ LL | 'x: for _ in 0..1 { ... LL | run_once!(continue 'x); | ----------------------- in this macro invocation + | + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) warning: label name `'x` shadows a label name that is already in scope --> $DIR/hygienic-labels-in-let.rs:39:9 @@ -261,6 +285,8 @@ LL | 'x: for _ in 0..1 { $e } ... LL | run_once!(continue 'x); | ----------------------- in this macro invocation + | + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) warning: label name `'x` shadows a label name that is already in scope --> $DIR/hygienic-labels-in-let.rs:39:9 @@ -273,6 +299,8 @@ LL | 'x: for _ in 0..1 { ... LL | run_once!(continue 'x); | ----------------------- in this macro invocation + | + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) warning: label name `'x` shadows a label name that is already in scope --> $DIR/hygienic-labels-in-let.rs:39:9 @@ -285,6 +313,8 @@ LL | 'x: for _ in 0..1 { $e } ... LL | run_once!(continue 'x); | ----------------------- in this macro invocation + | + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) warning: label name `'x` shadows a label name that is already in scope --> $DIR/hygienic-labels-in-let.rs:39:9 @@ -297,4 +327,6 @@ LL | 'x: for _ in 0..1 { ... LL | run_once!(continue 'x); | ----------------------- in this macro invocation + | + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/src/test/ui/hygiene/hygienic-labels.stderr b/src/test/ui/hygiene/hygienic-labels.stderr index 0833825940a..960da15ef3c 100644 --- a/src/test/ui/hygiene/hygienic-labels.stderr +++ b/src/test/ui/hygiene/hygienic-labels.stderr @@ -9,6 +9,8 @@ LL | 'x: for _ in 0..1 { LL | // this 'x should refer to the outer loop, lexically LL | loop_x!(break 'x); | ------------------ in this macro invocation + | + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) warning: label name `'x` shadows a label name that is already in scope --> $DIR/hygienic-labels.rs:54:5 @@ -39,6 +41,8 @@ LL | 'x: for _ in 0..1 { ... LL | loop_x!(break 'x); | ------------------ in this macro invocation + | + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) warning: label name `'x` shadows a label name that is already in scope --> $DIR/hygienic-labels.rs:13:9 @@ -51,6 +55,8 @@ LL | 'x: loop { $e } ... LL | loop_x!(break 'x); | ------------------ in this macro invocation + | + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) warning: label name `'x` shadows a label name that is already in scope --> $DIR/hygienic-labels.rs:13:9 @@ -63,6 +69,8 @@ LL | 'x: loop { ... LL | loop_x!(break 'x); | ------------------ in this macro invocation + | + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) warning: label name `'x` shadows a label name that is already in scope --> $DIR/hygienic-labels.rs:63:5 @@ -111,6 +119,8 @@ LL | 'x: for _ in 0..1 { ... LL | while_x!(break 'x); | ------------------- in this macro invocation + | + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) warning: label name `'x` shadows a label name that is already in scope --> $DIR/hygienic-labels.rs:38:9 @@ -123,6 +133,8 @@ LL | 'x: while 1 + 1 == 2 { $e } ... LL | while_x!(break 'x); | ------------------- in this macro invocation + | + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) warning: label name `'x` shadows a label name that is already in scope --> $DIR/hygienic-labels.rs:38:9 @@ -135,6 +147,8 @@ LL | 'x: loop { ... LL | while_x!(break 'x); | ------------------- in this macro invocation + | + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) warning: label name `'x` shadows a label name that is already in scope --> $DIR/hygienic-labels.rs:38:9 @@ -147,6 +161,8 @@ LL | 'x: while 1 + 1 == 2 { $e } ... LL | while_x!(break 'x); | ------------------- in this macro invocation + | + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) warning: label name `'x` shadows a label name that is already in scope --> $DIR/hygienic-labels.rs:38:9 @@ -159,6 +175,8 @@ LL | 'x: while 1 + 1 == 2 { ... LL | while_x!(break 'x); | ------------------- in this macro invocation + | + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) warning: label name `'x` shadows a label name that is already in scope --> $DIR/hygienic-labels.rs:73:5 @@ -225,6 +243,8 @@ LL | 'x: for _ in 0..1 { ... LL | run_once!(continue 'x); | ----------------------- in this macro invocation + | + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) warning: label name `'x` shadows a label name that is already in scope --> $DIR/hygienic-labels.rs:24:9 @@ -237,6 +257,8 @@ LL | 'x: for _ in 0..1 { $e } ... LL | run_once!(continue 'x); | ----------------------- in this macro invocation + | + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) warning: label name `'x` shadows a label name that is already in scope --> $DIR/hygienic-labels.rs:24:9 @@ -249,6 +271,8 @@ LL | 'x: loop { ... LL | run_once!(continue 'x); | ----------------------- in this macro invocation + | + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) warning: label name `'x` shadows a label name that is already in scope --> $DIR/hygienic-labels.rs:24:9 @@ -261,6 +285,8 @@ LL | 'x: for _ in 0..1 { $e } ... LL | run_once!(continue 'x); | ----------------------- in this macro invocation + | + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) warning: label name `'x` shadows a label name that is already in scope --> $DIR/hygienic-labels.rs:24:9 @@ -273,6 +299,8 @@ LL | 'x: while 1 + 1 == 2 { ... LL | run_once!(continue 'x); | ----------------------- in this macro invocation + | + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) warning: label name `'x` shadows a label name that is already in scope --> $DIR/hygienic-labels.rs:24:9 @@ -285,6 +313,8 @@ LL | 'x: while 1 + 1 == 2 { $e } ... LL | run_once!(continue 'x); | ----------------------- in this macro invocation + | + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) warning: label name `'x` shadows a label name that is already in scope --> $DIR/hygienic-labels.rs:24:9 @@ -297,4 +327,6 @@ LL | 'x: for _ in 0..1 { ... LL | run_once!(continue 'x); | ----------------------- in this macro invocation + | + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/src/test/ui/hygiene/impl_items.stderr b/src/test/ui/hygiene/impl_items.stderr index 418c2c73ba1..85ee9f4cbf3 100644 --- a/src/test/ui/hygiene/impl_items.stderr +++ b/src/test/ui/hygiene/impl_items.stderr @@ -6,6 +6,8 @@ LL | let _: () = S.f(); ... LL | foo::m!(); | ---------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/hygiene/intercrate.stderr b/src/test/ui/hygiene/intercrate.stderr index 30a5570b2ad..3912ca337fb 100644 --- a/src/test/ui/hygiene/intercrate.stderr +++ b/src/test/ui/hygiene/intercrate.stderr @@ -4,7 +4,7 @@ error: type `fn() -> u32 {intercrate::foo::bar::f}` is private LL | assert_eq!(intercrate::foo::m!(), 1); | ^^^^^^^^^^^^^^^^^^^^^ | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/hygiene/no_implicit_prelude.stderr b/src/test/ui/hygiene/no_implicit_prelude.stderr index 5d75f5034bc..986671c7810 100644 --- a/src/test/ui/hygiene/no_implicit_prelude.stderr +++ b/src/test/ui/hygiene/no_implicit_prelude.stderr @@ -4,7 +4,7 @@ error: cannot find macro `panic` in this scope LL | assert_eq!(0, 0); | ^^^^^^^^^^^^^^^^^ | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0433]: failed to resolve: use of undeclared type or module `Vec` --> $DIR/no_implicit_prelude.rs:11:9 @@ -14,6 +14,8 @@ LL | fn f() { ::bar::m!(); } ... LL | Vec::new(); | ^^^ use of undeclared type or module `Vec` + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0599]: no method named `clone` found for unit type `()` in the current scope --> $DIR/no_implicit_prelude.rs:12:12 @@ -27,6 +29,7 @@ LL | ().clone() = help: items from traits can only be used if the trait is in scope = note: the following trait is implemented but not in scope; perhaps add a `use` for it: `use std::clone::Clone;` + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 3 previous errors diff --git a/src/test/ui/hygiene/privacy-early.stderr b/src/test/ui/hygiene/privacy-early.stderr index 60e50e05fc3..afc94bf79f6 100644 --- a/src/test/ui/hygiene/privacy-early.stderr +++ b/src/test/ui/hygiene/privacy-early.stderr @@ -15,6 +15,7 @@ LL | use f as g; ... LL | foo::m!(); | ---------- in this macro invocation + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/hygiene/trait_items.stderr b/src/test/ui/hygiene/trait_items.stderr index 8e3609292a7..d24336883e9 100644 --- a/src/test/ui/hygiene/trait_items.stderr +++ b/src/test/ui/hygiene/trait_items.stderr @@ -10,6 +10,7 @@ LL | pub macro m() { ().f() } = help: items from traits can only be used if the trait is in scope = note: the following trait is implemented but not in scope; perhaps add a `use` for it: `use foo::T;` + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/if/if-let.stderr b/src/test/ui/if/if-let.stderr index 570a64e999c..ad4aefb6e58 100644 --- a/src/test/ui/if/if-let.stderr +++ b/src/test/ui/if/if-let.stderr @@ -10,6 +10,7 @@ LL | | }); | |_______- in this macro invocation | = note: `#[warn(irrefutable_let_patterns)]` on by default + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) warning: irrefutable if-let pattern --> $DIR/if-let.rs:6:13 @@ -21,6 +22,8 @@ LL | / bar!(a, 1, { LL | | println!("irrefutable pattern"); LL | | }); | |_______- in this macro invocation + | + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) warning: irrefutable if-let pattern --> $DIR/if-let.rs:26:5 diff --git a/src/test/ui/if/ifmt-bad-arg.stderr b/src/test/ui/if/ifmt-bad-arg.stderr index c024094dd56..3e5f5a63742 100644 --- a/src/test/ui/if/ifmt-bad-arg.stderr +++ b/src/test/ui/if/ifmt-bad-arg.stderr @@ -300,6 +300,7 @@ LL | println!("{} {:.*} {}", 1, 3.2, 4); | = note: expected reference `&usize` found reference `&{float}` + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0308]: mismatched types --> $DIR/ifmt-bad-arg.rs:81:35 @@ -309,6 +310,7 @@ LL | println!("{} {:07$.*} {}", 1, 3.2, 4); | = note: expected reference `&usize` found reference `&{float}` + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 36 previous errors diff --git a/src/test/ui/if/ifmt-bad-format-args.stderr b/src/test/ui/if/ifmt-bad-format-args.stderr index 23252b6b5f4..8bb0d40629f 100644 --- a/src/test/ui/if/ifmt-bad-format-args.stderr +++ b/src/test/ui/if/ifmt-bad-format-args.stderr @@ -3,6 +3,8 @@ error: requires at least a format string argument | LL | format_args!(); | ^^^^^^^^^^^^^^^ + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: format argument must be a string literal --> $DIR/ifmt-bad-format-args.rs:3:18 diff --git a/src/test/ui/if/ifmt-unimpl.stderr b/src/test/ui/if/ifmt-unimpl.stderr index 7a7e4b34d25..a142896ada5 100644 --- a/src/test/ui/if/ifmt-unimpl.stderr +++ b/src/test/ui/if/ifmt-unimpl.stderr @@ -6,6 +6,7 @@ LL | format!("{:X}", "3"); | = note: required because of the requirements on the impl of `std::fmt::UpperHex` for `&str` = note: required by `std::fmt::UpperHex::fmt` + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/imports/extern-prelude-extern-crate-fail.stderr b/src/test/ui/imports/extern-prelude-extern-crate-fail.stderr index e067432b392..f7544306d34 100644 --- a/src/test/ui/imports/extern-prelude-extern-crate-fail.stderr +++ b/src/test/ui/imports/extern-prelude-extern-crate-fail.stderr @@ -6,6 +6,8 @@ LL | extern crate std as non_existent; ... LL | define_std_as_non_existent!(); | ------------------------------ in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0433]: failed to resolve: use of undeclared type or module `two_macros` --> $DIR/extern-prelude-extern-crate-fail.rs:10:9 diff --git a/src/test/ui/imports/extern-prelude-extern-crate-restricted-shadowing.stderr b/src/test/ui/imports/extern-prelude-extern-crate-restricted-shadowing.stderr index 245013a4ea4..e344d059147 100644 --- a/src/test/ui/imports/extern-prelude-extern-crate-restricted-shadowing.stderr +++ b/src/test/ui/imports/extern-prelude-extern-crate-restricted-shadowing.stderr @@ -6,6 +6,8 @@ LL | extern crate std as core; ... LL | define_other_core!(); | --------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0659]: `Vec` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution) --> $DIR/extern-prelude-extern-crate-restricted-shadowing.rs:17:9 @@ -26,6 +28,7 @@ note: `Vec` could also refer to the struct defined here | LL | pub use crate::vec::Vec; | ^^^^^^^^^^^^^^^ + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 2 previous errors diff --git a/src/test/ui/imports/import-crate-var.stderr b/src/test/ui/imports/import-crate-var.stderr index 85f15ad4648..6bc2d15b2ff 100644 --- a/src/test/ui/imports/import-crate-var.stderr +++ b/src/test/ui/imports/import-crate-var.stderr @@ -4,7 +4,7 @@ error: `$crate` may not be imported LL | m!(); | ^^^^^ | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/imports/import-prefix-macro-1.stderr b/src/test/ui/imports/import-prefix-macro-1.stderr index 6c12a366b71..2ecc519e718 100644 --- a/src/test/ui/imports/import-prefix-macro-1.stderr +++ b/src/test/ui/imports/import-prefix-macro-1.stderr @@ -6,6 +6,8 @@ LL | ($p: path) => (use $p {S, Z}); ... LL | import! { a::b::c } | ------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/imports/import-prefix-macro-2.stderr b/src/test/ui/imports/import-prefix-macro-2.stderr index 8428dce2728..80317a34944 100644 --- a/src/test/ui/imports/import-prefix-macro-2.stderr +++ b/src/test/ui/imports/import-prefix-macro-2.stderr @@ -6,6 +6,8 @@ LL | ($p: path) => (use ::$p {S, Z}); ... LL | import! { a::b::c } | ------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/imports/local-modularized-tricky-fail-1.stderr b/src/test/ui/imports/local-modularized-tricky-fail-1.stderr index c9498fed6a5..ea720c8b873 100644 --- a/src/test/ui/imports/local-modularized-tricky-fail-1.stderr +++ b/src/test/ui/imports/local-modularized-tricky-fail-1.stderr @@ -20,6 +20,7 @@ note: `exported` could also refer to the macro imported here LL | use inner1::*; | ^^^^^^^^^ = help: consider adding an explicit import of `exported` to disambiguate + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0659]: `exported` is ambiguous (glob import vs macro-expanded name in the same module during import/macro resolution) --> $DIR/local-modularized-tricky-fail-1.rs:28:1 @@ -43,6 +44,7 @@ note: `exported` could also refer to the macro imported here LL | use inner1::*; | ^^^^^^^^^ = help: consider adding an explicit import of `exported` to disambiguate + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0659]: `panic` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution) --> $DIR/local-modularized-tricky-fail-1.rs:36:5 @@ -62,6 +64,7 @@ LL | | } LL | define_panic!(); | ---------------- in this macro invocation = help: use `crate::panic` to refer to this macro unambiguously + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0659]: `include` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution) --> $DIR/local-modularized-tricky-fail-1.rs:47:1 @@ -81,6 +84,7 @@ LL | | } LL | define_include!(); | ------------------ in this macro invocation = help: use `crate::include` to refer to this macro unambiguously + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 4 previous errors diff --git a/src/test/ui/imports/local-modularized-tricky-fail-2.stderr b/src/test/ui/imports/local-modularized-tricky-fail-2.stderr index 92a836cadfa..07b7ff942a6 100644 --- a/src/test/ui/imports/local-modularized-tricky-fail-2.stderr +++ b/src/test/ui/imports/local-modularized-tricky-fail-2.stderr @@ -9,6 +9,7 @@ LL | () => ( struct Б; ) | = note: for more information, see https://github.com/rust-lang/rust/issues/55467 = help: add `#![feature(non_ascii_idents)]` to the crate attributes to enable + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0658]: non-ascii idents are not fully supported --> $DIR/local-modularized-tricky-fail-2.rs:36:24 @@ -21,6 +22,7 @@ LL | () => ( struct Г; ) | = note: for more information, see https://github.com/rust-lang/rust/issues/55467 = help: add `#![feature(non_ascii_idents)]` to the crate attributes to enable + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0658]: non-ascii idents are not fully supported --> $DIR/local-modularized-tricky-fail-2.rs:46:24 @@ -33,6 +35,7 @@ LL | () => ( struct Д; ) | = note: for more information, see https://github.com/rust-lang/rust/issues/55467 = help: add `#![feature(non_ascii_idents)]` to the crate attributes to enable + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 3 previous errors diff --git a/src/test/ui/imports/local-modularized-tricky-fail-3.stderr b/src/test/ui/imports/local-modularized-tricky-fail-3.stderr index 5272d2a319f..4494a88a5cf 100644 --- a/src/test/ui/imports/local-modularized-tricky-fail-3.stderr +++ b/src/test/ui/imports/local-modularized-tricky-fail-3.stderr @@ -17,6 +17,7 @@ LL | | } ... LL | define_exported!(); | ------------------- in this macro invocation + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: macro-expanded `macro_export` macros from the current crate cannot be referred to by absolute paths --> $DIR/local-modularized-tricky-fail-3.rs:19:5 @@ -36,6 +37,7 @@ LL | | } ... LL | define_exported!(); | ------------------- in this macro invocation + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 2 previous errors diff --git a/src/test/ui/imports/shadow_builtin_macros.stderr b/src/test/ui/imports/shadow_builtin_macros.stderr index 2f2ab20cdf0..413ead8c25e 100644 --- a/src/test/ui/imports/shadow_builtin_macros.stderr +++ b/src/test/ui/imports/shadow_builtin_macros.stderr @@ -28,6 +28,7 @@ LL | macro_rules! panic { () => {} } LL | } } LL | m!(); | ----- in this macro invocation + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0659]: `n` is ambiguous (glob import vs any other name from outer scope during import/macro resolution) --> $DIR/shadow_builtin_macros.rs:49:5 diff --git a/src/test/ui/in-band-lifetimes/elided-lifetimes.stderr b/src/test/ui/in-band-lifetimes/elided-lifetimes.stderr index 1184f51680a..6eddd9c411b 100644 --- a/src/test/ui/in-band-lifetimes/elided-lifetimes.stderr +++ b/src/test/ui/in-band-lifetimes/elided-lifetimes.stderr @@ -36,6 +36,8 @@ LL | fn $fn_name(gift: &str) -> $type_name { ... LL | autowrapper!(Autowrapped, autowrap_gift, 'a); | --------------------------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: hidden lifetime parameters in types are deprecated --> $DIR/elided-lifetimes.rs:78:18 @@ -51,6 +53,8 @@ LL | Ref<($($types),*)> ... LL | let yellow: anytuple_ref_ty!(bool, &str) = laughter.borrow(); | ---------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 7 previous errors diff --git a/src/test/ui/include-macros/mismatched-types.stderr b/src/test/ui/include-macros/mismatched-types.stderr index efe1f58a6f4..d035df8e5d8 100644 --- a/src/test/ui/include-macros/mismatched-types.stderr +++ b/src/test/ui/include-macros/mismatched-types.stderr @@ -8,6 +8,7 @@ LL | let b: &[u8] = include_str!("file.txt"); | = note: expected reference `&[u8]` found reference `&'static str` + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0308]: mismatched types --> $DIR/mismatched-types.rs:3:19 @@ -19,6 +20,7 @@ LL | let s: &str = include_bytes!("file.txt"); | = note: expected reference `&str` found reference `&'static [u8; 0]` + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 2 previous errors diff --git a/src/test/ui/infinite/infinite-macro-expansion.stderr b/src/test/ui/infinite/infinite-macro-expansion.stderr index ff67eea5688..c9254915d03 100644 --- a/src/test/ui/infinite/infinite-macro-expansion.stderr +++ b/src/test/ui/infinite/infinite-macro-expansion.stderr @@ -8,6 +8,7 @@ LL | recursive!() | ------------ in this macro invocation | = help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`infinite_macro_expansion`) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/inline-asm-bad-constraint.stderr b/src/test/ui/inline-asm-bad-constraint.stderr index f38bfb2af1d..2647e337b9d 100644 --- a/src/test/ui/inline-asm-bad-constraint.stderr +++ b/src/test/ui/inline-asm-bad-constraint.stderr @@ -3,18 +3,24 @@ error[E0668]: malformed inline assembly | LL | asm!("" :"={rax"(rax)) | ^^^^^^^^^^^^^^^^^^^^^^ + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0668]: malformed inline assembly --> $DIR/inline-asm-bad-constraint.rs:30:9 | LL | asm!("callq $0" : : "0"(foo)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0668]: malformed inline assembly --> $DIR/inline-asm-bad-constraint.rs:37:9 | LL | asm!("addb $1, $0" : "={rax}"((0i32, rax))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 3 previous errors diff --git a/src/test/ui/internal/internal-unstable-noallow.stderr b/src/test/ui/internal/internal-unstable-noallow.stderr index 5a3a2356150..ede8e5437ff 100644 --- a/src/test/ui/internal/internal-unstable-noallow.stderr +++ b/src/test/ui/internal/internal-unstable-noallow.stderr @@ -5,7 +5,7 @@ LL | call_unstable_noallow!(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(function)]` to the crate attributes to enable - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0658]: use of unstable library feature 'struct_field' --> $DIR/internal-unstable-noallow.rs:18:5 @@ -14,7 +14,7 @@ LL | construct_unstable_noallow!(0); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(struct_field)]` to the crate attributes to enable - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0658]: use of unstable library feature 'method' --> $DIR/internal-unstable-noallow.rs:20:35 @@ -23,7 +23,7 @@ LL | |x: internal_unstable::Foo| { call_method_noallow!(x) }; | ^^^^^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(method)]` to the crate attributes to enable - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0658]: use of unstable library feature 'struct2_field' --> $DIR/internal-unstable-noallow.rs:22:35 @@ -32,7 +32,7 @@ LL | |x: internal_unstable::Bar| { access_field_noallow!(x) }; | ^^^^^^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(struct2_field)]` to the crate attributes to enable - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 4 previous errors diff --git a/src/test/ui/internal/internal-unstable.stderr b/src/test/ui/internal/internal-unstable.stderr index 2c9d1469210..2c6bf42ae86 100644 --- a/src/test/ui/internal/internal-unstable.stderr +++ b/src/test/ui/internal/internal-unstable.stderr @@ -40,6 +40,7 @@ LL | bar!(internal_unstable::unstable()); | ------------------------------------ in this macro invocation | = help: add `#![feature(function)]` to the crate attributes to enable + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 5 previous errors diff --git a/src/test/ui/issues/issue-12997-2.stderr b/src/test/ui/issues/issue-12997-2.stderr index 01f8e348836..04464896e92 100644 --- a/src/test/ui/issues/issue-12997-2.stderr +++ b/src/test/ui/issues/issue-12997-2.stderr @@ -3,6 +3,8 @@ error[E0308]: mismatched types | LL | fn bar(x: isize) { } | ^^^^^^^^^^^^^^^^^^^^ expected `isize`, found `&mut test::Bencher` + | + = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/issues/issue-13446.stderr b/src/test/ui/issues/issue-13446.stderr index 13c35dd84f7..71d3bfe3398 100644 --- a/src/test/ui/issues/issue-13446.stderr +++ b/src/test/ui/issues/issue-13446.stderr @@ -6,7 +6,7 @@ LL | static VEC: [u32; 256] = vec![]; | = note: expected array `[u32; 256]` found struct `std::vec::Vec<_>` - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/issues/issue-14091-2.stderr b/src/test/ui/issues/issue-14091-2.stderr index 2d6e9567d26..499ebe977ed 100644 --- a/src/test/ui/issues/issue-14091-2.stderr +++ b/src/test/ui/issues/issue-14091-2.stderr @@ -5,6 +5,7 @@ LL | assert!(x, x); | ^^^^^^^^^^^^^^ cannot apply unary operator `!` | = note: an implementation of `std::ops::Not` might be missing for `BytePos` + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/issues/issue-15167.stderr b/src/test/ui/issues/issue-15167.stderr index 1c488bf6fba..fff28b0c3af 100644 --- a/src/test/ui/issues/issue-15167.stderr +++ b/src/test/ui/issues/issue-15167.stderr @@ -6,6 +6,8 @@ LL | macro_rules! f { () => (n) } ... LL | println!("{}", f!()); | ---- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0425]: cannot find value `n` in this scope --> $DIR/issue-15167.rs:3:25 @@ -15,6 +17,8 @@ LL | macro_rules! f { () => (n) } ... LL | println!("{}", f!()); | ---- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0425]: cannot find value `n` in this scope --> $DIR/issue-15167.rs:3:25 @@ -24,6 +28,8 @@ LL | macro_rules! f { () => (n) } ... LL | println!("{}", f!()); | ---- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0425]: cannot find value `n` in this scope --> $DIR/issue-15167.rs:3:25 @@ -33,6 +39,8 @@ LL | macro_rules! f { () => (n) } ... LL | println!("{}", f!()); | ---- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 4 previous errors diff --git a/src/test/ui/issues/issue-16098.stderr b/src/test/ui/issues/issue-16098.stderr index a34039a6eec..077c720a9cd 100644 --- a/src/test/ui/issues/issue-16098.stderr +++ b/src/test/ui/issues/issue-16098.stderr @@ -8,6 +8,7 @@ LL | println!("Problem 1: {}", prob1!(1000)); | ------------ in this macro invocation | = help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`issue_16098`) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/issues/issue-16966.stderr b/src/test/ui/issues/issue-16966.stderr index 49a12cc2009..30932a375b1 100644 --- a/src/test/ui/issues/issue-16966.stderr +++ b/src/test/ui/issues/issue-16966.stderr @@ -4,7 +4,7 @@ error[E0282]: type annotations needed LL | panic!(std::default::Default::default()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type for type parameter `M` declared on the function `begin_panic` | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/issues/issue-21160.stderr b/src/test/ui/issues/issue-21160.stderr index a7bb4fc5128..a24dc8a259d 100644 --- a/src/test/ui/issues/issue-21160.stderr +++ b/src/test/ui/issues/issue-21160.stderr @@ -8,6 +8,8 @@ LL | struct Foo(Bar); | LL | fn hash(&self, state: &mut H); | - required by this bound in `std::hash::Hash::hash` + | + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/issues/issue-2150.stderr b/src/test/ui/issues/issue-2150.stderr index 3f370255106..f1cb3890a72 100644 --- a/src/test/ui/issues/issue-2150.stderr +++ b/src/test/ui/issues/issue-2150.stderr @@ -11,7 +11,6 @@ note: the lint level is defined here | LL | #![deny(unreachable_code)] | ^^^^^^^^^^^^^^^^ - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/issues/issue-25385.stderr b/src/test/ui/issues/issue-25385.stderr index ab4db7e42a4..2ed48356e9f 100644 --- a/src/test/ui/issues/issue-25385.stderr +++ b/src/test/ui/issues/issue-25385.stderr @@ -6,6 +6,8 @@ LL | ($e:expr) => { $e.foo() } ... LL | foo!(a); | -------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0599]: no method named `foo` found for type `i32` in the current scope --> $DIR/issue-25385.rs:10:15 diff --git a/src/test/ui/issues/issue-25386.stderr b/src/test/ui/issues/issue-25386.stderr index eabb139b97d..76a4a5a493f 100644 --- a/src/test/ui/issues/issue-25386.stderr +++ b/src/test/ui/issues/issue-25386.stderr @@ -6,6 +6,8 @@ LL | (*$var.c_object).$member.is_some() ... LL | println!("{}", check_ptr_exist!(item, name)); | ---------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0616]: field `name` of struct `stuff::CObj` is private --> $DIR/issue-25386.rs:19:9 @@ -15,6 +17,8 @@ LL | (*$var.c_object).$member.is_some() ... LL | println!("{}", check_ptr_exist!(item, name)); | ---------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-25793.stderr b/src/test/ui/issues/issue-25793.stderr index daea9cd8cd7..9d66ba3aae1 100644 --- a/src/test/ui/issues/issue-25793.stderr +++ b/src/test/ui/issues/issue-25793.stderr @@ -10,6 +10,8 @@ LL | r.get_size(width!(self)) | -------- ------------ in this macro invocation | | | borrow later used by call + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/issues/issue-26093.stderr b/src/test/ui/issues/issue-26093.stderr index c96228b518a..204786c65c1 100644 --- a/src/test/ui/issues/issue-26093.stderr +++ b/src/test/ui/issues/issue-26093.stderr @@ -9,6 +9,8 @@ LL | not_a_place!(99); | | | | | cannot assign to this expression | in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0067]: invalid left-hand side of assignment --> $DIR/issue-26093.rs:5:16 @@ -21,6 +23,8 @@ LL | not_a_place!(99); | | | | | cannot assign to this expression | in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-26094.stderr b/src/test/ui/issues/issue-26094.stderr index 36b2d3d074b..0b5b6d5a750 100644 --- a/src/test/ui/issues/issue-26094.stderr +++ b/src/test/ui/issues/issue-26094.stderr @@ -9,6 +9,8 @@ LL | fn some_function() {} ... LL | some_macro!(some_function); | --------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/issues/issue-27340.stderr b/src/test/ui/issues/issue-27340.stderr index 05b213b293c..f2c659083f6 100644 --- a/src/test/ui/issues/issue-27340.stderr +++ b/src/test/ui/issues/issue-27340.stderr @@ -6,6 +6,8 @@ LL | #[derive(Copy, Clone)] LL | LL | struct Bar(Foo); | --- this field does not implement `Copy` + | + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/issues/issue-27592.stderr b/src/test/ui/issues/issue-27592.stderr index c8649d82d74..cf59016ded4 100644 --- a/src/test/ui/issues/issue-27592.stderr +++ b/src/test/ui/issues/issue-27592.stderr @@ -6,12 +6,16 @@ LL | write(|| format_args!("{}", String::from("Hello world"))); | | | | | temporary value created here | returns a value referencing data owned by the current function + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0515]: cannot return reference to temporary value --> $DIR/issue-27592.rs:16:14 | LL | write(|| format_args!("{}", String::from("Hello world"))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ returns a reference to data owned by the current function + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-29084.stderr b/src/test/ui/issues/issue-29084.stderr index 3e7ea745ce4..bc22e937139 100644 --- a/src/test/ui/issues/issue-29084.stderr +++ b/src/test/ui/issues/issue-29084.stderr @@ -6,6 +6,8 @@ LL | bar(&mut $d); ... LL | foo!(0u8); | ---------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/issues/issue-31011.stderr b/src/test/ui/issues/issue-31011.stderr index c7618e0835b..deaf490466c 100644 --- a/src/test/ui/issues/issue-31011.stderr +++ b/src/test/ui/issues/issue-31011.stderr @@ -9,6 +9,8 @@ LL | fn wrap(context: &T) -> () LL | { LL | log!(context, "entered wrapper"); | --------------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/issues/issue-32655.stderr b/src/test/ui/issues/issue-32655.stderr index ca085b25c2d..5d5ad8aed98 100644 --- a/src/test/ui/issues/issue-32655.stderr +++ b/src/test/ui/issues/issue-32655.stderr @@ -6,6 +6,8 @@ LL | #[derive_Clone] ... LL | foo!(); | ------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: cannot find attribute `derive_Clone` in this scope --> $DIR/issue-32655.rs:15:7 diff --git a/src/test/ui/issues/issue-32782.stderr b/src/test/ui/issues/issue-32782.stderr index 029826f09a2..3d74897aab2 100644 --- a/src/test/ui/issues/issue-32782.stderr +++ b/src/test/ui/issues/issue-32782.stderr @@ -8,6 +8,7 @@ LL | foo!(); | ------- in this macro invocation | = help: add `#![feature(allow_internal_unstable)]` to the crate attributes to enable + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/issues/issue-32829.stderr b/src/test/ui/issues/issue-32829.stderr index b620abbf436..98201b050ec 100644 --- a/src/test/ui/issues/issue-32829.stderr +++ b/src/test/ui/issues/issue-32829.stderr @@ -6,7 +6,7 @@ LL | static S : u64 = { { panic!("foo"); 0 } }; | = note: for more information, see https://github.com/rust-lang/rust/issues/51999 = help: add `#![feature(const_panic)]` to the crate attributes to enable - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/issues/issue-32950.stderr b/src/test/ui/issues/issue-32950.stderr index 3cdf35af1d8..06a6ebd9704 100644 --- a/src/test/ui/issues/issue-32950.stderr +++ b/src/test/ui/issues/issue-32950.stderr @@ -9,6 +9,8 @@ error[E0412]: cannot find type `FooBar` in this scope | LL | concat_idents!(Foo, Bar) | ^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-34229.stderr b/src/test/ui/issues/issue-34229.stderr index 9e1734899bd..cd9be6ab72c 100644 --- a/src/test/ui/issues/issue-34229.stderr +++ b/src/test/ui/issues/issue-34229.stderr @@ -6,6 +6,7 @@ LL | #[derive(PartialEq, PartialOrd)] struct Nope(Comparable); | = help: the trait `std::cmp::PartialOrd` is not implemented for `Comparable` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `Comparable` with `Comparable` --> $DIR/issue-34229.rs:2:46 @@ -15,6 +16,7 @@ LL | #[derive(PartialEq, PartialOrd)] struct Nope(Comparable); | = help: the trait `std::cmp::PartialOrd` is not implemented for `Comparable` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `Comparable` with `Comparable` --> $DIR/issue-34229.rs:2:46 @@ -24,6 +26,7 @@ LL | #[derive(PartialEq, PartialOrd)] struct Nope(Comparable); | = help: the trait `std::cmp::PartialOrd` is not implemented for `Comparable` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `Comparable` with `Comparable` --> $DIR/issue-34229.rs:2:46 @@ -33,6 +36,7 @@ LL | #[derive(PartialEq, PartialOrd)] struct Nope(Comparable); | = help: the trait `std::cmp::PartialOrd` is not implemented for `Comparable` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `Comparable` with `Comparable` --> $DIR/issue-34229.rs:2:46 @@ -42,6 +46,7 @@ LL | #[derive(PartialEq, PartialOrd)] struct Nope(Comparable); | = help: the trait `std::cmp::PartialOrd` is not implemented for `Comparable` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 5 previous errors diff --git a/src/test/ui/issues/issue-34334.stderr b/src/test/ui/issues/issue-34334.stderr index c52ea4ef9da..c68b271807b 100644 --- a/src/test/ui/issues/issue-34334.stderr +++ b/src/test/ui/issues/issue-34334.stderr @@ -33,7 +33,7 @@ LL | let sr: Vec<(u32, _, _) = vec![]; | = note: expected type `bool` found struct `std::vec::Vec<_>` - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0070]: invalid left-hand side of assignment --> $DIR/issue-34334.rs:2:29 diff --git a/src/test/ui/issues/issue-38821.stderr b/src/test/ui/issues/issue-38821.stderr index 0687fc940de..e355094261d 100644 --- a/src/test/ui/issues/issue-38821.stderr +++ b/src/test/ui/issues/issue-38821.stderr @@ -5,6 +5,7 @@ LL | #[derive(Debug, Copy, Clone)] | ^^^^ the trait `NotNull` is not implemented for `::SqlType` | = note: required because of the requirements on the impl of `IntoNullable` for `::SqlType` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/issues/issue-42954.stderr b/src/test/ui/issues/issue-42954.stderr index 8c35088a1bb..840cceea7b0 100644 --- a/src/test/ui/issues/issue-42954.stderr +++ b/src/test/ui/issues/issue-42954.stderr @@ -9,6 +9,8 @@ LL | $i as u32 < 0 ... LL | is_plainly_printable!(c); | ------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/issues/issue-48364.stderr b/src/test/ui/issues/issue-48364.stderr index e5bb9298cd5..5ccede308a1 100644 --- a/src/test/ui/issues/issue-48364.stderr +++ b/src/test/ui/issues/issue-48364.stderr @@ -6,6 +6,7 @@ LL | b"".starts_with(stringify!(foo)) | = note: expected reference `&[u8]` found reference `&'static str` + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/issues/issue-48728.stderr b/src/test/ui/issues/issue-48728.stderr index 84c10d8fbc4..a0698c20798 100644 --- a/src/test/ui/issues/issue-48728.stderr +++ b/src/test/ui/issues/issue-48728.stderr @@ -8,6 +8,7 @@ LL | impl Clone for Node<[T]> { | ------------------------------------------- first implementation here | = note: upstream crates may add a new impl of trait `std::clone::Clone` for type `[_]` in future versions + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/issues/issue-50480.stderr b/src/test/ui/issues/issue-50480.stderr index 2b92664d577..dfcac128173 100644 --- a/src/test/ui/issues/issue-50480.stderr +++ b/src/test/ui/issues/issue-50480.stderr @@ -29,6 +29,8 @@ LL | struct Foo(NotDefined, ::Item, Vec, String); | -------- ------ this field does not implement `Copy` | | | this field does not implement `Copy` + | + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 4 previous errors diff --git a/src/test/ui/issues/issue-51848.stderr b/src/test/ui/issues/issue-51848.stderr index 31faaab6141..051c4d7f427 100644 --- a/src/test/ui/issues/issue-51848.stderr +++ b/src/test/ui/issues/issue-51848.stderr @@ -10,6 +10,7 @@ LL | macro_with_error!(); | -------------------- in this macro invocation | = note: if you intended to print `{`, you can escape it using `{{` + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: invalid format string: unmatched `}` found --> $DIR/issue-51848.rs:18:15 diff --git a/src/test/ui/issues/issue-53251.stderr b/src/test/ui/issues/issue-53251.stderr index 21e41574a46..cd5030f7619 100644 --- a/src/test/ui/issues/issue-53251.stderr +++ b/src/test/ui/issues/issue-53251.stderr @@ -6,6 +6,8 @@ LL | S::f::(); ... LL | impl_add!(a b); | --------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0107]: wrong number of type arguments: expected 0, found 1 --> $DIR/issue-53251.rs:11:24 @@ -15,6 +17,8 @@ LL | S::f::(); ... LL | impl_add!(a b); | --------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-56411.stderr b/src/test/ui/issues/issue-56411.stderr index 1f38c70a119..3ac8dc548ae 100644 --- a/src/test/ui/issues/issue-56411.stderr +++ b/src/test/ui/issues/issue-56411.stderr @@ -13,6 +13,7 @@ LL | import!(("issue-56411-aux.rs", issue_56411_aux)); | ------------------------------------------------- in this macro invocation | = note: `issue_56411_aux` must be defined only once in the type namespace of this module + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0365]: `issue_56411_aux` is private, and cannot be re-exported --> $DIR/issue-56411.rs:6:21 @@ -24,6 +25,7 @@ LL | import!(("issue-56411-aux.rs", issue_56411_aux)); | ------------------------------------------------- in this macro invocation | = note: consider declaring type or module `issue_56411_aux` with `pub` + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-59488.stderr b/src/test/ui/issues/issue-59488.stderr index 35ada71a1f1..2ac5577e0a0 100644 --- a/src/test/ui/issues/issue-59488.stderr +++ b/src/test/ui/issues/issue-59488.stderr @@ -80,7 +80,7 @@ LL | assert_eq!(Foo::Bar, i); | fn(usize) -> Foo {Foo::Bar} | = note: an implementation of `std::cmp::PartialEq` might be missing for `fn(usize) -> Foo {Foo::Bar}` - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: `fn(usize) -> Foo {Foo::Bar}` doesn't implement `std::fmt::Debug` --> $DIR/issue-59488.rs:30:5 @@ -91,7 +91,7 @@ LL | assert_eq!(Foo::Bar, i); = help: the trait `std::fmt::Debug` is not implemented for `fn(usize) -> Foo {Foo::Bar}` = note: required because of the requirements on the impl of `std::fmt::Debug` for `&fn(usize) -> Foo {Foo::Bar}` = note: required by `std::fmt::Debug::fmt` - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: `fn(usize) -> Foo {Foo::Bar}` doesn't implement `std::fmt::Debug` --> $DIR/issue-59488.rs:30:5 @@ -102,7 +102,7 @@ LL | assert_eq!(Foo::Bar, i); = help: the trait `std::fmt::Debug` is not implemented for `fn(usize) -> Foo {Foo::Bar}` = note: required because of the requirements on the impl of `std::fmt::Debug` for `&fn(usize) -> Foo {Foo::Bar}` = note: required by `std::fmt::Debug::fmt` - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 10 previous errors diff --git a/src/test/ui/issues/issue-6596-1.stderr b/src/test/ui/issues/issue-6596-1.stderr index 2a4ece2f242..4f29d8a9274 100644 --- a/src/test/ui/issues/issue-6596-1.stderr +++ b/src/test/ui/issues/issue-6596-1.stderr @@ -6,6 +6,8 @@ LL | $nonexistent ... LL | e!(foo); | -------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/issues/issue-6596-2.stderr b/src/test/ui/issues/issue-6596-2.stderr index 20fbe0fab01..4fcb0176faa 100644 --- a/src/test/ui/issues/issue-6596-2.stderr +++ b/src/test/ui/issues/issue-6596-2.stderr @@ -6,6 +6,8 @@ LL | { $inp $nonexistent } ... LL | g!(foo); | -------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/issues/issue-68091-unicode-ident-after-if.stderr b/src/test/ui/issues/issue-68091-unicode-ident-after-if.stderr index 8d1a03ac207..78760efd8d1 100644 --- a/src/test/ui/issues/issue-68091-unicode-ident-after-if.stderr +++ b/src/test/ui/issues/issue-68091-unicode-ident-after-if.stderr @@ -12,6 +12,8 @@ LL | $($c)ö* {} ... LL | x!(if); | ------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 2 previous errors diff --git a/src/test/ui/lifetimes/borrowck-let-suggestion.stderr b/src/test/ui/lifetimes/borrowck-let-suggestion.stderr index 0e2fc0a0fe9..2cb6e62e412 100644 --- a/src/test/ui/lifetimes/borrowck-let-suggestion.stderr +++ b/src/test/ui/lifetimes/borrowck-let-suggestion.stderr @@ -10,7 +10,7 @@ LL | x.use_mut(); | - borrow later used here | = note: consider using a `let` binding to create a longer lived value - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/lint/lint-stability2.stderr b/src/test/ui/lint/lint-stability2.stderr index 5bac22594d6..a14bf2ec8ca 100644 --- a/src/test/ui/lint/lint-stability2.stderr +++ b/src/test/ui/lint/lint-stability2.stderr @@ -9,7 +9,7 @@ note: the lint level is defined here | LL | #![deny(deprecated)] | ^^^^^^^^^^ - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/lint/lint-stability3.stderr b/src/test/ui/lint/lint-stability3.stderr index 566734743ca..858ac12612c 100644 --- a/src/test/ui/lint/lint-stability3.stderr +++ b/src/test/ui/lint/lint-stability3.stderr @@ -9,7 +9,7 @@ note: the lint level is defined here | LL | #![deny(deprecated)] | ^^^^^^^^^^ - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/lint/lint-unsafe-code.stderr b/src/test/ui/lint/lint-unsafe-code.stderr index 8e56fd4139b..0b2b9fab392 100644 --- a/src/test/ui/lint/lint-unsafe-code.stderr +++ b/src/test/ui/lint/lint-unsafe-code.stderr @@ -90,6 +90,8 @@ LL | unsafe {} ... LL | unsafe_in_macro!() | ------------------ in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 14 previous errors diff --git a/src/test/ui/lint/lints-in-foreign-macros.stderr b/src/test/ui/lint/lints-in-foreign-macros.stderr index 0d2adb2ad04..207d85a89c7 100644 --- a/src/test/ui/lint/lints-in-foreign-macros.stderr +++ b/src/test/ui/lint/lints-in-foreign-macros.stderr @@ -12,6 +12,7 @@ note: the lint level is defined here | LL | #![warn(unused_imports)] | ^^^^^^^^^^^^^^ + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) warning: unused import: `std::string::ToString` --> $DIR/lints-in-foreign-macros.rs:16:18 diff --git a/src/test/ui/lint/test-inner-fn.stderr b/src/test/ui/lint/test-inner-fn.stderr index bf476a45f77..a8974e1cf96 100644 --- a/src/test/ui/lint/test-inner-fn.stderr +++ b/src/test/ui/lint/test-inner-fn.stderr @@ -5,12 +5,15 @@ LL | #[test] | ^^^^^^^ | = note: requested on the command line with `-D unnameable-test-items` + = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) error: cannot test inner items --> $DIR/test-inner-fn.rs:13:9 | LL | #[test] | ^^^^^^^ + | + = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 2 previous errors diff --git a/src/test/ui/lint/unreachable_pub-pub_crate.stderr b/src/test/ui/lint/unreachable_pub-pub_crate.stderr index abe07b1c649..fd3f2dbc076 100644 --- a/src/test/ui/lint/unreachable_pub-pub_crate.stderr +++ b/src/test/ui/lint/unreachable_pub-pub_crate.stderr @@ -132,6 +132,7 @@ LL | define_empty_struct_with_visibility!(pub, Fluorine); | in this macro invocation | = help: or consider exporting it for use by other crates + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) warning: unreachable `pub` item --> $DIR/unreachable_pub-pub_crate.rs:45:9 diff --git a/src/test/ui/lint/unreachable_pub.stderr b/src/test/ui/lint/unreachable_pub.stderr index 6144d5bb657..ad687a4b54e 100644 --- a/src/test/ui/lint/unreachable_pub.stderr +++ b/src/test/ui/lint/unreachable_pub.stderr @@ -132,6 +132,7 @@ LL | define_empty_struct_with_visibility!(pub, Fluorine); | in this macro invocation | = help: or consider exporting it for use by other crates + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) warning: unreachable `pub` item --> $DIR/unreachable_pub.rs:41:9 diff --git a/src/test/ui/liveness/liveness-return-last-stmt-semi.stderr b/src/test/ui/liveness/liveness-return-last-stmt-semi.stderr index 6b4de6618c5..ae63bad841f 100644 --- a/src/test/ui/liveness/liveness-return-last-stmt-semi.stderr +++ b/src/test/ui/liveness/liveness-return-last-stmt-semi.stderr @@ -9,6 +9,8 @@ LL | macro_rules! test { () => { fn foo() -> i32 { 1; } } } ... LL | test!(); | -------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0308]: mismatched types --> $DIR/liveness-return-last-stmt-semi.rs:7:19 diff --git a/src/test/ui/macro_backtrace/main.stderr b/src/test/ui/macro_backtrace/main.-Zmacro-backtrace.stderr similarity index 96% rename from src/test/ui/macro_backtrace/main.stderr rename to src/test/ui/macro_backtrace/main.-Zmacro-backtrace.stderr index c4950e0fdf5..41ed545cf16 100644 --- a/src/test/ui/macro_backtrace/main.stderr +++ b/src/test/ui/macro_backtrace/main.-Zmacro-backtrace.stderr @@ -1,5 +1,5 @@ error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `error` - --> $DIR/main.rs:9:20 + --> $DIR/main.rs:10:20 | LL | / macro_rules! pong { LL | | () => { syntax error }; @@ -11,7 +11,7 @@ LL | pong!(); | -------- in this macro invocation error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `error` - --> $DIR/main.rs:9:20 + --> $DIR/main.rs:10:20 | LL | / macro_rules! pong { LL | | () => { syntax error }; @@ -31,7 +31,7 @@ LL | () => { pong ! () ; } | in this expansion of `ping!` error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `error` - --> $DIR/main.rs:9:20 + --> $DIR/main.rs:10:20 | LL | / macro_rules! pong { LL | | () => { syntax error }; diff --git a/src/test/ui/macro_backtrace/main.default.stderr b/src/test/ui/macro_backtrace/main.default.stderr new file mode 100644 index 00000000000..fac76fd6080 --- /dev/null +++ b/src/test/ui/macro_backtrace/main.default.stderr @@ -0,0 +1,35 @@ +error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `error` + --> $DIR/main.rs:10:20 + | +LL | () => { syntax error }; + | ^^^^^ expected one of 8 possible tokens +... +LL | pong!(); + | -------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + +error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `error` + --> $DIR/main.rs:10:20 + | +LL | () => { syntax error }; + | ^^^^^ expected one of 8 possible tokens +... +LL | ping!(); + | -------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + +error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `error` + --> $DIR/main.rs:10:20 + | +LL | () => { syntax error }; + | ^^^^^ expected one of 8 possible tokens +... +LL | deep!(); + | -------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + +error: aborting due to 3 previous errors + diff --git a/src/test/ui/macro_backtrace/main.rs b/src/test/ui/macro_backtrace/main.rs index 8fcd497f87b..6cee3b4cd96 100644 --- a/src/test/ui/macro_backtrace/main.rs +++ b/src/test/ui/macro_backtrace/main.rs @@ -1,6 +1,7 @@ // Test that the macro backtrace facility works // aux-build:ping.rs -// compile-flags: -Z external-macro-backtrace +// revisions: default -Zmacro-backtrace +//[-Zmacro-backtrace] compile-flags: -Z macro-backtrace #[macro_use] extern crate ping; diff --git a/src/test/ui/macros/assert.stderr b/src/test/ui/macros/assert.stderr index fa604506b94..8aa7c331859 100644 --- a/src/test/ui/macros/assert.stderr +++ b/src/test/ui/macros/assert.stderr @@ -16,7 +16,7 @@ error: macro requires a boolean expression as an argument LL | debug_assert!(); | ^^^^^^^^^^^^^^^^ boolean expression required | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: expected expression, found keyword `struct` --> $DIR/assert.rs:5:19 diff --git a/src/test/ui/macros/cfg.stderr b/src/test/ui/macros/cfg.stderr index 0fdb62922a7..bbfc5e27fec 100644 --- a/src/test/ui/macros/cfg.stderr +++ b/src/test/ui/macros/cfg.stderr @@ -3,6 +3,8 @@ error: macro requires a cfg-pattern as an argument | LL | cfg!(); | ^^^^^^^ cfg-pattern required + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: expected identifier, found `123` --> $DIR/cfg.rs:3:10 diff --git a/src/test/ui/macros/derive-in-eager-expansion-hang.stderr b/src/test/ui/macros/derive-in-eager-expansion-hang.stderr index 0e2fb4c8af5..5943a252579 100644 --- a/src/test/ui/macros/derive-in-eager-expansion-hang.stderr +++ b/src/test/ui/macros/derive-in-eager-expansion-hang.stderr @@ -12,6 +12,7 @@ LL | | } LL | format_args!(hang!()); | ------- in this macro invocation | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) help: you might be missing a string literal to format with | LL | format_args!("{}", hang!()); diff --git a/src/test/ui/macros/format-parse-errors.stderr b/src/test/ui/macros/format-parse-errors.stderr index 02b704299ff..66cffbfa181 100644 --- a/src/test/ui/macros/format-parse-errors.stderr +++ b/src/test/ui/macros/format-parse-errors.stderr @@ -4,7 +4,7 @@ error: requires at least a format string argument LL | format!(); | ^^^^^^^^^^ | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: expected expression, found keyword `struct` --> $DIR/format-parse-errors.rs:5:13 diff --git a/src/test/ui/macros/issue-54441.stderr b/src/test/ui/macros/issue-54441.stderr index 92d1afe1b64..c94355f4716 100644 --- a/src/test/ui/macros/issue-54441.stderr +++ b/src/test/ui/macros/issue-54441.stderr @@ -6,6 +6,8 @@ LL | let ... LL | m!(); | ----- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/macros/macro-backtrace-invalid-internals.stderr b/src/test/ui/macros/macro-backtrace-invalid-internals.stderr index 85dee9f24fe..2ce565936f2 100644 --- a/src/test/ui/macros/macro-backtrace-invalid-internals.stderr +++ b/src/test/ui/macros/macro-backtrace-invalid-internals.stderr @@ -6,6 +6,8 @@ LL | 1.fake() ... LL | fake_method_stmt!(); | -------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> $DIR/macro-backtrace-invalid-internals.rs:11:13 @@ -15,6 +17,8 @@ LL | 1.fake ... LL | fake_field_stmt!(); | ------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> $DIR/macro-backtrace-invalid-internals.rs:17:15 @@ -24,6 +28,8 @@ LL | (1).0 ... LL | fake_anon_field_stmt!(); | ------------------------ in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0689]: can't call method `neg` on ambiguous numeric type `{float}` --> $DIR/macro-backtrace-invalid-internals.rs:41:15 @@ -34,6 +40,7 @@ LL | 2.0.neg() LL | real_method_stmt!(); | -------------------- in this macro invocation | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) help: you must specify a concrete type for this numeric value, like `f32` | LL | 2.0_f32.neg() @@ -47,6 +54,8 @@ LL | 1.fake() ... LL | let _ = fake_method_expr!(); | ------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> $DIR/macro-backtrace-invalid-internals.rs:29:13 @@ -56,6 +65,8 @@ LL | 1.fake ... LL | let _ = fake_field_expr!(); | ------------------ in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> $DIR/macro-backtrace-invalid-internals.rs:35:15 @@ -65,6 +76,8 @@ LL | (1).0 ... LL | let _ = fake_anon_field_expr!(); | ----------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0689]: can't call method `neg` on ambiguous numeric type `{float}` --> $DIR/macro-backtrace-invalid-internals.rs:47:15 @@ -75,6 +88,7 @@ LL | 2.0.neg() LL | let _ = real_method_expr!(); | ------------------- in this macro invocation | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) help: you must specify a concrete type for this numeric value, like `f32` | LL | 2.0_f32.neg() diff --git a/src/test/ui/macros/macro-backtrace-nested.stderr b/src/test/ui/macros/macro-backtrace-nested.stderr index 501f525a05f..8d366383366 100644 --- a/src/test/ui/macros/macro-backtrace-nested.stderr +++ b/src/test/ui/macros/macro-backtrace-nested.stderr @@ -6,6 +6,8 @@ LL | () => (fake) ... LL | 1 + call_nested_expr!(); | ------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0425]: cannot find value `fake` in this scope --> $DIR/macro-backtrace-nested.rs:5:12 @@ -15,6 +17,8 @@ LL | () => (fake) ... LL | call_nested_expr_sum!(); | ------------------------ in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 2 previous errors diff --git a/src/test/ui/macros/macro-backtrace-println.stderr b/src/test/ui/macros/macro-backtrace-println.stderr index 209ff09aea4..b4194a833a4 100644 --- a/src/test/ui/macros/macro-backtrace-println.stderr +++ b/src/test/ui/macros/macro-backtrace-println.stderr @@ -6,6 +6,8 @@ LL | ($fmt:expr) => (myprint!(concat!($fmt, "\n"))); ... LL | myprintln!("{}"); | ----------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/macros/macro-context.stderr b/src/test/ui/macros/macro-context.stderr index 2a0779190f5..2e712110689 100644 --- a/src/test/ui/macros/macro-context.stderr +++ b/src/test/ui/macros/macro-context.stderr @@ -39,6 +39,8 @@ LL | () => ( i ; typeof ); ... LL | m!(); | ----- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 4 previous errors diff --git a/src/test/ui/macros/macro-lifetime-used-with-labels.stderr b/src/test/ui/macros/macro-lifetime-used-with-labels.stderr index 05418d9bddf..162b337bbef 100644 --- a/src/test/ui/macros/macro-lifetime-used-with-labels.stderr +++ b/src/test/ui/macros/macro-lifetime-used-with-labels.stderr @@ -8,4 +8,6 @@ LL | 'b: loop { | -- first declared here LL | br2!('b); | --------- in this macro invocation + | + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/src/test/ui/macros/macro-local-data-key-priv.stderr b/src/test/ui/macros/macro-local-data-key-priv.stderr index 72994d1652c..c53a09aad57 100644 --- a/src/test/ui/macros/macro-local-data-key-priv.stderr +++ b/src/test/ui/macros/macro-local-data-key-priv.stderr @@ -9,7 +9,7 @@ note: the constant `baz` is defined here | LL | thread_local!(static baz: f64 = 0.0); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/macros/macro-shadowing.stderr b/src/test/ui/macros/macro-shadowing.stderr index 033e12a31ae..461e71471fb 100644 --- a/src/test/ui/macros/macro-shadowing.stderr +++ b/src/test/ui/macros/macro-shadowing.stderr @@ -8,6 +8,7 @@ LL | m1!(); | ------ in this macro invocation | = note: macro-expanded `#[macro_use]`s may not shadow existing macros (see RFC 1560) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0659]: `foo` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution) --> $DIR/macro-shadowing.rs:17:1 @@ -28,6 +29,7 @@ note: `foo` could also refer to the macro defined here | LL | macro_rules! foo { () => {} } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 2 previous errors diff --git a/src/test/ui/macros/macros-nonfatal-errors.stderr b/src/test/ui/macros/macros-nonfatal-errors.stderr index d29e6b4d46f..1ab6b79a61e 100644 --- a/src/test/ui/macros/macros-nonfatal-errors.stderr +++ b/src/test/ui/macros/macros-nonfatal-errors.stderr @@ -3,6 +3,8 @@ error[E0665]: `Default` cannot be derived for enums, only structs | LL | #[derive(Default)] | ^^^^^^^ + | + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: inline assembly must be a string literal --> $DIR/macros-nonfatal-errors.rs:13:10 @@ -68,6 +70,8 @@ error: couldn't read $DIR/i'd be quite surprised if a file with this name existe | LL | include_str!("i'd be quite surprised if a file with this name existed"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: argument must be a string literal --> $DIR/macros-nonfatal-errors.rs:28:20 @@ -80,6 +84,8 @@ error: couldn't read $DIR/i'd be quite surprised if a file with this name existe | LL | include_bytes!("i'd be quite surprised if a file with this name existed"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: trace_macros! accepts only `true` or `false` --> $DIR/macros-nonfatal-errors.rs:31:5 diff --git a/src/test/ui/macros/must-use-in-macro-55516.stderr b/src/test/ui/macros/must-use-in-macro-55516.stderr index 302c8aa7e6a..e3649e32d76 100644 --- a/src/test/ui/macros/must-use-in-macro-55516.stderr +++ b/src/test/ui/macros/must-use-in-macro-55516.stderr @@ -6,5 +6,5 @@ LL | write!(&mut example, "{}", 42); | = note: `-W unused-must-use` implied by `-W unused` = note: this `Result` may be an `Err` variant, which should be handled - = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/src/test/ui/macros/nonterminal-matching.stderr b/src/test/ui/macros/nonterminal-matching.stderr index 93cc97d4583..9521322f5c2 100644 --- a/src/test/ui/macros/nonterminal-matching.stderr +++ b/src/test/ui/macros/nonterminal-matching.stderr @@ -9,6 +9,8 @@ LL | n!(a $nt_item b); ... LL | complex_nonterminal!(enum E {}); | -------------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/macros/restricted-shadowing-legacy.stderr b/src/test/ui/macros/restricted-shadowing-legacy.stderr index 8378286bdad..662266013d0 100644 --- a/src/test/ui/macros/restricted-shadowing-legacy.stderr +++ b/src/test/ui/macros/restricted-shadowing-legacy.stderr @@ -23,6 +23,7 @@ LL | macro_rules! m { () => {} } ... LL | include!(); | ----------- in this macro invocation + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution) --> $DIR/restricted-shadowing-legacy.rs:139:42 @@ -49,6 +50,7 @@ LL | macro_rules! m { () => {} } ... LL | include!(); | ----------- in this macro invocation + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution) --> $DIR/restricted-shadowing-legacy.rs:148:9 @@ -75,6 +77,7 @@ LL | macro_rules! m { () => {} } ... LL | include!(); | ----------- in this macro invocation + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution) --> $DIR/restricted-shadowing-legacy.rs:164:9 @@ -101,6 +104,7 @@ LL | macro_rules! m { () => { Wrong } } ... LL | include!(); | ----------- in this macro invocation + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution) --> $DIR/restricted-shadowing-legacy.rs:180:13 @@ -127,6 +131,7 @@ LL | macro_rules! m { () => { Wrong } } ... LL | include!(); | ----------- in this macro invocation + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution) --> $DIR/restricted-shadowing-legacy.rs:218:42 @@ -153,6 +158,7 @@ LL | macro_rules! m { () => { Wrong } } ... LL | include!(); | ----------- in this macro invocation + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution) --> $DIR/restricted-shadowing-legacy.rs:232:9 @@ -179,6 +185,7 @@ LL | macro_rules! m { () => {} } ... LL | include!(); | ----------- in this macro invocation + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution) --> $DIR/restricted-shadowing-legacy.rs:262:42 @@ -205,6 +212,7 @@ LL | macro_rules! m { () => {} } ... LL | include!(); | ----------- in this macro invocation + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 8 previous errors diff --git a/src/test/ui/macros/restricted-shadowing-modern.stderr b/src/test/ui/macros/restricted-shadowing-modern.stderr index 12075d42b9a..609f0b6b18a 100644 --- a/src/test/ui/macros/restricted-shadowing-modern.stderr +++ b/src/test/ui/macros/restricted-shadowing-modern.stderr @@ -23,6 +23,7 @@ LL | macro m() {} ... LL | include!(); | ----------- in this macro invocation + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution) --> $DIR/restricted-shadowing-modern.rs:147:33 @@ -49,6 +50,7 @@ LL | macro m() {} ... LL | include!(); | ----------- in this macro invocation + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution) --> $DIR/restricted-shadowing-modern.rs:156:13 @@ -75,6 +77,7 @@ LL | macro m() {} ... LL | include!(); | ----------- in this macro invocation + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution) --> $DIR/restricted-shadowing-modern.rs:172:13 @@ -101,6 +104,7 @@ LL | macro m() { Wrong } ... LL | include!(); | ----------- in this macro invocation + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution) --> $DIR/restricted-shadowing-modern.rs:190:17 @@ -127,6 +131,7 @@ LL | macro m() { Wrong } ... LL | include!(); | ----------- in this macro invocation + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution) --> $DIR/restricted-shadowing-modern.rs:233:33 @@ -153,6 +158,7 @@ LL | macro m() { Wrong } ... LL | include!(); | ----------- in this macro invocation + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 6 previous errors diff --git a/src/test/ui/macros/same-sequence-span.stderr b/src/test/ui/macros/same-sequence-span.stderr index 896f579765f..65b67a94238 100644 --- a/src/test/ui/macros/same-sequence-span.stderr +++ b/src/test/ui/macros/same-sequence-span.stderr @@ -28,17 +28,16 @@ LL | | fn main() {} ... | | = note: allowed there are: `=>`, `,` or `;` + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: `$x:expr` may be followed by `=`, which is not allowed for `expr` fragments --> $DIR/same-sequence-span.rs:19:1 | LL | proc_macro_sequence::make_foo!(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | not allowed after `expr` fragments - | in this macro invocation + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not allowed after `expr` fragments | = note: allowed there are: `=>`, `,` or `;` + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 4 previous errors diff --git a/src/test/ui/macros/span-covering-argument-1.stderr b/src/test/ui/macros/span-covering-argument-1.stderr index 2ac881107b9..efb8f61e462 100644 --- a/src/test/ui/macros/span-covering-argument-1.stderr +++ b/src/test/ui/macros/span-covering-argument-1.stderr @@ -8,6 +8,8 @@ LL | *&mut $s = 0; ... LL | bad!(foo whatever); | ------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/macros/trace_faulty_macros.stderr b/src/test/ui/macros/trace_faulty_macros.stderr index 021c51fd726..a18e22e07f8 100644 --- a/src/test/ui/macros/trace_faulty_macros.stderr +++ b/src/test/ui/macros/trace_faulty_macros.stderr @@ -9,6 +9,8 @@ LL | my_faulty_macro!(bcd); ... LL | my_faulty_macro!(); | ------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) note: trace_macro --> $DIR/trace_faulty_macros.rs:33:5 @@ -30,6 +32,7 @@ LL | my_recursive_macro!(); | ---------------------- in this macro invocation | = help: consider adding a `#![recursion_limit="8"]` attribute to your crate (`trace_faulty_macros`) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) note: trace_macro --> $DIR/trace_faulty_macros.rs:34:5 diff --git a/src/test/ui/malformed/malformed-derive-entry.stderr b/src/test/ui/malformed/malformed-derive-entry.stderr index 1f1ee39b049..ddc75c905ac 100644 --- a/src/test/ui/malformed/malformed-derive-entry.stderr +++ b/src/test/ui/malformed/malformed-derive-entry.stderr @@ -21,12 +21,16 @@ error[E0277]: the trait bound `Test1: std::clone::Clone` is not satisfied | LL | #[derive(Copy(Bad))] | ^^^^ the trait `std::clone::Clone` is not implemented for `Test1` + | + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `Test2: std::clone::Clone` is not satisfied --> $DIR/malformed-derive-entry.rs:6:10 | LL | #[derive(Copy="bad")] | ^^^^ the trait `std::clone::Clone` is not implemented for `Test2` + | + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 5 previous errors diff --git a/src/test/ui/malformed/malformed-interpolated.stderr b/src/test/ui/malformed/malformed-interpolated.stderr index 6f6ad4508be..d1be82cf7b7 100644 --- a/src/test/ui/malformed/malformed-interpolated.stderr +++ b/src/test/ui/malformed/malformed-interpolated.stderr @@ -14,6 +14,8 @@ LL | #[rustc_dummy = $expr] ... LL | check!(-0); // ERROR, see above | ----------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: unexpected token: `0 + 0` --> $DIR/malformed-interpolated.rs:5:25 @@ -23,6 +25,8 @@ LL | #[rustc_dummy = $expr] ... LL | check!(0 + 0); // ERROR, see above | -------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 3 previous errors diff --git a/src/test/ui/match/match-arm-resolving-to-never.stderr b/src/test/ui/match/match-arm-resolving-to-never.stderr index 3a723de9f6b..686fbd0baa3 100644 --- a/src/test/ui/match/match-arm-resolving-to-never.stderr +++ b/src/test/ui/match/match-arm-resolving-to-never.stderr @@ -12,8 +12,6 @@ LL | | E::F => "", | | ^^ expected integer, found `&str` LL | | }; | |_____- `match` arms have incompatible types - | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/methods/method-on-ambiguous-numeric-type.stderr b/src/test/ui/methods/method-on-ambiguous-numeric-type.stderr index d9e250882e1..10950834ad3 100644 --- a/src/test/ui/methods/method-on-ambiguous-numeric-type.stderr +++ b/src/test/ui/methods/method-on-ambiguous-numeric-type.stderr @@ -46,8 +46,6 @@ LL | mac!(bar); | ---------- you must specify a type for this binding, like `i32` LL | bar.pow(2); | ^^^ - | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) error: aborting due to 5 previous errors diff --git a/src/test/ui/mismatched_types/issue-26480.stderr b/src/test/ui/mismatched_types/issue-26480.stderr index d4dcb9a39a4..69a9d03e474 100644 --- a/src/test/ui/mismatched_types/issue-26480.stderr +++ b/src/test/ui/mismatched_types/issue-26480.stderr @@ -7,6 +7,7 @@ LL | $arr.len() * size_of($arr[0])); LL | write!(hello); | -------------- in this macro invocation | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) help: you can convert an `usize` to `u64` and panic if the converted value wouldn't fit | LL | ($arr.len() * size_of($arr[0])).try_into().unwrap()); @@ -22,6 +23,7 @@ LL | cast!(2); | --------- in this macro invocation | = note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 2 previous errors diff --git a/src/test/ui/missing/missing-semicolon-warning.stderr b/src/test/ui/missing/missing-semicolon-warning.stderr index b4001aba288..ecaefd47de0 100644 --- a/src/test/ui/missing/missing-semicolon-warning.stderr +++ b/src/test/ui/missing/missing-semicolon-warning.stderr @@ -8,6 +8,7 @@ LL | fn main() { m!(0, 0; 0, 0); } | --------------- in this macro invocation | = note: this was erroneously allowed and will become a hard error in a future release + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) warning: expected `;`, found `println` --> $DIR/missing-semicolon-warning.rs:7:12 @@ -19,4 +20,5 @@ LL | fn main() { m!(0, 0; 0, 0); } | --------------- in this macro invocation | = note: this was erroneously allowed and will become a hard error in a future release + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/src/test/ui/never_type/feature-gate-never_type_fallback.stderr b/src/test/ui/never_type/feature-gate-never_type_fallback.stderr index 08e16f46936..c652faafad4 100644 --- a/src/test/ui/never_type/feature-gate-never_type_fallback.stderr +++ b/src/test/ui/never_type/feature-gate-never_type_fallback.stderr @@ -8,7 +8,6 @@ LL | panic!() | -------- this returned value is of type `!` | = note: the return type of a function must have a statically known size - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/never_type/never-assign-dead-code.stderr b/src/test/ui/never_type/never-assign-dead-code.stderr index f0a11ae1bcc..6002f8e1eb7 100644 --- a/src/test/ui/never_type/never-assign-dead-code.stderr +++ b/src/test/ui/never_type/never-assign-dead-code.stderr @@ -12,7 +12,6 @@ note: the lint level is defined here LL | #![warn(unused)] | ^^^^^^ = note: `#[warn(unreachable_code)]` implied by `#[warn(unused)]` - = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) warning: unreachable call --> $DIR/never-assign-dead-code.rs:10:5 diff --git a/src/test/ui/nll/issue-55850.rs b/src/test/ui/nll/issue-55850.rs index a8f7299f899..e6279bd028e 100644 --- a/src/test/ui/nll/issue-55850.rs +++ b/src/test/ui/nll/issue-55850.rs @@ -15,7 +15,7 @@ where type Item = G::Yield; fn next(&mut self) -> Option { - match Pin::new(&mut self.0).resume() { + match Pin::new(&mut self.0).resume(()) { Yielded(y) => Some(y), _ => None } diff --git a/src/test/ui/on-unimplemented/no-debug.stderr b/src/test/ui/on-unimplemented/no-debug.stderr index cbb41263a83..4f9d428546b 100644 --- a/src/test/ui/on-unimplemented/no-debug.stderr +++ b/src/test/ui/on-unimplemented/no-debug.stderr @@ -7,6 +7,7 @@ LL | println!("{:?} {:?}", Foo, Bar); = help: the trait `std::fmt::Debug` is not implemented for `Foo` = note: add `#[derive(Debug)]` or manually implement `std::fmt::Debug` = note: required by `std::fmt::Debug::fmt` + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: `no_debug::Bar` doesn't implement `std::fmt::Debug` --> $DIR/no-debug.rs:10:32 @@ -16,6 +17,7 @@ LL | println!("{:?} {:?}", Foo, Bar); | = help: the trait `std::fmt::Debug` is not implemented for `no_debug::Bar` = note: required by `std::fmt::Debug::fmt` + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: `Foo` doesn't implement `std::fmt::Display` --> $DIR/no-debug.rs:11:23 @@ -26,6 +28,7 @@ LL | println!("{} {}", Foo, Bar); = help: the trait `std::fmt::Display` is not implemented for `Foo` = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead = note: required by `std::fmt::Display::fmt` + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: `no_debug::Bar` doesn't implement `std::fmt::Display` --> $DIR/no-debug.rs:11:28 @@ -36,6 +39,7 @@ LL | println!("{} {}", Foo, Bar); = help: the trait `std::fmt::Display` is not implemented for `no_debug::Bar` = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead = note: required by `std::fmt::Display::fmt` + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 4 previous errors diff --git a/src/test/ui/out-of-order-shadowing.stderr b/src/test/ui/out-of-order-shadowing.stderr index 2a120dee482..b414f9230b6 100644 --- a/src/test/ui/out-of-order-shadowing.stderr +++ b/src/test/ui/out-of-order-shadowing.stderr @@ -14,7 +14,7 @@ note: `bar` could also refer to the macro defined here | LL | macro_rules! bar { () => {} } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/parser/issue-65122-mac-invoc-in-mut-patterns.stderr b/src/test/ui/parser/issue-65122-mac-invoc-in-mut-patterns.stderr index dd193d6a86e..40599d228b2 100644 --- a/src/test/ui/parser/issue-65122-mac-invoc-in-mut-patterns.stderr +++ b/src/test/ui/parser/issue-65122-mac-invoc-in-mut-patterns.stderr @@ -8,6 +8,7 @@ LL | mac1! { does_not_exist!() } | --------------------------- in this macro invocation | = note: `mut` may be followed by `variable` and `variable @ pattern` + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: expected identifier, found `does_not_exist!()` --> $DIR/issue-65122-mac-invoc-in-mut-patterns.rs:13:17 @@ -17,6 +18,8 @@ LL | let mut $eval = (); ... LL | mac2! { does_not_exist!() } | --------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: `mut` must be followed by a named binding --> $DIR/issue-65122-mac-invoc-in-mut-patterns.rs:13:13 @@ -28,6 +31,7 @@ LL | mac2! { does_not_exist!() } | --------------------------- in this macro invocation | = note: `mut` may be followed by `variable` and `variable @ pattern` + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: cannot find macro `does_not_exist` in this scope --> $DIR/issue-65122-mac-invoc-in-mut-patterns.rs:20:13 diff --git a/src/test/ui/parser/macro/issue-37113.stderr b/src/test/ui/parser/macro/issue-37113.stderr index 7aadc0aa4b5..20ee9d35ec7 100644 --- a/src/test/ui/parser/macro/issue-37113.stderr +++ b/src/test/ui/parser/macro/issue-37113.stderr @@ -6,6 +6,8 @@ LL | $( $t, )* ... LL | test_macro!(String,); | --------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/parser/macro/issue-37234.stderr b/src/test/ui/parser/macro/issue-37234.stderr index 8cef5ae3758..2db0f848f75 100644 --- a/src/test/ui/parser/macro/issue-37234.stderr +++ b/src/test/ui/parser/macro/issue-37234.stderr @@ -6,6 +6,8 @@ LL | let x = 5 ""; ... LL | failed!(); | ---------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/parser/macro/macro-incomplete-parse.stderr b/src/test/ui/parser/macro/macro-incomplete-parse.stderr index 46cccba74c0..c9d220b1a27 100644 --- a/src/test/ui/parser/macro/macro-incomplete-parse.stderr +++ b/src/test/ui/parser/macro/macro-incomplete-parse.stderr @@ -17,6 +17,8 @@ LL | () => ( 1, ... LL | ignored_expr!(); | ---------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: macro expansion ignores token `,` and any following --> $DIR/macro-incomplete-parse.rs:16:14 diff --git a/src/test/ui/parser/macro/pub-item-macro.stderr b/src/test/ui/parser/macro/pub-item-macro.stderr index ae981ac4cbe..49644cf6a0e 100644 --- a/src/test/ui/parser/macro/pub-item-macro.stderr +++ b/src/test/ui/parser/macro/pub-item-macro.stderr @@ -8,6 +8,7 @@ LL | pub_x!(); | --------- in this macro invocation | = help: try adjusting the macro to put `pub` inside the invocation + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0603]: static `x` is private --> $DIR/pub-item-macro.rs:17:23 @@ -23,6 +24,7 @@ LL | static x: u32 = 0; ... LL | pub_x!(); | --------- in this macro invocation + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 2 previous errors diff --git a/src/test/ui/parser/macro/trait-non-item-macros.stderr b/src/test/ui/parser/macro/trait-non-item-macros.stderr index 7647ba500e0..5a89b5b936f 100644 --- a/src/test/ui/parser/macro/trait-non-item-macros.stderr +++ b/src/test/ui/parser/macro/trait-non-item-macros.stderr @@ -6,6 +6,8 @@ LL | ($a:expr) => ($a) ... LL | bah!(2); | -------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/parser/mut-patterns.stderr b/src/test/ui/parser/mut-patterns.stderr index a0e290a834d..5f4c349d7d6 100644 --- a/src/test/ui/parser/mut-patterns.stderr +++ b/src/test/ui/parser/mut-patterns.stderr @@ -99,6 +99,8 @@ LL | let mut $p = 0; ... LL | foo!(x); | -------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 12 previous errors diff --git a/src/test/ui/parser/recover-range-pats.stderr b/src/test/ui/parser/recover-range-pats.stderr index 50bfbcec247..0d4db74f9f4 100644 --- a/src/test/ui/parser/recover-range-pats.stderr +++ b/src/test/ui/parser/recover-range-pats.stderr @@ -166,6 +166,8 @@ LL | let ...$e; ... LL | mac!(0); | -------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0586]: inclusive range with no end --> $DIR/recover-range-pats.rs:141:19 @@ -177,6 +179,7 @@ LL | mac!(0); | -------- in this macro invocation | = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0586]: inclusive range with no end --> $DIR/recover-range-pats.rs:142:19 @@ -188,6 +191,7 @@ LL | mac!(0); | -------- in this macro invocation | = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: `...` range patterns are deprecated --> $DIR/recover-range-pats.rs:42:13 @@ -251,6 +255,8 @@ LL | let $e1...$e2; ... LL | mac2!(0, 1); | ------------ in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0029]: only char and numeric types are allowed in range patterns --> $DIR/recover-range-pats.rs:20:12 diff --git a/src/test/ui/pattern/rest-pat-semantic-disallowed.stderr b/src/test/ui/pattern/rest-pat-semantic-disallowed.stderr index be484e3a4d4..95f6d53a9d4 100644 --- a/src/test/ui/pattern/rest-pat-semantic-disallowed.stderr +++ b/src/test/ui/pattern/rest-pat-semantic-disallowed.stderr @@ -8,6 +8,7 @@ LL | let mk_pat!(); | --------- in this macro invocation | = note: only allowed in tuple, tuple struct, and slice patterns + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: `..` patterns are not allowed here --> $DIR/rest-pat-semantic-disallowed.rs:18:9 diff --git a/src/test/ui/privacy/associated-item-privacy-inherent.stderr b/src/test/ui/privacy/associated-item-privacy-inherent.stderr index 6471a7914e1..88561568ea5 100644 --- a/src/test/ui/privacy/associated-item-privacy-inherent.stderr +++ b/src/test/ui/privacy/associated-item-privacy-inherent.stderr @@ -6,6 +6,8 @@ LL | let value = Pub::method; ... LL | priv_nominal::mac!(); | --------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `for<'r> fn(&'r priv_nominal::Pub) {priv_nominal::Pub::method}` is private --> $DIR/associated-item-privacy-inherent.rs:15:9 @@ -15,6 +17,8 @@ LL | value; ... LL | priv_nominal::mac!(); | --------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `for<'r> fn(&'r priv_nominal::Pub) {priv_nominal::Pub::method}` is private --> $DIR/associated-item-privacy-inherent.rs:17:13 @@ -24,6 +28,8 @@ LL | Pub.method(); ... LL | priv_nominal::mac!(); | --------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: associated constant `CONST` is private --> $DIR/associated-item-privacy-inherent.rs:19:9 @@ -33,6 +39,8 @@ LL | Pub::CONST; ... LL | priv_nominal::mac!(); | --------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_signature::Priv` is private --> $DIR/associated-item-privacy-inherent.rs:37:21 @@ -42,6 +50,8 @@ LL | let value = Pub::method; ... LL | priv_signature::mac!(); | ----------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_signature::Priv` is private --> $DIR/associated-item-privacy-inherent.rs:39:9 @@ -51,6 +61,8 @@ LL | value; ... LL | priv_signature::mac!(); | ----------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_signature::Priv` is private --> $DIR/associated-item-privacy-inherent.rs:41:13 @@ -60,6 +72,8 @@ LL | Pub.method(loop {}); ... LL | priv_signature::mac!(); | ----------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_substs::Priv` is private --> $DIR/associated-item-privacy-inherent.rs:57:21 @@ -69,6 +83,8 @@ LL | let value = Pub::method::; ... LL | priv_substs::mac!(); | -------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_substs::Priv` is private --> $DIR/associated-item-privacy-inherent.rs:59:9 @@ -78,6 +94,8 @@ LL | value; ... LL | priv_substs::mac!(); | -------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_substs::Priv` is private --> $DIR/associated-item-privacy-inherent.rs:61:9 @@ -87,6 +105,8 @@ LL | Pub.method::(); ... LL | priv_substs::mac!(); | -------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-inherent.rs:80:21 @@ -96,6 +116,8 @@ LL | let value = ::method; ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-inherent.rs:82:9 @@ -105,6 +127,8 @@ LL | value; ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-inherent.rs:84:21 @@ -114,6 +138,8 @@ LL | let value = Pub::method; ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-inherent.rs:86:9 @@ -123,6 +149,8 @@ LL | value; ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-inherent.rs:88:21 @@ -132,6 +160,8 @@ LL | let value = ::static_method; ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-inherent.rs:90:9 @@ -141,6 +171,8 @@ LL | value; ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-inherent.rs:92:21 @@ -150,6 +182,8 @@ LL | let value = Pub::static_method; ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-inherent.rs:94:9 @@ -159,6 +193,8 @@ LL | value; ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-inherent.rs:96:19 @@ -168,6 +204,8 @@ LL | Pub(Priv).method(); ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-inherent.rs:99:10 @@ -177,6 +215,8 @@ LL | ::CONST; ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-inherent.rs:101:9 @@ -186,6 +226,8 @@ LL | Pub::CONST; ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 21 previous errors diff --git a/src/test/ui/privacy/associated-item-privacy-trait.stderr b/src/test/ui/privacy/associated-item-privacy-trait.stderr index 5cf1be82937..ac422e99855 100644 --- a/src/test/ui/privacy/associated-item-privacy-trait.stderr +++ b/src/test/ui/privacy/associated-item-privacy-trait.stderr @@ -6,6 +6,8 @@ LL | let value = ::method; ... LL | priv_trait::mac!(); | ------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `for<'r> fn(&'r priv_trait::Pub) {::method}` is private --> $DIR/associated-item-privacy-trait.rs:19:9 @@ -15,6 +17,8 @@ LL | value; ... LL | priv_trait::mac!(); | ------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `for<'r> fn(&'r Self) {::method}` is private --> $DIR/associated-item-privacy-trait.rs:21:13 @@ -24,6 +28,8 @@ LL | Pub.method(); ... LL | priv_trait::mac!(); | ------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: associated constant `PrivTr::CONST` is private --> $DIR/associated-item-privacy-trait.rs:23:9 @@ -33,6 +39,8 @@ LL | ::CONST; ... LL | priv_trait::mac!(); | ------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: trait `priv_trait::PrivTr` is private --> $DIR/associated-item-privacy-trait.rs:25:13 @@ -42,6 +50,8 @@ LL | let _: ::AssocTy; ... LL | priv_trait::mac!(); | ------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: trait `priv_trait::PrivTr` is private --> $DIR/associated-item-privacy-trait.rs:25:16 @@ -51,6 +61,8 @@ LL | let _: ::AssocTy; ... LL | priv_trait::mac!(); | ------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: trait `priv_trait::PrivTr` is private --> $DIR/associated-item-privacy-trait.rs:28:34 @@ -60,6 +72,8 @@ LL | pub type InSignatureTy = ::AssocTy; ... LL | priv_trait::mac!(); | ------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: trait `priv_trait::PrivTr` is private --> $DIR/associated-item-privacy-trait.rs:30:34 @@ -69,6 +83,8 @@ LL | pub trait InSignatureTr: PrivTr {} ... LL | priv_trait::mac!(); | ------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: trait `priv_trait::PrivTr` is private --> $DIR/associated-item-privacy-trait.rs:32:14 @@ -78,6 +94,8 @@ LL | impl PrivTr for u8 {} ... LL | priv_trait::mac!(); | ------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_signature::Priv` is private --> $DIR/associated-item-privacy-trait.rs:49:21 @@ -87,6 +105,8 @@ LL | let value = ::method; ... LL | priv_signature::mac!(); | ----------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_signature::Priv` is private --> $DIR/associated-item-privacy-trait.rs:51:9 @@ -96,6 +116,8 @@ LL | value; ... LL | priv_signature::mac!(); | ----------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_signature::Priv` is private --> $DIR/associated-item-privacy-trait.rs:53:13 @@ -105,6 +127,8 @@ LL | Pub.method(loop {}); ... LL | priv_signature::mac!(); | ----------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_substs::Priv` is private --> $DIR/associated-item-privacy-trait.rs:70:21 @@ -114,6 +138,8 @@ LL | let value = ::method::; ... LL | priv_substs::mac!(); | -------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_substs::Priv` is private --> $DIR/associated-item-privacy-trait.rs:72:9 @@ -123,6 +149,8 @@ LL | value; ... LL | priv_substs::mac!(); | -------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_substs::Priv` is private --> $DIR/associated-item-privacy-trait.rs:74:9 @@ -132,6 +160,8 @@ LL | Pub.method::(); ... LL | priv_substs::mac!(); | -------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-trait.rs:94:21 @@ -141,6 +171,8 @@ LL | let value = ::method; ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-trait.rs:96:9 @@ -150,6 +182,8 @@ LL | value; ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-trait.rs:98:21 @@ -159,6 +193,8 @@ LL | let value = >::method; ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-trait.rs:100:9 @@ -168,6 +204,8 @@ LL | value; ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-trait.rs:102:9 @@ -177,6 +215,8 @@ LL | Pub.method(); ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-trait.rs:105:21 @@ -186,6 +226,8 @@ LL | let value = >::method; ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-trait.rs:107:9 @@ -195,6 +237,8 @@ LL | value; ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-trait.rs:109:9 @@ -204,6 +248,8 @@ LL | Priv.method(); ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-trait.rs:112:9 @@ -213,6 +259,8 @@ LL | ::CONST; ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-trait.rs:114:9 @@ -222,6 +270,8 @@ LL | >::CONST; ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-trait.rs:116:9 @@ -231,6 +281,8 @@ LL | >::CONST; ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-trait.rs:119:13 @@ -240,6 +292,8 @@ LL | let _: ::AssocTy; ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-trait.rs:119:16 @@ -249,6 +303,8 @@ LL | let _: ::AssocTy; ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-trait.rs:122:13 @@ -258,6 +314,8 @@ LL | let _: >::AssocTy; ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-trait.rs:122:16 @@ -267,6 +325,8 @@ LL | let _: >::AssocTy; ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-trait.rs:125:13 @@ -276,6 +336,8 @@ LL | let _: >::AssocTy; ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-trait.rs:125:16 @@ -285,6 +347,8 @@ LL | let _: >::AssocTy; ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-trait.rs:129:35 @@ -294,6 +358,8 @@ LL | pub type InSignatureTy1 = ::AssocTy; ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-trait.rs:131:35 @@ -303,6 +369,8 @@ LL | pub type InSignatureTy2 = >::AssocTy; ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-trait.rs:133:14 @@ -312,6 +380,8 @@ LL | impl PubTr for u8 {} ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 35 previous errors diff --git a/src/test/ui/privacy/associated-item-privacy-type-binding.stderr b/src/test/ui/privacy/associated-item-privacy-type-binding.stderr index 7f6886d7f9a..5afa286b85f 100644 --- a/src/test/ui/privacy/associated-item-privacy-type-binding.stderr +++ b/src/test/ui/privacy/associated-item-privacy-type-binding.stderr @@ -6,6 +6,8 @@ LL | let _: Box>; ... LL | priv_trait::mac1!(); | -------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: trait `priv_trait::PrivTr` is private --> $DIR/associated-item-privacy-type-binding.rs:11:16 @@ -15,6 +17,8 @@ LL | let _: Box>; ... LL | priv_trait::mac1!(); | -------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: trait `priv_trait::PrivTr` is private --> $DIR/associated-item-privacy-type-binding.rs:14:31 @@ -24,6 +28,8 @@ LL | type InSignatureTy2 = Box>; ... LL | priv_trait::mac1!(); | -------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: trait `priv_trait::PrivTr` is private --> $DIR/associated-item-privacy-type-binding.rs:16:31 @@ -33,6 +39,8 @@ LL | trait InSignatureTr2: PubTr {} ... LL | priv_trait::mac1!(); | -------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: trait `priv_trait::PrivTr` is private --> $DIR/associated-item-privacy-type-binding.rs:20:13 @@ -42,6 +50,8 @@ LL | let _: Box>; ... LL | priv_trait::mac2!(); | -------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: trait `priv_trait::PrivTr` is private --> $DIR/associated-item-privacy-type-binding.rs:20:16 @@ -51,6 +61,8 @@ LL | let _: Box>; ... LL | priv_trait::mac2!(); | -------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: trait `priv_trait::PrivTr` is private --> $DIR/associated-item-privacy-type-binding.rs:23:31 @@ -60,6 +72,8 @@ LL | type InSignatureTy1 = Box>; ... LL | priv_trait::mac2!(); | -------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: trait `priv_trait::PrivTr` is private --> $DIR/associated-item-privacy-type-binding.rs:25:31 @@ -69,6 +83,8 @@ LL | trait InSignatureTr1: PrivTr {} ... LL | priv_trait::mac2!(); | -------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-type-binding.rs:44:13 @@ -78,6 +94,8 @@ LL | let _: Box>; ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-type-binding.rs:44:16 @@ -87,6 +105,8 @@ LL | let _: Box>; ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-type-binding.rs:47:13 @@ -96,6 +116,8 @@ LL | let _: Box>; ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-type-binding.rs:47:16 @@ -105,6 +127,8 @@ LL | let _: Box>; ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-type-binding.rs:50:35 @@ -114,6 +138,8 @@ LL | pub type InSignatureTy1 = Box>; ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-type-binding.rs:52:35 @@ -123,6 +149,8 @@ LL | pub type InSignatureTy2 = Box>; ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-type-binding.rs:54:31 @@ -132,6 +160,8 @@ LL | trait InSignatureTr1: PubTrWithParam {} ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-type-binding.rs:56:31 @@ -141,6 +171,8 @@ LL | trait InSignatureTr2: PubTr {} ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 16 previous errors diff --git a/src/test/ui/privacy/private-inferred-type-3.stderr b/src/test/ui/privacy/private-inferred-type-3.stderr index 61cd8476297..376f1334ff8 100644 --- a/src/test/ui/privacy/private-inferred-type-3.stderr +++ b/src/test/ui/privacy/private-inferred-type-3.stderr @@ -4,7 +4,7 @@ error: type `fn() {ext::priv_fn}` is private LL | ext::m!(); | ^^^^^^^^^^ | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: static `PRIV_STATIC` is private --> $DIR/private-inferred-type-3.rs:16:5 @@ -12,7 +12,7 @@ error: static `PRIV_STATIC` is private LL | ext::m!(); | ^^^^^^^^^^ | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `ext::PrivEnum` is private --> $DIR/private-inferred-type-3.rs:16:5 @@ -20,7 +20,7 @@ error: type `ext::PrivEnum` is private LL | ext::m!(); | ^^^^^^^^^^ | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `fn() {::method}` is private --> $DIR/private-inferred-type-3.rs:16:5 @@ -28,7 +28,7 @@ error: type `fn() {::method}` is private LL | ext::m!(); | ^^^^^^^^^^ | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `fn(u8) -> ext::PrivTupleStruct {ext::PrivTupleStruct}` is private --> $DIR/private-inferred-type-3.rs:16:5 @@ -36,7 +36,7 @@ error: type `fn(u8) -> ext::PrivTupleStruct {ext::PrivTupleStruct}` is private LL | ext::m!(); | ^^^^^^^^^^ | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `fn(u8) -> ext::PubTupleStruct {ext::PubTupleStruct}` is private --> $DIR/private-inferred-type-3.rs:16:5 @@ -44,7 +44,7 @@ error: type `fn(u8) -> ext::PubTupleStruct {ext::PubTupleStruct}` is private LL | ext::m!(); | ^^^^^^^^^^ | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `for<'r> fn(&'r ext::Pub) {ext::Pub::::priv_method}` is private --> $DIR/private-inferred-type-3.rs:16:5 @@ -52,7 +52,7 @@ error: type `for<'r> fn(&'r ext::Pub) {ext::Pub::::priv_method}` is priv LL | ext::m!(); | ^^^^^^^^^^ | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 7 previous errors diff --git a/src/test/ui/privacy/private-inferred-type.stderr b/src/test/ui/privacy/private-inferred-type.stderr index 4d40b6b7cab..48c83c21865 100644 --- a/src/test/ui/privacy/private-inferred-type.stderr +++ b/src/test/ui/privacy/private-inferred-type.stderr @@ -114,6 +114,8 @@ LL | priv_fn; ... LL | m::m!(); | -------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `m::PrivEnum` is private --> $DIR/private-inferred-type.rs:41:9 @@ -123,6 +125,8 @@ LL | PrivEnum::Variant; ... LL | m::m!(); | -------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `fn() {::method}` is private --> $DIR/private-inferred-type.rs:43:9 @@ -132,6 +136,8 @@ LL | ::method; ... LL | m::m!(); | -------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `fn(u8) -> m::PrivTupleStruct {m::PrivTupleStruct}` is private --> $DIR/private-inferred-type.rs:45:9 @@ -141,6 +147,8 @@ LL | PrivTupleStruct; ... LL | m::m!(); | -------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `fn(u8) -> m::PubTupleStruct {m::PubTupleStruct}` is private --> $DIR/private-inferred-type.rs:47:9 @@ -150,6 +158,8 @@ LL | PubTupleStruct; ... LL | m::m!(); | -------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: type `for<'r> fn(&'r m::Pub) {m::Pub::::priv_method}` is private --> $DIR/private-inferred-type.rs:49:18 @@ -159,6 +169,8 @@ LL | Pub(0u8).priv_method(); ... LL | m::m!(); | -------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: trait `m::Trait` is private --> $DIR/private-inferred-type.rs:118:5 diff --git a/src/test/ui/proc-macro/derive-bad.stderr b/src/test/ui/proc-macro/derive-bad.stderr index 93908150b6c..8667396c989 100644 --- a/src/test/ui/proc-macro/derive-bad.stderr +++ b/src/test/ui/proc-macro/derive-bad.stderr @@ -3,6 +3,8 @@ error: expected `:`, found `}` | LL | A | ^ expected `:` + | + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: proc-macro derive produced unparseable tokens --> $DIR/derive-bad.rs:7:5 diff --git a/src/test/ui/proc-macro/derive-helper-shadowing.stderr b/src/test/ui/proc-macro/derive-helper-shadowing.stderr index 76434860a49..f82f49aa775 100644 --- a/src/test/ui/proc-macro/derive-helper-shadowing.stderr +++ b/src/test/ui/proc-macro/derive-helper-shadowing.stderr @@ -15,6 +15,8 @@ error: cannot find attribute `empty_helper` in this scope | LL | #[derive(GenHelperUse)] | ^^^^^^^^^^^^ + | + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: cannot find attribute `empty_helper` in this scope --> $DIR/derive-helper-shadowing.rs:14:11 @@ -24,6 +26,8 @@ LL | #[empty_helper] ... LL | gen_helper_use!(); | ------------------ in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0659]: `empty_helper` is ambiguous (name vs any other name during import resolution) --> $DIR/derive-helper-shadowing.rs:24:13 diff --git a/src/test/ui/proc-macro/dollar-crate.stderr b/src/test/ui/proc-macro/dollar-crate.stderr index 5d78a8e1987..465f242580d 100644 --- a/src/test/ui/proc-macro/dollar-crate.stderr +++ b/src/test/ui/proc-macro/dollar-crate.stderr @@ -11,6 +11,7 @@ LL | local!(); | --------- in this macro invocation | = note: `D` must be defined only once in the type namespace of this module + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0428]: the name `D` is defined multiple times --> $DIR/dollar-crate.rs:36:5 @@ -22,7 +23,7 @@ LL | dollar_crate_external::external!(); | previous definition of the type `D` here | = note: `D` must be defined only once in the type namespace of this module - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 2 previous errors diff --git a/src/test/ui/proc-macro/expand-to-unstable-2.stderr b/src/test/ui/proc-macro/expand-to-unstable-2.stderr index 5b6184afacd..ac75367d7ff 100644 --- a/src/test/ui/proc-macro/expand-to-unstable-2.stderr +++ b/src/test/ui/proc-macro/expand-to-unstable-2.stderr @@ -6,6 +6,7 @@ LL | #[derive(Unstable)] | = note: for more information, see https://github.com/rust-lang/rust/issues/29642 = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/proc-macro/expand-to-unstable.stderr b/src/test/ui/proc-macro/expand-to-unstable.stderr index 6df00765866..fdbf80f9b33 100644 --- a/src/test/ui/proc-macro/expand-to-unstable.stderr +++ b/src/test/ui/proc-macro/expand-to-unstable.stderr @@ -5,6 +5,7 @@ LL | #[derive(Unstable)] | ^^^^^^^^ | = help: add `#![feature(core_intrinsics)]` to the crate attributes to enable + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/proc-macro/gen-macro-rules-hygiene.stderr b/src/test/ui/proc-macro/gen-macro-rules-hygiene.stderr index ecebdfa9656..b65fc739e09 100644 --- a/src/test/ui/proc-macro/gen-macro-rules-hygiene.stderr +++ b/src/test/ui/proc-macro/gen-macro-rules-hygiene.stderr @@ -6,6 +6,8 @@ LL | gen_macro_rules!(); ... LL | generated!(); | ------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0425]: cannot find value `local_use` in this scope --> $DIR/gen-macro-rules-hygiene.rs:12:1 @@ -15,6 +17,8 @@ LL | gen_macro_rules!(); ... LL | generated!(); | ------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0425]: cannot find value `local_def` in this scope --> $DIR/gen-macro-rules-hygiene.rs:21:9 diff --git a/src/test/ui/proc-macro/generate-mod.stderr b/src/test/ui/proc-macro/generate-mod.stderr index fe53fb242f4..d2390972634 100644 --- a/src/test/ui/proc-macro/generate-mod.stderr +++ b/src/test/ui/proc-macro/generate-mod.stderr @@ -2,25 +2,21 @@ error[E0412]: cannot find type `FromOutside` in this scope --> $DIR/generate-mod.rs:9:1 | LL | generate_mod::check!(); - | ^^^^^^^^^^^^^^^^^^^^^^^ - | | - | not found in this scope - | in this macro invocation + | ^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope | = note: possible candidate is found in another module, you can import it into scope: FromOutside + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0412]: cannot find type `Outer` in this scope --> $DIR/generate-mod.rs:9:1 | LL | generate_mod::check!(); - | ^^^^^^^^^^^^^^^^^^^^^^^ - | | - | not found in this scope - | in this macro invocation + | ^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope | = note: possible candidate is found in another module, you can import it into scope: Outer + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0412]: cannot find type `FromOutside` in this scope --> $DIR/generate-mod.rs:12:1 @@ -30,6 +26,7 @@ LL | #[generate_mod::check_attr] | = note: possible candidate is found in another module, you can import it into scope: FromOutside + = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0412]: cannot find type `OuterAttr` in this scope --> $DIR/generate-mod.rs:12:1 @@ -39,6 +36,7 @@ LL | #[generate_mod::check_attr] | = note: possible candidate is found in another module, you can import it into scope: OuterAttr + = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) warning: cannot find type `FromOutside` in this scope --> $DIR/generate-mod.rs:16:10 diff --git a/src/test/ui/proc-macro/invalid-punct-ident-4.stderr b/src/test/ui/proc-macro/invalid-punct-ident-4.stderr index e7764004e8d..fe3e55b31be 100644 --- a/src/test/ui/proc-macro/invalid-punct-ident-4.stderr +++ b/src/test/ui/proc-macro/invalid-punct-ident-4.stderr @@ -2,10 +2,9 @@ error: unexpected closing delimiter: `)` --> $DIR/invalid-punct-ident-4.rs:6:1 | LL | lexer_failure!(); - | ^^^^^^^^^^^^^^^^^ - | | - | unexpected closing delimiter - | in this macro invocation + | ^^^^^^^^^^^^^^^^^ unexpected closing delimiter + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: proc macro panicked --> $DIR/invalid-punct-ident-4.rs:6:1 diff --git a/src/test/ui/proc-macro/issue-38586.stderr b/src/test/ui/proc-macro/issue-38586.stderr index 2584e0c62ee..4cdca5c8e01 100644 --- a/src/test/ui/proc-macro/issue-38586.stderr +++ b/src/test/ui/proc-macro/issue-38586.stderr @@ -3,6 +3,8 @@ error[E0425]: cannot find value `foo` in this scope | LL | #[derive(A)] | ^ not found in this scope + | + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/proc-macro/issue-50493.stderr b/src/test/ui/proc-macro/issue-50493.stderr index 56c78001021..7997786b50b 100644 --- a/src/test/ui/proc-macro/issue-50493.stderr +++ b/src/test/ui/proc-macro/issue-50493.stderr @@ -9,12 +9,16 @@ error[E0616]: field `field` of struct `Restricted` is private | LL | #[derive(Derive)] | ^^^^^^ + | + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0616]: field `field` of struct `Restricted` is private --> $DIR/issue-50493.rs:6:10 | LL | #[derive(Derive)] | ^^^^^^ + | + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 3 previous errors diff --git a/src/test/ui/proc-macro/issue-59191-replace-root-with-fn.stderr b/src/test/ui/proc-macro/issue-59191-replace-root-with-fn.stderr index e0a3caef9db..5995a4891f3 100644 --- a/src/test/ui/proc-macro/issue-59191-replace-root-with-fn.stderr +++ b/src/test/ui/proc-macro/issue-59191-replace-root-with-fn.stderr @@ -3,6 +3,8 @@ error: expected crate top-level item to be a module after macro expansion, found | LL | #![issue_59191::no_main] | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0601]: `main` function not found in crate `issue_59191_replace_root_with_fn` --> $DIR/issue-59191-replace-root-with-fn.rs:5:1 diff --git a/src/test/ui/proc-macro/lints_in_proc_macros.stderr b/src/test/ui/proc-macro/lints_in_proc_macros.stderr index f28b8c9fb73..df9d7e1efe3 100644 --- a/src/test/ui/proc-macro/lints_in_proc_macros.stderr +++ b/src/test/ui/proc-macro/lints_in_proc_macros.stderr @@ -2,10 +2,9 @@ error[E0425]: cannot find value `foobar2` in this scope --> $DIR/lints_in_proc_macros.rs:12:5 | LL | bang_proc_macro2!(); - | ^^^^^^^^^^^^^^^^^^^^ - | | - | help: a local variable with a similar name exists: `foobar` - | in this macro invocation + | ^^^^^^^^^^^^^^^^^^^^ help: a local variable with a similar name exists: `foobar` + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/proc-macro/mixed-site-span.stderr b/src/test/ui/proc-macro/mixed-site-span.stderr index 54d10fe0d90..c344147ed93 100644 --- a/src/test/ui/proc-macro/mixed-site-span.stderr +++ b/src/test/ui/proc-macro/mixed-site-span.stderr @@ -2,19 +2,17 @@ error[E0426]: use of undeclared label `'label_use` --> $DIR/mixed-site-span.rs:15:9 | LL | proc_macro_rules!(); - | ^^^^^^^^^^^^^^^^^^^^ - | | - | undeclared label `'label_use` - | in this macro invocation + | ^^^^^^^^^^^^^^^^^^^^ undeclared label `'label_use` + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0425]: cannot find value `local_use` in this scope --> $DIR/mixed-site-span.rs:15:9 | LL | proc_macro_rules!(); - | ^^^^^^^^^^^^^^^^^^^^ - | | - | not found in this scope - | in this macro invocation + | ^^^^^^^^^^^^^^^^^^^^ not found in this scope + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0425]: cannot find value `local_def` in this scope --> $DIR/mixed-site-span.rs:19:9 @@ -39,6 +37,7 @@ LL | | } LL | pass_dollar_crate!(); | --------------------- in this macro invocation | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) help: possible candidate is found in another module, you can import it into scope | LL | use ItemUse; diff --git a/src/test/ui/proc-macro/multispan.stderr b/src/test/ui/proc-macro/multispan.stderr index e7f705c7feb..c9390a04b9e 100644 --- a/src/test/ui/proc-macro/multispan.stderr +++ b/src/test/ui/proc-macro/multispan.stderr @@ -20,6 +20,7 @@ note: found these 'hi's | LL | hello!(hi); | ^^ + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: hello to you, too! --> $DIR/auxiliary/multispan.rs:31:1 @@ -43,6 +44,7 @@ note: found these 'hi's | LL | hello!(hi hi); | ^^ ^^ + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: hello to you, too! --> $DIR/auxiliary/multispan.rs:31:1 @@ -66,6 +68,7 @@ note: found these 'hi's | LL | hello!(hi hi hi); | ^^ ^^ ^^ + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: hello to you, too! --> $DIR/auxiliary/multispan.rs:31:1 @@ -89,6 +92,7 @@ note: found these 'hi's | LL | hello!(hi hey hi yo hi beep beep hi hi); | ^^ ^^ ^^ ^^ ^^ + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: hello to you, too! --> $DIR/auxiliary/multispan.rs:31:1 @@ -112,6 +116,7 @@ note: found these 'hi's | LL | hello!(hi there, hi how are you? hi... hi.); | ^^ ^^ ^^ ^^ + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: hello to you, too! --> $DIR/auxiliary/multispan.rs:31:1 @@ -135,6 +140,7 @@ note: found these 'hi's | LL | hello!(whoah. hi di hi di ho); | ^^ ^^ + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: hello to you, too! --> $DIR/auxiliary/multispan.rs:31:1 @@ -158,6 +164,7 @@ note: found these 'hi's | LL | hello!(hi good hi and good bye); | ^^ ^^ + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 7 previous errors diff --git a/src/test/ui/proc-macro/parent-source-spans.stderr b/src/test/ui/proc-macro/parent-source-spans.stderr index 9f0fefcfe6c..254f87751fd 100644 --- a/src/test/ui/proc-macro/parent-source-spans.stderr +++ b/src/test/ui/proc-macro/parent-source-spans.stderr @@ -6,6 +6,8 @@ LL | three!($a, $b); ... LL | one!("hello", "world"); | ----------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: second final: "world" --> $DIR/parent-source-spans.rs:19:16 @@ -15,6 +17,8 @@ LL | three!($a, $b); ... LL | one!("hello", "world"); | ----------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: first parent: "hello" --> $DIR/parent-source-spans.rs:13:5 @@ -24,6 +28,8 @@ LL | two!($a, $b); ... LL | one!("hello", "world"); | ----------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: second parent: "world" --> $DIR/parent-source-spans.rs:13:5 @@ -33,6 +39,8 @@ LL | two!($a, $b); ... LL | one!("hello", "world"); | ----------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: first grandparent: "hello" --> $DIR/parent-source-spans.rs:39:5 @@ -66,6 +74,8 @@ LL | three!($a, $b); ... LL | two!("yay", "rust"); | -------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: second final: "rust" --> $DIR/parent-source-spans.rs:19:16 @@ -75,6 +85,8 @@ LL | three!($a, $b); ... LL | two!("yay", "rust"); | -------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: first parent: "yay" --> $DIR/parent-source-spans.rs:45:5 @@ -137,6 +149,8 @@ LL | one!("hello", "world"); | LL | Ok(#[stable(feature = "rust1", since = "1.0.0")] T), | --------------------------------------------------- similarly named tuple variant `Ok` defined here + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0425]: cannot find value `ok` in this scope --> $DIR/parent-source-spans.rs:32:5 @@ -151,6 +165,8 @@ LL | two!("yay", "rust"); | LL | Ok(#[stable(feature = "rust1", since = "1.0.0")] T), | --------------------------------------------------- similarly named tuple variant `Ok` defined here + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0425]: cannot find value `ok` in this scope --> $DIR/parent-source-spans.rs:32:5 @@ -165,6 +181,8 @@ LL | three!("hip", "hop"); | LL | Ok(#[stable(feature = "rust1", since = "1.0.0")] T), | --------------------------------------------------- similarly named tuple variant `Ok` defined here + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 21 previous errors diff --git a/src/test/ui/proc-macro/subspan.stderr b/src/test/ui/proc-macro/subspan.stderr index 06715c197bc..c82c2dee676 100644 --- a/src/test/ui/proc-macro/subspan.stderr +++ b/src/test/ui/proc-macro/subspan.stderr @@ -2,97 +2,105 @@ error: found 'hi's --> $DIR/subspan.rs:11:1 | LL | subspan!("hi"); - | ^^^^^^^^^^^^^^^ in this macro invocation + | ^^^^^^^^^^^^^^^ | note: here --> $DIR/subspan.rs:11:11 | LL | subspan!("hi"); | ^^ + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: found 'hi's --> $DIR/subspan.rs:14:1 | LL | subspan!("hihi"); - | ^^^^^^^^^^^^^^^^^ in this macro invocation + | ^^^^^^^^^^^^^^^^^ | note: here --> $DIR/subspan.rs:14:11 | LL | subspan!("hihi"); | ^^^^ + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: found 'hi's --> $DIR/subspan.rs:17:1 | LL | subspan!("hihihi"); - | ^^^^^^^^^^^^^^^^^^^ in this macro invocation + | ^^^^^^^^^^^^^^^^^^^ | note: here --> $DIR/subspan.rs:17:11 | LL | subspan!("hihihi"); | ^^^^^^ + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: found 'hi's --> $DIR/subspan.rs:20:1 | LL | subspan!("why I hide? hi!"); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ in this macro invocation + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: here --> $DIR/subspan.rs:20:17 | LL | subspan!("why I hide? hi!"); | ^^ ^^ + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: found 'hi's --> $DIR/subspan.rs:21:1 | LL | subspan!("hey, hi, hidy, hidy, hi hi"); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ in this macro invocation + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: here --> $DIR/subspan.rs:21:16 | LL | subspan!("hey, hi, hidy, hidy, hi hi"); | ^^ ^^ ^^ ^^ ^^ + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: found 'hi's --> $DIR/subspan.rs:22:1 | LL | subspan!("this is a hi, and this is another hi"); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ in this macro invocation + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: here --> $DIR/subspan.rs:22:12 | LL | subspan!("this is a hi, and this is another hi"); | ^^ ^^ ^^ ^^ + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: found 'hi's --> $DIR/subspan.rs:23:1 | LL | subspan!("how are you this evening"); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ in this macro invocation + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: here --> $DIR/subspan.rs:23:24 | LL | subspan!("how are you this evening"); | ^^ + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: found 'hi's --> $DIR/subspan.rs:24:1 | LL | subspan!("this is highly eradic"); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ in this macro invocation + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: here --> $DIR/subspan.rs:24:12 | LL | subspan!("this is highly eradic"); | ^^ ^^ + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 8 previous errors diff --git a/src/test/ui/proc-macro/three-equals.stderr b/src/test/ui/proc-macro/three-equals.stderr index 0698b0f4754..82c4167262f 100644 --- a/src/test/ui/proc-macro/three-equals.stderr +++ b/src/test/ui/proc-macro/three-equals.stderr @@ -16,6 +16,7 @@ LL | three_equals!(==); | ------------------ in this macro invocation | = help: input must be: `===` + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: expected EOF, found `=`. --> $DIR/three-equals.rs:18:21 diff --git a/src/test/ui/range/range_traits-1.stderr b/src/test/ui/range/range_traits-1.stderr index f60ec23bdb0..0e1da3d3f76 100644 --- a/src/test/ui/range/range_traits-1.stderr +++ b/src/test/ui/range/range_traits-1.stderr @@ -6,6 +6,7 @@ LL | a: Range, | = help: the trait `std::cmp::PartialOrd` is not implemented for `std::ops::Range` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `std::ops::RangeTo` with `std::ops::RangeTo` --> $DIR/range_traits-1.rs:12:5 @@ -15,6 +16,7 @@ LL | b: RangeTo, | = help: the trait `std::cmp::PartialOrd` is not implemented for `std::ops::RangeTo` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `std::ops::RangeFrom` with `std::ops::RangeFrom` --> $DIR/range_traits-1.rs:19:5 @@ -24,6 +26,7 @@ LL | c: RangeFrom, | = help: the trait `std::cmp::PartialOrd` is not implemented for `std::ops::RangeFrom` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `std::ops::RangeFull` with `std::ops::RangeFull` --> $DIR/range_traits-1.rs:26:5 @@ -33,6 +36,7 @@ LL | d: RangeFull, | = help: the trait `std::cmp::PartialOrd` is not implemented for `std::ops::RangeFull` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `std::ops::RangeInclusive` with `std::ops::RangeInclusive` --> $DIR/range_traits-1.rs:33:5 @@ -42,6 +46,7 @@ LL | e: RangeInclusive, | = help: the trait `std::cmp::PartialOrd` is not implemented for `std::ops::RangeInclusive` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `std::ops::RangeToInclusive` with `std::ops::RangeToInclusive` --> $DIR/range_traits-1.rs:40:5 @@ -51,6 +56,7 @@ LL | f: RangeToInclusive, | = help: the trait `std::cmp::PartialOrd` is not implemented for `std::ops::RangeToInclusive` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `std::ops::Range` with `std::ops::Range` --> $DIR/range_traits-1.rs:5:5 @@ -60,6 +66,7 @@ LL | a: Range, | = help: the trait `std::cmp::PartialOrd` is not implemented for `std::ops::Range` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `std::ops::RangeTo` with `std::ops::RangeTo` --> $DIR/range_traits-1.rs:12:5 @@ -69,6 +76,7 @@ LL | b: RangeTo, | = help: the trait `std::cmp::PartialOrd` is not implemented for `std::ops::RangeTo` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `std::ops::RangeFrom` with `std::ops::RangeFrom` --> $DIR/range_traits-1.rs:19:5 @@ -78,6 +86,7 @@ LL | c: RangeFrom, | = help: the trait `std::cmp::PartialOrd` is not implemented for `std::ops::RangeFrom` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `std::ops::RangeFull` with `std::ops::RangeFull` --> $DIR/range_traits-1.rs:26:5 @@ -87,6 +96,7 @@ LL | d: RangeFull, | = help: the trait `std::cmp::PartialOrd` is not implemented for `std::ops::RangeFull` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `std::ops::RangeInclusive` with `std::ops::RangeInclusive` --> $DIR/range_traits-1.rs:33:5 @@ -96,6 +106,7 @@ LL | e: RangeInclusive, | = help: the trait `std::cmp::PartialOrd` is not implemented for `std::ops::RangeInclusive` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `std::ops::RangeToInclusive` with `std::ops::RangeToInclusive` --> $DIR/range_traits-1.rs:40:5 @@ -105,6 +116,7 @@ LL | f: RangeToInclusive, | = help: the trait `std::cmp::PartialOrd` is not implemented for `std::ops::RangeToInclusive` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `std::ops::Range` with `std::ops::Range` --> $DIR/range_traits-1.rs:5:5 @@ -114,6 +126,7 @@ LL | a: Range, | = help: the trait `std::cmp::PartialOrd` is not implemented for `std::ops::Range` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `std::ops::RangeTo` with `std::ops::RangeTo` --> $DIR/range_traits-1.rs:12:5 @@ -123,6 +136,7 @@ LL | b: RangeTo, | = help: the trait `std::cmp::PartialOrd` is not implemented for `std::ops::RangeTo` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `std::ops::RangeFrom` with `std::ops::RangeFrom` --> $DIR/range_traits-1.rs:19:5 @@ -132,6 +146,7 @@ LL | c: RangeFrom, | = help: the trait `std::cmp::PartialOrd` is not implemented for `std::ops::RangeFrom` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `std::ops::RangeFull` with `std::ops::RangeFull` --> $DIR/range_traits-1.rs:26:5 @@ -141,6 +156,7 @@ LL | d: RangeFull, | = help: the trait `std::cmp::PartialOrd` is not implemented for `std::ops::RangeFull` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `std::ops::RangeInclusive` with `std::ops::RangeInclusive` --> $DIR/range_traits-1.rs:33:5 @@ -150,6 +166,7 @@ LL | e: RangeInclusive, | = help: the trait `std::cmp::PartialOrd` is not implemented for `std::ops::RangeInclusive` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `std::ops::RangeToInclusive` with `std::ops::RangeToInclusive` --> $DIR/range_traits-1.rs:40:5 @@ -159,6 +176,7 @@ LL | f: RangeToInclusive, | = help: the trait `std::cmp::PartialOrd` is not implemented for `std::ops::RangeToInclusive` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `std::ops::Range` with `std::ops::Range` --> $DIR/range_traits-1.rs:5:5 @@ -168,6 +186,7 @@ LL | a: Range, | = help: the trait `std::cmp::PartialOrd` is not implemented for `std::ops::Range` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `std::ops::RangeTo` with `std::ops::RangeTo` --> $DIR/range_traits-1.rs:12:5 @@ -177,6 +196,7 @@ LL | b: RangeTo, | = help: the trait `std::cmp::PartialOrd` is not implemented for `std::ops::RangeTo` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `std::ops::RangeFrom` with `std::ops::RangeFrom` --> $DIR/range_traits-1.rs:19:5 @@ -186,6 +206,7 @@ LL | c: RangeFrom, | = help: the trait `std::cmp::PartialOrd` is not implemented for `std::ops::RangeFrom` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `std::ops::RangeFull` with `std::ops::RangeFull` --> $DIR/range_traits-1.rs:26:5 @@ -195,6 +216,7 @@ LL | d: RangeFull, | = help: the trait `std::cmp::PartialOrd` is not implemented for `std::ops::RangeFull` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `std::ops::RangeInclusive` with `std::ops::RangeInclusive` --> $DIR/range_traits-1.rs:33:5 @@ -204,6 +226,7 @@ LL | e: RangeInclusive, | = help: the trait `std::cmp::PartialOrd` is not implemented for `std::ops::RangeInclusive` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `std::ops::RangeToInclusive` with `std::ops::RangeToInclusive` --> $DIR/range_traits-1.rs:40:5 @@ -213,6 +236,7 @@ LL | f: RangeToInclusive, | = help: the trait `std::cmp::PartialOrd` is not implemented for `std::ops::RangeToInclusive` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `std::ops::Range` with `std::ops::Range` --> $DIR/range_traits-1.rs:5:5 @@ -222,6 +246,7 @@ LL | a: Range, | = help: the trait `std::cmp::PartialOrd` is not implemented for `std::ops::Range` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `std::ops::RangeTo` with `std::ops::RangeTo` --> $DIR/range_traits-1.rs:12:5 @@ -231,6 +256,7 @@ LL | b: RangeTo, | = help: the trait `std::cmp::PartialOrd` is not implemented for `std::ops::RangeTo` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `std::ops::RangeFrom` with `std::ops::RangeFrom` --> $DIR/range_traits-1.rs:19:5 @@ -240,6 +266,7 @@ LL | c: RangeFrom, | = help: the trait `std::cmp::PartialOrd` is not implemented for `std::ops::RangeFrom` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `std::ops::RangeFull` with `std::ops::RangeFull` --> $DIR/range_traits-1.rs:26:5 @@ -249,6 +276,7 @@ LL | d: RangeFull, | = help: the trait `std::cmp::PartialOrd` is not implemented for `std::ops::RangeFull` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `std::ops::RangeInclusive` with `std::ops::RangeInclusive` --> $DIR/range_traits-1.rs:33:5 @@ -258,6 +286,7 @@ LL | e: RangeInclusive, | = help: the trait `std::cmp::PartialOrd` is not implemented for `std::ops::RangeInclusive` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: can't compare `std::ops::RangeToInclusive` with `std::ops::RangeToInclusive` --> $DIR/range_traits-1.rs:40:5 @@ -267,6 +296,7 @@ LL | f: RangeToInclusive, | = help: the trait `std::cmp::PartialOrd` is not implemented for `std::ops::RangeToInclusive` = note: required by `std::cmp::PartialOrd::partial_cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `std::ops::Range: std::cmp::Ord` is not satisfied --> $DIR/range_traits-1.rs:5:5 @@ -275,6 +305,7 @@ LL | a: Range, | ^^^^^^^^^^^^^^^ the trait `std::cmp::Ord` is not implemented for `std::ops::Range` | = note: required by `std::cmp::Ord::cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `std::ops::RangeTo: std::cmp::Ord` is not satisfied --> $DIR/range_traits-1.rs:12:5 @@ -283,6 +314,7 @@ LL | b: RangeTo, | ^^^^^^^^^^^^^^^^^ the trait `std::cmp::Ord` is not implemented for `std::ops::RangeTo` | = note: required by `std::cmp::Ord::cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `std::ops::RangeFrom: std::cmp::Ord` is not satisfied --> $DIR/range_traits-1.rs:19:5 @@ -291,6 +323,7 @@ LL | c: RangeFrom, | ^^^^^^^^^^^^^^^^^^^ the trait `std::cmp::Ord` is not implemented for `std::ops::RangeFrom` | = note: required by `std::cmp::Ord::cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `std::ops::RangeFull: std::cmp::Ord` is not satisfied --> $DIR/range_traits-1.rs:26:5 @@ -299,6 +332,7 @@ LL | d: RangeFull, | ^^^^^^^^^^^^ the trait `std::cmp::Ord` is not implemented for `std::ops::RangeFull` | = note: required by `std::cmp::Ord::cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `std::ops::RangeInclusive: std::cmp::Ord` is not satisfied --> $DIR/range_traits-1.rs:33:5 @@ -307,6 +341,7 @@ LL | e: RangeInclusive, | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::cmp::Ord` is not implemented for `std::ops::RangeInclusive` | = note: required by `std::cmp::Ord::cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `std::ops::RangeToInclusive: std::cmp::Ord` is not satisfied --> $DIR/range_traits-1.rs:40:5 @@ -315,6 +350,7 @@ LL | f: RangeToInclusive, | ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::cmp::Ord` is not implemented for `std::ops::RangeToInclusive` | = note: required by `std::cmp::Ord::cmp` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 36 previous errors diff --git a/src/test/ui/range/range_traits-2.stderr b/src/test/ui/range/range_traits-2.stderr index 598a0b3ed03..8a9d15f0999 100644 --- a/src/test/ui/range/range_traits-2.stderr +++ b/src/test/ui/range/range_traits-2.stderr @@ -5,6 +5,8 @@ LL | #[derive(Copy, Clone)] | ^^^^ LL | struct R(Range); | ------------ this field does not implement `Copy` + | + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/range/range_traits-3.stderr b/src/test/ui/range/range_traits-3.stderr index e2713a2bd5e..14fda58e1f8 100644 --- a/src/test/ui/range/range_traits-3.stderr +++ b/src/test/ui/range/range_traits-3.stderr @@ -5,6 +5,8 @@ LL | #[derive(Copy, Clone)] | ^^^^ LL | struct R(RangeFrom); | ---------------- this field does not implement `Copy` + | + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/range/range_traits-6.stderr b/src/test/ui/range/range_traits-6.stderr index 226d72ce026..693600cdce4 100644 --- a/src/test/ui/range/range_traits-6.stderr +++ b/src/test/ui/range/range_traits-6.stderr @@ -5,6 +5,8 @@ LL | #[derive(Copy, Clone)] | ^^^^ LL | struct R(RangeInclusive); | --------------------- this field does not implement `Copy` + | + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/reachable/expr_again.stderr b/src/test/ui/reachable/expr_again.stderr index a9b5832ba2c..130fd8535e0 100644 --- a/src/test/ui/reachable/expr_again.stderr +++ b/src/test/ui/reachable/expr_again.stderr @@ -11,7 +11,7 @@ note: the lint level is defined here | LL | #![deny(unreachable_code)] | ^^^^^^^^^^^^^^^^ - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/reachable/expr_block.stderr b/src/test/ui/reachable/expr_block.stderr index 8b696b7abcb..154734b0f69 100644 --- a/src/test/ui/reachable/expr_block.stderr +++ b/src/test/ui/reachable/expr_block.stderr @@ -20,7 +20,7 @@ LL | return; LL | println!("foo"); | ^^^^^^^^^^^^^^^^ unreachable statement | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 2 previous errors diff --git a/src/test/ui/reachable/expr_if.stderr b/src/test/ui/reachable/expr_if.stderr index 6ae635ae4b7..850570d0564 100644 --- a/src/test/ui/reachable/expr_if.stderr +++ b/src/test/ui/reachable/expr_if.stderr @@ -24,7 +24,7 @@ LL | return; LL | println!("But I am."); | ^^^^^^^^^^^^^^^^^^^^^^ unreachable statement | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 2 previous errors diff --git a/src/test/ui/reachable/expr_loop.stderr b/src/test/ui/reachable/expr_loop.stderr index e5d395254a0..fe7d7782edf 100644 --- a/src/test/ui/reachable/expr_loop.stderr +++ b/src/test/ui/reachable/expr_loop.stderr @@ -11,7 +11,7 @@ note: the lint level is defined here | LL | #![deny(unreachable_code)] | ^^^^^^^^^^^^^^^^ - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: unreachable statement --> $DIR/expr_loop.rs:21:5 @@ -21,7 +21,7 @@ LL | loop { return; } LL | println!("I am dead."); | ^^^^^^^^^^^^^^^^^^^^^^^ unreachable statement | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: unreachable statement --> $DIR/expr_loop.rs:32:5 @@ -31,7 +31,7 @@ LL | loop { 'middle: loop { loop { break 'middle; } } } LL | println!("I am dead."); | ^^^^^^^^^^^^^^^^^^^^^^^ unreachable statement | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 3 previous errors diff --git a/src/test/ui/reachable/expr_match.stderr b/src/test/ui/reachable/expr_match.stderr index a8317192c2b..a1c396e0c61 100644 --- a/src/test/ui/reachable/expr_match.stderr +++ b/src/test/ui/reachable/expr_match.stderr @@ -11,7 +11,7 @@ note: the lint level is defined here | LL | #![deny(unreachable_code)] | ^^^^^^^^^^^^^^^^ - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: unreachable statement --> $DIR/expr_match.rs:19:5 @@ -21,7 +21,7 @@ LL | match () { () if false => return, () => return } LL | println!("I am dead"); | ^^^^^^^^^^^^^^^^^^^^^^ unreachable statement | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 2 previous errors diff --git a/src/test/ui/regions/regions-var-type-out-of-scope.stderr b/src/test/ui/regions/regions-var-type-out-of-scope.stderr index 146fb8fd81f..d9571767685 100644 --- a/src/test/ui/regions/regions-var-type-out-of-scope.stderr +++ b/src/test/ui/regions/regions-var-type-out-of-scope.stderr @@ -9,7 +9,6 @@ LL | assert_eq!(*x, 3); | ------------------ borrow later used here | = note: consider using a `let` binding to create a longer lived value - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr b/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr index ed4f34b527f..d4bd760770d 100644 --- a/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr +++ b/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr @@ -12,6 +12,7 @@ LL | pub fn assert_test_result(result: T) { | ----------- required by this bound in `test::assert_test_result` | = help: the trait `std::process::Termination` is not implemented for `std::result::Result` + = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/rfc-2361-dbg-macro/dbg-macro-move-semantics.stderr b/src/test/ui/rfc-2361-dbg-macro/dbg-macro-move-semantics.stderr index 5f0b3a1d40b..5611b5f4ece 100644 --- a/src/test/ui/rfc-2361-dbg-macro/dbg-macro-move-semantics.stderr +++ b/src/test/ui/rfc-2361-dbg-macro/dbg-macro-move-semantics.stderr @@ -7,8 +7,6 @@ LL | let _ = dbg!(a); | ------- value moved here LL | let _ = dbg!(a); | ^ value used here after move - | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/rfc-2361-dbg-macro/dbg-macro-requires-debug.stderr b/src/test/ui/rfc-2361-dbg-macro/dbg-macro-requires-debug.stderr index ecab673953d..799a05bf7e8 100644 --- a/src/test/ui/rfc-2361-dbg-macro/dbg-macro-requires-debug.stderr +++ b/src/test/ui/rfc-2361-dbg-macro/dbg-macro-requires-debug.stderr @@ -8,7 +8,7 @@ LL | let _: NotDebug = dbg!(NotDebug); = note: add `#[derive(Debug)]` or manually implement `std::fmt::Debug` = note: required because of the requirements on the impl of `std::fmt::Debug` for `&NotDebug` = note: required by `std::fmt::Debug::fmt` - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/rust-2018/suggestions-not-always-applicable.stderr b/src/test/ui/rust-2018/suggestions-not-always-applicable.stderr index 8495fe62575..30f98d6df9e 100644 --- a/src/test/ui/rust-2018/suggestions-not-always-applicable.stderr +++ b/src/test/ui/rust-2018/suggestions-not-always-applicable.stderr @@ -12,6 +12,7 @@ LL | #![warn(rust_2018_compatibility)] = note: `#[warn(absolute_paths_not_starting_with_crate)]` implied by `#[warn(rust_2018_compatibility)]` = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition! = note: for more information, see issue #53130 + = note: this warning originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) warning: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition --> $DIR/suggestions-not-always-applicable.rs:17:5 @@ -21,4 +22,5 @@ LL | #[foo] | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition! = note: for more information, see issue #53130 + = note: this warning originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/src/test/ui/rust-2018/uniform-paths/ambiguity-macros-nested.stderr b/src/test/ui/rust-2018/uniform-paths/ambiguity-macros-nested.stderr index 27b8d0e216e..14c2582121b 100644 --- a/src/test/ui/rust-2018/uniform-paths/ambiguity-macros-nested.stderr +++ b/src/test/ui/rust-2018/uniform-paths/ambiguity-macros-nested.stderr @@ -17,6 +17,7 @@ LL | | } LL | m!(); | ----- in this macro invocation = help: use `self::std` to refer to this module unambiguously + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/rust-2018/uniform-paths/ambiguity-macros.stderr b/src/test/ui/rust-2018/uniform-paths/ambiguity-macros.stderr index 44b34d2682d..de7b79de95c 100644 --- a/src/test/ui/rust-2018/uniform-paths/ambiguity-macros.stderr +++ b/src/test/ui/rust-2018/uniform-paths/ambiguity-macros.stderr @@ -17,6 +17,7 @@ LL | | } LL | m!(); | ----- in this macro invocation = help: use `crate::std` to refer to this module unambiguously + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/span/E0204.stderr b/src/test/ui/span/E0204.stderr index 5a981a4a6e4..23c9513f9cc 100644 --- a/src/test/ui/span/E0204.stderr +++ b/src/test/ui/span/E0204.stderr @@ -15,6 +15,8 @@ LL | #[derive(Copy)] LL | struct Foo2<'a> { LL | ty: &'a mut bool, | ---------------- this field does not implement `Copy` + | + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0204]: the trait `Copy` may not be implemented for this type --> $DIR/E0204.rs:17:6 @@ -33,6 +35,8 @@ LL | #[derive(Copy)] LL | enum EFoo2<'a> { LL | Bar(&'a mut bool), | ------------ this field does not implement `Copy` + | + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 4 previous errors diff --git a/src/test/ui/span/coerce-suggestions.stderr b/src/test/ui/span/coerce-suggestions.stderr index 343644006b1..d1960a8aab3 100644 --- a/src/test/ui/span/coerce-suggestions.stderr +++ b/src/test/ui/span/coerce-suggestions.stderr @@ -49,7 +49,7 @@ error[E0308]: mismatched types LL | s = format!("foo"); | ^^^^^^^^^^^^^^ expected `&mut std::string::String`, found struct `std::string::String` | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 6 previous errors diff --git a/src/test/ui/span/issue-33884.stderr b/src/test/ui/span/issue-33884.stderr index 4f46c4c7394..184d9644c83 100644 --- a/src/test/ui/span/issue-33884.stderr +++ b/src/test/ui/span/issue-33884.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | stream.write_fmt(format!("message received")) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `std::fmt::Arguments`, found struct `std::string::String` | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/span/macro-span-replacement.stderr b/src/test/ui/span/macro-span-replacement.stderr index 4eb775155a5..721d3b12172 100644 --- a/src/test/ui/span/macro-span-replacement.stderr +++ b/src/test/ui/span/macro-span-replacement.stderr @@ -13,4 +13,5 @@ note: the lint level is defined here LL | #![warn(unused)] | ^^^^^^ = note: `#[warn(dead_code)]` implied by `#[warn(unused)]` + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/src/test/ui/span/slice-borrow.stderr b/src/test/ui/span/slice-borrow.stderr index 84d0c847b7b..745936e11ea 100644 --- a/src/test/ui/span/slice-borrow.stderr +++ b/src/test/ui/span/slice-borrow.stderr @@ -10,7 +10,7 @@ LL | y.use_ref(); | - borrow later used here | = note: consider using a `let` binding to create a longer lived value - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/suggestions/dont-suggest-deref-inside-macro-issue-58298.stderr b/src/test/ui/suggestions/dont-suggest-deref-inside-macro-issue-58298.stderr index e37edc1daca..b0cef952b21 100644 --- a/src/test/ui/suggestions/dont-suggest-deref-inside-macro-issue-58298.stderr +++ b/src/test/ui/suggestions/dont-suggest-deref-inside-macro-issue-58298.stderr @@ -4,12 +4,9 @@ error[E0308]: mismatched types LL | / intrinsic_match! { LL | | "abc" LL | | }; - | | ^ - | | | - | |______expected `&str`, found struct `std::string::String` - | in this macro invocation + | |______^ expected `&str`, found struct `std::string::String` | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/suggestions/dont-suggest-try_into-in-macros.stderr b/src/test/ui/suggestions/dont-suggest-try_into-in-macros.stderr index 1f2252f4d43..b1ea100f164 100644 --- a/src/test/ui/suggestions/dont-suggest-try_into-in-macros.stderr +++ b/src/test/ui/suggestions/dont-suggest-try_into-in-macros.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | assert_eq!(10u64, 10usize); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u64`, found `usize` | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/suggestions/mut-borrow-needed-by-trait.stderr b/src/test/ui/suggestions/mut-borrow-needed-by-trait.stderr index 2c3c07c19e7..8dc041ace36 100644 --- a/src/test/ui/suggestions/mut-borrow-needed-by-trait.stderr +++ b/src/test/ui/suggestions/mut-borrow-needed-by-trait.stderr @@ -33,7 +33,7 @@ LL | writeln!(fp, "hello world").unwrap(); | = note: the method `write_fmt` exists but the following trait bounds were not satisfied: `std::io::BufWriter<&dyn std::io::Write> : std::io::Write` - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 4 previous errors diff --git a/src/test/ui/suggestions/path-display.stderr b/src/test/ui/suggestions/path-display.stderr index 39d236af4f3..13546cddbd3 100644 --- a/src/test/ui/suggestions/path-display.stderr +++ b/src/test/ui/suggestions/path-display.stderr @@ -8,6 +8,7 @@ LL | println!("{}", path); = note: call `.display()` or `.to_string_lossy()` to safely print paths, as they may contain non-Unicode data = note: required because of the requirements on the impl of `std::fmt::Display` for `&std::path::Path` = note: required by `std::fmt::Display::fmt` + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/suggestions/vec-macro-in-pattern.stderr b/src/test/ui/suggestions/vec-macro-in-pattern.stderr index 1634fdde7d2..f9d0464ac88 100644 --- a/src/test/ui/suggestions/vec-macro-in-pattern.stderr +++ b/src/test/ui/suggestions/vec-macro-in-pattern.stderr @@ -10,7 +10,7 @@ LL | Some(vec![_x]) => (), | help: use a slice pattern here instead: `[_x]` | = help: for more information, see https://doc.rust-lang.org/edition-guide/rust-2018/slice-patterns.html - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/trace_macros-gate.stderr b/src/test/ui/trace_macros-gate.stderr index 7b954273071..7b46bee6a64 100644 --- a/src/test/ui/trace_macros-gate.stderr +++ b/src/test/ui/trace_macros-gate.stderr @@ -42,6 +42,7 @@ LL | expando!(true); | = note: for more information, see https://github.com/rust-lang/rust/issues/29598 = help: add `#![feature(trace_macros)]` to the crate attributes to enable + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 5 previous errors diff --git a/src/test/ui/try-block/try-block-opt-init.stderr b/src/test/ui/try-block/try-block-opt-init.stderr index 308906477d9..6bae3a8587d 100644 --- a/src/test/ui/try-block/try-block-opt-init.stderr +++ b/src/test/ui/try-block/try-block-opt-init.stderr @@ -4,7 +4,7 @@ error[E0381]: borrow of possibly-uninitialized variable: `cfg_res` LL | assert_eq!(cfg_res, 5); | ^^^^^^^^^^^^^^^^^^^^^^^ use of possibly-uninitialized `cfg_res` | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/tuple/tuple-struct-fields/test2.stderr b/src/test/ui/tuple/tuple-struct-fields/test2.stderr index 2f1ca2fe0c1..d6ea3626675 100644 --- a/src/test/ui/tuple/tuple-struct-fields/test2.stderr +++ b/src/test/ui/tuple/tuple-struct-fields/test2.stderr @@ -8,6 +8,8 @@ LL | struct S3(pub $t ()); ... LL | define_struct! { (foo) } | ------------------------ in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0412]: cannot find type `foo` in this scope --> $DIR/test2.rs:11:23 diff --git a/src/test/ui/tuple/tuple-struct-fields/test3.stderr b/src/test/ui/tuple/tuple-struct-fields/test3.stderr index 5d42fe6ef50..b38513e5a92 100644 --- a/src/test/ui/tuple/tuple-struct-fields/test3.stderr +++ b/src/test/ui/tuple/tuple-struct-fields/test3.stderr @@ -8,6 +8,8 @@ LL | struct S3(pub($t) ()); ... LL | define_struct! { foo } | ---------------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0412]: cannot find type `foo` in this scope --> $DIR/test3.rs:11:22 diff --git a/src/test/ui/type/ascription/issue-47666.stderr b/src/test/ui/type/ascription/issue-47666.stderr index 648635f0c32..baffe4ea351 100644 --- a/src/test/ui/type/ascription/issue-47666.stderr +++ b/src/test/ui/type/ascription/issue-47666.stderr @@ -11,7 +11,7 @@ LL | let _ = Option:Some(vec![0, 1]); | = note: `#![feature(type_ascription)]` lets you annotate an expression with a type: `: ` = note: for more information, see https://github.com/rust-lang/rust/issues/23416 - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/type/type-check/cannot_infer_local_or_vec.stderr b/src/test/ui/type/type-check/cannot_infer_local_or_vec.stderr index 53cc769bae3..8162fed2cd8 100644 --- a/src/test/ui/type/type-check/cannot_infer_local_or_vec.stderr +++ b/src/test/ui/type/type-check/cannot_infer_local_or_vec.stderr @@ -6,7 +6,7 @@ LL | let x = vec![]; | | | consider giving `x` the explicit type `std::vec::Vec`, where the type parameter `T` is specified | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/type/type-check/cannot_infer_local_or_vec_in_tuples.stderr b/src/test/ui/type/type-check/cannot_infer_local_or_vec_in_tuples.stderr index df7228ce9f2..e62565c8f9b 100644 --- a/src/test/ui/type/type-check/cannot_infer_local_or_vec_in_tuples.stderr +++ b/src/test/ui/type/type-check/cannot_infer_local_or_vec_in_tuples.stderr @@ -6,7 +6,7 @@ LL | let (x, ) = (vec![], ); | | | consider giving this pattern the explicit type `(std::vec::Vec,)`, where the type parameter `T` is specified | - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/union/union-derive-clone.stderr b/src/test/ui/union/union-derive-clone.stderr index 0ef5753b590..12b5321331a 100644 --- a/src/test/ui/union/union-derive-clone.stderr +++ b/src/test/ui/union/union-derive-clone.stderr @@ -5,6 +5,7 @@ LL | #[derive(Clone)] | ^^^^^ the trait `std::marker::Copy` is not implemented for `U1` | = note: required by `std::clone::AssertParamIsCopy` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0599]: no method named `clone` found for union `U5` in the current scope --> $DIR/union-derive-clone.rs:37:15 diff --git a/src/test/ui/union/union-derive-eq.stderr b/src/test/ui/union/union-derive-eq.stderr index f63ab1704c4..0955c161871 100644 --- a/src/test/ui/union/union-derive-eq.stderr +++ b/src/test/ui/union/union-derive-eq.stderr @@ -5,6 +5,7 @@ LL | a: PartialEqNotEq, | ^^^^^^^^^^^^^^^^^ the trait `std::cmp::Eq` is not implemented for `PartialEqNotEq` | = note: required by `std::cmp::AssertParamIsEq` + = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/unreachable-code-ret.stderr b/src/test/ui/unreachable-code-ret.stderr index 3b93ef97f32..72abb4fc8db 100644 --- a/src/test/ui/unreachable-code-ret.stderr +++ b/src/test/ui/unreachable-code-ret.stderr @@ -11,7 +11,7 @@ note: the lint level is defined here | LL | #![deny(unreachable_code)] | ^^^^^^^^^^^^^^^^ - = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/unused/unused-macro-rules.stderr b/src/test/ui/unused/unused-macro-rules.stderr index 9bb3c3f3dec..532d9339781 100644 --- a/src/test/ui/unused/unused-macro-rules.stderr +++ b/src/test/ui/unused/unused-macro-rules.stderr @@ -22,6 +22,8 @@ LL | | } ... LL | create_macro!(); | ---------------- in this macro invocation + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error: unused macro definition --> $DIR/unused-macro-rules.rs:24:5 diff --git a/src/test/ui/while-let.stderr b/src/test/ui/while-let.stderr index 09f0d641de0..b2f2ec97c14 100644 --- a/src/test/ui/while-let.stderr +++ b/src/test/ui/while-let.stderr @@ -10,6 +10,7 @@ LL | | }); | |_______- in this macro invocation | = note: `#[warn(irrefutable_let_patterns)]` on by default + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) warning: irrefutable while-let pattern --> $DIR/while-let.rs:7:13 @@ -21,6 +22,8 @@ LL | / bar!(_a, 1, { LL | | println!("irrefutable pattern"); LL | | }); | |_______- in this macro invocation + | + = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) warning: irrefutable while-let pattern --> $DIR/while-let.rs:27:5 diff --git a/src/tools/rustbook/Cargo.toml b/src/tools/rustbook/Cargo.toml index 327de29037c..e6e758dccdf 100644 --- a/src/tools/rustbook/Cargo.toml +++ b/src/tools/rustbook/Cargo.toml @@ -6,13 +6,14 @@ license = "MIT OR Apache-2.0" edition = "2018" [features] -linkcheck = ["mdbook-linkcheck", "codespan-reporting"] +linkcheck = ["mdbook-linkcheck", "codespan-reporting", "codespan"] [dependencies] clap = "2.25.0" failure = "0.1" mdbook-linkcheck = { version = "0.5.0", optional = true } # Keep in sync with mdbook-linkcheck. +codespan = { version = "0.5", optional = true } codespan-reporting = { version = "0.5", optional = true } diff --git a/src/tools/rustbook/src/main.rs b/src/tools/rustbook/src/main.rs index fc283156693..023f5aa1e28 100644 --- a/src/tools/rustbook/src/main.rs +++ b/src/tools/rustbook/src/main.rs @@ -8,11 +8,6 @@ use clap::{App, AppSettings, ArgMatches, SubCommand}; use mdbook::errors::Result as Result3; use mdbook::MDBook; -#[cfg(feature = "linkcheck")] -use failure::Error; -#[cfg(feature = "linkcheck")] -use mdbook::renderer::RenderContext; - fn main() { let d_message = "-d, --dest-dir=[dest-dir] 'The output directory for your book{n}(Defaults to ./book when omitted)'"; @@ -53,8 +48,18 @@ fn main() { ("linkcheck", Some(sub_matches)) => { #[cfg(feature = "linkcheck")] { - if let Err(err) = linkcheck(sub_matches) { - eprintln!("Error: {}", err); + let (diags, files) = linkcheck(sub_matches).expect("Error while linkchecking."); + if !diags.is_empty() { + let color = codespan_reporting::term::termcolor::ColorChoice::Auto; + let mut writer = + codespan_reporting::term::termcolor::StandardStream::stderr(color); + let cfg = codespan_reporting::term::Config::default(); + + for diag in diags { + codespan_reporting::term::emit(&mut writer, &cfg, &files, &diag) + .expect("Unable to emit linkcheck error."); + } + std::process::exit(101); } } @@ -73,14 +78,55 @@ fn main() { } #[cfg(feature = "linkcheck")] -pub fn linkcheck(args: &ArgMatches<'_>) -> Result<(), Error> { +pub fn linkcheck( + args: &ArgMatches<'_>, +) -> Result<(Vec, codespan::Files), failure::Error> { + use mdbook_linkcheck::Reason; + let book_dir = get_book_dir(args); + let src_dir = book_dir.join("src"); let book = MDBook::load(&book_dir).unwrap(); - let cfg = book.config; - let render_ctx = RenderContext::new(&book_dir, book.book, cfg, &book_dir); - let cache_file = render_ctx.destination.join("cache.json"); - let color = codespan_reporting::term::termcolor::ColorChoice::Auto; - mdbook_linkcheck::run(&cache_file, color, &render_ctx) + let linkck_cfg = mdbook_linkcheck::get_config(&book.config)?; + let mut files = codespan::Files::new(); + let target_files = mdbook_linkcheck::load_files_into_memory(&book.book, &mut files); + let cache = mdbook_linkcheck::Cache::default(); + + let (links, incomplete) = mdbook_linkcheck::extract_links(target_files, &files); + + let outcome = + mdbook_linkcheck::validate(&links, &linkck_cfg, &src_dir, &cache, &files, incomplete)?; + + let mut is_real_error = false; + + for link in outcome.invalid_links.iter() { + match &link.reason { + Reason::FileNotFound | Reason::TraversesParentDirectories => { + is_real_error = true; + } + Reason::UnsuccessfulServerResponse(status) => { + if status.is_client_error() { + is_real_error = true; + } else { + eprintln!("Unsuccessful server response for link `{}`", link.link.uri); + } + } + Reason::Client(err) => { + if err.is_timeout() { + eprintln!("Timeout for link `{}`", link.link.uri); + } else if err.is_server_error() { + eprintln!("Server error for link `{}`", link.link.uri); + } else { + is_real_error = true; + } + } + } + } + + if is_real_error { + Ok((outcome.generate_diagnostics(&files, linkck_cfg.warning_policy), files)) + } else { + Ok((vec![], files)) + } } // Build command implementation