Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions compiler/rustc_errors/src/emitter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -474,9 +474,12 @@ pub trait Emitter {
.chain(span.span_labels().iter().map(|sp_label| sp_label.span))
.filter_map(|sp| {
if !sp.is_dummy() && source_map.is_imported(sp) {
let maybe_callsite = sp.source_callsite();
if sp != maybe_callsite {
return Some((sp, maybe_callsite));
let mut span = sp;
while let Some(callsite) = span.parent_callsite() {
span = callsite;
if !source_map.is_imported(span) {
return Some((sp, span));
}
}
}
None
Expand Down
2 changes: 1 addition & 1 deletion src/tools/miri/tests/fail/panic/tls_macro_drop_panic.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//@error-in-other-file: aborted execution
// Backtraces vary wildly between platforms, we have to normalize away almost the entire thing
//@normalize-stderr-test: "'main'|'<unnamed>'" -> "$$NAME"
//@normalize-stderr-test: ".*(note|-->|\|).*\n" -> ""
//@normalize-stderr-test: ".*(note|-->|:::|\|).*\n" -> ""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this need normalization? Does the output differ between targets?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like it: f3b52fd

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see, I misread the regex. Makes sense, thanks.


pub struct NoisyDrop {}

Expand Down
3 changes: 3 additions & 0 deletions tests/ui-fulldeps/rustc-dev-remap.only-remap.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ help: the following other types implement trait `VisitorResult`
= note: `ControlFlow<T>`
note: required by a bound in `rustc_ast::visit::Visitor::Result`
--> /rustc-dev/xyz/compiler/rustc_ast/src/visit.rs:LL:COL
::: /rustc-dev/xyz/compiler/rustc_ast/src/visit.rs:LL:COL
|
= note: in this macro invocation
= note: this error originates in the macro `common_visitor_and_walkers` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 1 previous error
Expand Down
5 changes: 4 additions & 1 deletion tests/ui-fulldeps/rustc-dev-remap.remap-unremap.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ LL | impl<T> VisitorResult for ControlFlow<T> {
note: required by a bound in `rustc_ast::visit::Visitor::Result`
--> $COMPILER_DIR_REAL/rustc_ast/src/visit.rs:LL:COL
|
LL | type Result: VisitorResult = ();
| ^^^^^^^^^^^^^ required by this bound in `Visitor::Result`
...
LL | common_visitor_and_walkers!(Visitor<'a>);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Visitor::Result`
| ---------------------------------------- in this macro invocation
= note: this error originates in the macro `common_visitor_and_walkers` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 1 previous error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ LL | struct NotIntoDiagArg;
= help: normalized in stderr
note: required by a bound in `Diag::<'a, G>::arg`
--> $COMPILER_DIR/rustc_errors/src/diagnostic.rs:LL:CC
::: $COMPILER_DIR/rustc_errors/src/diagnostic.rs:LL:CC
|
= note: in this macro invocation
= note: this error originates in the macro `with_fn` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `NotIntoDiagArg: IntoDiagArg` is not satisfied
Expand All @@ -34,6 +37,9 @@ LL | struct NotIntoDiagArg;
= help: normalized in stderr
note: required by a bound in `Diag::<'a, G>::arg`
--> $COMPILER_DIR/rustc_errors/src/diagnostic.rs:LL:CC
::: $COMPILER_DIR/rustc_errors/src/diagnostic.rs:LL:CC
|
= note: in this macro invocation
= note: this error originates in the macro `with_fn` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 2 previous errors
Expand Down
3 changes: 3 additions & 0 deletions tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,9 @@ LL | struct Hello {}
= help: normalized in stderr
note: required by a bound in `Diag::<'a, G>::arg`
--> $COMPILER_DIR/rustc_errors/src/diagnostic.rs:LL:CC
::: $COMPILER_DIR/rustc_errors/src/diagnostic.rs:LL:CC
|
= note: in this macro invocation
= note: this error originates in the macro `with_fn` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 85 previous errors
Expand Down
12 changes: 9 additions & 3 deletions tests/ui/binop/binary-op-suggest-deref.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -305,13 +305,19 @@ LL | let _ = FOO & (*"Sized".to_string().into_boxed_str());
help: the following other types implement trait `BitAnd<Rhs>`
--> $SRC_DIR/core/src/ops/bit.rs:LL:COL
|
= note: `&i32` implements `BitAnd<i32>`
= note: `i32` implements `BitAnd`
::: $SRC_DIR/core/src/ops/bit.rs:LL:COL
|
= note: `&i32` implements `BitAnd`
= note: in this macro invocation
--> $SRC_DIR/core/src/internal_macros.rs:LL:COL
|
= note: `&i32` implements `BitAnd<i32>`
::: $SRC_DIR/core/src/internal_macros.rs:LL:COL
|
= note: `i32` implements `BitAnd<&i32>`
::: $SRC_DIR/core/src/internal_macros.rs:LL:COL
|
= note: `i32` implements `BitAnd`
= note: `&i32` implements `BitAnd`
= note: this error originates in the macro `bitand_impl` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the size for values of type `str` cannot be known at compilation time
Expand Down
12 changes: 9 additions & 3 deletions tests/ui/binop/binop-mul-i32-f32.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,19 @@ LL | x * y
help: the following other types implement trait `Mul<Rhs>`
--> $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
= note: `&i32` implements `Mul<i32>`
= note: `i32` implements `Mul`
::: $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
= note: `&i32` implements `Mul`
= note: in this macro invocation
--> $SRC_DIR/core/src/internal_macros.rs:LL:COL
|
= note: `&i32` implements `Mul<i32>`
::: $SRC_DIR/core/src/internal_macros.rs:LL:COL
|
= note: `i32` implements `Mul<&i32>`
::: $SRC_DIR/core/src/internal_macros.rs:LL:COL
|
= note: `i32` implements `Mul`
= note: `&i32` implements `Mul`
= note: this error originates in the macro `mul_impl` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 1 previous error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ LL | check(&mut () as *mut ());
|
help: the trait `ConstParamTy_` is implemented for `()`
--> $SRC_DIR/core/src/marker.rs:LL:COL
::: $SRC_DIR/core/src/marker.rs:LL:COL
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what's going on here.

The span is external, why is it reported? Because we cannot find its local parent call site?
Why is it reported twice now?

A number of tests show improvements similar to the macro-span-caller-replacement.rs case, but more tests show changes like this, which don't seem right.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is caused by a bug/difference in how AnnotateSnippetEmitter handles annotations from files whose source is unavailable ("unannotated messages"). I have some changes locally that will hopefully address this issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The span is external, why is it reported? Because we cannot find its local parent call site?
Why is it reported twice now?

I think it is because it is now considered local from the point of view of the current module being shown, not from the span in the main subdiagnostic. There are now two spans because there's one pointing inside the macro and one pointing at the macro call. (You can see this when running these tests in an environment that has the std files available for rendering.)

I have some changes locally that will hopefully address this issue.

Are you also looking at making the ordering consistent? I don't think we used to do that. I also noticed that when we have multiple primary spans within different macros, we only point at a single macro call. I'm assuming that MultiSpan never accounted for its component Spans having different contexts. I wouldn't worry too much about that for now, but it's good that this change surfaced that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you also looking at making the ordering consistent? I don't think we used to do that.

I'm not sure what ordering you are referring to here, but I can look into it if you give me a couple of examples.

I also noticed that when we have multiple primary spans within different macros, we only point at a single macro call. I'm assuming that MultiSpan never accounted for its component Spans having different contexts. I wouldn't worry too much about that for now, but it's good that this change surfaced that.

Could you also provide a couple of examples of this?

Copy link
Contributor Author

@estebank estebank Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For context, this is what it looks like in a sane std environment:

error[E0277]: `*mut ()` can't be used as a const parameter type
    --> tests/ui/const-generics/adt_const_params/const_param_ty_bad.rs:11:11
     |
  11 |     check(&mut () as *mut ()); //~ error: `*mut ()` can't be used as a const parameter type
     |     ----- ^^^^^^^^^^^^^^^^^^ the trait `ConstParamTy_` is not implemented for `*mut ()`
     |     |
     |     required by a bound introduced by this call
     |
help: the trait `ConstParamTy_` is implemented for `()`
    --> /home/gh-estebank/workspace/rust/library/core/src/marker.rs:60:26
     |
  60 |           $(#[$($meta)*])* impl< $($($bounds)*)? > $Trait for $T {}
     |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
1098 | / marker_impls! {
1099 | |     #[unstable(feature = "adt_const_params", issue = "95174")]
1100 | |     ConstParamTy_ for
1101 | |         usize, u8, u16, u32, u64, u128,
...    |
1106 | |         {T: ConstParamTy_, const N: usize} [T; N],
1107 | | }
     | |_- in this macro invocation
note: required by a bound in `check`
    --> tests/ui/const-generics/adt_const_params/const_param_ty_bad.rs:4:18
     |
   4 | fn check(_: impl std::marker::ConstParamTy_) {}
     |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check`
     = note: this error originates in the macro `marker_impls` (in Nightly builds, run with -Z macro-backtrace for more info)

And this is what it currently looks like:

error[E0277]: `*mut ()` can't be used as a const parameter type
    --> tests/ui/const-generics/adt_const_params/const_param_ty_bad.rs:11:11
     |
  11 |     check(&mut () as *mut ()); //~ error: `*mut ()` can't be used as a const parameter type
     |     ----- ^^^^^^^^^^^^^^^^^^ the trait `ConstParamTy_` is not implemented for `*mut ()`
     |     |
     |     required by a bound introduced by this call
     |
help: the trait `ConstParamTy_` is implemented for `()`
    --> /home/gh-estebank/.rustup/toolchains/nightly-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:1098:1
     |
1098 | / marker_impls! {
1099 | |     #[unstable(feature = "adt_const_params", issue = "95174")]
1100 | |     ConstParamTy_ for
1101 | |         usize, u8, u16, u32, u64, u128,
...    |
1106 | |         {T: ConstParamTy_, const N: usize} [T; N],
1107 | | }
     | |_^
note: required by a bound in `check`
    --> tests/ui/const-generics/adt_const_params/const_param_ty_bad.rs:4:18
     |
   4 | fn check(_: impl std::marker::ConstParamTy_) {}
     |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check`
     = note: this error originates in the macro `marker_impls` (in Nightly builds, run with -Z macro-backtrace for more info)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example does look convincing, it's unfortunate that our tests suite is not representative here.
But it would be similarly annoying to update tests outputs on miscellaneous changes to the standard library, so it seems similar to LL:COL line number anonymization.

|
= note: in this macro invocation
note: required by a bound in `check`
--> $DIR/const_param_ty_bad.rs:4:18
|
Expand All @@ -101,6 +104,9 @@ LL | check(&() as *const ());
|
help: the trait `ConstParamTy_` is implemented for `()`
--> $SRC_DIR/core/src/marker.rs:LL:COL
::: $SRC_DIR/core/src/marker.rs:LL:COL
|
= note: in this macro invocation
note: required by a bound in `check`
--> $DIR/const_param_ty_bad.rs:4:18
|
Expand Down
12 changes: 9 additions & 3 deletions tests/ui/consts/const-eval/const-eval-overflow-3b.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,19 @@ LL | = [0; (i8::MAX + 1u8) as usize];
help: the following other types implement trait `Add<Rhs>`
--> $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
= note: `&i8` implements `Add<i8>`
= note: `i8` implements `Add`
::: $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
= note: `&i8` implements `Add`
= note: in this macro invocation
--> $SRC_DIR/core/src/internal_macros.rs:LL:COL
|
= note: `&i8` implements `Add<i8>`
::: $SRC_DIR/core/src/internal_macros.rs:LL:COL
|
= note: `i8` implements `Add<&i8>`
::: $SRC_DIR/core/src/internal_macros.rs:LL:COL
|
= note: `i8` implements `Add`
= note: `&i8` implements `Add`
= note: this error originates in the macro `add_impl` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 2 previous errors
Expand Down
12 changes: 9 additions & 3 deletions tests/ui/consts/const-eval/const-eval-overflow-4b.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,19 @@ LL | : [u32; (i8::MAX as i8 + 1u8) as usize]
help: the following other types implement trait `Add<Rhs>`
--> $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
= note: `&i8` implements `Add<i8>`
= note: `i8` implements `Add`
::: $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
= note: `&i8` implements `Add`
= note: in this macro invocation
--> $SRC_DIR/core/src/internal_macros.rs:LL:COL
|
= note: `&i8` implements `Add<i8>`
::: $SRC_DIR/core/src/internal_macros.rs:LL:COL
|
= note: `i8` implements `Add<&i8>`
::: $SRC_DIR/core/src/internal_macros.rs:LL:COL
|
= note: `i8` implements `Add`
= note: `&i8` implements `Add`
= note: this error originates in the macro `add_impl` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0604]: only `u8` can be cast as `char`, not `i8`
Expand Down
7 changes: 5 additions & 2 deletions tests/ui/consts/const-eval/issue-85155.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ LL | let _ = 1 / ((IMM >= MIN && IMM <= MAX) as usize);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `post_monomorphization_error::ValidateConstImm::<2, 0, 1>::VALID` failed here

note: erroneous constant encountered
--> $DIR/auxiliary/post_monomorphization_error.rs:19:5
--> $DIR/auxiliary/post_monomorphization_error.rs:13:17
|
LL | let _ = $crate::ValidateConstImm::<$imm, 0, { (1 << 1) - 1 }>::VALID;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
LL | static_assert_imm1!(IMM1);
| ^^^^^^^^^^^^^^^^^^^^^^^^^
| ------------------------- in this macro invocation
|
= note: this note originates in the macro `static_assert_imm1` (in Nightly builds, run with -Z macro-backtrace for more info)

Expand Down
12 changes: 12 additions & 0 deletions tests/ui/consts/const-eval/parse_ints.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@ LL | const _TOO_LOW: () = { u64::from_str_radix("12345ABCD", 1); };
|
note: inside `core::num::<impl u64>::from_str_radix`
--> $SRC_DIR/core/src/num/mod.rs:LL:COL
::: $SRC_DIR/core/src/num/mod.rs:LL:COL
|
= note: in this macro invocation
note: inside `core::num::<impl u64>::from_ascii_radix`
--> $SRC_DIR/core/src/num/mod.rs:LL:COL
::: $SRC_DIR/core/src/num/mod.rs:LL:COL
|
= note: in this macro invocation
= note: this error originates in the macro `from_str_int_impl` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0080]: evaluation panicked: from_ascii_radix: radix must lie in the range `[2, 36]`
Expand All @@ -18,8 +24,14 @@ LL | const _TOO_HIGH: () = { u64::from_str_radix("12345ABCD", 37); };
|
note: inside `core::num::<impl u64>::from_str_radix`
--> $SRC_DIR/core/src/num/mod.rs:LL:COL
::: $SRC_DIR/core/src/num/mod.rs:LL:COL
|
= note: in this macro invocation
note: inside `core::num::<impl u64>::from_ascii_radix`
--> $SRC_DIR/core/src/num/mod.rs:LL:COL
::: $SRC_DIR/core/src/num/mod.rs:LL:COL
|
= note: in this macro invocation
= note: this error originates in the macro `from_str_int_impl` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 2 previous errors
Expand Down
7 changes: 7 additions & 0 deletions tests/ui/consts/const-ptr-is-null.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,16 @@ LL | assert!(!ptr.wrapping_sub(512).is_null());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `MAYBE_NULL` failed inside this call
|
note: inside `std::ptr::const_ptr::<impl *const i32>::is_null`
--> $SRC_DIR/core/src/intrinsics/mod.rs:LL:COL
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
::: $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
= note: in this macro invocation
note: inside `std::ptr::const_ptr::<impl *const T>::is_null::compiletime`
--> $SRC_DIR/core/src/panic.rs:LL:COL
--> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
= note: in this macro invocation

error: aborting due to 1 previous error

Expand Down
4 changes: 4 additions & 0 deletions tests/ui/consts/const_transmute_type_id2.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ LL | assert!(a == b);
| ^^^^^^ evaluation of `_` failed inside this call
|
note: inside `<TypeId as PartialEq>::eq`
--> $SRC_DIR/core/src/intrinsics/mod.rs:LL:COL
--> $SRC_DIR/core/src/any.rs:LL:COL
::: $SRC_DIR/core/src/any.rs:LL:COL
|
= note: in this macro invocation
note: inside `<TypeId as PartialEq>::eq::compiletime`
--> $SRC_DIR/core/src/any.rs:LL:COL
= note: this error originates in the macro `$crate::intrinsics::const_eval_select` which comes from the expansion of the macro `crate::intrinsics::const_eval_select` (in Nightly builds, run with -Z macro-backtrace for more info)
Expand Down
4 changes: 4 additions & 0 deletions tests/ui/consts/const_transmute_type_id3.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ LL | assert!(a == b);
| ^^^^^^ evaluation of `_` failed inside this call
|
note: inside `<TypeId as PartialEq>::eq`
--> $SRC_DIR/core/src/intrinsics/mod.rs:LL:COL
--> $SRC_DIR/core/src/any.rs:LL:COL
::: $SRC_DIR/core/src/any.rs:LL:COL
|
= note: in this macro invocation
note: inside `<TypeId as PartialEq>::eq::compiletime`
--> $SRC_DIR/core/src/any.rs:LL:COL
= note: this error originates in the macro `$crate::intrinsics::const_eval_select` which comes from the expansion of the macro `crate::intrinsics::const_eval_select` (in Nightly builds, run with -Z macro-backtrace for more info)
Expand Down
4 changes: 4 additions & 0 deletions tests/ui/consts/const_transmute_type_id4.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ LL | assert!(a == b);
| ^^^^^^ evaluation of `_` failed inside this call
|
note: inside `<TypeId as PartialEq>::eq`
--> $SRC_DIR/core/src/intrinsics/mod.rs:LL:COL
--> $SRC_DIR/core/src/any.rs:LL:COL
::: $SRC_DIR/core/src/any.rs:LL:COL
|
= note: in this macro invocation
note: inside `<TypeId as PartialEq>::eq::compiletime`
--> $SRC_DIR/core/src/any.rs:LL:COL
= note: this error originates in the macro `$crate::intrinsics::const_eval_select` which comes from the expansion of the macro `crate::intrinsics::const_eval_select` (in Nightly builds, run with -Z macro-backtrace for more info)
Expand Down
4 changes: 4 additions & 0 deletions tests/ui/consts/const_transmute_type_id5.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ LL | assert!(b == b);
| ^^^^^^ evaluation of `_` failed inside this call
|
note: inside `<TypeId as PartialEq>::eq`
--> $SRC_DIR/core/src/intrinsics/mod.rs:LL:COL
--> $SRC_DIR/core/src/any.rs:LL:COL
::: $SRC_DIR/core/src/any.rs:LL:COL
|
= note: in this macro invocation
note: inside `<TypeId as PartialEq>::eq::compiletime`
--> $SRC_DIR/core/src/any.rs:LL:COL
= note: this error originates in the macro `$crate::intrinsics::const_eval_select` which comes from the expansion of the macro `crate::intrinsics::const_eval_select` (in Nightly builds, run with -Z macro-backtrace for more info)
Expand Down
4 changes: 4 additions & 0 deletions tests/ui/consts/const_transmute_type_id6.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ LL | id == id
| ^^^^^^^^ evaluation of `X` failed inside this call
|
note: inside `<TypeId as PartialEq>::eq`
--> $SRC_DIR/core/src/intrinsics/mod.rs:LL:COL
--> $SRC_DIR/core/src/any.rs:LL:COL
::: $SRC_DIR/core/src/any.rs:LL:COL
|
= note: in this macro invocation
note: inside `<TypeId as PartialEq>::eq::compiletime`
--> $SRC_DIR/core/src/any.rs:LL:COL
= note: this error originates in the macro `$crate::intrinsics::const_eval_select` which comes from the expansion of the macro `crate::intrinsics::const_eval_select` (in Nightly builds, run with -Z macro-backtrace for more info)
Expand Down
5 changes: 5 additions & 0 deletions tests/ui/consts/timeout.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
error: constant evaluation is taking a long time
--> $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
|
--> $SRC_DIR/core/src/num/mod.rs:LL:COL
::: $SRC_DIR/core/src/num/mod.rs:LL:COL
|
= note: in this macro invocation
|
= note: this lint makes sure the compiler doesn't get stuck due to infinite loops in const eval.
If your compilation actually takes a long time, you can safely allow the lint.
Expand Down
6 changes: 3 additions & 3 deletions tests/ui/hygiene/cross-crate-name-hiding-2.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ error[E0422]: cannot find struct, variant or union type `MyStruct` in this scope
LL | let x = MyStruct {};
| ^^^^^^^^ not found in this scope
|
::: $DIR/auxiliary/use_by_macro.rs:15:1
::: $DIR/auxiliary/use_by_macro.rs:7:24
|
LL | x!(my_struct);
| ------------- you might have meant to refer to this struct
LL | pub struct MyStruct;
| -------- you might have meant to refer to this struct

error: aborting due to 1 previous error

Expand Down
12 changes: 9 additions & 3 deletions tests/ui/impl-trait/equality.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,19 @@ LL | n + sum_to(n - 1)
help: the following other types implement trait `Add<Rhs>`
--> $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
= note: `&u32` implements `Add<u32>`
= note: `u32` implements `Add`
::: $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
= note: `&u32` implements `Add`
= note: in this macro invocation
--> $SRC_DIR/core/src/internal_macros.rs:LL:COL
|
= note: `&u32` implements `Add<u32>`
::: $SRC_DIR/core/src/internal_macros.rs:LL:COL
|
= note: `u32` implements `Add<&u32>`
::: $SRC_DIR/core/src/internal_macros.rs:LL:COL
|
= note: `u32` implements `Add`
= note: `&u32` implements `Add`
= note: this error originates in the macro `add_impl` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 2 previous errors; 1 warning emitted
Expand Down
14 changes: 10 additions & 4 deletions tests/ui/imports/ambiguous-glob-vs-expanded-extern.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ LL | glob_vs_expanded::mac!();
= note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
= note: ambiguous because of a conflict between a name from a glob import and a macro-expanded name in the same module during import or macro resolution
note: `mac` could refer to the macro defined here
--> $DIR/auxiliary/glob-vs-expanded.rs:11:1
--> $DIR/auxiliary/glob-vs-expanded.rs:9:13
|
LL | () => { pub macro mac() {} }
| ^^^^^^^^^^^^^
LL | }
LL | define_mac!();
| ^^^^^^^^^^^^^
| ------------- in this macro invocation
note: `mac` could also refer to the macro defined here
--> $DIR/auxiliary/glob-vs-expanded.rs:5:9
|
Expand All @@ -33,10 +36,13 @@ LL | glob_vs_expanded::mac!();
= note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
= note: ambiguous because of a conflict between a name from a glob import and a macro-expanded name in the same module during import or macro resolution
note: `mac` could refer to the macro defined here
--> $DIR/auxiliary/glob-vs-expanded.rs:11:1
--> $DIR/auxiliary/glob-vs-expanded.rs:9:13
|
LL | () => { pub macro mac() {} }
| ^^^^^^^^^^^^^
LL | }
LL | define_mac!();
| ^^^^^^^^^^^^^
| ------------- in this macro invocation
note: `mac` could also refer to the macro defined here
--> $DIR/auxiliary/glob-vs-expanded.rs:5:9
|
Expand Down
Loading
Loading