diff options
Diffstat (limited to 'src/test')
70 files changed, 710 insertions, 400 deletions
diff --git a/src/test/codegen-units/polymorphization/pr-75255.rs b/src/test/codegen-units/polymorphization/pr-75255.rs deleted file mode 100644 index af47b440640..00000000000 --- a/src/test/codegen-units/polymorphization/pr-75255.rs +++ /dev/null @@ -1,52 +0,0 @@ -// compile-flags:-Zpolymorphize=on -Zprint-mono-items=lazy -Copt-level=1 -// ignore-tidy-linelength - -#![crate_type = "rlib"] - -// Test that only one copy of `Iter::map` and `iter::repeat` are generated. - -fn unused<T>() -> u64 { - 42 -} - -fn foo<T>() { - let x = [1, 2, 3, std::mem::size_of::<T>()]; - x.iter().map(|_| ()); -} - -//~ MONO_ITEM fn core::iter[0]::adapters[0]::{{impl}}[29]::new[0]<core::slice[0]::Iter[0]<usize>, pr_75255::foo[0]::{{closure}}[0]<T>> @@ pr_75255-cgu.0[External] -//~ MONO_ITEM fn core::iter[0]::traits[0]::iterator[0]::Iterator[0]::map[0]<core::slice[0]::Iter[0]<usize>, (), pr_75255::foo[0]::{{closure}}[0]<T>> @@ pr_75255-cgu.1[Internal] - -fn bar<T>() { - std::iter::repeat(unused::<T>); -} - -//~ MONO_ITEM fn core::iter[0]::sources[0]::repeat[0]<fn() -> u64> @@ pr_75255-cgu.1[Internal] - -pub fn dispatch() { - foo::<String>(); - foo::<Vec<String>>(); - - bar::<String>(); - bar::<Vec<String>>(); -} - -// These are all the items that aren't relevant to the test. -//~ MONO_ITEM fn core::mem[0]::size_of[0]<alloc::string[0]::String[0]> @@ pr_75255-cgu.1[Internal] -//~ MONO_ITEM fn core::mem[0]::size_of[0]<alloc::vec[0]::Vec[0]<alloc::string[0]::String[0]>> @@ pr_75255-cgu.1[Internal] -//~ MONO_ITEM fn core::mem[0]::size_of[0]<usize> @@ pr_75255-cgu.1[Internal] -//~ MONO_ITEM fn core::ptr[0]::const_ptr[0]::{{impl}}[0]::add[0]<usize> @@ pr_75255-cgu.1[Internal] -//~ MONO_ITEM fn core::ptr[0]::const_ptr[0]::{{impl}}[0]::is_null[0]<usize> @@ pr_75255-cgu.1[Internal] -//~ MONO_ITEM fn core::ptr[0]::const_ptr[0]::{{impl}}[0]::offset[0]<usize> @@ pr_75255-cgu.1[Internal] -//~ MONO_ITEM fn core::ptr[0]::const_ptr[0]::{{impl}}[0]::wrapping_add[0]<u8> @@ pr_75255-cgu.1[Internal] -//~ MONO_ITEM fn core::ptr[0]::const_ptr[0]::{{impl}}[0]::wrapping_offset[0]<u8> @@ pr_75255-cgu.1[Internal] -//~ MONO_ITEM fn core::ptr[0]::non_null[0]::{{impl}}[3]::new_unchecked[0]<usize> @@ pr_75255-cgu.1[Internal] -//~ MONO_ITEM fn core::ptr[0]::null[0]<u8> @@ pr_75255-cgu.1[Internal] -//~ MONO_ITEM fn core::slice[0]::{{impl}}[0]::as_ptr[0]<usize> @@ pr_75255-cgu.1[Internal] -//~ MONO_ITEM fn core::slice[0]::{{impl}}[0]::iter[0]<usize> @@ pr_75255-cgu.1[Internal] -//~ MONO_ITEM fn core::slice[0]::{{impl}}[0]::len[0]<usize> @@ pr_75255-cgu.1[Internal] -//~ MONO_ITEM fn pr_75255::dispatch[0] @@ pr_75255-cgu.1[External] -//~ MONO_ITEM fn pr_75255::foo[0]<alloc::string[0]::String[0]> @@ pr_75255-cgu.1[Internal] -//~ MONO_ITEM fn pr_75255::foo[0]<alloc::vec[0]::Vec[0]<alloc::string[0]::String[0]>> @@ pr_75255-cgu.1[Internal] -//~ MONO_ITEM fn pr_75255::bar[0]<alloc::string[0]::String[0]> @@ pr_75255-cgu.1[Internal] -//~ MONO_ITEM fn pr_75255::bar[0]<alloc::vec[0]::Vec[0]<alloc::string[0]::String[0]>> @@ pr_75255-cgu.1[Internal] diff --git a/src/test/mir-opt/const_allocation2.main.ConstProp.after.mir.32bit b/src/test/mir-opt/const_allocation2.main.ConstProp.after.mir.32bit index d386d247829..71d55dbb96e 100644 --- a/src/test/mir-opt/const_allocation2.main.ConstProp.after.mir.32bit +++ b/src/test/mir-opt/const_allocation2.main.ConstProp.after.mir.32bit @@ -30,41 +30,41 @@ fn main() -> () { } alloc0 (static: FOO, size: 8, align: 4) { - ╾─alloc21─╼ 03 00 00 00 │ ╾──╼.... + ╾─alloc23─╼ 03 00 00 00 │ ╾──╼.... } -alloc21 (size: 48, align: 4) { - 0x00 │ 00 00 00 00 __ __ __ __ ╾─alloc4──╼ 00 00 00 00 │ ....░░░░╾──╼.... - 0x10 │ 00 00 00 00 __ __ __ __ ╾─alloc9──╼ 02 00 00 00 │ ....░░░░╾──╼.... - 0x20 │ 01 00 00 00 2a 00 00 00 ╾─alloc19─╼ 03 00 00 00 │ ....*...╾──╼.... +alloc23 (size: 48, align: 4) { + 0x00 │ 00 00 00 00 __ __ __ __ ╾─alloc8──╼ 00 00 00 00 │ ....░░░░╾──╼.... + 0x10 │ 00 00 00 00 __ __ __ __ ╾─alloc13─╼ 02 00 00 00 │ ....░░░░╾──╼.... + 0x20 │ 01 00 00 00 2a 00 00 00 ╾─alloc21─╼ 03 00 00 00 │ ....*...╾──╼.... } -alloc4 (size: 0, align: 4) {} +alloc8 (size: 0, align: 4) {} -alloc9 (size: 8, align: 4) { - ╾─alloc7──╼ ╾─alloc8──╼ │ ╾──╼╾──╼ +alloc13 (size: 8, align: 4) { + ╾─alloc11─╼ ╾─alloc12─╼ │ ╾──╼╾──╼ } -alloc7 (size: 1, align: 1) { +alloc11 (size: 1, align: 1) { 05 │ . } -alloc8 (size: 1, align: 1) { +alloc12 (size: 1, align: 1) { 06 │ . } -alloc19 (size: 12, align: 4) { - ╾─a15+0x3─╼ ╾─alloc16─╼ ╾─a18+0x2─╼ │ ╾──╼╾──╼╾──╼ +alloc21 (size: 12, align: 4) { + ╾─a17+0x3─╼ ╾─alloc18─╼ ╾─a20+0x2─╼ │ ╾──╼╾──╼╾──╼ } -alloc15 (size: 4, align: 1) { +alloc17 (size: 4, align: 1) { 2a 45 15 6f │ *E.o } -alloc16 (size: 1, align: 1) { +alloc18 (size: 1, align: 1) { 2a │ * } -alloc18 (size: 4, align: 1) { +alloc20 (size: 4, align: 1) { 2a 45 15 6f │ *E.o } diff --git a/src/test/mir-opt/const_allocation2.main.ConstProp.after.mir.64bit b/src/test/mir-opt/const_allocation2.main.ConstProp.after.mir.64bit index d7acd0f0f43..79bad7ea926 100644 --- a/src/test/mir-opt/const_allocation2.main.ConstProp.after.mir.64bit +++ b/src/test/mir-opt/const_allocation2.main.ConstProp.after.mir.64bit @@ -30,44 +30,44 @@ fn main() -> () { } alloc0 (static: FOO, size: 16, align: 8) { - ╾───────alloc21───────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........ + ╾───────alloc23───────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........ } -alloc21 (size: 72, align: 8) { - 0x00 │ 00 00 00 00 __ __ __ __ ╾───────alloc4────────╼ │ ....░░░░╾──────╼ +alloc23 (size: 72, align: 8) { + 0x00 │ 00 00 00 00 __ __ __ __ ╾───────alloc8────────╼ │ ....░░░░╾──────╼ 0x10 │ 00 00 00 00 00 00 00 00 00 00 00 00 __ __ __ __ │ ............░░░░ - 0x20 │ ╾───────alloc9────────╼ 02 00 00 00 00 00 00 00 │ ╾──────╼........ - 0x30 │ 01 00 00 00 2a 00 00 00 ╾───────alloc19───────╼ │ ....*...╾──────╼ + 0x20 │ ╾───────alloc13───────╼ 02 00 00 00 00 00 00 00 │ ╾──────╼........ + 0x30 │ 01 00 00 00 2a 00 00 00 ╾───────alloc21───────╼ │ ....*...╾──────╼ 0x40 │ 03 00 00 00 00 00 00 00 │ ........ } -alloc4 (size: 0, align: 8) {} +alloc8 (size: 0, align: 8) {} -alloc9 (size: 16, align: 8) { - ╾───────alloc7────────╼ ╾───────alloc8────────╼ │ ╾──────╼╾──────╼ +alloc13 (size: 16, align: 8) { + ╾───────alloc11───────╼ ╾───────alloc12───────╼ │ ╾──────╼╾──────╼ } -alloc7 (size: 1, align: 1) { +alloc11 (size: 1, align: 1) { 05 │ . } -alloc8 (size: 1, align: 1) { +alloc12 (size: 1, align: 1) { 06 │ . } -alloc19 (size: 24, align: 8) { - 0x00 │ ╾─────alloc15+0x3─────╼ ╾───────alloc16───────╼ │ ╾──────╼╾──────╼ - 0x10 │ ╾─────alloc18+0x2─────╼ │ ╾──────╼ +alloc21 (size: 24, align: 8) { + 0x00 │ ╾─────alloc17+0x3─────╼ ╾───────alloc18───────╼ │ ╾──────╼╾──────╼ + 0x10 │ ╾─────alloc20+0x2─────╼ │ ╾──────╼ } -alloc15 (size: 4, align: 1) { +alloc17 (size: 4, align: 1) { 2a 45 15 6f │ *E.o } -alloc16 (size: 1, align: 1) { +alloc18 (size: 1, align: 1) { 2a │ * } -alloc18 (size: 4, align: 1) { +alloc20 (size: 4, align: 1) { 2a 45 15 6f │ *E.o } diff --git a/src/test/rustdoc-ui/error-in-impl-trait/async.rs b/src/test/rustdoc-ui/error-in-impl-trait/async.rs index 112a2c494a5..cda53bff07a 100644 --- a/src/test/rustdoc-ui/error-in-impl-trait/async.rs +++ b/src/test/rustdoc-ui/error-in-impl-trait/async.rs @@ -1,10 +1,7 @@ // edition:2018 +// check-pass -/// This used to work with ResolveBodyWithLoop. -/// However now that we ignore type checking instead of modifying the function body, -/// the return type is seen as `impl Future<Output = u32>`, not a `u32`. -/// So it no longer allows errors in the function body. +/// Should compile fine pub async fn a() -> u32 { error::_in::async_fn() - //~^ ERROR failed to resolve } diff --git a/src/test/rustdoc-ui/error-in-impl-trait/async.stderr b/src/test/rustdoc-ui/error-in-impl-trait/async.stderr deleted file mode 100644 index 086db1be722..00000000000 --- a/src/test/rustdoc-ui/error-in-impl-trait/async.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0433]: failed to resolve: could not resolve path `error::_in::async_fn` - --> $DIR/async.rs:8:5 - | -LL | error::_in::async_fn() - | ^^^^^^^^^^^^^^^^^^^^ could not resolve path `error::_in::async_fn` - | - = note: this error was originally ignored because you are running `rustdoc` - = note: try running again with `rustc` or `cargo check` and you may get a more detailed error - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0433`. diff --git a/src/test/rustdoc-ui/error-in-impl-trait/closure.rs b/src/test/rustdoc-ui/error-in-impl-trait/closure.rs index df40c121d57..f1fd85bb23c 100644 --- a/src/test/rustdoc-ui/error-in-impl-trait/closure.rs +++ b/src/test/rustdoc-ui/error-in-impl-trait/closure.rs @@ -1,5 +1,5 @@ +// check-pass // manually desugared version of an `async fn` (but with a closure instead of a generator) pub fn a() -> impl Fn() -> u32 { || content::doesnt::matter() - //~^ ERROR failed to resolve } diff --git a/src/test/rustdoc-ui/error-in-impl-trait/closure.stderr b/src/test/rustdoc-ui/error-in-impl-trait/closure.stderr deleted file mode 100644 index 4ee9c4d1f43..00000000000 --- a/src/test/rustdoc-ui/error-in-impl-trait/closure.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0433]: failed to resolve: could not resolve path `content::doesnt::matter` - --> $DIR/closure.rs:3:8 - | -LL | || content::doesnt::matter() - | ^^^^^^^^^^^^^^^^^^^^^^^ could not resolve path `content::doesnt::matter` - | - = note: this error was originally ignored because you are running `rustdoc` - = note: try running again with `rustc` or `cargo check` and you may get a more detailed error - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0433`. diff --git a/src/test/rustdoc-ui/error-in-impl-trait/generic-argument.rs b/src/test/rustdoc-ui/error-in-impl-trait/generic-argument.rs index 0ccf2e3866f..dcec379d47e 100644 --- a/src/test/rustdoc-ui/error-in-impl-trait/generic-argument.rs +++ b/src/test/rustdoc-ui/error-in-impl-trait/generic-argument.rs @@ -1,7 +1,7 @@ +// check-pass trait ValidTrait {} /// This has docs pub fn f() -> impl ValidTrait { Vec::<DoesNotExist>::new() - //~^ ERROR failed to resolve } diff --git a/src/test/rustdoc-ui/error-in-impl-trait/generic-argument.stderr b/src/test/rustdoc-ui/error-in-impl-trait/generic-argument.stderr deleted file mode 100644 index 72716c258dc..00000000000 --- a/src/test/rustdoc-ui/error-in-impl-trait/generic-argument.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0433]: failed to resolve: could not resolve path `DoesNotExist` - --> $DIR/generic-argument.rs:5:11 - | -LL | Vec::<DoesNotExist>::new() - | ^^^^^^^^^^^^ could not resolve path `DoesNotExist` - | - = note: this error was originally ignored because you are running `rustdoc` - = note: try running again with `rustc` or `cargo check` and you may get a more detailed error - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0433`. diff --git a/src/test/rustdoc-ui/error-in-impl-trait/impl-keyword-closure.rs b/src/test/rustdoc-ui/error-in-impl-trait/impl-keyword-closure.rs index 399fb827517..b935b0832f0 100644 --- a/src/test/rustdoc-ui/error-in-impl-trait/impl-keyword-closure.rs +++ b/src/test/rustdoc-ui/error-in-impl-trait/impl-keyword-closure.rs @@ -1,6 +1,6 @@ +// check-pass pub trait ValidTrait {} /// This returns impl trait pub fn g() -> impl ValidTrait { (|| error::_in::impl_trait::alias::nested::closure())() - //~^ ERROR failed to resolve } diff --git a/src/test/rustdoc-ui/error-in-impl-trait/impl-keyword-closure.stderr b/src/test/rustdoc-ui/error-in-impl-trait/impl-keyword-closure.stderr deleted file mode 100644 index 55f9b609a11..00000000000 --- a/src/test/rustdoc-ui/error-in-impl-trait/impl-keyword-closure.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0433]: failed to resolve: could not resolve path `error::_in::impl_trait::alias::nested::closure` - --> $DIR/impl-keyword-closure.rs:4:9 - | -LL | (|| error::_in::impl_trait::alias::nested::closure())() - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ could not resolve path `error::_in::impl_trait::alias::nested::closure` - | - = note: this error was originally ignored because you are running `rustdoc` - = note: try running again with `rustc` or `cargo check` and you may get a more detailed error - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0433`. diff --git a/src/test/rustdoc-ui/error-in-impl-trait/impl-keyword.rs b/src/test/rustdoc-ui/error-in-impl-trait/impl-keyword.rs index 24b5734dbd0..701126f87a1 100644 --- a/src/test/rustdoc-ui/error-in-impl-trait/impl-keyword.rs +++ b/src/test/rustdoc-ui/error-in-impl-trait/impl-keyword.rs @@ -1,6 +1,6 @@ +// check-pass pub trait ValidTrait {} /// This returns impl trait pub fn g() -> impl ValidTrait { error::_in::impl_trait() - //~^ ERROR failed to resolve } diff --git a/src/test/rustdoc-ui/error-in-impl-trait/impl-keyword.stderr b/src/test/rustdoc-ui/error-in-impl-trait/impl-keyword.stderr deleted file mode 100644 index 3257079f942..00000000000 --- a/src/test/rustdoc-ui/error-in-impl-trait/impl-keyword.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0433]: failed to resolve: could not resolve path `error::_in::impl_trait` - --> $DIR/impl-keyword.rs:4:5 - | -LL | error::_in::impl_trait() - | ^^^^^^^^^^^^^^^^^^^^^^ could not resolve path `error::_in::impl_trait` - | - = note: this error was originally ignored because you are running `rustdoc` - = note: try running again with `rustc` or `cargo check` and you may get a more detailed error - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0433`. diff --git a/src/test/rustdoc-ui/error-in-impl-trait/realistic-async.rs b/src/test/rustdoc-ui/error-in-impl-trait/realistic-async.rs new file mode 100644 index 00000000000..248575d3528 --- /dev/null +++ b/src/test/rustdoc-ui/error-in-impl-trait/realistic-async.rs @@ -0,0 +1,28 @@ +// edition:2018 +// check-pass + +mod windows { + pub trait WinFoo { + fn foo(&self) {} + } + + impl WinFoo for () {} +} + +#[cfg(any(windows, doc))] +use windows::*; + +mod unix { + pub trait UnixFoo { + fn foo(&self) {} + } + + impl UnixFoo for () {} +} + +#[cfg(any(unix, doc))] +use unix::*; + +async fn bar() { + ().foo() +} diff --git a/src/test/rustdoc-ui/error-in-impl-trait/trait-alias-closure.rs b/src/test/rustdoc-ui/error-in-impl-trait/trait-alias-closure.rs index 1498fa4f890..31dd786cbbf 100644 --- a/src/test/rustdoc-ui/error-in-impl-trait/trait-alias-closure.rs +++ b/src/test/rustdoc-ui/error-in-impl-trait/trait-alias-closure.rs @@ -1,3 +1,4 @@ +// check-pass #![feature(type_alias_impl_trait)] pub trait ValidTrait {} @@ -6,5 +7,4 @@ type ImplTrait = impl ValidTrait; /// This returns impl trait, but using a type alias pub fn h() -> ImplTrait { (|| error::_in::impl_trait::alias::nested::closure())() - //~^ ERROR failed to resolve } diff --git a/src/test/rustdoc-ui/error-in-impl-trait/trait-alias-closure.stderr b/src/test/rustdoc-ui/error-in-impl-trait/trait-alias-closure.stderr deleted file mode 100644 index 84b28139dbc..00000000000 --- a/src/test/rustdoc-ui/error-in-impl-trait/trait-alias-closure.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0433]: failed to resolve: could not resolve path `error::_in::impl_trait::alias::nested::closure` - --> $DIR/trait-alias-closure.rs:8:9 - | -LL | (|| error::_in::impl_trait::alias::nested::closure())() - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ could not resolve path `error::_in::impl_trait::alias::nested::closure` - | - = note: this error was originally ignored because you are running `rustdoc` - = note: try running again with `rustc` or `cargo check` and you may get a more detailed error - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0433`. diff --git a/src/test/rustdoc-ui/error-in-impl-trait/trait-alias.rs b/src/test/rustdoc-ui/error-in-impl-trait/trait-alias.rs index cf9bc48c7f8..c18a024af4b 100644 --- a/src/test/rustdoc-ui/error-in-impl-trait/trait-alias.rs +++ b/src/test/rustdoc-ui/error-in-impl-trait/trait-alias.rs @@ -1,3 +1,4 @@ +// check-pass #![feature(type_alias_impl_trait)] pub trait ValidTrait {} @@ -6,5 +7,4 @@ type ImplTrait = impl ValidTrait; /// This returns impl trait, but using a type alias pub fn h() -> ImplTrait { error::_in::impl_trait::alias() - //~^ ERROR failed to resolve } diff --git a/src/test/rustdoc-ui/error-in-impl-trait/trait-alias.stderr b/src/test/rustdoc-ui/error-in-impl-trait/trait-alias.stderr deleted file mode 100644 index 9be6a3d8d6b..00000000000 --- a/src/test/rustdoc-ui/error-in-impl-trait/trait-alias.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0433]: failed to resolve: could not resolve path `error::_in::impl_trait::alias` - --> $DIR/trait-alias.rs:8:5 - | -LL | error::_in::impl_trait::alias() - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ could not resolve path `error::_in::impl_trait::alias` - | - = note: this error was originally ignored because you are running `rustdoc` - = note: try running again with `rustc` or `cargo check` and you may get a more detailed error - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0433`. diff --git a/src/test/rustdoc-ui/infinite-recursive-type-impl-trait-return.rs b/src/test/rustdoc-ui/infinite-recursive-type-impl-trait-return.rs new file mode 100644 index 00000000000..acce0f77a25 --- /dev/null +++ b/src/test/rustdoc-ui/infinite-recursive-type-impl-trait-return.rs @@ -0,0 +1,15 @@ +// normalize-stderr-test: "`.*`" -> "`DEF_ID`" +// normalize-stdout-test: "`.*`" -> "`DEF_ID`" +// edition:2018 + +pub async fn f() -> impl std::fmt::Debug { + #[derive(Debug)] + enum E { + //~^ ERROR recursive type `f::{{closure}}#0::E` has infinite size + This(E), + Unit, + } + E::Unit +} + +fn main() {} diff --git a/src/test/rustdoc-ui/infinite-recursive-type-impl-trait-return.stderr b/src/test/rustdoc-ui/infinite-recursive-type-impl-trait-return.stderr new file mode 100644 index 00000000000..991dc6eec1d --- /dev/null +++ b/src/test/rustdoc-ui/infinite-recursive-type-impl-trait-return.stderr @@ -0,0 +1,17 @@ +error[E0072]: recursive type `DEF_ID` has infinite size + --> $DIR/infinite-recursive-type-impl-trait-return.rs:7:5 + | +LL | enum E { + | ^^^^^^ recursive type has infinite size +LL | +LL | This(E), + | - recursive without indirection + | +help: insert some indirection (e.g., a `DEF_ID` representable + | +LL | This(Box<E>), + | ^^^^ ^ + +error: aborting due to previous error + +For more information about this error, try `DEF_ID`. diff --git a/src/test/rustdoc-ui/infinite-recursive-type-impl-trait.rs b/src/test/rustdoc-ui/infinite-recursive-type-impl-trait.rs new file mode 100644 index 00000000000..b3a7ee56313 --- /dev/null +++ b/src/test/rustdoc-ui/infinite-recursive-type-impl-trait.rs @@ -0,0 +1,7 @@ +fn f() -> impl Sized { + enum E { + //~^ ERROR recursive type `f::E` has infinite size + V(E), + } + unimplemented!() +} diff --git a/src/test/rustdoc-ui/infinite-recursive-type-impl-trait.stderr b/src/test/rustdoc-ui/infinite-recursive-type-impl-trait.stderr new file mode 100644 index 00000000000..ec1bb786fe5 --- /dev/null +++ b/src/test/rustdoc-ui/infinite-recursive-type-impl-trait.stderr @@ -0,0 +1,17 @@ +error[E0072]: recursive type `f::E` has infinite size + --> $DIR/infinite-recursive-type-impl-trait.rs:2:5 + | +LL | enum E { + | ^^^^^^ recursive type has infinite size +LL | +LL | V(E), + | - recursive without indirection + | +help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `f::E` representable + | +LL | V(Box<E>), + | ^^^^ ^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0072`. diff --git a/src/test/rustdoc/const-display.rs b/src/test/rustdoc/const-display.rs index 8e0d230f7d0..c5016c650e5 100644 --- a/src/test/rustdoc/const-display.rs +++ b/src/test/rustdoc/const-display.rs @@ -32,3 +32,12 @@ pub const unsafe fn bar2_gated() -> u32 { 42 } // @has 'foo/fn.bar_not_gated.html' '//pre' 'pub unsafe fn bar_not_gated() -> u32' pub const unsafe fn bar_not_gated() -> u32 { 42 } + +pub struct Foo; + +impl Foo { + // @has 'foo/struct.Foo.html' '//h4[@id="method.gated"]/code' 'pub unsafe fn gated() -> u32' + #[stable(feature = "rust1", since = "1.0.0")] + #[rustc_const_unstable(feature="foo", issue = "none")] + pub const unsafe fn gated() -> u32 { 42 } +} diff --git a/src/test/rustdoc/intra-link-prim-precedence.rs b/src/test/rustdoc/intra-link-prim-precedence.rs index 5f10c1ec4a7..15ea1232fd6 100644 --- a/src/test/rustdoc/intra-link-prim-precedence.rs +++ b/src/test/rustdoc/intra-link-prim-precedence.rs @@ -8,5 +8,10 @@ pub mod char {} pub struct MyString; /// See also [char] -// @has intra_link_prim_precedence/struct.MyString2.html '//a/@href' 'intra_link_prim_precedence/char/index.html' +// @has intra_link_prim_precedence/struct.MyString2.html '//a/@href' 'https://doc.rust-lang.org/nightly/std/primitive.char.html' pub struct MyString2; + +/// See also [crate::char] and [mod@char] +// @has intra_link_prim_precedence/struct.MyString3.html '//*[@href="../intra_link_prim_precedence/char/index.html"]' 'crate::char' +// @has - '//*[@href="../intra_link_prim_precedence/char/index.html"]' 'mod@char' +pub struct MyString3; diff --git a/src/test/ui/const-generics/argument_order.rs b/src/test/ui/const-generics/argument_order.rs index 1d1adf39434..9e071e674e7 100644 --- a/src/test/ui/const-generics/argument_order.rs +++ b/src/test/ui/const-generics/argument_order.rs @@ -1,14 +1,13 @@ #![feature(const_generics)] -//~^ WARN the feature `const_generics` is incomplete +#![allow(incomplete_features)] -struct Bad<const N: usize, T> { //~ ERROR type parameters must be declared prior +struct Bad<const N: usize, T> { arr: [u8; { N }], another: T, } struct AlsoBad<const N: usize, 'a, T, 'b, const M: usize, U> { - //~^ ERROR type parameters must be declared prior - //~| ERROR lifetime parameters must be declared prior + //~^ ERROR lifetime parameters must be declared prior a: &'a T, b: &'b U, } diff --git a/src/test/ui/const-generics/argument_order.stderr b/src/test/ui/const-generics/argument_order.stderr index 19e895b8eb8..d6546a768d2 100644 --- a/src/test/ui/const-generics/argument_order.stderr +++ b/src/test/ui/const-generics/argument_order.stderr @@ -1,39 +1,18 @@ -error: type parameters must be declared prior to const parameters - --> $DIR/argument_order.rs:4:28 - | -LL | struct Bad<const N: usize, T> { - | -----------------^- help: reorder the parameters: lifetimes, then types, then consts: `<T, const N: usize>` - error: lifetime parameters must be declared prior to const parameters --> $DIR/argument_order.rs:9:32 | LL | struct AlsoBad<const N: usize, 'a, T, 'b, const M: usize, U> { - | -----------------^^-----^^-------------------- help: reorder the parameters: lifetimes, then types, then consts: `<'a, 'b, T, U, const N: usize, const M: usize>` - -error: type parameters must be declared prior to const parameters - --> $DIR/argument_order.rs:9:36 - | -LL | struct AlsoBad<const N: usize, 'a, T, 'b, const M: usize, U> { - | ---------------------^----------------------^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, 'b, T, U, const N: usize, const M: usize>` - -warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/argument_order.rs:1:12 - | -LL | #![feature(const_generics)] - | ^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information + | -----------------^^-----^^-------------------- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b, const N: usize, T, const M: usize, U>` error[E0747]: lifetime provided when a type was expected - --> $DIR/argument_order.rs:17:23 + --> $DIR/argument_order.rs:16:23 | LL | let _: AlsoBad<7, 'static, u32, 'static, 17, u16>; | ^^^^^^^ | = note: lifetime arguments must be provided before type arguments - = help: reorder the arguments: lifetimes, then types, then consts: `<'a, 'b, T, U, N, M>` + = help: reorder the arguments: lifetimes, then consts: `<'a, 'b, N, T, M, U>` -error: aborting due to 4 previous errors; 1 warning emitted +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0747`. diff --git a/src/test/ui/const-generics/const-arg-type-arg-misordered.rs b/src/test/ui/const-generics/const-arg-type-arg-misordered.rs index 9f989ee20a5..13ca56ad3e6 100644 --- a/src/test/ui/const-generics/const-arg-type-arg-misordered.rs +++ b/src/test/ui/const-generics/const-arg-type-arg-misordered.rs @@ -1,5 +1,5 @@ #![feature(const_generics)] -//~^ WARN the feature `const_generics` is incomplete +#![allow(incomplete_features)] type Array<T, const N: usize> = [T; N]; diff --git a/src/test/ui/const-generics/const-arg-type-arg-misordered.stderr b/src/test/ui/const-generics/const-arg-type-arg-misordered.stderr index 4a6241de1b4..2e2bfed51fb 100644 --- a/src/test/ui/const-generics/const-arg-type-arg-misordered.stderr +++ b/src/test/ui/const-generics/const-arg-type-arg-misordered.stderr @@ -1,21 +1,9 @@ -warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/const-arg-type-arg-misordered.rs:1:12 - | -LL | #![feature(const_generics)] - | ^^^^^^^^^^^^^^ - | - = note: `#[warn(incomplete_features)]` on by default - = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information - error[E0747]: constant provided when a type was expected --> $DIR/const-arg-type-arg-misordered.rs:6:35 | LL | fn foo<const N: usize>() -> Array<N, ()> { | ^ - | - = note: type arguments must be provided before constant arguments - = help: reorder the arguments: types, then consts: `<T, N>` -error: aborting due to previous error; 1 warning emitted +error: aborting due to previous error For more information about this error, try `rustc --explain E0747`. diff --git a/src/test/ui/const-generics/const-param-before-other-params.rs b/src/test/ui/const-generics/const-param-before-other-params.rs index 756e961ce91..0d787d9a67b 100644 --- a/src/test/ui/const-generics/const-param-before-other-params.rs +++ b/src/test/ui/const-generics/const-param-before-other-params.rs @@ -5,8 +5,6 @@ fn bar<const X: (), 'a>(_: &'a ()) { //~^ ERROR lifetime parameters must be declared prior to const parameters } -fn foo<const X: (), T>(_: &T) { - //~^ ERROR type parameters must be declared prior to const parameters -} +fn foo<const X: (), T>(_: &T) {} fn main() {} diff --git a/src/test/ui/const-generics/const-param-before-other-params.stderr b/src/test/ui/const-generics/const-param-before-other-params.stderr index 9b18b8c79ed..1194dd30f61 100644 --- a/src/test/ui/const-generics/const-param-before-other-params.stderr +++ b/src/test/ui/const-generics/const-param-before-other-params.stderr @@ -2,13 +2,7 @@ error: lifetime parameters must be declared prior to const parameters --> $DIR/const-param-before-other-params.rs:4:21 | LL | fn bar<const X: (), 'a>(_: &'a ()) { - | --------------^^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, const X: ()>` + | --------------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, const X: ()>` -error: type parameters must be declared prior to const parameters - --> $DIR/const-param-before-other-params.rs:8:21 - | -LL | fn foo<const X: (), T>(_: &T) { - | --------------^- help: reorder the parameters: lifetimes, then types, then consts: `<T, const X: ()>` - -error: aborting due to 2 previous errors +error: aborting due to previous error diff --git a/src/test/ui/const-generics/defaults/complex-unord-param.rs b/src/test/ui/const-generics/defaults/complex-unord-param.rs new file mode 100644 index 00000000000..72967640a8e --- /dev/null +++ b/src/test/ui/const-generics/defaults/complex-unord-param.rs @@ -0,0 +1,20 @@ +// run-pass +// Checks a complicated usage of unordered params + +#![feature(const_generics)] +#![allow(incomplete_features)] +#![allow(dead_code)] + +struct NestedArrays<'a, const N: usize, A: 'a, const M: usize, T:'a =u32> { + args: &'a [&'a [T; M]; N], + specifier: A, +} + +fn main() { + let array = [1, 2, 3]; + let nest = [&array]; + let _ = NestedArrays { + args: &nest, + specifier: true, + }; +} diff --git a/src/test/ui/const-generics/defaults/intermixed-lifetime.rs b/src/test/ui/const-generics/defaults/intermixed-lifetime.rs new file mode 100644 index 00000000000..ea3a8c14b98 --- /dev/null +++ b/src/test/ui/const-generics/defaults/intermixed-lifetime.rs @@ -0,0 +1,12 @@ +// Checks that lifetimes cannot be interspersed between consts and types. + +#![feature(const_generics)] +#![allow(incomplete_features)] + +struct Foo<const N: usize, 'a, T = u32>(&'a (), T); +//~^ Error lifetime parameters must be declared prior to const parameters + +struct Bar<const N: usize, T = u32, 'a>(&'a (), T); +//~^ Error lifetime parameters must be declared prior to type parameters + +fn main() {} diff --git a/src/test/ui/const-generics/defaults/intermixed-lifetime.stderr b/src/test/ui/const-generics/defaults/intermixed-lifetime.stderr new file mode 100644 index 00000000000..0f6d7f1065a --- /dev/null +++ b/src/test/ui/const-generics/defaults/intermixed-lifetime.stderr @@ -0,0 +1,14 @@ +error: lifetime parameters must be declared prior to const parameters + --> $DIR/intermixed-lifetime.rs:6:28 + | +LL | struct Foo<const N: usize, 'a, T = u32>(&'a (), T); + | -----------------^^---------- help: reorder the parameters: lifetimes, then consts and types: `<'a, const N: usize, T>` + +error: lifetime parameters must be declared prior to type parameters + --> $DIR/intermixed-lifetime.rs:9:37 + | +LL | struct Bar<const N: usize, T = u32, 'a>(&'a (), T); + | --------------------------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, const N: usize, T>` + +error: aborting due to 2 previous errors + diff --git a/src/test/ui/const-generics/defaults/needs-feature.min.stderr b/src/test/ui/const-generics/defaults/needs-feature.min.stderr new file mode 100644 index 00000000000..d57190ea3bb --- /dev/null +++ b/src/test/ui/const-generics/defaults/needs-feature.min.stderr @@ -0,0 +1,8 @@ +error: type parameters must be declared prior to const parameters + --> $DIR/needs-feature.rs:10:26 + | +LL | struct A<const N: usize, T=u32>(T); + | -----------------^----- help: reorder the parameters: lifetimes, then consts, then types: `<T, const N: usize>` + +error: aborting due to previous error + diff --git a/src/test/ui/const-generics/defaults/needs-feature.none.stderr b/src/test/ui/const-generics/defaults/needs-feature.none.stderr new file mode 100644 index 00000000000..3b6f63a8efe --- /dev/null +++ b/src/test/ui/const-generics/defaults/needs-feature.none.stderr @@ -0,0 +1,18 @@ +error: type parameters must be declared prior to const parameters + --> $DIR/needs-feature.rs:10:26 + | +LL | struct A<const N: usize, T=u32>(T); + | -----------------^----- help: reorder the parameters: lifetimes, then types: `<T, const N: usize>` + +error[E0658]: const generics are unstable + --> $DIR/needs-feature.rs:10:16 + | +LL | struct A<const N: usize, T=u32>(T); + | ^ + | + = note: see issue #74878 <https://github.com/rust-lang/rust/issues/74878> for more information + = help: add `#![feature(min_const_generics)]` to the crate attributes to enable + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/const-generics/defaults/needs-feature.rs b/src/test/ui/const-generics/defaults/needs-feature.rs new file mode 100644 index 00000000000..ec02dbf407d --- /dev/null +++ b/src/test/ui/const-generics/defaults/needs-feature.rs @@ -0,0 +1,17 @@ +//[full] run-pass +// Verifies that having generic parameters after constants is not permitted without the +// `const_generics` feature. +// revisions: none min full + +#![cfg_attr(full, feature(const_generics))] +#![cfg_attr(full, allow(incomplete_features))] +#![cfg_attr(min, feature(min_const_generics))] + +struct A<const N: usize, T=u32>(T); +//[none]~^ ERROR type parameters must be declared prior +//[none]~| ERROR const generics are unstable +//[min]~^^^ ERROR type parameters must be declared prior + +fn main() { + let _: A<3> = A(0); +} diff --git a/src/test/ui/const-generics/defaults/simple-defaults.rs b/src/test/ui/const-generics/defaults/simple-defaults.rs new file mode 100644 index 00000000000..b282dfd37cc --- /dev/null +++ b/src/test/ui/const-generics/defaults/simple-defaults.rs @@ -0,0 +1,15 @@ +// run-pass +// Checks some basic test cases for defaults. +#![feature(const_generics)] +#![allow(incomplete_features)] +#![allow(dead_code)] + +struct FixedOutput<'a, const N: usize, T=u32> { + out: &'a [T; N], +} + +trait FixedOutputter { + fn out(&self) -> FixedOutput<'_, 10>; +} + +fn main() {} diff --git a/src/test/ui/const-generics/type-after-const-ok.rs b/src/test/ui/const-generics/type-after-const-ok.rs new file mode 100644 index 00000000000..fc977d6617c --- /dev/null +++ b/src/test/ui/const-generics/type-after-const-ok.rs @@ -0,0 +1,10 @@ +// run-pass +// Verifies that having generic parameters after constants is permitted + +#![feature(const_generics)] +#![allow(incomplete_features)] + +#[allow(dead_code)] +struct A<const N: usize, T>(T); + +fn main() {} diff --git a/src/test/ui/consts/const-eval/erroneous-const.rs b/src/test/ui/consts/const-eval/erroneous-const.rs new file mode 100644 index 00000000000..93c4e9372e8 --- /dev/null +++ b/src/test/ui/consts/const-eval/erroneous-const.rs @@ -0,0 +1,20 @@ +//! Make sure we error on erroneous consts even if they are unused. +#![warn(const_err, unconditional_panic)] + +struct PrintName<T>(T); +impl<T> PrintName<T> { + const VOID: () = [()][2]; //~WARN any use of this value will cause an error + //~^ WARN this operation will panic at runtime +} + +const fn no_codegen<T>() { + if false { //~ERROR evaluation of constant value failed + let _ = PrintName::<T>::VOID; + } +} + +pub static FOO: () = no_codegen::<i32>(); //~ERROR could not evaluate static initializer + +fn main() { + FOO +} diff --git a/src/test/ui/consts/const-eval/erroneous-const.stderr b/src/test/ui/consts/const-eval/erroneous-const.stderr new file mode 100644 index 00000000000..da7e7247d50 --- /dev/null +++ b/src/test/ui/consts/const-eval/erroneous-const.stderr @@ -0,0 +1,43 @@ +warning: this operation will panic at runtime + --> $DIR/erroneous-const.rs:6:22 + | +LL | const VOID: () = [()][2]; + | ^^^^^^^ index out of bounds: the len is 1 but the index is 2 + | +note: the lint level is defined here + --> $DIR/erroneous-const.rs:2:20 + | +LL | #![warn(const_err, unconditional_panic)] + | ^^^^^^^^^^^^^^^^^^^ + +warning: any use of this value will cause an error + --> $DIR/erroneous-const.rs:6:22 + | +LL | const VOID: () = [()][2]; + | -----------------^^^^^^^- + | | + | index out of bounds: the len is 1 but the index is 2 + | +note: the lint level is defined here + --> $DIR/erroneous-const.rs:2:9 + | +LL | #![warn(const_err, unconditional_panic)] + | ^^^^^^^^^ + +error[E0080]: evaluation of constant value failed + --> $DIR/erroneous-const.rs:11:5 + | +LL | / if false { +LL | | let _ = PrintName::<T>::VOID; +LL | | } + | |_____^ referenced constant has errors + +error[E0080]: could not evaluate static initializer + --> $DIR/erroneous-const.rs:16:22 + | +LL | pub static FOO: () = no_codegen::<i32>(); + | ^^^^^^^^^^^^^^^^^^^ referenced constant has errors + +error: aborting due to 2 previous errors; 2 warnings emitted + +For more information about this error, try `rustc --explain E0080`. diff --git a/src/test/ui/issues/issue-40782.fixed b/src/test/ui/issues/issue-40782.fixed index d61c248c6ec..305a9c3292a 100644 --- a/src/test/ui/issues/issue-40782.fixed +++ b/src/test/ui/issues/issue-40782.fixed @@ -3,4 +3,6 @@ fn main() { for _i in 0..2 { //~ ERROR missing `in` } + for _i in 0..2 { //~ ERROR missing `in` + } } diff --git a/src/test/ui/issues/issue-40782.rs b/src/test/ui/issues/issue-40782.rs index 3688c69fbc6..43460ec1535 100644 --- a/src/test/ui/issues/issue-40782.rs +++ b/src/test/ui/issues/issue-40782.rs @@ -3,4 +3,6 @@ fn main() { for _i 0..2 { //~ ERROR missing `in` } + for _i of 0..2 { //~ ERROR missing `in` + } } diff --git a/src/test/ui/issues/issue-40782.stderr b/src/test/ui/issues/issue-40782.stderr index 9d7776f32b3..81f419bf687 100644 --- a/src/test/ui/issues/issue-40782.stderr +++ b/src/test/ui/issues/issue-40782.stderr @@ -4,5 +4,11 @@ error: missing `in` in `for` loop LL | for _i 0..2 { | ^ help: try adding `in` here -error: aborting due to previous error +error: missing `in` in `for` loop + --> $DIR/issue-40782.rs:6:12 + | +LL | for _i of 0..2 { + | ^^ help: try using `in` here instead + +error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-59508-1.stderr b/src/test/ui/issues/issue-59508-1.stderr index 85db20b13fb..5e97339f148 100644 --- a/src/test/ui/issues/issue-59508-1.stderr +++ b/src/test/ui/issues/issue-59508-1.stderr @@ -2,7 +2,7 @@ error: lifetime parameters must be declared prior to type parameters --> $DIR/issue-59508-1.rs:12:25 | LL | pub fn do_things<T, 'a, 'b: 'a>() { - | ----^^--^^----- help: reorder the parameters: lifetimes, then types, then consts: `<'a, 'b: 'a, T>` + | ----^^--^^----- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b: 'a, T>` warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes --> $DIR/issue-59508-1.rs:2:12 diff --git a/src/test/ui/issues/issue-75283.rs b/src/test/ui/issues/issue-75283.rs new file mode 100644 index 00000000000..d556132e47f --- /dev/null +++ b/src/test/ui/issues/issue-75283.rs @@ -0,0 +1,6 @@ +extern "C" { + fn lol() { //~ ERROR incorrect function inside `extern` block + println!(""); + } +} +fn main() {} diff --git a/src/test/ui/issues/issue-75283.stderr b/src/test/ui/issues/issue-75283.stderr new file mode 100644 index 00000000000..da3800affc0 --- /dev/null +++ b/src/test/ui/issues/issue-75283.stderr @@ -0,0 +1,18 @@ +error: incorrect function inside `extern` block + --> $DIR/issue-75283.rs:2:8 + | +LL | extern "C" { + | ---------- `extern` blocks define existing foreign functions and functions inside of them cannot have a body +LL | fn lol() { + | ________^^^___- + | | | + | | cannot have a body +LL | | println!(""); +LL | | } + | |_____- help: remove the invalid body: `;` + | + = help: you might have meant to write a function accessible through FFI, which can be done by writing `extern fn` outside of the `extern` block + = note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html + +error: aborting due to previous error + diff --git a/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-confusable-idents.rs b/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-confusable-idents.rs index e15ed2e70b8..2c711f99404 100644 --- a/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-confusable-idents.rs +++ b/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-confusable-idents.rs @@ -3,9 +3,11 @@ #![allow(uncommon_codepoints, non_upper_case_globals)] const s: usize = 42; +const s_s: usize = 42; fn main() { let s = "rust"; //~ ERROR identifier pair considered confusable + let s_s = "rust2"; //~ ERROR identifier pair considered confusable not_affected(); } diff --git a/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-confusable-idents.stderr b/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-confusable-idents.stderr index 218f94f7b58..b9af60963ad 100644 --- a/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-confusable-idents.stderr +++ b/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-confusable-idents.stderr @@ -1,5 +1,5 @@ error: identifier pair considered confusable between `s` and `s` - --> $DIR/lint-confusable-idents.rs:8:9 + --> $DIR/lint-confusable-idents.rs:9:9 | LL | const s: usize = 42; | -- this is where the previous identifier occurred @@ -13,5 +13,14 @@ note: the lint level is defined here LL | #![deny(confusable_idents)] | ^^^^^^^^^^^^^^^^^ -error: aborting due to previous error +error: identifier pair considered confusable between `s_s` and `s_s` + --> $DIR/lint-confusable-idents.rs:10:9 + | +LL | const s_s: usize = 42; + | --- this is where the previous identifier occurred +... +LL | let s_s = "rust2"; + | ^^^^^ + +error: aborting due to 2 previous errors diff --git a/src/test/ui/mismatched_types/issue-74918-missing-lifetime.rs b/src/test/ui/mismatched_types/issue-74918-missing-lifetime.rs new file mode 100644 index 00000000000..0e3ea4bc8c9 --- /dev/null +++ b/src/test/ui/mismatched_types/issue-74918-missing-lifetime.rs @@ -0,0 +1,28 @@ +// Regression test for issue #74918 +// Tests that we don't ICE after emitting an error + +struct ChunkingIterator<T, S: 'static + Iterator<Item = T>> { + source: S, +} + +impl<T, S: Iterator<Item = T>> Iterator for ChunkingIterator<T, S> { + type Item = IteratorChunk<T, S>; //~ ERROR missing lifetime + + fn next(&mut self) -> Option<IteratorChunk<T, S>> { //~ ERROR `impl` + todo!() + } +} + +struct IteratorChunk<'a, T, S: Iterator<Item = T>> { + source: &'a mut S, +} + +impl<T, S: Iterator<Item = T>> Iterator for IteratorChunk<'_, T, S> { + type Item = T; + + fn next(&mut self) -> Option<T> { + todo!() + } +} + +fn main() {} diff --git a/src/test/ui/mismatched_types/issue-74918-missing-lifetime.stderr b/src/test/ui/mismatched_types/issue-74918-missing-lifetime.stderr new file mode 100644 index 00000000000..da3056eac90 --- /dev/null +++ b/src/test/ui/mismatched_types/issue-74918-missing-lifetime.stderr @@ -0,0 +1,30 @@ +error[E0106]: missing lifetime specifier + --> $DIR/issue-74918-missing-lifetime.rs:9:31 + | +LL | type Item = IteratorChunk<T, S>; + | ^ expected named lifetime parameter + | +help: consider introducing a named lifetime parameter + | +LL | type Item<'a> = IteratorChunk<<'a>T, S>; + | ^^^^ ^^^^ + +error: `impl` item signature doesn't match `trait` item signature + --> $DIR/issue-74918-missing-lifetime.rs:11:5 + | +LL | fn next(&mut self) -> Option<IteratorChunk<T, S>> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found `fn(&mut ChunkingIterator<T, S>) -> std::option::Option<IteratorChunk<'_, T, S>>` + | + ::: $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL + | +LL | fn next(&mut self) -> Option<Self::Item>; + | ----------------------------------------- expected `fn(&mut ChunkingIterator<T, S>) -> std::option::Option<IteratorChunk<'static, _, _>>` + | + = note: expected `fn(&mut ChunkingIterator<T, S>) -> std::option::Option<IteratorChunk<'static, _, _>>` + found `fn(&mut ChunkingIterator<T, S>) -> std::option::Option<IteratorChunk<'_, _, _>>` + = help: the lifetime requirements from the `impl` do not correspond to the requirements in the `trait` + = help: verify the lifetime relationships in the `trait` and `impl` between the `self` argument, the other inputs and its output + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0106`. diff --git a/src/test/ui/mismatched_types/issue-75361-mismatched-impl.rs b/src/test/ui/mismatched_types/issue-75361-mismatched-impl.rs new file mode 100644 index 00000000000..4410514476d --- /dev/null +++ b/src/test/ui/mismatched_types/issue-75361-mismatched-impl.rs @@ -0,0 +1,24 @@ +// Regresison test for issue #75361 +// Tests that we don't ICE on mismatched types with inference variables + + +trait MyTrait { + type Item; +} + +pub trait Graph { + type EdgeType; + + fn adjacent_edges(&self) -> Box<dyn MyTrait<Item = &Self::EdgeType>>; +} + +impl<T> Graph for T { + type EdgeType = T; + + fn adjacent_edges(&self) -> Box<dyn MyTrait<Item = &Self::EdgeType> + '_> { //~ ERROR `impl` + panic!() + } + +} + +fn main() {} diff --git a/src/test/ui/mismatched_types/issue-75361-mismatched-impl.stderr b/src/test/ui/mismatched_types/issue-75361-mismatched-impl.stderr new file mode 100644 index 00000000000..5be7f5271de --- /dev/null +++ b/src/test/ui/mismatched_types/issue-75361-mismatched-impl.stderr @@ -0,0 +1,19 @@ +error: `impl` item signature doesn't match `trait` item signature + --> $DIR/issue-75361-mismatched-impl.rs:18:3 + | +LL | fn adjacent_edges(&self) -> Box<dyn MyTrait<Item = &Self::EdgeType>>; + | --------------------------------------------------------------------- expected `fn(&T) -> std::boxed::Box<(dyn MyTrait<Item = &_> + 'static)>` +... +LL | fn adjacent_edges(&self) -> Box<dyn MyTrait<Item = &Self::EdgeType> + '_> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found `fn(&T) -> std::boxed::Box<dyn MyTrait<Item = &_>>` + | + = note: expected `fn(&T) -> std::boxed::Box<(dyn MyTrait<Item = &T> + 'static)>` + found `fn(&T) -> std::boxed::Box<dyn MyTrait<Item = &T>>` +help: the lifetime requirements from the `impl` do not correspond to the requirements in the `trait` + --> $DIR/issue-75361-mismatched-impl.rs:12:55 + | +LL | fn adjacent_edges(&self) -> Box<dyn MyTrait<Item = &Self::EdgeType>>; + | ^^^^^^^^^^^^^^ consider borrowing this type parameter in the trait + +error: aborting due to previous error + diff --git a/src/test/ui/proc-macro/doc-comment-preserved.rs b/src/test/ui/proc-macro/doc-comment-preserved.rs index c2724ae1806..ed8ca99bd2c 100644 --- a/src/test/ui/proc-macro/doc-comment-preserved.rs +++ b/src/test/ui/proc-macro/doc-comment-preserved.rs @@ -1,9 +1,9 @@ // check-pass +// compile-flags: -Z span-debug // aux-build:test-macros.rs -// Anonymize unstable non-dummy spans while still showing dummy spans `0..0`. -// normalize-stdout-test "bytes\([^0]\w*\.\.(\w+)\)" -> "bytes(LO..$1)" -// normalize-stdout-test "bytes\((\w+)\.\.[^0]\w*\)" -> "bytes($1..HI)" +#![no_std] // Don't load unnecessary hygiene information from std +extern crate std; #[macro_use] extern crate test_macros; diff --git a/src/test/ui/proc-macro/doc-comment-preserved.stdout b/src/test/ui/proc-macro/doc-comment-preserved.stdout index f7904536a76..f4160d7da80 100644 --- a/src/test/ui/proc-macro/doc-comment-preserved.stdout +++ b/src/test/ui/proc-macro/doc-comment-preserved.stdout @@ -11,44 +11,44 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ Punct { ch: '#', spacing: Alone, - span: #0 bytes(LO..HI), + span: $DIR/doc-comment-preserved.rs:13:1: 19:3 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "doc", - span: #0 bytes(LO..HI), + span: $DIR/doc-comment-preserved.rs:13:1: 19:3 (#0), }, Punct { ch: '=', spacing: Alone, - span: #0 bytes(LO..HI), + span: $DIR/doc-comment-preserved.rs:13:1: 19:3 (#0), }, Literal { kind: Str, symbol: "\n*******\n* DOC *\n* DOC *\n* DOC *\n*******\n", suffix: None, - span: #0 bytes(LO..HI), + span: $DIR/doc-comment-preserved.rs:13:1: 19:3 (#0), }, ], - span: #0 bytes(LO..HI), + span: $DIR/doc-comment-preserved.rs:13:1: 19:3 (#0), }, Ident { ident: "pub", - span: #0 bytes(LO..HI), + span: $DIR/doc-comment-preserved.rs:20:1: 20:4 (#0), }, Ident { ident: "struct", - span: #0 bytes(LO..HI), + span: $DIR/doc-comment-preserved.rs:20:5: 20:11 (#0), }, Ident { ident: "S", - span: #0 bytes(LO..HI), + span: $DIR/doc-comment-preserved.rs:20:12: 20:13 (#0), }, Punct { ch: ';', spacing: Alone, - span: #0 bytes(LO..HI), + span: $DIR/doc-comment-preserved.rs:20:13: 20:14 (#0), }, ] diff --git a/src/test/ui/proc-macro/dollar-crate-issue-57089.rs b/src/test/ui/proc-macro/dollar-crate-issue-57089.rs index 9ce90e42069..27bfa099f21 100644 --- a/src/test/ui/proc-macro/dollar-crate-issue-57089.rs +++ b/src/test/ui/proc-macro/dollar-crate-issue-57089.rs @@ -1,11 +1,10 @@ // check-pass // edition:2018 +// compile-flags: -Z span-debug // aux-build:test-macros.rs -// Anonymize unstable non-dummy spans while still showing dummy spans `0..0`. -// normalize-stdout-test "bytes\([^0]\w*\.\.(\w+)\)" -> "bytes(LO..$1)" -// normalize-stdout-test "bytes\((\w+)\.\.[^0]\w*\)" -> "bytes($1..HI)" -// normalize-stdout-test "#\d+" -> "#CTXT" +#![no_std] // Don't load unnecessary hygiene information from std +extern crate std; #[macro_use] extern crate test_macros; diff --git a/src/test/ui/proc-macro/dollar-crate-issue-57089.stdout b/src/test/ui/proc-macro/dollar-crate-issue-57089.stdout index c36c7560387..9a5afbd604f 100644 --- a/src/test/ui/proc-macro/dollar-crate-issue-57089.stdout +++ b/src/test/ui/proc-macro/dollar-crate-issue-57089.stdout @@ -2,79 +2,79 @@ PRINT-BANG INPUT (DISPLAY): struct M($crate :: S) ; PRINT-BANG INPUT (DEBUG): TokenStream [ Ident { ident: "struct", - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate-issue-57089.rs:17:13: 17:19 (#3), }, Ident { ident: "M", - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate-issue-57089.rs:17:20: 17:21 (#3), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "$crate", - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate-issue-57089.rs:17:22: 17:28 (#3), }, Punct { ch: ':', spacing: Joint, - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate-issue-57089.rs:17:28: 17:30 (#3), }, Punct { ch: ':', spacing: Alone, - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate-issue-57089.rs:17:28: 17:30 (#3), }, Ident { ident: "S", - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate-issue-57089.rs:17:30: 17:31 (#3), }, ], - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate-issue-57089.rs:17:21: 17:32 (#3), }, Punct { ch: ';', spacing: Alone, - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate-issue-57089.rs:17:32: 17:33 (#3), }, ] PRINT-ATTR INPUT (DISPLAY): struct A($crate :: S) ; PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "struct", - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate-issue-57089.rs:21:9: 21:15 (#3), }, Ident { ident: "A", - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate-issue-57089.rs:21:16: 21:17 (#3), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "$crate", - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate-issue-57089.rs:21:18: 21:24 (#3), }, Punct { ch: ':', spacing: Joint, - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate-issue-57089.rs:21:24: 21:26 (#3), }, Punct { ch: ':', spacing: Alone, - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate-issue-57089.rs:21:24: 21:26 (#3), }, Ident { ident: "S", - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate-issue-57089.rs:21:26: 21:27 (#3), }, ], - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate-issue-57089.rs:21:17: 21:28 (#3), }, Punct { ch: ';', spacing: Alone, - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate-issue-57089.rs:21:28: 21:29 (#3), }, ] diff --git a/src/test/ui/proc-macro/dollar-crate-issue-62325.rs b/src/test/ui/proc-macro/dollar-crate-issue-62325.rs index 2a9ff4c20cd..d828fb9fd80 100644 --- a/src/test/ui/proc-macro/dollar-crate-issue-62325.rs +++ b/src/test/ui/proc-macro/dollar-crate-issue-62325.rs @@ -1,12 +1,12 @@ // check-pass // edition:2018 +// compile-flags: -Z span-debug // aux-build:test-macros.rs // aux-build:dollar-crate-external.rs -// Anonymize unstable non-dummy spans while still showing dummy spans `0..0`. -// normalize-stdout-test "bytes\([^0]\w*\.\.(\w+)\)" -> "bytes(LO..$1)" -// normalize-stdout-test "bytes\((\w+)\.\.[^0]\w*\)" -> "bytes($1..HI)" -// normalize-stdout-test "#\d+" -> "#CTXT" + +#![no_std] // Don't load unnecessary hygiene information from std +extern crate std; #[macro_use] extern crate test_macros; diff --git a/src/test/ui/proc-macro/dollar-crate-issue-62325.stdout b/src/test/ui/proc-macro/dollar-crate-issue-62325.stdout index 456940b89da..fc62eadd313 100644 --- a/src/test/ui/proc-macro/dollar-crate-issue-62325.stdout +++ b/src/test/ui/proc-macro/dollar-crate-issue-62325.stdout @@ -2,109 +2,109 @@ PRINT-ATTR INPUT (DISPLAY): struct A(identity ! ($crate :: S)) ; PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "struct", - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate-issue-62325.rs:19:5: 19:11 (#3), }, Ident { ident: "A", - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate-issue-62325.rs:19:12: 19:13 (#3), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "identity", - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate-issue-62325.rs:19:14: 19:22 (#3), }, Punct { ch: '!', spacing: Alone, - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate-issue-62325.rs:19:22: 19:23 (#3), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "$crate", - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate-issue-62325.rs:19:24: 19:30 (#3), }, Punct { ch: ':', spacing: Joint, - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate-issue-62325.rs:19:30: 19:32 (#3), }, Punct { ch: ':', spacing: Alone, - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate-issue-62325.rs:19:30: 19:32 (#3), }, Ident { ident: "S", - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate-issue-62325.rs:19:32: 19:33 (#3), }, ], - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate-issue-62325.rs:19:23: 19:34 (#3), }, ], - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate-issue-62325.rs:19:13: 19:35 (#3), }, Punct { ch: ';', spacing: Alone, - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate-issue-62325.rs:19:35: 19:36 (#3), }, ] PRINT-ATTR INPUT (DISPLAY): struct B(identity ! ($crate :: S)) ; PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "struct", - span: #CTXT bytes(LO..HI), + span: $DIR/auxiliary/dollar-crate-external.rs:21:5: 21:11 (#10), }, Ident { ident: "B", - span: #CTXT bytes(LO..HI), + span: $DIR/auxiliary/dollar-crate-external.rs:21:12: 21:13 (#10), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "identity", - span: #CTXT bytes(LO..HI), + span: $DIR/auxiliary/dollar-crate-external.rs:21:14: 21:22 (#10), }, Punct { ch: '!', spacing: Alone, - span: #CTXT bytes(LO..HI), + span: $DIR/auxiliary/dollar-crate-external.rs:21:22: 21:23 (#10), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "$crate", - span: #CTXT bytes(LO..HI), + span: $DIR/auxiliary/dollar-crate-external.rs:21:24: 21:30 (#10), }, Punct { ch: ':', spacing: Joint, - span: #CTXT bytes(LO..HI), + span: $DIR/auxiliary/dollar-crate-external.rs:21:30: 21:32 (#10), }, Punct { ch: ':', spacing: Alone, - span: #CTXT bytes(LO..HI), + span: $DIR/auxiliary/dollar-crate-external.rs:21:30: 21:32 (#10), }, Ident { ident: "S", - span: #CTXT bytes(LO..HI), + span: $DIR/auxiliary/dollar-crate-external.rs:21:32: 21:33 (#10), }, ], - span: #CTXT bytes(LO..HI), + span: $DIR/auxiliary/dollar-crate-external.rs:21:23: 21:34 (#10), }, ], - span: #CTXT bytes(LO..HI), + span: $DIR/auxiliary/dollar-crate-external.rs:21:13: 21:35 (#10), }, Punct { ch: ';', spacing: Alone, - span: #CTXT bytes(LO..HI), + span: $DIR/auxiliary/dollar-crate-external.rs:21:35: 21:36 (#10), }, ] diff --git a/src/test/ui/proc-macro/dollar-crate.rs b/src/test/ui/proc-macro/dollar-crate.rs index 1a5223d3d41..ac27dfa1aeb 100644 --- a/src/test/ui/proc-macro/dollar-crate.rs +++ b/src/test/ui/proc-macro/dollar-crate.rs @@ -1,12 +1,11 @@ // check-pass // edition:2018 +// compile-flags: -Z span-debug // aux-build:test-macros.rs // aux-build:dollar-crate-external.rs -// Anonymize unstable non-dummy spans while still showing dummy spans `0..0`. -// normalize-stdout-test "bytes\([^0]\w*\.\.(\w+)\)" -> "bytes(LO..$1)" -// normalize-stdout-test "bytes\((\w+)\.\.[^0]\w*\)" -> "bytes($1..HI)" -// normalize-stdout-test "#\d+" -> "#CTXT" +#![no_std] // Don't load unnecessary hygiene information from std +extern crate std; #[macro_use] extern crate test_macros; diff --git a/src/test/ui/proc-macro/dollar-crate.stdout b/src/test/ui/proc-macro/dollar-crate.stdout index deef102afb2..72fc6588583 100644 --- a/src/test/ui/proc-macro/dollar-crate.stdout +++ b/src/test/ui/proc-macro/dollar-crate.stdout @@ -2,239 +2,239 @@ PRINT-BANG INPUT (DISPLAY): struct M($crate :: S) ; PRINT-BANG INPUT (DEBUG): TokenStream [ Ident { ident: "struct", - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate.rs:20:17: 20:23 (#3), }, Ident { ident: "M", - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate.rs:20:24: 20:25 (#3), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "$crate", - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate.rs:20:26: 20:32 (#3), }, Punct { ch: ':', spacing: Joint, - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate.rs:20:32: 20:34 (#3), }, Punct { ch: ':', spacing: Alone, - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate.rs:20:32: 20:34 (#3), }, Ident { ident: "S", - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate.rs:20:34: 20:35 (#3), }, ], - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate.rs:20:25: 20:36 (#3), }, Punct { ch: ';', spacing: Alone, - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate.rs:20:36: 20:37 (#3), }, ] PRINT-ATTR INPUT (DISPLAY): struct A($crate :: S) ; PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "struct", - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate.rs:24:13: 24:19 (#3), }, Ident { ident: "A", - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate.rs:24:20: 24:21 (#3), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "$crate", - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate.rs:24:22: 24:28 (#3), }, Punct { ch: ':', spacing: Joint, - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate.rs:24:28: 24:30 (#3), }, Punct { ch: ':', spacing: Alone, - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate.rs:24:28: 24:30 (#3), }, Ident { ident: "S", - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate.rs:24:30: 24:31 (#3), }, ], - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate.rs:24:21: 24:32 (#3), }, Punct { ch: ';', spacing: Alone, - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate.rs:24:32: 24:33 (#3), }, ] PRINT-DERIVE INPUT (DISPLAY): struct D($crate :: S) ; PRINT-DERIVE INPUT (DEBUG): TokenStream [ Ident { ident: "struct", - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate.rs:27:13: 27:19 (#3), }, Ident { ident: "D", - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate.rs:27:20: 27:21 (#3), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "$crate", - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate.rs:27:22: 27:28 (#3), }, Punct { ch: ':', spacing: Joint, - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate.rs:27:28: 27:30 (#3), }, Punct { ch: ':', spacing: Alone, - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate.rs:27:28: 27:30 (#3), }, Ident { ident: "S", - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate.rs:27:30: 27:31 (#3), }, ], - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate.rs:27:21: 27:32 (#3), }, Punct { ch: ';', spacing: Alone, - span: #CTXT bytes(LO..HI), + span: $DIR/dollar-crate.rs:27:32: 27:33 (#3), }, ] PRINT-BANG INPUT (DISPLAY): struct M($crate :: S) ; PRINT-BANG INPUT (DEBUG): TokenStream [ Ident { ident: "struct", - span: #CTXT bytes(LO..HI), + span: $DIR/auxiliary/dollar-crate-external.rs:7:13: 7:19 (#13), }, Ident { ident: "M", - span: #CTXT bytes(LO..HI), + span: $DIR/auxiliary/dollar-crate-external.rs:7:20: 7:21 (#13), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "$crate", - span: #CTXT bytes(LO..HI), + span: $DIR/auxiliary/dollar-crate-external.rs:7:22: 7:28 (#13), }, Punct { ch: ':', spacing: Joint, - span: #CTXT bytes(LO..HI), + span: $DIR/auxiliary/dollar-crate-external.rs:7:28: 7:30 (#13), }, Punct { ch: ':', spacing: Alone, - span: #CTXT bytes(LO..HI), + span: $DIR/auxiliary/dollar-crate-external.rs:7:28: 7:30 (#13), }, Ident { ident: "S", - span: #CTXT bytes(LO..HI), + span: $DIR/auxiliary/dollar-crate-external.rs:7:30: 7:31 (#13), }, ], - span: #CTXT bytes(LO..HI), + span: $DIR/auxiliary/dollar-crate-external.rs:7:21: 7:32 (#13), }, Punct { ch: ';', spacing: Alone, - span: #CTXT bytes(LO..HI), + span: $DIR/auxiliary/dollar-crate-external.rs:7:32: 7:33 (#13), }, ] PRINT-ATTR INPUT (DISPLAY): struct A($crate :: S) ; PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "struct", - span: #CTXT bytes(LO..HI), + span: $DIR/auxiliary/dollar-crate-external.rs:11:9: 11:15 (#13), }, Ident { ident: "A", - span: #CTXT bytes(LO..HI), + span: $DIR/auxiliary/dollar-crate-external.rs:11:16: 11:17 (#13), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "$crate", - span: #CTXT bytes(LO..HI), + span: $DIR/auxiliary/dollar-crate-external.rs:11:18: 11:24 (#13), }, Punct { ch: ':', spacing: Joint, - span: #CTXT bytes(LO..HI), + span: $DIR/auxiliary/dollar-crate-external.rs:11:24: 11:26 (#13), }, Punct { ch: ':', spacing: Alone, - span: #CTXT bytes(LO..HI), + span: $DIR/auxiliary/dollar-crate-external.rs:11:24: 11:26 (#13), }, Ident { ident: "S", - span: #CTXT bytes(LO..HI), + span: $DIR/auxiliary/dollar-crate-external.rs:11:26: 11:27 (#13), }, ], - span: #CTXT bytes(LO..HI), + span: $DIR/auxiliary/dollar-crate-external.rs:11:17: 11:28 (#13), }, Punct { ch: ';', spacing: Alone, - span: #CTXT bytes(LO..HI), + span: $DIR/auxiliary/dollar-crate-external.rs:11:28: 11:29 (#13), }, ] PRINT-DERIVE INPUT (DISPLAY): struct D($crate :: S) ; PRINT-DERIVE INPUT (DEBUG): TokenStream [ Ident { ident: "struct", - span: #CTXT bytes(LO..HI), + span: $DIR/auxiliary/dollar-crate-external.rs:14:9: 14:15 (#13), }, Ident { ident: "D", - span: #CTXT bytes(LO..HI), + span: $DIR/auxiliary/dollar-crate-external.rs:14:16: 14:17 (#13), }, Group { delimiter: Parenthesis, stream: TokenStream [ Ident { ident: "$crate", - span: #CTXT bytes(LO..HI), + span: $DIR/auxiliary/dollar-crate-external.rs:14:18: 14:24 (#13), }, Punct { ch: ':', spacing: Joint, - span: #CTXT bytes(LO..HI), + span: $DIR/auxiliary/dollar-crate-external.rs:14:24: 14:26 (#13), }, Punct { ch: ':', spacing: Alone, - span: #CTXT bytes(LO..HI), + span: $DIR/auxiliary/dollar-crate-external.rs:14:24: 14:26 (#13), }, Ident { ident: "S", - span: #CTXT bytes(LO..HI), + span: $DIR/auxiliary/dollar-crate-external.rs:14:26: 14:27 (#13), }, ], - span: #CTXT bytes(LO..HI), + span: $DIR/auxiliary/dollar-crate-external.rs:14:17: 14:28 (#13), }, Punct { ch: ';', spacing: Alone, - span: #CTXT bytes(LO..HI), + span: $DIR/auxiliary/dollar-crate-external.rs:14:28: 14:29 (#13), }, ] diff --git a/src/test/ui/proc-macro/input-interpolated.rs b/src/test/ui/proc-macro/input-interpolated.rs index 41c829d9d88..5e49e330cac 100644 --- a/src/test/ui/proc-macro/input-interpolated.rs +++ b/src/test/ui/proc-macro/input-interpolated.rs @@ -1,9 +1,12 @@ // Check what token streams proc macros see when interpolated tokens are passed to them as input. // check-pass -// normalize-stdout-test "#\d+" -> "#CTXT" +// edition:2018 // aux-build:test-macros.rs +#![no_std] // Don't load unnecessary hygiene information from std +extern crate std; + #[macro_use] extern crate test_macros; diff --git a/src/test/ui/proc-macro/input-interpolated.stdout b/src/test/ui/proc-macro/input-interpolated.stdout index d98f52249a7..9cf33ba4a9d 100644 --- a/src/test/ui/proc-macro/input-interpolated.stdout +++ b/src/test/ui/proc-macro/input-interpolated.stdout @@ -5,61 +5,61 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ stream: TokenStream [ Ident { ident: "A", - span: #CTXT bytes(445..446), + span: #0 bytes(503..504), }, ], - span: #CTXT bytes(312..314), + span: #3 bytes(370..372), }, ] PRINT-ATTR INPUT (DISPLAY): const A : u8 = 0 ; PRINT-ATTR INPUT (DEBUG): TokenStream [ Ident { ident: "const", - span: #CTXT bytes(0..0), + span: #0 bytes(0..0), }, Ident { ident: "A", - span: #CTXT bytes(0..0), + span: #0 bytes(0..0), }, Punct { ch: ':', spacing: Alone, - span: #CTXT bytes(0..0), + span: #0 bytes(0..0), }, Ident { ident: "u8", - span: #CTXT bytes(0..0), + span: #0 bytes(0..0), }, Punct { ch: '=', spacing: Alone, - span: #CTXT bytes(0..0), + span: #0 bytes(0..0), }, Literal { kind: Integer, symbol: "0", suffix: None, - span: #CTXT bytes(0..0), + span: #0 bytes(0..0), }, Punct { ch: ';', spacing: Alone, - span: #CTXT bytes(0..0), + span: #0 bytes(0..0), }, ] PRINT-DERIVE INPUT (DISPLAY): struct A { } PRINT-DERIVE INPUT (DEBUG): TokenStream [ Ident { ident: "struct", - span: #CTXT bytes(0..0), + span: #0 bytes(0..0), }, Ident { ident: "A", - span: #CTXT bytes(0..0), + span: #0 bytes(0..0), }, Group { delimiter: Brace, stream: TokenStream [], - span: #CTXT bytes(0..0), + span: #0 bytes(0..0), }, ] diff --git a/src/test/ui/proc-macro/meta-macro-hygiene.rs b/src/test/ui/proc-macro/meta-macro-hygiene.rs index 4b1787453cb..c11cf42956f 100644 --- a/src/test/ui/proc-macro/meta-macro-hygiene.rs +++ b/src/test/ui/proc-macro/meta-macro-hygiene.rs @@ -1,13 +1,16 @@ // aux-build:make-macro.rs // aux-build:meta-macro.rs // edition:2018 -// compile-flags: -Z span-debug -Z macro-backtrace +// compile-flags: -Z span-debug -Z macro-backtrace -Z unpretty=expanded,hygiene // check-pass -// normalize-stdout-test "#\d+" -> "#CTXT" // normalize-stdout-test "\d+#" -> "0#" // // We don't care about symbol ids, so we set them all to 0 // in the stdout + +#![no_std] // Don't load unnecessary hygiene information from std +extern crate std; + extern crate meta_macro; macro_rules! produce_it { diff --git a/src/test/ui/proc-macro/meta-macro-hygiene.stdout b/src/test/ui/proc-macro/meta-macro-hygiene.stdout index e162bdd7fc0..dfd3e6a839a 100644 --- a/src/test/ui/proc-macro/meta-macro-hygiene.stdout +++ b/src/test/ui/proc-macro/meta-macro-hygiene.stdout @@ -1,3 +1,63 @@ -Def site: $DIR/auxiliary/make-macro.rs:7:9: 16:10 (#CTXT) -Input: TokenStream [Ident { ident: "$crate", span: $DIR/meta-macro-hygiene.rs:20:37: 20:43 (#CTXT) }, Punct { ch: ':', spacing: Joint, span: $DIR/meta-macro-hygiene.rs:20:43: 20:45 (#CTXT) }, Punct { ch: ':', spacing: Alone, span: $DIR/meta-macro-hygiene.rs:20:43: 20:45 (#CTXT) }, Ident { ident: "dummy", span: $DIR/meta-macro-hygiene.rs:20:45: 20:50 (#CTXT) }, Punct { ch: '!', spacing: Alone, span: $DIR/meta-macro-hygiene.rs:20:50: 20:51 (#CTXT) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: $DIR/meta-macro-hygiene.rs:20:51: 20:53 (#CTXT) }] -Respanned: TokenStream [Ident { ident: "$crate", span: $DIR/auxiliary/make-macro.rs:7:9: 16:10 (#CTXT) }, Punct { ch: ':', spacing: Joint, span: $DIR/auxiliary/make-macro.rs:7:9: 16:10 (#CTXT) }, Punct { ch: ':', spacing: Alone, span: $DIR/auxiliary/make-macro.rs:7:9: 16:10 (#CTXT) }, Ident { ident: "dummy", span: $DIR/auxiliary/make-macro.rs:7:9: 16:10 (#CTXT) }, Punct { ch: '!', spacing: Alone, span: $DIR/auxiliary/make-macro.rs:7:9: 16:10 (#CTXT) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: $DIR/auxiliary/make-macro.rs:7:9: 16:10 (#CTXT) }] +Def site: $DIR/auxiliary/make-macro.rs:7:9: 16:10 (#4) +Input: TokenStream [Ident { ident: "$crate", span: $DIR/meta-macro-hygiene.rs:23:37: 23:43 (#3) }, Punct { ch: ':', spacing: Joint, span: $DIR/meta-macro-hygiene.rs:23:43: 23:45 (#3) }, Punct { ch: ':', spacing: Alone, span: $DIR/meta-macro-hygiene.rs:23:43: 23:45 (#3) }, Ident { ident: "dummy", span: $DIR/meta-macro-hygiene.rs:23:45: 23:50 (#3) }, Punct { ch: '!', spacing: Alone, span: $DIR/meta-macro-hygiene.rs:23:50: 23:51 (#3) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: $DIR/meta-macro-hygiene.rs:23:51: 23:53 (#3) }] +Respanned: TokenStream [Ident { ident: "$crate", span: $DIR/auxiliary/make-macro.rs:7:9: 16:10 (#4) }, Punct { ch: ':', spacing: Joint, span: $DIR/auxiliary/make-macro.rs:7:9: 16:10 (#4) }, Punct { ch: ':', spacing: Alone, span: $DIR/auxiliary/make-macro.rs:7:9: 16:10 (#4) }, Ident { ident: "dummy", span: $DIR/auxiliary/make-macro.rs:7:9: 16:10 (#4) }, Punct { ch: '!', spacing: Alone, span: $DIR/auxiliary/make-macro.rs:7:9: 16:10 (#4) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: $DIR/auxiliary/make-macro.rs:7:9: 16:10 (#4) }] +#![feature /* 0#0 */(prelude_import)] +// aux-build:make-macro.rs +// aux-build:meta-macro.rs +// edition:2018 +// compile-flags: -Z span-debug -Z macro-backtrace -Z unpretty=expanded,hygiene +// check-pass +// normalize-stdout-test "\d+#" -> "0#" +// +// We don't care about symbol ids, so we set them all to 0 +// in the stdout + +#![no_std /* 0#0 */] +#[prelude_import /* 0#1 */] +use core /* 0#1 */::prelude /* 0#1 */::v1 /* 0#1 */::*; +#[macro_use /* 0#1 */] +extern crate core /* 0#1 */; +#[macro_use /* 0#1 */] +extern crate compiler_builtins /* 0#1 */; +// Don't load unnecessary hygiene information from std +extern crate std /* 0#0 */; + +extern crate meta_macro /* 0#0 */; + +macro_rules! produce_it + /* + 0#0 + */ { + () => + { + meta_macro :: print_def_site ! ($ crate :: dummy ! ()) ; + // `print_def_site!` will respan the `$crate` identifier + // with `Span::def_site()`. This should cause it to resolve + // relative to `meta_macro`, *not* `make_macro` (despite + // the fact that that `print_def_site` is produced by + // a `macro_rules!` macro in `make_macro`). + } +} + +fn main /* 0#0 */() { } + +/* +Expansions: +0: parent: ExpnId(0), call_site_ctxt: #0, def_site_ctxt: #0, kind: Root +1: parent: ExpnId(0), call_site_ctxt: #0, def_site_ctxt: #0, kind: AstPass(StdImports) +2: parent: ExpnId(0), call_site_ctxt: #0, def_site_ctxt: #0, kind: Macro(Bang, "produce_it") +3: parent: ExpnId(2), call_site_ctxt: #3, def_site_ctxt: #0, kind: Macro(Bang, "meta_macro::print_def_site") +4: parent: ExpnId(3), call_site_ctxt: #4, def_site_ctxt: #0, kind: Macro(Bang, "$crate::dummy") + +SyntaxContexts: +#0: parent: #0, outer_mark: (ExpnId(0), Opaque) +#1: parent: #0, outer_mark: (ExpnId(1), Opaque) +#2: parent: #0, outer_mark: (ExpnId(1), Transparent) +#3: parent: #0, outer_mark: (ExpnId(2), SemiTransparent) +#4: parent: #0, outer_mark: (ExpnId(3), Opaque) +#5: parent: #3, outer_mark: (ExpnId(3), Transparent) +#6: parent: #0, outer_mark: (ExpnId(3), SemiTransparent) +#7: parent: #0, outer_mark: (ExpnId(4), Opaque) +#8: parent: #4, outer_mark: (ExpnId(4), Transparent) +#9: parent: #4, outer_mark: (ExpnId(4), SemiTransparent) +*/ diff --git a/src/test/ui/proc-macro/meta-macro.rs b/src/test/ui/proc-macro/meta-macro.rs index 579e232c0d9..dbac90382d1 100644 --- a/src/test/ui/proc-macro/meta-macro.rs +++ b/src/test/ui/proc-macro/meta-macro.rs @@ -2,9 +2,11 @@ // aux-build:meta-macro.rs // edition:2018 // compile-flags: -Z span-debug -// normalize-stdout-test "#\d+" -> "#CTXT" // run-pass +#![no_std] // Don't load unnecessary hygiene information from std +extern crate std; + extern crate meta_macro; fn main() { diff --git a/src/test/ui/proc-macro/meta-macro.stdout b/src/test/ui/proc-macro/meta-macro.stdout index a9847a25d92..71aa565f4dd 100644 --- a/src/test/ui/proc-macro/meta-macro.stdout +++ b/src/test/ui/proc-macro/meta-macro.stdout @@ -1,3 +1,3 @@ -Def site: $DIR/auxiliary/make-macro.rs:7:9: 16:10 (#CTXT) +Def site: $DIR/auxiliary/make-macro.rs:7:9: 16:10 (#3) Input: TokenStream [] Respanned: TokenStream [] diff --git a/src/test/ui/proc-macro/nested-macro-rules.rs b/src/test/ui/proc-macro/nested-macro-rules.rs index 62c3dd84ce1..2fef0e5fad0 100644 --- a/src/test/ui/proc-macro/nested-macro-rules.rs +++ b/src/test/ui/proc-macro/nested-macro-rules.rs @@ -2,9 +2,11 @@ // aux-build:nested-macro-rules.rs // aux-build:test-macros.rs // compile-flags: -Z span-debug -// normalize-stdout-test "#\d+" -> "#CTXT" // edition:2018 +#![no_std] // Don't load unnecessary hygiene information from std +extern crate std; + extern crate nested_macro_rules; extern crate test_macros; diff --git a/src/test/ui/proc-macro/nested-macro-rules.stdout b/src/test/ui/proc-macro/nested-macro-rules.stdout index 337b9863def..7feea56c5d8 100644 --- a/src/test/ui/proc-macro/nested-macro-rules.stdout +++ b/src/test/ui/proc-macro/nested-macro-rules.stdout @@ -5,10 +5,10 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ stream: TokenStream [ Ident { ident: "FirstStruct", - span: $DIR/auxiliary/nested-macro-rules.rs:15:14: 15:25 (#CTXT), + span: $DIR/auxiliary/nested-macro-rules.rs:15:14: 15:25 (#5), }, ], - span: $DIR/auxiliary/nested-macro-rules.rs:9:27: 9:32 (#CTXT), + span: $DIR/auxiliary/nested-macro-rules.rs:9:27: 9:32 (#4), }, ] PRINT-BANG INPUT (DISPLAY): SecondStruct @@ -18,9 +18,9 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ stream: TokenStream [ Ident { ident: "SecondStruct", - span: $DIR/nested-macro-rules.rs:19:38: 19:50 (#CTXT), + span: $DIR/nested-macro-rules.rs:21:38: 21:50 (#11), }, ], - span: $DIR/auxiliary/nested-macro-rules.rs:9:27: 9:32 (#CTXT), + span: $DIR/auxiliary/nested-macro-rules.rs:9:27: 9:32 (#10), }, ] diff --git a/src/test/ui/proc-macro/nodelim-groups.rs b/src/test/ui/proc-macro/nodelim-groups.rs index 1dc8796de90..db2a879f405 100644 --- a/src/test/ui/proc-macro/nodelim-groups.rs +++ b/src/test/ui/proc-macro/nodelim-groups.rs @@ -1,11 +1,13 @@ // run-pass // aux-build:test-macros.rs // compile-flags: -Z span-debug -// normalize-stdout-test "#\d+" -> "#CTXT" // edition:2018 // // Tests the pretty-printing behavior of inserting `NoDelim` groups +#![no_std] // Don't load unnecessary hygiene information from std +extern crate std; + extern crate test_macros; use test_macros::print_bang_consume; diff --git a/src/test/ui/proc-macro/nodelim-groups.stdout b/src/test/ui/proc-macro/nodelim-groups.stdout index 79cdf2b53b5..2fcd41f6da0 100644 --- a/src/test/ui/proc-macro/nodelim-groups.stdout +++ b/src/test/ui/proc-macro/nodelim-groups.stdout @@ -4,7 +4,7 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ kind: Str, symbol: "hi", suffix: None, - span: $DIR/nodelim-groups.rs:14:42: 14:46 (#CTXT), + span: $DIR/nodelim-groups.rs:16:42: 16:46 (#3), }, Group { delimiter: None, @@ -13,12 +13,12 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ kind: Integer, symbol: "1", suffix: None, - span: $DIR/nodelim-groups.rs:18:16: 18:17 (#CTXT), + span: $DIR/nodelim-groups.rs:20:16: 20:17 (#0), }, Punct { ch: '+', spacing: Alone, - span: $DIR/nodelim-groups.rs:18:18: 18:19 (#CTXT), + span: $DIR/nodelim-groups.rs:20:18: 20:19 (#0), }, Group { delimiter: Parenthesis, @@ -27,24 +27,24 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ kind: Integer, symbol: "25", suffix: None, - span: $DIR/nodelim-groups.rs:18:21: 18:23 (#CTXT), + span: $DIR/nodelim-groups.rs:20:21: 20:23 (#0), }, ], - span: $DIR/nodelim-groups.rs:18:20: 18:24 (#CTXT), + span: $DIR/nodelim-groups.rs:20:20: 20:24 (#0), }, Punct { ch: '+', spacing: Alone, - span: $DIR/nodelim-groups.rs:18:25: 18:26 (#CTXT), + span: $DIR/nodelim-groups.rs:20:25: 20:26 (#0), }, Literal { kind: Integer, symbol: "1", suffix: None, - span: $DIR/nodelim-groups.rs:18:27: 18:28 (#CTXT), + span: $DIR/nodelim-groups.rs:20:27: 20:28 (#0), }, ], - span: $DIR/nodelim-groups.rs:14:47: 14:51 (#CTXT), + span: $DIR/nodelim-groups.rs:16:47: 16:51 (#3), }, Group { delimiter: Parenthesis, @@ -53,21 +53,21 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ kind: Integer, symbol: "1", suffix: None, - span: $DIR/nodelim-groups.rs:14:53: 14:54 (#CTXT), + span: $DIR/nodelim-groups.rs:16:53: 16:54 (#3), }, Punct { ch: '+', spacing: Alone, - span: $DIR/nodelim-groups.rs:14:55: 14:56 (#CTXT), + span: $DIR/nodelim-groups.rs:16:55: 16:56 (#3), }, Literal { kind: Integer, symbol: "1", suffix: None, - span: $DIR/nodelim-groups.rs:14:57: 14:58 (#CTXT), + span: $DIR/nodelim-groups.rs:16:57: 16:58 (#3), }, ], - span: $DIR/nodelim-groups.rs:14:52: 14:59 (#CTXT), + span: $DIR/nodelim-groups.rs:16:52: 16:59 (#3), }, ] PRINT-BANG INPUT (DISPLAY): "hi" "hello".len() + "world".len() (1 + 1) @@ -77,7 +77,7 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ kind: Str, symbol: "hi", suffix: None, - span: $DIR/nodelim-groups.rs:14:42: 14:46 (#CTXT), + span: $DIR/nodelim-groups.rs:16:42: 16:46 (#8), }, Group { delimiter: None, @@ -86,49 +86,49 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ kind: Str, symbol: "hello", suffix: None, - span: $DIR/nodelim-groups.rs:14:47: 14:51 (#CTXT), + span: $DIR/nodelim-groups.rs:16:47: 16:51 (#8), }, Punct { ch: '.', spacing: Alone, - span: $DIR/nodelim-groups.rs:14:47: 14:51 (#CTXT), + span: $DIR/nodelim-groups.rs:16:47: 16:51 (#8), }, Ident { ident: "len", - span: $DIR/nodelim-groups.rs:14:47: 14:51 (#CTXT), + span: $DIR/nodelim-groups.rs:16:47: 16:51 (#8), }, Group { delimiter: Parenthesis, stream: TokenStream [], - span: $DIR/nodelim-groups.rs:14:47: 14:51 (#CTXT), + span: $DIR/nodelim-groups.rs:16:47: 16:51 (#8), }, Punct { ch: '+', spacing: Alone, - span: $DIR/nodelim-groups.rs:14:47: 14:51 (#CTXT), + span: $DIR/nodelim-groups.rs:16:47: 16:51 (#8), }, Literal { kind: Str, symbol: "world", suffix: None, - span: $DIR/nodelim-groups.rs:14:47: 14:51 (#CTXT), + span: $DIR/nodelim-groups.rs:16:47: 16:51 (#8), }, Punct { ch: '.', spacing: Alone, - span: $DIR/nodelim-groups.rs:14:47: 14:51 (#CTXT), + span: $DIR/nodelim-groups.rs:16:47: 16:51 (#8), }, Ident { ident: "len", - span: $DIR/nodelim-groups.rs:14:47: 14:51 (#CTXT), + span: $DIR/nodelim-groups.rs:16:47: 16:51 (#8), }, Group { delimiter: Parenthesis, stream: TokenStream [], - span: $DIR/nodelim-groups.rs:14:47: 14:51 (#CTXT), + span: $DIR/nodelim-groups.rs:16:47: 16:51 (#8), }, ], - span: $DIR/nodelim-groups.rs:14:47: 14:51 (#CTXT), + span: $DIR/nodelim-groups.rs:16:47: 16:51 (#8), }, Group { delimiter: Parenthesis, @@ -137,20 +137,20 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ kind: Integer, symbol: "1", suffix: None, - span: $DIR/nodelim-groups.rs:14:53: 14:54 (#CTXT), + span: $DIR/nodelim-groups.rs:16:53: 16:54 (#8), }, Punct { ch: '+', spacing: Alone, - span: $DIR/nodelim-groups.rs:14:55: 14:56 (#CTXT), + span: $DIR/nodelim-groups.rs:16:55: 16:56 (#8), }, Literal { kind: Integer, symbol: "1", suffix: None, - span: $DIR/nodelim-groups.rs:14:57: 14:58 (#CTXT), + span: $DIR/nodelim-groups.rs:16:57: 16:58 (#8), }, ], - span: $DIR/nodelim-groups.rs:14:52: 14:59 (#CTXT), + span: $DIR/nodelim-groups.rs:16:52: 16:59 (#8), }, ] |
