rustc_macros: don't limit the -Zmacro-backtrace suggestion to extern macros.

This commit is contained in:
Eduard-Mihai Burtescu 2019-12-16 15:56:47 +02:00
parent ab080973cb
commit 4c7eb59e81
280 changed files with 888 additions and 119 deletions

View file

@ -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

View file

@ -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 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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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 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

View file

@ -8,6 +8,8 @@ LL | struct Foo(Bar);
|
LL | fn hash<H: Hasher>(&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

View file

@ -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 macro-backtrace for more info)
error: aborting due to previous error

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -9,6 +9,8 @@ LL | fn wrap<T>(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

View file

@ -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

View file

@ -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

View file

@ -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 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

View file

@ -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

View file

@ -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

View file

@ -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 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

View file

@ -5,6 +5,7 @@ LL | #[derive(Debug, Copy, Clone)]
| ^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`
|
= note: required because of the requirements on the impl of `IntoNullable` for `<Col as Expression>::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

View file

@ -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

View file

@ -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

View file

@ -8,6 +8,7 @@ LL | impl<T: Clone + ?Sized> 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

View file

@ -29,6 +29,8 @@ LL | struct Foo(NotDefined, <i32 as Iterator>::Item, Vec<i32>, 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

View file

@ -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

View file

@ -6,6 +6,8 @@ LL | S::f::<i64>();
...
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::<i64>();
...
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

View file

@ -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

View file

@ -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 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 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 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

View file

@ -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

View file

@ -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

View file

@ -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