diff options
Diffstat (limited to 'tests')
801 files changed, 15184 insertions, 5327 deletions
diff --git a/tests/assembly/option-nonzero-eq.rs b/tests/assembly/option-nonzero-eq.rs deleted file mode 100644 index b04cf63fd78..00000000000 --- a/tests/assembly/option-nonzero-eq.rs +++ /dev/null @@ -1,27 +0,0 @@ -//@ revisions: WIN LIN -//@ [WIN] only-windows -//@ [LIN] only-linux -//@ assembly-output: emit-asm -//@ compile-flags: --crate-type=lib -O -C llvm-args=-x86-asm-syntax=intel -//@ only-x86_64 -//@ ignore-sgx - -use std::cmp::Ordering; - -// CHECK-lABEL: ordering_eq: -#[no_mangle] -pub fn ordering_eq(l: Option<Ordering>, r: Option<Ordering>) -> bool { - // Linux (System V): first two arguments are rdi then rsi - // Windows: first two arguments are rcx then rdx - // Both use rax for the return value. - - // CHECK-NOT: mov - // CHECK-NOT: test - // CHECK-NOT: cmp - - // LIN: cmp dil, sil - // WIN: cmp cl, dl - // CHECK-NEXT: sete al - // CHECK-NEXT: ret - l == r -} diff --git a/tests/assembly/targets/targets-elf.rs b/tests/assembly/targets/targets-elf.rs index bda77b5f09b..3563aec6d80 100644 --- a/tests/assembly/targets/targets-elf.rs +++ b/tests/assembly/targets/targets-elf.rs @@ -369,6 +369,9 @@ //@ revisions: riscv32im_unknown_none_elf //@ [riscv32im_unknown_none_elf] compile-flags: --target riscv32im-unknown-none-elf //@ [riscv32im_unknown_none_elf] needs-llvm-components: riscv +//@ revisions: riscv32ima_unknown_none_elf +//@ [riscv32ima_unknown_none_elf] compile-flags: --target riscv32ima-unknown-none-elf +//@ [riscv32ima_unknown_none_elf] needs-llvm-components: riscv //@ revisions: riscv32imac_esp_espidf //@ [riscv32imac_esp_espidf] compile-flags: --target riscv32imac-esp-espidf //@ [riscv32imac_esp_espidf] needs-llvm-components: riscv diff --git a/tests/codegen/dont_codegen_private_const_fn_only_used_in_const_eval.rs b/tests/codegen/dont_codegen_private_const_fn_only_used_in_const_eval.rs new file mode 100644 index 00000000000..eeeaebe52dd --- /dev/null +++ b/tests/codegen/dont_codegen_private_const_fn_only_used_in_const_eval.rs @@ -0,0 +1,10 @@ +//! This test checks that we do not monomorphize functions that are only +//! used to evaluate static items, but never used in runtime code. + +//@compile-flags: --crate-type=lib -Copt-level=0 + +const fn foo() {} + +pub static FOO: () = foo(); + +// CHECK-NOT: define{{.*}}foo{{.*}} diff --git a/tests/codegen/issues/issue-114312.rs b/tests/codegen/issues/issue-114312.rs index 54fa40dcf0d..be5b999afd0 100644 --- a/tests/codegen/issues/issue-114312.rs +++ b/tests/codegen/issues/issue-114312.rs @@ -1,5 +1,4 @@ //@ compile-flags: -O -//@ min-llvm-version: 17 //@ only-x86_64-unknown-linux-gnu // We want to check that this function does not mis-optimize to loop jumping. diff --git a/tests/codegen/move-before-nocapture-ref-arg.rs b/tests/codegen/move-before-nocapture-ref-arg.rs index a530bc26672..c3448192ea1 100644 --- a/tests/codegen/move-before-nocapture-ref-arg.rs +++ b/tests/codegen/move-before-nocapture-ref-arg.rs @@ -1,7 +1,6 @@ // Verify that move before the call of the function with noalias, nocapture, readonly. // #107436 //@ compile-flags: -O -//@ min-llvm-version: 17 #![crate_type = "lib"] diff --git a/tests/codegen/option-as-slice.rs b/tests/codegen/option-as-slice.rs index 14a39243607..c5b1eafaccb 100644 --- a/tests/codegen/option-as-slice.rs +++ b/tests/codegen/option-as-slice.rs @@ -1,7 +1,5 @@ //@ compile-flags: -O -Z randomize-layout=no //@ only-x86_64 -//@ ignore-llvm-version: 16.0.0 -// ^-- needs https://reviews.llvm.org/D146149 in 16.0.1 #![crate_type = "lib"] #![feature(generic_nonzero)] diff --git a/tests/codegen/option-nonzero-eq.rs b/tests/codegen/option-niche-eq.rs index f637b1aef97..8b8044e9b75 100644 --- a/tests/codegen/option-nonzero-eq.rs +++ b/tests/codegen/option-niche-eq.rs @@ -1,4 +1,5 @@ //@ compile-flags: -O -Zmerge-functions=disabled +//@ min-llvm-version: 18 #![crate_type = "lib"] #![feature(generic_nonzero)] @@ -7,9 +8,6 @@ use core::cmp::Ordering; use core::ptr::NonNull; use core::num::NonZero; -// See also tests/assembly/option-nonzero-eq.rs, for cases with `assume`s in the -// LLVM and thus don't optimize down clearly here, but do in assembly. - // CHECK-lABEL: @non_zero_eq #[no_mangle] pub fn non_zero_eq(l: Option<NonZero<u32>>, r: Option<NonZero<u32>>) -> bool { @@ -36,3 +34,42 @@ pub fn non_null_eq(l: Option<NonNull<u8>>, r: Option<NonNull<u8>>) -> bool { // CHECK-NEXT: ret i1 l == r } + +// CHECK-lABEL: @ordering_eq +#[no_mangle] +pub fn ordering_eq(l: Option<Ordering>, r: Option<Ordering>) -> bool { + // CHECK: start: + // CHECK-NEXT: icmp eq i8 + // CHECK-NEXT: ret i1 + l == r +} + +#[derive(PartialEq)] +pub enum EnumWithNiche { + A, + B, + C, + D, + E, + F, + G, +} + +// CHECK-lABEL: @niche_eq +#[no_mangle] +pub fn niche_eq(l: Option<EnumWithNiche>, r: Option<EnumWithNiche>) -> bool { + // CHECK: start: + // CHECK-NEXT: icmp eq i8 + // CHECK-NEXT: ret i1 + l == r +} + +// FIXME: This should work too +// // FIXME-CHECK-lABEL: @bool_eq +// #[no_mangle] +// pub fn bool_eq(l: Option<bool>, r: Option<bool>) -> bool { +// // FIXME-CHECK: start: +// // FIXME-CHECK-NEXT: icmp eq i8 +// // FIXME-CHECK-NEXT: ret i1 +// l == r +// } diff --git a/tests/codegen/sanitizer/cfi-emit-type-metadata-id-itanium-cxx-abi.rs b/tests/codegen/sanitizer/cfi-emit-type-metadata-id-itanium-cxx-abi.rs deleted file mode 100644 index 5f49909712f..00000000000 --- a/tests/codegen/sanitizer/cfi-emit-type-metadata-id-itanium-cxx-abi.rs +++ /dev/null @@ -1,604 +0,0 @@ -// Verifies that type metadata identifiers for functions are emitted correctly. -// -//@ needs-sanitizer-cfi -//@ compile-flags: -Clto -Cno-prepopulate-passes -Ctarget-feature=-crt-static -Zsanitizer=cfi -Copt-level=0 - -#![crate_type="lib"] -#![allow(dead_code)] -#![allow(incomplete_features)] -#![allow(unused_must_use)] -#![feature(adt_const_params, extern_types, inline_const, type_alias_impl_trait)] - -extern crate core; -use core::ffi::*; -use std::marker::PhantomData; - -// User-defined type (structure) -pub struct Struct1<T> { - member1: T, -} - -// User-defined type (enum) -pub enum Enum1<T> { - Variant1(T), -} - -// User-defined type (union) -pub union Union1<T> { - member1: std::mem::ManuallyDrop<T>, -} - -// Extern type -extern { - pub type type1; -} - -// Trait -pub trait Trait1<T> { - fn foo(&self) { } -} - -// Trait implementation -impl<T> Trait1<T> for i32 { - fn foo(&self) { } -} - -// Trait implementation -impl<T, U> Trait1<T> for Struct1<U> { - fn foo(&self) { } -} - -// impl Trait type aliases for helping with defining other types (see below) -pub type Type1 = impl Send; -pub type Type2 = impl Send; -pub type Type3 = impl Send; -pub type Type4 = impl Send; -pub type Type5 = impl Send; -pub type Type6 = impl Send; -pub type Type7 = impl Send; -pub type Type8 = impl Send; -pub type Type9 = impl Send; -pub type Type10 = impl Send; -pub type Type11 = impl Send; - -pub fn fn1<'a>() where - Type1: 'static, - Type2: 'static, - Type3: 'static, - Type4: 'static, - Type5: 'static, - Type6: 'static, - Type7: 'static, - Type8: 'static, - Type9: 'static, - Type10: 'static, - Type11: 'static, -{ - // Closure - let closure1 = || { }; - let _: Type1 = closure1; - - // Constructor - pub struct Foo(i32); - let _: Type2 = Foo; - - // Type in extern path - extern { - fn foo(); - } - let _: Type3 = foo; - - // Type in closure path - || { - pub struct Foo; - let _: Type4 = Foo; - }; - - // Type in const path - const { - pub struct Foo; - fn foo() -> Type5 { Foo } - }; - - // Type in impl path - impl<T> Struct1<T> { - fn foo(&self) { } - } - let _: Type6 = <Struct1<i32>>::foo; - - // Trait method - let _: Type7 = <dyn Trait1<i32>>::foo; - - // Trait method - let _: Type8 = <i32 as Trait1<i32>>::foo; - - // Trait method - let _: Type9 = <Struct1<i32> as Trait1<i32>>::foo; - - // Const generics - pub struct Qux<T, const N: usize>([T; N]); - let _: Type10 = Qux([0; 32]); - - // Lifetimes/regions - pub struct Quux<'a>(&'a i32); - pub struct Quuux<'a, 'b>(&'a i32, &'b Quux<'b>); - let _: Type11 = Quuux; -} - -// Helper type to make Type12 have an unique id -struct Foo(i32); - -// repr(transparent) user-defined type -#[repr(transparent)] -pub struct Type12 { - member1: (), - member2: PhantomData<i32>, - member3: Foo, -} - -// Self-referencing repr(transparent) user-defined type -#[repr(transparent)] -pub struct Type13<'a> { - member1: (), - member2: PhantomData<i32>, - member3: &'a Type13<'a>, -} - -// Helper type to make Type14 have an unique id -pub struct Bar; - -// repr(transparent) user-defined generic type -#[repr(transparent)] -pub struct Type14<T>(T); - -pub fn foo0(_: ()) { } -// CHECK: define{{.*}}foo0{{.*}}!type ![[TYPE0:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo1(_: (), _: c_void) { } -// CHECK: define{{.*}}foo1{{.*}}!type ![[TYPE1:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo2(_: (), _: c_void, _: c_void) { } -// CHECK: define{{.*}}foo2{{.*}}!type ![[TYPE2:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo3(_: *mut ()) { } -// CHECK: define{{.*}}foo3{{.*}}!type ![[TYPE3:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo4(_: *mut (), _: *mut c_void) { } -// CHECK: define{{.*}}foo4{{.*}}!type ![[TYPE4:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo5(_: *mut (), _: *mut c_void, _: *mut c_void) { } -// CHECK: define{{.*}}foo5{{.*}}!type ![[TYPE5:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo6(_: *const ()) { } -// CHECK: define{{.*}}foo6{{.*}}!type ![[TYPE6:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo7(_: *const (), _: *const c_void) { } -// CHECK: define{{.*}}foo7{{.*}}!type ![[TYPE7:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo8(_: *const (), _: *const c_void, _: *const c_void) { } -// CHECK: define{{.*}}foo8{{.*}}!type ![[TYPE8:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo9(_: bool) { } -// CHECK: define{{.*}}foo9{{.*}}!type ![[TYPE9:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo10(_: bool, _: bool) { } -// CHECK: define{{.*}}foo10{{.*}}!type ![[TYPE10:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo11(_: bool, _: bool, _: bool) { } -// CHECK: define{{.*}}foo11{{.*}}!type ![[TYPE11:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo12(_: i8) { } -// CHECK: define{{.*}}foo12{{.*}}!type ![[TYPE12:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo13(_: i8, _: i8) { } -// CHECK: define{{.*}}foo13{{.*}}!type ![[TYPE13:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo14(_: i8, _: i8, _: i8) { } -// CHECK: define{{.*}}foo14{{.*}}!type ![[TYPE14:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo15(_: i16) { } -// CHECK: define{{.*}}foo15{{.*}}!type ![[TYPE15:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo16(_: i16, _: i16) { } -// CHECK: define{{.*}}foo16{{.*}}!type ![[TYPE16:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo17(_: i16, _: i16, _: i16) { } -// CHECK: define{{.*}}foo17{{.*}}!type ![[TYPE17:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo18(_: i32) { } -// CHECK: define{{.*}}foo18{{.*}}!type ![[TYPE18:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo19(_: i32, _: i32) { } -// CHECK: define{{.*}}foo19{{.*}}!type ![[TYPE19:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo20(_: i32, _: i32, _: i32) { } -// CHECK: define{{.*}}foo20{{.*}}!type ![[TYPE20:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo21(_: i64) { } -// CHECK: define{{.*}}foo21{{.*}}!type ![[TYPE21:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo22(_: i64, _: i64) { } -// CHECK: define{{.*}}foo22{{.*}}!type ![[TYPE22:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo23(_: i64, _: i64, _: i64) { } -// CHECK: define{{.*}}foo23{{.*}}!type ![[TYPE23:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo24(_: i128) { } -// CHECK: define{{.*}}foo24{{.*}}!type ![[TYPE24:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo25(_: i128, _: i128) { } -// CHECK: define{{.*}}foo25{{.*}}!type ![[TYPE25:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo26(_: i128, _: i128, _: i128) { } -// CHECK: define{{.*}}foo26{{.*}}!type ![[TYPE26:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo27(_: isize) { } -// CHECK: define{{.*}}foo27{{.*}}!type ![[TYPE27:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo28(_: isize, _: isize) { } -// CHECK: define{{.*}}foo28{{.*}}!type ![[TYPE28:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo29(_: isize, _: isize, _: isize) { } -// CHECK: define{{.*}}foo29{{.*}}!type ![[TYPE29:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo30(_: u8) { } -// CHECK: define{{.*}}foo30{{.*}}!type ![[TYPE30:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo31(_: u8, _: u8) { } -// CHECK: define{{.*}}foo31{{.*}}!type ![[TYPE31:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo32(_: u8, _: u8, _: u8) { } -// CHECK: define{{.*}}foo32{{.*}}!type ![[TYPE32:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo33(_: u16) { } -// CHECK: define{{.*}}foo33{{.*}}!type ![[TYPE33:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo34(_: u16, _: u16) { } -// CHECK: define{{.*}}foo34{{.*}}!type ![[TYPE34:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo35(_: u16, _: u16, _: u16) { } -// CHECK: define{{.*}}foo35{{.*}}!type ![[TYPE35:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo36(_: u32) { } -// CHECK: define{{.*}}foo36{{.*}}!type ![[TYPE36:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo37(_: u32, _: u32) { } -// CHECK: define{{.*}}foo37{{.*}}!type ![[TYPE37:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo38(_: u32, _: u32, _: u32) { } -// CHECK: define{{.*}}foo38{{.*}}!type ![[TYPE38:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo39(_: u64) { } -// CHECK: define{{.*}}foo39{{.*}}!type ![[TYPE39:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo40(_: u64, _: u64) { } -// CHECK: define{{.*}}foo40{{.*}}!type ![[TYPE40:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo41(_: u64, _: u64, _: u64) { } -// CHECK: define{{.*}}foo41{{.*}}!type ![[TYPE41:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo42(_: u128) { } -// CHECK: define{{.*}}foo42{{.*}}!type ![[TYPE42:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo43(_: u128, _: u128) { } -// CHECK: define{{.*}}foo43{{.*}}!type ![[TYPE43:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo44(_: u128, _: u128, _: u128) { } -// CHECK: define{{.*}}foo44{{.*}}!type ![[TYPE44:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo45(_: usize) { } -// CHECK: define{{.*}}foo45{{.*}}!type ![[TYPE45:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo46(_: usize, _: usize) { } -// CHECK: define{{.*}}foo46{{.*}}!type ![[TYPE46:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo47(_: usize, _: usize, _: usize) { } -// CHECK: define{{.*}}foo47{{.*}}!type ![[TYPE47:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo48(_: f32) { } -// CHECK: define{{.*}}foo48{{.*}}!type ![[TYPE48:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo49(_: f32, _: f32) { } -// CHECK: define{{.*}}foo49{{.*}}!type ![[TYPE49:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo50(_: f32, _: f32, _: f32) { } -// CHECK: define{{.*}}foo50{{.*}}!type ![[TYPE50:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo51(_: f64) { } -// CHECK: define{{.*}}foo51{{.*}}!type ![[TYPE51:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo52(_: f64, _: f64) { } -// CHECK: define{{.*}}foo52{{.*}}!type ![[TYPE52:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo53(_: f64, _: f64, _: f64) { } -// CHECK: define{{.*}}foo53{{.*}}!type ![[TYPE53:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo54(_: char) { } -// CHECK: define{{.*}}foo54{{.*}}!type ![[TYPE54:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo55(_: char, _: char) { } -// CHECK: define{{.*}}foo55{{.*}}!type ![[TYPE55:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo56(_: char, _: char, _: char) { } -// CHECK: define{{.*}}foo56{{.*}}!type ![[TYPE56:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo57(_: &str) { } -// CHECK: define{{.*}}foo57{{.*}}!type ![[TYPE57:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo58(_: &str, _: &str) { } -// CHECK: define{{.*}}foo58{{.*}}!type ![[TYPE58:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo59(_: &str, _: &str, _: &str) { } -// CHECK: define{{.*}}foo59{{.*}}!type ![[TYPE59:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo60(_: (i32, i32)) { } -// CHECK: define{{.*}}foo60{{.*}}!type ![[TYPE60:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo61(_: (i32, i32), _: (i32, i32)) { } -// CHECK: define{{.*}}foo61{{.*}}!type ![[TYPE61:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo62(_: (i32, i32), _: (i32, i32), _: (i32, i32)) { } -// CHECK: define{{.*}}foo62{{.*}}!type ![[TYPE62:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo63(_: [i32; 32]) { } -// CHECK: define{{.*}}foo63{{.*}}!type ![[TYPE63:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo64(_: [i32; 32], _: [i32; 32]) { } -// CHECK: define{{.*}}foo64{{.*}}!type ![[TYPE64:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo65(_: [i32; 32], _: [i32; 32], _: [i32; 32]) { } -// CHECK: define{{.*}}foo65{{.*}}!type ![[TYPE65:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo66(_: &[i32]) { } -// CHECK: define{{.*}}foo66{{.*}}!type ![[TYPE66:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo67(_: &[i32], _: &[i32]) { } -// CHECK: define{{.*}}foo67{{.*}}!type ![[TYPE67:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo68(_: &[i32], _: &[i32], _: &[i32]) { } -// CHECK: define{{.*}}foo68{{.*}}!type ![[TYPE68:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo69(_: &Struct1::<i32>) { } -// CHECK: define{{.*}}foo69{{.*}}!type ![[TYPE69:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo70(_: &Struct1::<i32>, _: &Struct1::<i32>) { } -// CHECK: define{{.*}}foo70{{.*}}!type ![[TYPE70:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo71(_: &Struct1::<i32>, _: &Struct1::<i32>, _: &Struct1::<i32>) { } -// CHECK: define{{.*}}foo71{{.*}}!type ![[TYPE71:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo72(_: &Enum1::<i32>) { } -// CHECK: define{{.*}}foo72{{.*}}!type ![[TYPE72:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo73(_: &Enum1::<i32>, _: &Enum1::<i32>) { } -// CHECK: define{{.*}}foo73{{.*}}!type ![[TYPE73:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo74(_: &Enum1::<i32>, _: &Enum1::<i32>, _: &Enum1::<i32>) { } -// CHECK: define{{.*}}foo74{{.*}}!type ![[TYPE74:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo75(_: &Union1::<i32>) { } -// CHECK: define{{.*}}foo75{{.*}}!type ![[TYPE75:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo76(_: &Union1::<i32>, _: &Union1::<i32>) { } -// CHECK: define{{.*}}foo76{{.*}}!type ![[TYPE76:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo77(_: &Union1::<i32>, _: &Union1::<i32>, _: &Union1::<i32>) { } -// CHECK: define{{.*}}foo77{{.*}}!type ![[TYPE77:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo78(_: *mut type1) { } -// CHECK: define{{.*}}foo78{{.*}}!type ![[TYPE78:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo79(_: *mut type1, _: *mut type1) { } -// CHECK: define{{.*}}foo79{{.*}}!type ![[TYPE79:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo80(_: *mut type1, _: *mut type1, _: *mut type1) { } -// CHECK: define{{.*}}foo80{{.*}}!type ![[TYPE80:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo81(_: &mut i32) { } -// CHECK: define{{.*}}foo81{{.*}}!type ![[TYPE81:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo82(_: &mut i32, _: &i32) { } -// CHECK: define{{.*}}foo82{{.*}}!type ![[TYPE82:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo83(_: &mut i32, _: &i32, _: &i32) { } -// CHECK: define{{.*}}foo83{{.*}}!type ![[TYPE83:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo84(_: &i32) { } -// CHECK: define{{.*}}foo84{{.*}}!type ![[TYPE84:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo85(_: &i32, _: &mut i32) { } -// CHECK: define{{.*}}foo85{{.*}}!type ![[TYPE85:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo86(_: &i32, _: &mut i32, _: &mut i32) { } -// CHECK: define{{.*}}foo86{{.*}}!type ![[TYPE86:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo87(_: *mut i32) { } -// CHECK: define{{.*}}foo87{{.*}}!type ![[TYPE87:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo88(_: *mut i32, _: *const i32) { } -// CHECK: define{{.*}}foo88{{.*}}!type ![[TYPE88:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo89(_: *mut i32, _: *const i32, _: *const i32) { } -// CHECK: define{{.*}}foo89{{.*}}!type ![[TYPE89:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo90(_: *const i32) { } -// CHECK: define{{.*}}foo90{{.*}}!type ![[TYPE90:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo91(_: *const i32, _: *mut i32) { } -// CHECK: define{{.*}}foo91{{.*}}!type ![[TYPE91:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo92(_: *const i32, _: *mut i32, _: *mut i32) { } -// CHECK: define{{.*}}foo92{{.*}}!type ![[TYPE92:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo93(_: fn(i32) -> i32) { } -// CHECK: define{{.*}}foo93{{.*}}!type ![[TYPE93:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo94(_: fn(i32) -> i32, _: fn(i32) -> i32) { } -// CHECK: define{{.*}}foo94{{.*}}!type ![[TYPE94:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo95(_: fn(i32) -> i32, _: fn(i32) -> i32, _: fn(i32) -> i32) { } -// CHECK: define{{.*}}foo95{{.*}}!type ![[TYPE95:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo96(_: &dyn Fn(i32) -> i32) { } -// CHECK: define{{.*}}foo96{{.*}}!type ![[TYPE96:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo97(_: &dyn Fn(i32) -> i32, _: &dyn Fn(i32) -> i32) { } -// CHECK: define{{.*}}foo97{{.*}}!type ![[TYPE97:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo98(_: &dyn Fn(i32) -> i32, _: &dyn Fn(i32) -> i32, _: &dyn Fn(i32) -> i32) { } -// CHECK: define{{.*}}foo98{{.*}}!type ![[TYPE98:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo99(_: &dyn FnMut(i32) -> i32) { } -// CHECK: define{{.*}}foo99{{.*}}!type ![[TYPE99:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo100(_: &dyn FnMut(i32) -> i32, _: &dyn FnMut(i32) -> i32) { } -// CHECK: define{{.*}}foo100{{.*}}!type ![[TYPE100:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo101(_: &dyn FnMut(i32) -> i32, _: &dyn FnMut(i32) -> i32, _: &dyn FnMut(i32) -> i32) { } -// CHECK: define{{.*}}foo101{{.*}}!type ![[TYPE101:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo102(_: &dyn FnOnce(i32) -> i32) { } -// CHECK: define{{.*}}foo102{{.*}}!type ![[TYPE102:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo103(_: &dyn FnOnce(i32) -> i32, _: &dyn FnOnce(i32) -> i32) { } -// CHECK: define{{.*}}foo103{{.*}}!type ![[TYPE103:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo104(_: &dyn FnOnce(i32) -> i32, _: &dyn FnOnce(i32) -> i32, _: &dyn FnOnce(i32) -> i32) {} -// CHECK: define{{.*}}foo104{{.*}}!type ![[TYPE104:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo105(_: &dyn Send) { } -// CHECK: define{{.*}}foo105{{.*}}!type ![[TYPE105:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo106(_: &dyn Send, _: &dyn Send) { } -// CHECK: define{{.*}}foo106{{.*}}!type ![[TYPE106:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo107(_: &dyn Send, _: &dyn Send, _: &dyn Send) { } -// CHECK: define{{.*}}foo107{{.*}}!type ![[TYPE107:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo108(_: Type1) { } -// CHECK: define{{.*}}foo108{{.*}}!type ![[TYPE108:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo109(_: Type1, _: Type1) { } -// CHECK: define{{.*}}foo109{{.*}}!type ![[TYPE109:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo110(_: Type1, _: Type1, _: Type1) { } -// CHECK: define{{.*}}foo110{{.*}}!type ![[TYPE110:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo111(_: Type2) { } -// CHECK: define{{.*}}foo111{{.*}}!type ![[TYPE111:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo112(_: Type2, _: Type2) { } -// CHECK: define{{.*}}foo112{{.*}}!type ![[TYPE112:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo113(_: Type2, _: Type2, _: Type2) { } -// CHECK: define{{.*}}foo113{{.*}}!type ![[TYPE113:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo114(_: Type3) { } -// CHECK: define{{.*}}foo114{{.*}}!type ![[TYPE114:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo115(_: Type3, _: Type3) { } -// CHECK: define{{.*}}foo115{{.*}}!type ![[TYPE115:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo116(_: Type3, _: Type3, _: Type3) { } -// CHECK: define{{.*}}foo116{{.*}}!type ![[TYPE116:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo117(_: Type4) { } -// CHECK: define{{.*}}foo117{{.*}}!type ![[TYPE117:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo118(_: Type4, _: Type4) { } -// CHECK: define{{.*}}foo118{{.*}}!type ![[TYPE118:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo119(_: Type4, _: Type4, _: Type4) { } -// CHECK: define{{.*}}foo119{{.*}}!type ![[TYPE119:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo120(_: Type5) { } -// CHECK: define{{.*}}foo120{{.*}}!type ![[TYPE120:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo121(_: Type5, _: Type5) { } -// CHECK: define{{.*}}foo121{{.*}}!type ![[TYPE121:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo122(_: Type5, _: Type5, _: Type5) { } -// CHECK: define{{.*}}foo122{{.*}}!type ![[TYPE122:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo123(_: Type6) { } -// CHECK: define{{.*}}foo123{{.*}}!type ![[TYPE123:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo124(_: Type6, _: Type6) { } -// CHECK: define{{.*}}foo124{{.*}}!type ![[TYPE124:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo125(_: Type6, _: Type6, _: Type6) { } -// CHECK: define{{.*}}foo125{{.*}}!type ![[TYPE125:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo126(_: Type7) { } -// CHECK: define{{.*}}foo126{{.*}}!type ![[TYPE126:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo127(_: Type7, _: Type7) { } -// CHECK: define{{.*}}foo127{{.*}}!type ![[TYPE127:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo128(_: Type7, _: Type7, _: Type7) { } -// CHECK: define{{.*}}foo128{{.*}}!type ![[TYPE128:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo129(_: Type8) { } -// CHECK: define{{.*}}foo129{{.*}}!type ![[TYPE129:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo130(_: Type8, _: Type8) { } -// CHECK: define{{.*}}foo130{{.*}}!type ![[TYPE130:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo131(_: Type8, _: Type8, _: Type8) { } -// CHECK: define{{.*}}foo131{{.*}}!type ![[TYPE131:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo132(_: Type9) { } -// CHECK: define{{.*}}foo132{{.*}}!type ![[TYPE132:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo133(_: Type9, _: Type9) { } -// CHECK: define{{.*}}foo133{{.*}}!type ![[TYPE133:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo134(_: Type9, _: Type9, _: Type9) { } -// CHECK: define{{.*}}foo134{{.*}}!type ![[TYPE134:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo135(_: Type10) { } -// CHECK: define{{.*}}foo135{{.*}}!type ![[TYPE135:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo136(_: Type10, _: Type10) { } -// CHECK: define{{.*}}foo136{{.*}}!type ![[TYPE136:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo137(_: Type10, _: Type10, _: Type10) { } -// CHECK: define{{.*}}foo137{{.*}}!type ![[TYPE137:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo138(_: Type11) { } -// CHECK: define{{.*}}foo138{{.*}}!type ![[TYPE138:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo139(_: Type11, _: Type11) { } -// CHECK: define{{.*}}foo139{{.*}}!type ![[TYPE139:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo140(_: Type11, _: Type11, _: Type11) { } -// CHECK: define{{.*}}foo140{{.*}}!type ![[TYPE140:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo141(_: Type12) { } -// CHECK: define{{.*}}foo141{{.*}}!type ![[TYPE141:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo142(_: Type12, _: Type12) { } -// CHECK: define{{.*}}foo142{{.*}}!type ![[TYPE142:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo143(_: Type12, _: Type12, _: Type12) { } -// CHECK: define{{.*}}foo143{{.*}}!type ![[TYPE143:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo144(_: Type13) { } -// CHECK: define{{.*}}foo144{{.*}}!type ![[TYPE144:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo145(_: Type13, _: Type13) { } -// CHECK: define{{.*}}foo145{{.*}}!type ![[TYPE145:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo146(_: Type13, _: Type13, _: Type13) { } -// CHECK: define{{.*}}foo146{{.*}}!type ![[TYPE146:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo147(_: Type14<Bar>) { } -// CHECK: define{{.*}}foo147{{.*}}!type ![[TYPE147:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo148(_: Type14<Bar>, _: Type14<Bar>) { } -// CHECK: define{{.*}}foo148{{.*}}!type ![[TYPE148:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} -pub fn foo149(_: Type14<Bar>, _: Type14<Bar>, _: Type14<Bar>) { } -// CHECK: define{{.*}}foo149{{.*}}!type ![[TYPE149:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} - -// CHECK: ![[TYPE0]] = !{i64 0, !"_ZTSFvvE"} -// CHECK: ![[TYPE1]] = !{i64 0, !"_ZTSFvvvE"} -// CHECK: ![[TYPE2]] = !{i64 0, !"_ZTSFvvvvE"} -// CHECK: ![[TYPE3]] = !{i64 0, !"_ZTSFvPvE"} -// CHECK: ![[TYPE4]] = !{i64 0, !"_ZTSFvPvS_E"} -// CHECK: ![[TYPE5]] = !{i64 0, !"_ZTSFvPvS_S_E"} -// CHECK: ![[TYPE6]] = !{i64 0, !"_ZTSFvPKvE"} -// CHECK: ![[TYPE7]] = !{i64 0, !"_ZTSFvPKvS0_E"} -// CHECK: ![[TYPE8]] = !{i64 0, !"_ZTSFvPKvS0_S0_E"} -// CHECK: ![[TYPE9]] = !{i64 0, !"_ZTSFvbE"} -// CHECK: ![[TYPE10]] = !{i64 0, !"_ZTSFvbbE"} -// CHECK: ![[TYPE11]] = !{i64 0, !"_ZTSFvbbbE"} -// CHECK: ![[TYPE12]] = !{i64 0, !"_ZTSFvu2i8E"} -// CHECK: ![[TYPE13]] = !{i64 0, !"_ZTSFvu2i8S_E"} -// CHECK: ![[TYPE14]] = !{i64 0, !"_ZTSFvu2i8S_S_E"} -// CHECK: ![[TYPE15]] = !{i64 0, !"_ZTSFvu3i16E"} -// CHECK: ![[TYPE16]] = !{i64 0, !"_ZTSFvu3i16S_E"} -// CHECK: ![[TYPE17]] = !{i64 0, !"_ZTSFvu3i16S_S_E"} -// CHECK: ![[TYPE18]] = !{i64 0, !"_ZTSFvu3i32E"} -// CHECK: ![[TYPE19]] = !{i64 0, !"_ZTSFvu3i32S_E"} -// CHECK: ![[TYPE20]] = !{i64 0, !"_ZTSFvu3i32S_S_E"} -// CHECK: ![[TYPE21]] = !{i64 0, !"_ZTSFvu3i64E"} -// CHECK: ![[TYPE22]] = !{i64 0, !"_ZTSFvu3i64S_E"} -// CHECK: ![[TYPE23]] = !{i64 0, !"_ZTSFvu3i64S_S_E"} -// CHECK: ![[TYPE24]] = !{i64 0, !"_ZTSFvu4i128E"} -// CHECK: ![[TYPE25]] = !{i64 0, !"_ZTSFvu4i128S_E"} -// CHECK: ![[TYPE26]] = !{i64 0, !"_ZTSFvu4i128S_S_E"} -// CHECK: ![[TYPE27]] = !{i64 0, !"_ZTSFvu5isizeE"} -// CHECK: ![[TYPE28]] = !{i64 0, !"_ZTSFvu5isizeS_E"} -// CHECK: ![[TYPE29]] = !{i64 0, !"_ZTSFvu5isizeS_S_E"} -// CHECK: ![[TYPE30]] = !{i64 0, !"_ZTSFvu2u8E"} -// CHECK: ![[TYPE31]] = !{i64 0, !"_ZTSFvu2u8S_E"} -// CHECK: ![[TYPE32]] = !{i64 0, !"_ZTSFvu2u8S_S_E"} -// CHECK: ![[TYPE33]] = !{i64 0, !"_ZTSFvu3u16E"} -// CHECK: ![[TYPE34]] = !{i64 0, !"_ZTSFvu3u16S_E"} -// CHECK: ![[TYPE35]] = !{i64 0, !"_ZTSFvu3u16S_S_E"} -// CHECK: ![[TYPE36]] = !{i64 0, !"_ZTSFvu3u32E"} -// CHECK: ![[TYPE37]] = !{i64 0, !"_ZTSFvu3u32S_E"} -// CHECK: ![[TYPE38]] = !{i64 0, !"_ZTSFvu3u32S_S_E"} -// CHECK: ![[TYPE39]] = !{i64 0, !"_ZTSFvu3u64E"} -// CHECK: ![[TYPE40]] = !{i64 0, !"_ZTSFvu3u64S_E"} -// CHECK: ![[TYPE41]] = !{i64 0, !"_ZTSFvu3u64S_S_E"} -// CHECK: ![[TYPE42]] = !{i64 0, !"_ZTSFvu4u128E"} -// CHECK: ![[TYPE43]] = !{i64 0, !"_ZTSFvu4u128S_E"} -// CHECK: ![[TYPE44]] = !{i64 0, !"_ZTSFvu4u128S_S_E"} -// CHECK: ![[TYPE45]] = !{i64 0, !"_ZTSFvu5usizeE"} -// CHECK: ![[TYPE46]] = !{i64 0, !"_ZTSFvu5usizeS_E"} -// CHECK: ![[TYPE47]] = !{i64 0, !"_ZTSFvu5usizeS_S_E"} -// CHECK: ![[TYPE48]] = !{i64 0, !"_ZTSFvfE"} -// CHECK: ![[TYPE49]] = !{i64 0, !"_ZTSFvffE"} -// CHECK: ![[TYPE50]] = !{i64 0, !"_ZTSFvfffE"} -// CHECK: ![[TYPE51]] = !{i64 0, !"_ZTSFvdE"} -// CHECK: ![[TYPE52]] = !{i64 0, !"_ZTSFvddE"} -// CHECK: ![[TYPE53]] = !{i64 0, !"_ZTSFvdddE"} -// CHECK: ![[TYPE54]] = !{i64 0, !"_ZTSFvu4charE"} -// CHECK: ![[TYPE55]] = !{i64 0, !"_ZTSFvu4charS_E"} -// CHECK: ![[TYPE56]] = !{i64 0, !"_ZTSFvu4charS_S_E"} -// CHECK: ![[TYPE57]] = !{i64 0, !"_ZTSFvu3refIu3strEE"} -// CHECK: ![[TYPE58]] = !{i64 0, !"_ZTSFvu3refIu3strES0_E"} -// CHECK: ![[TYPE59]] = !{i64 0, !"_ZTSFvu3refIu3strES0_S0_E"} -// CHECK: ![[TYPE60]] = !{i64 0, !"_ZTSFvu5tupleIu3i32S_EE"} -// CHECK: ![[TYPE61]] = !{i64 0, !"_ZTSFvu5tupleIu3i32S_ES0_E"} -// CHECK: ![[TYPE62]] = !{i64 0, !"_ZTSFvu5tupleIu3i32S_ES0_S0_E"} -// CHECK: ![[TYPE63]] = !{i64 0, !"_ZTSFvA32u3i32E"} -// CHECK: ![[TYPE64]] = !{i64 0, !"_ZTSFvA32u3i32S0_E"} -// CHECK: ![[TYPE65]] = !{i64 0, !"_ZTSFvA32u3i32S0_S0_E"} -// CHECK: ![[TYPE66]] = !{i64 0, !"_ZTSFvu3refIu5sliceIu3i32EEE"} -// CHECK: ![[TYPE67]] = !{i64 0, !"_ZTSFvu3refIu5sliceIu3i32EES1_E"} -// CHECK: ![[TYPE68]] = !{i64 0, !"_ZTSFvu3refIu5sliceIu3i32EES1_S1_E"} -// CHECK: ![[TYPE69]] = !{i64 0, !"_ZTSFvu3refIu{{[0-9]+}}NtC{{[[:print:]]+}}_[[ITANIUMED_FILENAME:[0-9]{1,2}[a-z_]{1,99}]]7Struct1Iu3i32EEE"} -// CHECK: ![[TYPE70]] = !{i64 0, !"_ZTSFvu3refIu{{[0-9]+}}NtC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]7Struct1Iu3i32EES1_E"} -// CHECK: ![[TYPE71]] = !{i64 0, !"_ZTSFvu3refIu{{[0-9]+}}NtC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]7Struct1Iu3i32EES1_S1_E"} -// CHECK: ![[TYPE72]] = !{i64 0, !"_ZTSFvu3refIu{{[0-9]+}}NtC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]5Enum1Iu3i32EEE"} -// CHECK: ![[TYPE73]] = !{i64 0, !"_ZTSFvu3refIu{{[0-9]+}}NtC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]5Enum1Iu3i32EES1_E"} -// CHECK: ![[TYPE74]] = !{i64 0, !"_ZTSFvu3refIu{{[0-9]+}}NtC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]5Enum1Iu3i32EES1_S1_E"} -// CHECK: ![[TYPE75]] = !{i64 0, !"_ZTSFvu3refIu{{[0-9]+}}NtC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]6Union1Iu3i32EEE"} -// CHECK: ![[TYPE76]] = !{i64 0, !"_ZTSFvu3refIu{{[0-9]+}}NtC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]6Union1Iu3i32EES1_E"} -// CHECK: ![[TYPE77]] = !{i64 0, !"_ZTSFvu3refIu{{[0-9]+}}NtC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]6Union1Iu3i32EES1_S1_E"} -// CHECK: ![[TYPE78]] = !{i64 0, !"_ZTSFvP5type1E"} -// CHECK: ![[TYPE79]] = !{i64 0, !"_ZTSFvP5type1S0_E"} -// CHECK: ![[TYPE80]] = !{i64 0, !"_ZTSFvP5type1S0_S0_E"} -// CHECK: ![[TYPE81]] = !{i64 0, !"_ZTSFvU3mutu3refIu3i32EE"} -// CHECK: ![[TYPE82]] = !{i64 0, !"_ZTSFvU3mutu3refIu3i32ES0_E"} -// CHECK: ![[TYPE83]] = !{i64 0, !"_ZTSFvU3mutu3refIu3i32ES0_S0_E"} -// CHECK: ![[TYPE84]] = !{i64 0, !"_ZTSFvu3refIu3i32EE"} -// CHECK: ![[TYPE85]] = !{i64 0, !"_ZTSFvu3refIu3i32EU3mutS0_E"} -// CHECK: ![[TYPE86]] = !{i64 0, !"_ZTSFvu3refIu3i32EU3mutS0_S1_E"} -// CHECK: ![[TYPE87]] = !{i64 0, !"_ZTSFvPu3i32E"} -// CHECK: ![[TYPE88]] = !{i64 0, !"_ZTSFvPu3i32PKS_E"} -// CHECK: ![[TYPE89]] = !{i64 0, !"_ZTSFvPu3i32PKS_S2_E"} -// CHECK: ![[TYPE90]] = !{i64 0, !"_ZTSFvPKu3i32E"} -// CHECK: ![[TYPE91]] = !{i64 0, !"_ZTSFvPKu3i32PS_E"} -// CHECK: ![[TYPE92]] = !{i64 0, !"_ZTSFvPKu3i32PS_S2_E"} -// CHECK: ![[TYPE93]] = !{i64 0, !"_ZTSFvPFu3i32S_EE"} -// CHECK: ![[TYPE94]] = !{i64 0, !"_ZTSFvPFu3i32S_ES0_E"} -// CHECK: ![[TYPE95]] = !{i64 0, !"_ZTSFvPFu3i32S_ES0_S0_E"} -// CHECK: ![[TYPE96]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtNtC{{[[:print:]]+}}_4core3ops8function2FnIu5paramEu6regionEEE"} -// CHECK: ![[TYPE97]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtNtC{{[[:print:]]+}}_4core3ops8function2FnIu5paramEu6regionEES3_E"} -// CHECK: ![[TYPE98]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtNtC{{[[:print:]]+}}_4core3ops8function2FnIu5paramEu6regionEES3_S3_E"} -// CHECK: ![[TYPE99]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtNtC{{[[:print:]]+}}_4core3ops8function5FnMutIu5paramEu6regionEEE"} -// CHECK: ![[TYPE100]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtNtC{{[[:print:]]+}}_4core3ops8function5FnMutIu5paramEu6regionEES3_E"} -// CHECK: ![[TYPE101]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtNtC{{[[:print:]]+}}_4core3ops8function5FnMutIu5paramEu6regionEES3_S3_E"} -// CHECK: ![[TYPE102]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtNtC{{[[:print:]]+}}_4core3ops8function6FnOnceIu5paramEu6regionEEE"} -// CHECK: ![[TYPE103]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtNtC{{[[:print:]]+}}_4core3ops8function6FnOnceIu5paramEu6regionEES3_E"} -// CHECK: ![[TYPE104]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtNtC{{[[:print:]]+}}_4core3ops8function6FnOnceIu5paramEu6regionEES3_S3_E"} -// CHECK: ![[TYPE105]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtC{{[[:print:]]+}}_4core6marker4Sendu6regionEEE"} -// CHECK: ![[TYPE106]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtC{{[[:print:]]+}}_4core6marker4Sendu6regionEES2_E"} -// CHECK: ![[TYPE107]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtC{{[[:print:]]+}}_4core6marker4Sendu6regionEES2_S2_E"} -// CHECK: ![[TYPE108]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NCNvC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]3fn111{{[{}][{}]}}closure{{[}][}]}}Iu2i8PFvvEvEE"} -// CHECK: ![[TYPE109]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NCNvC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]3fn111{{[{}][{}]}}closure{{[}][}]}}Iu2i8PFvvEvES1_E"} -// CHECK: ![[TYPE110]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NCNvC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]3fn111{{[{}][{}]}}closure{{[}][}]}}Iu2i8PFvvEvES1_S1_E"} -// CHECK: ![[TYPE111]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NcNtNvC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]3fn13Foo15{{[{}][{}]}}constructor{{[}][}]}}E"} -// CHECK: ![[TYPE112]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NcNtNvC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]3fn13Foo15{{[{}][{}]}}constructor{{[}][}]}}S_E"} -// CHECK: ![[TYPE113]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NcNtNvC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]3fn13Foo15{{[{}][{}]}}constructor{{[}][}]}}S_S_E"} -// CHECK: ![[TYPE114]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NvNFNvC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]3fn110{{[{}][{}]}}extern{{[}][}]}}3fooE"} -// CHECK: ![[TYPE115]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NvNFNvC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]3fn110{{[{}][{}]}}extern{{[}][}]}}3fooS_E"} -// CHECK: ![[TYPE116]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NvNFNvC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]3fn110{{[{}][{}]}}extern{{[}][}]}}3fooS_S_E"} -// CHECK: ![[TYPE117]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NtNCNvC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]3fn1s0_11{{[{}][{}]}}closure{{[}][}]}}3FooE"} -// CHECK: ![[TYPE118]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NtNCNvC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]3fn1s0_11{{[{}][{}]}}closure{{[}][}]}}3FooS_E"} -// CHECK: ![[TYPE119]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NtNCNvC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]3fn1s0_11{{[{}][{}]}}closure{{[}][}]}}3FooS_S_E"} -// CHECK: ![[TYPE120]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NtNkNvC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]3fn112{{[{}][{}]}}constant{{[}][}]}}3FooE"} -// CHECK: ![[TYPE121]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NtNkNvC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]3fn112{{[{}][{}]}}constant{{[}][}]}}3FooS_E"} -// CHECK: ![[TYPE122]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NtNkNvC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]3fn112{{[{}][{}]}}constant{{[}][}]}}3FooS_S_E"} -// CHECK: ![[TYPE123]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NvNINvC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]3fn18{{[{}][{}]}}impl{{[}][}]}}3fooIu3i32EE"} -// CHECK: ![[TYPE124]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NvNINvC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]3fn18{{[{}][{}]}}impl{{[}][}]}}3fooIu3i32ES0_E"} -// CHECK: ![[TYPE125]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NvNINvC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]3fn18{{[{}][{}]}}impl{{[}][}]}}3fooIu3i32ES0_S0_E"} -// CHECK: ![[TYPE126]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NvNtC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]6Trait13fooIu3dynIu{{[0-9]+}}NtC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]6Trait1Iu5paramEu6regionEu3i32EE"} -// CHECK: ![[TYPE127]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NvNtC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]6Trait13fooIu3dynIu{{[0-9]+}}NtC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]6Trait1Iu5paramEu6regionEu3i32ES4_E"} -// CHECK: ![[TYPE128]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NvNtC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]6Trait13fooIu3dynIu{{[0-9]+}}NtC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]6Trait1Iu5paramEu6regionEu3i32ES4_S4_E"} -// CHECK: ![[TYPE129]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NvNtC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]6Trait13fooIu3i32S_EE"} -// CHECK: ![[TYPE130]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NvNtC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]6Trait13fooIu3i32S_ES0_E"} -// CHECK: ![[TYPE131]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NvNtC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]6Trait13fooIu3i32S_ES0_S0_E"} -// CHECK: ![[TYPE132]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NvNtC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]6Trait13fooIu{{[0-9]+}}NtC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]7Struct1Iu3i32ES_EE"} -// CHECK: ![[TYPE133]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NvNtC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]6Trait13fooIu{{[0-9]+}}NtC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]7Struct1Iu3i32ES_ES1_E"} -// CHECK: ![[TYPE134]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NvNtC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]6Trait13fooIu{{[0-9]+}}NtC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]7Struct1Iu3i32ES_ES1_S1_E"} -// CHECK: ![[TYPE135]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NtNvC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]3fn13QuxIu3i32Lu5usize32EEE"} -// CHECK: ![[TYPE136]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NtNvC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]3fn13QuxIu3i32Lu5usize32EES2_E"} -// CHECK: ![[TYPE137]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NtNvC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]3fn13QuxIu3i32Lu5usize32EES2_S2_E"} -// CHECK: ![[TYPE138]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NcNtNvC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]3fn15Quuux15{{[{}][{}]}}constructor{{[}][}]}}Iu6regionS_EE"} -// CHECK: ![[TYPE139]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NcNtNvC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]3fn15Quuux15{{[{}][{}]}}constructor{{[}][}]}}Iu6regionS_ES0_E"} -// CHECK: ![[TYPE140]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NcNtNvC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]3fn15Quuux15{{[{}][{}]}}constructor{{[}][}]}}Iu6regionS_ES0_S0_E"} -// CHECK: ![[TYPE141]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NtC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]3FooE"} -// CHECK: ![[TYPE142]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NtC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]3FooS_E"} -// CHECK: ![[TYPE143]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NtC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]3FooS_S_E"} -// CHECK: ![[TYPE144]] = !{i64 0, !"_ZTSFvu3refIvEE"} -// CHECK: ![[TYPE145]] = !{i64 0, !"_ZTSFvu3refIvES_E"} -// CHECK: ![[TYPE146]] = !{i64 0, !"_ZTSFvu3refIvES_S_E"} -// CHECK: ![[TYPE147]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NtC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]3BarE"} -// CHECK: ![[TYPE148]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NtC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]3BarS_E"} -// CHECK: ![[TYPE149]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NtC{{[[:print:]]+}}_[[ITANIUMED_FILENAME]]3BarS_S_E"} diff --git a/tests/codegen/sanitizer/cfi-add-canonical-jump-tables-flag.rs b/tests/codegen/sanitizer/cfi/add-canonical-jump-tables-flag.rs index f122fbdc086..f122fbdc086 100644 --- a/tests/codegen/sanitizer/cfi-add-canonical-jump-tables-flag.rs +++ b/tests/codegen/sanitizer/cfi/add-canonical-jump-tables-flag.rs diff --git a/tests/codegen/sanitizer/cfi-add-enable-split-lto-unit-flag.rs b/tests/codegen/sanitizer/cfi/add-enable-split-lto-unit-flag.rs index 05eea13c6ee..05eea13c6ee 100644 --- a/tests/codegen/sanitizer/cfi-add-enable-split-lto-unit-flag.rs +++ b/tests/codegen/sanitizer/cfi/add-enable-split-lto-unit-flag.rs diff --git a/tests/codegen/sanitizer/cfi-emit-type-checks-attr-no-sanitize.rs b/tests/codegen/sanitizer/cfi/emit-type-checks-attr-no-sanitize.rs index 9e0cc346afb..9f72de2ebcc 100644 --- a/tests/codegen/sanitizer/cfi-emit-type-checks-attr-no-sanitize.rs +++ b/tests/codegen/sanitizer/cfi/emit-type-checks-attr-no-sanitize.rs @@ -8,7 +8,7 @@ #[no_sanitize(cfi)] pub fn foo(f: fn(i32) -> i32, arg: i32) -> i32 { - // CHECK-LABEL: cfi_emit_type_checks_attr_no_sanitize::foo + // CHECK-LABEL: emit_type_checks_attr_no_sanitize::foo // CHECK: Function Attrs: {{.*}} // CHECK-LABEL: define{{.*}}foo{{.*}}!type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} // CHECK: start: diff --git a/tests/codegen/sanitizer/cfi-emit-type-checks.rs b/tests/codegen/sanitizer/cfi/emit-type-checks.rs index 6ec6f0e5476..6ec6f0e5476 100644 --- a/tests/codegen/sanitizer/cfi-emit-type-checks.rs +++ b/tests/codegen/sanitizer/cfi/emit-type-checks.rs diff --git a/tests/codegen/sanitizer/cfi-emit-type-metadata-attr-cfi-encoding.rs b/tests/codegen/sanitizer/cfi/emit-type-metadata-attr-cfi-encoding.rs index be4af9b7962..be4af9b7962 100644 --- a/tests/codegen/sanitizer/cfi-emit-type-metadata-attr-cfi-encoding.rs +++ b/tests/codegen/sanitizer/cfi/emit-type-metadata-attr-cfi-encoding.rs diff --git a/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-const-generics.rs b/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-const-generics.rs new file mode 100644 index 00000000000..6608caca8af --- /dev/null +++ b/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-const-generics.rs @@ -0,0 +1,30 @@ +// Verifies that type metadata identifiers for functions are emitted correctly +// for const generics. +// +//@ needs-sanitizer-cfi +//@ compile-flags: -Clto -Cno-prepopulate-passes -Ctarget-feature=-crt-static -Zsanitizer=cfi -Copt-level=0 + +#![crate_type="lib"] +#![feature(type_alias_impl_trait)] + +extern crate core; + +pub type Type1 = impl Send; + +pub fn foo() where + Type1: 'static, +{ + pub struct Foo<T, const N: usize>([T; N]); + let _: Type1 = Foo([0; 32]); +} + +pub fn foo1(_: Type1) { } +// CHECK: define{{.*}}4foo1{{.*}}!type ![[TYPE1:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo2(_: Type1, _: Type1) { } +// CHECK: define{{.*}}4foo2{{.*}}!type ![[TYPE2:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo3(_: Type1, _: Type1, _: Type1) { } +// CHECK: define{{.*}}4foo3{{.*}}!type ![[TYPE3:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} + +// CHECK: ![[TYPE1]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NtNvC{{[[:print:]]+}}_{{[[:print:]]+}}3foo3FooIu3i32Lu5usize32EEE"} +// CHECK: ![[TYPE2]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NtNvC{{[[:print:]]+}}_{{[[:print:]]+}}3foo3FooIu3i32Lu5usize32EES2_E"} +// CHECK: ![[TYPE3]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NtNvC{{[[:print:]]+}}_{{[[:print:]]+}}3foo3FooIu3i32Lu5usize32EES2_S2_E"} diff --git a/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-function-types.rs b/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-function-types.rs new file mode 100644 index 00000000000..ab3d339989b --- /dev/null +++ b/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-function-types.rs @@ -0,0 +1,45 @@ +// Verifies that type metadata identifiers for functions are emitted correctly +// for function types. +// +//@ needs-sanitizer-cfi +//@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static + +#![crate_type="lib"] + +pub fn foo1(_: fn(i32) -> i32) { } +// CHECK: define{{.*}}4foo1{{.*}}!type ![[TYPE1:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo2(_: fn(i32) -> i32, _: fn(i32) -> i32) { } +// CHECK: define{{.*}}4foo2{{.*}}!type ![[TYPE2:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo3(_: fn(i32) -> i32, _: fn(i32) -> i32, _: fn(i32) -> i32) { } +// CHECK: define{{.*}}4foo3{{.*}}!type ![[TYPE3:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo4(_: &dyn Fn(i32) -> i32) { } +// CHECK: define{{.*}}4foo4{{.*}}!type ![[TYPE4:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo5(_: &dyn Fn(i32) -> i32, _: &dyn Fn(i32) -> i32) { } +// CHECK: define{{.*}}4foo5{{.*}}!type ![[TYPE5:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo6(_: &dyn Fn(i32) -> i32, _: &dyn Fn(i32) -> i32, _: &dyn Fn(i32) -> i32) { } +// CHECK: define{{.*}}4foo6{{.*}}!type ![[TYPE6:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo7(_: &dyn FnMut(i32) -> i32) { } +// CHECK: define{{.*}}4foo7{{.*}}!type ![[TYPE7:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo8(_: &dyn FnMut(i32) -> i32, _: &dyn FnMut(i32) -> i32) { } +// CHECK: define{{.*}}4foo8{{.*}}!type ![[TYPE8:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo9(_: &dyn FnMut(i32) -> i32, _: &dyn FnMut(i32) -> i32, _: &dyn FnMut(i32) -> i32) { } +// CHECK: define{{.*}}4foo9{{.*}}!type ![[TYPE9:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo10(_: &dyn FnOnce(i32) -> i32) { } +// CHECK: define{{.*}}5foo10{{.*}}!type ![[TYPE10:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo11(_: &dyn FnOnce(i32) -> i32, _: &dyn FnOnce(i32) -> i32) { } +// CHECK: define{{.*}}5foo11{{.*}}!type ![[TYPE11:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo12(_: &dyn FnOnce(i32) -> i32, _: &dyn FnOnce(i32) -> i32, _: &dyn FnOnce(i32) -> i32) {} +// CHECK: define{{.*}}5foo12{{.*}}!type ![[TYPE12:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} + +// CHECK: ![[TYPE1]] = !{i64 0, !"_ZTSFvPFu3i32S_EE"} +// CHECK: ![[TYPE2]] = !{i64 0, !"_ZTSFvPFu3i32S_ES0_E"} +// CHECK: ![[TYPE3]] = !{i64 0, !"_ZTSFvPFu3i32S_ES0_S0_E"} +// CHECK: ![[TYPE4]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtNtC{{[[:print:]]+}}_4core3ops8function2FnIu5paramEu6regionEEE"} +// CHECK: ![[TYPE5]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtNtC{{[[:print:]]+}}_4core3ops8function2FnIu5paramEu6regionEES3_E"} +// CHECK: ![[TYPE6]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtNtC{{[[:print:]]+}}_4core3ops8function2FnIu5paramEu6regionEES3_S3_E"} +// CHECK: ![[TYPE7]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtNtC{{[[:print:]]+}}_4core3ops8function5FnMutIu5paramEu6regionEEE"} +// CHECK: ![[TYPE8]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtNtC{{[[:print:]]+}}_4core3ops8function5FnMutIu5paramEu6regionEES3_E"} +// CHECK: ![[TYPE9]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtNtC{{[[:print:]]+}}_4core3ops8function5FnMutIu5paramEu6regionEES3_S3_E"} +// CHECK: ![[TYPE10]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtNtC{{[[:print:]]+}}_4core3ops8function6FnOnceIu5paramEu6regionEEE"} +// CHECK: ![[TYPE11]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtNtC{{[[:print:]]+}}_4core3ops8function6FnOnceIu5paramEu6regionEES3_E"} +// CHECK: ![[TYPE12]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtNtC{{[[:print:]]+}}_4core3ops8function6FnOnceIu5paramEu6regionEES3_S3_E"} diff --git a/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-lifetimes.rs b/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-lifetimes.rs new file mode 100644 index 00000000000..4d08c0c3039 --- /dev/null +++ b/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-lifetimes.rs @@ -0,0 +1,27 @@ +// Verifies that type metadata identifiers for functions are emitted correctly +// for lifetimes/regions. +// +//@ needs-sanitizer-cfi +//@ compile-flags: -Clto -Cno-prepopulate-passes -Ctarget-feature=-crt-static -Zsanitizer=cfi -Copt-level=0 + +#![crate_type="lib"] +#![feature(type_alias_impl_trait)] + +extern crate core; + +pub type Type1 = impl Send; + +pub fn foo<'a>() where + Type1: 'static, +{ + pub struct Foo<'a>(&'a i32); + pub struct Bar<'a, 'b>(&'a i32, &'b Foo<'b>); + let _: Type1 = Bar; +} + +pub fn foo1(_: Type1) { } +// CHECK: define{{.*}}4foo1{{.*}}!type ![[TYPE1:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo2(_: Type1, _: Type1) { } +// CHECK: define{{.*}}4foo2{{.*}}!type ![[TYPE2:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo3(_: Type1, _: Type1, _: Type1) { } +// CHECK: define{{.*}}4foo3{{.*}}!type ![[TYPE3:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} diff --git a/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-paths.rs b/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-paths.rs new file mode 100644 index 00000000000..ca781a99296 --- /dev/null +++ b/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-paths.rs @@ -0,0 +1,88 @@ +// Verifies that type metadata identifiers for functions are emitted correctly +// for paths. +// +//@ needs-sanitizer-cfi +//@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static + +#![crate_type="lib"] +#![feature(inline_const, type_alias_impl_trait)] + +extern crate core; + +pub type Type1 = impl Send; +pub type Type2 = impl Send; +pub type Type3 = impl Send; +pub type Type4 = impl Send; + +pub fn foo() where + Type1: 'static, + Type2: 'static, + Type3: 'static, + Type4: 'static, +{ + // Type in extern path + extern { + fn bar(); + } + let _: Type1 = bar; + + // Type in closure path + || { + pub struct Foo; + let _: Type2 = Foo; + }; + + // Type in const path + const { + pub struct Foo; + fn bar() -> Type3 { Foo } + }; + + + // Type in impl path + struct Foo; + impl Foo { + fn bar(&self) { } + } + let _: Type4 = <Foo>::bar; +} + +// Force arguments to be passed by using a reference. Otherwise, they may end up PassMode::Ignore + +pub fn foo1(_: &Type1) { } +// CHECK: define{{.*}}4foo1{{.*}}!type ![[TYPE1:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo2(_: &Type1, _: &Type1) { } +// CHECK: define{{.*}}4foo2{{.*}}!type ![[TYPE2:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo3(_: &Type1, _: &Type1, _: &Type1) { } +// CHECK: define{{.*}}4foo3{{.*}}!type ![[TYPE3:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo4(_: &Type2) { } +// CHECK: define{{.*}}4foo4{{.*}}!type ![[TYPE4:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo5(_: &Type2, _: &Type2) { } +// CHECK: define{{.*}}4foo5{{.*}}!type ![[TYPE5:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo6(_: &Type2, _: &Type2, _: &Type2) { } +// CHECK: define{{.*}}4foo6{{.*}}!type ![[TYPE6:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo7(_: &Type3) { } +// CHECK: define{{.*}}4foo7{{.*}}!type ![[TYPE7:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo8(_: &Type3, _: &Type3) { } +// CHECK: define{{.*}}4foo8{{.*}}!type ![[TYPE8:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo9(_: &Type3, _: &Type3, _: &Type3) { } +// CHECK: define{{.*}}4foo9{{.*}}!type ![[TYPE9:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo10(_: &Type4) { } +// CHECK: define{{.*}}5foo10{{.*}}!type ![[TYPE10:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo11(_: &Type4, _: &Type4) { } +// CHECK: define{{.*}}5foo11{{.*}}!type ![[TYPE11:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo12(_: &Type4, _: &Type4, _: &Type4) { } +// CHECK: define{{.*}}5foo12{{.*}}!type ![[TYPE12:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} + +// CHECK: ![[TYPE1]] = !{i64 0, !"_ZTSFvu3refIu{{[0-9]+}}NvNFNvC{{[[:print:]]+}}_{{[[:print:]]+}}3foo10{{[{}][{}]}}extern{{[}][}]}}3barEE"} +// CHECK: ![[TYPE2]] = !{i64 0, !"_ZTSFvu3refIu{{[0-9]+}}NvNFNvC{{[[:print:]]+}}_{{[[:print:]]+}}3foo10{{[{}][{}]}}extern{{[}][}]}}3barES0_E"} +// CHECK: ![[TYPE3]] = !{i64 0, !"_ZTSFvu3refIu{{[0-9]+}}NvNFNvC{{[[:print:]]+}}_{{[[:print:]]+}}3foo10{{[{}][{}]}}extern{{[}][}]}}3barES0_S0_E"} +// CHECK: ![[TYPE4]] = !{i64 0, !"_ZTSFvu3refIu{{[0-9]+}}NtNCNvC{{[[:print:]]+}}_{{[[:print:]]+}}3foo11{{[{}][{}]}}closure{{[}][}]}}3FooEE"} +// CHECK: ![[TYPE5]] = !{i64 0, !"_ZTSFvu3refIu{{[0-9]+}}NtNCNvC{{[[:print:]]+}}_{{[[:print:]]+}}3foo11{{[{}][{}]}}closure{{[}][}]}}3FooES0_E"} +// CHECK: ![[TYPE6]] = !{i64 0, !"_ZTSFvu3refIu{{[0-9]+}}NtNCNvC{{[[:print:]]+}}_{{[[:print:]]+}}3foo11{{[{}][{}]}}closure{{[}][}]}}3FooES0_S0_E"} +// CHECK: ![[TYPE7]] = !{i64 0, !"_ZTSFvu3refIu{{[0-9]+}}NtNkNvC{{[[:print:]]+}}_{{[[:print:]]+}}3foo12{{[{}][{}]}}constant{{[}][}]}}3FooEE"} +// CHECK: ![[TYPE8]] = !{i64 0, !"_ZTSFvu3refIu{{[0-9]+}}NtNkNvC{{[[:print:]]+}}_{{[[:print:]]+}}3foo12{{[{}][{}]}}constant{{[}][}]}}3FooES0_E"} +// CHECK: ![[TYPE9]] = !{i64 0, !"_ZTSFvu3refIu{{[0-9]+}}NtNkNvC{{[[:print:]]+}}_{{[[:print:]]+}}3foo12{{[{}][{}]}}constant{{[}][}]}}3FooES0_S0_E"} +// CHECK: ![[TYPE10]] = !{i64 0, !"_ZTSFvu3refIu{{[0-9]+}}NvNINvC{{[[:print:]]+}}_{{[[:print:]]+}}3foo8{{[{}][{}]}}impl{{[}][}]}}3barEE"} +// CHECK: ![[TYPE11]] = !{i64 0, !"_ZTSFvu3refIu{{[0-9]+}}NvNINvC{{[[:print:]]+}}_{{[[:print:]]+}}3foo8{{[{}][{}]}}impl{{[}][}]}}3barES0_E"} +// CHECK: ![[TYPE12]] = !{i64 0, !"_ZTSFvu3refIu{{[0-9]+}}NvNINvC{{[[:print:]]+}}_{{[[:print:]]+}}3foo8{{[{}][{}]}}impl{{[}][}]}}3barES0_S0_E"} diff --git a/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-pointer-types.rs b/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-pointer-types.rs new file mode 100644 index 00000000000..6ad6f3ac348 --- /dev/null +++ b/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-pointer-types.rs @@ -0,0 +1,54 @@ +// Verifies that type metadata identifiers for functions are emitted correctly +// for pointer types. +// +//@ needs-sanitizer-cfi +//@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static + +#![crate_type="lib"] + +pub fn foo1(_: &mut i32) { } +// CHECK: define{{.*}}4foo1{{.*}}!type ![[TYPE1:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo2(_: &mut i32, _: &i32) { } +// CHECK: define{{.*}}4foo2{{.*}}!type ![[TYPE2:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo3(_: &mut i32, _: &i32, _: &i32) { } +// CHECK: define{{.*}}4foo3{{.*}}!type ![[TYPE3:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo4(_: &i32) { } +// CHECK: define{{.*}}4foo4{{.*}}!type ![[TYPE4:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo5(_: &i32, _: &mut i32) { } +// CHECK: define{{.*}}4foo5{{.*}}!type ![[TYPE5:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo6(_: &i32, _: &mut i32, _: &mut i32) { } +// CHECK: define{{.*}}4foo6{{.*}}!type ![[TYPE6:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo7(_: *mut i32) { } +// CHECK: define{{.*}}4foo7{{.*}}!type ![[TYPE7:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo8(_: *mut i32, _: *const i32) { } +// CHECK: define{{.*}}4foo8{{.*}}!type ![[TYPE8:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo9(_: *mut i32, _: *const i32, _: *const i32) { } +// CHECK: define{{.*}}4foo9{{.*}}!type ![[TYPE9:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo10(_: *const i32) { } +// CHECK: define{{.*}}5foo10{{.*}}!type ![[TYPE10:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo11(_: *const i32, _: *mut i32) { } +// CHECK: define{{.*}}5foo11{{.*}}!type ![[TYPE11:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo12(_: *const i32, _: *mut i32, _: *mut i32) { } +// CHECK: define{{.*}}5foo12{{.*}}!type ![[TYPE12:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo13(_: fn(i32) -> i32) { } +// CHECK: define{{.*}}5foo13{{.*}}!type ![[TYPE13:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo14(_: fn(i32) -> i32, _: fn(i32) -> i32) { } +// CHECK: define{{.*}}5foo14{{.*}}!type ![[TYPE14:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo15(_: fn(i32) -> i32, _: fn(i32) -> i32, _: fn(i32) -> i32) { } +// CHECK: define{{.*}}5foo15{{.*}}!type ![[TYPE15:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} + +// CHECK: ![[TYPE1]] = !{i64 0, !"_ZTSFvU3mutu3refIu3i32EE"} +// CHECK: ![[TYPE2]] = !{i64 0, !"_ZTSFvU3mutu3refIu3i32ES0_E"} +// CHECK: ![[TYPE3]] = !{i64 0, !"_ZTSFvU3mutu3refIu3i32ES0_S0_E"} +// CHECK: ![[TYPE4]] = !{i64 0, !"_ZTSFvu3refIu3i32EE"} +// CHECK: ![[TYPE5]] = !{i64 0, !"_ZTSFvu3refIu3i32EU3mutS0_E"} +// CHECK: ![[TYPE6]] = !{i64 0, !"_ZTSFvu3refIu3i32EU3mutS0_S1_E"} +// CHECK: ![[TYPE7]] = !{i64 0, !"_ZTSFvPu3i32E"} +// CHECK: ![[TYPE8]] = !{i64 0, !"_ZTSFvPu3i32PKS_E"} +// CHECK: ![[TYPE9]] = !{i64 0, !"_ZTSFvPu3i32PKS_S2_E"} +// CHECK: ![[TYPE10]] = !{i64 0, !"_ZTSFvPKu3i32E"} +// CHECK: ![[TYPE11]] = !{i64 0, !"_ZTSFvPKu3i32PS_E"} +// CHECK: ![[TYPE12]] = !{i64 0, !"_ZTSFvPKu3i32PS_S2_E"} +// CHECK: ![[TYPE13]] = !{i64 0, !"_ZTSFvPFu3i32S_EE"} +// CHECK: ![[TYPE14]] = !{i64 0, !"_ZTSFvPFu3i32S_ES0_E"} +// CHECK: ![[TYPE15]] = !{i64 0, !"_ZTSFvPFu3i32S_ES0_S0_E"} diff --git a/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-primitive-types.rs b/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-primitive-types.rs new file mode 100644 index 00000000000..38f507856bd --- /dev/null +++ b/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-primitive-types.rs @@ -0,0 +1,190 @@ +// Verifies that type metadata identifiers for functions are emitted correctly +// for primitive types. +// +//@ needs-sanitizer-cfi +//@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static + +#![crate_type="lib"] + +extern crate core; +use core::ffi::*; + +pub fn foo1(_: ()) { } +// CHECK: define{{.*}}4foo1{{.*}}!type ![[TYPE1:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo2(_: (), _: c_void) { } +// CHECK: define{{.*}}4foo2{{.*}}!type ![[TYPE1:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo3(_: (), _: c_void, _: c_void) { } +// CHECK: define{{.*}}4foo3{{.*}}!type ![[TYPE2:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo4(_: *mut ()) { } +// CHECK: define{{.*}}4foo4{{.*}}!type ![[TYPE4:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo5(_: *mut (), _: *mut c_void) { } +// CHECK: define{{.*}}4foo5{{.*}}!type ![[TYPE5:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo6(_: *mut (), _: *mut c_void, _: *mut c_void) { } +// CHECK: define{{.*}}4foo6{{.*}}!type ![[TYPE6:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo7(_: *const ()) { } +// CHECK: define{{.*}}4foo7{{.*}}!type ![[TYPE7:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo8(_: *const (), _: *const c_void) { } +// CHECK: define{{.*}}4foo8{{.*}}!type ![[TYPE8:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo9(_: *const (), _: *const c_void, _: *const c_void) { } +// CHECK: define{{.*}}4foo9{{.*}}!type ![[TYPE9:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo10(_: bool) { } +// CHECK: define{{.*}}5foo10{{.*}}!type ![[TYPE10:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo11(_: bool, _: bool) { } +// CHECK: define{{.*}}5foo11{{.*}}!type ![[TYPE11:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo12(_: bool, _: bool, _: bool) { } +// CHECK: define{{.*}}5foo12{{.*}}!type ![[TYPE12:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo13(_: i8) { } +// CHECK: define{{.*}}5foo13{{.*}}!type ![[TYPE13:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo14(_: i8, _: i8) { } +// CHECK: define{{.*}}5foo14{{.*}}!type ![[TYPE14:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo15(_: i8, _: i8, _: i8) { } +// CHECK: define{{.*}}5foo15{{.*}}!type ![[TYPE15:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo16(_: i16) { } +// CHECK: define{{.*}}5foo16{{.*}}!type ![[TYPE16:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo17(_: i16, _: i16) { } +// CHECK: define{{.*}}5foo17{{.*}}!type ![[TYPE17:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo18(_: i16, _: i16, _: i16) { } +// CHECK: define{{.*}}5foo18{{.*}}!type ![[TYPE18:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo19(_: i32) { } +// CHECK: define{{.*}}5foo19{{.*}}!type ![[TYPE19:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo20(_: i32, _: i32) { } +// CHECK: define{{.*}}5foo20{{.*}}!type ![[TYPE20:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo21(_: i32, _: i32, _: i32) { } +// CHECK: define{{.*}}5foo21{{.*}}!type ![[TYPE21:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo22(_: i64) { } +// CHECK: define{{.*}}5foo22{{.*}}!type ![[TYPE22:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo23(_: i64, _: i64) { } +// CHECK: define{{.*}}5foo23{{.*}}!type ![[TYPE23:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo24(_: i64, _: i64, _: i64) { } +// CHECK: define{{.*}}5foo24{{.*}}!type ![[TYPE24:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo25(_: i128) { } +// CHECK: define{{.*}}5foo25{{.*}}!type ![[TYPE25:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo26(_: i128, _: i128) { } +// CHECK: define{{.*}}5foo26{{.*}}!type ![[TYPE26:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo27(_: i128, _: i128, _: i128) { } +// CHECK: define{{.*}}5foo27{{.*}}!type ![[TYPE27:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo28(_: isize) { } +// CHECK: define{{.*}}5foo28{{.*}}!type ![[TYPE28:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo29(_: isize, _: isize) { } +// CHECK: define{{.*}}5foo29{{.*}}!type ![[TYPE29:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo30(_: isize, _: isize, _: isize) { } +// CHECK: define{{.*}}5foo30{{.*}}!type ![[TYPE30:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo31(_: u8) { } +// CHECK: define{{.*}}5foo31{{.*}}!type ![[TYPE31:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo32(_: u8, _: u8) { } +// CHECK: define{{.*}}5foo32{{.*}}!type ![[TYPE32:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo33(_: u8, _: u8, _: u8) { } +// CHECK: define{{.*}}5foo33{{.*}}!type ![[TYPE33:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo34(_: u16) { } +// CHECK: define{{.*}}5foo34{{.*}}!type ![[TYPE34:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo35(_: u16, _: u16) { } +// CHECK: define{{.*}}5foo35{{.*}}!type ![[TYPE35:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo36(_: u16, _: u16, _: u16) { } +// CHECK: define{{.*}}5foo36{{.*}}!type ![[TYPE36:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo37(_: u32) { } +// CHECK: define{{.*}}5foo37{{.*}}!type ![[TYPE37:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo38(_: u32, _: u32) { } +// CHECK: define{{.*}}5foo38{{.*}}!type ![[TYPE38:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo39(_: u32, _: u32, _: u32) { } +// CHECK: define{{.*}}5foo39{{.*}}!type ![[TYPE39:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo40(_: u64) { } +// CHECK: define{{.*}}5foo40{{.*}}!type ![[TYPE40:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo41(_: u64, _: u64) { } +// CHECK: define{{.*}}5foo41{{.*}}!type ![[TYPE41:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo42(_: u64, _: u64, _: u64) { } +// CHECK: define{{.*}}5foo42{{.*}}!type ![[TYPE42:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo43(_: u128) { } +// CHECK: define{{.*}}5foo43{{.*}}!type ![[TYPE43:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo44(_: u128, _: u128) { } +// CHECK: define{{.*}}5foo44{{.*}}!type ![[TYPE44:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo45(_: u128, _: u128, _: u128) { } +// CHECK: define{{.*}}5foo45{{.*}}!type ![[TYPE45:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo46(_: usize) { } +// CHECK: define{{.*}}5foo46{{.*}}!type ![[TYPE46:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo47(_: usize, _: usize) { } +// CHECK: define{{.*}}5foo47{{.*}}!type ![[TYPE47:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo48(_: usize, _: usize, _: usize) { } +// CHECK: define{{.*}}5foo48{{.*}}!type ![[TYPE48:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo49(_: f32) { } +// CHECK: define{{.*}}5foo49{{.*}}!type ![[TYPE49:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo50(_: f32, _: f32) { } +// CHECK: define{{.*}}5foo50{{.*}}!type ![[TYPE50:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo51(_: f32, _: f32, _: f32) { } +// CHECK: define{{.*}}5foo51{{.*}}!type ![[TYPE51:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo52(_: f64) { } +// CHECK: define{{.*}}5foo52{{.*}}!type ![[TYPE52:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo53(_: f64, _: f64) { } +// CHECK: define{{.*}}5foo53{{.*}}!type ![[TYPE53:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo54(_: f64, _: f64, _: f64) { } +// CHECK: define{{.*}}5foo54{{.*}}!type ![[TYPE54:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo55(_: char) { } +// CHECK: define{{.*}}5foo55{{.*}}!type ![[TYPE55:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo56(_: char, _: char) { } +// CHECK: define{{.*}}5foo56{{.*}}!type ![[TYPE56:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo57(_: char, _: char, _: char) { } +// CHECK: define{{.*}}5foo57{{.*}}!type ![[TYPE57:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo58(_: &str) { } +// CHECK: define{{.*}}5foo58{{.*}}!type ![[TYPE58:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo59(_: &str, _: &str) { } +// CHECK: define{{.*}}5foo59{{.*}}!type ![[TYPE59:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo60(_: &str, _: &str, _: &str) { } +// CHECK: define{{.*}}5foo60{{.*}}!type ![[TYPE60:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} + +// CHECK: ![[TYPE1]] = !{i64 0, !"_ZTSFvvE"} +// CHECK: ![[TYPE4]] = !{i64 0, !"_ZTSFvPvE"} +// CHECK: ![[TYPE5]] = !{i64 0, !"_ZTSFvPvS_E"} +// CHECK: ![[TYPE6]] = !{i64 0, !"_ZTSFvPvS_S_E"} +// CHECK: ![[TYPE7]] = !{i64 0, !"_ZTSFvPKvE"} +// CHECK: ![[TYPE8]] = !{i64 0, !"_ZTSFvPKvS0_E"} +// CHECK: ![[TYPE9]] = !{i64 0, !"_ZTSFvPKvS0_S0_E"} +// CHECK: ![[TYPE10]] = !{i64 0, !"_ZTSFvbE"} +// CHECK: ![[TYPE11]] = !{i64 0, !"_ZTSFvbbE"} +// CHECK: ![[TYPE12]] = !{i64 0, !"_ZTSFvbbbE"} +// CHECK: ![[TYPE13]] = !{i64 0, !"_ZTSFvu2i8E"} +// CHECK: ![[TYPE14]] = !{i64 0, !"_ZTSFvu2i8S_E"} +// CHECK: ![[TYPE15]] = !{i64 0, !"_ZTSFvu2i8S_S_E"} +// CHECK: ![[TYPE16]] = !{i64 0, !"_ZTSFvu3i16E"} +// CHECK: ![[TYPE17]] = !{i64 0, !"_ZTSFvu3i16S_E"} +// CHECK: ![[TYPE18]] = !{i64 0, !"_ZTSFvu3i16S_S_E"} +// CHECK: ![[TYPE19]] = !{i64 0, !"_ZTSFvu3i32E"} +// CHECK: ![[TYPE20]] = !{i64 0, !"_ZTSFvu3i32S_E"} +// CHECK: ![[TYPE21]] = !{i64 0, !"_ZTSFvu3i32S_S_E"} +// CHECK: ![[TYPE22]] = !{i64 0, !"_ZTSFvu3i64E"} +// CHECK: ![[TYPE23]] = !{i64 0, !"_ZTSFvu3i64S_E"} +// CHECK: ![[TYPE24]] = !{i64 0, !"_ZTSFvu3i64S_S_E"} +// CHECK: ![[TYPE25]] = !{i64 0, !"_ZTSFvu4i128E"} +// CHECK: ![[TYPE26]] = !{i64 0, !"_ZTSFvu4i128S_E"} +// CHECK: ![[TYPE27]] = !{i64 0, !"_ZTSFvu4i128S_S_E"} +// CHECK: ![[TYPE28]] = !{i64 0, !"_ZTSFvu5isizeE"} +// CHECK: ![[TYPE29]] = !{i64 0, !"_ZTSFvu5isizeS_E"} +// CHECK: ![[TYPE30]] = !{i64 0, !"_ZTSFvu5isizeS_S_E"} +// CHECK: ![[TYPE31]] = !{i64 0, !"_ZTSFvu2u8E"} +// CHECK: ![[TYPE32]] = !{i64 0, !"_ZTSFvu2u8S_E"} +// CHECK: ![[TYPE33]] = !{i64 0, !"_ZTSFvu2u8S_S_E"} +// CHECK: ![[TYPE34]] = !{i64 0, !"_ZTSFvu3u16E"} +// CHECK: ![[TYPE35]] = !{i64 0, !"_ZTSFvu3u16S_E"} +// CHECK: ![[TYPE36]] = !{i64 0, !"_ZTSFvu3u16S_S_E"} +// CHECK: ![[TYPE37]] = !{i64 0, !"_ZTSFvu3u32E"} +// CHECK: ![[TYPE38]] = !{i64 0, !"_ZTSFvu3u32S_E"} +// CHECK: ![[TYPE39]] = !{i64 0, !"_ZTSFvu3u32S_S_E"} +// CHECK: ![[TYPE40]] = !{i64 0, !"_ZTSFvu3u64E"} +// CHECK: ![[TYPE41]] = !{i64 0, !"_ZTSFvu3u64S_E"} +// CHECK: ![[TYPE42]] = !{i64 0, !"_ZTSFvu3u64S_S_E"} +// CHECK: ![[TYPE43]] = !{i64 0, !"_ZTSFvu4u128E"} +// CHECK: ![[TYPE44]] = !{i64 0, !"_ZTSFvu4u128S_E"} +// CHECK: ![[TYPE45]] = !{i64 0, !"_ZTSFvu4u128S_S_E"} +// CHECK: ![[TYPE46]] = !{i64 0, !"_ZTSFvu5usizeE"} +// CHECK: ![[TYPE47]] = !{i64 0, !"_ZTSFvu5usizeS_E"} +// CHECK: ![[TYPE48]] = !{i64 0, !"_ZTSFvu5usizeS_S_E"} +// CHECK: ![[TYPE49]] = !{i64 0, !"_ZTSFvfE"} +// CHECK: ![[TYPE50]] = !{i64 0, !"_ZTSFvffE"} +// CHECK: ![[TYPE51]] = !{i64 0, !"_ZTSFvfffE"} +// CHECK: ![[TYPE52]] = !{i64 0, !"_ZTSFvdE"} +// CHECK: ![[TYPE53]] = !{i64 0, !"_ZTSFvddE"} +// CHECK: ![[TYPE54]] = !{i64 0, !"_ZTSFvdddE"} +// CHECK: ![[TYPE55]] = !{i64 0, !"_ZTSFvu4charE"} +// CHECK: ![[TYPE56]] = !{i64 0, !"_ZTSFvu4charS_E"} +// CHECK: ![[TYPE57]] = !{i64 0, !"_ZTSFvu4charS_S_E"} +// CHECK: ![[TYPE58]] = !{i64 0, !"_ZTSFvu3refIu3strEE"} +// CHECK: ![[TYPE59]] = !{i64 0, !"_ZTSFvu3refIu3strES0_E"} +// CHECK: ![[TYPE60]] = !{i64 0, !"_ZTSFvu3refIu3strES0_S0_E"} diff --git a/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-repr-transparent-types.rs b/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-repr-transparent-types.rs new file mode 100644 index 00000000000..6f47f5e3355 --- /dev/null +++ b/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-repr-transparent-types.rs @@ -0,0 +1,64 @@ +// Verifies that type metadata identifiers for functions are emitted correctly +// for repr transparent types. +// +//@ needs-sanitizer-cfi +//@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static + +#![crate_type="lib"] + +extern crate core; +use core::ffi::*; +use std::marker::PhantomData; + +struct Foo(i32); + +// repr(transparent) user-defined type +#[repr(transparent)] +pub struct Type1 { + member1: (), + member2: PhantomData<i32>, + member3: Foo, +} + +// Self-referencing repr(transparent) user-defined type +#[repr(transparent)] +pub struct Type2<'a> { + member1: (), + member2: PhantomData<i32>, + member3: &'a Type2<'a>, +} + +pub struct Bar(i32); + +// repr(transparent) user-defined generic type +#[repr(transparent)] +pub struct Type3<T>(T); + +pub fn foo1(_: Type1) { } +// CHECK: define{{.*}}4foo1{{.*}}!type ![[TYPE1:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo2(_: Type1, _: Type1) { } +// CHECK: define{{.*}}4foo2{{.*}}!type ![[TYPE2:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo3(_: Type1, _: Type1, _: Type1) { } +// CHECK: define{{.*}}4foo3{{.*}}!type ![[TYPE3:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo4(_: Type2) { } +// CHECK: define{{.*}}4foo4{{.*}}!type ![[TYPE4:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo5(_: Type2, _: Type2) { } +// CHECK: define{{.*}}4foo5{{.*}}!type ![[TYPE5:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo6(_: Type2, _: Type2, _: Type2) { } +// CHECK: define{{.*}}4foo6{{.*}}!type ![[TYPE6:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo7(_: Type3<Bar>) { } +// CHECK: define{{.*}}4foo7{{.*}}!type ![[TYPE7:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo8(_: Type3<Bar>, _: Type3<Bar>) { } +// CHECK: define{{.*}}4foo8{{.*}}!type ![[TYPE8:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo9(_: Type3<Bar>, _: Type3<Bar>, _: Type3<Bar>) { } +// CHECK: define{{.*}}4foo9{{.*}}!type ![[TYPE9:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} + +// CHECK: ![[TYPE1]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NtC{{[[:print:]]+}}_{{[[:print:]]+}}3FooE"} +// CHECK: ![[TYPE2]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NtC{{[[:print:]]+}}_{{[[:print:]]+}}3FooS_E"} +// CHECK: ![[TYPE3]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NtC{{[[:print:]]+}}_{{[[:print:]]+}}3FooS_S_E"} +// CHECK: ![[TYPE4]] = !{i64 0, !"_ZTSFvu3refIvEE"} +// CHECK: ![[TYPE5]] = !{i64 0, !"_ZTSFvu3refIvES_E"} +// CHECK: ![[TYPE6]] = !{i64 0, !"_ZTSFvu3refIvES_S_E"} +// CHECK: ![[TYPE7]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NtC{{[[:print:]]+}}_{{[[:print:]]+}}3BarE"} +// CHECK: ![[TYPE8]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NtC{{[[:print:]]+}}_{{[[:print:]]+}}3BarS_E"} +// CHECK: ![[TYPE9]] = !{i64 0, !"_ZTSFvu{{[0-9]+}}NtC{{[[:print:]]+}}_{{[[:print:]]+}}3BarS_S_E"} diff --git a/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-sequence-types.rs b/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-sequence-types.rs new file mode 100644 index 00000000000..dd2e05dd2ec --- /dev/null +++ b/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-sequence-types.rs @@ -0,0 +1,36 @@ +// Verifies that type metadata identifiers for functions are emitted correctly +// for sequence types. +// +//@ needs-sanitizer-cfi +//@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static + +#![crate_type="lib"] + +pub fn foo1(_: (i32, i32)) { } +// CHECK: define{{.*}}4foo1{{.*}}!type ![[TYPE1:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo2(_: (i32, i32), _: (i32, i32)) { } +// CHECK: define{{.*}}4foo2{{.*}}!type ![[TYPE2:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo3(_: (i32, i32), _: (i32, i32), _: (i32, i32)) { } +// CHECK: define{{.*}}4foo3{{.*}}!type ![[TYPE3:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo4(_: [i32; 32]) { } +// CHECK: define{{.*}}4foo4{{.*}}!type ![[TYPE4:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo5(_: [i32; 32], _: [i32; 32]) { } +// CHECK: define{{.*}}4foo5{{.*}}!type ![[TYPE5:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo6(_: [i32; 32], _: [i32; 32], _: [i32; 32]) { } +// CHECK: define{{.*}}4foo6{{.*}}!type ![[TYPE6:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo7(_: &[i32]) { } +// CHECK: define{{.*}}4foo7{{.*}}!type ![[TYPE7:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo8(_: &[i32], _: &[i32]) { } +// CHECK: define{{.*}}4foo8{{.*}}!type ![[TYPE8:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo9(_: &[i32], _: &[i32], _: &[i32]) { } +// CHECK: define{{.*}}4foo9{{.*}}!type ![[TYPE9:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} + +// CHECK: ![[TYPE1]] = !{i64 0, !"_ZTSFvu5tupleIu3i32S_EE"} +// CHECK: ![[TYPE2]] = !{i64 0, !"_ZTSFvu5tupleIu3i32S_ES0_E"} +// CHECK: ![[TYPE3]] = !{i64 0, !"_ZTSFvu5tupleIu3i32S_ES0_S0_E"} +// CHECK: ![[TYPE4]] = !{i64 0, !"_ZTSFvA32u3i32E"} +// CHECK: ![[TYPE5]] = !{i64 0, !"_ZTSFvA32u3i32S0_E"} +// CHECK: ![[TYPE6]] = !{i64 0, !"_ZTSFvA32u3i32S0_S0_E"} +// CHECK: ![[TYPE7]] = !{i64 0, !"_ZTSFvu3refIu5sliceIu3i32EEE"} +// CHECK: ![[TYPE8]] = !{i64 0, !"_ZTSFvu3refIu5sliceIu3i32EES1_E"} +// CHECK: ![[TYPE9]] = !{i64 0, !"_ZTSFvu3refIu5sliceIu3i32EES1_S1_E"} diff --git a/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-trait-types.rs b/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-trait-types.rs new file mode 100644 index 00000000000..cc7178e41c7 --- /dev/null +++ b/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-trait-types.rs @@ -0,0 +1,161 @@ +// Verifies that type metadata identifiers for functions are emitted correctly +// for trait types. +// +//@ needs-sanitizer-cfi +//@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static + +#![crate_type="lib"] + +extern crate core; + +pub trait Trait1 { + fn foo(&self); +} + +#[derive(Clone, Copy)] +pub struct Type1; + +impl Trait1 for Type1 { + fn foo(&self) { + } +} + +pub trait Trait2<T> { + fn bar(&self); +} + +pub struct Type2; + +impl Trait2<i32> for Type2 { + fn bar(&self) { + } +} + +pub trait Trait3<T> { + fn baz(&self, _: &T); +} + +pub struct Type3; + +impl<T, U> Trait3<U> for T { + fn baz(&self, _: &U) { + } +} + +pub trait Trait4<'a, T> { + type Output: 'a; + fn qux(&self, _: &T) -> Self::Output; +} + +pub struct Type4; + +impl<'a, T, U> Trait4<'a, U> for T { + type Output = &'a i32; + fn qux(&self, _: &U) -> Self::Output { + &0 + } +} + +pub trait Trait5<T, const N: usize> { + fn quux(&self, _: &[T; N]); +} + +#[derive(Copy, Clone)] +pub struct Type5; + +impl<T, U, const N: usize> Trait5<U, N> for T { + fn quux(&self, _: &[U; N]) { + } +} + +pub fn foo1(_: &dyn Send) { } +// CHECK: define{{.*}}4foo1{{.*}}!type ![[TYPE1:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo2(_: &dyn Send, _: &dyn Send) { } +// CHECK: define{{.*}}4foo2{{.*}}!type ![[TYPE2:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo3(_: &dyn Send, _: &dyn Send, _: &dyn Send) { } +// CHECK: define{{.*}}4foo3{{.*}}!type ![[TYPE3:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo4(_: &(dyn Send + Sync)) { } +// CHECK: define{{.*}}4foo4{{.*}}!type ![[TYPE4:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo5(_: &(dyn Send + Sync), _: &(dyn Sync + Send)) { } +// CHECK: define{{.*}}4foo5{{.*}}!type ![[TYPE5:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo6(_: &(dyn Send + Sync), _: &(dyn Sync + Send), _: &(dyn Sync + Send)) { } +// CHECK: define{{.*}}4foo6{{.*}}!type ![[TYPE6:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo7(_: &(dyn Trait1 + Send)) { } +// CHECK: define{{.*}}4foo7{{.*}}!type ![[TYPE7:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo8(_: &(dyn Trait1 + Send), _: &(dyn Trait1 + Send)) { } +// CHECK: define{{.*}}4foo8{{.*}}!type ![[TYPE8:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo9(_: &(dyn Trait1 + Send), _: &(dyn Trait1 + Send), _: &(dyn Trait1 + Send)) { } +// CHECK: define{{.*}}4foo9{{.*}}!type ![[TYPE9:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo10(_: &(dyn Trait1 + Send + Sync)) { } +// CHECK: define{{.*}}5foo10{{.*}}!type ![[TYPE10:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo11(_: &(dyn Trait1 + Send + Sync), _: &(dyn Trait1 + Sync + Send)) { } +// CHECK: define{{.*}}5foo11{{.*}}!type ![[TYPE11:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo12(_: &(dyn Trait1 + Send + Sync), + _: &(dyn Trait1 + Sync + Send), + _: &(dyn Trait1 + Sync + Send)) { } +// CHECK: define{{.*}}5foo12{{.*}}!type ![[TYPE12:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo13(_: &dyn Trait1) { } +// CHECK: define{{.*}}5foo13{{.*}}!type ![[TYPE13:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo14(_: &dyn Trait1, _: &dyn Trait1) { } +// CHECK: define{{.*}}5foo14{{.*}}!type ![[TYPE14:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo15(_: &dyn Trait1, _: &dyn Trait1, _: &dyn Trait1) { } +// CHECK: define{{.*}}5foo15{{.*}}!type ![[TYPE15:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo16<T>(_: &dyn Trait2<T>) { } +pub fn bar16() { let a = Type2; foo16(&a); } +// CHECK: define{{.*}}5foo16{{.*}}!type ![[TYPE16:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo17<T>(_: &dyn Trait2<T>, _: &dyn Trait2<T>) { } +pub fn bar17() { let a = Type2; foo17(&a, &a); } +// CHECK: define{{.*}}5foo17{{.*}}!type ![[TYPE17:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo18<T>(_: &dyn Trait2<T>, _: &dyn Trait2<T>, _: &dyn Trait2<T>) { } +pub fn bar18() { let a = Type2; foo18(&a, &a, &a); } +// CHECK: define{{.*}}5foo18{{.*}}!type ![[TYPE18:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo19(_: &dyn Trait3<Type3>) { } +// CHECK: define{{.*}}5foo19{{.*}}!type ![[TYPE19:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo20(_: &dyn Trait3<Type3>, _: &dyn Trait3<Type3>) { } +// CHECK: define{{.*}}5foo20{{.*}}!type ![[TYPE20:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo21(_: &dyn Trait3<Type3>, _: &dyn Trait3<Type3>, _: &dyn Trait3<Type3>) { } +// CHECK: define{{.*}}5foo21{{.*}}!type ![[TYPE21:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo22<'a>(_: &dyn Trait4<'a, Type4, Output = &'a i32>) { } +// CHECK: define{{.*}}5foo22{{.*}}!type ![[TYPE22:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo23<'a>(_: &dyn Trait4<'a, Type4, Output = &'a i32>, + _: &dyn Trait4<'a, Type4, Output = &'a i32>) { } +// CHECK: define{{.*}}5foo23{{.*}}!type ![[TYPE23:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo24<'a>(_: &dyn Trait4<'a, Type4, Output = &'a i32>, + _: &dyn Trait4<'a, Type4, Output = &'a i32>, + _: &dyn Trait4<'a, Type4, Output = &'a i32>) { } +// CHECK: define{{.*}}5foo24{{.*}}!type ![[TYPE24:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo25(_: &dyn Trait5<Type5, 32>) { } +// CHECK: define{{.*}}5foo25{{.*}}!type ![[TYPE25:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo26(_: &dyn Trait5<Type5, 32>, _: &dyn Trait5<Type5, 32>) { } +// CHECK: define{{.*}}5foo26{{.*}}!type ![[TYPE26:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo27(_: &dyn Trait5<Type5, 32>, _: &dyn Trait5<Type5, 32>, _: &dyn Trait5<Type5, 32>) { } +// CHECK: define{{.*}}5foo27{{.*}}!type ![[TYPE27:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} + +// CHECK: ![[TYPE13]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtC{{[[:print:]]+}}_{{[[:print:]]+}}6Trait1u6regionEEE"} +// CHECK: ![[TYPE16]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtC{{[[:print:]]+}}_{{[[:print:]]+}}6Trait2Iu5paramEu6regionEEE"} +// CHECK: ![[TYPE1]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtC{{[[:print:]]+}}_4core6marker4Sendu6regionEEE"} +// CHECK: ![[TYPE2]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtC{{[[:print:]]+}}_4core6marker4Sendu6regionEES2_E"} +// CHECK: ![[TYPE3]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtC{{[[:print:]]+}}_4core6marker4Sendu6regionEES2_S2_E"} +// FIXME(rcvalle): Enforce autotraits ordering when encoding (e.g., alphabetical order) +// CHECK: ![[TYPE4]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtC{{[[:print:]]+}}_4core6marker{{(4Send|4Sync)}}u{{[0-9]+}}NtNtC{{[[:print:]]+}}_4core6marker{{(4Send|4Sync)}}u6regionEEE"} +// CHECK: ![[TYPE5]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtC{{[[:print:]]+}}_4core6marker{{(4Send|4Sync)}}u{{[0-9]+}}NtNtC{{[[:print:]]+}}_4core6marker{{(4Send|4Sync)}}u6regionEES3_E"} +// CHECK: ![[TYPE6]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtNtC{{[[:print:]]+}}_4core6marker{{(4Send|4Sync)}}u{{[0-9]+}}NtNtC{{[[:print:]]+}}_4core6marker{{(4Send|4Sync)}}u6regionEES3_S3_E"} +// CHECK: ![[TYPE7]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtC{{[[:print:]]+}}_{{[[:print:]]+}}6Trait1u{{[0-9]+}}NtNtC{{[[:print:]]+}}_4core6marker4Sendu6regionEEE"} +// CHECK: ![[TYPE8]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtC{{[[:print:]]+}}_{{[[:print:]]+}}6Trait1u{{[0-9]+}}NtNtC{{[[:print:]]+}}_4core6marker4Sendu6regionEES3_E"} +// CHECK: ![[TYPE9]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtC{{[[:print:]]+}}_{{[[:print:]]+}}6Trait1u{{[0-9]+}}NtNtC{{[[:print:]]+}}_4core6marker4Sendu6regionEES3_S3_E"} +// CHECK: ![[TYPE10]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtC{{[[:print:]]+}}_{{[[:print:]]+}}6Trait1u{{[0-9]+}}NtNtC{{[[:print:]]+}}_4core6marker{{(4Send|4Sync)}}u{{[0-9]+}}NtNtC{{[[:print:]]+}}_4core6marker{{(4Send|4Sync)}}u6regionEEE"} +// CHECK: ![[TYPE11]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtC{{[[:print:]]+}}_{{[[:print:]]+}}6Trait1u{{[0-9]+}}NtNtC{{[[:print:]]+}}_4core6marker{{(4Send|4Sync)}}u{{[0-9]+}}NtNtC{{[[:print:]]+}}_4core6marker{{(4Send|4Sync)}}u6regionEES4_E"} +// CHECK: ![[TYPE12]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtC{{[[:print:]]+}}_{{[[:print:]]+}}6Trait1u{{[0-9]+}}NtNtC{{[[:print:]]+}}_4core6marker{{(4Send|4Sync)}}u{{[0-9]+}}NtNtC{{[[:print:]]+}}_4core6marker{{(4Send|4Sync)}}u6regionEES4_S4_E"} +// CHECK: ![[TYPE14]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtC{{[[:print:]]+}}_{{[[:print:]]+}}6Trait1u6regionEES2_E"} +// CHECK: ![[TYPE15]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtC{{[[:print:]]+}}_{{[[:print:]]+}}6Trait1u6regionEES2_S2_E"} +// CHECK: ![[TYPE17]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtC{{[[:print:]]+}}_{{[[:print:]]+}}6Trait2Iu5paramEu6regionEES3_E"} +// CHECK: ![[TYPE18]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtC{{[[:print:]]+}}_{{[[:print:]]+}}6Trait2Iu5paramEu6regionEES3_S3_E"} +// CHECK: ![[TYPE19]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtC{{[[:print:]]+}}_{{[[:print:]]+}}6Trait3Iu5paramEu6regionEEE"} +// CHECK: ![[TYPE20]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtC{{[[:print:]]+}}_{{[[:print:]]+}}6Trait3Iu5paramEu6regionEES3_E"} +// CHECK: ![[TYPE21]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtC{{[[:print:]]+}}_{{[[:print:]]+}}6Trait3Iu5paramEu6regionEES3_S3_E"} +// CHECK: ![[TYPE22]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtC{{[[:print:]]+}}_{{[[:print:]]+}}6Trait4Iu6regionu5paramEu6regionEEE"} +// CHECK: ![[TYPE23]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtC{{[[:print:]]+}}_{{[[:print:]]+}}6Trait4Iu6regionu5paramEu6regionEES4_E"} +// CHECK: ![[TYPE24]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtC{{[[:print:]]+}}_{{[[:print:]]+}}6Trait4Iu6regionu5paramEu6regionEES4_S4_E"} +// CHECK: ![[TYPE25]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtC{{[[:print:]]+}}_{{[[:print:]]+}}6Trait5Iu5paramLu5usizeEEu6regionEEE"} +// CHECK: ![[TYPE26]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtC{{[[:print:]]+}}_{{[[:print:]]+}}6Trait5Iu5paramLu5usizeEEu6regionEES5_E"} +// CHECK: ![[TYPE27]] = !{i64 0, !"_ZTSFvu3refIu3dynIu{{[0-9]+}}NtC{{[[:print:]]+}}_{{[[:print:]]+}}6Trait5Iu5paramLu5usizeEEu6regionEES5_S5_E"} diff --git a/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-user-defined-types.rs b/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-user-defined-types.rs new file mode 100644 index 00000000000..4eaf42bf87d --- /dev/null +++ b/tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-user-defined-types.rs @@ -0,0 +1,62 @@ +// Verifies that type metadata identifiers for functions are emitted correctly +// for user-defined types. +// +//@ needs-sanitizer-cfi +//@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static + +#![crate_type="lib"] +#![feature(extern_types)] + +pub struct Struct1<T> { + member1: T, +} + +pub enum Enum1<T> { + Variant1(T), +} + +pub union Union1<T> { + member1: std::mem::ManuallyDrop<T>, +} + +extern { + pub type type1; +} + +pub fn foo1(_: &Struct1::<i32>) { } +// CHECK: define{{.*}}4foo1{{.*}}!type ![[TYPE1:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo2(_: &Struct1::<i32>, _: &Struct1::<i32>) { } +// CHECK: define{{.*}}4foo2{{.*}}!type ![[TYPE2:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo3(_: &Struct1::<i32>, _: &Struct1::<i32>, _: &Struct1::<i32>) { } +// CHECK: define{{.*}}4foo3{{.*}}!type ![[TYPE3:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo4(_: &Enum1::<i32>) { } +// CHECK: define{{.*}}4foo4{{.*}}!type ![[TYPE4:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo5(_: &Enum1::<i32>, _: &Enum1::<i32>) { } +// CHECK: define{{.*}}4foo5{{.*}}!type ![[TYPE5:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo6(_: &Enum1::<i32>, _: &Enum1::<i32>, _: &Enum1::<i32>) { } +// CHECK: define{{.*}}4foo6{{.*}}!type ![[TYPE6:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo7(_: &Union1::<i32>) { } +// CHECK: define{{.*}}4foo7{{.*}}!type ![[TYPE7:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo8(_: &Union1::<i32>, _: &Union1::<i32>) { } +// CHECK: define{{.*}}4foo8{{.*}}!type ![[TYPE8:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo9(_: &Union1::<i32>, _: &Union1::<i32>, _: &Union1::<i32>) { } +// CHECK: define{{.*}}4foo9{{.*}}!type ![[TYPE9:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo10(_: *mut type1) { } +// CHECK: define{{.*}}5foo10{{.*}}!type ![[TYPE10:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo11(_: *mut type1, _: *mut type1) { } +// CHECK: define{{.*}}5foo11{{.*}}!type ![[TYPE11:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} +pub fn foo12(_: *mut type1, _: *mut type1, _: *mut type1) { } +// CHECK: define{{.*}}5foo12{{.*}}!type ![[TYPE12:[0-9]+]] !type !{{[0-9]+}} !type !{{[0-9]+}} !type !{{[0-9]+}} + +// CHECK: ![[TYPE1]] = !{i64 0, !"_ZTSFvu3refIu{{[0-9]+}}NtC{{[[:print:]]+}}_{{[[:print:]]+}}7Struct1Iu3i32EEE"} +// CHECK: ![[TYPE2]] = !{i64 0, !"_ZTSFvu3refIu{{[0-9]+}}NtC{{[[:print:]]+}}_{{[[:print:]]+}}7Struct1Iu3i32EES1_E"} +// CHECK: ![[TYPE3]] = !{i64 0, !"_ZTSFvu3refIu{{[0-9]+}}NtC{{[[:print:]]+}}_{{[[:print:]]+}}7Struct1Iu3i32EES1_S1_E"} +// CHECK: ![[TYPE4]] = !{i64 0, !"_ZTSFvu3refIu{{[0-9]+}}NtC{{[[:print:]]+}}_{{[[:print:]]+}}5Enum1Iu3i32EEE"} +// CHECK: ![[TYPE5]] = !{i64 0, !"_ZTSFvu3refIu{{[0-9]+}}NtC{{[[:print:]]+}}_{{[[:print:]]+}}5Enum1Iu3i32EES1_E"} +// CHECK: ![[TYPE6]] = !{i64 0, !"_ZTSFvu3refIu{{[0-9]+}}NtC{{[[:print:]]+}}_{{[[:print:]]+}}5Enum1Iu3i32EES1_S1_E"} +// CHECK: ![[TYPE7]] = !{i64 0, !"_ZTSFvu3refIu{{[0-9]+}}NtC{{[[:print:]]+}}_{{[[:print:]]+}}6Union1Iu3i32EEE"} +// CHECK: ![[TYPE8]] = !{i64 0, !"_ZTSFvu3refIu{{[0-9]+}}NtC{{[[:print:]]+}}_{{[[:print:]]+}}6Union1Iu3i32EES1_E"} +// CHECK: ![[TYPE9]] = !{i64 0, !"_ZTSFvu3refIu{{[0-9]+}}NtC{{[[:print:]]+}}_{{[[:print:]]+}}6Union1Iu3i32EES1_S1_E"} +// CHECK: ![[TYPE10]] = !{i64 0, !"_ZTSFvP5type1E"} +// CHECK: ![[TYPE11]] = !{i64 0, !"_ZTSFvP5type1S0_E"} +// CHECK: ![[TYPE12]] = !{i64 0, !"_ZTSFvP5type1S0_S0_E"} diff --git a/tests/codegen/sanitizer/cfi-emit-type-metadata-itanium-cxx-abi-generalized.rs b/tests/codegen/sanitizer/cfi/emit-type-metadata-itanium-cxx-abi-generalized.rs index ccd7ee93ca1..ccd7ee93ca1 100644 --- a/tests/codegen/sanitizer/cfi-emit-type-metadata-itanium-cxx-abi-generalized.rs +++ b/tests/codegen/sanitizer/cfi/emit-type-metadata-itanium-cxx-abi-generalized.rs diff --git a/tests/codegen/sanitizer/cfi-emit-type-metadata-itanium-cxx-abi-normalized-generalized.rs b/tests/codegen/sanitizer/cfi/emit-type-metadata-itanium-cxx-abi-normalized-generalized.rs index d4130034178..d4130034178 100644 --- a/tests/codegen/sanitizer/cfi-emit-type-metadata-itanium-cxx-abi-normalized-generalized.rs +++ b/tests/codegen/sanitizer/cfi/emit-type-metadata-itanium-cxx-abi-normalized-generalized.rs diff --git a/tests/codegen/sanitizer/cfi-emit-type-metadata-itanium-cxx-abi-normalized.rs b/tests/codegen/sanitizer/cfi/emit-type-metadata-itanium-cxx-abi-normalized.rs index ac18379165d..ac18379165d 100644 --- a/tests/codegen/sanitizer/cfi-emit-type-metadata-itanium-cxx-abi-normalized.rs +++ b/tests/codegen/sanitizer/cfi/emit-type-metadata-itanium-cxx-abi-normalized.rs diff --git a/tests/codegen/sanitizer/cfi-emit-type-metadata-itanium-cxx-abi.rs b/tests/codegen/sanitizer/cfi/emit-type-metadata-itanium-cxx-abi.rs index 526ba62c264..526ba62c264 100644 --- a/tests/codegen/sanitizer/cfi-emit-type-metadata-itanium-cxx-abi.rs +++ b/tests/codegen/sanitizer/cfi/emit-type-metadata-itanium-cxx-abi.rs diff --git a/tests/codegen/sanitizer/cfi-emit-type-metadata-trait-objects.rs b/tests/codegen/sanitizer/cfi/emit-type-metadata-trait-objects.rs index 318aad9291c..318aad9291c 100644 --- a/tests/codegen/sanitizer/cfi-emit-type-metadata-trait-objects.rs +++ b/tests/codegen/sanitizer/cfi/emit-type-metadata-trait-objects.rs diff --git a/tests/codegen/sanitizer/cfi-generalize-pointers.rs b/tests/codegen/sanitizer/cfi/generalize-pointers.rs index eaf3dad1909..eaf3dad1909 100644 --- a/tests/codegen/sanitizer/cfi-generalize-pointers.rs +++ b/tests/codegen/sanitizer/cfi/generalize-pointers.rs diff --git a/tests/codegen/sanitizer/cfi-normalize-integers.rs b/tests/codegen/sanitizer/cfi/normalize-integers.rs index 210814eb9ae..801ed312be5 100644 --- a/tests/codegen/sanitizer/cfi-normalize-integers.rs +++ b/tests/codegen/sanitizer/cfi/normalize-integers.rs @@ -41,6 +41,6 @@ pub fn foo11(_: (), _: usize, _: usize, _: usize) { } // CHECK: ![[TYPE6]] = !{i64 0, !"_ZTSFv{{u3i16|u3i32|u3i64|u4i128}}E.normalized"} // CHECK: ![[TYPE7]] = !{i64 0, !"_ZTSFv{{u3i16|u3i32|u3i64|u4i128}}S_E.normalized"} // CHECK: ![[TYPE8]] = !{i64 0, !"_ZTSFv{{u3i16|u3i32|u3i64|u4i128}}S_S_E.normalized"} -// CHECK: ![[TYPE9]] = !{i64 0, !"_ZTSFvv{{u3u16|u3u32|u3u64|u4u128}}E.normalized"} -// CHECK: ![[TYPE10]] = !{i64 0, !"_ZTSFvv{{u3u16|u3u32|u3u64|u4u128}}S_E.normalized"} -// CHECK: ![[TYPE11]] = !{i64 0, !"_ZTSFvv{{u3u16|u3u32|u3u64|u4u128}}S_S_E.normalized"} +// CHECK: ![[TYPE9]] = !{i64 0, !"_ZTSFv{{u3u16|u3u32|u3u64|u4u128}}E.normalized"} +// CHECK: ![[TYPE10]] = !{i64 0, !"_ZTSFv{{u3u16|u3u32|u3u64|u4u128}}S_E.normalized"} +// CHECK: ![[TYPE11]] = !{i64 0, !"_ZTSFv{{u3u16|u3u32|u3u64|u4u128}}S_S_E.normalized"} diff --git a/tests/codegen/sanitizer/kcfi-add-kcfi-flag.rs b/tests/codegen/sanitizer/kcfi/add-kcfi-flag.rs index 7751d3baf79..7751d3baf79 100644 --- a/tests/codegen/sanitizer/kcfi-add-kcfi-flag.rs +++ b/tests/codegen/sanitizer/kcfi/add-kcfi-flag.rs diff --git a/tests/codegen/sanitizer/kcfi-emit-kcfi-operand-bundle-attr-no-sanitize.rs b/tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-attr-no-sanitize.rs index 50e591ba06b..8055c63a2f8 100644 --- a/tests/codegen/sanitizer/kcfi-emit-kcfi-operand-bundle-attr-no-sanitize.rs +++ b/tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-attr-no-sanitize.rs @@ -20,7 +20,7 @@ impl Copy for i32 {} #[no_sanitize(kcfi)] pub fn foo(f: fn(i32) -> i32, arg: i32) -> i32 { - // CHECK-LABEL: kcfi_emit_kcfi_operand_bundle_attr_no_sanitize::foo + // CHECK-LABEL: emit_kcfi_operand_bundle_attr_no_sanitize::foo // CHECK: Function Attrs: {{.*}} // CHECK-LABEL: define{{.*}}foo{{.*}}!{{<unknown kind #36>|kcfi_type}} !{{[0-9]+}} // CHECK: start: diff --git a/tests/codegen/sanitizer/kcfi-emit-kcfi-operand-bundle-itanium-cxx-abi-generalized.rs b/tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-generalized.rs index bd1dfc4c413..bd1dfc4c413 100644 --- a/tests/codegen/sanitizer/kcfi-emit-kcfi-operand-bundle-itanium-cxx-abi-generalized.rs +++ b/tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-generalized.rs diff --git a/tests/codegen/sanitizer/kcfi-emit-kcfi-operand-bundle-itanium-cxx-abi-normalized-generalized.rs b/tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-normalized-generalized.rs index b8275f44fac..b8275f44fac 100644 --- a/tests/codegen/sanitizer/kcfi-emit-kcfi-operand-bundle-itanium-cxx-abi-normalized-generalized.rs +++ b/tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-normalized-generalized.rs diff --git a/tests/codegen/sanitizer/kcfi-emit-kcfi-operand-bundle-itanium-cxx-abi-normalized.rs b/tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-normalized.rs index cd1b0c5efb0..cd1b0c5efb0 100644 --- a/tests/codegen/sanitizer/kcfi-emit-kcfi-operand-bundle-itanium-cxx-abi-normalized.rs +++ b/tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi-normalized.rs diff --git a/tests/codegen/sanitizer/kcfi-emit-kcfi-operand-bundle-itanium-cxx-abi.rs b/tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi.rs index 12690577da7..12690577da7 100644 --- a/tests/codegen/sanitizer/kcfi-emit-kcfi-operand-bundle-itanium-cxx-abi.rs +++ b/tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle-itanium-cxx-abi.rs diff --git a/tests/codegen/sanitizer/kcfi-emit-kcfi-operand-bundle.rs b/tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle.rs index f4b3e48638e..f4b3e48638e 100644 --- a/tests/codegen/sanitizer/kcfi-emit-kcfi-operand-bundle.rs +++ b/tests/codegen/sanitizer/kcfi/emit-kcfi-operand-bundle.rs diff --git a/tests/codegen/sanitizer/kcfi-emit-type-metadata-trait-objects.rs b/tests/codegen/sanitizer/kcfi/emit-type-metadata-trait-objects.rs index f08c9e6702e..f08c9e6702e 100644 --- a/tests/codegen/sanitizer/kcfi-emit-type-metadata-trait-objects.rs +++ b/tests/codegen/sanitizer/kcfi/emit-type-metadata-trait-objects.rs diff --git a/tests/codegen/trailing_zeros.rs b/tests/codegen/trailing_zeros.rs index 66560c0d4fc..b659e061821 100644 --- a/tests/codegen/trailing_zeros.rs +++ b/tests/codegen/trailing_zeros.rs @@ -1,5 +1,4 @@ //@ compile-flags: -O -//@ min-llvm-version: 17 #![crate_type = "lib"] diff --git a/tests/codegen/vec-shrink-panik.rs b/tests/codegen/vec-shrink-panik.rs index 4e996b234f9..4b798fe6c9c 100644 --- a/tests/codegen/vec-shrink-panik.rs +++ b/tests/codegen/vec-shrink-panik.rs @@ -1,8 +1,5 @@ -//@ revisions: old new // LLVM 17 realizes double panic is not possible and doesn't generate calls // to panic_cannot_unwind. -//@ [old]ignore-llvm-version: 17 - 99 -//@ [new]min-llvm-version: 17 //@ compile-flags: -O //@ ignore-debug: plain old debug assertions //@ needs-unwind @@ -23,14 +20,6 @@ pub fn shrink_to_fit(vec: &mut Vec<u32>) { #[no_mangle] pub fn issue71861(vec: Vec<u32>) -> Box<[u32]> { // CHECK-NOT: panic - - // Call to panic_cannot_unwind in case of double-panic is expected - // on LLVM 16 and older, but other panics are not. - // old: filter - // old-NEXT: ; call core::panicking::panic_cannot_unwind - // old-NEXT: panic_cannot_unwind - - // CHECK-NOT: panic vec.into_boxed_slice() } @@ -40,6 +29,3 @@ pub fn issue75636<'a>(iter: &[&'a str]) -> Box<[&'a str]> { // CHECK-NOT: panic iter.iter().copied().collect() } - -// old: ; core::panicking::panic_cannot_unwind -// old: declare void @{{.*}}panic_cannot_unwind diff --git a/tests/coverage/let_else_loop.cov-map b/tests/coverage/let_else_loop.cov-map new file mode 100644 index 00000000000..b0cee300522 --- /dev/null +++ b/tests/coverage/let_else_loop.cov-map @@ -0,0 +1,30 @@ +Function name: let_else_loop::_if (unused) +Raw bytes (19): 0x[01, 01, 00, 03, 00, 16, 01, 01, 0c, 00, 02, 09, 00, 10, 00, 02, 09, 00, 10] +Number of files: 1 +- file 0 => global file 1 +Number of expressions: 0 +Number of file 0 mappings: 3 +- Code(Zero) at (prev + 22, 1) to (start + 1, 12) +- Code(Zero) at (prev + 2, 9) to (start + 0, 16) +- Code(Zero) at (prev + 2, 9) to (start + 0, 16) + +Function name: let_else_loop::_loop_either_way (unused) +Raw bytes (19): 0x[01, 01, 00, 03, 00, 0f, 01, 01, 14, 00, 01, 1c, 00, 23, 00, 01, 05, 00, 0c] +Number of files: 1 +- file 0 => global file 1 +Number of expressions: 0 +Number of file 0 mappings: 3 +- Code(Zero) at (prev + 15, 1) to (start + 1, 20) +- Code(Zero) at (prev + 1, 28) to (start + 0, 35) +- Code(Zero) at (prev + 1, 5) to (start + 0, 12) + +Function name: let_else_loop::loopy +Raw bytes (19): 0x[01, 01, 00, 03, 01, 09, 01, 01, 14, 00, 01, 1c, 00, 23, 05, 01, 01, 00, 02] +Number of files: 1 +- file 0 => global file 1 +Number of expressions: 0 +Number of file 0 mappings: 3 +- Code(Counter(0)) at (prev + 9, 1) to (start + 1, 20) +- Code(Zero) at (prev + 1, 28) to (start + 0, 35) +- Code(Counter(1)) at (prev + 1, 1) to (start + 0, 2) + diff --git a/tests/coverage/let_else_loop.coverage b/tests/coverage/let_else_loop.coverage new file mode 100644 index 00000000000..d193c8ca1b5 --- /dev/null +++ b/tests/coverage/let_else_loop.coverage @@ -0,0 +1,35 @@ + LL| |#![feature(coverage_attribute)] + LL| |//@ edition: 2021 + LL| | + LL| |// Regression test for <https://github.com/rust-lang/rust/issues/122738>. + LL| |// These code patterns should not trigger an ICE when allocating a physical + LL| |// counter to a node and also one of its in-edges, because that is allowed + LL| |// when the node contains a tight loop to itself. + LL| | + LL| 1|fn loopy(cond: bool) { + LL| 1| let true = cond else { loop {} }; + ^0 + LL| 1|} + LL| | + LL| |// Variant that also has `loop {}` on the success path. + LL| |// This isn't needed to catch the original ICE, but might help detect regressions. + LL| 0|fn _loop_either_way(cond: bool) { + LL| 0| let true = cond else { loop {} }; + LL| 0| loop {} + LL| |} + LL| | + LL| |// Variant using regular `if` instead of let-else. + LL| |// This doesn't trigger the original ICE, but might help detect regressions. + LL| 0|fn _if(cond: bool) { + LL| 0| if cond { + LL| 0| loop {} + LL| | } else { + LL| 0| loop {} + LL| | } + LL| |} + LL| | + LL| |#[coverage(off)] + LL| |fn main() { + LL| | loopy(true); + LL| |} + diff --git a/tests/coverage/let_else_loop.rs b/tests/coverage/let_else_loop.rs new file mode 100644 index 00000000000..12e0aeabcab --- /dev/null +++ b/tests/coverage/let_else_loop.rs @@ -0,0 +1,33 @@ +#![feature(coverage_attribute)] +//@ edition: 2021 + +// Regression test for <https://github.com/rust-lang/rust/issues/122738>. +// These code patterns should not trigger an ICE when allocating a physical +// counter to a node and also one of its in-edges, because that is allowed +// when the node contains a tight loop to itself. + +fn loopy(cond: bool) { + let true = cond else { loop {} }; +} + +// Variant that also has `loop {}` on the success path. +// This isn't needed to catch the original ICE, but might help detect regressions. +fn _loop_either_way(cond: bool) { + let true = cond else { loop {} }; + loop {} +} + +// Variant using regular `if` instead of let-else. +// This doesn't trigger the original ICE, but might help detect regressions. +fn _if(cond: bool) { + if cond { + loop {} + } else { + loop {} + } +} + +#[coverage(off)] +fn main() { + loopy(true); +} diff --git a/tests/debuginfo/associated-types.rs b/tests/debuginfo/associated-types.rs index ab41073b7c4..d1d4e320b05 100644 --- a/tests/debuginfo/associated-types.rs +++ b/tests/debuginfo/associated-types.rs @@ -42,42 +42,42 @@ // === LLDB TESTS ================================================================================== // lldb-command:run -// lldb-command:print arg -// lldbg-check:[...]$0 = { b = -1, b1 = 0 } +// lldb-command:v arg +// lldbg-check:[...] { b = -1, b1 = 0 } // lldbr-check:(associated_types::Struct<i32>) arg = { b = -1, b1 = 0 } // lldb-command:continue -// lldb-command:print inferred -// lldbg-check:[...]$1 = 1 +// lldb-command:v inferred +// lldbg-check:[...] 1 // lldbr-check:(i64) inferred = 1 -// lldb-command:print explicitly -// lldbg-check:[...]$2 = 1 +// lldb-command:v explicitly +// lldbg-check:[...] 1 // lldbr-check:(i64) explicitly = 1 // lldb-command:continue -// lldb-command:print arg -// lldbg-check:[...]$3 = 2 +// lldb-command:v arg +// lldbg-check:[...] 2 // lldbr-check:(i64) arg = 2 // lldb-command:continue -// lldb-command:print arg -// lldbg-check:[...]$4 = (4, 5) +// lldb-command:v arg +// lldbg-check:[...] (4, 5) // lldbr-check:((i32, i64)) arg = { = 4 = 5 } // lldb-command:continue -// lldb-command:print a -// lldbg-check:[...]$5 = 6 +// lldb-command:v a +// lldbg-check:[...] 6 // lldbr-check:(i32) a = 6 -// lldb-command:print b -// lldbg-check:[...]$6 = 7 +// lldb-command:v b +// lldbg-check:[...] 7 // lldbr-check:(i64) b = 7 // lldb-command:continue -// lldb-command:print a -// lldbg-check:[...]$7 = 8 +// lldb-command:v a +// lldbg-check:[...] 8 // lldbr-check:(i64) a = 8 -// lldb-command:print b -// lldbg-check:[...]$8 = 9 +// lldb-command:v b +// lldbg-check:[...] 9 // lldbr-check:(i32) b = 9 // lldb-command:continue diff --git a/tests/debuginfo/basic-types.rs b/tests/debuginfo/basic-types.rs index 8319b71bfcd..13d85d326ee 100644 --- a/tests/debuginfo/basic-types.rs +++ b/tests/debuginfo/basic-types.rs @@ -50,49 +50,49 @@ // === LLDB TESTS ================================================================================== // lldb-command:run -// lldb-command:print b -// lldbg-check:[...]$0 = false +// lldb-command:v b +// lldbg-check:[...] false // lldbr-check:(bool) b = false -// lldb-command:print i -// lldbg-check:[...]$1 = -1 +// lldb-command:v i +// lldbg-check:[...] -1 // lldbr-check:(isize) i = -1 // NOTE: only rust-enabled lldb supports 32bit chars // lldbr-command:print c // lldbr-check:(char) c = 'a' -// lldb-command:print i8 -// lldbg-check:[...]$2 = 'D' +// lldb-command:v i8 +// lldbg-check:[...] 'D' // lldbr-check:(i8) i8 = 68 -// lldb-command:print i16 -// lldbg-check:[...]$3 = -16 +// lldb-command:v i16 +// lldbg-check:[...] -16 // lldbr-check:(i16) i16 = -16 -// lldb-command:print i32 -// lldbg-check:[...]$4 = -32 +// lldb-command:v i32 +// lldbg-check:[...] -32 // lldbr-check:(i32) i32 = -32 -// lldb-command:print i64 -// lldbg-check:[...]$5 = -64 +// lldb-command:v i64 +// lldbg-check:[...] -64 // lldbr-check:(i64) i64 = -64 -// lldb-command:print u -// lldbg-check:[...]$6 = 1 +// lldb-command:v u +// lldbg-check:[...] 1 // lldbr-check:(usize) u = 1 -// lldb-command:print u8 -// lldbg-check:[...]$7 = 'd' +// lldb-command:v u8 +// lldbg-check:[...] 'd' // lldbr-check:(u8) u8 = 100 -// lldb-command:print u16 -// lldbg-check:[...]$8 = 16 +// lldb-command:v u16 +// lldbg-check:[...] 16 // lldbr-check:(u16) u16 = 16 -// lldb-command:print u32 -// lldbg-check:[...]$9 = 32 +// lldb-command:v u32 +// lldbg-check:[...] 32 // lldbr-check:(u32) u32 = 32 -// lldb-command:print u64 -// lldbg-check:[...]$10 = 64 +// lldb-command:v u64 +// lldbg-check:[...] 64 // lldbr-check:(u64) u64 = 64 -// lldb-command:print f32 -// lldbg-check:[...]$11 = 2.5 +// lldb-command:v f32 +// lldbg-check:[...] 2.5 // lldbr-check:(f32) f32 = 2.5 -// lldb-command:print f64 -// lldbg-check:[...]$12 = 3.5 +// lldb-command:v f64 +// lldbg-check:[...] 3.5 // lldbr-check:(f64) f64 = 3.5 // === CDB TESTS =================================================================================== diff --git a/tests/debuginfo/borrowed-basic.rs b/tests/debuginfo/borrowed-basic.rs index 52d61f33e7c..e48e3dd055e 100644 --- a/tests/debuginfo/borrowed-basic.rs +++ b/tests/debuginfo/borrowed-basic.rs @@ -52,60 +52,60 @@ // === LLDB TESTS ================================================================================== // lldb-command:run -// lldb-command:print *bool_ref -// lldbg-check:[...]$0 = true +// lldb-command:v *bool_ref +// lldbg-check:[...] true // lldbr-check:(bool) *bool_ref = true -// lldb-command:print *int_ref -// lldbg-check:[...]$1 = -1 +// lldb-command:v *int_ref +// lldbg-check:[...] -1 // lldbr-check:(isize) *int_ref = -1 // NOTE: only rust-enabled lldb supports 32bit chars // lldbr-command:print *char_ref // lldbr-check:(char) *char_ref = 'a' -// lldb-command:print *i8_ref -// lldbg-check:[...]$2 = 'D' +// lldb-command:v *i8_ref +// lldbg-check:[...] 'D' // lldbr-check:(i8) *i8_ref = 68 -// lldb-command:print *i16_ref -// lldbg-check:[...]$3 = -16 +// lldb-command:v *i16_ref +// lldbg-check:[...] -16 // lldbr-check:(i16) *i16_ref = -16 -// lldb-command:print *i32_ref -// lldbg-check:[...]$4 = -32 +// lldb-command:v *i32_ref +// lldbg-check:[...] -32 // lldbr-check:(i32) *i32_ref = -32 -// lldb-command:print *i64_ref -// lldbg-check:[...]$5 = -64 +// lldb-command:v *i64_ref +// lldbg-check:[...] -64 // lldbr-check:(i64) *i64_ref = -64 -// lldb-command:print *uint_ref -// lldbg-check:[...]$6 = 1 +// lldb-command:v *uint_ref +// lldbg-check:[...] 1 // lldbr-check:(usize) *uint_ref = 1 -// lldb-command:print *u8_ref -// lldbg-check:[...]$7 = 'd' +// lldb-command:v *u8_ref +// lldbg-check:[...] 'd' // lldbr-check:(u8) *u8_ref = 100 -// lldb-command:print *u16_ref -// lldbg-check:[...]$8 = 16 +// lldb-command:v *u16_ref +// lldbg-check:[...] 16 // lldbr-check:(u16) *u16_ref = 16 -// lldb-command:print *u32_ref -// lldbg-check:[...]$9 = 32 +// lldb-command:v *u32_ref +// lldbg-check:[...] 32 // lldbr-check:(u32) *u32_ref = 32 -// lldb-command:print *u64_ref -// lldbg-check:[...]$10 = 64 +// lldb-command:v *u64_ref +// lldbg-check:[...] 64 // lldbr-check:(u64) *u64_ref = 64 -// lldb-command:print *f32_ref -// lldbg-check:[...]$11 = 2.5 +// lldb-command:v *f32_ref +// lldbg-check:[...] 2.5 // lldbr-check:(f32) *f32_ref = 2.5 -// lldb-command:print *f64_ref -// lldbg-check:[...]$12 = 3.5 +// lldb-command:v *f64_ref +// lldbg-check:[...] 3.5 // lldbr-check:(f64) *f64_ref = 3.5 #![allow(unused_variables)] diff --git a/tests/debuginfo/borrowed-c-style-enum.rs b/tests/debuginfo/borrowed-c-style-enum.rs index 950a05a0992..1a582e8a6d9 100644 --- a/tests/debuginfo/borrowed-c-style-enum.rs +++ b/tests/debuginfo/borrowed-c-style-enum.rs @@ -22,16 +22,16 @@ // lldb-command:run -// lldb-command:print *the_a_ref -// lldbg-check:[...]$0 = TheA +// lldb-command:v *the_a_ref +// lldbg-check:[...] TheA // lldbr-check:(borrowed_c_style_enum::ABC) *the_a_ref = borrowed_c_style_enum::ABC::TheA -// lldb-command:print *the_b_ref -// lldbg-check:[...]$1 = TheB +// lldb-command:v *the_b_ref +// lldbg-check:[...] TheB // lldbr-check:(borrowed_c_style_enum::ABC) *the_b_ref = borrowed_c_style_enum::ABC::TheB -// lldb-command:print *the_c_ref -// lldbg-check:[...]$2 = TheC +// lldb-command:v *the_c_ref +// lldbg-check:[...] TheC // lldbr-check:(borrowed_c_style_enum::ABC) *the_c_ref = borrowed_c_style_enum::ABC::TheC #![allow(unused_variables)] diff --git a/tests/debuginfo/borrowed-enum.rs b/tests/debuginfo/borrowed-enum.rs index aee4631a8b3..39883ffd0b6 100644 --- a/tests/debuginfo/borrowed-enum.rs +++ b/tests/debuginfo/borrowed-enum.rs @@ -22,11 +22,11 @@ // lldb-command:run -// lldb-command:print *the_a_ref +// lldb-command:v *the_a_ref // lldbr-check:(borrowed_enum::ABC::TheA) *the_a_ref = TheA { TheA: 0, TheB: 8970181431921507452 } -// lldb-command:print *the_b_ref +// lldb-command:v *the_b_ref // lldbr-check:(borrowed_enum::ABC::TheB) *the_b_ref = { = 0 = 286331153 = 286331153 } -// lldb-command:print *univariant_ref +// lldb-command:v *univariant_ref // lldbr-check:(borrowed_enum::Univariant) *univariant_ref = { TheOnlyCase = { = 4820353753753434 } } #![allow(unused_variables)] diff --git a/tests/debuginfo/borrowed-struct.rs b/tests/debuginfo/borrowed-struct.rs index 467de7878ee..d108a29592b 100644 --- a/tests/debuginfo/borrowed-struct.rs +++ b/tests/debuginfo/borrowed-struct.rs @@ -34,32 +34,32 @@ // lldb-command:run -// lldb-command:print *stack_val_ref -// lldbg-check:[...]$0 = { x = 10 y = 23.5 } +// lldb-command:v *stack_val_ref +// lldbg-check:[...] { x = 10 y = 23.5 } // lldbr-check:(borrowed_struct::SomeStruct) *stack_val_ref = (x = 10, y = 23.5) -// lldb-command:print *stack_val_interior_ref_1 -// lldbg-check:[...]$1 = 10 +// lldb-command:v *stack_val_interior_ref_1 +// lldbg-check:[...] 10 // lldbr-check:(isize) *stack_val_interior_ref_1 = 10 -// lldb-command:print *stack_val_interior_ref_2 -// lldbg-check:[...]$2 = 23.5 +// lldb-command:v *stack_val_interior_ref_2 +// lldbg-check:[...] 23.5 // lldbr-check:(f64) *stack_val_interior_ref_2 = 23.5 -// lldb-command:print *ref_to_unnamed -// lldbg-check:[...]$3 = { x = 11 y = 24.5 } +// lldb-command:v *ref_to_unnamed +// lldbg-check:[...] { x = 11 y = 24.5 } // lldbr-check:(borrowed_struct::SomeStruct) *ref_to_unnamed = (x = 11, y = 24.5) -// lldb-command:print *unique_val_ref -// lldbg-check:[...]$4 = { x = 13 y = 26.5 } +// lldb-command:v *unique_val_ref +// lldbg-check:[...] { x = 13 y = 26.5 } // lldbr-check:(borrowed_struct::SomeStruct) *unique_val_ref = (x = 13, y = 26.5) -// lldb-command:print *unique_val_interior_ref_1 -// lldbg-check:[...]$5 = 13 +// lldb-command:v *unique_val_interior_ref_1 +// lldbg-check:[...] 13 // lldbr-check:(isize) *unique_val_interior_ref_1 = 13 -// lldb-command:print *unique_val_interior_ref_2 -// lldbg-check:[...]$6 = 26.5 +// lldb-command:v *unique_val_interior_ref_2 +// lldbg-check:[...] 26.5 // lldbr-check:(f64) *unique_val_interior_ref_2 = 26.5 #![allow(unused_variables)] diff --git a/tests/debuginfo/borrowed-tuple.rs b/tests/debuginfo/borrowed-tuple.rs index 4fe1abbaba2..4c5643deb9d 100644 --- a/tests/debuginfo/borrowed-tuple.rs +++ b/tests/debuginfo/borrowed-tuple.rs @@ -23,16 +23,16 @@ // lldb-command:run -// lldb-command:print *stack_val_ref -// lldbg-check:[...]$0 = { 0 = -14 1 = -19 } +// lldb-command:v *stack_val_ref +// lldbg-check:[...] { 0 = -14 1 = -19 } // lldbr-check:((i16, f32)) *stack_val_ref = { 0 = -14 1 = -19 } -// lldb-command:print *ref_to_unnamed -// lldbg-check:[...]$1 = { 0 = -15 1 = -20 } +// lldb-command:v *ref_to_unnamed +// lldbg-check:[...] { 0 = -15 1 = -20 } // lldbr-check:((i16, f32)) *ref_to_unnamed = { 0 = -15 1 = -20 } -// lldb-command:print *unique_val_ref -// lldbg-check:[...]$2 = { 0 = -17 1 = -22 } +// lldb-command:v *unique_val_ref +// lldbg-check:[...] { 0 = -17 1 = -22 } // lldbr-check:((i16, f32)) *unique_val_ref = { 0 = -17 1 = -22 } diff --git a/tests/debuginfo/borrowed-unique-basic.rs b/tests/debuginfo/borrowed-unique-basic.rs index ae843c355bc..d6948a12851 100644 --- a/tests/debuginfo/borrowed-unique-basic.rs +++ b/tests/debuginfo/borrowed-unique-basic.rs @@ -55,60 +55,60 @@ // lldb-command:type format add -f decimal 'unsigned char' // lldb-command:run -// lldb-command:print *bool_ref -// lldbg-check:[...]$0 = true +// lldb-command:v *bool_ref +// lldbg-check:[...] true // lldbr-check:(bool) *bool_ref = true -// lldb-command:print *int_ref -// lldbg-check:[...]$1 = -1 +// lldb-command:v *int_ref +// lldbg-check:[...] -1 // lldbr-check:(isize) *int_ref = -1 // NOTE: only rust-enabled lldb supports 32bit chars // lldbr-command:print *char_ref // lldbr-check:(char) *char_ref = 97 -// lldb-command:print *i8_ref -// lldbg-check:[...]$2 = 68 +// lldb-command:v *i8_ref +// lldbg-check:[...] 68 // lldbr-check:(i8) *i8_ref = 68 -// lldb-command:print *i16_ref -// lldbg-check:[...]$3 = -16 +// lldb-command:v *i16_ref +// lldbg-check:[...] -16 // lldbr-check:(i16) *i16_ref = -16 -// lldb-command:print *i32_ref -// lldbg-check:[...]$4 = -32 +// lldb-command:v *i32_ref +// lldbg-check:[...] -32 // lldbr-check:(i32) *i32_ref = -32 -// lldb-command:print *i64_ref -// lldbg-check:[...]$5 = -64 +// lldb-command:v *i64_ref +// lldbg-check:[...] -64 // lldbr-check:(i64) *i64_ref = -64 -// lldb-command:print *uint_ref -// lldbg-check:[...]$6 = 1 +// lldb-command:v *uint_ref +// lldbg-check:[...] 1 // lldbr-check:(usize) *uint_ref = 1 -// lldb-command:print *u8_ref -// lldbg-check:[...]$7 = 100 +// lldb-command:v *u8_ref +// lldbg-check:[...] 100 // lldbr-check:(u8) *u8_ref = 100 -// lldb-command:print *u16_ref -// lldbg-check:[...]$8 = 16 +// lldb-command:v *u16_ref +// lldbg-check:[...] 16 // lldbr-check:(u16) *u16_ref = 16 -// lldb-command:print *u32_ref -// lldbg-check:[...]$9 = 32 +// lldb-command:v *u32_ref +// lldbg-check:[...] 32 // lldbr-check:(u32) *u32_ref = 32 -// lldb-command:print *u64_ref -// lldbg-check:[...]$10 = 64 +// lldb-command:v *u64_ref +// lldbg-check:[...] 64 // lldbr-check:(u64) *u64_ref = 64 -// lldb-command:print *f32_ref -// lldbg-check:[...]$11 = 2.5 +// lldb-command:v *f32_ref +// lldbg-check:[...] 2.5 // lldbr-check:(f32) *f32_ref = 2.5 -// lldb-command:print *f64_ref -// lldbg-check:[...]$12 = 3.5 +// lldb-command:v *f64_ref +// lldbg-check:[...] 3.5 // lldbr-check:(f64) *f64_ref = 3.5 #![allow(unused_variables)] diff --git a/tests/debuginfo/box.rs b/tests/debuginfo/box.rs index f2e744e87b9..46019bcb1a7 100644 --- a/tests/debuginfo/box.rs +++ b/tests/debuginfo/box.rs @@ -16,11 +16,11 @@ // === LLDB TESTS ================================================================================== // lldb-command:run -// lldb-command:print *a -// lldbg-check:[...]$0 = 1 +// lldb-command:v *a +// lldbg-check:[...] 1 // lldbr-check:(i32) *a = 1 -// lldb-command:print *b -// lldbg-check:[...]$1 = { 0 = 2 1 = 3.5 } +// lldb-command:v *b +// lldbg-check:[...] { 0 = 2 1 = 3.5 } // lldbr-check:((i32, f64)) *b = { 0 = 2 1 = 3.5 } #![allow(unused_variables)] diff --git a/tests/debuginfo/boxed-struct.rs b/tests/debuginfo/boxed-struct.rs index c47bffb3a38..1ee639690ea 100644 --- a/tests/debuginfo/boxed-struct.rs +++ b/tests/debuginfo/boxed-struct.rs @@ -19,12 +19,12 @@ // lldb-command:run -// lldb-command:print *boxed_with_padding -// lldbg-check:[...]$0 = { x = 99 y = 999 z = 9999 w = 99999 } +// lldb-command:v *boxed_with_padding +// lldbg-check:[...] { x = 99 y = 999 z = 9999 w = 99999 } // lldbr-check:(boxed_struct::StructWithSomePadding) *boxed_with_padding = { x = 99 y = 999 z = 9999 w = 99999 } -// lldb-command:print *boxed_with_dtor -// lldbg-check:[...]$1 = { x = 77 y = 777 z = 7777 w = 77777 } +// lldb-command:v *boxed_with_dtor +// lldbg-check:[...] { x = 77 y = 777 z = 7777 w = 77777 } // lldbr-check:(boxed_struct::StructWithDestructor) *boxed_with_dtor = { x = 77 y = 777 z = 7777 w = 77777 } #![allow(unused_variables)] diff --git a/tests/debuginfo/by-value-non-immediate-argument.rs b/tests/debuginfo/by-value-non-immediate-argument.rs index 52e3dc9a76b..e0ae4458d03 100644 --- a/tests/debuginfo/by-value-non-immediate-argument.rs +++ b/tests/debuginfo/by-value-non-immediate-argument.rs @@ -41,28 +41,28 @@ // lldb-command:run -// lldb-command:print s -// lldb-check:[...]$0 = Struct { a: 1, b: 2.5 } +// lldb-command:v s +// lldb-check:[...] Struct { a: 1, b: 2.5 } // lldb-command:continue -// lldb-command:print x -// lldb-check:[...]$1 = Struct { a: 3, b: 4.5 } -// lldb-command:print y -// lldb-check:[...]$2 = 5 -// lldb-command:print z -// lldb-check:[...]$3 = 6.5 +// lldb-command:v x +// lldb-check:[...] Struct { a: 3, b: 4.5 } +// lldb-command:v y +// lldb-check:[...] 5 +// lldb-command:v z +// lldb-check:[...] 6.5 // lldb-command:continue -// lldb-command:print a -// lldb-check:[...]$4 = (7, 8, 9.5, 10.5) +// lldb-command:v a +// lldb-check:[...] (7, 8, 9.5, 10.5) // lldb-command:continue -// lldb-command:print a -// lldb-check:[...]$5 = Newtype(11.5, 12.5, 13, 14) +// lldb-command:v a +// lldb-check:[...] Newtype(11.5, 12.5, 13, 14) // lldb-command:continue -// lldb-command:print x -// lldb-check:[...]$6 = Case1 { x: 0, y: 8970181431921507452 } +// lldb-command:v x +// lldb-check:[...] Case1 { x: 0, y: 8970181431921507452 } // lldb-command:continue #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/by-value-self-argument-in-trait-impl.rs b/tests/debuginfo/by-value-self-argument-in-trait-impl.rs index 247d6c27a06..5276ec82733 100644 --- a/tests/debuginfo/by-value-self-argument-in-trait-impl.rs +++ b/tests/debuginfo/by-value-self-argument-in-trait-impl.rs @@ -25,18 +25,18 @@ // lldb-command:run -// lldb-command:print self -// lldbg-check:[...]$0 = 1111 +// lldb-command:v self +// lldbg-check:[...] 1111 // lldbr-check:(isize) self = 1111 // lldb-command:continue -// lldb-command:print self -// lldbg-check:[...]$1 = { x = 2222 y = 3333 } +// lldb-command:v self +// lldbg-check:[...] { x = 2222 y = 3333 } // lldbr-check:(by_value_self_argument_in_trait_impl::Struct) self = { x = 2222 y = 3333 } // lldb-command:continue -// lldb-command:print self -// lldbg-check:[...] $2 = { 0 = 4444.5 1 = 5555 2 = 6666 3 = 7777.5 } +// lldb-command:v self +// lldbg-check:[...] { 0 = 4444.5 1 = 5555 2 = 6666 3 = 7777.5 } // lldbr-check:((f64, isize, isize, f64)) self = { 0 = 4444.5 1 = 5555 2 = 6666 3 = 7777.5 } // lldb-command:continue diff --git a/tests/debuginfo/c-style-enum-in-composite.rs b/tests/debuginfo/c-style-enum-in-composite.rs index 3f0968f09af..ec11d5f4655 100644 --- a/tests/debuginfo/c-style-enum-in-composite.rs +++ b/tests/debuginfo/c-style-enum-in-composite.rs @@ -38,32 +38,32 @@ // lldb-command:run -// lldb-command:print tuple_interior_padding -// lldbg-check:[...]$0 = { 0 = 0 1 = OneHundred } +// lldb-command:v tuple_interior_padding +// lldbg-check:[...] { 0 = 0 1 = OneHundred } // lldbr-check:((i16, c_style_enum_in_composite::AnEnum)) tuple_interior_padding = { 0 = 0 1 = OneHundred } -// lldb-command:print tuple_padding_at_end -// lldbg-check:[...]$1 = { 0 = { 0 = 1 1 = OneThousand } 1 = 2 } +// lldb-command:v tuple_padding_at_end +// lldbg-check:[...] { 0 = { 0 = 1 1 = OneThousand } 1 = 2 } // lldbr-check:(((u64, c_style_enum_in_composite::AnEnum), u64)) tuple_padding_at_end = { 0 = { 0 = 1 1 = OneThousand } 1 = 2 } -// lldb-command:print tuple_different_enums -// lldbg-check:[...]$2 = { 0 = OneThousand 1 = MountainView 2 = OneMillion 3 = Vienna } +// lldb-command:v tuple_different_enums +// lldbg-check:[...] { 0 = OneThousand 1 = MountainView 2 = OneMillion 3 = Vienna } // lldbr-check:((c_style_enum_in_composite::AnEnum, c_style_enum_in_composite::AnotherEnum, c_style_enum_in_composite::AnEnum, c_style_enum_in_composite::AnotherEnum)) tuple_different_enums = { 0 = c_style_enum_in_composite::AnEnum::OneThousand 1 = c_style_enum_in_composite::AnotherEnum::MountainView 2 = c_style_enum_in_composite::AnEnum::OneMillion 3 = c_style_enum_in_composite::AnotherEnum::Vienna } -// lldb-command:print padded_struct -// lldbg-check:[...]$3 = { a = 3 b = OneMillion c = 4 d = Toronto e = 5 } +// lldb-command:v padded_struct +// lldbg-check:[...] { a = 3 b = OneMillion c = 4 d = Toronto e = 5 } // lldbr-check:(c_style_enum_in_composite::PaddedStruct) padded_struct = { a = 3 b = c_style_enum_in_composite::AnEnum::OneMillion c = 4 d = Toronto e = 5 } -// lldb-command:print packed_struct -// lldbg-check:[...]$4 = { a = 6 b = OneHundred c = 7 d = Vienna e = 8 } +// lldb-command:v packed_struct +// lldbg-check:[...] { a = 6 b = OneHundred c = 7 d = Vienna e = 8 } // lldbr-check:(c_style_enum_in_composite::PackedStruct) packed_struct = { a = 6 b = c_style_enum_in_composite::AnEnum::OneHundred c = 7 d = Vienna e = 8 } -// lldb-command:print non_padded_struct -// lldbg-check:[...]$5 = { a = OneMillion b = MountainView c = OneThousand d = Toronto } +// lldb-command:v non_padded_struct +// lldbg-check:[...] { a = OneMillion b = MountainView c = OneThousand d = Toronto } // lldbr-check:(c_style_enum_in_composite::NonPaddedStruct) non_padded_struct = { a = c_style_enum_in_composite::AnEnum::OneMillion, b = c_style_enum_in_composite::AnotherEnum::MountainView, c = c_style_enum_in_composite::AnEnum::OneThousand, d = c_style_enum_in_composite::AnotherEnum::Toronto } -// lldb-command:print struct_with_drop -// lldbg-check:[...]$6 = { 0 = { a = OneHundred b = Vienna } 1 = 9 } +// lldb-command:v struct_with_drop +// lldbg-check:[...] { 0 = { a = OneHundred b = Vienna } 1 = 9 } // lldbr-check:((c_style_enum_in_composite::StructWithDrop, i64)) struct_with_drop = { 0 = { a = c_style_enum_in_composite::AnEnum::OneHundred b = c_style_enum_in_composite::AnotherEnum::Vienna } 1 = 9 } #![allow(unused_variables)] diff --git a/tests/debuginfo/c-style-enum.rs b/tests/debuginfo/c-style-enum.rs index 2794575d328..395b94c59a4 100644 --- a/tests/debuginfo/c-style-enum.rs +++ b/tests/debuginfo/c-style-enum.rs @@ -96,32 +96,32 @@ // lldb-command:run -// lldb-command:print auto_one -// lldbg-check:[...]$0 = One +// lldb-command:v auto_one +// lldbg-check:[...] One // lldbr-check:(c_style_enum::AutoDiscriminant) auto_one = c_style_enum::AutoDiscriminant::One -// lldb-command:print auto_two -// lldbg-check:[...]$1 = Two +// lldb-command:v auto_two +// lldbg-check:[...] Two // lldbr-check:(c_style_enum::AutoDiscriminant) auto_two = c_style_enum::AutoDiscriminant::Two -// lldb-command:print auto_three -// lldbg-check:[...]$2 = Three +// lldb-command:v auto_three +// lldbg-check:[...] Three // lldbr-check:(c_style_enum::AutoDiscriminant) auto_three = c_style_enum::AutoDiscriminant::Three -// lldb-command:print manual_one_hundred -// lldbg-check:[...]$3 = OneHundred +// lldb-command:v manual_one_hundred +// lldbg-check:[...] OneHundred // lldbr-check:(c_style_enum::ManualDiscriminant) manual_one_hundred = c_style_enum::ManualDiscriminant::OneHundred -// lldb-command:print manual_one_thousand -// lldbg-check:[...]$4 = OneThousand +// lldb-command:v manual_one_thousand +// lldbg-check:[...] OneThousand // lldbr-check:(c_style_enum::ManualDiscriminant) manual_one_thousand = c_style_enum::ManualDiscriminant::OneThousand -// lldb-command:print manual_one_million -// lldbg-check:[...]$5 = OneMillion +// lldb-command:v manual_one_million +// lldbg-check:[...] OneMillion // lldbr-check:(c_style_enum::ManualDiscriminant) manual_one_million = c_style_enum::ManualDiscriminant::OneMillion -// lldb-command:print single_variant -// lldbg-check:[...]$6 = TheOnlyVariant +// lldb-command:v single_variant +// lldbg-check:[...] TheOnlyVariant // lldbr-check:(c_style_enum::SingleVariant) single_variant = c_style_enum::SingleVariant::TheOnlyVariant #![allow(unused_variables)] diff --git a/tests/debuginfo/captured-fields-1.rs b/tests/debuginfo/captured-fields-1.rs index f5fdf4fb3d9..d96f2590570 100644 --- a/tests/debuginfo/captured-fields-1.rs +++ b/tests/debuginfo/captured-fields-1.rs @@ -25,23 +25,23 @@ // === LLDB TESTS ================================================================================== // lldb-command:run -// lldb-command:print test -// lldbg-check:(captured_fields_1::main::{closure_env#0}) $0 = { _ref__my_ref__my_field1 = 0x[...] } +// lldb-command:v test +// lldbg-check:(captured_fields_1::main::{closure_env#0}) test = { _ref__my_ref__my_field1 = 0x[...] } // lldb-command:continue -// lldb-command:print test -// lldbg-check:(captured_fields_1::main::{closure_env#1}) $1 = { _ref__my_ref__my_field2 = 0x[...] } +// lldb-command:v test +// lldbg-check:(captured_fields_1::main::{closure_env#1}) test = { _ref__my_ref__my_field2 = 0x[...] } // lldb-command:continue -// lldb-command:print test -// lldbg-check:(captured_fields_1::main::{closure_env#2}) $2 = { _ref__my_ref = 0x[...] } +// lldb-command:v test +// lldbg-check:(captured_fields_1::main::{closure_env#2}) test = { _ref__my_ref = 0x[...] } // lldb-command:continue -// lldb-command:print test -// lldbg-check:(captured_fields_1::main::{closure_env#3}) $3 = { my_ref = 0x[...] } +// lldb-command:v test +// lldbg-check:(captured_fields_1::main::{closure_env#3}) test = { my_ref = 0x[...] } // lldb-command:continue -// lldb-command:print test -// lldbg-check:(captured_fields_1::main::{closure_env#4}) $4 = { my_var__my_field2 = 22 } +// lldb-command:v test +// lldbg-check:(captured_fields_1::main::{closure_env#4}) test = { my_var__my_field2 = 22 } // lldb-command:continue -// lldb-command:print test -// lldbg-check:(captured_fields_1::main::{closure_env#5}) $5 = { my_var = { my_field1 = 11 my_field2 = 22 } } +// lldb-command:v test +// lldbg-check:(captured_fields_1::main::{closure_env#5}) test = { my_var = { my_field1 = 11 my_field2 = 22 } } // lldb-command:continue #![allow(unused)] diff --git a/tests/debuginfo/captured-fields-2.rs b/tests/debuginfo/captured-fields-2.rs index aaf4fa1bc45..446c5c70fef 100644 --- a/tests/debuginfo/captured-fields-2.rs +++ b/tests/debuginfo/captured-fields-2.rs @@ -13,11 +13,11 @@ // === LLDB TESTS ================================================================================== // lldb-command:run -// lldb-command:print my_ref__my_field1 -// lldbg-check:(unsigned int) $0 = 11 +// lldb-command:v my_ref__my_field1 +// lldbg-check:(unsigned int) my_ref__my_field1 = 11 // lldb-command:continue -// lldb-command:print my_var__my_field2 -// lldbg-check:(unsigned int) $1 = 22 +// lldb-command:v my_var__my_field2 +// lldbg-check:(unsigned int) my_var__my_field2 = 22 // lldb-command:continue #![allow(unused)] diff --git a/tests/debuginfo/closure-in-generic-function.rs b/tests/debuginfo/closure-in-generic-function.rs index 676a624191c..ef0f2b0b464 100644 --- a/tests/debuginfo/closure-in-generic-function.rs +++ b/tests/debuginfo/closure-in-generic-function.rs @@ -23,19 +23,19 @@ // lldb-command:run -// lldb-command:print x -// lldbg-check:[...]$0 = 0.5 +// lldb-command:v x +// lldbg-check:[...] 0.5 // lldbr-check:(f64) x = 0.5 -// lldb-command:print y -// lldbg-check:[...]$1 = 10 +// lldb-command:v y +// lldbg-check:[...] 10 // lldbr-check:(i32) y = 10 // lldb-command:continue -// lldb-command:print *x -// lldbg-check:[...]$2 = 29 +// lldb-command:v *x +// lldbg-check:[...] 29 // lldbr-check:(i32) *x = 29 -// lldb-command:print *y -// lldbg-check:[...]$3 = 110 +// lldb-command:v *y +// lldbg-check:[...] 110 // lldbr-check:(i32) *y = 110 // lldb-command:continue diff --git a/tests/debuginfo/coroutine-locals.rs b/tests/debuginfo/coroutine-locals.rs index 0430e1d313b..54b5cd577c8 100644 --- a/tests/debuginfo/coroutine-locals.rs +++ b/tests/debuginfo/coroutine-locals.rs @@ -27,32 +27,24 @@ // === LLDB TESTS ================================================================================== // lldb-command:run -// lldb-command:print a -// lldbg-check:(int) $0 = 5 -// lldbr-check:(int) a = 5 -// lldb-command:print c -// lldbg-check:(int) $1 = 6 -// lldbr-check:(int) c = 6 -// lldb-command:print d -// lldbg-check:(int) $2 = 7 -// lldbr-check:(int) d = 7 +// lldb-command:v a +// lldb-check:(int) a = 5 +// lldb-command:v c +// lldb-check:(int) c = 6 +// lldb-command:v d +// lldb-check:(int) d = 7 // lldb-command:continue -// lldb-command:print a -// lldbg-check:(int) $3 = 7 -// lldbr-check:(int) a = 7 -// lldb-command:print c -// lldbg-check:(int) $4 = 6 -// lldbr-check:(int) c = 6 -// lldb-command:print e -// lldbg-check:(int) $5 = 8 -// lldbr-check:(int) e = 8 +// lldb-command:v a +// lldb-check:(int) a = 7 +// lldb-command:v c +// lldb-check:(int) c = 6 +// lldb-command:v e +// lldb-check:(int) e = 8 // lldb-command:continue -// lldb-command:print a -// lldbg-check:(int) $6 = 8 -// lldbr-check:(int) a = 8 -// lldb-command:print c -// lldbg-check:(int) $7 = 6 -// lldbr-check:(int) c = 6 +// lldb-command:v a +// lldb-check:(int) a = 8 +// lldb-command:v c +// lldb-check:(int) c = 6 #![feature(omit_gdb_pretty_printer_section, coroutines, coroutine_trait)] #![omit_gdb_pretty_printer_section] diff --git a/tests/debuginfo/coroutine-objects.rs b/tests/debuginfo/coroutine-objects.rs index 98b37ac2001..9e1bd5d62e7 100644 --- a/tests/debuginfo/coroutine-objects.rs +++ b/tests/debuginfo/coroutine-objects.rs @@ -25,17 +25,17 @@ // === LLDB TESTS ================================================================================== // lldb-command:run -// lldb-command:print b -// lldbg-check:(coroutine_objects::main::{coroutine_env#0}) $0 = +// lldb-command:v b +// lldbg-check:(coroutine_objects::main::{coroutine_env#0}) b = // lldb-command:continue -// lldb-command:print b -// lldbg-check:(coroutine_objects::main::{coroutine_env#0}) $1 = +// lldb-command:v b +// lldbg-check:(coroutine_objects::main::{coroutine_env#0}) b = // lldb-command:continue -// lldb-command:print b -// lldbg-check:(coroutine_objects::main::{coroutine_env#0}) $2 = +// lldb-command:v b +// lldbg-check:(coroutine_objects::main::{coroutine_env#0}) b = // lldb-command:continue -// lldb-command:print b -// lldbg-check:(coroutine_objects::main::{coroutine_env#0}) $3 = +// lldb-command:v b +// lldbg-check:(coroutine_objects::main::{coroutine_env#0}) b = // === CDB TESTS =================================================================================== diff --git a/tests/debuginfo/cross-crate-spans.rs b/tests/debuginfo/cross-crate-spans.rs index 75550e1794c..cf3f8e1eadf 100644 --- a/tests/debuginfo/cross-crate-spans.rs +++ b/tests/debuginfo/cross-crate-spans.rs @@ -43,25 +43,25 @@ extern crate cross_crate_spans; // lldb-command:b cross_crate_spans.rs:14 // lldb-command:run -// lldb-command:print result -// lldbg-check:[...]$0 = { 0 = 17 1 = 17 } +// lldb-command:v result +// lldbg-check:[...] { 0 = 17 1 = 17 } // lldbr-check:((u32, u32)) result = { 0 = 17 1 = 17 } -// lldb-command:print a_variable -// lldbg-check:[...]$1 = 123456789 +// lldb-command:v a_variable +// lldbg-check:[...] 123456789 // lldbr-check:(u32) a_variable = 123456789 -// lldb-command:print another_variable -// lldbg-check:[...]$2 = 123456789.5 +// lldb-command:v another_variable +// lldbg-check:[...] 123456789.5 // lldbr-check:(f64) another_variable = 123456789.5 // lldb-command:continue -// lldb-command:print result -// lldbg-check:[...]$3 = { 0 = 1212 1 = 1212 } +// lldb-command:v result +// lldbg-check:[...] { 0 = 1212 1 = 1212 } // lldbr-check:((i16, i16)) result = { 0 = 1212 1 = 1212 } -// lldb-command:print a_variable -// lldbg-check:[...]$4 = 123456789 +// lldb-command:v a_variable +// lldbg-check:[...] 123456789 // lldbr-check:(u32) a_variable = 123456789 -// lldb-command:print another_variable -// lldbg-check:[...]$5 = 123456789.5 +// lldb-command:v another_variable +// lldbg-check:[...] 123456789.5 // lldbr-check:(f64) another_variable = 123456789.5 // lldb-command:continue diff --git a/tests/debuginfo/destructured-fn-argument.rs b/tests/debuginfo/destructured-fn-argument.rs index e6e697c518a..74e18a594d7 100644 --- a/tests/debuginfo/destructured-fn-argument.rs +++ b/tests/debuginfo/destructured-fn-argument.rs @@ -163,196 +163,196 @@ // lldb-command:run -// lldb-command:print a -// lldbg-check:[...]$0 = 1 +// lldb-command:v a +// lldbg-check:[...] 1 // lldbr-check:(isize) a = 1 -// lldb-command:print b -// lldbg-check:[...]$1 = false +// lldb-command:v b +// lldbg-check:[...] false // lldbr-check:(bool) b = false // lldb-command:continue -// lldb-command:print a -// lldbg-check:[...]$2 = 2 +// lldb-command:v a +// lldbg-check:[...] 2 // lldbr-check:(isize) a = 2 -// lldb-command:print b -// lldbg-check:[...]$3 = 3 +// lldb-command:v b +// lldbg-check:[...] 3 // lldbr-check:(u16) b = 3 -// lldb-command:print c -// lldbg-check:[...]$4 = 4 +// lldb-command:v c +// lldbg-check:[...] 4 // lldbr-check:(u16) c = 4 // lldb-command:continue -// lldb-command:print a -// lldbg-check:[...]$5 = 5 +// lldb-command:v a +// lldbg-check:[...] 5 // lldbr-check:(isize) a = 5 -// lldb-command:print b -// lldbg-check:[...]$6 = { 0 = 6 1 = 7 } +// lldb-command:v b +// lldbg-check:[...] { 0 = 6 1 = 7 } // lldbr-check:((u32, u32)) b = { 0 = 6 1 = 7 } // lldb-command:continue -// lldb-command:print h -// lldbg-check:[...]$7 = 8 +// lldb-command:v h +// lldbg-check:[...] 8 // lldbr-check:(i16) h = 8 -// lldb-command:print i -// lldbg-check:[...]$8 = { a = 9 b = 10 } +// lldb-command:v i +// lldbg-check:[...] { a = 9 b = 10 } // lldbr-check:(destructured_fn_argument::Struct) i = { a = 9 b = 10 } -// lldb-command:print j -// lldbg-check:[...]$9 = 11 +// lldb-command:v j +// lldbg-check:[...] 11 // lldbr-check:(i16) j = 11 // lldb-command:continue -// lldb-command:print k -// lldbg-check:[...]$10 = 12 +// lldb-command:v k +// lldbg-check:[...] 12 // lldbr-check:(i64) k = 12 -// lldb-command:print l -// lldbg-check:[...]$11 = 13 +// lldb-command:v l +// lldbg-check:[...] 13 // lldbr-check:(i32) l = 13 // lldb-command:continue -// lldb-command:print m -// lldbg-check:[...]$12 = 14 +// lldb-command:v m +// lldbg-check:[...] 14 // lldbr-check:(isize) m = 14 -// lldb-command:print n -// lldbg-check:[...]$13 = 16 +// lldb-command:v n +// lldbg-check:[...] 16 // lldbr-check:(i32) n = 16 // lldb-command:continue -// lldb-command:print o -// lldbg-check:[...]$14 = 18 +// lldb-command:v o +// lldbg-check:[...] 18 // lldbr-check:(i32) o = 18 // lldb-command:continue -// lldb-command:print p -// lldbg-check:[...]$15 = 19 +// lldb-command:v p +// lldbg-check:[...] 19 // lldbr-check:(i64) p = 19 -// lldb-command:print q -// lldbg-check:[...]$16 = 20 +// lldb-command:v q +// lldbg-check:[...] 20 // lldbr-check:(i32) q = 20 -// lldb-command:print r -// lldbg-check:[...]$17 = { a = 21 b = 22 } +// lldb-command:v r +// lldbg-check:[...] { a = 21 b = 22 } // lldbr-check:(destructured_fn_argument::Struct) r = { a = 21, b = 22 } // lldb-command:continue -// lldb-command:print s -// lldbg-check:[...]$18 = 24 +// lldb-command:v s +// lldbg-check:[...] 24 // lldbr-check:(i32) s = 24 -// lldb-command:print t -// lldbg-check:[...]$19 = 23 +// lldb-command:v t +// lldbg-check:[...] 23 // lldbr-check:(i64) t = 23 // lldb-command:continue -// lldb-command:print u -// lldbg-check:[...]$20 = 25 +// lldb-command:v u +// lldbg-check:[...] 25 // lldbr-check:(i16) u = 25 -// lldb-command:print v -// lldbg-check:[...]$21 = 26 +// lldb-command:v v +// lldbg-check:[...] 26 // lldbr-check:(i32) v = 26 -// lldb-command:print w -// lldbg-check:[...]$22 = 27 +// lldb-command:v w +// lldbg-check:[...] 27 // lldbr-check:(i64) w = 27 -// lldb-command:print x -// lldbg-check:[...]$23 = 28 +// lldb-command:v x +// lldbg-check:[...] 28 // lldbr-check:(i32) x = 28 -// lldb-command:print y -// lldbg-check:[...]$24 = 29 +// lldb-command:v y +// lldbg-check:[...] 29 // lldbr-check:(i64) y = 29 -// lldb-command:print z -// lldbg-check:[...]$25 = 30 +// lldb-command:v z +// lldbg-check:[...] 30 // lldbr-check:(i32) z = 30 -// lldb-command:print ae -// lldbg-check:[...]$26 = 31 +// lldb-command:v ae +// lldbg-check:[...] 31 // lldbr-check:(i64) ae = 31 -// lldb-command:print oe -// lldbg-check:[...]$27 = 32 +// lldb-command:v oe +// lldbg-check:[...] 32 // lldbr-check:(i32) oe = 32 -// lldb-command:print ue -// lldbg-check:[...]$28 = 33 +// lldb-command:v ue +// lldbg-check:[...] 33 // lldbr-check:(u16) ue = 33 // lldb-command:continue -// lldb-command:print aa -// lldbg-check:[...]$29 = { 0 = 34 1 = 35 } +// lldb-command:v aa +// lldbg-check:[...] { 0 = 34 1 = 35 } // lldbr-check:((isize, isize)) aa = { 0 = 34 1 = 35 } // lldb-command:continue -// lldb-command:print bb -// lldbg-check:[...]$30 = { 0 = 36 1 = 37 } +// lldb-command:v bb +// lldbg-check:[...] { 0 = 36 1 = 37 } // lldbr-check:((isize, isize)) bb = { 0 = 36 1 = 37 } // lldb-command:continue -// lldb-command:print cc -// lldbg-check:[...]$31 = 38 +// lldb-command:v cc +// lldbg-check:[...] 38 // lldbr-check:(isize) cc = 38 // lldb-command:continue -// lldb-command:print dd -// lldbg-check:[...]$32 = { 0 = 40 1 = 41 2 = 42 } +// lldb-command:v dd +// lldbg-check:[...] { 0 = 40 1 = 41 2 = 42 } // lldbr-check:((isize, isize, isize)) dd = { 0 = 40 1 = 41 2 = 42 } // lldb-command:continue -// lldb-command:print *ee -// lldbg-check:[...]$33 = { 0 = 43 1 = 44 2 = 45 } +// lldb-command:v *ee +// lldbg-check:[...] { 0 = 43 1 = 44 2 = 45 } // lldbr-check:((isize, isize, isize)) *ee = { 0 = 43 1 = 44 2 = 45 } // lldb-command:continue -// lldb-command:print *ff -// lldbg-check:[...]$34 = 46 +// lldb-command:v *ff +// lldbg-check:[...] 46 // lldbr-check:(isize) *ff = 46 -// lldb-command:print gg -// lldbg-check:[...]$35 = { 0 = 47 1 = 48 } +// lldb-command:v gg +// lldbg-check:[...] { 0 = 47 1 = 48 } // lldbr-check:((isize, isize)) gg = { 0 = 47 1 = 48 } // lldb-command:continue -// lldb-command:print *hh -// lldbg-check:[...]$36 = 50 +// lldb-command:v *hh +// lldbg-check:[...] 50 // lldbr-check:(i32) *hh = 50 // lldb-command:continue -// lldb-command:print ii -// lldbg-check:[...]$37 = 51 +// lldb-command:v ii +// lldbg-check:[...] 51 // lldbr-check:(i32) ii = 51 // lldb-command:continue -// lldb-command:print *jj -// lldbg-check:[...]$38 = 52 +// lldb-command:v *jj +// lldbg-check:[...] 52 // lldbr-check:(i32) *jj = 52 // lldb-command:continue -// lldb-command:print kk -// lldbg-check:[...]$39 = 53 +// lldb-command:v kk +// lldbg-check:[...] 53 // lldbr-check:(f64) kk = 53 -// lldb-command:print ll -// lldbg-check:[...]$40 = 54 +// lldb-command:v ll +// lldbg-check:[...] 54 // lldbr-check:(isize) ll = 54 // lldb-command:continue -// lldb-command:print mm -// lldbg-check:[...]$41 = 55 +// lldb-command:v mm +// lldbg-check:[...] 55 // lldbr-check:(f64) mm = 55 -// lldb-command:print *nn -// lldbg-check:[...]$42 = 56 +// lldb-command:v *nn +// lldbg-check:[...] 56 // lldbr-check:(isize) *nn = 56 // lldb-command:continue -// lldb-command:print oo -// lldbg-check:[...]$43 = 57 +// lldb-command:v oo +// lldbg-check:[...] 57 // lldbr-check:(isize) oo = 57 -// lldb-command:print pp -// lldbg-check:[...]$44 = 58 +// lldb-command:v pp +// lldbg-check:[...] 58 // lldbr-check:(isize) pp = 58 -// lldb-command:print qq -// lldbg-check:[...]$45 = 59 +// lldb-command:v qq +// lldbg-check:[...] 59 // lldbr-check:(isize) qq = 59 // lldb-command:continue -// lldb-command:print rr -// lldbg-check:[...]$46 = 60 +// lldb-command:v rr +// lldbg-check:[...] 60 // lldbr-check:(isize) rr = 60 -// lldb-command:print ss -// lldbg-check:[...]$47 = 61 +// lldb-command:v ss +// lldbg-check:[...] 61 // lldbr-check:(isize) ss = 61 -// lldb-command:print tt -// lldbg-check:[...]$48 = 62 +// lldb-command:v tt +// lldbg-check:[...] 62 // lldbr-check:(isize) tt = 62 // lldb-command:continue diff --git a/tests/debuginfo/destructured-for-loop-variable.rs b/tests/debuginfo/destructured-for-loop-variable.rs index 3e27d122c4b..1cad8bcfacb 100644 --- a/tests/debuginfo/destructured-for-loop-variable.rs +++ b/tests/debuginfo/destructured-for-loop-variable.rs @@ -84,90 +84,90 @@ // lldb-command:run // DESTRUCTURED STRUCT -// lldb-command:print x -// lldbg-check:[...]$0 = 400 +// lldb-command:v x +// lldbg-check:[...] 400 // lldbr-check:(i16) x = 400 -// lldb-command:print y -// lldbg-check:[...]$1 = 401.5 +// lldb-command:v y +// lldbg-check:[...] 401.5 // lldbr-check:(f32) y = 401.5 -// lldb-command:print z -// lldbg-check:[...]$2 = true +// lldb-command:v z +// lldbg-check:[...] true // lldbr-check:(bool) z = true // lldb-command:continue // DESTRUCTURED TUPLE -// lldb-command:print _i8 -// lldbg-check:[...]$3 = 0x6f +// lldb-command:v _i8 +// lldbg-check:[...] 0x6f // lldbr-check:(i8) _i8 = 111 -// lldb-command:print _u8 -// lldbg-check:[...]$4 = 0x70 +// lldb-command:v _u8 +// lldbg-check:[...] 0x70 // lldbr-check:(u8) _u8 = 112 -// lldb-command:print _i16 -// lldbg-check:[...]$5 = -113 +// lldb-command:v _i16 +// lldbg-check:[...] -113 // lldbr-check:(i16) _i16 = -113 -// lldb-command:print _u16 -// lldbg-check:[...]$6 = 114 +// lldb-command:v _u16 +// lldbg-check:[...] 114 // lldbr-check:(u16) _u16 = 114 -// lldb-command:print _i32 -// lldbg-check:[...]$7 = -115 +// lldb-command:v _i32 +// lldbg-check:[...] -115 // lldbr-check:(i32) _i32 = -115 -// lldb-command:print _u32 -// lldbg-check:[...]$8 = 116 +// lldb-command:v _u32 +// lldbg-check:[...] 116 // lldbr-check:(u32) _u32 = 116 -// lldb-command:print _i64 -// lldbg-check:[...]$9 = -117 +// lldb-command:v _i64 +// lldbg-check:[...] -117 // lldbr-check:(i64) _i64 = -117 -// lldb-command:print _u64 -// lldbg-check:[...]$10 = 118 +// lldb-command:v _u64 +// lldbg-check:[...] 118 // lldbr-check:(u64) _u64 = 118 -// lldb-command:print _f32 -// lldbg-check:[...]$11 = 119.5 +// lldb-command:v _f32 +// lldbg-check:[...] 119.5 // lldbr-check:(f32) _f32 = 119.5 -// lldb-command:print _f64 -// lldbg-check:[...]$12 = 120.5 +// lldb-command:v _f64 +// lldbg-check:[...] 120.5 // lldbr-check:(f64) _f64 = 120.5 // lldb-command:continue // MORE COMPLEX CASE -// lldb-command:print v1 -// lldbg-check:[...]$13 = 80000 +// lldb-command:v v1 +// lldbg-check:[...] 80000 // lldbr-check:(i32) v1 = 80000 -// lldb-command:print x1 -// lldbg-check:[...]$14 = 8000 +// lldb-command:v x1 +// lldbg-check:[...] 8000 // lldbr-check:(i16) x1 = 8000 -// lldb-command:print *y1 -// lldbg-check:[...]$15 = 80001.5 +// lldb-command:v *y1 +// lldbg-check:[...] 80001.5 // lldbr-check:(f32) *y1 = 80001.5 -// lldb-command:print z1 -// lldbg-check:[...]$16 = false +// lldb-command:v z1 +// lldbg-check:[...] false // lldbr-check:(bool) z1 = false -// lldb-command:print *x2 -// lldbg-check:[...]$17 = -30000 +// lldb-command:v *x2 +// lldbg-check:[...] -30000 // lldbr-check:(i16) *x2 = -30000 -// lldb-command:print y2 -// lldbg-check:[...]$18 = -300001.5 +// lldb-command:v y2 +// lldbg-check:[...] -300001.5 // lldbr-check:(f32) y2 = -300001.5 -// lldb-command:print *z2 -// lldbg-check:[...]$19 = true +// lldb-command:v *z2 +// lldbg-check:[...] true // lldbr-check:(bool) *z2 = true -// lldb-command:print v2 -// lldbg-check:[...]$20 = 854237.5 +// lldb-command:v v2 +// lldbg-check:[...] 854237.5 // lldbr-check:(f64) v2 = 854237.5 // lldb-command:continue // SIMPLE IDENTIFIER -// lldb-command:print i -// lldbg-check:[...]$21 = 1234 +// lldb-command:v i +// lldbg-check:[...] 1234 // lldbr-check:(i32) i = 1234 // lldb-command:continue -// lldb-command:print simple_struct_ident -// lldbg-check:[...]$22 = { x = 3537 y = 35437.5 z = true } +// lldb-command:v simple_struct_ident +// lldbg-check:[...] { x = 3537 y = 35437.5 z = true } // lldbr-check:(destructured_for_loop_variable::Struct) simple_struct_ident = { x = 3537 y = 35437.5 z = true } // lldb-command:continue -// lldb-command:print simple_tuple_ident -// lldbg-check:[...]$23 = { 0 = 34903493 1 = 232323 } +// lldb-command:v simple_tuple_ident +// lldbg-check:[...] { 0 = 34903493 1 = 232323 } // lldbr-check:((u32, i64)) simple_tuple_ident = { 0 = 34903493 1 = 232323 } // lldb-command:continue diff --git a/tests/debuginfo/destructured-local.rs b/tests/debuginfo/destructured-local.rs index 3e0557382b3..8d62fe5db03 100644 --- a/tests/debuginfo/destructured-local.rs +++ b/tests/debuginfo/destructured-local.rs @@ -129,157 +129,157 @@ // lldb-command:run -// lldb-command:print a -// lldbg-check:[...]$0 = 1 +// lldb-command:v a +// lldbg-check:[...] 1 // lldbr-check:(isize) a = 1 -// lldb-command:print b -// lldbg-check:[...]$1 = false +// lldb-command:v b +// lldbg-check:[...] false // lldbr-check:(bool) b = false -// lldb-command:print c -// lldbg-check:[...]$2 = 2 +// lldb-command:v c +// lldbg-check:[...] 2 // lldbr-check:(isize) c = 2 -// lldb-command:print d -// lldbg-check:[...]$3 = 3 +// lldb-command:v d +// lldbg-check:[...] 3 // lldbr-check:(u16) d = 3 -// lldb-command:print e -// lldbg-check:[...]$4 = 4 +// lldb-command:v e +// lldbg-check:[...] 4 // lldbr-check:(u16) e = 4 -// lldb-command:print f -// lldbg-check:[...]$5 = 5 +// lldb-command:v f +// lldbg-check:[...] 5 // lldbr-check:(isize) f = 5 -// lldb-command:print g -// lldbg-check:[...]$6 = { 0 = 6 1 = 7 } +// lldb-command:v g +// lldbg-check:[...] { 0 = 6 1 = 7 } // lldbr-check:((u32, u32)) g = { 0 = 6 1 = 7 } -// lldb-command:print h -// lldbg-check:[...]$7 = 8 +// lldb-command:v h +// lldbg-check:[...] 8 // lldbr-check:(i16) h = 8 -// lldb-command:print i -// lldbg-check:[...]$8 = { a = 9 b = 10 } +// lldb-command:v i +// lldbg-check:[...] { a = 9 b = 10 } // lldbr-check:(destructured_local::Struct) i = { a = 9 b = 10 } -// lldb-command:print j -// lldbg-check:[...]$9 = 11 +// lldb-command:v j +// lldbg-check:[...] 11 // lldbr-check:(i16) j = 11 -// lldb-command:print k -// lldbg-check:[...]$10 = 12 +// lldb-command:v k +// lldbg-check:[...] 12 // lldbr-check:(i64) k = 12 -// lldb-command:print l -// lldbg-check:[...]$11 = 13 +// lldb-command:v l +// lldbg-check:[...] 13 // lldbr-check:(i32) l = 13 -// lldb-command:print m -// lldbg-check:[...]$12 = 14 +// lldb-command:v m +// lldbg-check:[...] 14 // lldbr-check:(i32) m = 14 -// lldb-command:print n -// lldbg-check:[...]$13 = 16 +// lldb-command:v n +// lldbg-check:[...] 16 // lldbr-check:(i32) n = 16 -// lldb-command:print o -// lldbg-check:[...]$14 = 18 +// lldb-command:v o +// lldbg-check:[...] 18 // lldbr-check:(i32) o = 18 -// lldb-command:print p -// lldbg-check:[...]$15 = 19 +// lldb-command:v p +// lldbg-check:[...] 19 // lldbr-check:(i64) p = 19 -// lldb-command:print q -// lldbg-check:[...]$16 = 20 +// lldb-command:v q +// lldbg-check:[...] 20 // lldbr-check:(i32) q = 20 -// lldb-command:print r -// lldbg-check:[...]$17 = { a = 21 b = 22 } +// lldb-command:v r +// lldbg-check:[...] { a = 21 b = 22 } // lldbr-check:(destructured_local::Struct) r = { a = 21 b = 22 } -// lldb-command:print s -// lldbg-check:[...]$18 = 24 +// lldb-command:v s +// lldbg-check:[...] 24 // lldbr-check:(i32) s = 24 -// lldb-command:print t -// lldbg-check:[...]$19 = 23 +// lldb-command:v t +// lldbg-check:[...] 23 // lldbr-check:(i64) t = 23 -// lldb-command:print u -// lldbg-check:[...]$20 = 25 +// lldb-command:v u +// lldbg-check:[...] 25 // lldbr-check:(i32) u = 25 -// lldb-command:print v -// lldbg-check:[...]$21 = 26 +// lldb-command:v v +// lldbg-check:[...] 26 // lldbr-check:(i32) v = 26 -// lldb-command:print w -// lldbg-check:[...]$22 = 27 +// lldb-command:v w +// lldbg-check:[...] 27 // lldbr-check:(i32) w = 27 -// lldb-command:print x -// lldbg-check:[...]$23 = 28 +// lldb-command:v x +// lldbg-check:[...] 28 // lldbr-check:(i32) x = 28 -// lldb-command:print y -// lldbg-check:[...]$24 = 29 +// lldb-command:v y +// lldbg-check:[...] 29 // lldbr-check:(i64) y = 29 -// lldb-command:print z -// lldbg-check:[...]$25 = 30 +// lldb-command:v z +// lldbg-check:[...] 30 // lldbr-check:(i32) z = 30 -// lldb-command:print ae -// lldbg-check:[...]$26 = 31 +// lldb-command:v ae +// lldbg-check:[...] 31 // lldbr-check:(i64) ae = 31 -// lldb-command:print oe -// lldbg-check:[...]$27 = 32 +// lldb-command:v oe +// lldbg-check:[...] 32 // lldbr-check:(i32) oe = 32 -// lldb-command:print ue -// lldbg-check:[...]$28 = 33 +// lldb-command:v ue +// lldbg-check:[...] 33 // lldbr-check:(i32) ue = 33 -// lldb-command:print aa -// lldbg-check:[...]$29 = { 0 = 34 1 = 35 } +// lldb-command:v aa +// lldbg-check:[...] { 0 = 34 1 = 35 } // lldbr-check:((i32, i32)) aa = { 0 = 34 1 = 35 } -// lldb-command:print bb -// lldbg-check:[...]$30 = { 0 = 36 1 = 37 } +// lldb-command:v bb +// lldbg-check:[...] { 0 = 36 1 = 37 } // lldbr-check:((i32, i32)) bb = { 0 = 36 1 = 37 } -// lldb-command:print cc -// lldbg-check:[...]$31 = 38 +// lldb-command:v cc +// lldbg-check:[...] 38 // lldbr-check:(i32) cc = 38 -// lldb-command:print dd -// lldbg-check:[...]$32 = { 0 = 40 1 = 41 2 = 42 } +// lldb-command:v dd +// lldbg-check:[...] { 0 = 40 1 = 41 2 = 42 } // lldbr-check:((i32, i32, i32)) dd = { 0 = 40 1 = 41 2 = 42} -// lldb-command:print *ee -// lldbg-check:[...]$33 = { 0 = 43 1 = 44 2 = 45 } +// lldb-command:v *ee +// lldbg-check:[...] { 0 = 43 1 = 44 2 = 45 } // lldbr-check:((i32, i32, i32)) *ee = { 0 = 43 1 = 44 2 = 45} -// lldb-command:print *ff -// lldbg-check:[...]$34 = 46 +// lldb-command:v *ff +// lldbg-check:[...] 46 // lldbr-check:(i32) *ff = 46 -// lldb-command:print gg -// lldbg-check:[...]$35 = { 0 = 47 1 = 48 } +// lldb-command:v gg +// lldbg-check:[...] { 0 = 47 1 = 48 } // lldbr-check:((i32, i32)) gg = { 0 = 47 1 = 48 } -// lldb-command:print *hh -// lldbg-check:[...]$36 = 50 +// lldb-command:v *hh +// lldbg-check:[...] 50 // lldbr-check:(i32) *hh = 50 -// lldb-command:print ii -// lldbg-check:[...]$37 = 51 +// lldb-command:v ii +// lldbg-check:[...] 51 // lldbr-check:(i32) ii = 51 -// lldb-command:print *jj -// lldbg-check:[...]$38 = 52 +// lldb-command:v *jj +// lldbg-check:[...] 52 // lldbr-check:(i32) *jj = 52 -// lldb-command:print kk -// lldbg-check:[...]$39 = 53 +// lldb-command:v kk +// lldbg-check:[...] 53 // lldbr-check:(f64) kk = 53 -// lldb-command:print ll -// lldbg-check:[...]$40 = 54 +// lldb-command:v ll +// lldbg-check:[...] 54 // lldbr-check:(isize) ll = 54 -// lldb-command:print mm -// lldbg-check:[...]$41 = 55 +// lldb-command:v mm +// lldbg-check:[...] 55 // lldbr-check:(f64) mm = 55 -// lldb-command:print *nn -// lldbg-check:[...]$42 = 56 +// lldb-command:v *nn +// lldbg-check:[...] 56 // lldbr-check:(isize) *nn = 56 diff --git a/tests/debuginfo/drop-locations.rs b/tests/debuginfo/drop-locations.rs index 6404bf9c3da..15b2d0de7fe 100644 --- a/tests/debuginfo/drop-locations.rs +++ b/tests/debuginfo/drop-locations.rs @@ -43,22 +43,22 @@ // lldb-command:run // lldb-command:next // lldb-command:frame select -// lldb-check:[...]#loc1[...] +// lldb-check:[...] #loc1 [...] // lldb-command:next // lldb-command:frame select -// lldb-check:[...]#loc2[...] +// lldb-check:[...] #loc2 [...] // lldb-command:next // lldb-command:frame select -// lldb-check:[...]#loc3[...] +// lldb-check:[...] #loc3 [...] // lldb-command:next // lldb-command:frame select -// lldb-check:[...]#loc4[...] +// lldb-check:[...] #loc4 [...] // lldb-command:next // lldb-command:frame select -// lldb-check:[...]#loc5[...] +// lldb-check:[...] #loc5 [...] // lldb-command:next // lldb-command:frame select -// lldb-check:[...]#loc6[...] +// lldb-check:[...] #loc6 [...] fn main() { diff --git a/tests/debuginfo/empty-string.rs b/tests/debuginfo/empty-string.rs index 838e160e74e..36240730e19 100644 --- a/tests/debuginfo/empty-string.rs +++ b/tests/debuginfo/empty-string.rs @@ -17,13 +17,13 @@ // === LLDB TESTS ================================================================================== -// lldb-command: run +// lldb-command:run -// lldb-command: fr v empty_string -// lldb-check:[...]empty_string = "" { vec = size=0 } +// lldb-command:fr v empty_string +// lldb-check:[...] empty_string = "" { vec = size=0 } -// lldb-command: fr v empty_str -// lldb-check:[...]empty_str = "" { data_ptr = [...] length = 0 } +// lldb-command:fr v empty_str +// lldb-check:[...] empty_str = "" { data_ptr = [...] length = 0 } fn main() { let empty_string = String::new(); diff --git a/tests/debuginfo/enum-thinlto.rs b/tests/debuginfo/enum-thinlto.rs index 5c27fe4271c..f3f17758931 100644 --- a/tests/debuginfo/enum-thinlto.rs +++ b/tests/debuginfo/enum-thinlto.rs @@ -14,8 +14,8 @@ // lldb-command:run -// lldb-command:print *abc -// lldbg-check:(enum_thinlto::ABC) $0 = +// lldb-command:v *abc +// lldbg-check:(enum_thinlto::ABC) *abc = // lldbr-check:(enum_thinlto::ABC) *abc = (x = 0, y = 8970181431921507452) #![allow(unused_variables)] diff --git a/tests/debuginfo/evec-in-struct.rs b/tests/debuginfo/evec-in-struct.rs index d238cc9eded..2283e96c0ad 100644 --- a/tests/debuginfo/evec-in-struct.rs +++ b/tests/debuginfo/evec-in-struct.rs @@ -30,23 +30,23 @@ // lldb-command:run -// lldb-command:print no_padding1 -// lldbg-check:[...]$0 = { x = { [0] = 0 [1] = 1 [2] = 2 } y = -3 z = { [0] = 4.5 [1] = 5.5 } } +// lldb-command:v no_padding1 +// lldbg-check:[...] { x = { [0] = 0 [1] = 1 [2] = 2 } y = -3 z = { [0] = 4.5 [1] = 5.5 } } // lldbr-check:(evec_in_struct::NoPadding1) no_padding1 = { x = { [0] = 0 [1] = 1 [2] = 2 } y = -3 z = { [0] = 4.5 [1] = 5.5 } } -// lldb-command:print no_padding2 -// lldbg-check:[...]$1 = { x = { [0] = 6 [1] = 7 [2] = 8 } y = { [0] = { [0] = 9 [1] = 10 } [1] = { [0] = 11 [1] = 12 } } } +// lldb-command:v no_padding2 +// lldbg-check:[...] { x = { [0] = 6 [1] = 7 [2] = 8 } y = { [0] = { [0] = 9 [1] = 10 } [1] = { [0] = 11 [1] = 12 } } } // lldbr-check:(evec_in_struct::NoPadding2) no_padding2 = { x = { [0] = 6 [1] = 7 [2] = 8 } y = { [0] = { [0] = 9 [1] = 10 } [1] = { [0] = 11 [1] = 12 } } } -// lldb-command:print struct_internal_padding -// lldbg-check:[...]$2 = { x = { [0] = 13 [1] = 14 } y = { [0] = 15 [1] = 16 } } +// lldb-command:v struct_internal_padding +// lldbg-check:[...] { x = { [0] = 13 [1] = 14 } y = { [0] = 15 [1] = 16 } } // lldbr-check:(evec_in_struct::StructInternalPadding) struct_internal_padding = { x = { [0] = 13 [1] = 14 } y = { [0] = 15 [1] = 16 } } -// lldb-command:print single_vec -// lldbg-check:[...]$3 = { x = { [0] = 17 [1] = 18 [2] = 19 [3] = 20 [4] = 21 } } +// lldb-command:v single_vec +// lldbg-check:[...] { x = { [0] = 17 [1] = 18 [2] = 19 [3] = 20 [4] = 21 } } // lldbr-check:(evec_in_struct::SingleVec) single_vec = { x = { [0] = 17 [1] = 18 [2] = 19 [3] = 20 [4] = 21 } } -// lldb-command:print struct_padded_at_end -// lldbg-check:[...]$4 = { x = { [0] = 22 [1] = 23 } y = { [0] = 24 [1] = 25 } } +// lldb-command:v struct_padded_at_end +// lldbg-check:[...] { x = { [0] = 22 [1] = 23 } y = { [0] = 24 [1] = 25 } } // lldbr-check:(evec_in_struct::StructPaddedAtEnd) struct_padded_at_end = { x = { [0] = 22 [1] = 23 } y = { [0] = 24 [1] = 25 } } #![allow(unused_variables)] diff --git a/tests/debuginfo/extern-c-fn.rs b/tests/debuginfo/extern-c-fn.rs index 62c2b609969..b45a073ed05 100644 --- a/tests/debuginfo/extern-c-fn.rs +++ b/tests/debuginfo/extern-c-fn.rs @@ -21,17 +21,17 @@ // === LLDB TESTS ================================================================================== // lldb-command:run -// lldb-command:print len -// lldbg-check:[...]$0 = 20 +// lldb-command:v len +// lldbg-check:[...] 20 // lldbr-check:(i32) len = 20 -// lldb-command:print local0 -// lldbg-check:[...]$1 = 19 +// lldb-command:v local0 +// lldbg-check:[...] 19 // lldbr-check:(i32) local0 = 19 -// lldb-command:print local1 -// lldbg-check:[...]$2 = true +// lldb-command:v local1 +// lldbg-check:[...] true // lldbr-check:(bool) local1 = true -// lldb-command:print local2 -// lldbg-check:[...]$3 = 20.5 +// lldb-command:v local2 +// lldbg-check:[...] 20.5 // lldbr-check:(f64) local2 = 20.5 // lldb-command:continue diff --git a/tests/debuginfo/function-arg-initialization.rs b/tests/debuginfo/function-arg-initialization.rs index 4bdaefd9bdd..05935c30bea 100644 --- a/tests/debuginfo/function-arg-initialization.rs +++ b/tests/debuginfo/function-arg-initialization.rs @@ -119,100 +119,100 @@ // lldb-command:run // IMMEDIATE ARGS -// lldb-command:print a -// lldb-check:[...]$0 = 1 -// lldb-command:print b -// lldb-check:[...]$1 = true -// lldb-command:print c -// lldb-check:[...]$2 = 2.5 +// lldb-command:v a +// lldb-check:[...] 1 +// lldb-command:v b +// lldb-check:[...] true +// lldb-command:v c +// lldb-check:[...] 2.5 // lldb-command:continue // NON IMMEDIATE ARGS -// lldb-command:print a -// lldb-check:[...]$3 = BigStruct { a: 3, b: 4, c: 5, d: 6, e: 7, f: 8, g: 9, h: 10 } -// lldb-command:print b -// lldb-check:[...]$4 = BigStruct { a: 11, b: 12, c: 13, d: 14, e: 15, f: 16, g: 17, h: 18 } +// lldb-command:v a +// lldb-check:[...] BigStruct { a: 3, b: 4, c: 5, d: 6, e: 7, f: 8, g: 9, h: 10 } +// lldb-command:v b +// lldb-check:[...] BigStruct { a: 11, b: 12, c: 13, d: 14, e: 15, f: 16, g: 17, h: 18 } // lldb-command:continue // BINDING -// lldb-command:print a -// lldb-check:[...]$5 = 19 -// lldb-command:print b -// lldb-check:[...]$6 = 20 -// lldb-command:print c -// lldb-check:[...]$7 = 21.5 +// lldb-command:v a +// lldb-check:[...] 19 +// lldb-command:v b +// lldb-check:[...] 20 +// lldb-command:v c +// lldb-check:[...] 21.5 // lldb-command:continue // ASSIGNMENT -// lldb-command:print a -// lldb-check:[...]$8 = 22 -// lldb-command:print b -// lldb-check:[...]$9 = 23 -// lldb-command:print c -// lldb-check:[...]$10 = 24.5 +// lldb-command:v a +// lldb-check:[...] 22 +// lldb-command:v b +// lldb-check:[...] 23 +// lldb-command:v c +// lldb-check:[...] 24.5 // lldb-command:continue // FUNCTION CALL -// lldb-command:print x -// lldb-check:[...]$11 = 25 -// lldb-command:print y -// lldb-check:[...]$12 = 26 -// lldb-command:print z -// lldb-check:[...]$13 = 27.5 +// lldb-command:v x +// lldb-check:[...] 25 +// lldb-command:v y +// lldb-check:[...] 26 +// lldb-command:v z +// lldb-check:[...] 27.5 // lldb-command:continue // EXPR -// lldb-command:print x -// lldb-check:[...]$14 = 28 -// lldb-command:print y -// lldb-check:[...]$15 = 29 -// lldb-command:print z -// lldb-check:[...]$16 = 30.5 +// lldb-command:v x +// lldb-check:[...] 28 +// lldb-command:v y +// lldb-check:[...] 29 +// lldb-command:v z +// lldb-check:[...] 30.5 // lldb-command:continue // RETURN EXPR -// lldb-command:print x -// lldb-check:[...]$17 = 31 -// lldb-command:print y -// lldb-check:[...]$18 = 32 -// lldb-command:print z -// lldb-check:[...]$19 = 33.5 +// lldb-command:v x +// lldb-check:[...] 31 +// lldb-command:v y +// lldb-check:[...] 32 +// lldb-command:v z +// lldb-check:[...] 33.5 // lldb-command:continue // ARITHMETIC EXPR -// lldb-command:print x -// lldb-check:[...]$20 = 34 -// lldb-command:print y -// lldb-check:[...]$21 = 35 -// lldb-command:print z -// lldb-check:[...]$22 = 36.5 +// lldb-command:v x +// lldb-check:[...] 34 +// lldb-command:v y +// lldb-check:[...] 35 +// lldb-command:v z +// lldb-check:[...] 36.5 // lldb-command:continue // IF EXPR -// lldb-command:print x -// lldb-check:[...]$23 = 37 -// lldb-command:print y -// lldb-check:[...]$24 = 38 -// lldb-command:print z -// lldb-check:[...]$25 = 39.5 +// lldb-command:v x +// lldb-check:[...] 37 +// lldb-command:v y +// lldb-check:[...] 38 +// lldb-command:v z +// lldb-check:[...] 39.5 // lldb-command:continue // WHILE EXPR -// lldb-command:print x -// lldb-check:[...]$26 = 40 -// lldb-command:print y -// lldb-check:[...]$27 = 41 -// lldb-command:print z -// lldb-check:[...]$28 = 42 +// lldb-command:v x +// lldb-check:[...] 40 +// lldb-command:v y +// lldb-check:[...] 41 +// lldb-command:v z +// lldb-check:[...] 42 // lldb-command:continue // LOOP EXPR -// lldb-command:print x -// lldb-check:[...]$29 = 43 -// lldb-command:print y -// lldb-check:[...]$30 = 44 -// lldb-command:print z -// lldb-check:[...]$31 = 45 +// lldb-command:v x +// lldb-check:[...] 43 +// lldb-command:v y +// lldb-check:[...] 44 +// lldb-command:v z +// lldb-check:[...] 45 // lldb-command:continue diff --git a/tests/debuginfo/function-arguments.rs b/tests/debuginfo/function-arguments.rs index c6b865bd458..b0afa1d0772 100644 --- a/tests/debuginfo/function-arguments.rs +++ b/tests/debuginfo/function-arguments.rs @@ -22,19 +22,19 @@ // lldb-command:run -// lldb-command:print x -// lldbg-check:[...]$0 = 111102 +// lldb-command:v x +// lldbg-check:[...] 111102 // lldbr-check:(isize) x = 111102 -// lldb-command:print y -// lldbg-check:[...]$1 = true +// lldb-command:v y +// lldbg-check:[...] true // lldbr-check:(bool) y = true // lldb-command:continue -// lldb-command:print a -// lldbg-check:[...]$2 = 2000 +// lldb-command:v a +// lldbg-check:[...] 2000 // lldbr-check:(i32) a = 2000 -// lldb-command:print b -// lldbg-check:[...]$3 = 3000 +// lldb-command:v b +// lldbg-check:[...] 3000 // lldbr-check:(i64) b = 3000 // lldb-command:continue diff --git a/tests/debuginfo/function-prologue-stepping-regular.rs b/tests/debuginfo/function-prologue-stepping-regular.rs index e52d17a70bd..a1f44105bb9 100644 --- a/tests/debuginfo/function-prologue-stepping-regular.rs +++ b/tests/debuginfo/function-prologue-stepping-regular.rs @@ -20,100 +20,100 @@ // lldb-command:run // IMMEDIATE ARGS -// lldb-command:print a -// lldb-check:[...]$0 = 1 -// lldb-command:print b -// lldb-check:[...]$1 = true -// lldb-command:print c -// lldb-check:[...]$2 = 2.5 +// lldb-command:v a +// lldb-check:[...] 1 +// lldb-command:v b +// lldb-check:[...] true +// lldb-command:v c +// lldb-check:[...] 2.5 // lldb-command:continue // NON IMMEDIATE ARGS -// lldb-command:print a -// lldb-check:[...]$3 = { a = 3, b = 4, c = 5, d = 6, e = 7, f = 8, g = 9, h = 10 } -// lldb-command:print b -// lldb-check:[...]$4 = { a = 11, b = 12, c = 13, d = 14, e = 15, f = 16, g = 17, h = 18 } +// lldb-command:v a +// lldb-check:[...] { a = 3, b = 4, c = 5, d = 6, e = 7, f = 8, g = 9, h = 10 } +// lldb-command:v b +// lldb-check:[...] { a = 11, b = 12, c = 13, d = 14, e = 15, f = 16, g = 17, h = 18 } // lldb-command:continue // BINDING -// lldb-command:print a -// lldb-check:[...]$5 = 19 -// lldb-command:print b -// lldb-check:[...]$6 = 20 -// lldb-command:print c -// lldb-check:[...]$7 = 21.5 +// lldb-command:v a +// lldb-check:[...] 19 +// lldb-command:v b +// lldb-check:[...] 20 +// lldb-command:v c +// lldb-check:[...] 21.5 // lldb-command:continue // ASSIGNMENT -// lldb-command:print a -// lldb-check:[...]$8 = 22 -// lldb-command:print b -// lldb-check:[...]$9 = 23 -// lldb-command:print c -// lldb-check:[...]$10 = 24.5 +// lldb-command:v a +// lldb-check:[...] 22 +// lldb-command:v b +// lldb-check:[...] 23 +// lldb-command:v c +// lldb-check:[...] 24.5 // lldb-command:continue // FUNCTION CALL -// lldb-command:print x -// lldb-check:[...]$11 = 25 -// lldb-command:print y -// lldb-check:[...]$12 = 26 -// lldb-command:print z -// lldb-check:[...]$13 = 27.5 +// lldb-command:v x +// lldb-check:[...] 25 +// lldb-command:v y +// lldb-check:[...] 26 +// lldb-command:v z +// lldb-check:[...] 27.5 // lldb-command:continue // EXPR -// lldb-command:print x -// lldb-check:[...]$14 = 28 -// lldb-command:print y -// lldb-check:[...]$15 = 29 -// lldb-command:print z -// lldb-check:[...]$16 = 30.5 +// lldb-command:v x +// lldb-check:[...] 28 +// lldb-command:v y +// lldb-check:[...] 29 +// lldb-command:v z +// lldb-check:[...] 30.5 // lldb-command:continue // RETURN EXPR -// lldb-command:print x -// lldb-check:[...]$17 = 31 -// lldb-command:print y -// lldb-check:[...]$18 = 32 -// lldb-command:print z -// lldb-check:[...]$19 = 33.5 +// lldb-command:v x +// lldb-check:[...] 31 +// lldb-command:v y +// lldb-check:[...] 32 +// lldb-command:v z +// lldb-check:[...] 33.5 // lldb-command:continue // ARITHMETIC EXPR -// lldb-command:print x -// lldb-check:[...]$20 = 34 -// lldb-command:print y -// lldb-check:[...]$21 = 35 -// lldb-command:print z -// lldb-check:[...]$22 = 36.5 +// lldb-command:v x +// lldb-check:[...] 34 +// lldb-command:v y +// lldb-check:[...] 35 +// lldb-command:v z +// lldb-check:[...] 36.5 // lldb-command:continue // IF EXPR -// lldb-command:print x -// lldb-check:[...]$23 = 37 -// lldb-command:print y -// lldb-check:[...]$24 = 38 -// lldb-command:print z -// lldb-check:[...]$25 = 39.5 +// lldb-command:v x +// lldb-check:[...] 37 +// lldb-command:v y +// lldb-check:[...] 38 +// lldb-command:v z +// lldb-check:[...] 39.5 // lldb-command:continue // WHILE EXPR -// lldb-command:print x -// lldb-check:[...]$26 = 40 -// lldb-command:print y -// lldb-check:[...]$27 = 41 -// lldb-command:print z -// lldb-check:[...]$28 = 42 +// lldb-command:v x +// lldb-check:[...] 40 +// lldb-command:v y +// lldb-check:[...] 41 +// lldb-command:v z +// lldb-check:[...] 42 // lldb-command:continue // LOOP EXPR -// lldb-command:print x -// lldb-check:[...]$29 = 43 -// lldb-command:print y -// lldb-check:[...]$30 = 44 -// lldb-command:print z -// lldb-check:[...]$31 = 45 +// lldb-command:v x +// lldb-check:[...] 43 +// lldb-command:v y +// lldb-check:[...] 44 +// lldb-command:v z +// lldb-check:[...] 45 // lldb-command:continue #![allow(unused_variables)] diff --git a/tests/debuginfo/generic-enum-with-different-disr-sizes.rs b/tests/debuginfo/generic-enum-with-different-disr-sizes.rs index 6a8aa831c40..7b23221213a 100644 --- a/tests/debuginfo/generic-enum-with-different-disr-sizes.rs +++ b/tests/debuginfo/generic-enum-with-different-disr-sizes.rs @@ -39,23 +39,23 @@ // === LLDB TESTS ================================================================================== // lldb-command:run -// lldb-command:print eight_bytes1 -// lldb-check:[...]$0 = Variant1(100) -// lldb-command:print four_bytes1 -// lldb-check:[...]$1 = Variant1(101) -// lldb-command:print two_bytes1 -// lldb-check:[...]$2 = Variant1(102) -// lldb-command:print one_byte1 -// lldb-check:[...]$3 = Variant1('A') - -// lldb-command:print eight_bytes2 -// lldb-check:[...]$4 = Variant2(100) -// lldb-command:print four_bytes2 -// lldb-check:[...]$5 = Variant2(101) -// lldb-command:print two_bytes2 -// lldb-check:[...]$6 = Variant2(102) -// lldb-command:print one_byte2 -// lldb-check:[...]$7 = Variant2('A') +// lldb-command:v eight_bytes1 +// lldb-check:[...] Variant1(100) +// lldb-command:v four_bytes1 +// lldb-check:[...] Variant1(101) +// lldb-command:v two_bytes1 +// lldb-check:[...] Variant1(102) +// lldb-command:v one_byte1 +// lldb-check:[...] Variant1('A') + +// lldb-command:v eight_bytes2 +// lldb-check:[...] Variant2(100) +// lldb-command:v four_bytes2 +// lldb-check:[...] Variant2(101) +// lldb-command:v two_bytes2 +// lldb-check:[...] Variant2(102) +// lldb-command:v one_byte2 +// lldb-check:[...] Variant2('A') // lldb-command:continue diff --git a/tests/debuginfo/generic-function.rs b/tests/debuginfo/generic-function.rs index eab781d2150..e131ebfa306 100644 --- a/tests/debuginfo/generic-function.rs +++ b/tests/debuginfo/generic-function.rs @@ -29,27 +29,27 @@ // lldb-command:run -// lldb-command:print *t0 -// lldbg-check:[...]$0 = 1 +// lldb-command:v *t0 +// lldbg-check:[...] 1 // lldbr-check:(i32) *t0 = 1 -// lldb-command:print *t1 -// lldbg-check:[...]$1 = 2.5 +// lldb-command:v *t1 +// lldbg-check:[...] 2.5 // lldbr-check:(f64) *t1 = 2.5 // lldb-command:continue -// lldb-command:print *t0 -// lldbg-check:[...]$2 = 3.5 +// lldb-command:v *t0 +// lldbg-check:[...] 3.5 // lldbr-check:(f64) *t0 = 3.5 -// lldb-command:print *t1 -// lldbg-check:[...]$3 = 4 +// lldb-command:v *t1 +// lldbg-check:[...] 4 // lldbr-check:(u16) *t1 = 4 // lldb-command:continue -// lldb-command:print *t0 -// lldbg-check:[...]$4 = 5 +// lldb-command:v *t0 +// lldbg-check:[...] 5 // lldbr-check:(i32) *t0 = 5 -// lldb-command:print *t1 -// lldbg-check:[...]$5 = { a = 6 b = 7.5 } +// lldb-command:v *t1 +// lldbg-check:[...] { a = 6 b = 7.5 } // lldbr-check:(generic_function::Struct) *t1 = { a = 6 b = 7.5 } // lldb-command:continue diff --git a/tests/debuginfo/generic-functions-nested.rs b/tests/debuginfo/generic-functions-nested.rs index a146015246e..eee0c151182 100644 --- a/tests/debuginfo/generic-functions-nested.rs +++ b/tests/debuginfo/generic-functions-nested.rs @@ -35,35 +35,35 @@ // lldb-command:run -// lldb-command:print x -// lldbg-check:[...]$0 = -1 +// lldb-command:v x +// lldbg-check:[...] -1 // lldbr-check:(i32) x = -1 -// lldb-command:print y -// lldbg-check:[...]$1 = 1 +// lldb-command:v y +// lldbg-check:[...] 1 // lldbr-check:(i32) y = 1 // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$2 = -1 +// lldb-command:v x +// lldbg-check:[...] -1 // lldbr-check:(i32) x = -1 -// lldb-command:print y -// lldbg-check:[...]$3 = 2.5 +// lldb-command:v y +// lldbg-check:[...] 2.5 // lldbr-check:(f64) y = 2.5 // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$4 = -2.5 +// lldb-command:v x +// lldbg-check:[...] -2.5 // lldbr-check:(f64) x = -2.5 -// lldb-command:print y -// lldbg-check:[...]$5 = 1 +// lldb-command:v y +// lldbg-check:[...] 1 // lldbr-check:(i32) y = 1 // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$6 = -2.5 +// lldb-command:v x +// lldbg-check:[...] -2.5 // lldbr-check:(f64) x = -2.5 -// lldb-command:print y -// lldbg-check:[...]$7 = 2.5 +// lldb-command:v y +// lldbg-check:[...] 2.5 // lldbr-check:(f64) y = 2.5 // lldb-command:continue diff --git a/tests/debuginfo/generic-method-on-generic-struct.rs b/tests/debuginfo/generic-method-on-generic-struct.rs index dd1f482f3fa..0f706740410 100644 --- a/tests/debuginfo/generic-method-on-generic-struct.rs +++ b/tests/debuginfo/generic-method-on-generic-struct.rs @@ -64,62 +64,62 @@ // lldb-command:run // STACK BY REF -// lldb-command:print *self -// lldbg-check:[...]$0 = { x = { 0 = 8888, 1 = -8888 } } +// lldb-command:v *self +// lldbg-check:[...] { x = { 0 = 8888, 1 = -8888 } } // lldbr-check:(generic_method_on_generic_struct::Struct<(u32, i32)>) *self = { x = { 0 = 8888 1 = -8888 } } -// lldb-command:print arg1 -// lldbg-check:[...]$1 = -1 +// lldb-command:v arg1 +// lldbg-check:[...] -1 // lldbr-check:(isize) arg1 = -1 -// lldb-command:print arg2 -// lldbg-check:[...]$2 = 2 +// lldb-command:v arg2 +// lldbg-check:[...] 2 // lldbr-check:(u16) arg2 = 2 // lldb-command:continue // STACK BY VAL -// lldb-command:print self -// lldbg-check:[...]$3 = { x = { 0 = 8888, 1 = -8888 } } +// lldb-command:v self +// lldbg-check:[...] { x = { 0 = 8888, 1 = -8888 } } // lldbr-check:(generic_method_on_generic_struct::Struct<(u32, i32)>) self = { x = { 0 = 8888, 1 = -8888 } } -// lldb-command:print arg1 -// lldbg-check:[...]$4 = -3 +// lldb-command:v arg1 +// lldbg-check:[...] -3 // lldbr-check:(isize) arg1 = -3 -// lldb-command:print arg2 -// lldbg-check:[...]$5 = -4 +// lldb-command:v arg2 +// lldbg-check:[...] -4 // lldbr-check:(i16) arg2 = -4 // lldb-command:continue // OWNED BY REF -// lldb-command:print *self -// lldbg-check:[...]$6 = { x = 1234.5 } +// lldb-command:v *self +// lldbg-check:[...] { x = 1234.5 } // lldbr-check:(generic_method_on_generic_struct::Struct<f64>) *self = { x = 1234.5 } -// lldb-command:print arg1 -// lldbg-check:[...]$7 = -5 +// lldb-command:v arg1 +// lldbg-check:[...] -5 // lldbr-check:(isize) arg1 = -5 -// lldb-command:print arg2 -// lldbg-check:[...]$8 = -6 +// lldb-command:v arg2 +// lldbg-check:[...] -6 // lldbr-check:(i32) arg2 = -6 // lldb-command:continue // OWNED BY VAL -// lldb-command:print self -// lldbg-check:[...]$9 = { x = 1234.5 } +// lldb-command:v self +// lldbg-check:[...] { x = 1234.5 } // lldbr-check:(generic_method_on_generic_struct::Struct<f64>) self = { x = 1234.5 } -// lldb-command:print arg1 -// lldbg-check:[...]$10 = -7 +// lldb-command:v arg1 +// lldbg-check:[...] -7 // lldbr-check:(isize) arg1 = -7 -// lldb-command:print arg2 -// lldbg-check:[...]$11 = -8 +// lldb-command:v arg2 +// lldbg-check:[...] -8 // lldbr-check:(i64) arg2 = -8 // lldb-command:continue // OWNED MOVED -// lldb-command:print *self -// lldbg-check:[...]$12 = { x = 1234.5 } +// lldb-command:v *self +// lldbg-check:[...] { x = 1234.5 } // lldbr-check:(generic_method_on_generic_struct::Struct<f64>) *self = { x = 1234.5 } -// lldb-command:print arg1 -// lldbg-check:[...]$13 = -9 +// lldb-command:v arg1 +// lldbg-check:[...] -9 // lldbr-check:(isize) arg1 = -9 -// lldb-command:print arg2 -// lldbg-check:[...]$14 = -10.5 +// lldb-command:v arg2 +// lldbg-check:[...] -10.5 // lldbr-check:(f32) arg2 = -10.5 // lldb-command:continue diff --git a/tests/debuginfo/generic-struct.rs b/tests/debuginfo/generic-struct.rs index 82ed17618aa..8c74aa42d2c 100644 --- a/tests/debuginfo/generic-struct.rs +++ b/tests/debuginfo/generic-struct.rs @@ -25,18 +25,18 @@ // lldb-command:run -// lldb-command:print int_int -// lldbg-check:[...]$0 = AGenericStruct<i32, i32> { key: 0, value: 1 } +// lldb-command:v int_int +// lldbg-check:[...] AGenericStruct<i32, i32> { key: 0, value: 1 } // lldbr-check:(generic_struct::AGenericStruct<i32, i32>) int_int = AGenericStruct<i32, i32> { key: 0, value: 1 } -// lldb-command:print int_float -// lldbg-check:[...]$1 = AGenericStruct<i32, f64> { key: 2, value: 3.5 } +// lldb-command:v int_float +// lldbg-check:[...] AGenericStruct<i32, f64> { key: 2, value: 3.5 } // lldbr-check:(generic_struct::AGenericStruct<i32, f64>) int_float = AGenericStruct<i32, f64> { key: 2, value: 3.5 } -// lldb-command:print float_int -// lldbg-check:[...]$2 = AGenericStruct<f64, i32> { key: 4.5, value: 5 } +// lldb-command:v float_int +// lldbg-check:[...] AGenericStruct<f64, i32> { key: 4.5, value: 5 } // lldbr-check:(generic_struct::AGenericStruct<f64, i32>) float_int = AGenericStruct<f64, i32> { key: 4.5, value: 5 } -// lldb-command:print float_int_float -// lldbg-check:[...]$3 = AGenericStruct<f64, generic_struct::AGenericStruct<i32, f64>> { key: 6.5, value: AGenericStruct<i32, f64> { key: 7, value: 8.5 } } +// lldb-command:v float_int_float +// lldbg-check:[...] AGenericStruct<f64, generic_struct::AGenericStruct<i32, f64>> { key: 6.5, value: AGenericStruct<i32, f64> { key: 7, value: 8.5 } } // lldbr-check:(generic_struct::AGenericStruct<f64, generic_struct::AGenericStruct<i32, f64>>) float_int_float = AGenericStruct<f64, generic_struct::AGenericStruct<i32, f64>> { key: 6.5, value: AGenericStruct<i32, f64> { key: 7, value: 8.5 } } // === CDB TESTS =================================================================================== diff --git a/tests/debuginfo/generic-tuple-style-enum.rs b/tests/debuginfo/generic-tuple-style-enum.rs index fb5deb9b198..af90c6ce30e 100644 --- a/tests/debuginfo/generic-tuple-style-enum.rs +++ b/tests/debuginfo/generic-tuple-style-enum.rs @@ -26,16 +26,16 @@ // lldb-command:run -// lldb-command:print case1 +// lldb-command:v case1 // lldbr-check:(generic_tuple_style_enum::Regular<u16, u32, u64>::Case1) case1 = { __0 = 0 __1 = 31868 __2 = 31868 __3 = 31868 __4 = 31868 } -// lldb-command:print case2 +// lldb-command:v case2 // lldbr-check:(generic_tuple_style_enum::Regular<i16, i32, i64>::Case2) case2 = Regular<i16, i32, i64>::Case2 { Case1: 0, Case2: 286331153, Case3: 286331153 } -// lldb-command:print case3 +// lldb-command:v case3 // lldbr-check:(generic_tuple_style_enum::Regular<i16, i32, i64>::Case3) case3 = Regular<i16, i32, i64>::Case3 { Case1: 0, Case2: 6438275382588823897 } -// lldb-command:print univariant +// lldb-command:v univariant // lldbr-check:(generic_tuple_style_enum::Univariant<i64>) univariant = Univariant<i64> { TheOnlyCase: Univariant<i64>::TheOnlyCase(-1) } #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/include_string.rs b/tests/debuginfo/include_string.rs index 6f7d2b28b41..75013ab5274 100644 --- a/tests/debuginfo/include_string.rs +++ b/tests/debuginfo/include_string.rs @@ -15,14 +15,14 @@ // lldb-command:run -// lldb-command:print string1.length -// lldbg-check:[...]$0 = 48 +// lldb-command:v string1.length +// lldbg-check:[...] 48 // lldbr-check:(usize) length = 48 -// lldb-command:print string2.length -// lldbg-check:[...]$1 = 49 +// lldb-command:v string2.length +// lldbg-check:[...] 49 // lldbr-check:(usize) length = 49 -// lldb-command:print string3.length -// lldbg-check:[...]$2 = 50 +// lldb-command:v string3.length +// lldbg-check:[...] 50 // lldbr-check:(usize) length = 50 // lldb-command:continue diff --git a/tests/debuginfo/issue-22656.rs b/tests/debuginfo/issue-22656.rs index acbe2b12a24..5a5442acd95 100644 --- a/tests/debuginfo/issue-22656.rs +++ b/tests/debuginfo/issue-22656.rs @@ -10,11 +10,11 @@ // === LLDB TESTS ================================================================================== // lldb-command:run -// lldb-command:print v -// lldbg-check:[...]$0 = size=3 { [0] = 1 [1] = 2 [2] = 3 } +// lldb-command:v v +// lldbg-check:[...] size=3 { [0] = 1 [1] = 2 [2] = 3 } // lldbr-check:(alloc::vec::Vec<i32>) v = size=3 { [0] = 1 [1] = 2 [2] = 3 } -// lldb-command:print zs -// lldbg-check:[...]$1 = { x = y = 123 z = w = 456 } +// lldb-command:v zs +// lldbg-check:[...] { x = y = 123 z = w = 456 } // lldbr-check:(issue_22656::StructWithZeroSizedField) zs = { x = y = 123 z = w = 456 } // lldbr-command:continue diff --git a/tests/debuginfo/issue-57822.rs b/tests/debuginfo/issue-57822.rs index f4ef45f1d74..93e1a2558f6 100644 --- a/tests/debuginfo/issue-57822.rs +++ b/tests/debuginfo/issue-57822.rs @@ -20,11 +20,11 @@ // lldb-command:run -// lldb-command:print g -// lldbg-check:(issue_57822::main::{closure_env#1}) $0 = { f = { x = 1 } } +// lldb-command:v g +// lldbg-check:(issue_57822::main::{closure_env#1}) g = { f = { x = 1 } } -// lldb-command:print b -// lldbg-check:(issue_57822::main::{coroutine_env#3}) $1 = +// lldb-command:v b +// lldbg-check:(issue_57822::main::{coroutine_env#3}) b = #![feature(omit_gdb_pretty_printer_section, coroutines, coroutine_trait)] #![omit_gdb_pretty_printer_section] diff --git a/tests/debuginfo/lexical-scope-in-for-loop.rs b/tests/debuginfo/lexical-scope-in-for-loop.rs index 93be5288a64..1b1f106fece 100644 --- a/tests/debuginfo/lexical-scope-in-for-loop.rs +++ b/tests/debuginfo/lexical-scope-in-for-loop.rs @@ -44,41 +44,41 @@ // lldb-command:run // FIRST ITERATION -// lldb-command:print x -// lldbg-check:[...]$0 = 1 +// lldb-command:v x +// lldbg-check:[...] 1 // lldbr-check:(i32) x = 1 // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$1 = -1 +// lldb-command:v x +// lldbg-check:[...] -1 // lldbr-check:(i32) x = -1 // lldb-command:continue // SECOND ITERATION -// lldb-command:print x -// lldbg-check:[...]$2 = 2 +// lldb-command:v x +// lldbg-check:[...] 2 // lldbr-check:(i32) x = 2 // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$3 = -2 +// lldb-command:v x +// lldbg-check:[...] -2 // lldbr-check:(i32) x = -2 // lldb-command:continue // THIRD ITERATION -// lldb-command:print x -// lldbg-check:[...]$4 = 3 +// lldb-command:v x +// lldbg-check:[...] 3 // lldbr-check:(i32) x = 3 // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$5 = -3 +// lldb-command:v x +// lldbg-check:[...] -3 // lldbr-check:(i32) x = -3 // lldb-command:continue // AFTER LOOP -// lldb-command:print x -// lldbg-check:[...]$6 = 1000000 +// lldb-command:v x +// lldbg-check:[...] 1000000 // lldbr-check:(i32) x = 1000000 // lldb-command:continue diff --git a/tests/debuginfo/lexical-scope-in-if.rs b/tests/debuginfo/lexical-scope-in-if.rs index 88b4244a503..d472a50f697 100644 --- a/tests/debuginfo/lexical-scope-in-if.rs +++ b/tests/debuginfo/lexical-scope-in-if.rs @@ -68,74 +68,74 @@ // lldb-command:run // BEFORE if -// lldb-command:print x -// lldbg-check:[...]$0 = 999 +// lldb-command:v x +// lldbg-check:[...] 999 // lldbr-check:(i32) x = 999 -// lldb-command:print y -// lldbg-check:[...]$1 = -1 +// lldb-command:v y +// lldbg-check:[...] -1 // lldbr-check:(i32) y = -1 // lldb-command:continue // AT BEGINNING of 'then' block -// lldb-command:print x -// lldbg-check:[...]$2 = 999 +// lldb-command:v x +// lldbg-check:[...] 999 // lldbr-check:(i32) x = 999 -// lldb-command:print y -// lldbg-check:[...]$3 = -1 +// lldb-command:v y +// lldbg-check:[...] -1 // lldbr-check:(i32) y = -1 // lldb-command:continue // AFTER 1st redeclaration of 'x' -// lldb-command:print x -// lldbg-check:[...]$4 = 1001 +// lldb-command:v x +// lldbg-check:[...] 1001 // lldbr-check:(i32) x = 1001 -// lldb-command:print y -// lldbg-check:[...]$5 = -1 +// lldb-command:v y +// lldbg-check:[...] -1 // lldbr-check:(i32) y = -1 // lldb-command:continue // AFTER 2st redeclaration of 'x' -// lldb-command:print x -// lldbg-check:[...]$6 = 1002 +// lldb-command:v x +// lldbg-check:[...] 1002 // lldbr-check:(i32) x = 1002 -// lldb-command:print y -// lldbg-check:[...]$7 = 1003 +// lldb-command:v y +// lldbg-check:[...] 1003 // lldbr-check:(i32) y = 1003 // lldb-command:continue // AFTER 1st if expression -// lldb-command:print x -// lldbg-check:[...]$8 = 999 +// lldb-command:v x +// lldbg-check:[...] 999 // lldbr-check:(i32) x = 999 -// lldb-command:print y -// lldbg-check:[...]$9 = -1 +// lldb-command:v y +// lldbg-check:[...] -1 // lldbr-check:(i32) y = -1 // lldb-command:continue // BEGINNING of else branch -// lldb-command:print x -// lldbg-check:[...]$10 = 999 +// lldb-command:v x +// lldbg-check:[...] 999 // lldbr-check:(i32) x = 999 -// lldb-command:print y -// lldbg-check:[...]$11 = -1 +// lldb-command:v y +// lldbg-check:[...] -1 // lldbr-check:(i32) y = -1 // lldb-command:continue // BEGINNING of else branch -// lldb-command:print x -// lldbg-check:[...]$12 = 1004 +// lldb-command:v x +// lldbg-check:[...] 1004 // lldbr-check:(i32) x = 1004 -// lldb-command:print y -// lldbg-check:[...]$13 = 1005 +// lldb-command:v y +// lldbg-check:[...] 1005 // lldbr-check:(i32) y = 1005 // lldb-command:continue // BEGINNING of else branch -// lldb-command:print x -// lldbg-check:[...]$14 = 999 +// lldb-command:v x +// lldbg-check:[...] 999 // lldbr-check:(i32) x = 999 -// lldb-command:print y -// lldbg-check:[...]$15 = -1 +// lldb-command:v y +// lldbg-check:[...] -1 // lldbr-check:(i32) y = -1 // lldb-command:continue diff --git a/tests/debuginfo/lexical-scope-in-match.rs b/tests/debuginfo/lexical-scope-in-match.rs index 8a9ecfad249..d5f0fcbe892 100644 --- a/tests/debuginfo/lexical-scope-in-match.rs +++ b/tests/debuginfo/lexical-scope-in-match.rs @@ -63,73 +63,73 @@ // lldb-command:run -// lldb-command:print shadowed -// lldbg-check:[...]$0 = 231 +// lldb-command:v shadowed +// lldbg-check:[...] 231 // lldbr-check:(i32) shadowed = 231 -// lldb-command:print not_shadowed -// lldbg-check:[...]$1 = 232 +// lldb-command:v not_shadowed +// lldbg-check:[...] 232 // lldbr-check:(i32) not_shadowed = 232 // lldb-command:continue -// lldb-command:print shadowed -// lldbg-check:[...]$2 = 233 +// lldb-command:v shadowed +// lldbg-check:[...] 233 // lldbr-check:(i32) shadowed = 233 -// lldb-command:print not_shadowed -// lldbg-check:[...]$3 = 232 +// lldb-command:v not_shadowed +// lldbg-check:[...] 232 // lldbr-check:(i32) not_shadowed = 232 -// lldb-command:print local_to_arm -// lldbg-check:[...]$4 = 234 +// lldb-command:v local_to_arm +// lldbg-check:[...] 234 // lldbr-check:(i32) local_to_arm = 234 // lldb-command:continue -// lldb-command:print shadowed -// lldbg-check:[...]$5 = 236 +// lldb-command:v shadowed +// lldbg-check:[...] 236 // lldbr-check:(i32) shadowed = 236 -// lldb-command:print not_shadowed -// lldbg-check:[...]$6 = 232 +// lldb-command:v not_shadowed +// lldbg-check:[...] 232 // lldbr-check:(i32) not_shadowed = 232 // lldb-command:continue -// lldb-command:print shadowed -// lldbg-check:[...]$7 = 237 +// lldb-command:v shadowed +// lldbg-check:[...] 237 // lldbr-check:(isize) shadowed = 237 -// lldb-command:print not_shadowed -// lldbg-check:[...]$8 = 232 +// lldb-command:v not_shadowed +// lldbg-check:[...] 232 // lldbr-check:(i32) not_shadowed = 232 -// lldb-command:print local_to_arm -// lldbg-check:[...]$9 = 238 +// lldb-command:v local_to_arm +// lldbg-check:[...] 238 // lldbr-check:(isize) local_to_arm = 238 // lldb-command:continue -// lldb-command:print shadowed -// lldbg-check:[...]$10 = 239 +// lldb-command:v shadowed +// lldbg-check:[...] 239 // lldbr-check:(isize) shadowed = 239 -// lldb-command:print not_shadowed -// lldbg-check:[...]$11 = 232 +// lldb-command:v not_shadowed +// lldbg-check:[...] 232 // lldbr-check:(i32) not_shadowed = 232 // lldb-command:continue -// lldb-command:print shadowed -// lldbg-check:[...]$12 = 241 +// lldb-command:v shadowed +// lldbg-check:[...] 241 // lldbr-check:(isize) shadowed = 241 -// lldb-command:print not_shadowed -// lldbg-check:[...]$13 = 232 +// lldb-command:v not_shadowed +// lldbg-check:[...] 232 // lldbr-check:(i32) not_shadowed = 232 // lldb-command:continue -// lldb-command:print shadowed -// lldbg-check:[...]$14 = 243 +// lldb-command:v shadowed +// lldbg-check:[...] 243 // lldbr-check:(i32) shadowed = 243 -// lldb-command:print *local_to_arm -// lldbg-check:[...]$15 = 244 +// lldb-command:v *local_to_arm +// lldbg-check:[...] 244 // lldbr-check:(i32) *local_to_arm = 244 // lldb-command:continue -// lldb-command:print shadowed -// lldbg-check:[...]$16 = 231 +// lldb-command:v shadowed +// lldbg-check:[...] 231 // lldbr-check:(i32) shadowed = 231 -// lldb-command:print not_shadowed -// lldbg-check:[...]$17 = 232 +// lldb-command:v not_shadowed +// lldbg-check:[...] 232 // lldbr-check:(i32) not_shadowed = 232 // lldb-command:continue diff --git a/tests/debuginfo/lexical-scope-in-stack-closure.rs b/tests/debuginfo/lexical-scope-in-stack-closure.rs index eeafed9f4db..92582e10c42 100644 --- a/tests/debuginfo/lexical-scope-in-stack-closure.rs +++ b/tests/debuginfo/lexical-scope-in-stack-closure.rs @@ -35,33 +35,33 @@ // lldb-command:run -// lldb-command:print x -// lldbg-check:[...]$0 = false +// lldb-command:v x +// lldbg-check:[...] false // lldbr-check:(bool) x = false // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$1 = false +// lldb-command:v x +// lldbg-check:[...] false // lldbr-check:(bool) x = false // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$2 = 1000 +// lldb-command:v x +// lldbg-check:[...] 1000 // lldbr-check:(isize) x = 1000 // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$3 = 2.5 +// lldb-command:v x +// lldbg-check:[...] 2.5 // lldbr-check:(f64) x = 2.5 // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$4 = true +// lldb-command:v x +// lldbg-check:[...] true // lldbr-check:(bool) x = true // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$5 = false +// lldb-command:v x +// lldbg-check:[...] false // lldbr-check:(bool) x = false // lldb-command:continue diff --git a/tests/debuginfo/lexical-scope-in-unconditional-loop.rs b/tests/debuginfo/lexical-scope-in-unconditional-loop.rs index ec998975bc7..b1af018f3eb 100644 --- a/tests/debuginfo/lexical-scope-in-unconditional-loop.rs +++ b/tests/debuginfo/lexical-scope-in-unconditional-loop.rs @@ -67,70 +67,70 @@ // lldb-command:run // FIRST ITERATION -// lldb-command:print x -// lldbg-check:[...]$0 = 0 +// lldb-command:v x +// lldbg-check:[...] 0 // lldbr-check:(i32) x = 0 // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$1 = 1 +// lldb-command:v x +// lldbg-check:[...] 1 // lldbr-check:(i32) x = 1 // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$2 = 101 +// lldb-command:v x +// lldbg-check:[...] 101 // lldbr-check:(i32) x = 101 // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$3 = 101 +// lldb-command:v x +// lldbg-check:[...] 101 // lldbr-check:(i32) x = 101 // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$4 = -987 +// lldb-command:v x +// lldbg-check:[...] -987 // lldbr-check:(i32) x = -987 // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$5 = 101 +// lldb-command:v x +// lldbg-check:[...] 101 // lldbr-check:(i32) x = 101 // lldb-command:continue // SECOND ITERATION -// lldb-command:print x -// lldbg-check:[...]$6 = 1 +// lldb-command:v x +// lldbg-check:[...] 1 // lldbr-check:(i32) x = 1 // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$7 = 2 +// lldb-command:v x +// lldbg-check:[...] 2 // lldbr-check:(i32) x = 2 // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$8 = 102 +// lldb-command:v x +// lldbg-check:[...] 102 // lldbr-check:(i32) x = 102 // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$9 = 102 +// lldb-command:v x +// lldbg-check:[...] 102 // lldbr-check:(i32) x = 102 // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$10 = -987 +// lldb-command:v x +// lldbg-check:[...] -987 // lldbr-check:(i32) x = -987 // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$11 = 102 +// lldb-command:v x +// lldbg-check:[...] 102 // lldbr-check:(i32) x = 102 // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$12 = 2 +// lldb-command:v x +// lldbg-check:[...] 2 // lldbr-check:(i32) x = 2 // lldb-command:continue diff --git a/tests/debuginfo/lexical-scope-in-unique-closure.rs b/tests/debuginfo/lexical-scope-in-unique-closure.rs index 9376d039187..a08c2af05cc 100644 --- a/tests/debuginfo/lexical-scope-in-unique-closure.rs +++ b/tests/debuginfo/lexical-scope-in-unique-closure.rs @@ -35,33 +35,33 @@ // lldb-command:run -// lldb-command:print x -// lldbg-check:[...]$0 = false +// lldb-command:v x +// lldbg-check:[...] false // lldbr-check:(bool) x = false // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$1 = false +// lldb-command:v x +// lldbg-check:[...] false // lldbr-check:(bool) x = false // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$2 = 1000 +// lldb-command:v x +// lldbg-check:[...] 1000 // lldbr-check:(isize) x = 1000 // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$3 = 2.5 +// lldb-command:v x +// lldbg-check:[...] 2.5 // lldbr-check:(f64) x = 2.5 // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$4 = true +// lldb-command:v x +// lldbg-check:[...] true // lldbr-check:(bool) x = true // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$5 = false +// lldb-command:v x +// lldbg-check:[...] false // lldbr-check:(bool) x = false // lldb-command:continue diff --git a/tests/debuginfo/lexical-scope-in-while.rs b/tests/debuginfo/lexical-scope-in-while.rs index f70ef9c2dd1..bd885b5b10c 100644 --- a/tests/debuginfo/lexical-scope-in-while.rs +++ b/tests/debuginfo/lexical-scope-in-while.rs @@ -67,70 +67,70 @@ // lldb-command:run // FIRST ITERATION -// lldb-command:print x -// lldbg-check:[...]$0 = 0 +// lldb-command:v x +// lldbg-check:[...] 0 // lldbr-check:(i32) x = 0 // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$1 = 1 +// lldb-command:v x +// lldbg-check:[...] 1 // lldbr-check:(i32) x = 1 // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$2 = 101 +// lldb-command:v x +// lldbg-check:[...] 101 // lldbr-check:(i32) x = 101 // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$3 = 101 +// lldb-command:v x +// lldbg-check:[...] 101 // lldbr-check:(i32) x = 101 // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$4 = -987 +// lldb-command:v x +// lldbg-check:[...] -987 // lldbr-check:(i32) x = -987 // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$5 = 101 +// lldb-command:v x +// lldbg-check:[...] 101 // lldbr-check:(i32) x = 101 // lldb-command:continue // SECOND ITERATION -// lldb-command:print x -// lldbg-check:[...]$6 = 1 +// lldb-command:v x +// lldbg-check:[...] 1 // lldbr-check:(i32) x = 1 // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$7 = 2 +// lldb-command:v x +// lldbg-check:[...] 2 // lldbr-check:(i32) x = 2 // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$8 = 102 +// lldb-command:v x +// lldbg-check:[...] 102 // lldbr-check:(i32) x = 102 // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$9 = 102 +// lldb-command:v x +// lldbg-check:[...] 102 // lldbr-check:(i32) x = 102 // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$10 = -987 +// lldb-command:v x +// lldbg-check:[...] -987 // lldbr-check:(i32) x = -987 // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$11 = 102 +// lldb-command:v x +// lldbg-check:[...] 102 // lldbr-check:(i32) x = 102 // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$12 = 2 +// lldb-command:v x +// lldbg-check:[...] 2 // lldbr-check:(i32) x = 2 // lldb-command:continue diff --git a/tests/debuginfo/lexical-scope-with-macro.rs b/tests/debuginfo/lexical-scope-with-macro.rs index 400dde6af31..76c923524fb 100644 --- a/tests/debuginfo/lexical-scope-with-macro.rs +++ b/tests/debuginfo/lexical-scope-with-macro.rs @@ -56,57 +56,57 @@ // lldb-command:run -// lldb-command:print a -// lldbg-check:[...]$0 = 10 +// lldb-command:v a +// lldbg-check:[...] 10 // lldbr-check:(i32) a = 10 -// lldb-command:print b -// lldbg-check:[...]$1 = 34 +// lldb-command:v b +// lldbg-check:[...] 34 // lldbr-check:(i32) b = 34 // lldb-command:continue -// lldb-command:print a -// lldbg-check:[...]$2 = 890242 +// lldb-command:v a +// lldbg-check:[...] 890242 // lldbr-check:(i32) a = 10 -// lldb-command:print b -// lldbg-check:[...]$3 = 34 +// lldb-command:v b +// lldbg-check:[...] 34 // lldbr-check:(i32) b = 34 // lldb-command:continue -// lldb-command:print a -// lldbg-check:[...]$4 = 10 +// lldb-command:v a +// lldbg-check:[...] 10 // lldbr-check:(i32) a = 10 -// lldb-command:print b -// lldbg-check:[...]$5 = 34 +// lldb-command:v b +// lldbg-check:[...] 34 // lldbr-check:(i32) b = 34 // lldb-command:continue -// lldb-command:print a -// lldbg-check:[...]$6 = 102 +// lldb-command:v a +// lldbg-check:[...] 102 // lldbr-check:(i32) a = 10 -// lldb-command:print b -// lldbg-check:[...]$7 = 34 +// lldb-command:v b +// lldbg-check:[...] 34 // lldbr-check:(i32) b = 34 // lldb-command:continue // Don't test this with rust-enabled lldb for now; see issue #48807 // lldbg-command:print a -// lldbg-check:[...]$8 = 110 +// lldbg-check:[...] 110 // lldbg-command:print b -// lldbg-check:[...]$9 = 34 +// lldbg-check:[...] 34 // lldbg-command:continue // lldbg-command:print a -// lldbg-check:[...]$10 = 10 +// lldbg-check:[...] 10 // lldbg-command:print b -// lldbg-check:[...]$11 = 34 +// lldbg-check:[...] 34 // lldbg-command:continue // lldbg-command:print a -// lldbg-check:[...]$12 = 10 +// lldbg-check:[...] 10 // lldbg-command:print b -// lldbg-check:[...]$13 = 34 +// lldbg-check:[...] 34 // lldbg-command:print c -// lldbg-check:[...]$14 = 400 +// lldbg-check:[...] 400 // lldbg-command:continue diff --git a/tests/debuginfo/lexical-scopes-in-block-expression.rs b/tests/debuginfo/lexical-scopes-in-block-expression.rs index 09cb8142474..5ff70270ea6 100644 --- a/tests/debuginfo/lexical-scopes-in-block-expression.rs +++ b/tests/debuginfo/lexical-scopes-in-block-expression.rs @@ -194,203 +194,203 @@ // lldb-command:run // STRUCT EXPRESSION -// lldb-command:print val -// lldbg-check:[...]$0 = -1 +// lldb-command:v val +// lldbg-check:[...] -1 // lldbr-check:(i32) val = -1 -// lldb-command:print ten -// lldbg-check:[...]$1 = 10 +// lldb-command:v ten +// lldbg-check:[...] 10 // lldbr-check:(isize) ten = 10 // lldb-command:continue -// lldb-command:print val -// lldbg-check:[...]$2 = 11 +// lldb-command:v val +// lldbg-check:[...] 11 // lldbr-check:(isize) val = 11 -// lldb-command:print ten -// lldbg-check:[...]$3 = 10 +// lldb-command:v ten +// lldbg-check:[...] 10 // lldbr-check:(isize) ten = 10 // lldb-command:continue -// lldb-command:print val -// lldbg-check:[...]$4 = -1 +// lldb-command:v val +// lldbg-check:[...] -1 // lldbr-check:(i32) val = -1 -// lldb-command:print ten -// lldbg-check:[...]$5 = 10 +// lldb-command:v ten +// lldbg-check:[...] 10 // lldbr-check:(isize) ten = 10 // lldb-command:continue // FUNCTION CALL -// lldb-command:print val -// lldbg-check:[...]$6 = -1 +// lldb-command:v val +// lldbg-check:[...] -1 // lldbr-check:(i32) val = -1 -// lldb-command:print ten -// lldbg-check:[...]$7 = 10 +// lldb-command:v ten +// lldbg-check:[...] 10 // lldbr-check:(isize) ten = 10 // lldb-command:continue -// lldb-command:print val -// lldbg-check:[...]$8 = 12 +// lldb-command:v val +// lldbg-check:[...] 12 // lldbr-check:(isize) val = 12 -// lldb-command:print ten -// lldbg-check:[...]$9 = 10 +// lldb-command:v ten +// lldbg-check:[...] 10 // lldbr-check:(isize) ten = 10 // lldb-command:continue -// lldb-command:print val -// lldbg-check:[...]$10 = -1 +// lldb-command:v val +// lldbg-check:[...] -1 // lldbr-check:(i32) val = -1 -// lldb-command:print ten -// lldbg-check:[...]$11 = 10 +// lldb-command:v ten +// lldbg-check:[...] 10 // lldbr-check:(isize) ten = 10 // lldb-command:continue // TUPLE EXPRESSION -// lldb-command:print val -// lldbg-check:[...]$12 = -1 +// lldb-command:v val +// lldbg-check:[...] -1 // lldbr-check:(i32) val = -1 -// lldb-command:print ten -// lldbg-check:[...]$13 = 10 +// lldb-command:v ten +// lldbg-check:[...] 10 // lldbr-check:(isize) ten = 10 // lldb-command:continue -// lldb-command:print val -// lldbg-check:[...]$14 = 13 +// lldb-command:v val +// lldbg-check:[...] 13 // lldbr-check:(isize) val = 13 -// lldb-command:print ten -// lldbg-check:[...]$15 = 10 +// lldb-command:v ten +// lldbg-check:[...] 10 // lldbr-check:(isize) ten = 10 // lldb-command:continue -// lldb-command:print val -// lldbg-check:[...]$16 = -1 +// lldb-command:v val +// lldbg-check:[...] -1 // lldbr-check:(i32) val = -1 -// lldb-command:print ten -// lldbg-check:[...]$17 = 10 +// lldb-command:v ten +// lldbg-check:[...] 10 // lldbr-check:(isize) ten = 10 // lldb-command:continue // VEC EXPRESSION -// lldb-command:print val -// lldbg-check:[...]$18 = -1 +// lldb-command:v val +// lldbg-check:[...] -1 // lldbr-check:(i32) val = -1 -// lldb-command:print ten -// lldbg-check:[...]$19 = 10 +// lldb-command:v ten +// lldbg-check:[...] 10 // lldbr-check:(isize) ten = 10 // lldb-command:continue -// lldb-command:print val -// lldbg-check:[...]$20 = 14 +// lldb-command:v val +// lldbg-check:[...] 14 // lldbr-check:(isize) val = 14 -// lldb-command:print ten -// lldbg-check:[...]$21 = 10 +// lldb-command:v ten +// lldbg-check:[...] 10 // lldbr-check:(isize) ten = 10 // lldb-command:continue -// lldb-command:print val -// lldbg-check:[...]$22 = -1 +// lldb-command:v val +// lldbg-check:[...] -1 // lldbr-check:(i32) val = -1 -// lldb-command:print ten -// lldbg-check:[...]$23 = 10 +// lldb-command:v ten +// lldbg-check:[...] 10 // lldbr-check:(isize) ten = 10 // lldb-command:continue // REPEAT VEC EXPRESSION -// lldb-command:print val -// lldbg-check:[...]$24 = -1 +// lldb-command:v val +// lldbg-check:[...] -1 // lldbr-check:(i32) val = -1 -// lldb-command:print ten -// lldbg-check:[...]$25 = 10 +// lldb-command:v ten +// lldbg-check:[...] 10 // lldbr-check:(isize) ten = 10 // lldb-command:continue -// lldb-command:print val -// lldbg-check:[...]$26 = 15 +// lldb-command:v val +// lldbg-check:[...] 15 // lldbr-check:(isize) val = 15 -// lldb-command:print ten -// lldbg-check:[...]$27 = 10 +// lldb-command:v ten +// lldbg-check:[...] 10 // lldbr-check:(isize) ten = 10 // lldb-command:continue -// lldb-command:print val -// lldbg-check:[...]$28 = -1 +// lldb-command:v val +// lldbg-check:[...] -1 // lldbr-check:(i32) val = -1 -// lldb-command:print ten -// lldbg-check:[...]$29 = 10 +// lldb-command:v ten +// lldbg-check:[...] 10 // lldbr-check:(isize) ten = 10 // lldb-command:continue // ASSIGNMENT EXPRESSION -// lldb-command:print val -// lldbg-check:[...]$30 = -1 +// lldb-command:v val +// lldbg-check:[...] -1 // lldbr-check:(i32) val = -1 -// lldb-command:print ten -// lldbg-check:[...]$31 = 10 +// lldb-command:v ten +// lldbg-check:[...] 10 // lldbr-check:(isize) ten = 10 // lldb-command:continue -// lldb-command:print val -// lldbg-check:[...]$32 = 16 +// lldb-command:v val +// lldbg-check:[...] 16 // lldbr-check:(isize) val = 16 -// lldb-command:print ten -// lldbg-check:[...]$33 = 10 +// lldb-command:v ten +// lldbg-check:[...] 10 // lldbr-check:(isize) ten = 10 // lldb-command:continue -// lldb-command:print val -// lldbg-check:[...]$34 = -1 +// lldb-command:v val +// lldbg-check:[...] -1 // lldbr-check:(i32) val = -1 -// lldb-command:print ten -// lldbg-check:[...]$35 = 10 +// lldb-command:v ten +// lldbg-check:[...] 10 // lldbr-check:(isize) ten = 10 // lldb-command:continue // ARITHMETIC EXPRESSION -// lldb-command:print val -// lldbg-check:[...]$36 = -1 +// lldb-command:v val +// lldbg-check:[...] -1 // lldbr-check:(i32) val = -1 -// lldb-command:print ten -// lldbg-check:[...]$37 = 10 +// lldb-command:v ten +// lldbg-check:[...] 10 // lldbr-check:(isize) ten = 10 // lldb-command:continue -// lldb-command:print val -// lldbg-check:[...]$38 = 17 +// lldb-command:v val +// lldbg-check:[...] 17 // lldbr-check:(isize) val = 17 -// lldb-command:print ten -// lldbg-check:[...]$39 = 10 +// lldb-command:v ten +// lldbg-check:[...] 10 // lldbr-check:(isize) ten = 10 // lldb-command:continue -// lldb-command:print val -// lldbg-check:[...]$40 = -1 +// lldb-command:v val +// lldbg-check:[...] -1 // lldbr-check:(i32) val = -1 -// lldb-command:print ten -// lldbg-check:[...]$41 = 10 +// lldb-command:v ten +// lldbg-check:[...] 10 // lldbr-check:(isize) ten = 10 // lldb-command:continue // INDEX EXPRESSION -// lldb-command:print val -// lldbg-check:[...]$42 = -1 +// lldb-command:v val +// lldbg-check:[...] -1 // lldbr-check:(i32) val = -1 -// lldb-command:print ten -// lldbg-check:[...]$43 = 10 +// lldb-command:v ten +// lldbg-check:[...] 10 // lldbr-check:(isize) ten = 10 // lldb-command:continue -// lldb-command:print val -// lldbg-check:[...]$44 = 18 +// lldb-command:v val +// lldbg-check:[...] 18 // lldbr-check:(isize) val = 18 -// lldb-command:print ten -// lldbg-check:[...]$45 = 10 +// lldb-command:v ten +// lldbg-check:[...] 10 // lldbr-check:(isize) ten = 10 // lldb-command:continue -// lldb-command:print val -// lldbg-check:[...]$46 = -1 +// lldb-command:v val +// lldbg-check:[...] -1 // lldbr-check:(i32) val = -1 -// lldb-command:print ten -// lldbg-check:[...]$47 = 10 +// lldb-command:v ten +// lldbg-check:[...] 10 // lldbr-check:(isize) ten = 10 // lldb-command:continue diff --git a/tests/debuginfo/macro-stepping.rs b/tests/debuginfo/macro-stepping.rs index 69cabd92298..71ff9798079 100644 --- a/tests/debuginfo/macro-stepping.rs +++ b/tests/debuginfo/macro-stepping.rs @@ -56,36 +56,36 @@ extern crate macro_stepping; // exports new_scope!() // lldb-command:run // lldb-command:next // lldb-command:frame select -// lldb-check:[...]#loc1[...] +// lldb-check:[...] #loc1 [...] // lldb-command:next // lldb-command:frame select -// lldb-check:[...]#loc2[...] +// lldb-check:[...] #loc2 [...] // lldb-command:next // lldb-command:frame select -// lldb-check:[...]#loc3[...] +// lldb-check:[...] #loc3 [...] // lldb-command:next // lldb-command:frame select -// lldb-check:[...]#loc4[...] +// lldb-check:[...] #loc4 [...] // lldb-command:next // lldb-command:frame select -// lldb-check:[...]#loc5[...] +// lldb-check:[...] #loc5 [...] // lldb-command:continue // lldb-command:step // lldb-command:frame select -// lldb-check:[...]#inc-loc1[...] +// lldb-check:[...] #inc-loc1 [...] // lldb-command:next // lldb-command:frame select -// lldb-check:[...]#inc-loc2[...] +// lldb-check:[...] #inc-loc2 [...] // lldb-command:next // lldb-command:frame select -// lldb-check:[...]#inc-loc1[...] +// lldb-check:[...] #inc-loc1 [...] // lldb-command:next // lldb-command:frame select -// lldb-check:[...]#inc-loc2[...] +// lldb-check:[...] #inc-loc2 [...] // lldb-command:next // lldb-command:frame select -// lldb-check:[...]#inc-loc3[...] +// lldb-check:[...] #inc-loc3 [...] macro_rules! foo { () => { diff --git a/tests/debuginfo/method-on-enum.rs b/tests/debuginfo/method-on-enum.rs index 454967c6cb7..8a57060717e 100644 --- a/tests/debuginfo/method-on-enum.rs +++ b/tests/debuginfo/method-on-enum.rs @@ -63,48 +63,48 @@ // lldb-command:run // STACK BY REF -// lldb-command:print *self -// lldb-check:[...]$0 = Variant2(117901063) -// lldb-command:print arg1 -// lldb-check:[...]$1 = -1 -// lldb-command:print arg2 -// lldb-check:[...]$2 = -2 +// lldb-command:v *self +// lldb-check:[...] Variant2(117901063) +// lldb-command:v arg1 +// lldb-check:[...] -1 +// lldb-command:v arg2 +// lldb-check:[...] -2 // lldb-command:continue // STACK BY VAL -// lldb-command:print self -// lldb-check:[...]$3 = Variant2(117901063) -// lldb-command:print arg1 -// lldb-check:[...]$4 = -3 -// lldb-command:print arg2 -// lldb-check:[...]$5 = -4 +// lldb-command:v self +// lldb-check:[...] Variant2(117901063) +// lldb-command:v arg1 +// lldb-check:[...] -3 +// lldb-command:v arg2 +// lldb-check:[...] -4 // lldb-command:continue // OWNED BY REF -// lldb-command:print *self -// lldb-check:[...]$6 = Variant1 { x: 1799, y: 1799 } -// lldb-command:print arg1 -// lldb-check:[...]$7 = -5 -// lldb-command:print arg2 -// lldb-check:[...]$8 = -6 +// lldb-command:v *self +// lldb-check:[...] Variant1 { x: 1799, y: 1799 } +// lldb-command:v arg1 +// lldb-check:[...] -5 +// lldb-command:v arg2 +// lldb-check:[...] -6 // lldb-command:continue // OWNED BY VAL -// lldb-command:print self -// lldb-check:[...]$9 = Variant1 { x: 1799, y: 1799 } -// lldb-command:print arg1 -// lldb-check:[...]$10 = -7 -// lldb-command:print arg2 -// lldb-check:[...]$11 = -8 +// lldb-command:v self +// lldb-check:[...] Variant1 { x: 1799, y: 1799 } +// lldb-command:v arg1 +// lldb-check:[...] -7 +// lldb-command:v arg2 +// lldb-check:[...] -8 // lldb-command:continue // OWNED MOVED -// lldb-command:print *self -// lldb-check:[...]$12 = Variant1 { x: 1799, y: 1799 } -// lldb-command:print arg1 -// lldb-check:[...]$13 = -9 -// lldb-command:print arg2 -// lldb-check:[...]$14 = -10 +// lldb-command:v *self +// lldb-check:[...] Variant1 { x: 1799, y: 1799 } +// lldb-command:v arg1 +// lldb-check:[...] -9 +// lldb-command:v arg2 +// lldb-check:[...] -10 // lldb-command:continue #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/method-on-generic-struct.rs b/tests/debuginfo/method-on-generic-struct.rs index 562798c27da..64ef0e6bb0c 100644 --- a/tests/debuginfo/method-on-generic-struct.rs +++ b/tests/debuginfo/method-on-generic-struct.rs @@ -64,62 +64,62 @@ // lldb-command:run // STACK BY REF -// lldb-command:print *self -// lldbg-check:[...]$0 = Struct<(u32, i32)> { x: (8888, -8888) } +// lldb-command:v *self +// lldbg-check:[...] Struct<(u32, i32)> { x: (8888, -8888) } // lldbr-check:(method_on_generic_struct::Struct<(u32, i32)>) *self = { x = { = 8888 = -8888 } } -// lldb-command:print arg1 -// lldbg-check:[...]$1 = -1 +// lldb-command:v arg1 +// lldbg-check:[...] -1 // lldbr-check:(isize) arg1 = -1 -// lldb-command:print arg2 -// lldbg-check:[...]$2 = -2 +// lldb-command:v arg2 +// lldbg-check:[...] -2 // lldbr-check:(isize) arg2 = -2 // lldb-command:continue // STACK BY VAL -// lldb-command:print self -// lldbg-check:[...]$3 = Struct<(u32, i32)> { x: (8888, -8888) } +// lldb-command:v self +// lldbg-check:[...] Struct<(u32, i32)> { x: (8888, -8888) } // lldbr-check:(method_on_generic_struct::Struct<(u32, i32)>) self = { x = { = 8888 = -8888 } } -// lldb-command:print arg1 -// lldbg-check:[...]$4 = -3 +// lldb-command:v arg1 +// lldbg-check:[...] -3 // lldbr-check:(isize) arg1 = -3 -// lldb-command:print arg2 -// lldbg-check:[...]$5 = -4 +// lldb-command:v arg2 +// lldbg-check:[...] -4 // lldbr-check:(isize) arg2 = -4 // lldb-command:continue // OWNED BY REF -// lldb-command:print *self -// lldbg-check:[...]$6 = Struct<f64> { x: 1234.5 } +// lldb-command:v *self +// lldbg-check:[...] Struct<f64> { x: 1234.5 } // lldbr-check:(method_on_generic_struct::Struct<f64>) *self = Struct<f64> { x: 1234.5 } -// lldb-command:print arg1 -// lldbg-check:[...]$7 = -5 +// lldb-command:v arg1 +// lldbg-check:[...] -5 // lldbr-check:(isize) arg1 = -5 -// lldb-command:print arg2 -// lldbg-check:[...]$8 = -6 +// lldb-command:v arg2 +// lldbg-check:[...] -6 // lldbr-check:(isize) arg2 = -6 // lldb-command:continue // OWNED BY VAL -// lldb-command:print self -// lldbg-check:[...]$9 = Struct<f64> { x: 1234.5 } +// lldb-command:v self +// lldbg-check:[...] Struct<f64> { x: 1234.5 } // lldbr-check:(method_on_generic_struct::Struct<f64>) self = Struct<f64> { x: 1234.5 } -// lldb-command:print arg1 -// lldbg-check:[...]$10 = -7 +// lldb-command:v arg1 +// lldbg-check:[...] -7 // lldbr-check:(isize) arg1 = -7 -// lldb-command:print arg2 -// lldbg-check:[...]$11 = -8 +// lldb-command:v arg2 +// lldbg-check:[...] -8 // lldbr-check:(isize) arg2 = -8 // lldb-command:continue // OWNED MOVED -// lldb-command:print *self -// lldbg-check:[...]$12 = Struct<f64> { x: 1234.5 } +// lldb-command:v *self +// lldbg-check:[...] Struct<f64> { x: 1234.5 } // lldbr-check:(method_on_generic_struct::Struct<f64>) *self = Struct<f64> { x: 1234.5 } -// lldb-command:print arg1 -// lldbg-check:[...]$13 = -9 +// lldb-command:v arg1 +// lldbg-check:[...] -9 // lldbr-check:(isize) arg1 = -9 -// lldb-command:print arg2 -// lldbg-check:[...]$14 = -10 +// lldb-command:v arg2 +// lldbg-check:[...] -10 // lldbr-check:(isize) arg2 = -10 // lldb-command:continue diff --git a/tests/debuginfo/method-on-struct.rs b/tests/debuginfo/method-on-struct.rs index bb94ced305d..a4129af5429 100644 --- a/tests/debuginfo/method-on-struct.rs +++ b/tests/debuginfo/method-on-struct.rs @@ -62,62 +62,62 @@ // lldb-command:run // STACK BY REF -// lldb-command:print *self -// lldbg-check:[...]$0 = { x = 100 } +// lldb-command:v *self +// lldbg-check:[...] { x = 100 } // lldbr-check:(method_on_struct::Struct) *self = Struct { x: 100 } -// lldb-command:print arg1 -// lldbg-check:[...]$1 = -1 +// lldb-command:v arg1 +// lldbg-check:[...] -1 // lldbr-check:(isize) arg1 = -1 -// lldb-command:print arg2 -// lldbg-check:[...]$2 = -2 +// lldb-command:v arg2 +// lldbg-check:[...] -2 // lldbr-check:(isize) arg2 = -2 // lldb-command:continue // STACK BY VAL -// lldb-command:print self -// lldbg-check:[...]$3 = { x = 100 } +// lldb-command:v self +// lldbg-check:[...] { x = 100 } // lldbr-check:(method_on_struct::Struct) self = Struct { x: 100 } -// lldb-command:print arg1 -// lldbg-check:[...]$4 = -3 +// lldb-command:v arg1 +// lldbg-check:[...] -3 // lldbr-check:(isize) arg1 = -3 -// lldb-command:print arg2 -// lldbg-check:[...]$5 = -4 +// lldb-command:v arg2 +// lldbg-check:[...] -4 // lldbr-check:(isize) arg2 = -4 // lldb-command:continue // OWNED BY REF -// lldb-command:print *self -// lldbg-check:[...]$6 = { x = 200 } +// lldb-command:v *self +// lldbg-check:[...] { x = 200 } // lldbr-check:(method_on_struct::Struct) *self = Struct { x: 200 } -// lldb-command:print arg1 -// lldbg-check:[...]$7 = -5 +// lldb-command:v arg1 +// lldbg-check:[...] -5 // lldbr-check:(isize) arg1 = -5 -// lldb-command:print arg2 -// lldbg-check:[...]$8 = -6 +// lldb-command:v arg2 +// lldbg-check:[...] -6 // lldbr-check:(isize) arg2 = -6 // lldb-command:continue // OWNED BY VAL -// lldb-command:print self -// lldbg-check:[...]$9 = { x = 200 } +// lldb-command:v self +// lldbg-check:[...] { x = 200 } // lldbr-check:(method_on_struct::Struct) self = Struct { x: 200 } -// lldb-command:print arg1 -// lldbg-check:[...]$10 = -7 +// lldb-command:v arg1 +// lldbg-check:[...] -7 // lldbr-check:(isize) arg1 = -7 -// lldb-command:print arg2 -// lldbg-check:[...]$11 = -8 +// lldb-command:v arg2 +// lldbg-check:[...] -8 // lldbr-check:(isize) arg2 = -8 // lldb-command:continue // OWNED MOVED -// lldb-command:print *self -// lldbg-check:[...]$12 = { x = 200 } +// lldb-command:v *self +// lldbg-check:[...] { x = 200 } // lldbr-check:(method_on_struct::Struct) *self = Struct { x: 200 } -// lldb-command:print arg1 -// lldbg-check:[...]$13 = -9 +// lldb-command:v arg1 +// lldbg-check:[...] -9 // lldbr-check:(isize) arg1 = -9 -// lldb-command:print arg2 -// lldbg-check:[...]$14 = -10 +// lldb-command:v arg2 +// lldbg-check:[...] -10 // lldbr-check:(isize) arg2 = -10 // lldb-command:continue diff --git a/tests/debuginfo/method-on-trait.rs b/tests/debuginfo/method-on-trait.rs index bc8def40105..0934c267ab1 100644 --- a/tests/debuginfo/method-on-trait.rs +++ b/tests/debuginfo/method-on-trait.rs @@ -62,62 +62,62 @@ // lldb-command:run // STACK BY REF -// lldb-command:print *self -// lldbg-check:[...]$0 = { x = 100 } +// lldb-command:v *self +// lldbg-check:[...] { x = 100 } // lldbr-check:(method_on_trait::Struct) *self = { x = 100 } -// lldb-command:print arg1 -// lldbg-check:[...]$1 = -1 +// lldb-command:v arg1 +// lldbg-check:[...] -1 // lldbr-check:(isize) arg1 = -1 -// lldb-command:print arg2 -// lldbg-check:[...]$2 = -2 +// lldb-command:v arg2 +// lldbg-check:[...] -2 // lldbr-check:(isize) arg2 = -2 // lldb-command:continue // STACK BY VAL -// lldb-command:print self -// lldbg-check:[...]$3 = { x = 100 } +// lldb-command:v self +// lldbg-check:[...] { x = 100 } // lldbr-check:(method_on_trait::Struct) self = { x = 100 } -// lldb-command:print arg1 -// lldbg-check:[...]$4 = -3 +// lldb-command:v arg1 +// lldbg-check:[...] -3 // lldbr-check:(isize) arg1 = -3 -// lldb-command:print arg2 -// lldbg-check:[...]$5 = -4 +// lldb-command:v arg2 +// lldbg-check:[...] -4 // lldbr-check:(isize) arg2 = -4 // lldb-command:continue // OWNED BY REF -// lldb-command:print *self -// lldbg-check:[...]$6 = { x = 200 } +// lldb-command:v *self +// lldbg-check:[...] { x = 200 } // lldbr-check:(method_on_trait::Struct) *self = { x = 200 } -// lldb-command:print arg1 -// lldbg-check:[...]$7 = -5 +// lldb-command:v arg1 +// lldbg-check:[...] -5 // lldbr-check:(isize) arg1 = -5 -// lldb-command:print arg2 -// lldbg-check:[...]$8 = -6 +// lldb-command:v arg2 +// lldbg-check:[...] -6 // lldbr-check:(isize) arg2 = -6 // lldb-command:continue // OWNED BY VAL -// lldb-command:print self -// lldbg-check:[...]$9 = { x = 200 } +// lldb-command:v self +// lldbg-check:[...] { x = 200 } // lldbr-check:(method_on_trait::Struct) self = { x = 200 } -// lldb-command:print arg1 -// lldbg-check:[...]$10 = -7 +// lldb-command:v arg1 +// lldbg-check:[...] -7 // lldbr-check:(isize) arg1 = -7 -// lldb-command:print arg2 -// lldbg-check:[...]$11 = -8 +// lldb-command:v arg2 +// lldbg-check:[...] -8 // lldbr-check:(isize) arg2 = -8 // lldb-command:continue // OWNED MOVED -// lldb-command:print *self -// lldbg-check:[...]$12 = { x = 200 } +// lldb-command:v *self +// lldbg-check:[...] { x = 200 } // lldbr-check:(method_on_trait::Struct) *self = { x = 200 } -// lldb-command:print arg1 -// lldbg-check:[...]$13 = -9 +// lldb-command:v arg1 +// lldbg-check:[...] -9 // lldbr-check:(isize) arg1 = -9 -// lldb-command:print arg2 -// lldbg-check:[...]$14 = -10 +// lldb-command:v arg2 +// lldbg-check:[...] -10 // lldbr-check:(isize) arg2 = -10 // lldb-command:continue diff --git a/tests/debuginfo/method-on-tuple-struct.rs b/tests/debuginfo/method-on-tuple-struct.rs index 7ac0a2d8574..9cf9c6d7fba 100644 --- a/tests/debuginfo/method-on-tuple-struct.rs +++ b/tests/debuginfo/method-on-tuple-struct.rs @@ -62,62 +62,62 @@ // lldb-command:run // STACK BY REF -// lldb-command:print *self -// lldbg-check:[...]$0 = { 0 = 100 1 = -100.5 } +// lldb-command:v *self +// lldbg-check:[...] { 0 = 100 1 = -100.5 } // lldbr-check:(method_on_tuple_struct::TupleStruct) *self = { 0 = 100 1 = -100.5 } -// lldb-command:print arg1 -// lldbg-check:[...]$1 = -1 +// lldb-command:v arg1 +// lldbg-check:[...] -1 // lldbr-check:(isize) arg1 = -1 -// lldb-command:print arg2 -// lldbg-check:[...]$2 = -2 +// lldb-command:v arg2 +// lldbg-check:[...] -2 // lldbr-check:(isize) arg2 = -2 // lldb-command:continue // STACK BY VAL -// lldb-command:print self -// lldbg-check:[...]$3 = { 0 = 100 1 = -100.5 } +// lldb-command:v self +// lldbg-check:[...] { 0 = 100 1 = -100.5 } // lldbr-check:(method_on_tuple_struct::TupleStruct) self = { 0 = 100 1 = -100.5 } -// lldb-command:print arg1 -// lldbg-check:[...]$4 = -3 +// lldb-command:v arg1 +// lldbg-check:[...] -3 // lldbr-check:(isize) arg1 = -3 -// lldb-command:print arg2 -// lldbg-check:[...]$5 = -4 +// lldb-command:v arg2 +// lldbg-check:[...] -4 // lldbr-check:(isize) arg2 = -4 // lldb-command:continue // OWNED BY REF -// lldb-command:print *self -// lldbg-check:[...]$6 = { 0 = 200 1 = -200.5 } +// lldb-command:v *self +// lldbg-check:[...] { 0 = 200 1 = -200.5 } // lldbr-check:(method_on_tuple_struct::TupleStruct) *self = { 0 = 200 1 = -200.5 } -// lldb-command:print arg1 -// lldbg-check:[...]$7 = -5 +// lldb-command:v arg1 +// lldbg-check:[...] -5 // lldbr-check:(isize) arg1 = -5 -// lldb-command:print arg2 -// lldbg-check:[...]$8 = -6 +// lldb-command:v arg2 +// lldbg-check:[...] -6 // lldbr-check:(isize) arg2 = -6 // lldb-command:continue // OWNED BY VAL -// lldb-command:print self -// lldbg-check:[...]$9 = { 0 = 200 1 = -200.5 } +// lldb-command:v self +// lldbg-check:[...] { 0 = 200 1 = -200.5 } // lldbr-check:(method_on_tuple_struct::TupleStruct) self = { 0 = 200 1 = -200.5 } -// lldb-command:print arg1 -// lldbg-check:[...]$10 = -7 +// lldb-command:v arg1 +// lldbg-check:[...] -7 // lldbr-check:(isize) arg1 = -7 -// lldb-command:print arg2 -// lldbg-check:[...]$11 = -8 +// lldb-command:v arg2 +// lldbg-check:[...] -8 // lldbr-check:(isize) arg2 = -8 // lldb-command:continue // OWNED MOVED -// lldb-command:print *self -// lldbg-check:[...]$12 = { 0 = 200 1 = -200.5 } +// lldb-command:v *self +// lldbg-check:[...] { 0 = 200 1 = -200.5 } // lldbr-check:(method_on_tuple_struct::TupleStruct) *self = { 0 = 200 1 = -200.5 } -// lldb-command:print arg1 -// lldbg-check:[...]$13 = -9 +// lldb-command:v arg1 +// lldbg-check:[...] -9 // lldbr-check:(isize) arg1 = -9 -// lldb-command:print arg2 -// lldbg-check:[...]$14 = -10 +// lldb-command:v arg2 +// lldbg-check:[...] -10 // lldbr-check:(isize) arg2 = -10 // lldb-command:continue diff --git a/tests/debuginfo/multi-cgu.rs b/tests/debuginfo/multi-cgu.rs index b2ad1d3cd95..32fd6895877 100644 --- a/tests/debuginfo/multi-cgu.rs +++ b/tests/debuginfo/multi-cgu.rs @@ -23,13 +23,13 @@ // lldb-command:run -// lldb-command:print xxx -// lldbg-check:[...]$0 = 12345 +// lldb-command:v xxx +// lldbg-check:[...] 12345 // lldbr-check:(u32) xxx = 12345 // lldb-command:continue -// lldb-command:print yyy -// lldbg-check:[...]$1 = 67890 +// lldb-command:v yyy +// lldbg-check:[...] 67890 // lldbr-check:(u64) yyy = 67890 // lldb-command:continue diff --git a/tests/debuginfo/multiple-functions-equal-var-names.rs b/tests/debuginfo/multiple-functions-equal-var-names.rs index 08446997b42..2d9caf75290 100644 --- a/tests/debuginfo/multiple-functions-equal-var-names.rs +++ b/tests/debuginfo/multiple-functions-equal-var-names.rs @@ -22,18 +22,18 @@ // lldb-command:run -// lldb-command:print abc -// lldbg-check:[...]$0 = 10101 +// lldb-command:v abc +// lldbg-check:[...] 10101 // lldbr-check:(i32) abc = 10101 // lldb-command:continue -// lldb-command:print abc -// lldbg-check:[...]$1 = 20202 +// lldb-command:v abc +// lldbg-check:[...] 20202 // lldbr-check:(i32) abc = 20202 // lldb-command:continue -// lldb-command:print abc -// lldbg-check:[...]$2 = 30303 +// lldb-command:v abc +// lldbg-check:[...] 30303 // lldbr-check:(i32) abc = 30303 #![allow(unused_variables)] diff --git a/tests/debuginfo/multiple-functions.rs b/tests/debuginfo/multiple-functions.rs index 2c4092fd5a3..5c01a427051 100644 --- a/tests/debuginfo/multiple-functions.rs +++ b/tests/debuginfo/multiple-functions.rs @@ -22,18 +22,18 @@ // lldb-command:run -// lldb-command:print a -// lldbg-check:[...]$0 = 10101 +// lldb-command:v a +// lldbg-check:[...] 10101 // lldbr-check:(i32) a = 10101 // lldb-command:continue -// lldb-command:print b -// lldbg-check:[...]$1 = 20202 +// lldb-command:v b +// lldbg-check:[...] 20202 // lldbr-check:(i32) b = 20202 // lldb-command:continue -// lldb-command:print c -// lldbg-check:[...]$2 = 30303 +// lldb-command:v c +// lldbg-check:[...] 30303 // lldbr-check:(i32) c = 30303 #![allow(unused_variables)] diff --git a/tests/debuginfo/name-shadowing-and-scope-nesting.rs b/tests/debuginfo/name-shadowing-and-scope-nesting.rs index e8860b2d104..8813793e59e 100644 --- a/tests/debuginfo/name-shadowing-and-scope-nesting.rs +++ b/tests/debuginfo/name-shadowing-and-scope-nesting.rs @@ -47,51 +47,51 @@ // lldb-command:run -// lldb-command:print x -// lldbg-check:[...]$0 = false +// lldb-command:v x +// lldbg-check:[...] false // lldbr-check:(bool) x = false -// lldb-command:print y -// lldbg-check:[...]$1 = true +// lldb-command:v y +// lldbg-check:[...] true // lldbr-check:(bool) y = true // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$2 = 10 +// lldb-command:v x +// lldbg-check:[...] 10 // lldbr-check:(i32) x = 10 -// lldb-command:print y -// lldbg-check:[...]$3 = true +// lldb-command:v y +// lldbg-check:[...] true // lldbr-check:(bool) y = true // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$4 = 10.5 +// lldb-command:v x +// lldbg-check:[...] 10.5 // lldbr-check:(f64) x = 10.5 -// lldb-command:print y -// lldbg-check:[...]$5 = 20 +// lldb-command:v y +// lldbg-check:[...] 20 // lldbr-check:(i32) y = 20 // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$6 = true +// lldb-command:v x +// lldbg-check:[...] true // lldbr-check:(bool) x = true -// lldb-command:print y -// lldbg-check:[...]$7 = 2220 +// lldb-command:v y +// lldbg-check:[...] 2220 // lldbr-check:(i32) y = 2220 // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$8 = 203203.5 +// lldb-command:v x +// lldbg-check:[...] 203203.5 // lldbr-check:(f64) x = 203203.5 -// lldb-command:print y -// lldbg-check:[...]$9 = 2220 +// lldb-command:v y +// lldbg-check:[...] 2220 // lldbr-check:(i32) y = 2220 // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$10 = 10.5 +// lldb-command:v x +// lldbg-check:[...] 10.5 // lldbr-check:(f64) x = 10.5 -// lldb-command:print y -// lldbg-check:[...]$11 = 20 +// lldb-command:v y +// lldbg-check:[...] 20 // lldbr-check:(i32) y = 20 // lldb-command:continue diff --git a/tests/debuginfo/no_mangle-info.rs b/tests/debuginfo/no_mangle-info.rs index 15629d217ba..06c65a71b2e 100644 --- a/tests/debuginfo/no_mangle-info.rs +++ b/tests/debuginfo/no_mangle-info.rs @@ -10,10 +10,10 @@ // === LLDB TESTS ================================================================================== // lldb-command:run -// lldb-command:p TEST -// lldb-check: (unsigned long) $0 = 3735928559 -// lldb-command:p OTHER_TEST -// lldb-check: (unsigned long) $1 = 42 +// lldb-command:v TEST +// lldb-check:(unsigned long) TEST = 3735928559 +// lldb-command:v OTHER_TEST +// lldb-check:(unsigned long) no_mangle_info::namespace::OTHER_TEST::[...] = 42 // === CDB TESTS ================================================================================== // cdb-command: g diff --git a/tests/debuginfo/numeric-types.rs b/tests/debuginfo/numeric-types.rs index 74c9e5e1dc3..1ff72d34fbd 100644 --- a/tests/debuginfo/numeric-types.rs +++ b/tests/debuginfo/numeric-types.rs @@ -202,41 +202,41 @@ // lldb-command:run -// lldb-command:print/d nz_i8 -// lldb-check:[...]$0 = 11 { __0 = 11 } +// lldb-command:v/d nz_i8 +// lldb-check:[...] 11 { __0 = { 0 = 11 } } -// lldb-command:print nz_i16 -// lldb-check:[...]$1 = 22 { __0 = 22 } +// lldb-command:v nz_i16 +// lldb-check:[...] 22 { __0 = { 0 = 22 } } -// lldb-command:print nz_i32 -// lldb-check:[...]$2 = 33 { __0 = 33 } +// lldb-command:v nz_i32 +// lldb-check:[...] 33 { __0 = { 0 = 33 } } -// lldb-command:print nz_i64 -// lldb-check:[...]$3 = 44 { __0 = 44 } +// lldb-command:v nz_i64 +// lldb-check:[...] 44 { __0 = { 0 = 44 } } -// lldb-command:print nz_i128 -// lldb-check:[...]$4 = 55 { __0 = 55 } +// lldb-command:v nz_i128 +// lldb-check:[...] 55 { __0 = { 0 = 55 } } -// lldb-command:print nz_isize -// lldb-check:[...]$5 = 66 { __0 = 66 } +// lldb-command:v nz_isize +// lldb-check:[...] 66 { __0 = { 0 = 66 } } -// lldb-command:print/d nz_u8 -// lldb-check:[...]$6 = 77 { __0 = 77 } +// lldb-command:v/d nz_u8 +// lldb-check:[...] 77 { __0 = { 0 = 77 } } -// lldb-command:print nz_u16 -// lldb-check:[...]$7 = 88 { __0 = 88 } +// lldb-command:v nz_u16 +// lldb-check:[...] 88 { __0 = { 0 = 88 } } -// lldb-command:print nz_u32 -// lldb-check:[...]$8 = 99 { __0 = 99 } +// lldb-command:v nz_u32 +// lldb-check:[...] 99 { __0 = { 0 = 99 } } -// lldb-command:print nz_u64 -// lldb-check:[...]$9 = 100 { __0 = 100 } +// lldb-command:v nz_u64 +// lldb-check:[...] 100 { __0 = { 0 = 100 } } -// lldb-command:print nz_u128 -// lldb-check:[...]$10 = 111 { __0 = 111 } +// lldb-command:v nz_u128 +// lldb-check:[...] 111 { __0 = { 0 = 111 } } -// lldb-command:print nz_usize -// lldb-check:[...]$11 = 122 { __0 = 122 } +// lldb-command:v nz_usize +// lldb-check:[...] 122 { __0 = { 0 = 122 } } #![feature(generic_nonzero)] use std::num::*; diff --git a/tests/debuginfo/option-like-enum.rs b/tests/debuginfo/option-like-enum.rs index b2a8aa1c29a..c782796f473 100644 --- a/tests/debuginfo/option-like-enum.rs +++ b/tests/debuginfo/option-like-enum.rs @@ -47,35 +47,35 @@ // lldb-command:run -// lldb-command:print some -// lldb-check:[...]$0 = Some(&0x12345678) +// lldb-command:v some +// lldb-check:[...] Some(&0x12345678) -// lldb-command:print none -// lldb-check:[...]$1 = None +// lldb-command:v none +// lldb-check:[...] None -// lldb-command:print full -// lldb-check:[...]$2 = Full(454545, &0x87654321, 9988) +// lldb-command:v full +// lldb-check:[...] Full(454545, &0x87654321, 9988) -// lldb-command:print empty -// lldb-check:[...]$3 = Empty +// lldb-command:v empty +// lldb-check:[...] Empty -// lldb-command:print droid -// lldb-check:[...]$4 = Droid { id: 675675, range: 10000001, internals: &0x43218765 } +// lldb-command:v droid +// lldb-check:[...] Droid { id: 675675, range: 10000001, internals: &0x43218765 } -// lldb-command:print void_droid -// lldb-check:[...]$5 = Void +// lldb-command:v void_droid +// lldb-check:[...] Void -// lldb-command:print some_str -// lldb-check:[...]$6 = Some("abc") +// lldb-command:v some_str +// lldb-check:[...] Some("abc") -// lldb-command:print none_str -// lldb-check:[...]$7 = None +// lldb-command:v none_str +// lldb-check:[...] None -// lldb-command:print nested_non_zero_yep -// lldb-check:[...]$8 = Yep(10.5, NestedNonZeroField { a: 10, b: 20, c: &[...] }) +// lldb-command:v nested_non_zero_yep +// lldb-check:[...] Yep(10.5, NestedNonZeroField { a: 10, b: 20, c: &[...] }) -// lldb-command:print nested_non_zero_nope -// lldb-check:[...]$9 = Nope +// lldb-command:v nested_non_zero_nope +// lldb-check:[...] Nope #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/packed-struct-with-destructor.rs b/tests/debuginfo/packed-struct-with-destructor.rs index 19788339efa..f9bac844376 100644 --- a/tests/debuginfo/packed-struct-with-destructor.rs +++ b/tests/debuginfo/packed-struct-with-destructor.rs @@ -44,36 +44,36 @@ // lldb-command:run -// lldb-command:print packed -// lldbg-check:[...]$0 = { x = 123 y = 234 z = 345 } +// lldb-command:v packed +// lldbg-check:[...] { x = 123 y = 234 z = 345 } // lldbr-check:(packed_struct_with_destructor::Packed) packed = { x = 123 y = 234 z = 345 } -// lldb-command:print packedInPacked -// lldbg-check:[...]$1 = { a = 1111 b = { x = 2222 y = 3333 z = 4444 } c = 5555 d = { x = 6666 y = 7777 z = 8888 } } +// lldb-command:v packedInPacked +// lldbg-check:[...] { a = 1111 b = { x = 2222 y = 3333 z = 4444 } c = 5555 d = { x = 6666 y = 7777 z = 8888 } } // lldbr-check:(packed_struct_with_destructor::PackedInPacked) packedInPacked = { a = 1111 b = { x = 2222 y = 3333 z = 4444 } c = 5555 d = { x = 6666 y = 7777 z = 8888 } } -// lldb-command:print packedInUnpacked -// lldbg-check:[...]$2 = { a = -1111 b = { x = -2222 y = -3333 z = -4444 } c = -5555 d = { x = -6666 y = -7777 z = -8888 } } +// lldb-command:v packedInUnpacked +// lldbg-check:[...] { a = -1111 b = { x = -2222 y = -3333 z = -4444 } c = -5555 d = { x = -6666 y = -7777 z = -8888 } } // lldbr-check:(packed_struct_with_destructor::PackedInUnpacked) packedInUnpacked = { a = -1111 b = { x = -2222 y = -3333 z = -4444 } c = -5555 d = { x = -6666 y = -7777 z = -8888 } } -// lldb-command:print unpackedInPacked -// lldbg-check:[...]$3 = { a = 987 b = { x = 876 y = 765 z = 654 } c = { x = 543 y = 432 z = 321 } d = 210 } +// lldb-command:v unpackedInPacked +// lldbg-check:[...] { a = 987 b = { x = 876 y = 765 z = 654 } c = { x = 543 y = 432 z = 321 } d = 210 } // lldbr-check:(packed_struct_with_destructor::UnpackedInPacked) unpackedInPacked = { a = 987 b = { x = 876 y = 765 z = 654 } c = { x = 543 y = 432 z = 321 } d = 210 } -// lldb-command:print packedInPackedWithDrop -// lldbg-check:[...]$4 = { a = 11 b = { x = 22 y = 33 z = 44 } c = 55 d = { x = 66 y = 77 z = 88 } } +// lldb-command:v packedInPackedWithDrop +// lldbg-check:[...] { a = 11 b = { x = 22 y = 33 z = 44 } c = 55 d = { x = 66 y = 77 z = 88 } } // lldbr-check:(packed_struct_with_destructor::PackedInPackedWithDrop) packedInPackedWithDrop = { a = 11 b = { x = 22 y = 33 z = 44 } c = 55 d = { x = 66 y = 77 z = 88 } } -// lldb-command:print packedInUnpackedWithDrop -// lldbg-check:[...]$5 = { a = -11 b = { x = -22 y = -33 z = -44 } c = -55 d = { x = -66 y = -77 z = -88 } } +// lldb-command:v packedInUnpackedWithDrop +// lldbg-check:[...] { a = -11 b = { x = -22 y = -33 z = -44 } c = -55 d = { x = -66 y = -77 z = -88 } } // lldbr-check:(packed_struct_with_destructor::PackedInUnpackedWithDrop) packedInUnpackedWithDrop = { a = -11 b = { x = -22 y = -33 z = -44 } c = -55 d = { x = -66 y = -77 z = -88 } } -// lldb-command:print unpackedInPackedWithDrop -// lldbg-check:[...]$6 = { a = 98 b = { x = 87 y = 76 z = 65 } c = { x = 54 y = 43 z = 32 } d = 21 } +// lldb-command:v unpackedInPackedWithDrop +// lldbg-check:[...] { a = 98 b = { x = 87 y = 76 z = 65 } c = { x = 54 y = 43 z = 32 } d = 21 } // lldbr-check:(packed_struct_with_destructor::UnpackedInPackedWithDrop) unpackedInPackedWithDrop = { a = 98 b = { x = 87 y = 76 z = 65 } c = { x = 54 y = 43 z = 32 } d = 21 } -// lldb-command:print deeplyNested -// lldbg-check:[...]$7 = { a = { a = 1 b = { x = 2 y = 3 z = 4 } c = 5 d = { x = 6 y = 7 z = 8 } } b = { a = 9 b = { x = 10 y = 11 z = 12 } c = { x = 13 y = 14 z = 15 } d = 16 } c = { a = 17 b = { x = 18 y = 19 z = 20 } c = 21 d = { x = 22 y = 23 z = 24 } } d = { a = 25 b = { x = 26 y = 27 z = 28 } c = 29 d = { x = 30 y = 31 z = 32 } } e = { a = 33 b = { x = 34 y = 35 z = 36 } c = { x = 37 y = 38 z = 39 } d = 40 } f = { a = 41 b = { x = 42 y = 43 z = 44 } c = 45 d = { x = 46 y = 47 z = 48 } } } +// lldb-command:v deeplyNested +// lldbg-check:[...] { a = { a = 1 b = { x = 2 y = 3 z = 4 } c = 5 d = { x = 6 y = 7 z = 8 } } b = { a = 9 b = { x = 10 y = 11 z = 12 } c = { x = 13 y = 14 z = 15 } d = 16 } c = { a = 17 b = { x = 18 y = 19 z = 20 } c = 21 d = { x = 22 y = 23 z = 24 } } d = { a = 25 b = { x = 26 y = 27 z = 28 } c = 29 d = { x = 30 y = 31 z = 32 } } e = { a = 33 b = { x = 34 y = 35 z = 36 } c = { x = 37 y = 38 z = 39 } d = 40 } f = { a = 41 b = { x = 42 y = 43 z = 44 } c = 45 d = { x = 46 y = 47 z = 48 } } } // lldbr-check:(packed_struct_with_destructor::DeeplyNested) deeplyNested = { a = { a = 1 b = { x = 2 y = 3 z = 4 } c = 5 d = { x = 6 y = 7 z = 8 } } b = { a = 9 b = { x = 10 y = 11 z = 12 } c = { x = 13 y = 14 z = 15 } d = 16 } c = { a = 17 b = { x = 18 y = 19 z = 20 } c = 21 d = { x = 22 y = 23 z = 24 } } d = { a = 25 b = { x = 26 y = 27 z = 28 } c = 29 d = { x = 30 y = 31 z = 32 } } e = { a = 33 b = { x = 34 y = 35 z = 36 } c = { x = 37 y = 38 z = 39 } d = 40 } f = { a = 41 b = { x = 42 y = 43 z = 44 } c = 45 d = { x = 46 y = 47 z = 48 } } } diff --git a/tests/debuginfo/packed-struct.rs b/tests/debuginfo/packed-struct.rs index 0276a0ffb08..ea9aa22ba55 100644 --- a/tests/debuginfo/packed-struct.rs +++ b/tests/debuginfo/packed-struct.rs @@ -34,29 +34,29 @@ // lldb-command:run -// lldb-command:print packed -// lldbg-check:[...]$0 = { x = 123 y = 234 z = 345 } +// lldb-command:v packed +// lldbg-check:[...] { x = 123 y = 234 z = 345 } // lldbr-check:(packed_struct::Packed) packed = { x = 123 y = 234 z = 345 } -// lldb-command:print packedInPacked -// lldbg-check:[...]$1 = { a = 1111 b = { x = 2222 y = 3333 z = 4444 } c = 5555 d = { x = 6666 y = 7777 z = 8888 } } +// lldb-command:v packedInPacked +// lldbg-check:[...] { a = 1111 b = { x = 2222 y = 3333 z = 4444 } c = 5555 d = { x = 6666 y = 7777 z = 8888 } } // lldbr-check:(packed_struct::PackedInPacked) packedInPacked = { a = 1111 b = { x = 2222 y = 3333 z = 4444 } c = 5555 d = { x = 6666 y = 7777 z = 8888 } } -// lldb-command:print packedInUnpacked -// lldbg-check:[...]$2 = { a = -1111 b = { x = -2222 y = -3333 z = -4444 } c = -5555 d = { x = -6666 y = -7777 z = -8888 } } +// lldb-command:v packedInUnpacked +// lldbg-check:[...] { a = -1111 b = { x = -2222 y = -3333 z = -4444 } c = -5555 d = { x = -6666 y = -7777 z = -8888 } } // lldbr-check:(packed_struct::PackedInUnpacked) packedInUnpacked = { a = -1111 b = { x = -2222 y = -3333 z = -4444 } c = -5555 d = { x = -6666 y = -7777 z = -8888 } } -// lldb-command:print unpackedInPacked -// lldbg-check:[...]$3 = { a = 987 b = { x = 876 y = 765 z = 654 w = 543 } c = { x = 432 y = 321 z = 210 w = 109 } d = -98 } +// lldb-command:v unpackedInPacked +// lldbg-check:[...] { a = 987 b = { x = 876 y = 765 z = 654 w = 543 } c = { x = 432 y = 321 z = 210 w = 109 } d = -98 } // lldbr-check:(packed_struct::UnpackedInPacked) unpackedInPacked = { a = 987 b = { x = 876 y = 765 z = 654 w = 543 } c = { x = 432 y = 321 z = 210 w = 109 } d = -98 } -// lldb-command:print sizeof(packed) -// lldbg-check:[...]$4 = 14 -// lldbr-check:(usize) = 14 +// lldb-command:expr sizeof(packed) +// lldbg-check:[...] 14 +// lldbr-check:(usize) [...] 14 -// lldb-command:print sizeof(packedInPacked) -// lldbg-check:[...]$5 = 40 -// lldbr-check:(usize) = 40 +// lldb-command:expr sizeof(packedInPacked) +// lldbg-check:[...] 40 +// lldbr-check:(usize) [...] 40 #![allow(unused_variables)] #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/pretty-slices.rs b/tests/debuginfo/pretty-slices.rs index 4faa317d6a1..5d2086fa478 100644 --- a/tests/debuginfo/pretty-slices.rs +++ b/tests/debuginfo/pretty-slices.rs @@ -18,19 +18,19 @@ // gdb-command: print mut_str_slice // gdb-check: $4 = "mutable string slice" -// lldb-command: run +// lldb-command:run -// lldb-command: print slice -// lldb-check: (&[i32]) $0 = size=3 { [0] = 0 [1] = 1 [2] = 2 } +// lldb-command:v slice +// lldb-check:(&[i32]) slice = size=3 { [0] = 0 [1] = 1 [2] = 2 } -// lldb-command: print mut_slice -// lldb-check: (&mut [i32]) $1 = size=4 { [0] = 2 [1] = 3 [2] = 5 [3] = 7 } +// lldb-command:v mut_slice +// lldb-check:(&mut [i32]) mut_slice = size=4 { [0] = 2 [1] = 3 [2] = 5 [3] = 7 } -// lldb-command: print str_slice -// lldb-check: (&str) $2 = "string slice" { data_ptr = [...] length = 12 } +// lldb-command:v str_slice +// lldb-check:(&str) str_slice = "string slice" { data_ptr = [...] length = 12 } -// lldb-command: print mut_str_slice -// lldb-check: (&mut str) $3 = "mutable string slice" { data_ptr = [...] length = 20 } +// lldb-command:v mut_str_slice +// lldb-check:(&mut str) mut_str_slice = "mutable string slice" { data_ptr = [...] length = 20 } fn b() {} diff --git a/tests/debuginfo/pretty-std-collections.rs b/tests/debuginfo/pretty-std-collections.rs index 6e7c8dfbbe8..e9c2c4f2a1d 100644 --- a/tests/debuginfo/pretty-std-collections.rs +++ b/tests/debuginfo/pretty-std-collections.rs @@ -58,20 +58,20 @@ // lldb-command:run -// lldb-command:print vec_deque -// lldbg-check:[...]$0 = size=3 { [0] = 5 [1] = 3 [2] = 7 } +// lldb-command:v vec_deque +// lldbg-check:[...] size=3 { [0] = 5 [1] = 3 [2] = 7 } // lldbr-check:(alloc::collections::vec_deque::VecDeque<i32>) vec_deque = size=3 = { [0] = 5 [1] = 3 [2] = 7 } -// lldb-command:print vec_deque2 -// lldbg-check:[...]$1 = size=7 { [0] = 2 [1] = 3 [2] = 4 [3] = 5 [4] = 6 [5] = 7 [6] = 8 } +// lldb-command:v vec_deque2 +// lldbg-check:[...] size=7 { [0] = 2 [1] = 3 [2] = 4 [3] = 5 [4] = 6 [5] = 7 [6] = 8 } // lldbr-check:(alloc::collections::vec_deque::VecDeque<i32>) vec_deque2 = size=7 = { [0] = 2 [1] = 3 [2] = 4 [3] = 5 [4] = 6 [5] = 7 [6] = 8 } -// lldb-command:print hash_map -// lldbg-check:[...]$2 = size=4 { [0] = { 0 = 1 1 = 10 } [1] = { 0 = 2 1 = 20 } [2] = { 0 = 3 1 = 30 } [3] = { 0 = 4 1 = 40 } } +// lldb-command:v hash_map +// lldbg-check:[...] size=4 { [0] = { 0 = 1 1 = 10 } [1] = { 0 = 2 1 = 20 } [2] = { 0 = 3 1 = 30 } [3] = { 0 = 4 1 = 40 } } // lldbr-check:(std::collections::hash::map::HashMap<u64, u64, [...]>) hash_map = size=4 size=4 { [0] = { 0 = 1 1 = 10 } [1] = { 0 = 2 1 = 20 } [2] = { 0 = 3 1 = 30 } [3] = { 0 = 4 1 = 40 } } -// lldb-command:print hash_set -// lldbg-check:[...]$3 = size=4 { [0] = 1 [1] = 2 [2] = 3 [3] = 4 } +// lldb-command:v hash_set +// lldbg-check:[...] size=4 { [0] = 1 [1] = 2 [2] = 3 [3] = 4 } // lldbr-check:(std::collections::hash::set::HashSet<u64, [...]>) hash_set = size=4 { [0] = 1 [1] = 2 [2] = 3 [3] = 4 } #![allow(unused_variables)] diff --git a/tests/debuginfo/pretty-std.rs b/tests/debuginfo/pretty-std.rs index 2c2795379c9..70827d551ca 100644 --- a/tests/debuginfo/pretty-std.rs +++ b/tests/debuginfo/pretty-std.rs @@ -42,28 +42,28 @@ // === LLDB TESTS ================================================================================== -// lldb-command: run +// lldb-command:run -// lldb-command: print slice -// lldb-check:[...]$0 = &[0, 1, 2, 3] +// lldb-command:v slice +// lldb-check:[...] slice = &[0, 1, 2, 3] -// lldb-command: print vec -// lldb-check:[...]$1 = vec![4, 5, 6, 7] +// lldb-command:v vec +// lldb-check:[...] vec = vec![4, 5, 6, 7] -// lldb-command: print str_slice -// lldb-check:[...]$2 = "IAMA string slice!" +// lldb-command:v str_slice +// lldb-check:[...] str_slice = "IAMA string slice!" -// lldb-command: print string -// lldb-check:[...]$3 = "IAMA string!" +// lldb-command:v string +// lldb-check:[...] string = "IAMA string!" -// lldb-command: print some -// lldb-check:[...]$4 = Some(8) +// lldb-command:v some +// lldb-check:[...] some = Some(8) -// lldb-command: print none -// lldb-check:[...]$5 = None +// lldb-command:v none +// lldb-check:[...] none = None -// lldb-command: print os_string -// lldb-check:[...]$6 = "IAMA OS string 😃"[...] +// lldb-command:v os_string +// lldb-check:[...] os_string = "IAMA OS string 😃"[...] // === CDB TESTS ================================================================================== diff --git a/tests/debuginfo/rc_arc.rs b/tests/debuginfo/rc_arc.rs index 3cf6635a173..ca0feb1f465 100644 --- a/tests/debuginfo/rc_arc.rs +++ b/tests/debuginfo/rc_arc.rs @@ -17,10 +17,10 @@ // lldb-command:run -// lldb-command:print rc -// lldb-check:[...]$0 = strong=11, weak=1 { value = 111 } -// lldb-command:print arc -// lldb-check:[...]$1 = strong=21, weak=1 { data = 222 } +// lldb-command:v rc +// lldb-check:[...] strong=11, weak=1 { value = 111 } +// lldb-command:v arc +// lldb-check:[...] strong=21, weak=1 { data = 222 } // === CDB TESTS ================================================================================== diff --git a/tests/debuginfo/reference-debuginfo.rs b/tests/debuginfo/reference-debuginfo.rs index 1051cc7113c..339839f07cc 100644 --- a/tests/debuginfo/reference-debuginfo.rs +++ b/tests/debuginfo/reference-debuginfo.rs @@ -59,64 +59,64 @@ // === LLDB TESTS ================================================================================== // lldb-command:run -// lldb-command:print *bool_ref -// lldbg-check:[...]$0 = true +// lldb-command:v *bool_ref +// lldbg-check:[...] true // lldbr-check:(bool) *bool_ref = true -// lldb-command:print *int_ref -// lldbg-check:[...]$1 = -1 +// lldb-command:v *int_ref +// lldbg-check:[...] -1 // lldbr-check:(isize) *int_ref = -1 // NOTE: only rust-enabled lldb supports 32bit chars // lldbr-command:print *char_ref // lldbr-check:(char) *char_ref = 'a' -// lldb-command:print *i8_ref -// lldbg-check:[...]$2 = 'D' +// lldb-command:v *i8_ref +// lldbg-check:[...] 'D' // lldbr-check:(i8) *i8_ref = 68 -// lldb-command:print *i16_ref -// lldbg-check:[...]$3 = -16 +// lldb-command:v *i16_ref +// lldbg-check:[...] -16 // lldbr-check:(i16) *i16_ref = -16 -// lldb-command:print *i32_ref -// lldbg-check:[...]$4 = -32 +// lldb-command:v *i32_ref +// lldbg-check:[...] -32 // lldbr-check:(i32) *i32_ref = -32 -// lldb-command:print *i64_ref -// lldbg-check:[...]$5 = -64 +// lldb-command:v *i64_ref +// lldbg-check:[...] -64 // lldbr-check:(i64) *i64_ref = -64 -// lldb-command:print *uint_ref -// lldbg-check:[...]$6 = 1 +// lldb-command:v *uint_ref +// lldbg-check:[...] 1 // lldbr-check:(usize) *uint_ref = 1 -// lldb-command:print *u8_ref -// lldbg-check:[...]$7 = 'd' +// lldb-command:v *u8_ref +// lldbg-check:[...] 'd' // lldbr-check:(u8) *u8_ref = 100 -// lldb-command:print *u16_ref -// lldbg-check:[...]$8 = 16 +// lldb-command:v *u16_ref +// lldbg-check:[...] 16 // lldbr-check:(u16) *u16_ref = 16 -// lldb-command:print *u32_ref -// lldbg-check:[...]$9 = 32 +// lldb-command:v *u32_ref +// lldbg-check:[...] 32 // lldbr-check:(u32) *u32_ref = 32 -// lldb-command:print *u64_ref -// lldbg-check:[...]$10 = 64 +// lldb-command:v *u64_ref +// lldbg-check:[...] 64 // lldbr-check:(u64) *u64_ref = 64 -// lldb-command:print *f32_ref -// lldbg-check:[...]$11 = 2.5 +// lldb-command:v *f32_ref +// lldbg-check:[...] 2.5 // lldbr-check:(f32) *f32_ref = 2.5 -// lldb-command:print *f64_ref -// lldbg-check:[...]$12 = 3.5 +// lldb-command:v *f64_ref +// lldbg-check:[...] 3.5 // lldbr-check:(f64) *f64_ref = 3.5 -// lldb-command:print *f64_double_ref -// lldbg-check:[...]$13 = 3.5 +// lldb-command:v *f64_double_ref +// lldbg-check:[...] 3.5 // lldbr-check:(f64) **f64_double_ref = 3.5 #![allow(unused_variables)] diff --git a/tests/debuginfo/regression-bad-location-list-67992.rs b/tests/debuginfo/regression-bad-location-list-67992.rs index c397b403026..fe410942d51 100644 --- a/tests/debuginfo/regression-bad-location-list-67992.rs +++ b/tests/debuginfo/regression-bad-location-list-67992.rs @@ -10,8 +10,8 @@ // === LLDB TESTS ================================================================================== // lldb-command:run -// lldb-command:print a -// lldbg-check:(regression_bad_location_list_67992::Foo) $0 = [...] +// lldb-command:v a +// lldbg-check:(regression_bad_location_list_67992::Foo) [...] // lldbr-check:(regression_bad_location_list_67992::Foo) a = [...] const ARRAY_SIZE: usize = 1024; diff --git a/tests/debuginfo/self-in-default-method.rs b/tests/debuginfo/self-in-default-method.rs index eae1d58c124..374951475fc 100644 --- a/tests/debuginfo/self-in-default-method.rs +++ b/tests/debuginfo/self-in-default-method.rs @@ -62,62 +62,62 @@ // lldb-command:run // STACK BY REF -// lldb-command:print *self -// lldbg-check:[...]$0 = { x = 100 } +// lldb-command:v *self +// lldbg-check:[...] { x = 100 } // lldbr-check:(self_in_default_method::Struct) *self = Struct { x: 100 } -// lldb-command:print arg1 -// lldbg-check:[...]$1 = -1 +// lldb-command:v arg1 +// lldbg-check:[...] -1 // lldbr-check:(isize) arg1 = -1 -// lldb-command:print arg2 -// lldbg-check:[...]$2 = -2 +// lldb-command:v arg2 +// lldbg-check:[...] -2 // lldbr-check:(isize) arg2 = -2 // lldb-command:continue // STACK BY VAL -// lldb-command:print self -// lldbg-check:[...]$3 = { x = 100 } +// lldb-command:v self +// lldbg-check:[...] { x = 100 } // lldbr-check:(self_in_default_method::Struct) self = Struct { x: 100 } -// lldb-command:print arg1 -// lldbg-check:[...]$4 = -3 +// lldb-command:v arg1 +// lldbg-check:[...] -3 // lldbr-check:(isize) arg1 = -3 -// lldb-command:print arg2 -// lldbg-check:[...]$5 = -4 +// lldb-command:v arg2 +// lldbg-check:[...] -4 // lldbr-check:(isize) arg2 = -4 // lldb-command:continue // OWNED BY REF -// lldb-command:print *self -// lldbg-check:[...]$6 = { x = 200 } +// lldb-command:v *self +// lldbg-check:[...] { x = 200 } // lldbr-check:(self_in_default_method::Struct) *self = Struct { x: 200 } -// lldb-command:print arg1 -// lldbg-check:[...]$7 = -5 +// lldb-command:v arg1 +// lldbg-check:[...] -5 // lldbr-check:(isize) arg1 = -5 -// lldb-command:print arg2 -// lldbg-check:[...]$8 = -6 +// lldb-command:v arg2 +// lldbg-check:[...] -6 // lldbr-check:(isize) arg2 = -6 // lldb-command:continue // OWNED BY VAL -// lldb-command:print self -// lldbg-check:[...]$9 = { x = 200 } +// lldb-command:v self +// lldbg-check:[...] { x = 200 } // lldbr-check:(self_in_default_method::Struct) self = Struct { x: 200 } -// lldb-command:print arg1 -// lldbg-check:[...]$10 = -7 +// lldb-command:v arg1 +// lldbg-check:[...] -7 // lldbr-check:(isize) arg1 = -7 -// lldb-command:print arg2 -// lldbg-check:[...]$11 = -8 +// lldb-command:v arg2 +// lldbg-check:[...] -8 // lldbr-check:(isize) arg2 = -8 // lldb-command:continue // OWNED MOVED -// lldb-command:print *self -// lldbg-check:[...]$12 = { x = 200 } +// lldb-command:v *self +// lldbg-check:[...] { x = 200 } // lldbr-check:(self_in_default_method::Struct) *self = Struct { x: 200 } -// lldb-command:print arg1 -// lldbg-check:[...]$13 = -9 +// lldb-command:v arg1 +// lldbg-check:[...] -9 // lldbr-check:(isize) arg1 = -9 -// lldb-command:print arg2 -// lldbg-check:[...]$14 = -10 +// lldb-command:v arg2 +// lldbg-check:[...] -10 // lldbr-check:(isize) arg2 = -10 // lldb-command:continue diff --git a/tests/debuginfo/self-in-generic-default-method.rs b/tests/debuginfo/self-in-generic-default-method.rs index 92be253e18a..4759ca3ecdc 100644 --- a/tests/debuginfo/self-in-generic-default-method.rs +++ b/tests/debuginfo/self-in-generic-default-method.rs @@ -62,62 +62,62 @@ // lldb-command:run // STACK BY REF -// lldb-command:print *self -// lldbg-check:[...]$0 = { x = 987 } +// lldb-command:v *self +// lldbg-check:[...] { x = 987 } // lldbr-check:(self_in_generic_default_method::Struct) *self = Struct { x: 987 } -// lldb-command:print arg1 -// lldbg-check:[...]$1 = -1 +// lldb-command:v arg1 +// lldbg-check:[...] -1 // lldbr-check:(isize) arg1 = -1 -// lldb-command:print arg2 -// lldbg-check:[...]$2 = 2 +// lldb-command:v arg2 +// lldbg-check:[...] 2 // lldbr-check:(u16) arg2 = 2 // lldb-command:continue // STACK BY VAL -// lldb-command:print self -// lldbg-check:[...]$3 = { x = 987 } +// lldb-command:v self +// lldbg-check:[...] { x = 987 } // lldbr-check:(self_in_generic_default_method::Struct) self = Struct { x: 987 } -// lldb-command:print arg1 -// lldbg-check:[...]$4 = -3 +// lldb-command:v arg1 +// lldbg-check:[...] -3 // lldbr-check:(isize) arg1 = -3 -// lldb-command:print arg2 -// lldbg-check:[...]$5 = -4 +// lldb-command:v arg2 +// lldbg-check:[...] -4 // lldbr-check:(i16) arg2 = -4 // lldb-command:continue // OWNED BY REF -// lldb-command:print *self -// lldbg-check:[...]$6 = { x = 879 } +// lldb-command:v *self +// lldbg-check:[...] { x = 879 } // lldbr-check:(self_in_generic_default_method::Struct) *self = Struct { x: 879 } -// lldb-command:print arg1 -// lldbg-check:[...]$7 = -5 +// lldb-command:v arg1 +// lldbg-check:[...] -5 // lldbr-check:(isize) arg1 = -5 -// lldb-command:print arg2 -// lldbg-check:[...]$8 = -6 +// lldb-command:v arg2 +// lldbg-check:[...] -6 // lldbr-check:(i32) arg2 = -6 // lldb-command:continue // OWNED BY VAL -// lldb-command:print self -// lldbg-check:[...]$9 = { x = 879 } +// lldb-command:v self +// lldbg-check:[...] { x = 879 } // lldbr-check:(self_in_generic_default_method::Struct) self = Struct { x: 879 } -// lldb-command:print arg1 -// lldbg-check:[...]$10 = -7 +// lldb-command:v arg1 +// lldbg-check:[...] -7 // lldbr-check:(isize) arg1 = -7 -// lldb-command:print arg2 -// lldbg-check:[...]$11 = -8 +// lldb-command:v arg2 +// lldbg-check:[...] -8 // lldbr-check:(i64) arg2 = -8 // lldb-command:continue // OWNED MOVED -// lldb-command:print *self -// lldbg-check:[...]$12 = { x = 879 } +// lldb-command:v *self +// lldbg-check:[...] { x = 879 } // lldbr-check:(self_in_generic_default_method::Struct) *self = Struct { x: 879 } -// lldb-command:print arg1 -// lldbg-check:[...]$13 = -9 +// lldb-command:v arg1 +// lldbg-check:[...] -9 // lldbr-check:(isize) arg1 = -9 -// lldb-command:print arg2 -// lldbg-check:[...]$14 = -10.5 +// lldb-command:v arg2 +// lldbg-check:[...] -10.5 // lldbr-check:(f32) arg2 = -10.5 // lldb-command:continue diff --git a/tests/debuginfo/shadowed-argument.rs b/tests/debuginfo/shadowed-argument.rs index 33f73340a83..e7bc731336e 100644 --- a/tests/debuginfo/shadowed-argument.rs +++ b/tests/debuginfo/shadowed-argument.rs @@ -29,27 +29,27 @@ // lldb-command:run -// lldb-command:print x -// lldbg-check:[...]$0 = false +// lldb-command:v x +// lldbg-check:[...] false // lldbr-check:(bool) x = false -// lldb-command:print y -// lldbg-check:[...]$1 = true +// lldb-command:v y +// lldbg-check:[...] true // lldbr-check:(bool) y = true // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$2 = 10 +// lldb-command:v x +// lldbg-check:[...] 10 // lldbr-check:(i32) x = 10 -// lldb-command:print y -// lldbg-check:[...]$3 = true +// lldb-command:v y +// lldbg-check:[...] true // lldbr-check:(bool) y = true // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$4 = 10.5 +// lldb-command:v x +// lldbg-check:[...] 10.5 // lldbr-check:(f64) x = 10.5 -// lldb-command:print y -// lldbg-check:[...]$5 = 20 +// lldb-command:v y +// lldbg-check:[...] 20 // lldbr-check:(i32) y = 20 // lldb-command:continue diff --git a/tests/debuginfo/shadowed-variable.rs b/tests/debuginfo/shadowed-variable.rs index 60c392b15cb..3cc5fe14cb2 100644 --- a/tests/debuginfo/shadowed-variable.rs +++ b/tests/debuginfo/shadowed-variable.rs @@ -39,43 +39,43 @@ // lldb-command:run -// lldb-command:print x -// lldbg-check:[...]$0 = false +// lldb-command:v x +// lldbg-check:[...] false // lldbr-check:(bool) x = false -// lldb-command:print y -// lldbg-check:[...]$1 = true +// lldb-command:v y +// lldbg-check:[...] true // lldbr-check:(bool) y = true // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$2 = 10 +// lldb-command:v x +// lldbg-check:[...] 10 // lldbr-check:(i32) x = 10 -// lldb-command:print y -// lldbg-check:[...]$3 = true +// lldb-command:v y +// lldbg-check:[...] true // lldbr-check:(bool) y = true // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$4 = 10.5 +// lldb-command:v x +// lldbg-check:[...] 10.5 // lldbr-check:(f64) x = 10.5 -// lldb-command:print y -// lldbg-check:[...]$5 = 20 +// lldb-command:v y +// lldbg-check:[...] 20 // lldbr-check:(i32) y = 20 // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$6 = 10.5 +// lldb-command:v x +// lldbg-check:[...] 10.5 // lldbr-check:(f64) x = 10.5 -// lldb-command:print y -// lldbg-check:[...]$7 = 20 +// lldb-command:v y +// lldbg-check:[...] 20 // lldbr-check:(i32) y = 20 // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$8 = 11.5 +// lldb-command:v x +// lldbg-check:[...] 11.5 // lldbr-check:(f64) x = 11.5 -// lldb-command:print y -// lldbg-check:[...]$9 = 20 +// lldb-command:v y +// lldbg-check:[...] 20 // lldbr-check:(i32) y = 20 // lldb-command:continue diff --git a/tests/debuginfo/should-fail.rs b/tests/debuginfo/should-fail.rs index f3a8f52e0fa..0f153394a44 100644 --- a/tests/debuginfo/should-fail.rs +++ b/tests/debuginfo/should-fail.rs @@ -16,8 +16,8 @@ // lldb-command:run -// lldb-command:print x -// lldb-check:[...]$0 = 5 +// lldb-command:v x +// lldb-check:[...] 5 // === CDB TESTS ================================================================================== diff --git a/tests/debuginfo/simple-lexical-scope.rs b/tests/debuginfo/simple-lexical-scope.rs index f4be2035d3c..4156e68f8b1 100644 --- a/tests/debuginfo/simple-lexical-scope.rs +++ b/tests/debuginfo/simple-lexical-scope.rs @@ -39,38 +39,38 @@ // lldb-command:run -// lldb-command:print x -// lldbg-check:[...]$0 = false +// lldb-command:v x +// lldbg-check:[...] false // lldbr-check:(bool) x = false // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$1 = false +// lldb-command:v x +// lldbg-check:[...] false // lldbr-check:(bool) x = false // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$2 = 10 +// lldb-command:v x +// lldbg-check:[...] 10 // lldbr-check:(i32) x = 10 // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$3 = 10 +// lldb-command:v x +// lldbg-check:[...] 10 // lldbr-check:(i32) x = 10 // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$4 = 10.5 +// lldb-command:v x +// lldbg-check:[...] 10.5 // lldbr-check:(f64) x = 10.5 // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$5 = 10 +// lldb-command:v x +// lldbg-check:[...] 10 // lldbr-check:(i32) x = 10 // lldb-command:continue -// lldb-command:print x -// lldbg-check:[...]$6 = false +// lldb-command:v x +// lldbg-check:[...] false // lldbr-check:(bool) x = false // lldb-command:continue diff --git a/tests/debuginfo/simple-struct.rs b/tests/debuginfo/simple-struct.rs index 100763f60b6..968a5c63e89 100644 --- a/tests/debuginfo/simple-struct.rs +++ b/tests/debuginfo/simple-struct.rs @@ -97,28 +97,28 @@ // lldb-command:run -// lldb-command:print no_padding16 -// lldbg-check:[...]$0 = { x = 10000 y = -10001 } +// lldb-command:v no_padding16 +// lldbg-check:[...] { x = 10000 y = -10001 } // lldbr-check:(simple_struct::NoPadding16) no_padding16 = { x = 10000 y = -10001 } -// lldb-command:print no_padding32 -// lldbg-check:[...]$1 = { x = -10002 y = -10003.5 z = 10004 } +// lldb-command:v no_padding32 +// lldbg-check:[...] { x = -10002 y = -10003.5 z = 10004 } // lldbr-check:(simple_struct::NoPadding32) no_padding32 = { x = -10002 y = -10003.5 z = 10004 } -// lldb-command:print no_padding64 -// lldbg-check:[...]$2 = { x = -10005.5 y = 10006 z = 10007 } +// lldb-command:v no_padding64 +// lldbg-check:[...] { x = -10005.5 y = 10006 z = 10007 } // lldbr-check:(simple_struct::NoPadding64) no_padding64 = { x = -10005.5 y = 10006 z = 10007 } -// lldb-command:print no_padding163264 -// lldbg-check:[...]$3 = { a = -10008 b = 10009 c = 10010 d = 10011 } +// lldb-command:v no_padding163264 +// lldbg-check:[...] { a = -10008 b = 10009 c = 10010 d = 10011 } // lldbr-check:(simple_struct::NoPadding163264) no_padding163264 = { a = -10008 b = 10009 c = 10010 d = 10011 } -// lldb-command:print internal_padding -// lldbg-check:[...]$4 = { x = 10012 y = -10013 } +// lldb-command:v internal_padding +// lldbg-check:[...] { x = 10012 y = -10013 } // lldbr-check:(simple_struct::InternalPadding) internal_padding = { x = 10012 y = -10013 } -// lldb-command:print padding_at_end -// lldbg-check:[...]$5 = { x = -10014 y = 10015 } +// lldb-command:v padding_at_end +// lldbg-check:[...] { x = -10014 y = 10015 } // lldbr-check:(simple_struct::PaddingAtEnd) padding_at_end = { x = -10014 y = 10015 } #![allow(unused_variables)] diff --git a/tests/debuginfo/simple-tuple.rs b/tests/debuginfo/simple-tuple.rs index 2d8905a77bf..86003105f36 100644 --- a/tests/debuginfo/simple-tuple.rs +++ b/tests/debuginfo/simple-tuple.rs @@ -99,28 +99,28 @@ // lldb-command:run -// lldb-command:print/d noPadding8 -// lldbg-check:[...]$0 = { 0 = -100 1 = 100 } +// lldb-command:v/d noPadding8 +// lldbg-check:[...] { 0 = -100 1 = 100 } // lldbr-check:((i8, u8)) noPadding8 = { 0 = -100 1 = 100 } -// lldb-command:print noPadding16 -// lldbg-check:[...]$1 = { 0 = 0 1 = 1 2 = 2 } +// lldb-command:v noPadding16 +// lldbg-check:[...] { 0 = 0 1 = 1 2 = 2 } // lldbr-check:((i16, i16, u16)) noPadding16 = { 0 = 0 1 = 1 2 = 2 } -// lldb-command:print noPadding32 -// lldbg-check:[...]$2 = { 0 = 3 1 = 4.5 2 = 5 } +// lldb-command:v noPadding32 +// lldbg-check:[...] { 0 = 3 1 = 4.5 2 = 5 } // lldbr-check:((i32, f32, u32)) noPadding32 = { 0 = 3 1 = 4.5 2 = 5 } -// lldb-command:print noPadding64 -// lldbg-check:[...]$3 = { 0 = 6 1 = 7.5 2 = 8 } +// lldb-command:v noPadding64 +// lldbg-check:[...] { 0 = 6 1 = 7.5 2 = 8 } // lldbr-check:((i64, f64, u64)) noPadding64 = { 0 = 6 1 = 7.5 2 = 8 } -// lldb-command:print internalPadding1 -// lldbg-check:[...]$4 = { 0 = 9 1 = 10 } +// lldb-command:v internalPadding1 +// lldbg-check:[...] { 0 = 9 1 = 10 } // lldbr-check:((i16, i32)) internalPadding1 = { 0 = 9 1 = 10 } -// lldb-command:print internalPadding2 -// lldbg-check:[...]$5 = { 0 = 11 1 = 12 2 = 13 3 = 14 } +// lldb-command:v internalPadding2 +// lldbg-check:[...] { 0 = 11 1 = 12 2 = 13 3 = 14 } // lldbr-check:((i16, i32, u32, u64)) internalPadding2 = { 0 = 11 1 = 12 2 = 13 3 = 14 } -// lldb-command:print paddingAtEnd -// lldbg-check:[...]$6 = { 0 = 15 1 = 16 } +// lldb-command:v paddingAtEnd +// lldbg-check:[...] { 0 = 15 1 = 16 } // lldbr-check:((i32, i16)) paddingAtEnd = { 0 = 15 1 = 16 } diff --git a/tests/debuginfo/static-method-on-struct-and-enum.rs b/tests/debuginfo/static-method-on-struct-and-enum.rs index ad078122dde..b4ec4543572 100644 --- a/tests/debuginfo/static-method-on-struct-and-enum.rs +++ b/tests/debuginfo/static-method-on-struct-and-enum.rs @@ -28,23 +28,23 @@ // lldb-command:run // STRUCT -// lldb-command:print arg1 -// lldbg-check:[...]$0 = 1 +// lldb-command:v arg1 +// lldbg-check:[...] 1 // lldbr-check:(isize) arg1 = 1 -// lldb-command:print arg2 -// lldbg-check:[...]$1 = 2 +// lldb-command:v arg2 +// lldbg-check:[...] 2 // lldbr-check:(isize) arg2 = 2 // lldb-command:continue // ENUM -// lldb-command:print arg1 -// lldbg-check:[...]$2 = -3 +// lldb-command:v arg1 +// lldbg-check:[...] -3 // lldbr-check:(isize) arg1 = -3 -// lldb-command:print arg2 -// lldbg-check:[...]$3 = 4.5 +// lldb-command:v arg2 +// lldbg-check:[...] 4.5 // lldbr-check:(f64) arg2 = 4.5 -// lldb-command:print arg3 -// lldbg-check:[...]$4 = 5 +// lldb-command:v arg3 +// lldbg-check:[...] 5 // lldbr-check:(usize) arg3 = 5 // lldb-command:continue diff --git a/tests/debuginfo/struct-in-enum.rs b/tests/debuginfo/struct-in-enum.rs index c340f71a6cc..52e419e6b47 100644 --- a/tests/debuginfo/struct-in-enum.rs +++ b/tests/debuginfo/struct-in-enum.rs @@ -26,13 +26,13 @@ // lldb-command:run -// lldb-command:print case1 -// lldb-check:[...]$0 = Case1(0, Struct { x: 2088533116, y: 2088533116, z: 31868 }) -// lldb-command:print case2 -// lldb-check:[...]$1 = Case2(0, 1229782938247303441, 4369) +// lldb-command:v case1 +// lldb-check:[...] Case1(0, Struct { x: 2088533116, y: 2088533116, z: 31868 }) +// lldb-command:v case2 +// lldb-check:[...] Case2(0, 1229782938247303441, 4369) -// lldb-command:print univariant -// lldb-check:[...]$2 = TheOnlyCase(Struct { x: 123, y: 456, z: 789 }) +// lldb-command:v univariant +// lldb-check:[...] TheOnlyCase(Struct { x: 123, y: 456, z: 789 }) #![allow(unused_variables)] #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/struct-in-struct.rs b/tests/debuginfo/struct-in-struct.rs index 287564a36cd..7ca0e3a5ef6 100644 --- a/tests/debuginfo/struct-in-struct.rs +++ b/tests/debuginfo/struct-in-struct.rs @@ -23,36 +23,36 @@ // lldb-command:run -// lldb-command:print three_simple_structs -// lldbg-check:[...]$0 = { x = { x = 1 } y = { x = 2 } z = { x = 3 } } +// lldb-command:v three_simple_structs +// lldbg-check:[...] { x = { x = 1 } y = { x = 2 } z = { x = 3 } } // lldbr-check:(struct_in_struct::ThreeSimpleStructs) three_simple_structs = { x = { x = 1 } y = { x = 2 } z = { x = 3 } } -// lldb-command:print internal_padding_parent -// lldbg-check:[...]$1 = { x = { x = 4 y = 5 } y = { x = 6 y = 7 } z = { x = 8 y = 9 } } +// lldb-command:v internal_padding_parent +// lldbg-check:[...] { x = { x = 4 y = 5 } y = { x = 6 y = 7 } z = { x = 8 y = 9 } } // lldbr-check:(struct_in_struct::InternalPaddingParent) internal_padding_parent = { x = { x = 4 y = 5 } y = { x = 6 y = 7 } z = { x = 8 y = 9 } } -// lldb-command:print padding_at_end_parent -// lldbg-check:[...]$2 = { x = { x = 10 y = 11 } y = { x = 12 y = 13 } z = { x = 14 y = 15 } } +// lldb-command:v padding_at_end_parent +// lldbg-check:[...] { x = { x = 10 y = 11 } y = { x = 12 y = 13 } z = { x = 14 y = 15 } } // lldbr-check:(struct_in_struct::PaddingAtEndParent) padding_at_end_parent = { x = { x = 10 y = 11 } y = { x = 12 y = 13 } z = { x = 14 y = 15 } } -// lldb-command:print mixed -// lldbg-check:[...]$3 = { x = { x = 16 y = 17 } y = { x = 18 y = 19 } z = { x = 20 } w = 21 } +// lldb-command:v mixed +// lldbg-check:[...] { x = { x = 16 y = 17 } y = { x = 18 y = 19 } z = { x = 20 } w = 21 } // lldbr-check:(struct_in_struct::Mixed) mixed = { x = { x = 16 y = 17 } y = { x = 18 y = 19 } z = { x = 20 } w = 21 } -// lldb-command:print bag -// lldbg-check:[...]$4 = { x = { x = 22 } } +// lldb-command:v bag +// lldbg-check:[...] { x = { x = 22 } } // lldbr-check:(struct_in_struct::Bag) bag = { x = { x = 22 } } -// lldb-command:print bag_in_bag -// lldbg-check:[...]$5 = { x = { x = { x = 23 } } } +// lldb-command:v bag_in_bag +// lldbg-check:[...] { x = { x = { x = 23 } } } // lldbr-check:(struct_in_struct::BagInBag) bag_in_bag = { x = { x = { x = 23 } } } -// lldb-command:print tjo -// lldbg-check:[...]$6 = { x = { x = { x = { x = 24 } } } } +// lldb-command:v tjo +// lldbg-check:[...] { x = { x = { x = { x = 24 } } } } // lldbr-check:(struct_in_struct::ThatsJustOverkill) tjo = { x = { x = { x = { x = 24 } } } } -// lldb-command:print tree -// lldbg-check:[...]$7 = { x = { x = 25 } y = { x = { x = 26 y = 27 } y = { x = 28 y = 29 } z = { x = 30 y = 31 } } z = { x = { x = { x = 32 } } } } +// lldb-command:v tree +// lldbg-check:[...] { x = { x = 25 } y = { x = { x = 26 y = 27 } y = { x = 28 y = 29 } z = { x = 30 y = 31 } } z = { x = { x = { x = 32 } } } } // lldbr-check:(struct_in_struct::Tree) tree = { x = { x = 25 } y = { x = { x = 26 y = 27 } y = { x = 28 y = 29 } z = { x = 30 y = 31 } } z = { x = { x = { x = 32 } } } } #![allow(unused_variables)] diff --git a/tests/debuginfo/struct-namespace.rs b/tests/debuginfo/struct-namespace.rs index f9262a458d5..3cae51e83dd 100644 --- a/tests/debuginfo/struct-namespace.rs +++ b/tests/debuginfo/struct-namespace.rs @@ -5,18 +5,18 @@ // Check that structs get placed in the correct namespace // lldb-command:run -// lldb-command:p struct1 -// lldbg-check:(struct_namespace::Struct1) $0 = [...] +// lldb-command:v struct1 +// lldbg-check:(struct_namespace::Struct1)[...] // lldbr-check:(struct_namespace::Struct1) struct1 = Struct1 { a: 0, b: 1 } -// lldb-command:p struct2 -// lldbg-check:(struct_namespace::Struct2) $1 = [...] +// lldb-command:v struct2 +// lldbg-check:(struct_namespace::Struct2)[...] // lldbr-check:(struct_namespace::Struct2) struct2 = { = 2 } -// lldb-command:p mod1_struct1 -// lldbg-check:(struct_namespace::mod1::Struct1) $2 = [...] +// lldb-command:v mod1_struct1 +// lldbg-check:(struct_namespace::mod1::Struct1)[...] // lldbr-check:(struct_namespace::mod1::Struct1) mod1_struct1 = Struct1 { a: 3, b: 4 } -// lldb-command:p mod1_struct2 -// lldbg-check:(struct_namespace::mod1::Struct2) $3 = [...] +// lldb-command:v mod1_struct2 +// lldbg-check:(struct_namespace::mod1::Struct2)[...] // lldbr-check:(struct_namespace::mod1::Struct2) mod1_struct2 = { = 5 } #![allow(unused_variables)] diff --git a/tests/debuginfo/struct-style-enum.rs b/tests/debuginfo/struct-style-enum.rs index 2f155d2b83e..517b76c1412 100644 --- a/tests/debuginfo/struct-style-enum.rs +++ b/tests/debuginfo/struct-style-enum.rs @@ -26,16 +26,16 @@ // lldb-command:run -// lldb-command:print case1 +// lldb-command:v case1 // lldbr-check:(struct_style_enum::Regular::Case1) case1 = { a = 0 b = 31868 c = 31868 d = 31868 e = 31868 } -// lldb-command:print case2 +// lldb-command:v case2 // lldbr-check:(struct_style_enum::Regular::Case2) case2 = Case2 { Case1: 0, Case2: 286331153, Case3: 286331153 } -// lldb-command:print case3 +// lldb-command:v case3 // lldbr-check:(struct_style_enum::Regular::Case3) case3 = Case3 { Case1: 0, Case2: 6438275382588823897 } -// lldb-command:print univariant +// lldb-command:v univariant // lldbr-check:(struct_style_enum::Univariant) univariant = Univariant { TheOnlyCase: TheOnlyCase { a: -1 } } #![allow(unused_variables)] diff --git a/tests/debuginfo/struct-with-destructor.rs b/tests/debuginfo/struct-with-destructor.rs index 9b81136e7a8..12e2ac4225c 100644 --- a/tests/debuginfo/struct-with-destructor.rs +++ b/tests/debuginfo/struct-with-destructor.rs @@ -25,20 +25,20 @@ // === LLDB TESTS ================================================================================== // lldb-command:run -// lldb-command:print simple -// lldbg-check:[...]$0 = { x = 10 y = 20 } +// lldb-command:v simple +// lldbg-check:[...] { x = 10 y = 20 } // lldbr-check:(struct_with_destructor::WithDestructor) simple = { x = 10 y = 20 } -// lldb-command:print noDestructor -// lldbg-check:[...]$1 = { a = { x = 10 y = 20 } guard = -1 } +// lldb-command:v noDestructor +// lldbg-check:[...] { a = { x = 10 y = 20 } guard = -1 } // lldbr-check:(struct_with_destructor::NoDestructorGuarded) noDestructor = { a = { x = 10 y = 20 } guard = -1 } -// lldb-command:print withDestructor -// lldbg-check:[...]$2 = { a = { x = 10 y = 20 } guard = -1 } +// lldb-command:v withDestructor +// lldbg-check:[...] { a = { x = 10 y = 20 } guard = -1 } // lldbr-check:(struct_with_destructor::WithDestructorGuarded) withDestructor = { a = { x = 10 y = 20 } guard = -1 } -// lldb-command:print nested -// lldbg-check:[...]$3 = { a = { a = { x = 7890 y = 9870 } } } +// lldb-command:v nested +// lldbg-check:[...] { a = { a = { x = 7890 y = 9870 } } } // lldbr-check:(struct_with_destructor::NestedOuter) nested = { a = { a = { x = 7890 y = 9870 } } } #![allow(unused_variables)] diff --git a/tests/debuginfo/tuple-in-tuple.rs b/tests/debuginfo/tuple-in-tuple.rs index c1cfe64a52e..8ed0e1f9c13 100644 --- a/tests/debuginfo/tuple-in-tuple.rs +++ b/tests/debuginfo/tuple-in-tuple.rs @@ -35,28 +35,28 @@ // lldb-command:run -// lldb-command:print no_padding1 -// lldbg-check:[...]$0 = { 0 = { 0 = 0 1 = 1 } 1 = 2 2 = 3 } +// lldb-command:v no_padding1 +// lldbg-check:[...] { 0 = { 0 = 0 1 = 1 } 1 = 2 2 = 3 } // lldbr-check:(((u32, u32), u32, u32)) no_padding1 = { 0 = { 0 = 0 1 = 1 } 1 = 2 2 = 3 } -// lldb-command:print no_padding2 -// lldbg-check:[...]$1 = { 0 = 4 1 = { 0 = 5 1 = 6 } 2 = 7 } +// lldb-command:v no_padding2 +// lldbg-check:[...] { 0 = 4 1 = { 0 = 5 1 = 6 } 2 = 7 } // lldbr-check:((u32, (u32, u32), u32)) no_padding2 = { 0 = 4 1 = { 0 = 5 1 = 6 } 2 = 7 } -// lldb-command:print no_padding3 -// lldbg-check:[...]$2 = { 0 = 8 1 = 9 2 = { 0 = 10 1 = 11 } } +// lldb-command:v no_padding3 +// lldbg-check:[...] { 0 = 8 1 = 9 2 = { 0 = 10 1 = 11 } } // lldbr-check:((u32, u32, (u32, u32))) no_padding3 = { 0 = 8 1 = 9 2 = { 0 = 10 1 = 11 } } -// lldb-command:print internal_padding1 -// lldbg-check:[...]$3 = { 0 = 12 1 = { 0 = 13 1 = 14 } } +// lldb-command:v internal_padding1 +// lldbg-check:[...] { 0 = 12 1 = { 0 = 13 1 = 14 } } // lldbr-check:((i16, (i32, i32))) internal_padding1 = { 0 = 12 1 = { 0 = 13 1 = 14 } } -// lldb-command:print internal_padding2 -// lldbg-check:[...]$4 = { 0 = 15 1 = { 0 = 16 1 = 17 } } +// lldb-command:v internal_padding2 +// lldbg-check:[...] { 0 = 15 1 = { 0 = 16 1 = 17 } } // lldbr-check:((i16, (i16, i32))) internal_padding2 = { 0 = 15 1 = { 0 = 16 1 = 17 } } -// lldb-command:print padding_at_end1 -// lldbg-check:[...]$5 = { 0 = 18 1 = { 0 = 19 1 = 20 } } +// lldb-command:v padding_at_end1 +// lldbg-check:[...] { 0 = 18 1 = { 0 = 19 1 = 20 } } // lldbr-check:((i32, (i32, i16))) padding_at_end1 = { 0 = 18 1 = { 0 = 19 1 = 20 } } -// lldb-command:print padding_at_end2 -// lldbg-check:[...]$6 = { 0 = { 0 = 21 1 = 22 } 1 = 23 } +// lldb-command:v padding_at_end2 +// lldbg-check:[...] { 0 = { 0 = 21 1 = 22 } 1 = 23 } // lldbr-check:(((i32, i16), i32)) padding_at_end2 = { 0 = { 0 = 21 1 = 22 } 1 = 23 } diff --git a/tests/debuginfo/tuple-struct.rs b/tests/debuginfo/tuple-struct.rs index 5eeb1a6eed4..88b1ae19e29 100644 --- a/tests/debuginfo/tuple-struct.rs +++ b/tests/debuginfo/tuple-struct.rs @@ -35,28 +35,28 @@ // lldb-command:run -// lldb-command:print no_padding16 -// lldbg-check:[...]$0 = { 0 = 10000 1 = -10001 } +// lldb-command:v no_padding16 +// lldbg-check:[...] { 0 = 10000 1 = -10001 } // lldbr-check:(tuple_struct::NoPadding16) no_padding16 = { 0 = 10000 1 = -10001 } -// lldb-command:print no_padding32 -// lldbg-check:[...]$1 = { 0 = -10002 1 = -10003.5 2 = 10004 } +// lldb-command:v no_padding32 +// lldbg-check:[...] { 0 = -10002 1 = -10003.5 2 = 10004 } // lldbr-check:(tuple_struct::NoPadding32) no_padding32 = { 0 = -10002 1 = -10003.5 2 = 10004 } -// lldb-command:print no_padding64 -// lldbg-check:[...]$2 = { 0 = -10005.5 1 = 10006 2 = 10007 } +// lldb-command:v no_padding64 +// lldbg-check:[...] { 0 = -10005.5 1 = 10006 2 = 10007 } // lldbr-check:(tuple_struct::NoPadding64) no_padding64 = { 0 = -10005.5 1 = 10006 2 = 10007 } -// lldb-command:print no_padding163264 -// lldbg-check:[...]$3 = { 0 = -10008 1 = 10009 2 = 10010 3 = 10011 } +// lldb-command:v no_padding163264 +// lldbg-check:[...] { 0 = -10008 1 = 10009 2 = 10010 3 = 10011 } // lldbr-check:(tuple_struct::NoPadding163264) no_padding163264 = { 0 = -10008 1 = 10009 2 = 10010 3 = 10011 } -// lldb-command:print internal_padding -// lldbg-check:[...]$4 = { 0 = 10012 1 = -10013 } +// lldb-command:v internal_padding +// lldbg-check:[...] { 0 = 10012 1 = -10013 } // lldbr-check:(tuple_struct::InternalPadding) internal_padding = { 0 = 10012 1 = -10013 } -// lldb-command:print padding_at_end -// lldbg-check:[...]$5 = { 0 = -10014 1 = 10015 } +// lldb-command:v padding_at_end +// lldbg-check:[...] { 0 = -10014 1 = 10015 } // lldbr-check:(tuple_struct::PaddingAtEnd) padding_at_end = { 0 = -10014 1 = 10015 } // This test case mainly makes sure that no field names are generated for tuple structs (as opposed diff --git a/tests/debuginfo/tuple-style-enum.rs b/tests/debuginfo/tuple-style-enum.rs index e3e1684cc28..883aa658eb2 100644 --- a/tests/debuginfo/tuple-style-enum.rs +++ b/tests/debuginfo/tuple-style-enum.rs @@ -26,16 +26,16 @@ // lldb-command:run -// lldb-command:print case1 +// lldb-command:v case1 // lldbr-check:(tuple_style_enum::Regular::Case1) case1 = { = 0 = 31868 = 31868 = 31868 = 31868 } -// lldb-command:print case2 +// lldb-command:v case2 // lldbr-check:(tuple_style_enum::Regular::Case2) case2 = Case2 { Case1: 0, Case2: 286331153, Case3: 286331153 } -// lldb-command:print case3 +// lldb-command:v case3 // lldbr-check:(tuple_style_enum::Regular::Case3) case3 = Case3 { Case1: 0, Case2: 6438275382588823897 } -// lldb-command:print univariant +// lldb-command:v univariant // lldbr-check:(tuple_style_enum::Univariant) univariant = { TheOnlyCase = { = -1 } } #![allow(unused_variables)] diff --git a/tests/debuginfo/union-smoke.rs b/tests/debuginfo/union-smoke.rs index aa57ebdc844..9b1cf6e1e95 100644 --- a/tests/debuginfo/union-smoke.rs +++ b/tests/debuginfo/union-smoke.rs @@ -18,14 +18,14 @@ // === LLDB TESTS ================================================================================== // lldb-command:run -// lldb-command:print u -// lldbg-check:[...]$0 = { a = { 0 = '\x02' 1 = '\x02' } b = 514 } +// lldb-command:v u +// lldbg-check:[...] { a = { 0 = '\x02' 1 = '\x02' } b = 514 } // lldbr-check:(union_smoke::U) u = { a = { 0 = '\x02' 1 = '\x02' } b = 514 } // Don't test this with rust-enabled lldb for now; see // https://github.com/rust-lang-nursery/lldb/issues/18 // lldbg-command:print union_smoke::SU -// lldbg-check:[...]$1 = { a = { 0 = '\x01' 1 = '\x01' } b = 257 } +// lldbg-check:[...] { a = { 0 = '\x01' 1 = '\x01' } b = 257 } #![allow(unused)] #![feature(omit_gdb_pretty_printer_section)] diff --git a/tests/debuginfo/unique-enum.rs b/tests/debuginfo/unique-enum.rs index db2b4403ec6..b3879468e0a 100644 --- a/tests/debuginfo/unique-enum.rs +++ b/tests/debuginfo/unique-enum.rs @@ -22,13 +22,13 @@ // lldb-command:run -// lldb-command:print *the_a +// lldb-command:v *the_a // lldbr-check:(unique_enum::ABC::TheA) *the_a = TheA { TheA: 0, TheB: 8970181431921507452 } -// lldb-command:print *the_b +// lldb-command:v *the_b // lldbr-check:(unique_enum::ABC::TheB) *the_b = { = 0 = 286331153 = 286331153 } -// lldb-command:print *univariant +// lldb-command:v *univariant // lldbr-check:(unique_enum::Univariant) *univariant = { TheOnlyCase = { = 123234 } } #![allow(unused_variables)] diff --git a/tests/debuginfo/var-captured-in-nested-closure.rs b/tests/debuginfo/var-captured-in-nested-closure.rs index 75ab245e13e..7772ec00337 100644 --- a/tests/debuginfo/var-captured-in-nested-closure.rs +++ b/tests/debuginfo/var-captured-in-nested-closure.rs @@ -43,43 +43,43 @@ // lldb-command:run -// lldb-command:print variable -// lldbg-check:[...]$0 = 1 +// lldb-command:v variable +// lldbg-check:[...] 1 // lldbr-check:(isize) variable = 1 -// lldb-command:print constant -// lldbg-check:[...]$1 = 2 +// lldb-command:v constant +// lldbg-check:[...] 2 // lldbr-check:(isize) constant = 2 -// lldb-command:print a_struct -// lldbg-check:[...]$2 = { a = -3 b = 4.5 c = 5 } +// lldb-command:v a_struct +// lldbg-check:[...] { a = -3 b = 4.5 c = 5 } // lldbr-check:(var_captured_in_nested_closure::Struct) a_struct = { a = -3 b = 4.5 c = 5 } -// lldb-command:print *struct_ref -// lldbg-check:[...]$3 = { a = -3 b = 4.5 c = 5 } +// lldb-command:v *struct_ref +// lldbg-check:[...] { a = -3 b = 4.5 c = 5 } // lldbr-check:(var_captured_in_nested_closure::Struct) *struct_ref = { a = -3 b = 4.5 c = 5 } -// lldb-command:print *owned -// lldbg-check:[...]$4 = 6 +// lldb-command:v *owned +// lldbg-check:[...] 6 // lldbr-check:(isize) *owned = 6 -// lldb-command:print closure_local -// lldbg-check:[...]$5 = 8 +// lldb-command:v closure_local +// lldbg-check:[...] 8 // lldbr-check:(isize) closure_local = 8 // lldb-command:continue -// lldb-command:print variable -// lldbg-check:[...]$6 = 1 +// lldb-command:v variable +// lldbg-check:[...] 1 // lldbr-check:(isize) variable = 1 -// lldb-command:print constant -// lldbg-check:[...]$7 = 2 +// lldb-command:v constant +// lldbg-check:[...] 2 // lldbr-check:(isize) constant = 2 -// lldb-command:print a_struct -// lldbg-check:[...]$8 = { a = -3 b = 4.5 c = 5 } +// lldb-command:v a_struct +// lldbg-check:[...] { a = -3 b = 4.5 c = 5 } // lldbr-check:(var_captured_in_nested_closure::Struct) a_struct = { a = -3 b = 4.5 c = 5 } -// lldb-command:print *struct_ref -// lldbg-check:[...]$9 = { a = -3 b = 4.5 c = 5 } +// lldb-command:v *struct_ref +// lldbg-check:[...] { a = -3 b = 4.5 c = 5 } // lldbr-check:(var_captured_in_nested_closure::Struct) *struct_ref = { a = -3 b = 4.5 c = 5 } -// lldb-command:print *owned -// lldbg-check:[...]$10 = 6 +// lldb-command:v *owned +// lldbg-check:[...] 6 // lldbr-check:(isize) *owned = 6 -// lldb-command:print closure_local -// lldbg-check:[...]$11 = 8 +// lldb-command:v closure_local +// lldbg-check:[...] 8 // lldbr-check:(isize) closure_local = 8 // lldb-command:continue diff --git a/tests/debuginfo/var-captured-in-sendable-closure.rs b/tests/debuginfo/var-captured-in-sendable-closure.rs index b7992deef44..782a7d11373 100644 --- a/tests/debuginfo/var-captured-in-sendable-closure.rs +++ b/tests/debuginfo/var-captured-in-sendable-closure.rs @@ -23,14 +23,14 @@ // lldb-command:run -// lldb-command:print constant -// lldbg-check:[...]$0 = 1 +// lldb-command:v constant +// lldbg-check:[...] 1 // lldbr-check:(isize) constant = 1 -// lldb-command:print a_struct -// lldbg-check:[...]$1 = { a = -2 b = 3.5 c = 4 } +// lldb-command:v a_struct +// lldbg-check:[...] { a = -2 b = 3.5 c = 4 } // lldbr-check:(var_captured_in_sendable_closure::Struct) a_struct = { a = -2 b = 3.5 c = 4 } -// lldb-command:print *owned -// lldbg-check:[...]$2 = 5 +// lldb-command:v *owned +// lldbg-check:[...] 5 // lldbr-check:(isize) *owned = 5 #![allow(unused_variables)] diff --git a/tests/debuginfo/var-captured-in-stack-closure.rs b/tests/debuginfo/var-captured-in-stack-closure.rs index eb68b081a6d..c9a93cd7b7f 100644 --- a/tests/debuginfo/var-captured-in-stack-closure.rs +++ b/tests/debuginfo/var-captured-in-stack-closure.rs @@ -39,38 +39,38 @@ // lldb-command:run -// lldb-command:print variable -// lldbg-check:[...]$0 = 1 +// lldb-command:v variable +// lldbg-check:[...] 1 // lldbr-check:(isize) variable = 1 -// lldb-command:print constant -// lldbg-check:[...]$1 = 2 +// lldb-command:v constant +// lldbg-check:[...] 2 // lldbr-check:(isize) constant = 2 -// lldb-command:print a_struct -// lldbg-check:[...]$2 = { a = -3 b = 4.5 c = 5 } +// lldb-command:v a_struct +// lldbg-check:[...] { a = -3 b = 4.5 c = 5 } // lldbr-check:(var_captured_in_stack_closure::Struct) a_struct = { a = -3 b = 4.5 c = 5 } -// lldb-command:print *struct_ref -// lldbg-check:[...]$3 = { a = -3 b = 4.5 c = 5 } +// lldb-command:v *struct_ref +// lldbg-check:[...] { a = -3 b = 4.5 c = 5 } // lldbr-check:(var_captured_in_stack_closure::Struct) *struct_ref = { a = -3 b = 4.5 c = 5 } -// lldb-command:print *owned -// lldbg-check:[...]$4 = 6 +// lldb-command:v *owned +// lldbg-check:[...] 6 // lldbr-check:(isize) *owned = 6 // lldb-command:continue -// lldb-command:print variable -// lldbg-check:[...]$5 = 2 +// lldb-command:v variable +// lldbg-check:[...] 2 // lldbr-check:(isize) variable = 2 -// lldb-command:print constant -// lldbg-check:[...]$6 = 2 +// lldb-command:v constant +// lldbg-check:[...] 2 // lldbr-check:(isize) constant = 2 -// lldb-command:print a_struct -// lldbg-check:[...]$7 = { a = -3 b = 4.5 c = 5 } +// lldb-command:v a_struct +// lldbg-check:[...] { a = -3 b = 4.5 c = 5 } // lldbr-check:(var_captured_in_stack_closure::Struct) a_struct = { a = -3 b = 4.5 c = 5 } -// lldb-command:print *struct_ref -// lldbg-check:[...]$8 = { a = -3 b = 4.5 c = 5 } +// lldb-command:v *struct_ref +// lldbg-check:[...] { a = -3 b = 4.5 c = 5 } // lldbr-check:(var_captured_in_stack_closure::Struct) *struct_ref = { a = -3 b = 4.5 c = 5 } -// lldb-command:print *owned -// lldbg-check:[...]$9 = 6 +// lldb-command:v *owned +// lldbg-check:[...] 6 // lldbr-check:(isize) *owned = 6 diff --git a/tests/debuginfo/vec-slices.rs b/tests/debuginfo/vec-slices.rs index b044110fc78..5a8481699b2 100644 --- a/tests/debuginfo/vec-slices.rs +++ b/tests/debuginfo/vec-slices.rs @@ -70,28 +70,28 @@ // lldb-command:run -// lldb-command:print empty -// lldbg-check:[...]$0 = size=0 +// lldb-command:v empty +// lldbg-check:[...] size=0 // lldbr-check:(&[i64]) empty = size=0 -// lldb-command:print singleton -// lldbg-check:[...]$1 = size=1 { [0] = 1 } +// lldb-command:v singleton +// lldbg-check:[...] size=1 { [0] = 1 } // lldbr-check:(&[i64]) singleton = &[1] -// lldb-command:print multiple -// lldbg-check:[...]$2 = size=4 { [0] = 2 [1] = 3 [2] = 4 [3] = 5 } +// lldb-command:v multiple +// lldbg-check:[...] size=4 { [0] = 2 [1] = 3 [2] = 4 [3] = 5 } // lldbr-check:(&[i64]) multiple = size=4 { [0] = 2 [1] = 3 [2] = 4 [3] = 5 } -// lldb-command:print slice_of_slice -// lldbg-check:[...]$3 = size=2 { [0] = 3 [1] = 4 } +// lldb-command:v slice_of_slice +// lldbg-check:[...] size=2 { [0] = 3 [1] = 4 } // lldbr-check:(&[i64]) slice_of_slice = size=2 { [0] = 3 [1] = 4 } -// lldb-command:print padded_tuple -// lldbg-check:[...]$4 = size=2 { [0] = { 0 = 6 1 = 7 } [1] = { 0 = 8 1 = 9 } } +// lldb-command:v padded_tuple +// lldbg-check:[...] size=2 { [0] = { 0 = 6 1 = 7 } [1] = { 0 = 8 1 = 9 } } // lldbr-check:(&[(i32, i16)]) padded_tuple = size=2 { [0] = { 0 = 6 1 = 7 } [1] = { 0 = 8 1 = 9 } } -// lldb-command:print padded_struct -// lldbg-check:[...]$5 = size=2 { [0] = { x = 10 y = 11 z = 12 } [1] = { x = 13 y = 14 z = 15 } } +// lldb-command:v padded_struct +// lldbg-check:[...] size=2 { [0] = { x = 10 y = 11 z = 12 } [1] = { x = 13 y = 14 z = 15 } } // lldbr-check:(&[vec_slices::AStruct]) padded_struct = size=2 { [0] = { x = 10 y = 11 z = 12 } [1] = { x = 13 y = 14 z = 15 } } #![allow(dead_code, unused_variables)] diff --git a/tests/debuginfo/vec.rs b/tests/debuginfo/vec.rs index 27d04094e3c..cf7de0b9b55 100644 --- a/tests/debuginfo/vec.rs +++ b/tests/debuginfo/vec.rs @@ -17,8 +17,8 @@ // === LLDB TESTS ================================================================================== // lldb-command:run -// lldb-command:print a -// lldbg-check:[...]$0 = { [0] = 1 [1] = 2 [2] = 3 } +// lldb-command:v a +// lldbg-check:[...] { [0] = 1 [1] = 2 [2] = 3 } // lldbr-check:([i32; 3]) a = { [0] = 1 [1] = 2 [2] = 3 } #![allow(unused_variables)] diff --git a/tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.panic-abort.mir b/tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-pre-optimizations.after.panic-abort.mir index 9b4c221df73..3b7c4b8796e 100644 --- a/tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.panic-abort.mir +++ b/tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-pre-optimizations.after.panic-abort.mir @@ -1,4 +1,4 @@ -// MIR for `main` after SimplifyCfg-elaborate-drops +// MIR for `main` after SimplifyCfg-pre-optimizations fn main() -> () { let mut _0: (); diff --git a/tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.panic-unwind.mir b/tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-pre-optimizations.after.panic-unwind.mir index 4b05610f731..3dcddea0353 100644 --- a/tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.panic-unwind.mir +++ b/tests/mir-opt/array_index_is_temporary.main.SimplifyCfg-pre-optimizations.after.panic-unwind.mir @@ -1,4 +1,4 @@ -// MIR for `main` after SimplifyCfg-elaborate-drops +// MIR for `main` after SimplifyCfg-pre-optimizations fn main() -> () { let mut _0: (); diff --git a/tests/mir-opt/array_index_is_temporary.rs b/tests/mir-opt/array_index_is_temporary.rs index 3e5d5d5dd27..500b8b7f7c7 100644 --- a/tests/mir-opt/array_index_is_temporary.rs +++ b/tests/mir-opt/array_index_is_temporary.rs @@ -1,4 +1,4 @@ -//@ unit-test: SimplifyCfg-elaborate-drops +//@ unit-test: SimplifyCfg-pre-optimizations // EMIT_MIR_FOR_EACH_PANIC_STRATEGY // Retagging (from Stacked Borrows) relies on the array index being a fresh // temporary, so that side-effects cannot change it. @@ -10,7 +10,7 @@ unsafe fn foo(z: *mut usize) -> u32 { } -// EMIT_MIR array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.mir +// EMIT_MIR array_index_is_temporary.main.SimplifyCfg-pre-optimizations.after.mir fn main() { // CHECK-LABEL: fn main( // CHECK: debug x => [[x:_.*]]; diff --git a/tests/mir-opt/asm_unwind_panic_abort.rs b/tests/mir-opt/asm_unwind_panic_abort.rs index d6830e12287..fff60942124 100644 --- a/tests/mir-opt/asm_unwind_panic_abort.rs +++ b/tests/mir-opt/asm_unwind_panic_abort.rs @@ -1,9 +1,8 @@ //! Tests that unwinding from an asm block is caught and forced to abort //! when `-C panic=abort`. -//@ only-x86_64 //@ compile-flags: -C panic=abort -//@ no-prefer-dynamic +//@ needs-asm-support #![feature(asm_unwind)] diff --git a/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}-{closure#0}.coroutine_by_move.0.panic-abort.mir b/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}-{closure#0}.coroutine_by_move.0.panic-abort.mir index 1fae40c5f40..06028487d01 100644 --- a/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}-{closure#0}.coroutine_by_move.0.panic-abort.mir +++ b/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}-{closure#0}.coroutine_by_move.0.panic-abort.mir @@ -1,6 +1,6 @@ // MIR for `main::{closure#0}::{closure#0}::{closure#0}` 0 coroutine_by_move -fn main::{closure#0}::{closure#0}::{closure#0}(_1: {async closure body@$DIR/async_closure_shims.rs:39:53: 42:10}, _2: ResumeTy) -> () +fn main::{closure#0}::{closure#0}::{closure#0}(_1: {async closure body@$DIR/async_closure_shims.rs:42:53: 45:10}, _2: ResumeTy) -> () yields () { debug _task_context => _2; diff --git a/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}-{closure#0}.coroutine_by_move.0.panic-unwind.mir b/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}-{closure#0}.coroutine_by_move.0.panic-unwind.mir index 1fae40c5f40..06028487d01 100644 --- a/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}-{closure#0}.coroutine_by_move.0.panic-unwind.mir +++ b/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}-{closure#0}.coroutine_by_move.0.panic-unwind.mir @@ -1,6 +1,6 @@ // MIR for `main::{closure#0}::{closure#0}::{closure#0}` 0 coroutine_by_move -fn main::{closure#0}::{closure#0}::{closure#0}(_1: {async closure body@$DIR/async_closure_shims.rs:39:53: 42:10}, _2: ResumeTy) -> () +fn main::{closure#0}::{closure#0}::{closure#0}(_1: {async closure body@$DIR/async_closure_shims.rs:42:53: 45:10}, _2: ResumeTy) -> () yields () { debug _task_context => _2; diff --git a/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}-{closure#0}.coroutine_by_mut.0.panic-abort.mir b/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}-{closure#0}.coroutine_by_mut.0.panic-abort.mir deleted file mode 100644 index 9886d6f68a4..00000000000 --- a/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}-{closure#0}.coroutine_by_mut.0.panic-abort.mir +++ /dev/null @@ -1,47 +0,0 @@ -// MIR for `main::{closure#0}::{closure#0}::{closure#0}` 0 coroutine_by_mut - -fn main::{closure#0}::{closure#0}::{closure#0}(_1: {async closure body@$DIR/async_closure_shims.rs:39:53: 42:10}, _2: ResumeTy) -> () -yields () - { - debug _task_context => _2; - debug a => (_1.0: i32); - debug b => (*(_1.1: &i32)); - let mut _0: (); - let _3: i32; - scope 1 { - debug a => _3; - let _4: &i32; - scope 2 { - debug a => _4; - let _5: &i32; - scope 3 { - debug b => _5; - } - } - } - - bb0: { - StorageLive(_3); - _3 = (_1.0: i32); - FakeRead(ForLet(None), _3); - StorageLive(_4); - _4 = &_3; - FakeRead(ForLet(None), _4); - StorageLive(_5); - _5 = &(*(_1.1: &i32)); - FakeRead(ForLet(None), _5); - _0 = const (); - StorageDead(_5); - StorageDead(_4); - StorageDead(_3); - drop(_1) -> [return: bb1, unwind: bb2]; - } - - bb1: { - return; - } - - bb2 (cleanup): { - resume; - } -} diff --git a/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}-{closure#0}.coroutine_by_mut.0.panic-unwind.mir b/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}-{closure#0}.coroutine_by_mut.0.panic-unwind.mir deleted file mode 100644 index 9886d6f68a4..00000000000 --- a/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}-{closure#0}.coroutine_by_mut.0.panic-unwind.mir +++ /dev/null @@ -1,47 +0,0 @@ -// MIR for `main::{closure#0}::{closure#0}::{closure#0}` 0 coroutine_by_mut - -fn main::{closure#0}::{closure#0}::{closure#0}(_1: {async closure body@$DIR/async_closure_shims.rs:39:53: 42:10}, _2: ResumeTy) -> () -yields () - { - debug _task_context => _2; - debug a => (_1.0: i32); - debug b => (*(_1.1: &i32)); - let mut _0: (); - let _3: i32; - scope 1 { - debug a => _3; - let _4: &i32; - scope 2 { - debug a => _4; - let _5: &i32; - scope 3 { - debug b => _5; - } - } - } - - bb0: { - StorageLive(_3); - _3 = (_1.0: i32); - FakeRead(ForLet(None), _3); - StorageLive(_4); - _4 = &_3; - FakeRead(ForLet(None), _4); - StorageLive(_5); - _5 = &(*(_1.1: &i32)); - FakeRead(ForLet(None), _5); - _0 = const (); - StorageDead(_5); - StorageDead(_4); - StorageDead(_3); - drop(_1) -> [return: bb1, unwind: bb2]; - } - - bb1: { - return; - } - - bb2 (cleanup): { - resume; - } -} diff --git a/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}.coroutine_closure_by_move.0.panic-abort.mir b/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}.coroutine_closure_by_move.0.panic-abort.mir index 21a9f6f8721..93447b1388d 100644 --- a/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}.coroutine_closure_by_move.0.panic-abort.mir +++ b/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}.coroutine_closure_by_move.0.panic-abort.mir @@ -1,10 +1,10 @@ // MIR for `main::{closure#0}::{closure#0}` 0 coroutine_closure_by_move -fn main::{closure#0}::{closure#0}(_1: {async closure@$DIR/async_closure_shims.rs:39:33: 39:52}, _2: i32) -> {async closure body@$DIR/async_closure_shims.rs:39:53: 42:10} { - let mut _0: {async closure body@$DIR/async_closure_shims.rs:39:53: 42:10}; +fn main::{closure#0}::{closure#0}(_1: {async closure@$DIR/async_closure_shims.rs:42:33: 42:52}, _2: i32) -> {async closure body@$DIR/async_closure_shims.rs:42:53: 45:10} { + let mut _0: {async closure body@$DIR/async_closure_shims.rs:42:53: 45:10}; bb0: { - _0 = {coroutine@$DIR/async_closure_shims.rs:39:53: 42:10 (#0)} { a: move _2, b: move (_1.0: i32) }; + _0 = {coroutine@$DIR/async_closure_shims.rs:42:53: 45:10 (#0)} { a: move _2, b: move (_1.0: i32) }; return; } } diff --git a/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}.coroutine_closure_by_move.0.panic-unwind.mir b/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}.coroutine_closure_by_move.0.panic-unwind.mir index 21a9f6f8721..93447b1388d 100644 --- a/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}.coroutine_closure_by_move.0.panic-unwind.mir +++ b/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}.coroutine_closure_by_move.0.panic-unwind.mir @@ -1,10 +1,10 @@ // MIR for `main::{closure#0}::{closure#0}` 0 coroutine_closure_by_move -fn main::{closure#0}::{closure#0}(_1: {async closure@$DIR/async_closure_shims.rs:39:33: 39:52}, _2: i32) -> {async closure body@$DIR/async_closure_shims.rs:39:53: 42:10} { - let mut _0: {async closure body@$DIR/async_closure_shims.rs:39:53: 42:10}; +fn main::{closure#0}::{closure#0}(_1: {async closure@$DIR/async_closure_shims.rs:42:33: 42:52}, _2: i32) -> {async closure body@$DIR/async_closure_shims.rs:42:53: 45:10} { + let mut _0: {async closure body@$DIR/async_closure_shims.rs:42:53: 45:10}; bb0: { - _0 = {coroutine@$DIR/async_closure_shims.rs:39:53: 42:10 (#0)} { a: move _2, b: move (_1.0: i32) }; + _0 = {coroutine@$DIR/async_closure_shims.rs:42:53: 45:10 (#0)} { a: move _2, b: move (_1.0: i32) }; return; } } diff --git a/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}.coroutine_closure_by_mut.0.panic-abort.mir b/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}.coroutine_closure_by_mut.0.panic-abort.mir deleted file mode 100644 index 1cfb6c2f3ea..00000000000 --- a/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}.coroutine_closure_by_mut.0.panic-abort.mir +++ /dev/null @@ -1,16 +0,0 @@ -// MIR for `main::{closure#0}::{closure#0}` 0 coroutine_closure_by_mut - -fn main::{closure#0}::{closure#0}(_1: &mut {async closure@$DIR/async_closure_shims.rs:39:33: 39:52}, _2: i32) -> {async closure body@$DIR/async_closure_shims.rs:39:53: 42:10} { - debug a => _2; - debug b => ((*_1).0: i32); - let mut _0: {async closure body@$DIR/async_closure_shims.rs:39:53: 42:10}; - let mut _3: &i32; - - bb0: { - StorageLive(_3); - _3 = &((*_1).0: i32); - _0 = {coroutine@$DIR/async_closure_shims.rs:39:53: 42:10 (#0)} { a: _2, b: move _3 }; - StorageDead(_3); - return; - } -} diff --git a/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}.coroutine_closure_by_mut.0.panic-unwind.mir b/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}.coroutine_closure_by_mut.0.panic-unwind.mir deleted file mode 100644 index 1cfb6c2f3ea..00000000000 --- a/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#0}.coroutine_closure_by_mut.0.panic-unwind.mir +++ /dev/null @@ -1,16 +0,0 @@ -// MIR for `main::{closure#0}::{closure#0}` 0 coroutine_closure_by_mut - -fn main::{closure#0}::{closure#0}(_1: &mut {async closure@$DIR/async_closure_shims.rs:39:33: 39:52}, _2: i32) -> {async closure body@$DIR/async_closure_shims.rs:39:53: 42:10} { - debug a => _2; - debug b => ((*_1).0: i32); - let mut _0: {async closure body@$DIR/async_closure_shims.rs:39:53: 42:10}; - let mut _3: &i32; - - bb0: { - StorageLive(_3); - _3 = &((*_1).0: i32); - _0 = {coroutine@$DIR/async_closure_shims.rs:39:53: 42:10 (#0)} { a: _2, b: move _3 }; - StorageDead(_3); - return; - } -} diff --git a/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#1}.coroutine_closure_by_ref.0.panic-abort.mir b/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#1}.coroutine_closure_by_ref.0.panic-abort.mir new file mode 100644 index 00000000000..f51540bcfff --- /dev/null +++ b/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#1}.coroutine_closure_by_ref.0.panic-abort.mir @@ -0,0 +1,10 @@ +// MIR for `main::{closure#0}::{closure#1}` 0 coroutine_closure_by_ref + +fn main::{closure#0}::{closure#1}(_1: *mut {async closure@$DIR/async_closure_shims.rs:49:29: 49:48}, _2: i32) -> {async closure body@$DIR/async_closure_shims.rs:49:49: 51:10} { + let mut _0: {async closure body@$DIR/async_closure_shims.rs:49:49: 51:10}; + + bb0: { + _0 = {coroutine@$DIR/async_closure_shims.rs:49:49: 51:10 (#0)} { a: move _2 }; + return; + } +} diff --git a/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#1}.coroutine_closure_by_ref.0.panic-unwind.mir b/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#1}.coroutine_closure_by_ref.0.panic-unwind.mir new file mode 100644 index 00000000000..f51540bcfff --- /dev/null +++ b/tests/mir-opt/async_closure_shims.main-{closure#0}-{closure#1}.coroutine_closure_by_ref.0.panic-unwind.mir @@ -0,0 +1,10 @@ +// MIR for `main::{closure#0}::{closure#1}` 0 coroutine_closure_by_ref + +fn main::{closure#0}::{closure#1}(_1: *mut {async closure@$DIR/async_closure_shims.rs:49:29: 49:48}, _2: i32) -> {async closure body@$DIR/async_closure_shims.rs:49:49: 51:10} { + let mut _0: {async closure body@$DIR/async_closure_shims.rs:49:49: 51:10}; + + bb0: { + _0 = {coroutine@$DIR/async_closure_shims.rs:49:49: 51:10 (#0)} { a: move _2 }; + return; + } +} diff --git a/tests/mir-opt/async_closure_shims.rs b/tests/mir-opt/async_closure_shims.rs index 5e875321400..7d226df6866 100644 --- a/tests/mir-opt/async_closure_shims.rs +++ b/tests/mir-opt/async_closure_shims.rs @@ -29,10 +29,13 @@ async fn call_once(f: impl AsyncFnOnce(i32)) { f(1).await; } +async fn call_normal<F: Future<Output = ()>>(f: &impl Fn(i32) -> F) { + f(1).await; +} + // EMIT_MIR async_closure_shims.main-{closure#0}-{closure#0}.coroutine_closure_by_move.0.mir -// EMIT_MIR async_closure_shims.main-{closure#0}-{closure#0}.coroutine_closure_by_mut.0.mir -// EMIT_MIR async_closure_shims.main-{closure#0}-{closure#0}-{closure#0}.coroutine_by_mut.0.mir // EMIT_MIR async_closure_shims.main-{closure#0}-{closure#0}-{closure#0}.coroutine_by_move.0.mir +// EMIT_MIR async_closure_shims.main-{closure#0}-{closure#1}.coroutine_closure_by_ref.0.mir pub fn main() { block_on(async { let b = 2i32; @@ -42,5 +45,10 @@ pub fn main() { }; call_mut(&mut async_closure).await; call_once(async_closure).await; + + let async_closure = async move |a: i32| { + let a = &a; + }; + call_normal(&async_closure).await; }); } diff --git a/tests/mir-opt/byte_slice.main.SimplifyCfg-elaborate-drops.after.mir b/tests/mir-opt/byte_slice.main.SimplifyCfg-pre-optimizations.after.mir index 09a65e6e6a6..c53b5e48610 100644 --- a/tests/mir-opt/byte_slice.main.SimplifyCfg-elaborate-drops.after.mir +++ b/tests/mir-opt/byte_slice.main.SimplifyCfg-pre-optimizations.after.mir @@ -1,4 +1,4 @@ -// MIR for `main` after SimplifyCfg-elaborate-drops +// MIR for `main` after SimplifyCfg-pre-optimizations fn main() -> () { let mut _0: (); diff --git a/tests/mir-opt/byte_slice.rs b/tests/mir-opt/byte_slice.rs index c064e2945fd..fa616b62ad0 100644 --- a/tests/mir-opt/byte_slice.rs +++ b/tests/mir-opt/byte_slice.rs @@ -1,7 +1,7 @@ // skip-filecheck //@ compile-flags: -Z mir-opt-level=0 -// EMIT_MIR byte_slice.main.SimplifyCfg-elaborate-drops.after.mir +// EMIT_MIR byte_slice.main.SimplifyCfg-pre-optimizations.after.mir fn main() { let x = b"foo"; let y = [5u8, b'x']; diff --git a/tests/mir-opt/const_promotion_extern_static.BAR-promoted[0].SimplifyCfg-elaborate-drops.after.mir b/tests/mir-opt/const_promotion_extern_static.BAR-promoted[0].SimplifyCfg-pre-optimizations.after.mir index b4ae8386add..7affbf6dd40 100644 --- a/tests/mir-opt/const_promotion_extern_static.BAR-promoted[0].SimplifyCfg-elaborate-drops.after.mir +++ b/tests/mir-opt/const_promotion_extern_static.BAR-promoted[0].SimplifyCfg-pre-optimizations.after.mir @@ -1,4 +1,4 @@ -// MIR for `BAR::promoted[0]` after SimplifyCfg-elaborate-drops +// MIR for `BAR::promoted[0]` after SimplifyCfg-pre-optimizations const BAR::promoted[0]: &[&i32; 1] = { let mut _0: &[&i32; 1]; diff --git a/tests/mir-opt/const_promotion_extern_static.FOO-promoted[0].SimplifyCfg-elaborate-drops.after.mir b/tests/mir-opt/const_promotion_extern_static.FOO-promoted[0].SimplifyCfg-pre-optimizations.after.mir index 8d4bfa711e4..72cb64e275e 100644 --- a/tests/mir-opt/const_promotion_extern_static.FOO-promoted[0].SimplifyCfg-elaborate-drops.after.mir +++ b/tests/mir-opt/const_promotion_extern_static.FOO-promoted[0].SimplifyCfg-pre-optimizations.after.mir @@ -1,4 +1,4 @@ -// MIR for `FOO::promoted[0]` after SimplifyCfg-elaborate-drops +// MIR for `FOO::promoted[0]` after SimplifyCfg-pre-optimizations const FOO::promoted[0]: &[&i32; 1] = { let mut _0: &[&i32; 1]; diff --git a/tests/mir-opt/const_promotion_extern_static.rs b/tests/mir-opt/const_promotion_extern_static.rs index 077e74e91f4..fe258f5e8fd 100644 --- a/tests/mir-opt/const_promotion_extern_static.rs +++ b/tests/mir-opt/const_promotion_extern_static.rs @@ -6,11 +6,11 @@ extern "C" { static Y: i32 = 42; // EMIT_MIR const_promotion_extern_static.BAR.PromoteTemps.diff -// EMIT_MIR const_promotion_extern_static.BAR-promoted[0].SimplifyCfg-elaborate-drops.after.mir +// EMIT_MIR const_promotion_extern_static.BAR-promoted[0].SimplifyCfg-pre-optimizations.after.mir static mut BAR: *const &i32 = [&Y].as_ptr(); // EMIT_MIR const_promotion_extern_static.FOO.PromoteTemps.diff -// EMIT_MIR const_promotion_extern_static.FOO-promoted[0].SimplifyCfg-elaborate-drops.after.mir +// EMIT_MIR const_promotion_extern_static.FOO-promoted[0].SimplifyCfg-pre-optimizations.after.mir static mut FOO: *const &i32 = [unsafe { &X }].as_ptr(); // EMIT_MIR const_promotion_extern_static.BOP.built.after.mir diff --git a/tests/mir-opt/instrument_coverage_cleanup.main.CleanupPostBorrowck.diff b/tests/mir-opt/instrument_coverage_cleanup.main.CleanupPostBorrowck.diff new file mode 100644 index 00000000000..ff65ca77039 --- /dev/null +++ b/tests/mir-opt/instrument_coverage_cleanup.main.CleanupPostBorrowck.diff @@ -0,0 +1,56 @@ +- // MIR for `main` before CleanupPostBorrowck ++ // MIR for `main` after CleanupPostBorrowck + + fn main() -> () { + let mut _0: (); + let mut _1: bool; + + coverage branch { true: BlockMarkerId(0), false: BlockMarkerId(1) } => /the/src/instrument_coverage_cleanup.rs:15:8: 15:36 (#0) + + coverage ExpressionId(0) => Expression { lhs: Counter(0), op: Subtract, rhs: Counter(1) }; + coverage ExpressionId(1) => Expression { lhs: Counter(1), op: Add, rhs: Expression(0) }; + coverage Code(Counter(0)) => /the/src/instrument_coverage_cleanup.rs:14:1 - 15:36; + coverage Code(Expression(0)) => /the/src/instrument_coverage_cleanup.rs:15:37 - 15:39; + coverage Code(Counter(1)) => /the/src/instrument_coverage_cleanup.rs:15:39 - 15:40; + coverage Code(Expression(1)) => /the/src/instrument_coverage_cleanup.rs:16:1 - 16:2; + coverage Branch { true_term: Expression(0), false_term: Counter(1) } => /the/src/instrument_coverage_cleanup.rs:15:8 - 15:36; + + bb0: { + Coverage::CounterIncrement(0); +- Coverage::SpanMarker; ++ nop; + StorageLive(_1); + _1 = std::hint::black_box::<bool>(const true) -> [return: bb1, unwind: bb5]; + } + + bb1: { + switchInt(move _1) -> [0: bb3, otherwise: bb2]; + } + + bb2: { + Coverage::CounterIncrement(1); +- Coverage::BlockMarker(1); ++ nop; + _0 = const (); + goto -> bb4; + } + + bb3: { + Coverage::ExpressionUsed(0); +- Coverage::BlockMarker(0); ++ nop; + _0 = const (); + goto -> bb4; + } + + bb4: { + Coverage::ExpressionUsed(1); + StorageDead(_1); + return; + } + + bb5 (cleanup): { + resume; + } + } + diff --git a/tests/mir-opt/instrument_coverage_cleanup.main.InstrumentCoverage.diff b/tests/mir-opt/instrument_coverage_cleanup.main.InstrumentCoverage.diff new file mode 100644 index 00000000000..8757559149a --- /dev/null +++ b/tests/mir-opt/instrument_coverage_cleanup.main.InstrumentCoverage.diff @@ -0,0 +1,53 @@ +- // MIR for `main` before InstrumentCoverage ++ // MIR for `main` after InstrumentCoverage + + fn main() -> () { + let mut _0: (); + let mut _1: bool; + + coverage branch { true: BlockMarkerId(0), false: BlockMarkerId(1) } => /the/src/instrument_coverage_cleanup.rs:15:8: 15:36 (#0) + ++ coverage ExpressionId(0) => Expression { lhs: Counter(0), op: Subtract, rhs: Counter(1) }; ++ coverage ExpressionId(1) => Expression { lhs: Counter(1), op: Add, rhs: Expression(0) }; ++ coverage Code(Counter(0)) => /the/src/instrument_coverage_cleanup.rs:14:1 - 15:36; ++ coverage Code(Expression(0)) => /the/src/instrument_coverage_cleanup.rs:15:37 - 15:39; ++ coverage Code(Counter(1)) => /the/src/instrument_coverage_cleanup.rs:15:39 - 15:40; ++ coverage Code(Expression(1)) => /the/src/instrument_coverage_cleanup.rs:16:1 - 16:2; ++ coverage Branch { true_term: Expression(0), false_term: Counter(1) } => /the/src/instrument_coverage_cleanup.rs:15:8 - 15:36; ++ + bb0: { ++ Coverage::CounterIncrement(0); + Coverage::SpanMarker; + StorageLive(_1); + _1 = std::hint::black_box::<bool>(const true) -> [return: bb1, unwind: bb5]; + } + + bb1: { + switchInt(move _1) -> [0: bb3, otherwise: bb2]; + } + + bb2: { ++ Coverage::CounterIncrement(1); + Coverage::BlockMarker(1); + _0 = const (); + goto -> bb4; + } + + bb3: { ++ Coverage::ExpressionUsed(0); + Coverage::BlockMarker(0); + _0 = const (); + goto -> bb4; + } + + bb4: { ++ Coverage::ExpressionUsed(1); + StorageDead(_1); + return; + } + + bb5 (cleanup): { + resume; + } + } + diff --git a/tests/mir-opt/instrument_coverage_cleanup.rs b/tests/mir-opt/instrument_coverage_cleanup.rs new file mode 100644 index 00000000000..8a2fd67139b --- /dev/null +++ b/tests/mir-opt/instrument_coverage_cleanup.rs @@ -0,0 +1,22 @@ +// Test that CleanupPostBorrowck cleans up the marker statements that are +// inserted during MIR building (after InstrumentCoverage is done with them), +// but leaves the statements that were added by InstrumentCoverage. +// +// Removed statement kinds: BlockMarker, SpanMarker +// Retained statement kinds: CounterIncrement, ExpressionUsed + +//@ unit-test: InstrumentCoverage +//@ compile-flags: -Cinstrument-coverage -Zcoverage-options=branch -Zno-profiler-runtime +//@ compile-flags: --remap-path-prefix={{src-base}}=/the/src + +// EMIT_MIR instrument_coverage_cleanup.main.InstrumentCoverage.diff +// EMIT_MIR instrument_coverage_cleanup.main.CleanupPostBorrowck.diff +fn main() { + if !core::hint::black_box(true) {} +} + +// CHECK-NOT: Coverage::BlockMarker +// CHECK-NOT: Coverage::SpanMarker +// CHECK: Coverage::CounterIncrement +// CHECK-NOT: Coverage::BlockMarker +// CHECK-NOT: Coverage::SpanMarker diff --git a/tests/mir-opt/issue_99325.main.built.after.32bit.mir b/tests/mir-opt/issue_99325.main.built.after.32bit.mir index f8e195466ee..c8039dc4735 100644 --- a/tests/mir-opt/issue_99325.main.built.after.32bit.mir +++ b/tests/mir-opt/issue_99325.main.built.after.32bit.mir @@ -2,7 +2,7 @@ | User Type Annotations | 0: user_ty: Canonical { value: TypeOf(DefId(0:3 ~ issue_99325[d56d]::function_with_bytes), UserArgs { args: [&*b"AAAA"], user_self_ty: None }), max_universe: U0, variables: [] }, span: $DIR/issue_99325.rs:13:16: 13:46, inferred_ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">} -| 1: user_ty: Canonical { value: TypeOf(DefId(0:3 ~ issue_99325[d56d]::function_with_bytes), UserArgs { args: [UnevaluatedConst { def: DefId(0:8 ~ issue_99325[d56d]::main::{constant#1}), args: [] }: &ReStatic [u8; 4_usize]], user_self_ty: None }), max_universe: U0, variables: [] }, span: $DIR/issue_99325.rs:14:16: 14:68, inferred_ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">} +| 1: user_ty: Canonical { value: TypeOf(DefId(0:3 ~ issue_99325[d56d]::function_with_bytes), UserArgs { args: [UnevaluatedConst { def: DefId(0:8 ~ issue_99325[d56d]::main::{constant#1}), args: [] }: &'static [u8; 4_usize]], user_self_ty: None }), max_universe: U0, variables: [] }, span: $DIR/issue_99325.rs:14:16: 14:68, inferred_ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">} | fn main() -> () { let mut _0: (); diff --git a/tests/mir-opt/issue_99325.main.built.after.64bit.mir b/tests/mir-opt/issue_99325.main.built.after.64bit.mir index f8e195466ee..c8039dc4735 100644 --- a/tests/mir-opt/issue_99325.main.built.after.64bit.mir +++ b/tests/mir-opt/issue_99325.main.built.after.64bit.mir @@ -2,7 +2,7 @@ | User Type Annotations | 0: user_ty: Canonical { value: TypeOf(DefId(0:3 ~ issue_99325[d56d]::function_with_bytes), UserArgs { args: [&*b"AAAA"], user_self_ty: None }), max_universe: U0, variables: [] }, span: $DIR/issue_99325.rs:13:16: 13:46, inferred_ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">} -| 1: user_ty: Canonical { value: TypeOf(DefId(0:3 ~ issue_99325[d56d]::function_with_bytes), UserArgs { args: [UnevaluatedConst { def: DefId(0:8 ~ issue_99325[d56d]::main::{constant#1}), args: [] }: &ReStatic [u8; 4_usize]], user_self_ty: None }), max_universe: U0, variables: [] }, span: $DIR/issue_99325.rs:14:16: 14:68, inferred_ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">} +| 1: user_ty: Canonical { value: TypeOf(DefId(0:3 ~ issue_99325[d56d]::function_with_bytes), UserArgs { args: [UnevaluatedConst { def: DefId(0:8 ~ issue_99325[d56d]::main::{constant#1}), args: [] }: &'static [u8; 4_usize]], user_self_ty: None }), max_universe: U0, variables: [] }, span: $DIR/issue_99325.rs:14:16: 14:68, inferred_ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">} | fn main() -> () { let mut _0: (); diff --git a/tests/mir-opt/no_drop_for_inactive_variant.rs b/tests/mir-opt/no_drop_for_inactive_variant.rs index dd20e4a548e..c94b36971ca 100644 --- a/tests/mir-opt/no_drop_for_inactive_variant.rs +++ b/tests/mir-opt/no_drop_for_inactive_variant.rs @@ -4,7 +4,7 @@ // Ensure that there are no drop terminators in `unwrap<T>` (except the one along the cleanup // path). -// EMIT_MIR no_drop_for_inactive_variant.unwrap.SimplifyCfg-elaborate-drops.after.mir +// EMIT_MIR no_drop_for_inactive_variant.unwrap.SimplifyCfg-pre-optimizations.after.mir fn unwrap<T>(opt: Option<T>) -> T { match opt { Some(x) => x, diff --git a/tests/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-elaborate-drops.after.panic-abort.mir b/tests/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-pre-optimizations.after.panic-abort.mir index 31a6a1d8b3d..fa6c6ce8e57 100644 --- a/tests/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-elaborate-drops.after.panic-abort.mir +++ b/tests/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-pre-optimizations.after.panic-abort.mir @@ -1,4 +1,4 @@ -// MIR for `unwrap` after SimplifyCfg-elaborate-drops +// MIR for `unwrap` after SimplifyCfg-pre-optimizations fn unwrap(_1: Option<T>) -> T { debug opt => _1; diff --git a/tests/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-elaborate-drops.after.panic-unwind.mir b/tests/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-pre-optimizations.after.panic-unwind.mir index 53352fbb19f..54fec3c0f98 100644 --- a/tests/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-elaborate-drops.after.panic-unwind.mir +++ b/tests/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-pre-optimizations.after.panic-unwind.mir @@ -1,4 +1,4 @@ -// MIR for `unwrap` after SimplifyCfg-elaborate-drops +// MIR for `unwrap` after SimplifyCfg-pre-optimizations fn unwrap(_1: Option<T>) -> T { debug opt => _1; diff --git a/tests/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.panic-abort.mir b/tests/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-pre-optimizations.after.panic-abort.mir index 089adff0c56..57f3c614afa 100644 --- a/tests/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.panic-abort.mir +++ b/tests/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-pre-optimizations.after.panic-abort.mir @@ -1,4 +1,4 @@ -// MIR for `main` after SimplifyCfg-elaborate-drops +// MIR for `main` after SimplifyCfg-pre-optimizations fn main() -> () { let mut _0: (); diff --git a/tests/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.panic-unwind.mir b/tests/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-pre-optimizations.after.panic-unwind.mir index 0ef19180459..d5d466a1c30 100644 --- a/tests/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.panic-unwind.mir +++ b/tests/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-pre-optimizations.after.panic-unwind.mir @@ -1,4 +1,4 @@ -// MIR for `main` after SimplifyCfg-elaborate-drops +// MIR for `main` after SimplifyCfg-pre-optimizations fn main() -> () { let mut _0: (); diff --git a/tests/mir-opt/packed_struct_drop_aligned.rs b/tests/mir-opt/packed_struct_drop_aligned.rs index 079c4e68f50..dff941c4fa0 100644 --- a/tests/mir-opt/packed_struct_drop_aligned.rs +++ b/tests/mir-opt/packed_struct_drop_aligned.rs @@ -2,7 +2,7 @@ // EMIT_MIR_FOR_EACH_PANIC_STRATEGY -// EMIT_MIR packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.mir +// EMIT_MIR packed_struct_drop_aligned.main.SimplifyCfg-pre-optimizations.after.mir fn main() { let mut x = Packed(Aligned(Droppy(0))); x.0 = Aligned(Droppy(0)); diff --git a/tests/mir-opt/pre-codegen/checked_ops.rs b/tests/mir-opt/pre-codegen/checked_ops.rs index d36502d3547..3ff1123d0b1 100644 --- a/tests/mir-opt/pre-codegen/checked_ops.rs +++ b/tests/mir-opt/pre-codegen/checked_ops.rs @@ -1,7 +1,6 @@ // skip-filecheck //@ compile-flags: -O -Zmir-opt-level=2 -Cdebuginfo=2 //@ needs-unwind -//@ only-x86_64 #![crate_type = "lib"] #![feature(step_trait)] diff --git a/tests/mir-opt/pre-codegen/intrinsics.rs b/tests/mir-opt/pre-codegen/intrinsics.rs index ed7320cd3c4..e5c059cda12 100644 --- a/tests/mir-opt/pre-codegen/intrinsics.rs +++ b/tests/mir-opt/pre-codegen/intrinsics.rs @@ -1,6 +1,5 @@ // skip-filecheck //@ compile-flags: -O -C debuginfo=0 -Zmir-opt-level=2 -//@ only-64bit // Checks that we do not have any branches in the MIR for the two tested functions. diff --git a/tests/mir-opt/pre-codegen/loops.rs b/tests/mir-opt/pre-codegen/loops.rs index 2d179abc9f3..d0b8cc8db7a 100644 --- a/tests/mir-opt/pre-codegen/loops.rs +++ b/tests/mir-opt/pre-codegen/loops.rs @@ -1,7 +1,6 @@ // skip-filecheck //@ compile-flags: -O -Zmir-opt-level=2 -g //@ needs-unwind -//@ only-64bit #![crate_type = "lib"] diff --git a/tests/mir-opt/pre-codegen/mem_replace.rs b/tests/mir-opt/pre-codegen/mem_replace.rs index 535c1062669..9cb3a839956 100644 --- a/tests/mir-opt/pre-codegen/mem_replace.rs +++ b/tests/mir-opt/pre-codegen/mem_replace.rs @@ -1,6 +1,5 @@ // skip-filecheck //@ compile-flags: -O -C debuginfo=0 -Zmir-opt-level=2 -Zinline-mir -//@ only-64bit //@ ignore-debug the standard library debug assertions leak into this test // EMIT_MIR_FOR_EACH_PANIC_STRATEGY diff --git a/tests/mir-opt/pre-codegen/range_iter.rs b/tests/mir-opt/pre-codegen/range_iter.rs index fe7d0e67f7a..5aa617227ce 100644 --- a/tests/mir-opt/pre-codegen/range_iter.rs +++ b/tests/mir-opt/pre-codegen/range_iter.rs @@ -1,6 +1,5 @@ // skip-filecheck //@ compile-flags: -O -C debuginfo=0 -Zmir-opt-level=2 -//@ only-64bit // EMIT_MIR_FOR_EACH_PANIC_STRATEGY #![crate_type = "lib"] diff --git a/tests/mir-opt/pre-codegen/simple_option_map.ezmap.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/simple_option_map.ezmap.PreCodegen.after.mir index 718dba21a95..7265a4fc942 100644 --- a/tests/mir-opt/pre-codegen/simple_option_map.ezmap.PreCodegen.after.mir +++ b/tests/mir-opt/pre-codegen/simple_option_map.ezmap.PreCodegen.after.mir @@ -3,9 +3,9 @@ fn ezmap(_1: Option<i32>) -> Option<i32> { debug x => _1; let mut _0: std::option::Option<i32>; - scope 1 (inlined map::<i32, i32, {closure@$DIR/simple_option_map.rs:18:12: 18:15}>) { + scope 1 (inlined map::<i32, i32, {closure@$DIR/simple_option_map.rs:17:12: 17:15}>) { debug slf => _1; - debug f => const ZeroSized: {closure@$DIR/simple_option_map.rs:18:12: 18:15}; + debug f => const ZeroSized: {closure@$DIR/simple_option_map.rs:17:12: 17:15}; let mut _2: isize; let _3: i32; let mut _4: i32; diff --git a/tests/mir-opt/pre-codegen/simple_option_map.rs b/tests/mir-opt/pre-codegen/simple_option_map.rs index c563f6af2a5..0c432be0419 100644 --- a/tests/mir-opt/pre-codegen/simple_option_map.rs +++ b/tests/mir-opt/pre-codegen/simple_option_map.rs @@ -1,6 +1,5 @@ // skip-filecheck //@ compile-flags: -O -C debuginfo=0 -Zmir-opt-level=2 -//@ only-64bit #[inline(always)] fn map<T, U, F>(slf: Option<T>, f: F) -> Option<U> diff --git a/tests/mir-opt/pre-codegen/slice_index.rs b/tests/mir-opt/pre-codegen/slice_index.rs index 80bbffbd097..1d977ee9214 100644 --- a/tests/mir-opt/pre-codegen/slice_index.rs +++ b/tests/mir-opt/pre-codegen/slice_index.rs @@ -1,6 +1,5 @@ // skip-filecheck //@ compile-flags: -O -C debuginfo=0 -Zmir-opt-level=2 -//@ only-64bit //@ ignore-debug the standard library debug assertions leak into this test // EMIT_MIR_FOR_EACH_PANIC_STRATEGY diff --git a/tests/mir-opt/pre-codegen/slice_iter.rs b/tests/mir-opt/pre-codegen/slice_iter.rs index 0269eb39ddf..0fbd3706544 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.rs +++ b/tests/mir-opt/pre-codegen/slice_iter.rs @@ -1,6 +1,5 @@ // skip-filecheck //@ compile-flags: -O -C debuginfo=0 -Zmir-opt-level=2 -//@ only-64bit //@ ignore-debug the standard library debug assertions leak into this test // EMIT_MIR_FOR_EACH_PANIC_STRATEGY diff --git a/tests/mir-opt/pre-codegen/try_identity.rs b/tests/mir-opt/pre-codegen/try_identity.rs index 9da02d65e15..2e17a3ae6e7 100644 --- a/tests/mir-opt/pre-codegen/try_identity.rs +++ b/tests/mir-opt/pre-codegen/try_identity.rs @@ -1,6 +1,5 @@ // skip-filecheck //@ compile-flags: -O -C debuginfo=0 -Zmir-opt-level=2 -//@ only-64bit // Track the status of MIR optimizations simplifying `Ok(res?)` for both the old and new desugarings // of that syntax. diff --git a/tests/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.panic-abort.mir b/tests/mir-opt/retag.array_casts.SimplifyCfg-pre-optimizations.after.panic-abort.mir index 0580bf3e2d0..7124b4c1cd8 100644 --- a/tests/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.panic-abort.mir +++ b/tests/mir-opt/retag.array_casts.SimplifyCfg-pre-optimizations.after.panic-abort.mir @@ -1,4 +1,4 @@ -// MIR for `array_casts` after SimplifyCfg-elaborate-drops +// MIR for `array_casts` after SimplifyCfg-pre-optimizations fn array_casts() -> () { let mut _0: (); diff --git a/tests/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.panic-unwind.mir b/tests/mir-opt/retag.array_casts.SimplifyCfg-pre-optimizations.after.panic-unwind.mir index 6f3cc9051d3..be04757f2a3 100644 --- a/tests/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.panic-unwind.mir +++ b/tests/mir-opt/retag.array_casts.SimplifyCfg-pre-optimizations.after.panic-unwind.mir @@ -1,4 +1,4 @@ -// MIR for `array_casts` after SimplifyCfg-elaborate-drops +// MIR for `array_casts` after SimplifyCfg-pre-optimizations fn array_casts() -> () { let mut _0: (); diff --git a/tests/mir-opt/retag.box_to_raw_mut.SimplifyCfg-pre-optimizations.after.panic-abort.mir b/tests/mir-opt/retag.box_to_raw_mut.SimplifyCfg-pre-optimizations.after.panic-abort.mir new file mode 100644 index 00000000000..0e568f6a568 --- /dev/null +++ b/tests/mir-opt/retag.box_to_raw_mut.SimplifyCfg-pre-optimizations.after.panic-abort.mir @@ -0,0 +1,17 @@ +// MIR for `box_to_raw_mut` after SimplifyCfg-pre-optimizations + +fn box_to_raw_mut(_1: &mut Box<i32>) -> *mut i32 { + debug x => _1; + let mut _0: *mut i32; + let mut _2: std::boxed::Box<i32>; + let mut _3: *const i32; + + bb0: { + Retag([fn entry] _1); + _2 = deref_copy (*_1); + _3 = (((_2.0: std::ptr::Unique<i32>).0: std::ptr::NonNull<i32>).0: *const i32); + _0 = &raw mut (*_3); + Retag([raw] _0); + return; + } +} diff --git a/tests/mir-opt/retag.box_to_raw_mut.SimplifyCfg-pre-optimizations.after.panic-unwind.mir b/tests/mir-opt/retag.box_to_raw_mut.SimplifyCfg-pre-optimizations.after.panic-unwind.mir new file mode 100644 index 00000000000..0e568f6a568 --- /dev/null +++ b/tests/mir-opt/retag.box_to_raw_mut.SimplifyCfg-pre-optimizations.after.panic-unwind.mir @@ -0,0 +1,17 @@ +// MIR for `box_to_raw_mut` after SimplifyCfg-pre-optimizations + +fn box_to_raw_mut(_1: &mut Box<i32>) -> *mut i32 { + debug x => _1; + let mut _0: *mut i32; + let mut _2: std::boxed::Box<i32>; + let mut _3: *const i32; + + bb0: { + Retag([fn entry] _1); + _2 = deref_copy (*_1); + _3 = (((_2.0: std::ptr::Unique<i32>).0: std::ptr::NonNull<i32>).0: *const i32); + _0 = &raw mut (*_3); + Retag([raw] _0); + return; + } +} diff --git a/tests/mir-opt/retag.main-{closure#0}.SimplifyCfg-elaborate-drops.after.panic-abort.mir b/tests/mir-opt/retag.main-{closure#0}.SimplifyCfg-pre-optimizations.after.panic-abort.mir index 7f3310919ca..2620929e896 100644 --- a/tests/mir-opt/retag.main-{closure#0}.SimplifyCfg-elaborate-drops.after.panic-abort.mir +++ b/tests/mir-opt/retag.main-{closure#0}.SimplifyCfg-pre-optimizations.after.panic-abort.mir @@ -1,4 +1,4 @@ -// MIR for `main::{closure#0}` after SimplifyCfg-elaborate-drops +// MIR for `main::{closure#0}` after SimplifyCfg-pre-optimizations fn main::{closure#0}(_1: &{closure@main::{closure#0}}, _2: &i32) -> &i32 { debug x => _2; diff --git a/tests/mir-opt/retag.main-{closure#0}.SimplifyCfg-elaborate-drops.after.panic-unwind.mir b/tests/mir-opt/retag.main-{closure#0}.SimplifyCfg-pre-optimizations.after.panic-unwind.mir index 7f3310919ca..2620929e896 100644 --- a/tests/mir-opt/retag.main-{closure#0}.SimplifyCfg-elaborate-drops.after.panic-unwind.mir +++ b/tests/mir-opt/retag.main-{closure#0}.SimplifyCfg-pre-optimizations.after.panic-unwind.mir @@ -1,4 +1,4 @@ -// MIR for `main::{closure#0}` after SimplifyCfg-elaborate-drops +// MIR for `main::{closure#0}` after SimplifyCfg-pre-optimizations fn main::{closure#0}(_1: &{closure@main::{closure#0}}, _2: &i32) -> &i32 { debug x => _2; diff --git a/tests/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.panic-abort.mir b/tests/mir-opt/retag.main.SimplifyCfg-pre-optimizations.after.panic-abort.mir index 96a76cc66ab..d7372a05082 100644 --- a/tests/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.panic-abort.mir +++ b/tests/mir-opt/retag.main.SimplifyCfg-pre-optimizations.after.panic-abort.mir @@ -1,4 +1,4 @@ -// MIR for `main` after SimplifyCfg-elaborate-drops +// MIR for `main` after SimplifyCfg-pre-optimizations fn main() -> () { let mut _0: (); diff --git a/tests/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.panic-unwind.mir b/tests/mir-opt/retag.main.SimplifyCfg-pre-optimizations.after.panic-unwind.mir index 2cedf4c3f5f..6ec62bfcf8c 100644 --- a/tests/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.panic-unwind.mir +++ b/tests/mir-opt/retag.main.SimplifyCfg-pre-optimizations.after.panic-unwind.mir @@ -1,4 +1,4 @@ -// MIR for `main` after SimplifyCfg-elaborate-drops +// MIR for `main` after SimplifyCfg-pre-optimizations fn main() -> () { let mut _0: (); diff --git a/tests/mir-opt/retag.rs b/tests/mir-opt/retag.rs index 0f2659ebfe8..17b3c10abeb 100644 --- a/tests/mir-opt/retag.rs +++ b/tests/mir-opt/retag.rs @@ -8,8 +8,8 @@ struct Test(i32); -// EMIT_MIR retag.{impl#0}-foo.SimplifyCfg-elaborate-drops.after.mir -// EMIT_MIR retag.{impl#0}-foo_shr.SimplifyCfg-elaborate-drops.after.mir +// EMIT_MIR retag.{impl#0}-foo.SimplifyCfg-pre-optimizations.after.mir +// EMIT_MIR retag.{impl#0}-foo_shr.SimplifyCfg-pre-optimizations.after.mir impl Test { // Make sure we run the pass on a method, not just on bare functions. fn foo<'x>(&self, x: &'x mut i32) -> &'x mut i32 { @@ -26,8 +26,8 @@ impl Drop for Test { fn drop(&mut self) {} } -// EMIT_MIR retag.main.SimplifyCfg-elaborate-drops.after.mir -// EMIT_MIR retag.main-{closure#0}.SimplifyCfg-elaborate-drops.after.mir +// EMIT_MIR retag.main.SimplifyCfg-pre-optimizations.after.mir +// EMIT_MIR retag.main-{closure#0}.SimplifyCfg-pre-optimizations.after.mir pub fn main() { let mut x = 0; { @@ -55,7 +55,7 @@ pub fn main() { } /// Casting directly to an array should also go through `&raw` and thus add appropriate retags. -// EMIT_MIR retag.array_casts.SimplifyCfg-elaborate-drops.after.mir +// EMIT_MIR retag.array_casts.SimplifyCfg-pre-optimizations.after.mir fn array_casts() { let mut x: [usize; 2] = [0, 0]; let p = &mut x as *mut usize; @@ -65,3 +65,8 @@ fn array_casts() { let p = &x as *const usize; assert_eq!(unsafe { *p.add(1) }, 1); } + +// EMIT_MIR retag.box_to_raw_mut.SimplifyCfg-pre-optimizations.after.mir +fn box_to_raw_mut(x: &mut Box<i32>) -> *mut i32 { + std::ptr::addr_of_mut!(**x) +} diff --git a/tests/mir-opt/retag.{impl#0}-foo.SimplifyCfg-elaborate-drops.after.panic-abort.mir b/tests/mir-opt/retag.{impl#0}-foo.SimplifyCfg-pre-optimizations.after.panic-abort.mir index 285db435f5a..b656656919e 100644 --- a/tests/mir-opt/retag.{impl#0}-foo.SimplifyCfg-elaborate-drops.after.panic-abort.mir +++ b/tests/mir-opt/retag.{impl#0}-foo.SimplifyCfg-pre-optimizations.after.panic-abort.mir @@ -1,4 +1,4 @@ -// MIR for `<impl at $DIR/retag.rs:13:1: 13:10>::foo` after SimplifyCfg-elaborate-drops +// MIR for `<impl at $DIR/retag.rs:13:1: 13:10>::foo` after SimplifyCfg-pre-optimizations fn <impl at $DIR/retag.rs:13:1: 13:10>::foo(_1: &Test, _2: &mut i32) -> &mut i32 { debug self => _1; diff --git a/tests/mir-opt/retag.{impl#0}-foo.SimplifyCfg-elaborate-drops.after.panic-unwind.mir b/tests/mir-opt/retag.{impl#0}-foo.SimplifyCfg-pre-optimizations.after.panic-unwind.mir index 285db435f5a..b656656919e 100644 --- a/tests/mir-opt/retag.{impl#0}-foo.SimplifyCfg-elaborate-drops.after.panic-unwind.mir +++ b/tests/mir-opt/retag.{impl#0}-foo.SimplifyCfg-pre-optimizations.after.panic-unwind.mir @@ -1,4 +1,4 @@ -// MIR for `<impl at $DIR/retag.rs:13:1: 13:10>::foo` after SimplifyCfg-elaborate-drops +// MIR for `<impl at $DIR/retag.rs:13:1: 13:10>::foo` after SimplifyCfg-pre-optimizations fn <impl at $DIR/retag.rs:13:1: 13:10>::foo(_1: &Test, _2: &mut i32) -> &mut i32 { debug self => _1; diff --git a/tests/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-elaborate-drops.after.panic-abort.mir b/tests/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-pre-optimizations.after.panic-abort.mir index 9ad607b2fe2..4f90413e38b 100644 --- a/tests/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-elaborate-drops.after.panic-abort.mir +++ b/tests/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-pre-optimizations.after.panic-abort.mir @@ -1,4 +1,4 @@ -// MIR for `<impl at $DIR/retag.rs:13:1: 13:10>::foo_shr` after SimplifyCfg-elaborate-drops +// MIR for `<impl at $DIR/retag.rs:13:1: 13:10>::foo_shr` after SimplifyCfg-pre-optimizations fn <impl at $DIR/retag.rs:13:1: 13:10>::foo_shr(_1: &Test, _2: &i32) -> &i32 { debug self => _1; diff --git a/tests/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-elaborate-drops.after.panic-unwind.mir b/tests/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-pre-optimizations.after.panic-unwind.mir index 9ad607b2fe2..4f90413e38b 100644 --- a/tests/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-elaborate-drops.after.panic-unwind.mir +++ b/tests/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-pre-optimizations.after.panic-unwind.mir @@ -1,4 +1,4 @@ -// MIR for `<impl at $DIR/retag.rs:13:1: 13:10>::foo_shr` after SimplifyCfg-elaborate-drops +// MIR for `<impl at $DIR/retag.rs:13:1: 13:10>::foo_shr` after SimplifyCfg-pre-optimizations fn <impl at $DIR/retag.rs:13:1: 13:10>::foo_shr(_1: &Test, _2: &i32) -> &i32 { debug self => _1; diff --git a/tests/mir-opt/simplify_cfg.main.SimplifyCfg-early-opt.diff b/tests/mir-opt/simplify_cfg.main.SimplifyCfg-post-analysis.diff index f20ab869b7b..0e41950d626 100644 --- a/tests/mir-opt/simplify_cfg.main.SimplifyCfg-early-opt.diff +++ b/tests/mir-opt/simplify_cfg.main.SimplifyCfg-post-analysis.diff @@ -1,5 +1,5 @@ -- // MIR for `main` before SimplifyCfg-early-opt -+ // MIR for `main` after SimplifyCfg-early-opt +- // MIR for `main` before SimplifyCfg-post-analysis ++ // MIR for `main` after SimplifyCfg-post-analysis fn main() -> () { let mut _0: (); diff --git a/tests/mir-opt/simplify_cfg.rs b/tests/mir-opt/simplify_cfg.rs index 8dea0e50a61..b1fdc5e64a0 100644 --- a/tests/mir-opt/simplify_cfg.rs +++ b/tests/mir-opt/simplify_cfg.rs @@ -4,7 +4,7 @@ //@ no-prefer-dynamic // EMIT_MIR simplify_cfg.main.SimplifyCfg-initial.diff -// EMIT_MIR simplify_cfg.main.SimplifyCfg-early-opt.diff +// EMIT_MIR simplify_cfg.main.SimplifyCfg-post-analysis.diff fn main() { loop { if bar() { diff --git a/tests/pretty/postfix-match.rs b/tests/pretty/postfix-match.rs new file mode 100644 index 00000000000..5bb54e15275 --- /dev/null +++ b/tests/pretty/postfix-match.rs @@ -0,0 +1,21 @@ +#![feature(postfix_match)] + +fn main() { + let val = Some(42); + + val.match { + Some(_) => 2, + _ => 1 + }; + + + Some(2).match { + Some(_) => true, + None => false + }.match { + false => "ferris is cute", + true => "I turn cats in to petted cats", + }.match { + _ => (), + } +} diff --git a/tests/run-make-fulldeps/obtain-borrowck/driver.rs b/tests/run-make-fulldeps/obtain-borrowck/driver.rs index 2e3bf70e144..e67ec8690f8 100644 --- a/tests/run-make-fulldeps/obtain-borrowck/driver.rs +++ b/tests/run-make-fulldeps/obtain-borrowck/driver.rs @@ -68,7 +68,7 @@ impl rustc_driver::Callbacks for CompilerCalls { let mut bodies = Vec::new(); let crate_items = tcx.hir_crate_items(()); - for id in crate_items.items() { + for id in crate_items.free_items() { if matches!(tcx.def_kind(id.owner_id), DefKind::Fn) { bodies.push(id.owner_id); } diff --git a/tests/run-make/long-linker-command-lines/Makefile b/tests/run-make/long-linker-command-lines/Makefile index f864ea74f4a..b573038e344 100644 --- a/tests/run-make/long-linker-command-lines/Makefile +++ b/tests/run-make/long-linker-command-lines/Makefile @@ -1,6 +1,8 @@ # ignore-cross-compile include ../tools.mk +export LD_LIBRARY_PATH := $(HOST_RPATH_DIR) + all: $(RUSTC) foo.rs -g -O RUSTC="$(RUSTC_ORIGINAL)" $(call RUN,foo) diff --git a/tests/run-make/lto-linkage-used-attr/Makefile b/tests/run-make/lto-linkage-used-attr/Makefile index e78b83890ed..fed41a00f84 100644 --- a/tests/run-make/lto-linkage-used-attr/Makefile +++ b/tests/run-make/lto-linkage-used-attr/Makefile @@ -2,7 +2,6 @@ include ../tools.mk # Verify that the impl_* symbols are preserved. #108030 # only-x86_64-unknown-linux-gnu -# min-llvm-version: 17 all: $(RUSTC) -Cdebuginfo=0 -Copt-level=3 lib.rs diff --git a/tests/rustdoc-ui/invalid_associated_const.rs b/tests/rustdoc-ui/invalid_associated_const.rs index 6ab8c36f740..6f211a383a6 100644 --- a/tests/rustdoc-ui/invalid_associated_const.rs +++ b/tests/rustdoc-ui/invalid_associated_const.rs @@ -3,6 +3,7 @@ trait T { type A: S<C<X = 0i32> = 34>; //~^ ERROR associated type bindings are not allowed here + //~| ERROR associated type bindings are not allowed here } trait S { diff --git a/tests/rustdoc-ui/invalid_associated_const.stderr b/tests/rustdoc-ui/invalid_associated_const.stderr index 9c6ae0f76c6..1eb6d2714e3 100644 --- a/tests/rustdoc-ui/invalid_associated_const.stderr +++ b/tests/rustdoc-ui/invalid_associated_const.stderr @@ -4,6 +4,14 @@ error[E0229]: associated type bindings are not allowed here LL | type A: S<C<X = 0i32> = 34>; | ^^^^^^^^ associated type not allowed here -error: aborting due to 1 previous error +error[E0229]: associated type bindings are not allowed here + --> $DIR/invalid_associated_const.rs:4:17 + | +LL | type A: S<C<X = 0i32> = 34>; + | ^^^^^^^^ associated type not allowed here + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0229`. diff --git a/tests/rustdoc-ui/issue-102467.rs b/tests/rustdoc-ui/issue-102467.rs index bff876e41d6..a27e6156979 100644 --- a/tests/rustdoc-ui/issue-102467.rs +++ b/tests/rustdoc-ui/issue-102467.rs @@ -6,6 +6,7 @@ trait T { type A: S<C<X = 0i32> = 34>; //~^ ERROR associated type bindings are not allowed here + //~| ERROR associated type bindings are not allowed here } trait S { diff --git a/tests/rustdoc-ui/issue-102467.stderr b/tests/rustdoc-ui/issue-102467.stderr index 4a769f94cf2..f54a50a4e19 100644 --- a/tests/rustdoc-ui/issue-102467.stderr +++ b/tests/rustdoc-ui/issue-102467.stderr @@ -4,6 +4,14 @@ error[E0229]: associated type bindings are not allowed here LL | type A: S<C<X = 0i32> = 34>; | ^^^^^^^^ associated type not allowed here -error: aborting due to 1 previous error +error[E0229]: associated type bindings are not allowed here + --> $DIR/issue-102467.rs:7:17 + | +LL | type A: S<C<X = 0i32> = 34>; + | ^^^^^^^^ associated type not allowed here + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0229`. diff --git a/tests/rustdoc-ui/issues/issue-110900.rs b/tests/rustdoc-ui/issues/issue-110900.rs index 5f90444dfd3..5a896167083 100644 --- a/tests/rustdoc-ui/issues/issue-110900.rs +++ b/tests/rustdoc-ui/issues/issue-110900.rs @@ -1,7 +1,6 @@ //@ check-pass #![crate_type="lib"] -#![feature(associated_type_bounds)] trait A<'a> {} trait B<'b> {} diff --git a/tests/rustdoc-ui/issues/issue-96287.rs b/tests/rustdoc-ui/issues/issue-96287.rs index 08cc7ef4c90..b490c2fc03f 100644 --- a/tests/rustdoc-ui/issues/issue-96287.rs +++ b/tests/rustdoc-ui/issues/issue-96287.rs @@ -6,6 +6,7 @@ pub trait TraitWithAssoc { pub type Foo<V> = impl Trait<V::Assoc>; //~^ ERROR +//~| ERROR pub trait Trait<U> {} diff --git a/tests/rustdoc-ui/issues/issue-96287.stderr b/tests/rustdoc-ui/issues/issue-96287.stderr index 62d81534a98..9aba0332164 100644 --- a/tests/rustdoc-ui/issues/issue-96287.stderr +++ b/tests/rustdoc-ui/issues/issue-96287.stderr @@ -9,6 +9,18 @@ help: consider restricting type parameter `V` LL | pub type Foo<V: TraitWithAssoc> = impl Trait<V::Assoc>; | ++++++++++++++++ -error: aborting due to 1 previous error +error[E0220]: associated type `Assoc` not found for `V` + --> $DIR/issue-96287.rs:7:33 + | +LL | pub type Foo<V> = impl Trait<V::Assoc>; + | ^^^^^ there is an associated type `Assoc` in the trait `TraitWithAssoc` + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` +help: consider restricting type parameter `V` + | +LL | pub type Foo<V: TraitWithAssoc> = impl Trait<V::Assoc>; + | ++++++++++++++++ + +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0220`. diff --git a/tests/rustdoc-ui/lints/check.stderr b/tests/rustdoc-ui/lints/check.stderr index c5ed5d0c3ef..acdb8128443 100644 --- a/tests/rustdoc-ui/lints/check.stderr +++ b/tests/rustdoc-ui/lints/check.stderr @@ -4,7 +4,6 @@ warning: missing documentation for the crate LL | / #![feature(rustdoc_missing_doc_code_examples)] LL | | LL | | -LL | | ... | LL | | LL | | pub fn foo() {} @@ -39,7 +38,6 @@ warning: missing code example in this documentation LL | / #![feature(rustdoc_missing_doc_code_examples)] LL | | LL | | -LL | | ... | LL | | LL | | pub fn foo() {} diff --git a/tests/rustdoc/display-hidden-items.rs b/tests/rustdoc/display-hidden-items.rs index 76124554767..901ca17d4d2 100644 --- a/tests/rustdoc/display-hidden-items.rs +++ b/tests/rustdoc/display-hidden-items.rs @@ -5,19 +5,22 @@ #![crate_name = "foo"] // @has 'foo/index.html' -// @has - '//*[@id="reexport.hidden_reexport"]/code' 'pub use hidden::inside_hidden as hidden_reexport;' +// @has - '//*[@class="item-name"]/span[@title="Hidden item"]' '👻' + +// @has - '//*[@id="reexport.hidden_reexport"]/code' '#[doc(hidden)] pub use hidden::inside_hidden as hidden_reexport;' #[doc(hidden)] pub use hidden::inside_hidden as hidden_reexport; // @has - '//*[@class="item-name"]/a[@class="trait"]' 'TraitHidden' // @has 'foo/trait.TraitHidden.html' +// @has - '//code' '#[doc(hidden)] pub trait TraitHidden' #[doc(hidden)] pub trait TraitHidden {} // @has 'foo/index.html' '//*[@class="item-name"]/a[@class="trait"]' 'Trait' pub trait Trait { // @has 'foo/trait.Trait.html' - // @has - '//*[@id="associatedconstant.BAR"]/*[@class="code-header"]' 'const BAR: u32 = 0u32' + // @has - '//*[@id="associatedconstant.BAR"]/*[@class="code-header"]' '#[doc(hidden)] const BAR: u32 = 0u32' #[doc(hidden)] const BAR: u32 = 0; @@ -41,14 +44,15 @@ impl Struct { } impl Trait for Struct { - // @has - '//*[@id="associatedconstant.BAR"]/*[@class="code-header"]' 'const BAR: u32 = 0u32' - // @has - '//*[@id="method.foo"]/*[@class="code-header"]' 'fn foo()' + // @has - '//*[@id="associatedconstant.BAR"]/*[@class="code-header"]' '#[doc(hidden)] const BAR: u32 = 0u32' + // @has - '//*[@id="method.foo"]/*[@class="code-header"]' '#[doc(hidden)] fn foo()' } // @has - '//*[@id="impl-TraitHidden-for-Struct"]/*[@class="code-header"]' 'impl TraitHidden for Struct' impl TraitHidden for Struct {} // @has 'foo/index.html' '//*[@class="item-name"]/a[@class="enum"]' 'HiddenEnum' // @has 'foo/enum.HiddenEnum.html' +// @has - '//code' '#[doc(hidden)] pub enum HiddenEnum' #[doc(hidden)] pub enum HiddenEnum { A, diff --git a/tests/ui/asm/fail-const-eval-issue-121099.rs b/tests/ui/asm/fail-const-eval-issue-121099.rs new file mode 100644 index 00000000000..bed6fc9b39f --- /dev/null +++ b/tests/ui/asm/fail-const-eval-issue-121099.rs @@ -0,0 +1,11 @@ +//@ build-fail +//@ needs-asm-support +#![feature(asm_const)] + +use std::arch::global_asm; + +fn main() {} + +global_asm!("/* {} */", const 1 << 500); //~ ERROR evaluation of constant value failed [E0080] + +global_asm!("/* {} */", const 1 / 0); //~ ERROR evaluation of constant value failed [E0080] diff --git a/tests/ui/asm/fail-const-eval-issue-121099.stderr b/tests/ui/asm/fail-const-eval-issue-121099.stderr new file mode 100644 index 00000000000..51d283218d2 --- /dev/null +++ b/tests/ui/asm/fail-const-eval-issue-121099.stderr @@ -0,0 +1,15 @@ +error[E0080]: evaluation of constant value failed + --> $DIR/fail-const-eval-issue-121099.rs:9:31 + | +LL | global_asm!("/* {} */", const 1 << 500); + | ^^^^^^^^ attempt to shift left by `500_i32`, which would overflow + +error[E0080]: evaluation of constant value failed + --> $DIR/fail-const-eval-issue-121099.rs:11:31 + | +LL | global_asm!("/* {} */", const 1 / 0); + | ^^^^^ attempt to divide `1_i32` by zero + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0080`. diff --git a/tests/ui/associated-consts/assoc-const-eq-bound-var-in-ty-not-wf.rs b/tests/ui/associated-consts/assoc-const-eq-bound-var-in-ty-not-wf.rs new file mode 100644 index 00000000000..a718eb23bed --- /dev/null +++ b/tests/ui/associated-consts/assoc-const-eq-bound-var-in-ty-not-wf.rs @@ -0,0 +1,25 @@ +// Check that we eventually catch types of assoc const bounds +// (containing late-bound vars) that are ill-formed. +#![feature(associated_const_equality)] + +trait Trait<T> { + const K: T; +} + +fn take( + _: impl Trait< + <<for<'a> fn(&'a str) -> &'a str as Project>::Out as Discard>::Out, + K = { () } + >, +) {} +//~^^^^^^ ERROR implementation of `Project` is not general enough +//~^^^^ ERROR higher-ranked subtype error +//~| ERROR higher-ranked subtype error + +trait Project { type Out; } +impl<T> Project for fn(T) -> T { type Out = T; } + +trait Discard { type Out; } +impl<T: ?Sized> Discard for T { type Out = (); } + +fn main() {} diff --git a/tests/ui/associated-consts/assoc-const-eq-bound-var-in-ty-not-wf.stderr b/tests/ui/associated-consts/assoc-const-eq-bound-var-in-ty-not-wf.stderr new file mode 100644 index 00000000000..967814c9c3d --- /dev/null +++ b/tests/ui/associated-consts/assoc-const-eq-bound-var-in-ty-not-wf.stderr @@ -0,0 +1,25 @@ +error: higher-ranked subtype error + --> $DIR/assoc-const-eq-bound-var-in-ty-not-wf.rs:12:13 + | +LL | K = { () } + | ^^^^^^ + +error: higher-ranked subtype error + --> $DIR/assoc-const-eq-bound-var-in-ty-not-wf.rs:12:13 + | +LL | K = { () } + | ^^^^^^ + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error: implementation of `Project` is not general enough + --> $DIR/assoc-const-eq-bound-var-in-ty-not-wf.rs:9:4 + | +LL | fn take( + | ^^^^ implementation of `Project` is not general enough + | + = note: `Project` would have to be implemented for the type `for<'a> fn(&'a str) -> &'a str` + = note: ...but `Project` is actually implemented for the type `fn(&'0 str) -> &'0 str`, for some specific lifetime `'0` + +error: aborting due to 3 previous errors + diff --git a/tests/ui/associated-consts/assoc-const-eq-bound-var-in-ty.rs b/tests/ui/associated-consts/assoc-const-eq-bound-var-in-ty.rs new file mode 100644 index 00000000000..7fc6d564ca4 --- /dev/null +++ b/tests/ui/associated-consts/assoc-const-eq-bound-var-in-ty.rs @@ -0,0 +1,22 @@ +// Check that we don't reject non-escaping late-bound vars in the type of assoc const bindings. +// There's no reason why we should disallow them. +// +//@ check-pass + +#![feature(associated_const_equality)] + +trait Trait<T> { + const K: T; +} + +fn take( + _: impl Trait< + <for<'a> fn(&'a str) -> &'a str as Discard>::Out, + K = { () } + >, +) {} + +trait Discard { type Out; } +impl<T: ?Sized> Discard for T { type Out = (); } + +fn main() {} diff --git a/tests/ui/associated-consts/assoc-const-eq-esc-bound-var-in-ty.rs b/tests/ui/associated-consts/assoc-const-eq-esc-bound-var-in-ty.rs new file mode 100644 index 00000000000..6db1e85ccfa --- /dev/null +++ b/tests/ui/associated-consts/assoc-const-eq-esc-bound-var-in-ty.rs @@ -0,0 +1,15 @@ +// Detect and reject escaping late-bound generic params in +// the type of assoc consts used in an equality bound. +#![feature(associated_const_equality)] + +trait Trait<'a> { + const K: &'a (); +} + +fn take(_: impl for<'r> Trait<'r, K = { &() }>) {} +//~^ ERROR the type of the associated constant `K` cannot capture late-bound generic parameters +//~| NOTE its type cannot capture the late-bound lifetime parameter `'r` +//~| NOTE the late-bound lifetime parameter `'r` is defined here +//~| NOTE `K` has type `&'r ()` + +fn main() {} diff --git a/tests/ui/associated-consts/assoc-const-eq-esc-bound-var-in-ty.stderr b/tests/ui/associated-consts/assoc-const-eq-esc-bound-var-in-ty.stderr new file mode 100644 index 00000000000..349fddcafe8 --- /dev/null +++ b/tests/ui/associated-consts/assoc-const-eq-esc-bound-var-in-ty.stderr @@ -0,0 +1,12 @@ +error: the type of the associated constant `K` cannot capture late-bound generic parameters + --> $DIR/assoc-const-eq-esc-bound-var-in-ty.rs:9:35 + | +LL | fn take(_: impl for<'r> Trait<'r, K = { &() }>) {} + | -- ^ its type cannot capture the late-bound lifetime parameter `'r` + | | + | the late-bound lifetime parameter `'r` is defined here + | + = note: `K` has type `&'r ()` + +error: aborting due to 1 previous error + diff --git a/tests/ui/associated-consts/assoc-const-eq-param-in-ty.rs b/tests/ui/associated-consts/assoc-const-eq-param-in-ty.rs new file mode 100644 index 00000000000..06fd0a024f0 --- /dev/null +++ b/tests/ui/associated-consts/assoc-const-eq-param-in-ty.rs @@ -0,0 +1,69 @@ +// Regression test for issue #108271. +// Detect and reject generic params in the type of assoc consts used in an equality bound. +#![feature(associated_const_equality)] + +trait Trait<'a, T: 'a, const N: usize> { + const K: &'a [T; N]; +} + +fn take0<'r, A: 'r, const Q: usize>(_: impl Trait<'r, A, Q, K = { loop {} }>) {} +//~^ ERROR the type of the associated constant `K` must not depend on generic parameters +//~| NOTE its type must not depend on the lifetime parameter `'r` +//~| NOTE the lifetime parameter `'r` is defined here +//~| NOTE `K` has type `&'r [A; Q]` +//~| ERROR the type of the associated constant `K` must not depend on generic parameters +//~| NOTE its type must not depend on the type parameter `A` +//~| NOTE the type parameter `A` is defined here +//~| NOTE `K` has type `&'r [A; Q]` +//~| ERROR the type of the associated constant `K` must not depend on generic parameters +//~| NOTE its type must not depend on the const parameter `Q` +//~| NOTE the const parameter `Q` is defined here +//~| NOTE `K` has type `&'r [A; Q]` + +trait Project { + const SELF: Self; +} + +fn take1(_: impl Project<SELF = {}>) {} +//~^ ERROR the type of the associated constant `SELF` must not depend on `impl Trait` +//~| NOTE its type must not depend on `impl Trait` +//~| NOTE the `impl Trait` is specified here + +fn take2<P: Project<SELF = {}>>(_: P) {} +//~^ ERROR the type of the associated constant `SELF` must not depend on generic parameters +//~| NOTE its type must not depend on the type parameter `P` +//~| NOTE the type parameter `P` is defined here +//~| NOTE `SELF` has type `P` + +trait Iface<'r> { + //~^ NOTE the lifetime parameter `'r` is defined here + //~| NOTE the lifetime parameter `'r` is defined here + type Assoc<const Q: usize>: Trait<'r, Self, Q, K = { loop {} }> + //~^ ERROR the type of the associated constant `K` must not depend on generic parameters + //~| ERROR the type of the associated constant `K` must not depend on generic parameters + //~| NOTE its type must not depend on the lifetime parameter `'r` + //~| NOTE `K` has type `&'r [Self; Q]` + //~| ERROR the type of the associated constant `K` must not depend on `Self` + //~| NOTE its type must not depend on `Self` + //~| NOTE `K` has type `&'r [Self; Q]` + //~| ERROR the type of the associated constant `K` must not depend on generic parameters + //~| NOTE its type must not depend on the const parameter `Q` + //~| NOTE the const parameter `Q` is defined here + //~| NOTE `K` has type `&'r [Self; Q]` + //~| NOTE its type must not depend on the lifetime parameter `'r` + //~| NOTE `K` has type `&'r [Self; Q]` + //~| ERROR the type of the associated constant `K` must not depend on `Self` + //~| NOTE its type must not depend on `Self` + //~| NOTE `K` has type `&'r [Self; Q]` + //~| ERROR the type of the associated constant `K` must not depend on generic parameters + //~| NOTE its type must not depend on the const parameter `Q` + //~| NOTE the const parameter `Q` is defined here + //~| NOTE `K` has type `&'r [Self; Q]` + //~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + //~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + //~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + where + Self: Sized + 'r; +} + +fn main() {} diff --git a/tests/ui/associated-consts/assoc-const-eq-param-in-ty.stderr b/tests/ui/associated-consts/assoc-const-eq-param-in-ty.stderr new file mode 100644 index 00000000000..6b7b714fff1 --- /dev/null +++ b/tests/ui/associated-consts/assoc-const-eq-param-in-ty.stderr @@ -0,0 +1,108 @@ +error: the type of the associated constant `K` must not depend on generic parameters + --> $DIR/assoc-const-eq-param-in-ty.rs:9:61 + | +LL | fn take0<'r, A: 'r, const Q: usize>(_: impl Trait<'r, A, Q, K = { loop {} }>) {} + | -- the lifetime parameter `'r` is defined here ^ its type must not depend on the lifetime parameter `'r` + | + = note: `K` has type `&'r [A; Q]` + +error: the type of the associated constant `K` must not depend on generic parameters + --> $DIR/assoc-const-eq-param-in-ty.rs:9:61 + | +LL | fn take0<'r, A: 'r, const Q: usize>(_: impl Trait<'r, A, Q, K = { loop {} }>) {} + | - the type parameter `A` is defined here ^ its type must not depend on the type parameter `A` + | + = note: `K` has type `&'r [A; Q]` + +error: the type of the associated constant `K` must not depend on generic parameters + --> $DIR/assoc-const-eq-param-in-ty.rs:9:61 + | +LL | fn take0<'r, A: 'r, const Q: usize>(_: impl Trait<'r, A, Q, K = { loop {} }>) {} + | - ^ its type must not depend on the const parameter `Q` + | | + | the const parameter `Q` is defined here + | + = note: `K` has type `&'r [A; Q]` + +error: the type of the associated constant `SELF` must not depend on `impl Trait` + --> $DIR/assoc-const-eq-param-in-ty.rs:27:26 + | +LL | fn take1(_: impl Project<SELF = {}>) {} + | -------------^^^^------ + | | | + | | its type must not depend on `impl Trait` + | the `impl Trait` is specified here + +error: the type of the associated constant `SELF` must not depend on generic parameters + --> $DIR/assoc-const-eq-param-in-ty.rs:32:21 + | +LL | fn take2<P: Project<SELF = {}>>(_: P) {} + | - ^^^^ its type must not depend on the type parameter `P` + | | + | the type parameter `P` is defined here + | + = note: `SELF` has type `P` + +error: the type of the associated constant `K` must not depend on generic parameters + --> $DIR/assoc-const-eq-param-in-ty.rs:41:52 + | +LL | trait Iface<'r> { + | -- the lifetime parameter `'r` is defined here +... +LL | type Assoc<const Q: usize>: Trait<'r, Self, Q, K = { loop {} }> + | ^ its type must not depend on the lifetime parameter `'r` + | + = note: `K` has type `&'r [Self; Q]` + +error: the type of the associated constant `K` must not depend on `Self` + --> $DIR/assoc-const-eq-param-in-ty.rs:41:52 + | +LL | type Assoc<const Q: usize>: Trait<'r, Self, Q, K = { loop {} }> + | ^ its type must not depend on `Self` + | + = note: `K` has type `&'r [Self; Q]` + +error: the type of the associated constant `K` must not depend on generic parameters + --> $DIR/assoc-const-eq-param-in-ty.rs:41:52 + | +LL | type Assoc<const Q: usize>: Trait<'r, Self, Q, K = { loop {} }> + | - ^ its type must not depend on the const parameter `Q` + | | + | the const parameter `Q` is defined here + | + = note: `K` has type `&'r [Self; Q]` + +error: the type of the associated constant `K` must not depend on generic parameters + --> $DIR/assoc-const-eq-param-in-ty.rs:41:52 + | +LL | trait Iface<'r> { + | -- the lifetime parameter `'r` is defined here +... +LL | type Assoc<const Q: usize>: Trait<'r, Self, Q, K = { loop {} }> + | ^ its type must not depend on the lifetime parameter `'r` + | + = note: `K` has type `&'r [Self; Q]` + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error: the type of the associated constant `K` must not depend on `Self` + --> $DIR/assoc-const-eq-param-in-ty.rs:41:52 + | +LL | type Assoc<const Q: usize>: Trait<'r, Self, Q, K = { loop {} }> + | ^ its type must not depend on `Self` + | + = note: `K` has type `&'r [Self; Q]` + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error: the type of the associated constant `K` must not depend on generic parameters + --> $DIR/assoc-const-eq-param-in-ty.rs:41:52 + | +LL | type Assoc<const Q: usize>: Trait<'r, Self, Q, K = { loop {} }> + | - ^ its type must not depend on the const parameter `Q` + | | + | the const parameter `Q` is defined here + | + = note: `K` has type `&'r [Self; Q]` + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error: aborting due to 11 previous errors + diff --git a/tests/ui/associated-consts/issue-102335-const.rs b/tests/ui/associated-consts/issue-102335-const.rs index f60cb92da7f..969c2c43b71 100644 --- a/tests/ui/associated-consts/issue-102335-const.rs +++ b/tests/ui/associated-consts/issue-102335-const.rs @@ -3,6 +3,7 @@ trait T { type A: S<C<X = 0i32> = 34>; //~^ ERROR associated type bindings are not allowed here + //~| ERROR associated type bindings are not allowed here } trait S { diff --git a/tests/ui/associated-consts/issue-102335-const.stderr b/tests/ui/associated-consts/issue-102335-const.stderr index b69dfd51ea8..2a70425a3cc 100644 --- a/tests/ui/associated-consts/issue-102335-const.stderr +++ b/tests/ui/associated-consts/issue-102335-const.stderr @@ -4,6 +4,14 @@ error[E0229]: associated type bindings are not allowed here LL | type A: S<C<X = 0i32> = 34>; | ^^^^^^^^ associated type not allowed here -error: aborting due to 1 previous error +error[E0229]: associated type bindings are not allowed here + --> $DIR/issue-102335-const.rs:4:17 + | +LL | type A: S<C<X = 0i32> = 34>; + | ^^^^^^^^ associated type not allowed here + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0229`. diff --git a/tests/ui/associated-consts/issue-93835.rs b/tests/ui/associated-consts/issue-93835.rs index b2a437fcbfb..9cc33d53f9c 100644 --- a/tests/ui/associated-consts/issue-93835.rs +++ b/tests/ui/associated-consts/issue-93835.rs @@ -6,7 +6,6 @@ fn e() { //~| ERROR cannot find value //~| ERROR associated const equality //~| ERROR cannot find trait `p` in this scope - //~| ERROR associated type bounds } fn main() {} diff --git a/tests/ui/associated-consts/issue-93835.stderr b/tests/ui/associated-consts/issue-93835.stderr index d3ce46f6f03..dfe78b3d1f3 100644 --- a/tests/ui/associated-consts/issue-93835.stderr +++ b/tests/ui/associated-consts/issue-93835.stderr @@ -26,17 +26,7 @@ LL | type_ascribe!(p, a<p:p<e=6>>); = help: add `#![feature(associated_const_equality)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error[E0658]: associated type bounds are unstable - --> $DIR/issue-93835.rs:4:24 - | -LL | type_ascribe!(p, a<p:p<e=6>>); - | ^^^^^^^^ - | - = note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information - = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error: aborting due to 5 previous errors +error: aborting due to 4 previous errors Some errors have detailed explanations: E0405, E0412, E0425, E0658. For more information about an error, try `rustc --explain E0405`. diff --git a/tests/ui/associated-inherent-types/issue-109299-1.rs b/tests/ui/associated-inherent-types/issue-109299-1.rs index b86e2e31e06..4546785f0b1 100644 --- a/tests/ui/associated-inherent-types/issue-109299-1.rs +++ b/tests/ui/associated-inherent-types/issue-109299-1.rs @@ -7,7 +7,9 @@ impl Lexer<i32> { type Cursor = (); } -type X = impl for<T> Fn() -> Lexer<T>::Cursor; //~ ERROR associated type `Cursor` not found for `Lexer<T>` in the current scope -//~^ ERROR: unconstrained opaque type +type X = impl for<T> Fn() -> Lexer<T>::Cursor; +//~^ ERROR associated type `Cursor` not found for `Lexer<T>` in the current scope +//~| ERROR associated type `Cursor` not found for `Lexer<T>` in the current scope +//~| ERROR: unconstrained opaque type fn main() {} diff --git a/tests/ui/associated-inherent-types/issue-109299-1.stderr b/tests/ui/associated-inherent-types/issue-109299-1.stderr index 5848fa4087d..07a00b6b9a9 100644 --- a/tests/ui/associated-inherent-types/issue-109299-1.stderr +++ b/tests/ui/associated-inherent-types/issue-109299-1.stderr @@ -10,6 +10,19 @@ LL | type X = impl for<T> Fn() -> Lexer<T>::Cursor; = note: the associated type was found for - `Lexer<i32>` +error[E0220]: associated type `Cursor` not found for `Lexer<T>` in the current scope + --> $DIR/issue-109299-1.rs:10:40 + | +LL | struct Lexer<T>(T); + | --------------- associated item `Cursor` not found for this struct +... +LL | type X = impl for<T> Fn() -> Lexer<T>::Cursor; + | ^^^^^^ associated item not found in `Lexer<T>` + | + = note: the associated type was found for + - `Lexer<i32>` + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + error: unconstrained opaque type --> $DIR/issue-109299-1.rs:10:10 | @@ -18,6 +31,6 @@ LL | type X = impl for<T> Fn() -> Lexer<T>::Cursor; | = note: `X` must be used in combination with a concrete type within the same module -error: aborting due to 2 previous errors +error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0220`. diff --git a/tests/ui/associated-type-bounds/ambiguous-associated-type.rs b/tests/ui/associated-type-bounds/ambiguous-associated-type.rs index 4e6d8b9dd0a..ff3c6f2a95d 100644 --- a/tests/ui/associated-type-bounds/ambiguous-associated-type.rs +++ b/tests/ui/associated-type-bounds/ambiguous-associated-type.rs @@ -1,7 +1,5 @@ //@ check-pass -#![feature(associated_type_bounds)] - pub struct Flatten<I> where I: Iterator<Item: IntoIterator>, diff --git a/tests/ui/associated-type-bounds/assoc-type-eq-with-dyn-atb-fail.rs b/tests/ui/associated-type-bounds/assoc-type-eq-with-dyn-atb-fail.rs index 8a580e19186..ca4d1f6d920 100644 --- a/tests/ui/associated-type-bounds/assoc-type-eq-with-dyn-atb-fail.rs +++ b/tests/ui/associated-type-bounds/assoc-type-eq-with-dyn-atb-fail.rs @@ -8,8 +8,6 @@ // Additionally, as reported in https://github.com/rust-lang/rust/issues/63594, // we check that the spans for the error message are sane here. -#![feature(associated_type_bounds)] - fn main() {} trait Bar { diff --git a/tests/ui/associated-type-bounds/assoc-type-eq-with-dyn-atb-fail.stderr b/tests/ui/associated-type-bounds/assoc-type-eq-with-dyn-atb-fail.stderr index ad540909411..b1575abe571 100644 --- a/tests/ui/associated-type-bounds/assoc-type-eq-with-dyn-atb-fail.stderr +++ b/tests/ui/associated-type-bounds/assoc-type-eq-with-dyn-atb-fail.stderr @@ -1,5 +1,5 @@ error: associated type bounds are not allowed in `dyn` types - --> $DIR/assoc-type-eq-with-dyn-atb-fail.rs:30:28 + --> $DIR/assoc-type-eq-with-dyn-atb-fail.rs:28:28 | LL | type Out = Box<dyn Bar<Assoc: Copy>>; | ^^^^^^^^^^^ diff --git a/tests/ui/associated-type-bounds/bad-bounds-on-assoc-in-trait.rs b/tests/ui/associated-type-bounds/bad-bounds-on-assoc-in-trait.rs index edde549bb4b..30fa51bb175 100644 --- a/tests/ui/associated-type-bounds/bad-bounds-on-assoc-in-trait.rs +++ b/tests/ui/associated-type-bounds/bad-bounds-on-assoc-in-trait.rs @@ -1,7 +1,5 @@ //@ check-pass -#![feature(associated_type_bounds)] - use std::fmt::Debug; use std::iter::Once; diff --git a/tests/ui/associated-type-bounds/bad-universal-in-dyn-in-where-clause.rs b/tests/ui/associated-type-bounds/bad-universal-in-dyn-in-where-clause.rs index 81c8fe829f9..4689888719f 100644 --- a/tests/ui/associated-type-bounds/bad-universal-in-dyn-in-where-clause.rs +++ b/tests/ui/associated-type-bounds/bad-universal-in-dyn-in-where-clause.rs @@ -1,5 +1,3 @@ -#![feature(associated_type_bounds)] - trait B { type AssocType; } diff --git a/tests/ui/associated-type-bounds/bad-universal-in-dyn-in-where-clause.stderr b/tests/ui/associated-type-bounds/bad-universal-in-dyn-in-where-clause.stderr index 7d9870c72d4..5d8108f28a0 100644 --- a/tests/ui/associated-type-bounds/bad-universal-in-dyn-in-where-clause.stderr +++ b/tests/ui/associated-type-bounds/bad-universal-in-dyn-in-where-clause.stderr @@ -1,5 +1,5 @@ error: associated type bounds are not allowed in `dyn` types - --> $DIR/bad-universal-in-dyn-in-where-clause.rs:9:19 + --> $DIR/bad-universal-in-dyn-in-where-clause.rs:7:19 | LL | dyn for<'j> B<AssocType: 'j>:, | ^^^^^^^^^^^^^ diff --git a/tests/ui/associated-type-bounds/bad-universal-in-impl-sig.rs b/tests/ui/associated-type-bounds/bad-universal-in-impl-sig.rs index f465123f34c..014550823bd 100644 --- a/tests/ui/associated-type-bounds/bad-universal-in-impl-sig.rs +++ b/tests/ui/associated-type-bounds/bad-universal-in-impl-sig.rs @@ -1,5 +1,3 @@ -#![feature(associated_type_bounds)] - trait Trait { type Item; } diff --git a/tests/ui/associated-type-bounds/bad-universal-in-impl-sig.stderr b/tests/ui/associated-type-bounds/bad-universal-in-impl-sig.stderr index 8855bd9c312..a017a601a17 100644 --- a/tests/ui/associated-type-bounds/bad-universal-in-impl-sig.stderr +++ b/tests/ui/associated-type-bounds/bad-universal-in-impl-sig.stderr @@ -1,5 +1,5 @@ error: associated type bounds are not allowed in `dyn` types - --> $DIR/bad-universal-in-impl-sig.rs:10:16 + --> $DIR/bad-universal-in-impl-sig.rs:8:16 | LL | impl dyn Trait<Item: Trait2> {} | ^^^^^^^^^^^^ diff --git a/tests/ui/associated-type-bounds/bounds-on-assoc-in-trait.rs b/tests/ui/associated-type-bounds/bounds-on-assoc-in-trait.rs index dad1f644284..f69c392a8c3 100644 --- a/tests/ui/associated-type-bounds/bounds-on-assoc-in-trait.rs +++ b/tests/ui/associated-type-bounds/bounds-on-assoc-in-trait.rs @@ -1,7 +1,5 @@ //@ check-pass -#![feature(associated_type_bounds)] - use std::fmt::Debug; use std::iter::Empty; use std::ops::Range; diff --git a/tests/ui/associated-type-bounds/cant-see-copy-bound-from-child-rigid-2.rs b/tests/ui/associated-type-bounds/cant-see-copy-bound-from-child-rigid-2.rs new file mode 100644 index 00000000000..1768b006622 --- /dev/null +++ b/tests/ui/associated-type-bounds/cant-see-copy-bound-from-child-rigid-2.rs @@ -0,0 +1,18 @@ +trait Id { + type This: ?Sized; +} +impl<T: ?Sized> Id for T { + type This = T; +} + +trait Trait { + type Assoc: Id<This: Copy>; +} + +// We can't see use the `T::Assoc::This: Copy` bound to prove `T::Assoc: Copy` +fn foo<T: Trait>(x: T::Assoc) -> (T::Assoc, T::Assoc) { + (x, x) + //~^ ERROR use of moved value +} + +fn main() {} diff --git a/tests/ui/associated-type-bounds/cant-see-copy-bound-from-child-rigid-2.stderr b/tests/ui/associated-type-bounds/cant-see-copy-bound-from-child-rigid-2.stderr new file mode 100644 index 00000000000..cd0e026905c --- /dev/null +++ b/tests/ui/associated-type-bounds/cant-see-copy-bound-from-child-rigid-2.stderr @@ -0,0 +1,13 @@ +error[E0382]: use of moved value: `x` + --> $DIR/cant-see-copy-bound-from-child-rigid-2.rs:14:9 + | +LL | fn foo<T: Trait>(x: T::Assoc) -> (T::Assoc, T::Assoc) { + | - move occurs because `x` has type `<T as Trait>::Assoc`, which does not implement the `Copy` trait +LL | (x, x) + | - ^ value used here after move + | | + | value moved here + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/tests/ui/associated-type-bounds/cant-see-copy-bound-from-child-rigid.rs b/tests/ui/associated-type-bounds/cant-see-copy-bound-from-child-rigid.rs new file mode 100644 index 00000000000..6b3fd7e898d --- /dev/null +++ b/tests/ui/associated-type-bounds/cant-see-copy-bound-from-child-rigid.rs @@ -0,0 +1,18 @@ +trait Id { + type This: ?Sized; +} + +trait Trait { + type Assoc: Id<This: Copy>; +} + +// We can't see use the `T::Assoc::This: Copy` bound to prove `T::Assoc: Copy` +fn foo<T: Trait>(x: T::Assoc) -> (T::Assoc, T::Assoc) +where + T::Assoc: Id<This = T::Assoc>, +{ + (x, x) + //~^ ERROR use of moved value +} + +fn main() {} diff --git a/tests/ui/associated-type-bounds/cant-see-copy-bound-from-child-rigid.stderr b/tests/ui/associated-type-bounds/cant-see-copy-bound-from-child-rigid.stderr new file mode 100644 index 00000000000..3ed73918de3 --- /dev/null +++ b/tests/ui/associated-type-bounds/cant-see-copy-bound-from-child-rigid.stderr @@ -0,0 +1,14 @@ +error[E0382]: use of moved value: `x` + --> $DIR/cant-see-copy-bound-from-child-rigid.rs:14:9 + | +LL | fn foo<T: Trait>(x: T::Assoc) -> (T::Assoc, T::Assoc) + | - move occurs because `x` has type `<T as Trait>::Assoc`, which does not implement the `Copy` trait +... +LL | (x, x) + | - ^ value used here after move + | | + | value moved here + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/tests/ui/associated-type-bounds/consts.rs b/tests/ui/associated-type-bounds/consts.rs index 8f90c36ed45..17de1ff5682 100644 --- a/tests/ui/associated-type-bounds/consts.rs +++ b/tests/ui/associated-type-bounds/consts.rs @@ -1,5 +1,3 @@ -#![feature(associated_type_bounds)] - pub fn accept(_: impl Trait<K: Copy>) {} //~^ ERROR expected type, found constant diff --git a/tests/ui/associated-type-bounds/consts.stderr b/tests/ui/associated-type-bounds/consts.stderr index 7f9fe5e500a..ddb677ec74d 100644 --- a/tests/ui/associated-type-bounds/consts.stderr +++ b/tests/ui/associated-type-bounds/consts.stderr @@ -1,5 +1,5 @@ error: expected type, found constant - --> $DIR/consts.rs:3:29 + --> $DIR/consts.rs:1:29 | LL | pub fn accept(_: impl Trait<K: Copy>) {} | ^------ bounds are not allowed on associated constants @@ -7,7 +7,7 @@ LL | pub fn accept(_: impl Trait<K: Copy>) {} | unexpected constant | note: the associated constant is defined here - --> $DIR/consts.rs:7:5 + --> $DIR/consts.rs:5:5 | LL | const K: i32; | ^^^^^^^^^^^^ diff --git a/tests/ui/associated-type-bounds/dont-imply-atb-in-closure-inference.rs b/tests/ui/associated-type-bounds/dont-imply-atb-in-closure-inference.rs new file mode 100644 index 00000000000..fecb3b15338 --- /dev/null +++ b/tests/ui/associated-type-bounds/dont-imply-atb-in-closure-inference.rs @@ -0,0 +1,21 @@ +//@ check-pass + +#![feature(type_alias_impl_trait)] + +trait IsPtr { + type Assoc; +} +impl<T> IsPtr for T { + type Assoc = fn(i32); +} + +type Tait = impl IsPtr<Assoc: Fn(i32)> + Fn(u32); + +fn hello() +where + Tait:, +{ + let _: Tait = |x| {}; +} + +fn main() {} diff --git a/tests/ui/associated-type-bounds/duplicate.rs b/tests/ui/associated-type-bounds/duplicate.rs index 54c8cd3fde0..2b4a01376d7 100644 --- a/tests/ui/associated-type-bounds/duplicate.rs +++ b/tests/ui/associated-type-bounds/duplicate.rs @@ -1,4 +1,3 @@ -#![feature(associated_type_bounds)] #![feature(type_alias_impl_trait)] use std::iter; @@ -133,16 +132,19 @@ where fn FRPIT1() -> impl Iterator<Item: Copy, Item: Send> { //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719] + //~| ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719] iter::empty() //~^ ERROR type annotations needed } fn FRPIT2() -> impl Iterator<Item: Copy, Item: Copy> { //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719] + //~| ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719] iter::empty() //~^ ERROR type annotations needed } fn FRPIT3() -> impl Iterator<Item: 'static, Item: 'static> { //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719] + //~| ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719] iter::empty() //~^ ERROR type annotations needed } @@ -183,10 +185,13 @@ type ETAI3<T: Iterator<Item: 'static, Item: 'static>> = impl Copy; //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719] type ETAI4 = impl Iterator<Item: Copy, Item: Send>; //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719] +//~| ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719] type ETAI5 = impl Iterator<Item: Copy, Item: Copy>; //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719] +//~| ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719] type ETAI6 = impl Iterator<Item: 'static, Item: 'static>; //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719] +//~| ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719] trait TRI1<T: Iterator<Item: Copy, Item: Send>> {} //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719] @@ -251,14 +256,17 @@ where trait TRA1 { type A: Iterator<Item: Copy, Item: Send>; //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719] + //~| ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719] } trait TRA2 { type A: Iterator<Item: Copy, Item: Copy>; //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719] + //~| ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719] } trait TRA3 { type A: Iterator<Item: 'static, Item: 'static>; //~^ ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719] + //~| ERROR the value of the associated type `Item` in trait `Iterator` is already specified [E0719] } fn main() {} diff --git a/tests/ui/associated-type-bounds/duplicate.stderr b/tests/ui/associated-type-bounds/duplicate.stderr index 6345ef4b798..cf4809991c3 100644 --- a/tests/ui/associated-type-bounds/duplicate.stderr +++ b/tests/ui/associated-type-bounds/duplicate.stderr @@ -1,5 +1,5 @@ error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:7:36 + --> $DIR/duplicate.rs:6:36 | LL | struct SI1<T: Iterator<Item: Copy, Item: Send>> { | ---------- ^^^^^^^^^^ re-bound here @@ -7,7 +7,7 @@ LL | struct SI1<T: Iterator<Item: Copy, Item: Send>> { | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:11:36 + --> $DIR/duplicate.rs:10:36 | LL | struct SI2<T: Iterator<Item: Copy, Item: Copy>> { | ---------- ^^^^^^^^^^ re-bound here @@ -15,7 +15,7 @@ LL | struct SI2<T: Iterator<Item: Copy, Item: Copy>> { | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:15:39 + --> $DIR/duplicate.rs:14:39 | LL | struct SI3<T: Iterator<Item: 'static, Item: 'static>> { | ------------- ^^^^^^^^^^^^^ re-bound here @@ -23,7 +23,7 @@ LL | struct SI3<T: Iterator<Item: 'static, Item: 'static>> { | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:21:29 + --> $DIR/duplicate.rs:20:29 | LL | T: Iterator<Item: Copy, Item: Send>, | ---------- ^^^^^^^^^^ re-bound here @@ -31,7 +31,7 @@ LL | T: Iterator<Item: Copy, Item: Send>, | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:28:29 + --> $DIR/duplicate.rs:27:29 | LL | T: Iterator<Item: Copy, Item: Copy>, | ---------- ^^^^^^^^^^ re-bound here @@ -39,7 +39,7 @@ LL | T: Iterator<Item: Copy, Item: Copy>, | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:35:32 + --> $DIR/duplicate.rs:34:32 | LL | T: Iterator<Item: 'static, Item: 'static>, | ------------- ^^^^^^^^^^^^^ re-bound here @@ -47,7 +47,7 @@ LL | T: Iterator<Item: 'static, Item: 'static>, | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:41:34 + --> $DIR/duplicate.rs:40:34 | LL | enum EI1<T: Iterator<Item: Copy, Item: Send>> { | ---------- ^^^^^^^^^^ re-bound here @@ -55,7 +55,7 @@ LL | enum EI1<T: Iterator<Item: Copy, Item: Send>> { | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:45:34 + --> $DIR/duplicate.rs:44:34 | LL | enum EI2<T: Iterator<Item: Copy, Item: Copy>> { | ---------- ^^^^^^^^^^ re-bound here @@ -63,7 +63,7 @@ LL | enum EI2<T: Iterator<Item: Copy, Item: Copy>> { | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:49:37 + --> $DIR/duplicate.rs:48:37 | LL | enum EI3<T: Iterator<Item: 'static, Item: 'static>> { | ------------- ^^^^^^^^^^^^^ re-bound here @@ -71,7 +71,7 @@ LL | enum EI3<T: Iterator<Item: 'static, Item: 'static>> { | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:55:29 + --> $DIR/duplicate.rs:54:29 | LL | T: Iterator<Item: Copy, Item: Send>, | ---------- ^^^^^^^^^^ re-bound here @@ -79,7 +79,7 @@ LL | T: Iterator<Item: Copy, Item: Send>, | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:62:29 + --> $DIR/duplicate.rs:61:29 | LL | T: Iterator<Item: Copy, Item: Copy>, | ---------- ^^^^^^^^^^ re-bound here @@ -87,7 +87,7 @@ LL | T: Iterator<Item: Copy, Item: Copy>, | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:69:32 + --> $DIR/duplicate.rs:68:32 | LL | T: Iterator<Item: 'static, Item: 'static>, | ------------- ^^^^^^^^^^^^^ re-bound here @@ -95,7 +95,7 @@ LL | T: Iterator<Item: 'static, Item: 'static>, | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:75:35 + --> $DIR/duplicate.rs:74:35 | LL | union UI1<T: Iterator<Item: Copy, Item: Send>> { | ---------- ^^^^^^^^^^ re-bound here @@ -103,7 +103,7 @@ LL | union UI1<T: Iterator<Item: Copy, Item: Send>> { | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:79:35 + --> $DIR/duplicate.rs:78:35 | LL | union UI2<T: Iterator<Item: Copy, Item: Copy>> { | ---------- ^^^^^^^^^^ re-bound here @@ -111,7 +111,7 @@ LL | union UI2<T: Iterator<Item: Copy, Item: Copy>> { | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:83:38 + --> $DIR/duplicate.rs:82:38 | LL | union UI3<T: Iterator<Item: 'static, Item: 'static>> { | ------------- ^^^^^^^^^^^^^ re-bound here @@ -119,7 +119,7 @@ LL | union UI3<T: Iterator<Item: 'static, Item: 'static>> { | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:89:29 + --> $DIR/duplicate.rs:88:29 | LL | T: Iterator<Item: Copy, Item: Send>, | ---------- ^^^^^^^^^^ re-bound here @@ -127,7 +127,7 @@ LL | T: Iterator<Item: Copy, Item: Send>, | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:96:29 + --> $DIR/duplicate.rs:95:29 | LL | T: Iterator<Item: Copy, Item: Copy>, | ---------- ^^^^^^^^^^ re-bound here @@ -135,7 +135,7 @@ LL | T: Iterator<Item: Copy, Item: Copy>, | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:103:32 + --> $DIR/duplicate.rs:102:32 | LL | T: Iterator<Item: 'static, Item: 'static>, | ------------- ^^^^^^^^^^^^^ re-bound here @@ -143,7 +143,7 @@ LL | T: Iterator<Item: 'static, Item: 'static>, | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:109:32 + --> $DIR/duplicate.rs:108:32 | LL | fn FI1<T: Iterator<Item: Copy, Item: Send>>() {} | ---------- ^^^^^^^^^^ re-bound here @@ -151,7 +151,7 @@ LL | fn FI1<T: Iterator<Item: Copy, Item: Send>>() {} | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:111:32 + --> $DIR/duplicate.rs:110:32 | LL | fn FI2<T: Iterator<Item: Copy, Item: Copy>>() {} | ---------- ^^^^^^^^^^ re-bound here @@ -159,7 +159,7 @@ LL | fn FI2<T: Iterator<Item: Copy, Item: Copy>>() {} | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:113:35 + --> $DIR/duplicate.rs:112:35 | LL | fn FI3<T: Iterator<Item: 'static, Item: 'static>>() {} | ------------- ^^^^^^^^^^^^^ re-bound here @@ -167,7 +167,7 @@ LL | fn FI3<T: Iterator<Item: 'static, Item: 'static>>() {} | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:117:29 + --> $DIR/duplicate.rs:116:29 | LL | T: Iterator<Item: Copy, Item: Send>, | ---------- ^^^^^^^^^^ re-bound here @@ -175,7 +175,7 @@ LL | T: Iterator<Item: Copy, Item: Send>, | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:123:29 + --> $DIR/duplicate.rs:122:29 | LL | T: Iterator<Item: Copy, Item: Copy>, | ---------- ^^^^^^^^^^ re-bound here @@ -183,7 +183,7 @@ LL | T: Iterator<Item: Copy, Item: Copy>, | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:129:32 + --> $DIR/duplicate.rs:128:32 | LL | T: Iterator<Item: 'static, Item: 'static>, | ------------- ^^^^^^^^^^^^^ re-bound here @@ -191,13 +191,23 @@ LL | T: Iterator<Item: 'static, Item: 'static>, | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:134:42 + --> $DIR/duplicate.rs:133:42 | LL | fn FRPIT1() -> impl Iterator<Item: Copy, Item: Send> { | ---------- ^^^^^^^^^^ re-bound here | | | `Item` bound here first +error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified + --> $DIR/duplicate.rs:133:42 + | +LL | fn FRPIT1() -> impl Iterator<Item: Copy, Item: Send> { + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + error[E0282]: type annotations needed --> $DIR/duplicate.rs:136:5 | @@ -217,8 +227,18 @@ LL | fn FRPIT2() -> impl Iterator<Item: Copy, Item: Copy> { | | | `Item` bound here first +error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified + --> $DIR/duplicate.rs:139:42 + | +LL | fn FRPIT2() -> impl Iterator<Item: Copy, Item: Copy> { + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + error[E0282]: type annotations needed - --> $DIR/duplicate.rs:141:5 + --> $DIR/duplicate.rs:142:5 | LL | iter::empty() | ^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the function `empty` @@ -229,15 +249,25 @@ LL | iter::empty::<T>() | +++++ error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:144:45 + --> $DIR/duplicate.rs:145:45 | LL | fn FRPIT3() -> impl Iterator<Item: 'static, Item: 'static> { | ------------- ^^^^^^^^^^^^^ re-bound here | | | `Item` bound here first +error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified + --> $DIR/duplicate.rs:145:45 + | +LL | fn FRPIT3() -> impl Iterator<Item: 'static, Item: 'static> { + | ------------- ^^^^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + error[E0282]: type annotations needed - --> $DIR/duplicate.rs:146:5 + --> $DIR/duplicate.rs:148:5 | LL | iter::empty() | ^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the function `empty` @@ -248,7 +278,7 @@ LL | iter::empty::<T>() | +++++ error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:149:40 + --> $DIR/duplicate.rs:151:40 | LL | fn FAPIT1(_: impl Iterator<Item: Copy, Item: Send>) {} | ---------- ^^^^^^^^^^ re-bound here @@ -256,7 +286,7 @@ LL | fn FAPIT1(_: impl Iterator<Item: Copy, Item: Send>) {} | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:151:40 + --> $DIR/duplicate.rs:153:40 | LL | fn FAPIT2(_: impl Iterator<Item: Copy, Item: Copy>) {} | ---------- ^^^^^^^^^^ re-bound here @@ -264,7 +294,7 @@ LL | fn FAPIT2(_: impl Iterator<Item: Copy, Item: Copy>) {} | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:153:43 + --> $DIR/duplicate.rs:155:43 | LL | fn FAPIT3(_: impl Iterator<Item: 'static, Item: 'static>) {} | ------------- ^^^^^^^^^^^^^ re-bound here @@ -272,7 +302,7 @@ LL | fn FAPIT3(_: impl Iterator<Item: 'static, Item: 'static>) {} | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:156:35 + --> $DIR/duplicate.rs:158:35 | LL | type TAI1<T: Iterator<Item: Copy, Item: Send>> = T; | ---------- ^^^^^^^^^^ re-bound here @@ -280,7 +310,7 @@ LL | type TAI1<T: Iterator<Item: Copy, Item: Send>> = T; | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:158:35 + --> $DIR/duplicate.rs:160:35 | LL | type TAI2<T: Iterator<Item: Copy, Item: Copy>> = T; | ---------- ^^^^^^^^^^ re-bound here @@ -288,7 +318,7 @@ LL | type TAI2<T: Iterator<Item: Copy, Item: Copy>> = T; | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:160:38 + --> $DIR/duplicate.rs:162:38 | LL | type TAI3<T: Iterator<Item: 'static, Item: 'static>> = T; | ------------- ^^^^^^^^^^^^^ re-bound here @@ -296,7 +326,7 @@ LL | type TAI3<T: Iterator<Item: 'static, Item: 'static>> = T; | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:164:29 + --> $DIR/duplicate.rs:166:29 | LL | T: Iterator<Item: Copy, Item: Send>, | ---------- ^^^^^^^^^^ re-bound here @@ -304,7 +334,7 @@ LL | T: Iterator<Item: Copy, Item: Send>, | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:169:29 + --> $DIR/duplicate.rs:171:29 | LL | T: Iterator<Item: Copy, Item: Copy>, | ---------- ^^^^^^^^^^ re-bound here @@ -312,7 +342,7 @@ LL | T: Iterator<Item: Copy, Item: Copy>, | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:174:32 + --> $DIR/duplicate.rs:176:32 | LL | T: Iterator<Item: 'static, Item: 'static>, | ------------- ^^^^^^^^^^^^^ re-bound here @@ -320,7 +350,7 @@ LL | T: Iterator<Item: 'static, Item: 'static>, | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:178:36 + --> $DIR/duplicate.rs:180:36 | LL | type ETAI1<T: Iterator<Item: Copy, Item: Send>> = impl Copy; | ---------- ^^^^^^^^^^ re-bound here @@ -328,7 +358,7 @@ LL | type ETAI1<T: Iterator<Item: Copy, Item: Send>> = impl Copy; | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:180:36 + --> $DIR/duplicate.rs:182:36 | LL | type ETAI2<T: Iterator<Item: Copy, Item: Copy>> = impl Copy; | ---------- ^^^^^^^^^^ re-bound here @@ -336,7 +366,7 @@ LL | type ETAI2<T: Iterator<Item: Copy, Item: Copy>> = impl Copy; | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:182:39 + --> $DIR/duplicate.rs:184:39 | LL | type ETAI3<T: Iterator<Item: 'static, Item: 'static>> = impl Copy; | ------------- ^^^^^^^^^^^^^ re-bound here @@ -344,7 +374,7 @@ LL | type ETAI3<T: Iterator<Item: 'static, Item: 'static>> = impl Copy; | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:184:40 + --> $DIR/duplicate.rs:186:40 | LL | type ETAI4 = impl Iterator<Item: Copy, Item: Send>; | ---------- ^^^^^^^^^^ re-bound here @@ -354,21 +384,51 @@ LL | type ETAI4 = impl Iterator<Item: Copy, Item: Send>; error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified --> $DIR/duplicate.rs:186:40 | +LL | type ETAI4 = impl Iterator<Item: Copy, Item: Send>; + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified + --> $DIR/duplicate.rs:189:40 + | LL | type ETAI5 = impl Iterator<Item: Copy, Item: Copy>; | ---------- ^^^^^^^^^^ re-bound here | | | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:188:43 + --> $DIR/duplicate.rs:189:40 + | +LL | type ETAI5 = impl Iterator<Item: Copy, Item: Copy>; + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified + --> $DIR/duplicate.rs:192:43 + | +LL | type ETAI6 = impl Iterator<Item: 'static, Item: 'static>; + | ------------- ^^^^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified + --> $DIR/duplicate.rs:192:43 | LL | type ETAI6 = impl Iterator<Item: 'static, Item: 'static>; | ------------- ^^^^^^^^^^^^^ re-bound here | | | `Item` bound here first + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:191:36 + --> $DIR/duplicate.rs:196:36 | LL | trait TRI1<T: Iterator<Item: Copy, Item: Send>> {} | ---------- ^^^^^^^^^^ re-bound here @@ -376,7 +436,7 @@ LL | trait TRI1<T: Iterator<Item: Copy, Item: Send>> {} | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:193:36 + --> $DIR/duplicate.rs:198:36 | LL | trait TRI2<T: Iterator<Item: Copy, Item: Copy>> {} | ---------- ^^^^^^^^^^ re-bound here @@ -384,7 +444,7 @@ LL | trait TRI2<T: Iterator<Item: Copy, Item: Copy>> {} | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:195:39 + --> $DIR/duplicate.rs:200:39 | LL | trait TRI3<T: Iterator<Item: 'static, Item: 'static>> {} | ------------- ^^^^^^^^^^^^^ re-bound here @@ -392,7 +452,7 @@ LL | trait TRI3<T: Iterator<Item: 'static, Item: 'static>> {} | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:197:34 + --> $DIR/duplicate.rs:202:34 | LL | trait TRS1: Iterator<Item: Copy, Item: Send> {} | ---------- ^^^^^^^^^^ re-bound here @@ -400,7 +460,7 @@ LL | trait TRS1: Iterator<Item: Copy, Item: Send> {} | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:197:34 + --> $DIR/duplicate.rs:202:34 | LL | trait TRS1: Iterator<Item: Copy, Item: Send> {} | ---------- ^^^^^^^^^^ re-bound here @@ -410,7 +470,7 @@ LL | trait TRS1: Iterator<Item: Copy, Item: Send> {} = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:197:34 + --> $DIR/duplicate.rs:202:34 | LL | trait TRS1: Iterator<Item: Copy, Item: Send> {} | ---------- ^^^^^^^^^^ re-bound here @@ -420,7 +480,7 @@ LL | trait TRS1: Iterator<Item: Copy, Item: Send> {} = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:201:34 + --> $DIR/duplicate.rs:206:34 | LL | trait TRS2: Iterator<Item: Copy, Item: Copy> {} | ---------- ^^^^^^^^^^ re-bound here @@ -428,7 +488,7 @@ LL | trait TRS2: Iterator<Item: Copy, Item: Copy> {} | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:201:34 + --> $DIR/duplicate.rs:206:34 | LL | trait TRS2: Iterator<Item: Copy, Item: Copy> {} | ---------- ^^^^^^^^^^ re-bound here @@ -438,7 +498,7 @@ LL | trait TRS2: Iterator<Item: Copy, Item: Copy> {} = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:201:34 + --> $DIR/duplicate.rs:206:34 | LL | trait TRS2: Iterator<Item: Copy, Item: Copy> {} | ---------- ^^^^^^^^^^ re-bound here @@ -448,7 +508,7 @@ LL | trait TRS2: Iterator<Item: Copy, Item: Copy> {} = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:205:37 + --> $DIR/duplicate.rs:210:37 | LL | trait TRS3: Iterator<Item: 'static, Item: 'static> {} | ------------- ^^^^^^^^^^^^^ re-bound here @@ -456,7 +516,7 @@ LL | trait TRS3: Iterator<Item: 'static, Item: 'static> {} | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:205:37 + --> $DIR/duplicate.rs:210:37 | LL | trait TRS3: Iterator<Item: 'static, Item: 'static> {} | ------------- ^^^^^^^^^^^^^ re-bound here @@ -466,7 +526,7 @@ LL | trait TRS3: Iterator<Item: 'static, Item: 'static> {} = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:205:37 + --> $DIR/duplicate.rs:210:37 | LL | trait TRS3: Iterator<Item: 'static, Item: 'static> {} | ------------- ^^^^^^^^^^^^^ re-bound here @@ -476,7 +536,7 @@ LL | trait TRS3: Iterator<Item: 'static, Item: 'static> {} = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:211:29 + --> $DIR/duplicate.rs:216:29 | LL | T: Iterator<Item: Copy, Item: Send>, | ---------- ^^^^^^^^^^ re-bound here @@ -484,7 +544,7 @@ LL | T: Iterator<Item: Copy, Item: Send>, | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:217:29 + --> $DIR/duplicate.rs:222:29 | LL | T: Iterator<Item: Copy, Item: Copy>, | ---------- ^^^^^^^^^^ re-bound here @@ -492,7 +552,7 @@ LL | T: Iterator<Item: Copy, Item: Copy>, | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:223:32 + --> $DIR/duplicate.rs:228:32 | LL | T: Iterator<Item: 'static, Item: 'static>, | ------------- ^^^^^^^^^^^^^ re-bound here @@ -500,7 +560,7 @@ LL | T: Iterator<Item: 'static, Item: 'static>, | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:229:32 + --> $DIR/duplicate.rs:234:32 | LL | Self: Iterator<Item: Copy, Item: Send>, | ---------- ^^^^^^^^^^ re-bound here @@ -508,7 +568,7 @@ LL | Self: Iterator<Item: Copy, Item: Send>, | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:229:32 + --> $DIR/duplicate.rs:234:32 | LL | Self: Iterator<Item: Copy, Item: Send>, | ---------- ^^^^^^^^^^ re-bound here @@ -518,7 +578,7 @@ LL | Self: Iterator<Item: Copy, Item: Send>, = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:229:32 + --> $DIR/duplicate.rs:234:32 | LL | Self: Iterator<Item: Copy, Item: Send>, | ---------- ^^^^^^^^^^ re-bound here @@ -528,7 +588,7 @@ LL | Self: Iterator<Item: Copy, Item: Send>, = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:237:32 + --> $DIR/duplicate.rs:242:32 | LL | Self: Iterator<Item: Copy, Item: Copy>, | ---------- ^^^^^^^^^^ re-bound here @@ -536,7 +596,7 @@ LL | Self: Iterator<Item: Copy, Item: Copy>, | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:237:32 + --> $DIR/duplicate.rs:242:32 | LL | Self: Iterator<Item: Copy, Item: Copy>, | ---------- ^^^^^^^^^^ re-bound here @@ -546,7 +606,7 @@ LL | Self: Iterator<Item: Copy, Item: Copy>, = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:237:32 + --> $DIR/duplicate.rs:242:32 | LL | Self: Iterator<Item: Copy, Item: Copy>, | ---------- ^^^^^^^^^^ re-bound here @@ -556,7 +616,7 @@ LL | Self: Iterator<Item: Copy, Item: Copy>, = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:245:35 + --> $DIR/duplicate.rs:250:35 | LL | Self: Iterator<Item: 'static, Item: 'static>, | ------------- ^^^^^^^^^^^^^ re-bound here @@ -564,7 +624,7 @@ LL | Self: Iterator<Item: 'static, Item: 'static>, | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:245:35 + --> $DIR/duplicate.rs:250:35 | LL | Self: Iterator<Item: 'static, Item: 'static>, | ------------- ^^^^^^^^^^^^^ re-bound here @@ -574,7 +634,7 @@ LL | Self: Iterator<Item: 'static, Item: 'static>, = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:245:35 + --> $DIR/duplicate.rs:250:35 | LL | Self: Iterator<Item: 'static, Item: 'static>, | ------------- ^^^^^^^^^^^^^ re-bound here @@ -584,30 +644,60 @@ LL | Self: Iterator<Item: 'static, Item: 'static>, = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:252:34 + --> $DIR/duplicate.rs:257:34 + | +LL | type A: Iterator<Item: Copy, Item: Send>; + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified + --> $DIR/duplicate.rs:257:34 | LL | type A: Iterator<Item: Copy, Item: Send>; | ---------- ^^^^^^^^^^ re-bound here | | | `Item` bound here first + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified + --> $DIR/duplicate.rs:262:34 + | +LL | type A: Iterator<Item: Copy, Item: Copy>; + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:256:34 + --> $DIR/duplicate.rs:262:34 | LL | type A: Iterator<Item: Copy, Item: Copy>; | ---------- ^^^^^^^^^^ re-bound here | | | `Item` bound here first + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified - --> $DIR/duplicate.rs:260:37 + --> $DIR/duplicate.rs:267:37 | LL | type A: Iterator<Item: 'static, Item: 'static>; | ------------- ^^^^^^^^^^^^^ re-bound here | | | `Item` bound here first -error: aborting due to 72 previous errors +error[E0719]: the value of the associated type `Item` in trait `Iterator` is already specified + --> $DIR/duplicate.rs:267:37 + | +LL | type A: Iterator<Item: 'static, Item: 'static>; + | ------------- ^^^^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error: aborting due to 81 previous errors Some errors have detailed explanations: E0282, E0719. For more information about an error, try `rustc --explain E0282`. diff --git a/tests/ui/associated-type-bounds/elision.rs b/tests/ui/associated-type-bounds/elision.rs index 5d7ed940ac6..8d35df1e4f4 100644 --- a/tests/ui/associated-type-bounds/elision.rs +++ b/tests/ui/associated-type-bounds/elision.rs @@ -1,4 +1,3 @@ -#![feature(associated_type_bounds)] #![feature(anonymous_lifetime_in_impl_trait)] // The same thing should happen for constraints in dyn trait. diff --git a/tests/ui/associated-type-bounds/elision.stderr b/tests/ui/associated-type-bounds/elision.stderr index 749dffdc4d3..36ca5a80024 100644 --- a/tests/ui/associated-type-bounds/elision.stderr +++ b/tests/ui/associated-type-bounds/elision.stderr @@ -1,5 +1,5 @@ error[E0106]: missing lifetime specifier - --> $DIR/elision.rs:5:70 + --> $DIR/elision.rs:4:70 | LL | fn f(x: &mut dyn Iterator<Item: Iterator<Item = &'_ ()>>) -> Option<&'_ ()> { x.next() } | ------------------------------------------------ ^^ expected named lifetime parameter @@ -11,7 +11,7 @@ LL | fn f<'a>(x: &'a mut dyn Iterator<Item: Iterator<Item = &'a ()>>) -> Option< | ++++ ++ ~~ ~~ error: associated type bounds are not allowed in `dyn` types - --> $DIR/elision.rs:5:27 + --> $DIR/elision.rs:4:27 | LL | fn f(x: &mut dyn Iterator<Item: Iterator<Item = &'_ ()>>) -> Option<&'_ ()> { x.next() } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/associated-type-bounds/entails-sized-object-safety.rs b/tests/ui/associated-type-bounds/entails-sized-object-safety.rs index 211c67061e6..ad2cbe48209 100644 --- a/tests/ui/associated-type-bounds/entails-sized-object-safety.rs +++ b/tests/ui/associated-type-bounds/entails-sized-object-safety.rs @@ -1,7 +1,5 @@ //@ build-pass (FIXME(62277): could be check-pass?) -#![feature(associated_type_bounds)] - trait Tr1: Sized { type As1; } trait Tr2<'a>: Sized { type As2; } diff --git a/tests/ui/associated-type-bounds/enum-bounds.rs b/tests/ui/associated-type-bounds/enum-bounds.rs index b5087acb6b8..b1c42610862 100644 --- a/tests/ui/associated-type-bounds/enum-bounds.rs +++ b/tests/ui/associated-type-bounds/enum-bounds.rs @@ -1,6 +1,5 @@ //@ run-pass -#![feature(associated_type_bounds)] #![allow(dead_code)] trait Tr1 { type As1; } diff --git a/tests/ui/associated-type-bounds/fn-apit.rs b/tests/ui/associated-type-bounds/fn-apit.rs index 8e1897cc3d4..24bb5b93c99 100644 --- a/tests/ui/associated-type-bounds/fn-apit.rs +++ b/tests/ui/associated-type-bounds/fn-apit.rs @@ -2,8 +2,6 @@ //@ aux-build:fn-aux.rs #![allow(unused)] -#![feature(associated_type_bounds)] - extern crate fn_aux; use fn_aux::*; diff --git a/tests/ui/associated-type-bounds/fn-aux.rs b/tests/ui/associated-type-bounds/fn-aux.rs index 6aaa0cc895f..26ba2cc4015 100644 --- a/tests/ui/associated-type-bounds/fn-aux.rs +++ b/tests/ui/associated-type-bounds/fn-aux.rs @@ -1,8 +1,6 @@ //@ run-pass //@ aux-build:fn-aux.rs -#![feature(associated_type_bounds)] - extern crate fn_aux; use fn_aux::*; diff --git a/tests/ui/associated-type-bounds/fn-inline.rs b/tests/ui/associated-type-bounds/fn-inline.rs index 8435cb44a9a..971751cc115 100644 --- a/tests/ui/associated-type-bounds/fn-inline.rs +++ b/tests/ui/associated-type-bounds/fn-inline.rs @@ -2,8 +2,6 @@ //@ aux-build:fn-aux.rs #![allow(unused)] -#![feature(associated_type_bounds)] - extern crate fn_aux; use fn_aux::*; diff --git a/tests/ui/associated-type-bounds/fn-where.rs b/tests/ui/associated-type-bounds/fn-where.rs index 3b6b557fb11..d28860bd4cc 100644 --- a/tests/ui/associated-type-bounds/fn-where.rs +++ b/tests/ui/associated-type-bounds/fn-where.rs @@ -2,8 +2,6 @@ //@ aux-build:fn-aux.rs #![allow(unused)] -#![feature(associated_type_bounds)] - extern crate fn_aux; use fn_aux::*; diff --git a/tests/ui/associated-type-bounds/fn-wrap-apit.rs b/tests/ui/associated-type-bounds/fn-wrap-apit.rs index 4ce714d432f..7b55cd33b24 100644 --- a/tests/ui/associated-type-bounds/fn-wrap-apit.rs +++ b/tests/ui/associated-type-bounds/fn-wrap-apit.rs @@ -1,7 +1,6 @@ //@ run-pass //@ aux-build:fn-aux.rs -#![feature(associated_type_bounds)] #![allow(dead_code)] extern crate fn_aux; diff --git a/tests/ui/associated-type-bounds/higher-ranked.rs b/tests/ui/associated-type-bounds/higher-ranked.rs index 9e783c4bdca..a313b54f5b9 100644 --- a/tests/ui/associated-type-bounds/higher-ranked.rs +++ b/tests/ui/associated-type-bounds/higher-ranked.rs @@ -1,7 +1,5 @@ //@ check-pass -#![feature(associated_type_bounds)] - trait A<'a> { type Assoc: ?Sized; } diff --git a/tests/ui/associated-type-bounds/hrtb.rs b/tests/ui/associated-type-bounds/hrtb.rs index 73c7a1a5677..1bf574f2e65 100644 --- a/tests/ui/associated-type-bounds/hrtb.rs +++ b/tests/ui/associated-type-bounds/hrtb.rs @@ -1,7 +1,5 @@ //@ check-pass -#![feature(associated_type_bounds)] - trait A<'a> {} trait B<'b> {} fn foo<T>() diff --git a/tests/ui/associated-type-bounds/implied-bounds-cycle.rs b/tests/ui/associated-type-bounds/implied-bounds-cycle.rs index 785d47d4791..8f2bec889ea 100644 --- a/tests/ui/associated-type-bounds/implied-bounds-cycle.rs +++ b/tests/ui/associated-type-bounds/implied-bounds-cycle.rs @@ -1,5 +1,3 @@ -#![feature(associated_type_bounds)] - trait A { type T; } diff --git a/tests/ui/associated-type-bounds/implied-bounds-cycle.stderr b/tests/ui/associated-type-bounds/implied-bounds-cycle.stderr index 1c1c64ea5f5..9ced7431210 100644 --- a/tests/ui/associated-type-bounds/implied-bounds-cycle.stderr +++ b/tests/ui/associated-type-bounds/implied-bounds-cycle.stderr @@ -1,12 +1,12 @@ error[E0391]: cycle detected when computing the implied predicates of `B` - --> $DIR/implied-bounds-cycle.rs:7:15 + --> $DIR/implied-bounds-cycle.rs:5:15 | LL | trait B: A<T: B> {} | ^ | = note: ...which immediately requires computing the implied predicates of `B` again note: cycle used when computing normalized predicates of `B` - --> $DIR/implied-bounds-cycle.rs:7:1 + --> $DIR/implied-bounds-cycle.rs:5:1 | LL | trait B: A<T: B> {} | ^^^^^^^^^^^^^^^^ diff --git a/tests/ui/associated-type-bounds/implied-in-supertrait.rs b/tests/ui/associated-type-bounds/implied-in-supertrait.rs index 83cb07d700a..639eb8dc6db 100644 --- a/tests/ui/associated-type-bounds/implied-in-supertrait.rs +++ b/tests/ui/associated-type-bounds/implied-in-supertrait.rs @@ -1,7 +1,5 @@ //@ check-pass -#![feature(associated_type_bounds)] - trait Trait: Super<Assoc: Bound> {} trait Super { diff --git a/tests/ui/associated-type-bounds/implied-region-constraints.rs b/tests/ui/associated-type-bounds/implied-region-constraints.rs index 38219da61b4..ab03376c076 100644 --- a/tests/ui/associated-type-bounds/implied-region-constraints.rs +++ b/tests/ui/associated-type-bounds/implied-region-constraints.rs @@ -1,5 +1,3 @@ -#![feature(associated_type_bounds)] - trait Tr1 { type As1; } trait Tr2 { type As2; } diff --git a/tests/ui/associated-type-bounds/implied-region-constraints.stderr b/tests/ui/associated-type-bounds/implied-region-constraints.stderr index cddce8777ea..0aa76f732e4 100644 --- a/tests/ui/associated-type-bounds/implied-region-constraints.stderr +++ b/tests/ui/associated-type-bounds/implied-region-constraints.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/implied-region-constraints.rs:17:56 + --> $DIR/implied-region-constraints.rs:15:56 | LL | fn _bad_st<'a, 'b, T>(x: St<'a, 'b, T>) | -- -- lifetime `'b` defined here @@ -12,7 +12,7 @@ LL | let _failure_proves_not_implied_outlives_region_b: &'b T = &x.f0; = help: consider adding the following bound: `'a: 'b` error: lifetime may not live long enough - --> $DIR/implied-region-constraints.rs:38:64 + --> $DIR/implied-region-constraints.rs:36:64 | LL | fn _bad_en7<'a, 'b, T>(x: En7<'a, 'b, T>) | -- -- lifetime `'b` defined here diff --git a/tests/ui/associated-type-bounds/inside-adt.rs b/tests/ui/associated-type-bounds/inside-adt.rs index 2b4b060983e..bf520d7ee38 100644 --- a/tests/ui/associated-type-bounds/inside-adt.rs +++ b/tests/ui/associated-type-bounds/inside-adt.rs @@ -1,5 +1,3 @@ -#![feature(associated_type_bounds)] - use std::mem::ManuallyDrop; struct S1 { f: dyn Iterator<Item: Copy> } diff --git a/tests/ui/associated-type-bounds/inside-adt.stderr b/tests/ui/associated-type-bounds/inside-adt.stderr index ef45fae8f2a..ff9e2585264 100644 --- a/tests/ui/associated-type-bounds/inside-adt.stderr +++ b/tests/ui/associated-type-bounds/inside-adt.stderr @@ -1,53 +1,53 @@ error: associated type bounds are not allowed in `dyn` types - --> $DIR/inside-adt.rs:5:29 + --> $DIR/inside-adt.rs:3:29 | LL | struct S1 { f: dyn Iterator<Item: Copy> } | ^^^^^^^^^^ error: associated type bounds are not allowed in `dyn` types - --> $DIR/inside-adt.rs:7:33 + --> $DIR/inside-adt.rs:5:33 | LL | struct S2 { f: Box<dyn Iterator<Item: Copy>> } | ^^^^^^^^^^ error: associated type bounds are not allowed in `dyn` types - --> $DIR/inside-adt.rs:9:29 + --> $DIR/inside-adt.rs:7:29 | LL | struct S3 { f: dyn Iterator<Item: 'static> } | ^^^^^^^^^^^^^ error: associated type bounds are not allowed in `dyn` types - --> $DIR/inside-adt.rs:12:26 + --> $DIR/inside-adt.rs:10:26 | LL | enum E1 { V(dyn Iterator<Item: Copy>) } | ^^^^^^^^^^ error: associated type bounds are not allowed in `dyn` types - --> $DIR/inside-adt.rs:14:30 + --> $DIR/inside-adt.rs:12:30 | LL | enum E2 { V(Box<dyn Iterator<Item: Copy>>) } | ^^^^^^^^^^ error: associated type bounds are not allowed in `dyn` types - --> $DIR/inside-adt.rs:16:26 + --> $DIR/inside-adt.rs:14:26 | LL | enum E3 { V(dyn Iterator<Item: 'static>) } | ^^^^^^^^^^^^^ error: associated type bounds are not allowed in `dyn` types - --> $DIR/inside-adt.rs:19:41 + --> $DIR/inside-adt.rs:17:41 | LL | union U1 { f: ManuallyDrop<dyn Iterator<Item: Copy>> } | ^^^^^^^^^^ error: associated type bounds are not allowed in `dyn` types - --> $DIR/inside-adt.rs:21:45 + --> $DIR/inside-adt.rs:19:45 | LL | union U2 { f: ManuallyDrop<Box<dyn Iterator<Item: Copy>>> } | ^^^^^^^^^^ error: associated type bounds are not allowed in `dyn` types - --> $DIR/inside-adt.rs:23:41 + --> $DIR/inside-adt.rs:21:41 | LL | union U3 { f: ManuallyDrop<dyn Iterator<Item: 'static>> } | ^^^^^^^^^^^^^ diff --git a/tests/ui/associated-type-bounds/issue-102335-ty.rs b/tests/ui/associated-type-bounds/issue-102335-ty.rs index 363df73c1ff..5fd8b71e679 100644 --- a/tests/ui/associated-type-bounds/issue-102335-ty.rs +++ b/tests/ui/associated-type-bounds/issue-102335-ty.rs @@ -1,6 +1,7 @@ trait T { type A: S<C<i32 = u32> = ()>; //~^ ERROR associated type bindings are not allowed here + //~| ERROR associated type bindings are not allowed here } trait Q {} diff --git a/tests/ui/associated-type-bounds/issue-102335-ty.stderr b/tests/ui/associated-type-bounds/issue-102335-ty.stderr index 561ca15ab0d..3bd7566ad1e 100644 --- a/tests/ui/associated-type-bounds/issue-102335-ty.stderr +++ b/tests/ui/associated-type-bounds/issue-102335-ty.stderr @@ -4,6 +4,14 @@ error[E0229]: associated type bindings are not allowed here LL | type A: S<C<i32 = u32> = ()>; | ^^^^^^^^^ associated type not allowed here -error: aborting due to 1 previous error +error[E0229]: associated type bindings are not allowed here + --> $DIR/issue-102335-ty.rs:2:17 + | +LL | type A: S<C<i32 = u32> = ()>; + | ^^^^^^^^^ associated type not allowed here + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0229`. diff --git a/tests/ui/associated-type-bounds/issue-104916.rs b/tests/ui/associated-type-bounds/issue-104916.rs index ee29a0a2fc4..75f327e6ee7 100644 --- a/tests/ui/associated-type-bounds/issue-104916.rs +++ b/tests/ui/associated-type-bounds/issue-104916.rs @@ -1,5 +1,3 @@ -#![feature(associated_type_bounds)] - trait B { type AssocType; } diff --git a/tests/ui/associated-type-bounds/issue-104916.stderr b/tests/ui/associated-type-bounds/issue-104916.stderr index e8618b72103..21927328dad 100644 --- a/tests/ui/associated-type-bounds/issue-104916.stderr +++ b/tests/ui/associated-type-bounds/issue-104916.stderr @@ -1,5 +1,5 @@ error: associated type bounds are not allowed in `dyn` types - --> $DIR/issue-104916.rs:9:19 + --> $DIR/issue-104916.rs:7:19 | LL | dyn for<'j> B<AssocType: 'j>:, | ^^^^^^^^^^^^^ diff --git a/tests/ui/associated-type-bounds/issue-61752.rs b/tests/ui/associated-type-bounds/issue-61752.rs index 22e43ea875e..a73ba833c43 100644 --- a/tests/ui/associated-type-bounds/issue-61752.rs +++ b/tests/ui/associated-type-bounds/issue-61752.rs @@ -1,7 +1,5 @@ //@ check-pass -#![feature(associated_type_bounds)] - trait Foo { type Bar; } diff --git a/tests/ui/associated-type-bounds/issue-70292.rs b/tests/ui/associated-type-bounds/issue-70292.rs index 4b8e19904d0..1a6bdcd1a31 100644 --- a/tests/ui/associated-type-bounds/issue-70292.rs +++ b/tests/ui/associated-type-bounds/issue-70292.rs @@ -1,7 +1,5 @@ //@ check-pass -#![feature(associated_type_bounds)] - fn foo<F>(_: F) where F: for<'a> Trait<Output: 'a>, diff --git a/tests/ui/associated-type-bounds/issue-71443-1.rs b/tests/ui/associated-type-bounds/issue-71443-1.rs index 5d2a3e6cbad..58341ac3d3a 100644 --- a/tests/ui/associated-type-bounds/issue-71443-1.rs +++ b/tests/ui/associated-type-bounds/issue-71443-1.rs @@ -1,5 +1,3 @@ -#![feature(associated_type_bounds)] - struct Incorrect; fn hello<F: for<'a> Iterator<Item: 'a>>() { diff --git a/tests/ui/associated-type-bounds/issue-71443-1.stderr b/tests/ui/associated-type-bounds/issue-71443-1.stderr index 6abaaf8e182..27ef545daaa 100644 --- a/tests/ui/associated-type-bounds/issue-71443-1.stderr +++ b/tests/ui/associated-type-bounds/issue-71443-1.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/issue-71443-1.rs:6:5 + --> $DIR/issue-71443-1.rs:4:5 | LL | fn hello<F: for<'a> Iterator<Item: 'a>>() { | - help: try adding a return type: `-> Incorrect` diff --git a/tests/ui/associated-type-bounds/issue-71443-2.rs b/tests/ui/associated-type-bounds/issue-71443-2.rs index bd072f44650..24c4c88f20b 100644 --- a/tests/ui/associated-type-bounds/issue-71443-2.rs +++ b/tests/ui/associated-type-bounds/issue-71443-2.rs @@ -1,7 +1,5 @@ //@ check-pass -#![feature(associated_type_bounds)] - fn hello<'b, F>() where for<'a> F: Iterator<Item: 'a> + 'b, diff --git a/tests/ui/associated-type-bounds/issue-79949.rs b/tests/ui/associated-type-bounds/issue-79949.rs index 4513f0a0b62..9f4a8ffa7e7 100644 --- a/tests/ui/associated-type-bounds/issue-79949.rs +++ b/tests/ui/associated-type-bounds/issue-79949.rs @@ -1,8 +1,6 @@ //@ check-pass #![allow(incomplete_features)] -#![feature(associated_type_bounds)] - trait MP { type T<'a>; } diff --git a/tests/ui/associated-type-bounds/issue-81193.rs b/tests/ui/associated-type-bounds/issue-81193.rs index 1247f835be9..caa5915819b 100644 --- a/tests/ui/associated-type-bounds/issue-81193.rs +++ b/tests/ui/associated-type-bounds/issue-81193.rs @@ -1,7 +1,5 @@ //@ check-pass -#![feature(associated_type_bounds)] - trait A<'a, 'b> {} trait B<'a, 'b, 'c> {} diff --git a/tests/ui/associated-type-bounds/issue-83017.rs b/tests/ui/associated-type-bounds/issue-83017.rs index a059b940e66..932b71cc0ae 100644 --- a/tests/ui/associated-type-bounds/issue-83017.rs +++ b/tests/ui/associated-type-bounds/issue-83017.rs @@ -1,7 +1,5 @@ //@ check-pass -#![feature(associated_type_bounds)] - trait TraitA<'a> { type AsA; } diff --git a/tests/ui/associated-type-bounds/issue-99828.rs b/tests/ui/associated-type-bounds/issue-99828.rs index 67ba50f3cbc..ab3654131f1 100644 --- a/tests/ui/associated-type-bounds/issue-99828.rs +++ b/tests/ui/associated-type-bounds/issue-99828.rs @@ -1,5 +1,6 @@ fn get_iter(vec: &[i32]) -> impl Iterator<Item = {}> + '_ { //~^ ERROR expected type, found constant + //~| ERROR expected type, found constant //~| ERROR associated const equality is incomplete vec.iter() } diff --git a/tests/ui/associated-type-bounds/issue-99828.stderr b/tests/ui/associated-type-bounds/issue-99828.stderr index 911f3ff0f5e..132d5251987 100644 --- a/tests/ui/associated-type-bounds/issue-99828.stderr +++ b/tests/ui/associated-type-bounds/issue-99828.stderr @@ -19,6 +19,18 @@ LL | fn get_iter(vec: &[i32]) -> impl Iterator<Item = {}> + '_ { note: the associated type is defined here --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL -error: aborting due to 2 previous errors +error: expected type, found constant + --> $DIR/issue-99828.rs:1:50 + | +LL | fn get_iter(vec: &[i32]) -> impl Iterator<Item = {}> + '_ { + | ---- ^^ unexpected constant + | | + | expected a type because of this associated type + | +note: the associated type is defined here + --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/associated-type-bounds/nested-bounds-dont-eliminate-alias-bounds.rs b/tests/ui/associated-type-bounds/nested-bounds-dont-eliminate-alias-bounds.rs index ee4de509da6..305c117da62 100644 --- a/tests/ui/associated-type-bounds/nested-bounds-dont-eliminate-alias-bounds.rs +++ b/tests/ui/associated-type-bounds/nested-bounds-dont-eliminate-alias-bounds.rs @@ -1,7 +1,5 @@ //@ check-pass -#![feature(associated_type_bounds)] - trait Trait1 { type Assoc1: Bar; diff --git a/tests/ui/associated-type-bounds/no-gat-position.rs b/tests/ui/associated-type-bounds/no-gat-position.rs index 01740e6242e..5005c5027f4 100644 --- a/tests/ui/associated-type-bounds/no-gat-position.rs +++ b/tests/ui/associated-type-bounds/no-gat-position.rs @@ -1,5 +1,3 @@ -#![feature(associated_type_bounds)] - // Test for <https://github.com/rust-lang/rust/issues/119857>. pub trait Iter { diff --git a/tests/ui/associated-type-bounds/no-gat-position.stderr b/tests/ui/associated-type-bounds/no-gat-position.stderr index 5692b2c7d09..c348d33c3a9 100644 --- a/tests/ui/associated-type-bounds/no-gat-position.stderr +++ b/tests/ui/associated-type-bounds/no-gat-position.stderr @@ -1,5 +1,5 @@ error[E0229]: associated type bindings are not allowed here - --> $DIR/no-gat-position.rs:8:56 + --> $DIR/no-gat-position.rs:6:56 | LL | fn next<'a>(&'a mut self) -> Option<Self::Item<'a, As1: Copy>>; | ^^^^^^^^^ associated type not allowed here diff --git a/tests/ui/associated-type-bounds/overlaping-bound-suggestion.rs b/tests/ui/associated-type-bounds/overlaping-bound-suggestion.rs index 3853bc8594f..c0012564843 100644 --- a/tests/ui/associated-type-bounds/overlaping-bound-suggestion.rs +++ b/tests/ui/associated-type-bounds/overlaping-bound-suggestion.rs @@ -1,5 +1,4 @@ #![allow(bare_trait_objects)] -#![feature(associated_type_bounds)] trait Item { type Core; } diff --git a/tests/ui/associated-type-bounds/overlaping-bound-suggestion.stderr b/tests/ui/associated-type-bounds/overlaping-bound-suggestion.stderr index 03d72f2ae2c..39a2b98e2e2 100644 --- a/tests/ui/associated-type-bounds/overlaping-bound-suggestion.stderr +++ b/tests/ui/associated-type-bounds/overlaping-bound-suggestion.stderr @@ -1,11 +1,11 @@ error[E0191]: the value of the associated types `Item` and `IntoIter` in `IntoIterator` must be specified - --> $DIR/overlaping-bound-suggestion.rs:7:13 + --> $DIR/overlaping-bound-suggestion.rs:6:13 | LL | inner: <IntoIterator<Item: IntoIterator<Item: >>::IntoIterator as Item>::Core, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: specify the associated types: `IntoIterator<Item: IntoIterator<Item: >, Item = Type, IntoIter = Type>` error[E0223]: ambiguous associated type - --> $DIR/overlaping-bound-suggestion.rs:7:13 + --> $DIR/overlaping-bound-suggestion.rs:6:13 | LL | inner: <IntoIterator<Item: IntoIterator<Item: >>::IntoIterator as Item>::Core, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.rs b/tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.rs index 50a8cd8e04b..c23eff79ce2 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.rs +++ b/tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.rs @@ -9,11 +9,9 @@ trait Trait { fn foo<T: Trait<method(i32): Send>>() {} //~^ ERROR argument types not allowed with return type notation -//~| ERROR associated type bounds are unstable fn bar<T: Trait<method() -> (): Send>>() {} //~^ ERROR return type not allowed with return type notation -//~| ERROR associated type bounds are unstable fn baz<T: Trait<method(..): Send>>() {} //~^ ERROR return type notation uses `()` instead of `(..)` for elided arguments diff --git a/tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.stderr b/tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.stderr index 02bec24c628..d95249efe40 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.stderr +++ b/tests/ui/associated-type-bounds/return-type-notation/bad-inputs-and-output.stderr @@ -1,29 +1,9 @@ error: return type notation uses `()` instead of `(..)` for elided arguments - --> $DIR/bad-inputs-and-output.rs:18:24 + --> $DIR/bad-inputs-and-output.rs:16:24 | LL | fn baz<T: Trait<method(..): Send>>() {} | ^^ help: remove the `..` -error[E0658]: associated type bounds are unstable - --> $DIR/bad-inputs-and-output.rs:10:17 - | -LL | fn foo<T: Trait<method(i32): Send>>() {} - | ^^^^^^^^^^^^^^^^^ - | - = note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information - = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error[E0658]: associated type bounds are unstable - --> $DIR/bad-inputs-and-output.rs:14:17 - | -LL | fn bar<T: Trait<method() -> (): Send>>() {} - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information - = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes --> $DIR/bad-inputs-and-output.rs:3:12 | @@ -40,11 +20,10 @@ LL | fn foo<T: Trait<method(i32): Send>>() {} | ^^^^^ help: remove the input types: `()` error: return type not allowed with return type notation - --> $DIR/bad-inputs-and-output.rs:14:25 + --> $DIR/bad-inputs-and-output.rs:13:25 | LL | fn bar<T: Trait<method() -> (): Send>>() {} | ^^^^^^ help: remove the return type -error: aborting due to 5 previous errors; 1 warning emitted +error: aborting due to 3 previous errors; 1 warning emitted -For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.rs b/tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.rs index 0a98f0d2c8d..931e41bc840 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.rs +++ b/tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.rs @@ -1,11 +1,14 @@ //@ edition: 2021 //@ compile-flags: -Zunpretty=expanded +//@ check-pass + +// NOTE: This is not considered RTN syntax currently. +// This is simply parenthesized generics. trait Trait { async fn method() {} } fn foo<T: Trait<method(i32): Send>>() {} -//~^ ERROR associated type bounds are unstable fn main() {} diff --git a/tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.stderr b/tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.stderr deleted file mode 100644 index 3007240c3ab..00000000000 --- a/tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.stderr +++ /dev/null @@ -1,13 +0,0 @@ -error[E0658]: associated type bounds are unstable - --> $DIR/unpretty-parenthesized.rs:8:17 - | -LL | fn foo<T: Trait<method(i32): Send>>() {} - | ^^^^^^^^^^^^^^^^^ - | - = note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information - = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.stdout b/tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.stdout index 17c3b9580ca..87667553837 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.stdout +++ b/tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.stdout @@ -5,6 +5,10 @@ use std::prelude::rust_2021::*; extern crate std; //@ edition: 2021 //@ compile-flags: -Zunpretty=expanded +//@ check-pass + +// NOTE: This is not considered RTN syntax currently. +// This is simply parenthesized generics. trait Trait { async fn method() {} diff --git a/tests/ui/associated-type-bounds/rpit.rs b/tests/ui/associated-type-bounds/rpit.rs index 78710621cad..cb1d7f8fcc7 100644 --- a/tests/ui/associated-type-bounds/rpit.rs +++ b/tests/ui/associated-type-bounds/rpit.rs @@ -1,7 +1,5 @@ //@ run-pass -#![feature(associated_type_bounds)] - use std::ops::Add; trait Tr1 { type As1; fn mk(self) -> Self::As1; } diff --git a/tests/ui/associated-type-bounds/rpit.stderr b/tests/ui/associated-type-bounds/rpit.stderr index 76bd75bd2ca..1091a4c573b 100644 --- a/tests/ui/associated-type-bounds/rpit.stderr +++ b/tests/ui/associated-type-bounds/rpit.stderr @@ -1,5 +1,5 @@ warning: method `tr2` is never used - --> $DIR/rpit.rs:8:20 + --> $DIR/rpit.rs:6:20 | LL | trait Tr2<'a> { fn tr2(self) -> &'a Self; } | --- ^^^ diff --git a/tests/ui/associated-type-bounds/struct-bounds.rs b/tests/ui/associated-type-bounds/struct-bounds.rs index 2c46832cb99..0c8a52539f3 100644 --- a/tests/ui/associated-type-bounds/struct-bounds.rs +++ b/tests/ui/associated-type-bounds/struct-bounds.rs @@ -1,8 +1,6 @@ //@ run-pass #![allow(unused)] -#![feature(associated_type_bounds)] - trait Tr1 { type As1; } trait Tr2 { type As2; } trait Tr3 {} diff --git a/tests/ui/associated-type-bounds/supertrait-defines-ty.rs b/tests/ui/associated-type-bounds/supertrait-defines-ty.rs index 62b23b5fbab..ed1c1fa6f03 100644 --- a/tests/ui/associated-type-bounds/supertrait-defines-ty.rs +++ b/tests/ui/associated-type-bounds/supertrait-defines-ty.rs @@ -3,8 +3,6 @@ // Make sure that we don't look into associated type bounds when looking for // supertraits that define an associated type. Fixes #76593. -#![feature(associated_type_bounds)] - trait Load: Sized { type Blob; } diff --git a/tests/ui/associated-type-bounds/trait-alias-impl-trait.rs b/tests/ui/associated-type-bounds/trait-alias-impl-trait.rs index 6ca9f80ccaf..fb6a4fcbe97 100644 --- a/tests/ui/associated-type-bounds/trait-alias-impl-trait.rs +++ b/tests/ui/associated-type-bounds/trait-alias-impl-trait.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(dead_code)] -#![feature(associated_type_bounds)] #![feature(type_alias_impl_trait)] use std::ops::Add; diff --git a/tests/ui/associated-type-bounds/trait-params.rs b/tests/ui/associated-type-bounds/trait-params.rs index 6782d688126..72a445351e7 100644 --- a/tests/ui/associated-type-bounds/trait-params.rs +++ b/tests/ui/associated-type-bounds/trait-params.rs @@ -1,7 +1,5 @@ //@ build-pass (FIXME(62277): could be check-pass?) -#![feature(associated_type_bounds)] - use std::iter::Once; use std::ops::Range; diff --git a/tests/ui/associated-type-bounds/type-alias.rs b/tests/ui/associated-type-bounds/type-alias.rs index 819a7656a44..2dccb37f37f 100644 --- a/tests/ui/associated-type-bounds/type-alias.rs +++ b/tests/ui/associated-type-bounds/type-alias.rs @@ -1,7 +1,5 @@ //@ check-pass -#![feature(associated_type_bounds)] - type _TaWhere1<T> where T: Iterator<Item: Copy> = T; //~ WARNING type_alias_bounds type _TaWhere2<T> where T: Iterator<Item: 'static> = T; //~ WARNING type_alias_bounds type _TaWhere3<T> where T: Iterator<Item: 'static> = T; //~ WARNING type_alias_bounds diff --git a/tests/ui/associated-type-bounds/type-alias.stderr b/tests/ui/associated-type-bounds/type-alias.stderr index c22b80b889e..072c471467c 100644 --- a/tests/ui/associated-type-bounds/type-alias.stderr +++ b/tests/ui/associated-type-bounds/type-alias.stderr @@ -1,5 +1,5 @@ warning: where clauses are not enforced in type aliases - --> $DIR/type-alias.rs:5:25 + --> $DIR/type-alias.rs:3:25 | LL | type _TaWhere1<T> where T: Iterator<Item: Copy> = T; | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -12,7 +12,7 @@ LL + type _TaWhere1<T> = T; | warning: where clauses are not enforced in type aliases - --> $DIR/type-alias.rs:6:25 + --> $DIR/type-alias.rs:4:25 | LL | type _TaWhere2<T> where T: Iterator<Item: 'static> = T; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -24,7 +24,7 @@ LL + type _TaWhere2<T> = T; | warning: where clauses are not enforced in type aliases - --> $DIR/type-alias.rs:7:25 + --> $DIR/type-alias.rs:5:25 | LL | type _TaWhere3<T> where T: Iterator<Item: 'static> = T; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -36,7 +36,7 @@ LL + type _TaWhere3<T> = T; | warning: where clauses are not enforced in type aliases - --> $DIR/type-alias.rs:8:25 + --> $DIR/type-alias.rs:6:25 | LL | type _TaWhere4<T> where T: Iterator<Item: 'static + Copy + Send> = T; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -48,7 +48,7 @@ LL + type _TaWhere4<T> = T; | warning: where clauses are not enforced in type aliases - --> $DIR/type-alias.rs:9:25 + --> $DIR/type-alias.rs:7:25 | LL | type _TaWhere5<T> where T: Iterator<Item: for<'a> Into<&'a u8>> = T; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -60,7 +60,7 @@ LL + type _TaWhere5<T> = T; | warning: where clauses are not enforced in type aliases - --> $DIR/type-alias.rs:10:25 + --> $DIR/type-alias.rs:8:25 | LL | type _TaWhere6<T> where T: Iterator<Item: Iterator<Item: Copy>> = T; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -72,7 +72,7 @@ LL + type _TaWhere6<T> = T; | warning: bounds on generic parameters are not enforced in type aliases - --> $DIR/type-alias.rs:12:20 + --> $DIR/type-alias.rs:10:20 | LL | type _TaInline1<T: Iterator<Item: Copy>> = T; | ^^^^^^^^^^^^^^^^^^^^ @@ -84,7 +84,7 @@ LL + type _TaInline1<T> = T; | warning: bounds on generic parameters are not enforced in type aliases - --> $DIR/type-alias.rs:13:20 + --> $DIR/type-alias.rs:11:20 | LL | type _TaInline2<T: Iterator<Item: 'static>> = T; | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -96,7 +96,7 @@ LL + type _TaInline2<T> = T; | warning: bounds on generic parameters are not enforced in type aliases - --> $DIR/type-alias.rs:14:20 + --> $DIR/type-alias.rs:12:20 | LL | type _TaInline3<T: Iterator<Item: 'static>> = T; | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -108,7 +108,7 @@ LL + type _TaInline3<T> = T; | warning: bounds on generic parameters are not enforced in type aliases - --> $DIR/type-alias.rs:15:20 + --> $DIR/type-alias.rs:13:20 | LL | type _TaInline4<T: Iterator<Item: 'static + Copy + Send>> = T; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -120,7 +120,7 @@ LL + type _TaInline4<T> = T; | warning: bounds on generic parameters are not enforced in type aliases - --> $DIR/type-alias.rs:16:20 + --> $DIR/type-alias.rs:14:20 | LL | type _TaInline5<T: Iterator<Item: for<'a> Into<&'a u8>>> = T; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -132,7 +132,7 @@ LL + type _TaInline5<T> = T; | warning: bounds on generic parameters are not enforced in type aliases - --> $DIR/type-alias.rs:17:20 + --> $DIR/type-alias.rs:15:20 | LL | type _TaInline6<T: Iterator<Item: Iterator<Item: Copy>>> = T; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/associated-type-bounds/union-bounds.rs b/tests/ui/associated-type-bounds/union-bounds.rs index 8a7ba6f5ebf..b9b92a96fb0 100644 --- a/tests/ui/associated-type-bounds/union-bounds.rs +++ b/tests/ui/associated-type-bounds/union-bounds.rs @@ -1,7 +1,5 @@ //@ run-pass -#![feature(associated_type_bounds)] - #![allow(unused_assignments)] trait Tr1: Copy { type As1: Copy; } diff --git a/tests/ui/associated-types/issue-63591.rs b/tests/ui/associated-types/issue-63591.rs index 33826a24ddb..52464d94a23 100644 --- a/tests/ui/associated-types/issue-63591.rs +++ b/tests/ui/associated-types/issue-63591.rs @@ -1,6 +1,5 @@ //@ check-pass -#![feature(associated_type_bounds)] #![feature(impl_trait_in_assoc_type)] fn main() {} diff --git a/tests/ui/associated-types/substs-ppaux.normal.stderr b/tests/ui/associated-types/substs-ppaux.normal.stderr index a2647f66835..8d3146be560 100644 --- a/tests/ui/associated-types/substs-ppaux.normal.stderr +++ b/tests/ui/associated-types/substs-ppaux.normal.stderr @@ -1,47 +1,51 @@ error[E0308]: mismatched types - --> $DIR/substs-ppaux.rs:16:17 + --> $DIR/substs-ppaux.rs:23:17 | -LL | fn bar<'a, T>() where T: 'a {} - | --------------------------- associated function `bar` defined here +LL | / fn bar<'a, T>() +LL | | where +LL | | T: 'a, + | |______________- associated function `bar` defined here ... -LL | let x: () = <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>; - | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found fn item - | | - | expected due to this +LL | let x: () = <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>; + | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found fn item + | | + | expected due to this | = note: expected unit type `()` found fn item `fn() {<i8 as Foo<'static, 'static, u8>>::bar::<'static, char>}` help: use parentheses to call this associated function | -LL | let x: () = <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>(); - | ++ +LL | let x: () = <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>(); + | ++ error[E0308]: mismatched types - --> $DIR/substs-ppaux.rs:25:17 + --> $DIR/substs-ppaux.rs:31:17 | -LL | fn bar<'a, T>() where T: 'a {} - | --------------------------- associated function `bar` defined here +LL | / fn bar<'a, T>() +LL | | where +LL | | T: 'a, + | |______________- associated function `bar` defined here ... -LL | let x: () = <i8 as Foo<'static, 'static, u32>>::bar::<'static, char>; - | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found fn item - | | - | expected due to this +LL | let x: () = <i8 as Foo<'static, 'static, u32>>::bar::<'static, char>; + | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found fn item + | | + | expected due to this | = note: expected unit type `()` found fn item `fn() {<i8 as Foo<'static, 'static>>::bar::<'static, char>}` help: use parentheses to call this associated function | -LL | let x: () = <i8 as Foo<'static, 'static, u32>>::bar::<'static, char>(); - | ++ +LL | let x: () = <i8 as Foo<'static, 'static, u32>>::bar::<'static, char>(); + | ++ error[E0308]: mismatched types - --> $DIR/substs-ppaux.rs:33:17 + --> $DIR/substs-ppaux.rs:39:17 | LL | fn baz() {} | -------- associated function `baz` defined here ... -LL | let x: () = <i8 as Foo<'static, 'static, u8>>::baz; - | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found fn item +LL | let x: () = <i8 as Foo<'static, 'static, u8>>::baz; + | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found fn item | | | expected due to this | @@ -49,19 +53,21 @@ LL | let x: () = <i8 as Foo<'static, 'static, u8>>::baz; found fn item `fn() {<i8 as Foo<'static, 'static, u8>>::baz}` help: use parentheses to call this associated function | -LL | let x: () = <i8 as Foo<'static, 'static, u8>>::baz(); - | ++ +LL | let x: () = <i8 as Foo<'static, 'static, u8>>::baz(); + | ++ error[E0308]: mismatched types - --> $DIR/substs-ppaux.rs:41:17 + --> $DIR/substs-ppaux.rs:47:17 | -LL | fn foo<'z>() where &'z (): Sized { - | -------------------------------- function `foo` defined here +LL | / fn foo<'z>() +LL | | where +LL | | &'z (): Sized, + | |__________________- function `foo` defined here ... -LL | let x: () = foo::<'static>; - | -- ^^^^^^^^^^^^^^ expected `()`, found fn item - | | - | expected due to this +LL | let x: () = foo::<'static>; + | -- ^^^^^^^^^^^^^^ expected `()`, found fn item + | | + | expected due to this | = note: expected unit type `()` found fn item `fn() {foo::<'static>}` @@ -71,18 +77,18 @@ LL | let x: () = foo::<'static>(); | ++ error[E0277]: the trait bound `str: Foo<'_, '_, u8>` is not satisfied - --> $DIR/substs-ppaux.rs:49:6 + --> $DIR/substs-ppaux.rs:55:6 | LL | <str as Foo<u8>>::bar; | ^^^ the trait `Sized` is not implemented for `str`, which is required by `str: Foo<'_, '_, u8>` | note: required for `str` to implement `Foo<'_, '_, u8>` - --> $DIR/substs-ppaux.rs:11:17 + --> $DIR/substs-ppaux.rs:15:20 | -LL | impl<'a,'b,T,S> Foo<'a, 'b, S> for T {} - | - ^^^^^^^^^^^^^^ ^ - | | - | unsatisfied trait bound introduced here +LL | impl<'a, 'b, T, S> Foo<'a, 'b, S> for T {} + | - ^^^^^^^^^^^^^^ ^ + | | + | unsatisfied trait bound introduced here error: aborting due to 5 previous errors diff --git a/tests/ui/associated-types/substs-ppaux.rs b/tests/ui/associated-types/substs-ppaux.rs index 077ca764e24..302a6b345e4 100644 --- a/tests/ui/associated-types/substs-ppaux.rs +++ b/tests/ui/associated-types/substs-ppaux.rs @@ -3,37 +3,43 @@ // //@[verbose] compile-flags: -Z verbose-internals -trait Foo<'b, 'c, S=u32> { - fn bar<'a, T>() where T: 'a {} +trait Foo<'b, 'c, S = u32> { + fn bar<'a, T>() + where + T: 'a, + { + } fn baz() {} } -impl<'a,'b,T,S> Foo<'a, 'b, S> for T {} +impl<'a, 'b, T, S> Foo<'a, 'b, S> for T {} fn main() {} -fn foo<'z>() where &'z (): Sized { - let x: () = <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>; +fn foo<'z>() +where + &'z (): Sized, +{ + let x: () = <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>; //[verbose]~^ ERROR mismatched types //[verbose]~| expected unit type `()` - //[verbose]~| found fn item `fn() {<i8 as Foo<ReStatic, ReStatic, u8>>::bar::<ReStatic, char>}` + //[verbose]~| found fn item `fn() {<i8 as Foo<'static, 'static, u8>>::bar::<'static, char>}` //[normal]~^^^^ ERROR mismatched types //[normal]~| expected unit type `()` //[normal]~| found fn item `fn() {<i8 as Foo<'static, 'static, u8>>::bar::<'static, char>}` - - let x: () = <i8 as Foo<'static, 'static, u32>>::bar::<'static, char>; + let x: () = <i8 as Foo<'static, 'static, u32>>::bar::<'static, char>; //[verbose]~^ ERROR mismatched types //[verbose]~| expected unit type `()` - //[verbose]~| found fn item `fn() {<i8 as Foo<ReStatic, ReStatic>>::bar::<ReStatic, char>}` + //[verbose]~| found fn item `fn() {<i8 as Foo<'static, 'static>>::bar::<'static, char>}` //[normal]~^^^^ ERROR mismatched types //[normal]~| expected unit type `()` //[normal]~| found fn item `fn() {<i8 as Foo<'static, 'static>>::bar::<'static, char>}` - let x: () = <i8 as Foo<'static, 'static, u8>>::baz; + let x: () = <i8 as Foo<'static, 'static, u8>>::baz; //[verbose]~^ ERROR mismatched types //[verbose]~| expected unit type `()` - //[verbose]~| found fn item `fn() {<i8 as Foo<ReStatic, ReStatic, u8>>::baz}` + //[verbose]~| found fn item `fn() {<i8 as Foo<'static, 'static, u8>>::baz}` //[normal]~^^^^ ERROR mismatched types //[normal]~| expected unit type `()` //[normal]~| found fn item `fn() {<i8 as Foo<'static, 'static, u8>>::baz}` @@ -41,7 +47,7 @@ fn foo<'z>() where &'z (): Sized { let x: () = foo::<'static>; //[verbose]~^ ERROR mismatched types //[verbose]~| expected unit type `()` - //[verbose]~| found fn item `fn() {foo::<ReStatic>}` + //[verbose]~| found fn item `fn() {foo::<'static>}` //[normal]~^^^^ ERROR mismatched types //[normal]~| expected unit type `()` //[normal]~| found fn item `fn() {foo::<'static>}` diff --git a/tests/ui/associated-types/substs-ppaux.verbose.stderr b/tests/ui/associated-types/substs-ppaux.verbose.stderr index d32f44ccd64..0b5f449e576 100644 --- a/tests/ui/associated-types/substs-ppaux.verbose.stderr +++ b/tests/ui/associated-types/substs-ppaux.verbose.stderr @@ -1,88 +1,94 @@ error[E0308]: mismatched types - --> $DIR/substs-ppaux.rs:16:17 + --> $DIR/substs-ppaux.rs:23:17 | -LL | fn bar<'a, T>() where T: 'a {} - | --------------------------- associated function `bar` defined here +LL | / fn bar<'a, T>() +LL | | where +LL | | T: 'a, + | |______________- associated function `bar` defined here ... -LL | let x: () = <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>; - | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found fn item - | | - | expected due to this +LL | let x: () = <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>; + | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found fn item + | | + | expected due to this | = note: expected unit type `()` - found fn item `fn() {<i8 as Foo<ReStatic, ReStatic, u8>>::bar::<ReStatic, char>}` + found fn item `fn() {<i8 as Foo<'static, 'static, u8>>::bar::<'static, char>}` help: use parentheses to call this associated function | -LL | let x: () = <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>(); - | ++ +LL | let x: () = <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>(); + | ++ error[E0308]: mismatched types - --> $DIR/substs-ppaux.rs:25:17 + --> $DIR/substs-ppaux.rs:31:17 | -LL | fn bar<'a, T>() where T: 'a {} - | --------------------------- associated function `bar` defined here +LL | / fn bar<'a, T>() +LL | | where +LL | | T: 'a, + | |______________- associated function `bar` defined here ... -LL | let x: () = <i8 as Foo<'static, 'static, u32>>::bar::<'static, char>; - | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found fn item - | | - | expected due to this +LL | let x: () = <i8 as Foo<'static, 'static, u32>>::bar::<'static, char>; + | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found fn item + | | + | expected due to this | = note: expected unit type `()` - found fn item `fn() {<i8 as Foo<ReStatic, ReStatic>>::bar::<ReStatic, char>}` + found fn item `fn() {<i8 as Foo<'static, 'static>>::bar::<'static, char>}` help: use parentheses to call this associated function | -LL | let x: () = <i8 as Foo<'static, 'static, u32>>::bar::<'static, char>(); - | ++ +LL | let x: () = <i8 as Foo<'static, 'static, u32>>::bar::<'static, char>(); + | ++ error[E0308]: mismatched types - --> $DIR/substs-ppaux.rs:33:17 + --> $DIR/substs-ppaux.rs:39:17 | LL | fn baz() {} | -------- associated function `baz` defined here ... -LL | let x: () = <i8 as Foo<'static, 'static, u8>>::baz; - | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found fn item +LL | let x: () = <i8 as Foo<'static, 'static, u8>>::baz; + | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found fn item | | | expected due to this | = note: expected unit type `()` - found fn item `fn() {<i8 as Foo<ReStatic, ReStatic, u8>>::baz}` + found fn item `fn() {<i8 as Foo<'static, 'static, u8>>::baz}` help: use parentheses to call this associated function | -LL | let x: () = <i8 as Foo<'static, 'static, u8>>::baz(); - | ++ +LL | let x: () = <i8 as Foo<'static, 'static, u8>>::baz(); + | ++ error[E0308]: mismatched types - --> $DIR/substs-ppaux.rs:41:17 + --> $DIR/substs-ppaux.rs:47:17 | -LL | fn foo<'z>() where &'z (): Sized { - | -------------------------------- function `foo` defined here +LL | / fn foo<'z>() +LL | | where +LL | | &'z (): Sized, + | |__________________- function `foo` defined here ... -LL | let x: () = foo::<'static>; - | -- ^^^^^^^^^^^^^^ expected `()`, found fn item - | | - | expected due to this +LL | let x: () = foo::<'static>; + | -- ^^^^^^^^^^^^^^ expected `()`, found fn item + | | + | expected due to this | = note: expected unit type `()` - found fn item `fn() {foo::<ReStatic>}` + found fn item `fn() {foo::<'static>}` help: use parentheses to call this function | LL | let x: () = foo::<'static>(); | ++ error[E0277]: the trait bound `str: Foo<'?0, '?1, u8>` is not satisfied - --> $DIR/substs-ppaux.rs:49:6 + --> $DIR/substs-ppaux.rs:55:6 | LL | <str as Foo<u8>>::bar; | ^^^ the trait `Sized` is not implemented for `str`, which is required by `str: Foo<'?0, '?1, u8>` | note: required for `str` to implement `Foo<'?0, '?1, u8>` - --> $DIR/substs-ppaux.rs:11:17 + --> $DIR/substs-ppaux.rs:15:20 | -LL | impl<'a,'b,T,S> Foo<'a, 'b, S> for T {} - | - ^^^^^^^^^^^^^^ ^ - | | - | unsatisfied trait bound introduced here +LL | impl<'a, 'b, T, S> Foo<'a, 'b, S> for T {} + | - ^^^^^^^^^^^^^^ ^ + | | + | unsatisfied trait bound introduced here error: aborting due to 5 previous errors diff --git a/tests/ui/async-await/async-await-let-else.stderr b/tests/ui/async-await/async-await-let-else.stderr index 057906b49a3..0952be2abe5 100644 --- a/tests/ui/async-await/async-await-let-else.stderr +++ b/tests/ui/async-await/async-await-let-else.stderr @@ -38,7 +38,6 @@ LL | async fn bar2<T>(_: T) -> ! { LL | | panic!() LL | | } | |_^ - = note: required because it captures the following types: `impl Future<Output = !>` note: required because it's used within this `async` fn body --> $DIR/async-await-let-else.rs:18:32 | diff --git a/tests/ui/async-await/async-closures/def-path.stderr b/tests/ui/async-await/async-closures/def-path.stderr index dae45825f37..0a1e30c1253 100644 --- a/tests/ui/async-await/async-closures/def-path.stderr +++ b/tests/ui/async-await/async-closures/def-path.stderr @@ -5,11 +5,11 @@ LL | let x = async || {}; | -- the expected `async` closure body LL | LL | let () = x(); - | ^^ --- this expression has type `{static main::{closure#0}::{closure#0}<?7t> upvar_tys=?15t witness=?6t}` + | ^^ --- this expression has type `{static main::{closure#0}::{closure#0}<?17t> upvar_tys=?16t witness=?6t}` | | | expected `async` closure body, found `()` | - = note: expected `async` closure body `{static main::{closure#0}::{closure#0}<?7t> upvar_tys=?15t witness=?6t}` + = note: expected `async` closure body `{static main::{closure#0}::{closure#0}<?17t> upvar_tys=?16t witness=?6t}` found unit type `()` error: aborting due to 1 previous error diff --git a/tests/ui/async-await/async-fn/dyn-pos.rs b/tests/ui/async-await/async-fn/dyn-pos.rs index e817a1b518f..772c7d15cfd 100644 --- a/tests/ui/async-await/async-fn/dyn-pos.rs +++ b/tests/ui/async-await/async-fn/dyn-pos.rs @@ -4,9 +4,6 @@ fn foo(x: &dyn async Fn()) {} //~^ ERROR the trait `AsyncFn` cannot be made into an object -//~| ERROR the trait `AsyncFn` cannot be made into an object -//~| ERROR the trait `AsyncFn` cannot be made into an object -//~| ERROR the trait `AsyncFn` cannot be made into an object //~| ERROR the trait `AsyncFnMut` cannot be made into an object //~| ERROR the trait `AsyncFnMut` cannot be made into an object //~| ERROR the trait `AsyncFnMut` cannot be made into an object diff --git a/tests/ui/async-await/async-fn/dyn-pos.stderr b/tests/ui/async-await/async-fn/dyn-pos.stderr index 488c5d06938..3bef5a27897 100644 --- a/tests/ui/async-await/async-fn/dyn-pos.stderr +++ b/tests/ui/async-await/async-fn/dyn-pos.stderr @@ -1,17 +1,3 @@ -error[E0038]: the trait `AsyncFn` cannot be made into an object - --> $DIR/dyn-pos.rs:5:16 - | -LL | fn foo(x: &dyn async Fn()) {} - | ^^^^^^^^^^ `AsyncFn` cannot be made into an object - | -note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> - --> $SRC_DIR/core/src/ops/async_function.rs:LL:COL - | - = note: the trait cannot be made into an object because it contains the generic associated type `CallFuture` - = help: the following types implement the trait, consider defining an enum where each variant holds one of these types, implementing `AsyncFn` for this new enum and using it instead: - &F - std::boxed::Box<F, A> - error[E0038]: the trait `AsyncFnMut` cannot be made into an object --> $DIR/dyn-pos.rs:5:16 | @@ -21,27 +7,12 @@ LL | fn foo(x: &dyn async Fn()) {} note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> --> $SRC_DIR/core/src/ops/async_function.rs:LL:COL | - = note: the trait cannot be made into an object because it contains the generic associated type `CallMutFuture` + = note: the trait cannot be made into an object because it contains the generic associated type `CallRefFuture` = help: the following types implement the trait, consider defining an enum where each variant holds one of these types, implementing `AsyncFnMut` for this new enum and using it instead: &F &mut F std::boxed::Box<F, A> -error[E0038]: the trait `AsyncFn` cannot be made into an object - --> $DIR/dyn-pos.rs:5:16 - | -LL | fn foo(x: &dyn async Fn()) {} - | ^^^^^^^^^^ `AsyncFn` cannot be made into an object - | -note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> - --> $SRC_DIR/core/src/ops/async_function.rs:LL:COL - | - = note: the trait cannot be made into an object because it contains the generic associated type `CallFuture` - = help: the following types implement the trait, consider defining an enum where each variant holds one of these types, implementing `AsyncFn` for this new enum and using it instead: - &F - std::boxed::Box<F, A> - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - error[E0038]: the trait `AsyncFnMut` cannot be made into an object --> $DIR/dyn-pos.rs:5:16 | @@ -51,28 +22,13 @@ LL | fn foo(x: &dyn async Fn()) {} note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> --> $SRC_DIR/core/src/ops/async_function.rs:LL:COL | - = note: the trait cannot be made into an object because it contains the generic associated type `CallMutFuture` + = note: the trait cannot be made into an object because it contains the generic associated type `CallRefFuture` = help: the following types implement the trait, consider defining an enum where each variant holds one of these types, implementing `AsyncFnMut` for this new enum and using it instead: &F &mut F std::boxed::Box<F, A> = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -error[E0038]: the trait `AsyncFn` cannot be made into an object - --> $DIR/dyn-pos.rs:5:16 - | -LL | fn foo(x: &dyn async Fn()) {} - | ^^^^^^^^^^ `AsyncFn` cannot be made into an object - | -note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> - --> $SRC_DIR/core/src/ops/async_function.rs:LL:COL - | - = note: the trait cannot be made into an object because it contains the generic associated type `CallFuture` - = help: the following types implement the trait, consider defining an enum where each variant holds one of these types, implementing `AsyncFn` for this new enum and using it instead: - &F - std::boxed::Box<F, A> - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - error[E0038]: the trait `AsyncFnMut` cannot be made into an object --> $DIR/dyn-pos.rs:5:16 | @@ -82,7 +38,7 @@ LL | fn foo(x: &dyn async Fn()) {} note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> --> $SRC_DIR/core/src/ops/async_function.rs:LL:COL | - = note: the trait cannot be made into an object because it contains the generic associated type `CallMutFuture` + = note: the trait cannot be made into an object because it contains the generic associated type `CallRefFuture` = help: the following types implement the trait, consider defining an enum where each variant holds one of these types, implementing `AsyncFnMut` for this new enum and using it instead: &F &mut F @@ -98,14 +54,11 @@ LL | fn foo(x: &dyn async Fn()) {} note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> --> $SRC_DIR/core/src/ops/async_function.rs:LL:COL | - = note: the trait cannot be made into an object because it contains the generic associated type `CallFuture` - ::: $SRC_DIR/core/src/ops/async_function.rs:LL:COL - | - = note: the trait cannot be made into an object because it contains the generic associated type `CallMutFuture` + = note: the trait cannot be made into an object because it contains the generic associated type `CallRefFuture` = help: the following types implement the trait, consider defining an enum where each variant holds one of these types, implementing `AsyncFn` for this new enum and using it instead: &F std::boxed::Box<F, A> -error: aborting due to 7 previous errors +error: aborting due to 4 previous errors For more information about this error, try `rustc --explain E0038`. diff --git a/tests/ui/async-await/in-trait/async-example-desugared-boxed.stderr b/tests/ui/async-await/in-trait/async-example-desugared-boxed.stderr index 54aba77cc05..36f90c7bcd5 100644 --- a/tests/ui/async-await/in-trait/async-example-desugared-boxed.stderr +++ b/tests/ui/async-await/in-trait/async-example-desugared-boxed.stderr @@ -8,11 +8,13 @@ LL | fn foo(&self) -> Pin<Box<dyn Future<Output = i32> + '_>> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: add `#[allow(refining_impl_trait)]` if it is intended for this to be part of the public API of this crate + = note: we are soliciting feedback, see issue #121718 <https://github.com/rust-lang/rust/issues/121718> for more information note: the lint level is defined here --> $DIR/async-example-desugared-boxed.rs:13:12 | LL | #[warn(refining_impl_trait)] | ^^^^^^^^^^^^^^^^^^^ + = note: `#[warn(refining_impl_trait_reachable)]` implied by `#[warn(refining_impl_trait)]` help: replace the return type so that it matches the trait | LL | fn foo(&self) -> impl Future<Output = i32> { diff --git a/tests/ui/async-await/in-trait/async-example-desugared-manual.stderr b/tests/ui/async-await/in-trait/async-example-desugared-manual.stderr index d94afd92c56..8e39559071f 100644 --- a/tests/ui/async-await/in-trait/async-example-desugared-manual.stderr +++ b/tests/ui/async-await/in-trait/async-example-desugared-manual.stderr @@ -8,11 +8,13 @@ LL | fn foo(&self) -> MyFuture { | ^^^^^^^^ | = note: add `#[allow(refining_impl_trait)]` if it is intended for this to be part of the public API of this crate + = note: we are soliciting feedback, see issue #121718 <https://github.com/rust-lang/rust/issues/121718> for more information note: the lint level is defined here --> $DIR/async-example-desugared-manual.rs:21:12 | LL | #[warn(refining_impl_trait)] | ^^^^^^^^^^^^^^^^^^^ + = note: `#[warn(refining_impl_trait_reachable)]` implied by `#[warn(refining_impl_trait)]` help: replace the return type so that it matches the trait | LL | fn foo(&self) -> impl Future<Output = i32> { diff --git a/tests/ui/async-await/in-trait/return-not-existing-pair.rs b/tests/ui/async-await/in-trait/return-not-existing-pair.rs index 68be1358f81..3889efe1f2a 100644 --- a/tests/ui/async-await/in-trait/return-not-existing-pair.rs +++ b/tests/ui/async-await/in-trait/return-not-existing-pair.rs @@ -9,8 +9,7 @@ trait MyTrait<'a, 'b, T> { impl<'a, 'b, T, U> MyTrait<T> for U { //~^ ERROR: implicit elided lifetime not allowed here [E0726] async fn foo(_: T) -> (&'a U, &'b T) {} - //~^ ERROR: method `foo` has a `&self` declaration in the trait, but not in the impl [E0186] - //~| ERROR: mismatched types [E0308] + //~^ ERROR: mismatched types [E0308] } fn main() {} diff --git a/tests/ui/async-await/in-trait/return-not-existing-pair.stderr b/tests/ui/async-await/in-trait/return-not-existing-pair.stderr index 4694e608097..13d3606abba 100644 --- a/tests/ui/async-await/in-trait/return-not-existing-pair.stderr +++ b/tests/ui/async-await/in-trait/return-not-existing-pair.stderr @@ -15,15 +15,6 @@ error[E0412]: cannot find type `ConnImpl` in this scope LL | async fn foo(&'a self, key: &'b T) -> (&'a ConnImpl, &'b T); | ^^^^^^^^ not found in this scope -error[E0186]: method `foo` has a `&self` declaration in the trait, but not in the impl - --> $DIR/return-not-existing-pair.rs:11:5 - | -LL | async fn foo(&'a self, key: &'b T) -> (&'a ConnImpl, &'b T); - | ------------------------------------------------------------ `&self` used in trait -... -LL | async fn foo(_: T) -> (&'a U, &'b T) {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&self` in impl - error[E0308]: mismatched types --> $DIR/return-not-existing-pair.rs:11:42 | @@ -33,7 +24,7 @@ LL | async fn foo(_: T) -> (&'a U, &'b T) {} = note: expected tuple `(&'a U, &'b T)` found unit type `()` -error: aborting due to 4 previous errors +error: aborting due to 3 previous errors -Some errors have detailed explanations: E0186, E0308, E0412, E0726. -For more information about an error, try `rustc --explain E0186`. +Some errors have detailed explanations: E0308, E0412, E0726. +For more information about an error, try `rustc --explain E0308`. diff --git a/tests/ui/async-await/in-trait/unconstrained-impl-region.rs b/tests/ui/async-await/in-trait/unconstrained-impl-region.rs index 9382c232364..95ba1f3f277 100644 --- a/tests/ui/async-await/in-trait/unconstrained-impl-region.rs +++ b/tests/ui/async-await/in-trait/unconstrained-impl-region.rs @@ -14,6 +14,7 @@ impl<'a> Actor for () { //~^ ERROR the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates type Message = &'a (); async fn on_mount(self, _: impl Inbox<&'a ()>) {} + //~^ ERROR the trait bound `impl Inbox<&'a ()>: Inbox<&'a ()>` is not satisfied } fn main() {} diff --git a/tests/ui/async-await/in-trait/unconstrained-impl-region.stderr b/tests/ui/async-await/in-trait/unconstrained-impl-region.stderr index ef7e4ef0eb8..66819d1fcf7 100644 --- a/tests/ui/async-await/in-trait/unconstrained-impl-region.stderr +++ b/tests/ui/async-await/in-trait/unconstrained-impl-region.stderr @@ -1,9 +1,26 @@ +error[E0277]: the trait bound `impl Inbox<&'a ()>: Inbox<&'a ()>` is not satisfied + --> $DIR/unconstrained-impl-region.rs:16:5 + | +LL | async fn on_mount(self, _: impl Inbox<&'a ()>) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Inbox<&'a ()>` is not implemented for `impl Inbox<&'a ()>` + | +note: required by a bound in `<() as Actor>::on_mount` + --> $DIR/unconstrained-impl-region.rs:16:37 + | +LL | async fn on_mount(self, _: impl Inbox<&'a ()>) {} + | ^^^^^^^^^^^^^ required by this bound in `<() as Actor>::on_mount` +help: consider further restricting this bound + | +LL | async fn on_mount(self, _: impl Inbox<&'a ()> + Inbox<&'a ()>) {} + | +++++++++++++++ + error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates --> $DIR/unconstrained-impl-region.rs:13:6 | LL | impl<'a> Actor for () { | ^^ unconstrained lifetime parameter -error: aborting due to 1 previous error +error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0207`. +Some errors have detailed explanations: E0207, E0277. +For more information about an error, try `rustc --explain E0207`. diff --git a/tests/ui/async-await/issue-68112.stderr b/tests/ui/async-await/issue-68112.stderr index f92ac5dd0bc..96fc1633cc9 100644 --- a/tests/ui/async-await/issue-68112.stderr +++ b/tests/ui/async-await/issue-68112.stderr @@ -58,7 +58,6 @@ note: required because it appears within the type `impl Future<Output = Arc<RefC | LL | fn make_non_send_future2() -> impl Future<Output = Arc<RefCell<i32>>> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: required because it captures the following types: `impl Future<Output = Arc<RefCell<i32>>>`, `Ready<i32>` note: required because it's used within this `async` block --> $DIR/issue-68112.rs:57:20 | diff --git a/tests/ui/async-await/issue-70935-complex-spans.stderr b/tests/ui/async-await/issue-70935-complex-spans.stderr index 8dc3f476ec8..85c0c0c3088 100644 --- a/tests/ui/async-await/issue-70935-complex-spans.stderr +++ b/tests/ui/async-await/issue-70935-complex-spans.stderr @@ -25,7 +25,6 @@ LL | async fn baz<T>(_c: impl FnMut() -> T) where T: Future<Output=()> { | ___________________________________________________________________^ LL | | } | |_^ - = note: required because it captures the following types: `impl Future<Output = ()>` note: required because it's used within this `async` block --> $DIR/issue-70935-complex-spans.rs:18:5 | @@ -63,7 +62,6 @@ LL | async fn baz<T>(_c: impl FnMut() -> T) where T: Future<Output=()> { | ___________________________________________________________________^ LL | | } | |_^ - = note: required because it captures the following types: `impl Future<Output = ()>` note: required because it's used within this `async` block --> $DIR/issue-70935-complex-spans.rs:18:5 | diff --git a/tests/ui/async-await/issues/issue-65159.rs b/tests/ui/async-await/issues/issue-65159.rs index 781f8fe88d4..78492d55fda 100644 --- a/tests/ui/async-await/issues/issue-65159.rs +++ b/tests/ui/async-await/issues/issue-65159.rs @@ -4,6 +4,7 @@ async fn copy() -> Result<()> //~^ ERROR enum takes 2 generic arguments +//~| ERROR enum takes 2 generic arguments { Ok(()) } diff --git a/tests/ui/async-await/issues/issue-65159.stderr b/tests/ui/async-await/issues/issue-65159.stderr index 19512116a66..834927060b1 100644 --- a/tests/ui/async-await/issues/issue-65159.stderr +++ b/tests/ui/async-await/issues/issue-65159.stderr @@ -11,6 +11,20 @@ help: add missing generic argument LL | async fn copy() -> Result<(), E> | +++ -error: aborting due to 1 previous error +error[E0107]: enum takes 2 generic arguments but 1 generic argument was supplied + --> $DIR/issue-65159.rs:5:20 + | +LL | async fn copy() -> Result<()> + | ^^^^^^ -- supplied 1 generic argument + | | + | expected 2 generic arguments + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` +help: add missing generic argument + | +LL | async fn copy() -> Result<(), E> + | +++ + +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0107`. diff --git a/tests/ui/async-await/issues/issue-67893.stderr b/tests/ui/async-await/issues/issue-67893.stderr index 12bbfc12552..0c28aea44bb 100644 --- a/tests/ui/async-await/issues/issue-67893.stderr +++ b/tests/ui/async-await/issues/issue-67893.stderr @@ -12,7 +12,6 @@ LL | pub async fn run() { | ------------------ within this `impl Future<Output = ()>` | = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `MutexGuard<'_, ()>`, which is required by `impl Future<Output = ()>: Send` - = note: required because it captures the following types: `Arc<Mutex<()>>`, `MutexGuard<'_, ()>`, `impl Future<Output = ()>` note: required because it's used within this `async` fn body --> $DIR/auxiliary/issue_67893.rs:9:20 | diff --git a/tests/ui/async-await/partial-drop-partial-reinit.rs b/tests/ui/async-await/partial-drop-partial-reinit.rs index 36b3f2bc9ff..b72552ed324 100644 --- a/tests/ui/async-await/partial-drop-partial-reinit.rs +++ b/tests/ui/async-await/partial-drop-partial-reinit.rs @@ -8,7 +8,6 @@ fn main() { //~| NOTE cannot be sent //~| NOTE bound introduced by //~| NOTE appears within the type - //~| NOTE captures the following types } fn gimme_send<T: Send>(t: T) { diff --git a/tests/ui/async-await/partial-drop-partial-reinit.stderr b/tests/ui/async-await/partial-drop-partial-reinit.stderr index a6140c6db82..0bd7d50b941 100644 --- a/tests/ui/async-await/partial-drop-partial-reinit.stderr +++ b/tests/ui/async-await/partial-drop-partial-reinit.stderr @@ -11,9 +11,8 @@ LL | async fn foo() { | = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `NotSend`, which is required by `impl Future<Output = ()>: Send` = note: required because it appears within the type `(NotSend,)` - = note: required because it captures the following types: `(NotSend,)`, `impl Future<Output = ()>` note: required because it's used within this `async` fn body - --> $DIR/partial-drop-partial-reinit.rs:28:16 + --> $DIR/partial-drop-partial-reinit.rs:27:16 | LL | async fn foo() { | ________________^ @@ -25,7 +24,7 @@ LL | | bar().await; LL | | } | |_^ note: required by a bound in `gimme_send` - --> $DIR/partial-drop-partial-reinit.rs:14:18 + --> $DIR/partial-drop-partial-reinit.rs:13:18 | LL | fn gimme_send<T: Send>(t: T) { | ^^^^ required by this bound in `gimme_send` diff --git a/tests/ui/async-await/send-bound-async-closure.rs b/tests/ui/async-await/send-bound-async-closure.rs index 2732fa5d466..e4a9ae4cc75 100644 --- a/tests/ui/async-await/send-bound-async-closure.rs +++ b/tests/ui/async-await/send-bound-async-closure.rs @@ -1,5 +1,8 @@ //@ edition: 2021 //@ check-pass +//@ revisions: current next +//@ ignore-compare-mode-next-solver (explicit revisions) +//@[next] compile-flags: -Znext-solver // This test verifies that we do not create a query cycle when typechecking has several inference // variables that point to the same coroutine interior type. diff --git a/tests/ui/attributes/validation-on-associated-items-issue-121537.rs b/tests/ui/attributes/validation-on-associated-items-issue-121537.rs new file mode 100644 index 00000000000..60e5a21eec7 --- /dev/null +++ b/tests/ui/attributes/validation-on-associated-items-issue-121537.rs @@ -0,0 +1,7 @@ +trait MyTrait { + #[doc = MyTrait] + //~^ ERROR attribute value must be a literal + fn myfun(); +} + +fn main() {} diff --git a/tests/ui/attributes/validation-on-associated-items-issue-121537.stderr b/tests/ui/attributes/validation-on-associated-items-issue-121537.stderr new file mode 100644 index 00000000000..9c37bb82317 --- /dev/null +++ b/tests/ui/attributes/validation-on-associated-items-issue-121537.stderr @@ -0,0 +1,8 @@ +error: attribute value must be a literal + --> $DIR/validation-on-associated-items-issue-121537.rs:2:13 + | +LL | #[doc = MyTrait] + | ^^^^^^^ + +error: aborting due to 1 previous error + diff --git a/tests/ui/borrowck/clone-on-ref.fixed b/tests/ui/borrowck/clone-on-ref.fixed new file mode 100644 index 00000000000..b6927ba590e --- /dev/null +++ b/tests/ui/borrowck/clone-on-ref.fixed @@ -0,0 +1,32 @@ +//@ run-rustfix +fn foo<T: Default + Clone>(list: &mut Vec<T>) { + let mut cloned_items = Vec::new(); + for v in list.iter() { + cloned_items.push(v.clone()) + } + list.push(T::default()); + //~^ ERROR cannot borrow `*list` as mutable because it is also borrowed as immutable + drop(cloned_items); +} +fn bar<T: std::fmt::Display + Clone>(x: T) { + let a = &x; + let b = a.clone(); + drop(x); + //~^ ERROR cannot move out of `x` because it is borrowed + println!("{b}"); +} +#[derive(Debug)] +#[derive(Clone)] +struct A; +fn qux(x: A) { + let a = &x; + let b = a.clone(); + drop(x); + //~^ ERROR cannot move out of `x` because it is borrowed + println!("{b:?}"); +} +fn main() { + foo(&mut vec![1, 2, 3]); + bar(""); + qux(A); +} diff --git a/tests/ui/borrowck/clone-on-ref.rs b/tests/ui/borrowck/clone-on-ref.rs new file mode 100644 index 00000000000..f8c94d3cce3 --- /dev/null +++ b/tests/ui/borrowck/clone-on-ref.rs @@ -0,0 +1,31 @@ +//@ run-rustfix +fn foo<T: Default>(list: &mut Vec<T>) { + let mut cloned_items = Vec::new(); + for v in list.iter() { + cloned_items.push(v.clone()) + } + list.push(T::default()); + //~^ ERROR cannot borrow `*list` as mutable because it is also borrowed as immutable + drop(cloned_items); +} +fn bar<T: std::fmt::Display>(x: T) { + let a = &x; + let b = a.clone(); + drop(x); + //~^ ERROR cannot move out of `x` because it is borrowed + println!("{b}"); +} +#[derive(Debug)] +struct A; +fn qux(x: A) { + let a = &x; + let b = a.clone(); + drop(x); + //~^ ERROR cannot move out of `x` because it is borrowed + println!("{b:?}"); +} +fn main() { + foo(&mut vec![1, 2, 3]); + bar(""); + qux(A); +} diff --git a/tests/ui/borrowck/clone-on-ref.stderr b/tests/ui/borrowck/clone-on-ref.stderr new file mode 100644 index 00000000000..ee4fcadf55a --- /dev/null +++ b/tests/ui/borrowck/clone-on-ref.stderr @@ -0,0 +1,64 @@ +error[E0502]: cannot borrow `*list` as mutable because it is also borrowed as immutable + --> $DIR/clone-on-ref.rs:7:5 + | +LL | for v in list.iter() { + | ---- immutable borrow occurs here +LL | cloned_items.push(v.clone()) + | ------- this call doesn't do anything, the result is still `&T` because `T` doesn't implement `Clone` +LL | } +LL | list.push(T::default()); + | ^^^^^^^^^^^^^^^^^^^^^^^ mutable borrow occurs here +LL | +LL | drop(cloned_items); + | ------------ immutable borrow later used here + | +help: consider further restricting this bound + | +LL | fn foo<T: Default + Clone>(list: &mut Vec<T>) { + | +++++++ + +error[E0505]: cannot move out of `x` because it is borrowed + --> $DIR/clone-on-ref.rs:14:10 + | +LL | fn bar<T: std::fmt::Display>(x: T) { + | - binding `x` declared here +LL | let a = &x; + | -- borrow of `x` occurs here +LL | let b = a.clone(); + | ------- this call doesn't do anything, the result is still `&T` because `T` doesn't implement `Clone` +LL | drop(x); + | ^ move out of `x` occurs here +LL | +LL | println!("{b}"); + | --- borrow later used here + | +help: consider further restricting this bound + | +LL | fn bar<T: std::fmt::Display + Clone>(x: T) { + | +++++++ + +error[E0505]: cannot move out of `x` because it is borrowed + --> $DIR/clone-on-ref.rs:23:10 + | +LL | fn qux(x: A) { + | - binding `x` declared here +LL | let a = &x; + | -- borrow of `x` occurs here +LL | let b = a.clone(); + | ------- this call doesn't do anything, the result is still `&A` because `A` doesn't implement `Clone` +LL | drop(x); + | ^ move out of `x` occurs here +LL | +LL | println!("{b:?}"); + | ----- borrow later used here + | +help: consider annotating `A` with `#[derive(Clone)]` + | +LL + #[derive(Clone)] +LL | struct A; + | + +error: aborting due to 3 previous errors + +Some errors have detailed explanations: E0502, E0505. +For more information about an error, try `rustc --explain E0502`. diff --git a/tests/ui/borrowck/ice-mutability-error-slicing-121807.rs b/tests/ui/borrowck/ice-mutability-error-slicing-121807.rs new file mode 100644 index 00000000000..bbdd895d763 --- /dev/null +++ b/tests/ui/borrowck/ice-mutability-error-slicing-121807.rs @@ -0,0 +1,27 @@ +//@ edition:2015 +// test for ICE #121807 begin <= end (12 <= 11) when slicing 'Self::Assoc<'_>' +// fixed by #122749 + +trait MemoryUnit { // ERROR: not all trait items implemented, missing: `read_word` + extern "C" fn read_word(&mut self) -> u8; + extern "C" fn read_dword(Self::Assoc<'_>) -> u16; + //~^ WARN anonymous parameters are deprecated and will be removed in the next edition + //~^^ WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018! + //~^^^ ERROR associated type `Assoc` not found for `Self` +} + +struct ROM {} + +impl MemoryUnit for ROM { +//~^ ERROR not all trait items implemented, missing: `read_word` + extern "C" fn read_dword(&'s self) -> u16 { + //~^ ERROR use of undeclared lifetime name `'s` + //~^^ ERROR method `read_dword` has a `&self` declaration in the impl, but not in the trait + let a16 = self.read_word() as u16; + let b16 = self.read_word() as u16; + + (b16 << 8) | a16 + } +} + +pub fn main() {} diff --git a/tests/ui/borrowck/ice-mutability-error-slicing-121807.stderr b/tests/ui/borrowck/ice-mutability-error-slicing-121807.stderr new file mode 100644 index 00000000000..3a6b8008fce --- /dev/null +++ b/tests/ui/borrowck/ice-mutability-error-slicing-121807.stderr @@ -0,0 +1,53 @@ +error[E0261]: use of undeclared lifetime name `'s` + --> $DIR/ice-mutability-error-slicing-121807.rs:17:31 + | +LL | extern "C" fn read_dword(&'s self) -> u16 { + | ^^ undeclared lifetime + | +help: consider introducing lifetime `'s` here + | +LL | extern "C" fn read_dword<'s>(&'s self) -> u16 { + | ++++ +help: consider introducing lifetime `'s` here + | +LL | impl<'s> MemoryUnit for ROM { + | ++++ + +warning: anonymous parameters are deprecated and will be removed in the next edition + --> $DIR/ice-mutability-error-slicing-121807.rs:7:30 + | +LL | extern "C" fn read_dword(Self::Assoc<'_>) -> u16; + | ^^^^^^^^^^^^^^^ help: try naming the parameter or explicitly ignoring it: `_: Self::Assoc<'_>` + | + = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018! + = note: for more information, see issue #41686 <https://github.com/rust-lang/rust/issues/41686> + = note: `#[warn(anonymous_parameters)]` on by default + +error[E0220]: associated type `Assoc` not found for `Self` + --> $DIR/ice-mutability-error-slicing-121807.rs:7:36 + | +LL | extern "C" fn read_dword(Self::Assoc<'_>) -> u16; + | ^^^^^ associated type `Assoc` not found + +error[E0185]: method `read_dword` has a `&self` declaration in the impl, but not in the trait + --> $DIR/ice-mutability-error-slicing-121807.rs:17:5 + | +LL | extern "C" fn read_dword(Self::Assoc<'_>) -> u16; + | ------------------------------------------------- trait method declared without `&self` +... +LL | extern "C" fn read_dword(&'s self) -> u16 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `&self` used in impl + +error[E0046]: not all trait items implemented, missing: `read_word` + --> $DIR/ice-mutability-error-slicing-121807.rs:15:1 + | +LL | extern "C" fn read_word(&mut self) -> u8; + | ----------------------------------------- `read_word` from trait +... +LL | impl MemoryUnit for ROM { + | ^^^^^^^^^^^^^^^^^^^^^^^ missing `read_word` in implementation + +error: aborting due to 4 previous errors; 1 warning emitted + +Some errors have detailed explanations: E0046, E0185, E0220, E0261. +For more information about an error, try `rustc --explain E0046`. diff --git a/tests/ui/borrowck/issue-109271-pass-self-into-closure.stderr b/tests/ui/borrowck/issue-109271-pass-self-into-closure.stderr index 4e3bf1d7042..a66281a188d 100644 --- a/tests/ui/borrowck/issue-109271-pass-self-into-closure.stderr +++ b/tests/ui/borrowck/issue-109271-pass-self-into-closure.stderr @@ -42,8 +42,7 @@ LL | v.call(|(), this: &mut S| { | | LL | | LL | | -LL | | -LL | | _ = v; +... | LL | | v.set(); | | - first borrow occurs due to use of `v` in closure ... | diff --git a/tests/ui/borrowck/issue-82126-mismatched-subst-and-hir.rs b/tests/ui/borrowck/issue-82126-mismatched-subst-and-hir.rs index 15be5fb3fac..ebffa237f96 100644 --- a/tests/ui/borrowck/issue-82126-mismatched-subst-and-hir.rs +++ b/tests/ui/borrowck/issue-82126-mismatched-subst-and-hir.rs @@ -15,7 +15,9 @@ impl MarketMultiplier { async fn buy_lock(coroutine: &Mutex<MarketMultiplier>) -> LockedMarket<'_> { //~^ ERROR struct takes 0 lifetime arguments but 1 lifetime argument was supplied - //~^^ ERROR struct takes 1 generic argument but 0 generic arguments were supplied + //~| ERROR struct takes 1 generic argument but 0 generic arguments were supplied + //~| ERROR struct takes 0 lifetime arguments but 1 lifetime argument was supplied + //~| ERROR struct takes 1 generic argument but 0 generic arguments were supplied LockedMarket(coroutine.lock().unwrap().buy()) } diff --git a/tests/ui/borrowck/issue-82126-mismatched-subst-and-hir.stderr b/tests/ui/borrowck/issue-82126-mismatched-subst-and-hir.stderr index 516c1d065e6..c0b6dcd1512 100644 --- a/tests/ui/borrowck/issue-82126-mismatched-subst-and-hir.stderr +++ b/tests/ui/borrowck/issue-82126-mismatched-subst-and-hir.stderr @@ -7,7 +7,7 @@ LL | async fn buy_lock(coroutine: &Mutex<MarketMultiplier>) -> LockedMarket<'_> | expected 0 lifetime arguments | note: struct defined here, with 0 lifetime parameters - --> $DIR/issue-82126-mismatched-subst-and-hir.rs:22:8 + --> $DIR/issue-82126-mismatched-subst-and-hir.rs:24:8 | LL | struct LockedMarket<T>(T); | ^^^^^^^^^^^^ @@ -19,7 +19,7 @@ LL | async fn buy_lock(coroutine: &Mutex<MarketMultiplier>) -> LockedMarket<'_> | ^^^^^^^^^^^^ expected 1 generic argument | note: struct defined here, with 1 generic parameter: `T` - --> $DIR/issue-82126-mismatched-subst-and-hir.rs:22:8 + --> $DIR/issue-82126-mismatched-subst-and-hir.rs:24:8 | LL | struct LockedMarket<T>(T); | ^^^^^^^^^^^^ - @@ -28,6 +28,38 @@ help: add missing generic argument LL | async fn buy_lock(coroutine: &Mutex<MarketMultiplier>) -> LockedMarket<'_, T> { | +++ -error: aborting due to 2 previous errors +error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supplied + --> $DIR/issue-82126-mismatched-subst-and-hir.rs:16:59 + | +LL | async fn buy_lock(coroutine: &Mutex<MarketMultiplier>) -> LockedMarket<'_> { + | ^^^^^^^^^^^^---- help: remove these generics + | | + | expected 0 lifetime arguments + | +note: struct defined here, with 0 lifetime parameters + --> $DIR/issue-82126-mismatched-subst-and-hir.rs:24:8 + | +LL | struct LockedMarket<T>(T); + | ^^^^^^^^^^^^ + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error[E0107]: struct takes 1 generic argument but 0 generic arguments were supplied + --> $DIR/issue-82126-mismatched-subst-and-hir.rs:16:59 + | +LL | async fn buy_lock(coroutine: &Mutex<MarketMultiplier>) -> LockedMarket<'_> { + | ^^^^^^^^^^^^ expected 1 generic argument + | +note: struct defined here, with 1 generic parameter: `T` + --> $DIR/issue-82126-mismatched-subst-and-hir.rs:24:8 + | +LL | struct LockedMarket<T>(T); + | ^^^^^^^^^^^^ - + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` +help: add missing generic argument + | +LL | async fn buy_lock(coroutine: &Mutex<MarketMultiplier>) -> LockedMarket<'_, T> { + | +++ + +error: aborting due to 4 previous errors For more information about this error, try `rustc --explain E0107`. diff --git a/tests/ui/borrowck/mut-borrow-in-loop-2.fixed b/tests/ui/borrowck/mut-borrow-in-loop-2.fixed deleted file mode 100644 index cff3c372cdb..00000000000 --- a/tests/ui/borrowck/mut-borrow-in-loop-2.fixed +++ /dev/null @@ -1,35 +0,0 @@ -//@ run-rustfix -#![allow(dead_code)] - -struct Events<R>(R); - -struct Other; - -pub trait Trait<T> { - fn handle(value: T) -> Self; -} - -// Blanket impl. (If you comment this out, compiler figures out that it -// is passing an `&mut` to a method that must be expecting an `&mut`, -// and injects an auto-reborrow.) -impl<T, U> Trait<U> for T where T: From<U> { - fn handle(_: U) -> Self { unimplemented!() } -} - -impl<'a, R> Trait<&'a mut Events<R>> for Other { - fn handle(_: &'a mut Events<R>) -> Self { unimplemented!() } -} - -fn this_compiles<'a, R>(value: &'a mut Events<R>) { - for _ in 0..3 { - Other::handle(&mut *value); - } -} - -fn this_does_not<'a, R>(value: &'a mut Events<R>) { - for _ in 0..3 { - Other::handle(&mut *value); //~ ERROR use of moved value: `value` - } -} - -fn main() {} diff --git a/tests/ui/borrowck/mut-borrow-in-loop-2.rs b/tests/ui/borrowck/mut-borrow-in-loop-2.rs index ba79b12042f..f530dfca1a3 100644 --- a/tests/ui/borrowck/mut-borrow-in-loop-2.rs +++ b/tests/ui/borrowck/mut-borrow-in-loop-2.rs @@ -1,4 +1,3 @@ -//@ run-rustfix #![allow(dead_code)] struct Events<R>(R); diff --git a/tests/ui/borrowck/mut-borrow-in-loop-2.stderr b/tests/ui/borrowck/mut-borrow-in-loop-2.stderr index 7b9a946f3ca..7a569d1da41 100644 --- a/tests/ui/borrowck/mut-borrow-in-loop-2.stderr +++ b/tests/ui/borrowck/mut-borrow-in-loop-2.stderr @@ -1,5 +1,5 @@ error[E0382]: use of moved value: `value` - --> $DIR/mut-borrow-in-loop-2.rs:31:23 + --> $DIR/mut-borrow-in-loop-2.rs:30:23 | LL | fn this_does_not<'a, R>(value: &'a mut Events<R>) { | ----- move occurs because `value` has type `&mut Events<R>`, which does not implement the `Copy` trait @@ -9,12 +9,18 @@ LL | Other::handle(value); | ^^^^^ value moved here, in previous iteration of loop | note: consider changing this parameter type in function `handle` to borrow instead if owning the value isn't necessary - --> $DIR/mut-borrow-in-loop-2.rs:9:22 + --> $DIR/mut-borrow-in-loop-2.rs:8:22 | LL | fn handle(value: T) -> Self; | ------ ^ this parameter takes ownership of the value | | | in this function +help: consider moving the expression out of the loop so it is only moved once + | +LL ~ let mut value = Other::handle(value); +LL ~ for _ in 0..3 { +LL ~ value; + | help: consider creating a fresh reborrow of `value` here | LL | Other::handle(&mut *value); diff --git a/tests/ui/cast/unsized-union-ice.rs b/tests/ui/cast/unsized-union-ice.rs new file mode 100644 index 00000000000..11aefe57f1d --- /dev/null +++ b/tests/ui/cast/unsized-union-ice.rs @@ -0,0 +1,14 @@ +// Regression test for https://github.com/rust-lang/rust/issues/122581 +// This used to ICE, because the union was unsized and the pointer casting code +// assumed that non-struct ADTs must be sized. + +union Union { + val: std::mem::ManuallyDrop<[u8]>, + //~^ ERROR the size for values of type `[u8]` cannot be known at compilation time +} + +fn cast(ptr: *const ()) -> *const Union { + ptr as _ +} + +fn main() {} diff --git a/tests/ui/cast/unsized-union-ice.stderr b/tests/ui/cast/unsized-union-ice.stderr new file mode 100644 index 00000000000..05f86457829 --- /dev/null +++ b/tests/ui/cast/unsized-union-ice.stderr @@ -0,0 +1,23 @@ +error[E0277]: the size for values of type `[u8]` cannot be known at compilation time + --> $DIR/unsized-union-ice.rs:6:10 + | +LL | val: std::mem::ManuallyDrop<[u8]>, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: within `ManuallyDrop<[u8]>`, the trait `Sized` is not implemented for `[u8]`, which is required by `ManuallyDrop<[u8]>: Sized` +note: required because it appears within the type `ManuallyDrop<[u8]>` + --> $SRC_DIR/core/src/mem/manually_drop.rs:LL:COL + = note: no field of a union may have a dynamically sized type + = help: change the field's type to have a statically known size +help: borrowed types always have a statically known size + | +LL | val: &std::mem::ManuallyDrop<[u8]>, + | + +help: the `Box` type always has a statically known size and allocates its contents in the heap + | +LL | val: Box<std::mem::ManuallyDrop<[u8]>>, + | ++++ + + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/cfg/cfg-false-feature.stderr b/tests/ui/cfg/cfg-false-feature.stderr index 9309b59ca59..542aeaf5caf 100644 --- a/tests/ui/cfg/cfg-false-feature.stderr +++ b/tests/ui/cfg/cfg-false-feature.stderr @@ -1,15 +1,3 @@ -warning: trait aliases are experimental - --> $DIR/cfg-false-feature.rs:12:1 - | -LL | trait A = Clone; - | ^^^^^^^^^^^^^^^^ - | - = note: see issue #41517 <https://github.com/rust-lang/rust/issues/41517> for more information - = help: add `#![feature(trait_alias)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - = warning: unstable syntax can change at any point in the future, causing a hard error! - = note: for more information, see issue #65860 <https://github.com/rust-lang/rust/issues/65860> - warning: box pattern syntax is experimental --> $DIR/cfg-false-feature.rs:16:9 | @@ -22,5 +10,17 @@ LL | let box _ = Box::new(0); = warning: unstable syntax can change at any point in the future, causing a hard error! = note: for more information, see issue #65860 <https://github.com/rust-lang/rust/issues/65860> +warning: trait aliases are experimental + --> $DIR/cfg-false-feature.rs:12:1 + | +LL | trait A = Clone; + | ^^^^^^^^^^^^^^^^ + | + = note: see issue #41517 <https://github.com/rust-lang/rust/issues/41517> for more information + = help: add `#![feature(trait_alias)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + = warning: unstable syntax can change at any point in the future, causing a hard error! + = note: for more information, see issue #65860 <https://github.com/rust-lang/rust/issues/65860> + warning: 2 warnings emitted diff --git a/tests/ui/check-static-values-constraints.stderr b/tests/ui/check-static-values-constraints.stderr index e7532de5647..dee1f2b1210 100644 --- a/tests/ui/check-static-values-constraints.stderr +++ b/tests/ui/check-static-values-constraints.stderr @@ -36,8 +36,11 @@ LL | field2: SafeEnum::Variant4("str".to_string()), | ^^^^^^^^^^^ | = note: calls in statics are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable = note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell +help: add `#![feature(const_trait_impl)]` to the crate attributes to enable + | +LL + #![feature(const_trait_impl)] + | error[E0010]: allocations are not allowed in statics --> $DIR/check-static-values-constraints.rs:96:5 diff --git a/tests/ui/codegen/target-cpus.rs b/tests/ui/codegen/target-cpus.rs index 85a940f9f74..2d46e00f803 100644 --- a/tests/ui/codegen/target-cpus.rs +++ b/tests/ui/codegen/target-cpus.rs @@ -1,4 +1,3 @@ //@ needs-llvm-components: webassembly -//@ min-llvm-version: 17 //@ compile-flags: --print=target-cpus --target=wasm32-unknown-unknown //@ check-pass diff --git a/tests/ui/codemap_tests/huge_multispan_highlight.rs b/tests/ui/codemap_tests/huge_multispan_highlight.rs index 623c59081d0..c2bd393589e 100644 --- a/tests/ui/codemap_tests/huge_multispan_highlight.rs +++ b/tests/ui/codemap_tests/huge_multispan_highlight.rs @@ -1,5 +1,11 @@ +//@ compile-flags: --error-format=human --color=always +//@ ignore-windows +// Temporary until next release: +//@ ignore-stage2 fn main() { - let x = "foo"; + let _ = match true { + true => ( + // last line shown in multispan header @@ -87,5 +93,148 @@ fn main() { - let y = &mut x; //~ ERROR cannot borrow + + ), + false => " + + + + + + + + + + + + + + + + + + + + + + ", + }; + let _ = match true { + true => ( + + 1 // last line shown in multispan header + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ), + false => " + + + 1 last line shown in multispan + + + + + + + + + + + + + + + + + + + + ", + }; } diff --git a/tests/ui/codemap_tests/huge_multispan_highlight.stderr b/tests/ui/codemap_tests/huge_multispan_highlight.stderr deleted file mode 100644 index d2923875c94..00000000000 --- a/tests/ui/codemap_tests/huge_multispan_highlight.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable - --> $DIR/huge_multispan_highlight.rs:90:13 - | -LL | let y = &mut x; - | ^^^^^^ cannot borrow as mutable - | -help: consider changing this to be mutable - | -LL | let mut x = "foo"; - | +++ - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0596`. diff --git a/tests/ui/codemap_tests/huge_multispan_highlight.svg b/tests/ui/codemap_tests/huge_multispan_highlight.svg new file mode 100644 index 00000000000..f26a2bd7275 --- /dev/null +++ b/tests/ui/codemap_tests/huge_multispan_highlight.svg @@ -0,0 +1,116 @@ +<svg width="750px" height="848px" xmlns="http://www.w3.org/2000/svg"> + <style> + .fg { fill: #AAAAAA } + .bg { background: #000000 } + .fg-ansi256-009 { fill: #FF5555 } + .fg-ansi256-012 { fill: #5555FF } + .container { + padding: 0 10px; + line-height: 18px; + } + .bold { font-weight: bold; } + tspan { + font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace; + white-space: pre; + line-height: 18px; + } + </style> + + <rect width="100%" height="100%" y="0" rx="4.5" class="bg" /> + + <text xml:space="preserve" class="container fg"> + <tspan x="10px" y="28px"><tspan class="fg-ansi256-009 bold">error[E0308]</tspan><tspan class="bold">: `match` arms have incompatible types</tspan> +</tspan> + <tspan x="10px" y="46px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/huge_multispan_highlight.rs:98:18</tspan> +</tspan> + <tspan x="10px" y="64px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="82px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> let _ = match true {</tspan> +</tspan> + <tspan x="10px" y="100px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">| </tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">----------</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">`match` arms have incompatible types</tspan> +</tspan> + <tspan x="10px" y="118px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> true => (</tspan> +</tspan> + <tspan x="10px" y="136px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">| </tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">_________________-</tspan> +</tspan> + <tspan x="10px" y="154px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> // last line shown in multispan header</tspan> +</tspan> + <tspan x="10px" y="172px"><tspan class="fg-ansi256-012 bold">...</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="190px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="208px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> ),</tspan> +</tspan> + <tspan x="10px" y="226px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">| </tspan><tspan class="fg-ansi256-012 bold">|_________-</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">this is found to be of type `()`</tspan> +</tspan> + <tspan x="10px" y="244px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> false => "</tspan> +</tspan> + <tspan x="10px" y="262px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">| </tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">__________________^</tspan> +</tspan> + <tspan x="10px" y="280px"><tspan class="fg-ansi256-012 bold">...</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">|</tspan> +</tspan> + <tspan x="10px" y="298px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">|</tspan> +</tspan> + <tspan x="10px" y="316px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">|</tspan><tspan> ",</tspan> +</tspan> + <tspan x="10px" y="334px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">| </tspan><tspan class="fg-ansi256-009 bold">|_________^</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">expected `()`, found `&str`</tspan> +</tspan> + <tspan x="10px" y="352px"> +</tspan> + <tspan x="10px" y="370px"><tspan class="fg-ansi256-009 bold">error[E0308]</tspan><tspan class="bold">: `match` arms have incompatible types</tspan> +</tspan> + <tspan x="10px" y="388px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/huge_multispan_highlight.rs:215:18</tspan> +</tspan> + <tspan x="10px" y="406px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="424px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> let _ = match true {</tspan> +</tspan> + <tspan x="10px" y="442px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">| </tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">----------</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">`match` arms have incompatible types</tspan> +</tspan> + <tspan x="10px" y="460px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> true => (</tspan> +</tspan> + <tspan x="10px" y="478px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">| </tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">_________________-</tspan> +</tspan> + <tspan x="10px" y="496px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="514px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> 1 // last line shown in multispan header</tspan> +</tspan> + <tspan x="10px" y="532px"><tspan class="fg-ansi256-012 bold">...</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="550px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="568px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> ),</tspan> +</tspan> + <tspan x="10px" y="586px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">| </tspan><tspan class="fg-ansi256-012 bold">|_________-</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">this is found to be of type `{integer}`</tspan> +</tspan> + <tspan x="10px" y="604px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> false => "</tspan> +</tspan> + <tspan x="10px" y="622px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">| </tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">__________________^</tspan> +</tspan> + <tspan x="10px" y="640px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">|</tspan> +</tspan> + <tspan x="10px" y="658px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">|</tspan> +</tspan> + <tspan x="10px" y="676px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">|</tspan><tspan> 1 last line shown in multispan</tspan> +</tspan> + <tspan x="10px" y="694px"><tspan class="fg-ansi256-012 bold">...</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">|</tspan> +</tspan> + <tspan x="10px" y="712px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">|</tspan> +</tspan> + <tspan x="10px" y="730px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">|</tspan><tspan> ",</tspan> +</tspan> + <tspan x="10px" y="748px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">| </tspan><tspan class="fg-ansi256-009 bold">|_________^</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">expected integer, found `&str`</tspan> +</tspan> + <tspan x="10px" y="766px"> +</tspan> + <tspan x="10px" y="784px"><tspan class="fg-ansi256-009 bold">error</tspan><tspan class="bold">: aborting due to 2 previous errors</tspan> +</tspan> + <tspan x="10px" y="802px"> +</tspan> + <tspan x="10px" y="820px"><tspan class="bold">For more information about this error, try `rustc --explain E0308`.</tspan> +</tspan> + <tspan x="10px" y="838px"> +</tspan> + </text> + +</svg> diff --git a/tests/ui/coherence/occurs-check/associated-type.next.stderr b/tests/ui/coherence/occurs-check/associated-type.next.stderr index 50b83b90b0b..7443459b830 100644 --- a/tests/ui/coherence/occurs-check/associated-type.next.stderr +++ b/tests/ui/coherence/occurs-check/associated-type.next.stderr @@ -1,7 +1,7 @@ -WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) } -WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) } -WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) } -WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) } +WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, '^0.Named(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), "'a")], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) } +WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, '^0.Named(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), "'a")], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) } +WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, '^0.Named(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), "'a")], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) } +WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, '^0.Named(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), "'a")], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) } error[E0119]: conflicting implementations of trait `Overlap<for<'a> fn(&'a (), ())>` for type `for<'a> fn(&'a (), ())` --> $DIR/associated-type.rs:31:1 | diff --git a/tests/ui/coherence/occurs-check/associated-type.old.stderr b/tests/ui/coherence/occurs-check/associated-type.old.stderr index 655809b827e..38a02c906d4 100644 --- a/tests/ui/coherence/occurs-check/associated-type.old.stderr +++ b/tests/ui/coherence/occurs-check/associated-type.old.stderr @@ -1,11 +1,11 @@ -WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) } -WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, RePlaceholder(!2_BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) } -WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) } -WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, RePlaceholder(!2_BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) } -WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) } -WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, RePlaceholder(!2_BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) } -WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) } -WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, RePlaceholder(!2_BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) } +WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, '^0.Named(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), "'a")], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) } +WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, !2_0.Named(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), "'a")], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) } +WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, '^0.Named(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), "'a")], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) } +WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, !2_0.Named(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), "'a")], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) } +WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, '^0.Named(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), "'a")], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) } +WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, !2_0.Named(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), "'a")], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) } +WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, '^0.Named(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), "'a")], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) } +WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [*const ?1t, !2_0.Named(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), "'a")], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) } error[E0119]: conflicting implementations of trait `Overlap<for<'a> fn(&'a (), _)>` for type `for<'a> fn(&'a (), _)` --> $DIR/associated-type.rs:31:1 | diff --git a/tests/ui/compiletest-self-test/auxiliary/print-it-works.rs b/tests/ui/compiletest-self-test/auxiliary/print-it-works.rs new file mode 100644 index 00000000000..09411eb121c --- /dev/null +++ b/tests/ui/compiletest-self-test/auxiliary/print-it-works.rs @@ -0,0 +1,3 @@ +fn main() { + println!("it works"); +} diff --git a/tests/ui/compiletest-self-test/test-aux-bin.rs b/tests/ui/compiletest-self-test/test-aux-bin.rs new file mode 100644 index 00000000000..9e01e3ffabf --- /dev/null +++ b/tests/ui/compiletest-self-test/test-aux-bin.rs @@ -0,0 +1,9 @@ +//@ ignore-cross-compile because we run the compiled code +//@ aux-bin: print-it-works.rs +//@ run-pass + +fn main() { + let stdout = + std::process::Command::new("auxiliary/bin/print-it-works").output().unwrap().stdout; + assert_eq!(stdout, b"it works\n"); +} diff --git a/tests/ui/const-generics/adt_const_params/suggest_feature_only_when_possible.rs b/tests/ui/const-generics/adt_const_params/suggest_feature_only_when_possible.rs index a83830178d4..0d2e65c45ea 100644 --- a/tests/ui/const-generics/adt_const_params/suggest_feature_only_when_possible.rs +++ b/tests/ui/const-generics/adt_const_params/suggest_feature_only_when_possible.rs @@ -5,11 +5,16 @@ // Can never be used as const generics. fn uwu_0<const N: &'static mut ()>() {} //~^ ERROR: forbidden as the type of a const generic +//~| HELP: add `#![feature(adt_const_params)]` +//~| HELP: add `#![feature(adt_const_params)]` +//~| HELP: add `#![feature(adt_const_params)]` +//~| HELP: add `#![feature(adt_const_params)]` +//~| HELP: add `#![feature(adt_const_params)]` +//~| HELP: add `#![feature(adt_const_params)]` // Needs the feature but can be used, so suggest adding the feature. fn owo_0<const N: &'static u32>() {} //~^ ERROR: forbidden as the type of a const generic -//~^^ HELP: add `#![feature(adt_const_params)]` // Can only be used in const generics with changes. struct Meow { @@ -18,22 +23,17 @@ struct Meow { fn meow_0<const N: Meow>() {} //~^ ERROR: forbidden as the type of a const generic -//~^^ HELP: add `#![feature(adt_const_params)]` fn meow_1<const N: &'static Meow>() {} //~^ ERROR: forbidden as the type of a const generic -//~^^ HELP: add `#![feature(adt_const_params)]` fn meow_2<const N: [Meow; 100]>() {} //~^ ERROR: forbidden as the type of a const generic -//~^^ HELP: add `#![feature(adt_const_params)]` fn meow_3<const N: (Meow, u8)>() {} //~^ ERROR: forbidden as the type of a const generic -//~^^ HELP: add `#![feature(adt_const_params)]` // This is suboptimal that it thinks it can be used // but better to suggest the feature to the user. fn meow_4<const N: (Meow, String)>() {} //~^ ERROR: forbidden as the type of a const generic -//~^^ HELP: add `#![feature(adt_const_params)]` // Non-local ADT that does not impl `ConstParamTy` fn nya_0<const N: String>() {} diff --git a/tests/ui/const-generics/adt_const_params/suggest_feature_only_when_possible.stderr b/tests/ui/const-generics/adt_const_params/suggest_feature_only_when_possible.stderr index 04527e3158e..cd4349623d7 100644 --- a/tests/ui/const-generics/adt_const_params/suggest_feature_only_when_possible.stderr +++ b/tests/ui/const-generics/adt_const_params/suggest_feature_only_when_possible.stderr @@ -7,58 +7,76 @@ LL | fn uwu_0<const N: &'static mut ()>() {} = note: the only supported types are integers, `bool` and `char` error: `&'static u32` is forbidden as the type of a const generic parameter - --> $DIR/suggest_feature_only_when_possible.rs:10:19 + --> $DIR/suggest_feature_only_when_possible.rs:16:19 | LL | fn owo_0<const N: &'static u32>() {} | ^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: `Meow` is forbidden as the type of a const generic parameter - --> $DIR/suggest_feature_only_when_possible.rs:19:20 + --> $DIR/suggest_feature_only_when_possible.rs:24:20 | LL | fn meow_0<const N: Meow>() {} | ^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: `&'static Meow` is forbidden as the type of a const generic parameter - --> $DIR/suggest_feature_only_when_possible.rs:22:20 + --> $DIR/suggest_feature_only_when_possible.rs:26:20 | LL | fn meow_1<const N: &'static Meow>() {} | ^^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: `[Meow; 100]` is forbidden as the type of a const generic parameter - --> $DIR/suggest_feature_only_when_possible.rs:25:20 + --> $DIR/suggest_feature_only_when_possible.rs:28:20 | LL | fn meow_2<const N: [Meow; 100]>() {} | ^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: `(Meow, u8)` is forbidden as the type of a const generic parameter - --> $DIR/suggest_feature_only_when_possible.rs:28:20 + --> $DIR/suggest_feature_only_when_possible.rs:30:20 | LL | fn meow_3<const N: (Meow, u8)>() {} | ^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: `(Meow, String)` is forbidden as the type of a const generic parameter - --> $DIR/suggest_feature_only_when_possible.rs:34:20 + --> $DIR/suggest_feature_only_when_possible.rs:35:20 | LL | fn meow_4<const N: (Meow, String)>() {} | ^^^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: `String` is forbidden as the type of a const generic parameter --> $DIR/suggest_feature_only_when_possible.rs:39:19 diff --git a/tests/ui/const-generics/const-param-elided-lifetime.min.stderr b/tests/ui/const-generics/const-param-elided-lifetime.min.stderr index ffe45285988..1c81b14f8f5 100644 --- a/tests/ui/const-generics/const-param-elided-lifetime.min.stderr +++ b/tests/ui/const-generics/const-param-elided-lifetime.min.stderr @@ -35,7 +35,10 @@ LL | struct A<const N: &u8>; | ^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: `&u8` is forbidden as the type of a const generic parameter --> $DIR/const-param-elided-lifetime.rs:14:15 @@ -44,7 +47,10 @@ LL | impl<const N: &u8> A<N> { | ^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: `&u8` is forbidden as the type of a const generic parameter --> $DIR/const-param-elided-lifetime.rs:22:15 @@ -53,7 +59,10 @@ LL | impl<const N: &u8> B for A<N> {} | ^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: `&u8` is forbidden as the type of a const generic parameter --> $DIR/const-param-elided-lifetime.rs:26:17 @@ -62,7 +71,10 @@ LL | fn bar<const N: &u8>() {} | ^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: `&u8` is forbidden as the type of a const generic parameter --> $DIR/const-param-elided-lifetime.rs:17:21 @@ -71,7 +83,10 @@ LL | fn foo<const M: &u8>(&self) {} | ^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: aborting due to 10 previous errors diff --git a/tests/ui/const-generics/const-param-type-depends-on-const-param.min.stderr b/tests/ui/const-generics/const-param-type-depends-on-const-param.min.stderr index daeeadeed7c..fcc86b9ac33 100644 --- a/tests/ui/const-generics/const-param-type-depends-on-const-param.min.stderr +++ b/tests/ui/const-generics/const-param-type-depends-on-const-param.min.stderr @@ -21,7 +21,10 @@ LL | pub struct Dependent<const N: usize, const X: [u8; N]>([(); N]); | ^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: `[u8; N]` is forbidden as the type of a const generic parameter --> $DIR/const-param-type-depends-on-const-param.rs:15:35 @@ -30,7 +33,10 @@ LL | pub struct SelfDependent<const N: [u8; N]>; | ^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: aborting due to 4 previous errors diff --git a/tests/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.min.stderr b/tests/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.min.stderr index 1f4b892e20f..1f67a5c09f1 100644 --- a/tests/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.min.stderr +++ b/tests/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.min.stderr @@ -23,7 +23,10 @@ LL | struct B<const CFG: Config> { | ^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: aborting due to 3 previous errors diff --git a/tests/ui/const-generics/generic_const_exprs/const_kind_expr/issue_114151.rs b/tests/ui/const-generics/generic_const_exprs/const_kind_expr/issue_114151.rs index 9cdb4158d2b..e575d0dc9b4 100644 --- a/tests/ui/const-generics/generic_const_exprs/const_kind_expr/issue_114151.rs +++ b/tests/ui/const-generics/generic_const_exprs/const_kind_expr/issue_114151.rs @@ -19,8 +19,8 @@ where //~^^ ERROR: unconstrained generic constant //~^^^ ERROR: function takes 1 generic argument but 2 generic arguments were supplied //~^^^^ ERROR: unconstrained generic constant - //~^^^^^ ERROR: unconstrained generic constant `{const expr}` - //~^^^^^^ ERROR: unconstrained generic constant `{const expr}` + //~^^^^^ ERROR: unconstrained generic constant `L + 1 + L` + //~^^^^^^ ERROR: unconstrained generic constant `L + 1` } fn main() {} diff --git a/tests/ui/const-generics/generic_const_exprs/const_kind_expr/issue_114151.stderr b/tests/ui/const-generics/generic_const_exprs/const_kind_expr/issue_114151.stderr index 14c58f8d0da..9a8aa222dc1 100644 --- a/tests/ui/const-generics/generic_const_exprs/const_kind_expr/issue_114151.stderr +++ b/tests/ui/const-generics/generic_const_exprs/const_kind_expr/issue_114151.stderr @@ -52,19 +52,17 @@ LL | | } LL | | }], | |_____^ required by this bound in `foo` -error: unconstrained generic constant `{const expr}` +error: unconstrained generic constant `L + 1 + L` --> $DIR/issue_114151.rs:17:5 | LL | foo::<_, L>([(); L + 1 + L]); | ^^^^^^^^^^^ -error: unconstrained generic constant `{const expr}` +error: unconstrained generic constant `L + 1` --> $DIR/issue_114151.rs:17:5 | LL | foo::<_, L>([(); L + 1 + L]); | ^^^^^^^^^^^ - | - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: aborting due to 6 previous errors diff --git a/tests/ui/const-generics/generic_const_exprs/ice-generics_of-no-entry-found-for-key-113017.rs b/tests/ui/const-generics/generic_const_exprs/ice-generics_of-no-entry-found-for-key-113017.rs new file mode 100644 index 00000000000..a2f8c876b5e --- /dev/null +++ b/tests/ui/const-generics/generic_const_exprs/ice-generics_of-no-entry-found-for-key-113017.rs @@ -0,0 +1,13 @@ +// test for ICE "no entry found for key" in generics_of.rs #113017 + +#![feature(generic_const_exprs)] +#![allow(incomplete_features)] + +pub fn foo() +where + for<const N: usize = { || {}; 1 }> ():, + //~^ ERROR only lifetime parameters can be used in this context + //~^^ ERROR defaults for generic parameters are not allowed in `for<...>` binders +{} + +pub fn main() {} diff --git a/tests/ui/const-generics/generic_const_exprs/ice-generics_of-no-entry-found-for-key-113017.stderr b/tests/ui/const-generics/generic_const_exprs/ice-generics_of-no-entry-found-for-key-113017.stderr new file mode 100644 index 00000000000..edf27f58efd --- /dev/null +++ b/tests/ui/const-generics/generic_const_exprs/ice-generics_of-no-entry-found-for-key-113017.stderr @@ -0,0 +1,19 @@ +error[E0658]: only lifetime parameters can be used in this context + --> $DIR/ice-generics_of-no-entry-found-for-key-113017.rs:8:15 + | +LL | for<const N: usize = { || {}; 1 }> ():, + | ^ + | + = note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information + = help: add `#![feature(non_lifetime_binders)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error: defaults for generic parameters are not allowed in `for<...>` binders + --> $DIR/ice-generics_of-no-entry-found-for-key-113017.rs:8:9 + | +LL | for<const N: usize = { || {}; 1 }> ():, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/const-generics/generic_const_exprs/ice-predicates-of-no-entry-found-for-key-119275.rs b/tests/ui/const-generics/generic_const_exprs/ice-predicates-of-no-entry-found-for-key-119275.rs new file mode 100644 index 00000000000..4ba696f4ae0 --- /dev/null +++ b/tests/ui/const-generics/generic_const_exprs/ice-predicates-of-no-entry-found-for-key-119275.rs @@ -0,0 +1,18 @@ +// test for ICE #119275 "no entry found for key" in predicates_of.rs + +#![feature(generic_const_exprs)] +#![allow(incomplete_features)] + +fn bug<const N: Nat>(&self) +//~^ ERROR `self` parameter is only allowed in associated functions +//~^^ ERROR cannot find type `Nat` in this scope +where + for<const N: usize = 3, T = u32> [(); COT::BYTES]:, + //~^ ERROR only lifetime parameters can be used in this context + //~^^ ERROR defaults for generic parameters are not allowed in `for<...>` binders + //~^^^ ERROR defaults for generic parameters are not allowed in `for<...>` binders + //~^^^^ ERROR failed to resolve: use of undeclared type `COT` +{ +} + +pub fn main() {} diff --git a/tests/ui/const-generics/generic_const_exprs/ice-predicates-of-no-entry-found-for-key-119275.stderr b/tests/ui/const-generics/generic_const_exprs/ice-predicates-of-no-entry-found-for-key-119275.stderr new file mode 100644 index 00000000000..ee0ec38ab06 --- /dev/null +++ b/tests/ui/const-generics/generic_const_exprs/ice-predicates-of-no-entry-found-for-key-119275.stderr @@ -0,0 +1,46 @@ +error: `self` parameter is only allowed in associated functions + --> $DIR/ice-predicates-of-no-entry-found-for-key-119275.rs:6:22 + | +LL | fn bug<const N: Nat>(&self) + | ^^^^^ not semantically valid as function parameter + | + = note: associated functions are those in `impl` or `trait` definitions + +error[E0412]: cannot find type `Nat` in this scope + --> $DIR/ice-predicates-of-no-entry-found-for-key-119275.rs:6:17 + | +LL | fn bug<const N: Nat>(&self) + | ^^^ not found in this scope + +error[E0658]: only lifetime parameters can be used in this context + --> $DIR/ice-predicates-of-no-entry-found-for-key-119275.rs:10:15 + | +LL | for<const N: usize = 3, T = u32> [(); COT::BYTES]:, + | ^ ^ + | + = note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information + = help: add `#![feature(non_lifetime_binders)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error: defaults for generic parameters are not allowed in `for<...>` binders + --> $DIR/ice-predicates-of-no-entry-found-for-key-119275.rs:10:9 + | +LL | for<const N: usize = 3, T = u32> [(); COT::BYTES]:, + | ^^^^^^^^^^^^^^^^^^ + +error: defaults for generic parameters are not allowed in `for<...>` binders + --> $DIR/ice-predicates-of-no-entry-found-for-key-119275.rs:10:29 + | +LL | for<const N: usize = 3, T = u32> [(); COT::BYTES]:, + | ^^^^^^^ + +error[E0433]: failed to resolve: use of undeclared type `COT` + --> $DIR/ice-predicates-of-no-entry-found-for-key-119275.rs:10:43 + | +LL | for<const N: usize = 3, T = u32> [(); COT::BYTES]:, + | ^^^ use of undeclared type `COT` + +error: aborting due to 6 previous errors + +Some errors have detailed explanations: E0412, E0433, E0658. +For more information about an error, try `rustc --explain E0412`. diff --git a/tests/ui/const-generics/generic_const_exprs/issue-109141.rs b/tests/ui/const-generics/generic_const_exprs/issue-109141.rs index 148c3bda8d2..c6dd981cced 100644 --- a/tests/ui/const-generics/generic_const_exprs/issue-109141.rs +++ b/tests/ui/const-generics/generic_const_exprs/issue-109141.rs @@ -4,6 +4,7 @@ impl EntriesBuffer { fn a(&self) -> impl Iterator { self.0.iter_mut() //~ ERROR: cannot borrow `*self.0` as mutable, as it is behind a `&` reference + //~| ERROR captures lifetime that does not appear in bounds } } diff --git a/tests/ui/const-generics/generic_const_exprs/issue-109141.stderr b/tests/ui/const-generics/generic_const_exprs/issue-109141.stderr index 8b8489ac2bc..7a9572d000d 100644 --- a/tests/ui/const-generics/generic_const_exprs/issue-109141.stderr +++ b/tests/ui/const-generics/generic_const_exprs/issue-109141.stderr @@ -1,5 +1,5 @@ error[E0425]: cannot find value `HashesEntryLEN` in this scope - --> $DIR/issue-109141.rs:10:32 + --> $DIR/issue-109141.rs:11:32 | LL | struct EntriesBuffer(Box<[[u8; HashesEntryLEN]; 5]>); | ^^^^^^^^^^^^^^ not found in this scope @@ -20,7 +20,22 @@ help: consider changing this to be a mutable reference LL | fn a(&mut self) -> impl Iterator { | ~~~~~~~~~ -error: aborting due to 2 previous errors +error[E0700]: hidden type for `impl Iterator` captures lifetime that does not appear in bounds + --> $DIR/issue-109141.rs:6:9 + | +LL | fn a(&self) -> impl Iterator { + | ----- ------------- opaque type defined here + | | + | hidden type `std::slice::IterMut<'_, [u8; {const error}]>` captures the anonymous lifetime defined here +LL | self.0.iter_mut() + | ^^^^^^^^^^^^^^^^^ + | +help: to declare that `impl Iterator` captures `'_`, you can add an explicit `'_` lifetime bound + | +LL | fn a(&self) -> impl Iterator + '_ { + | ++++ + +error: aborting due to 3 previous errors -Some errors have detailed explanations: E0425, E0596. +Some errors have detailed explanations: E0425, E0596, E0700. For more information about an error, try `rustc --explain E0425`. diff --git a/tests/ui/const-generics/generic_const_exprs/unify-op-with-fn-call.stderr b/tests/ui/const-generics/generic_const_exprs/unify-op-with-fn-call.stderr index 77a7da17c13..0bf99bb8b26 100644 --- a/tests/ui/const-generics/generic_const_exprs/unify-op-with-fn-call.stderr +++ b/tests/ui/const-generics/generic_const_exprs/unify-op-with-fn-call.stderr @@ -54,7 +54,10 @@ note: impl defined here, but it is not `const` LL | impl const std::ops::Add for Foo { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: calls in constants are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(effects)]` to the crate attributes to enable +help: add `#![feature(effects)]` to the crate attributes to enable + | +LL + #![feature(effects)] + | error[E0015]: cannot call non-const fn `<Foo as Add>::add` in constants --> $DIR/unify-op-with-fn-call.rs:21:13 @@ -63,7 +66,10 @@ LL | bar::<{ std::ops::Add::add(N, N) }>(); | ^^^^^^^^^^^^^^^^^^^^^^^^ | = note: calls in constants are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(effects)]` to the crate attributes to enable +help: add `#![feature(effects)]` to the crate attributes to enable + | +LL + #![feature(effects)] + | error[E0015]: cannot call non-const fn `<usize as Add>::add` in constants --> $DIR/unify-op-with-fn-call.rs:30:14 @@ -72,7 +78,10 @@ LL | bar2::<{ std::ops::Add::add(N, N) }>(); | ^^^^^^^^^^^^^^^^^^^^^^^^ | = note: calls in constants are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(effects)]` to the crate attributes to enable +help: add `#![feature(effects)]` to the crate attributes to enable + | +LL + #![feature(effects)] + | error: aborting due to 7 previous errors diff --git a/tests/ui/const-generics/ice-unexpected-inference-var-122549.rs b/tests/ui/const-generics/ice-unexpected-inference-var-122549.rs new file mode 100644 index 00000000000..126ea667290 --- /dev/null +++ b/tests/ui/const-generics/ice-unexpected-inference-var-122549.rs @@ -0,0 +1,29 @@ +// Regression test for https://github.com/rust-lang/rust/issues/122549 +// was fixed by https://github.com/rust-lang/rust/pull/122749 + +trait ConstChunksExactTrait<T> { + fn const_chunks_exact<const N: usize>(&self) -> ConstChunksExact<'a, T, { N }>; + //~^ ERROR undeclared lifetime +} + +impl<T> ConstChunksExactTrait<T> for [T] {} +//~^ ERROR not all trait items implemented, missing: `const_chunks_exact` +struct ConstChunksExact<'rem, T: 'a, const N: usize> {} +//~^ ERROR use of undeclared lifetime name `'a` +//~^^ ERROR lifetime parameter +//~^^^ ERROR type parameter +impl<'a, T, const N: usize> Iterator for ConstChunksExact<'a, T, {}> { +//~^ ERROR the const parameter `N` is not constrained by the impl trait, self type, or predicates +//~^^ ERROR mismatched types + type Item = &'a [T; N]; +} + +fn main() { + let slice = &[1i32, 2, 3, 4, 5, 6, 7, 8, 9, 10]; + + let mut iter = [[1, 2, 3], [4, 5, 6], [7, 8, 9]].iter(); + + for a in slice.const_chunks_exact::<3>() { + assert_eq!(a, iter.next().unwrap()); + } +} diff --git a/tests/ui/const-generics/ice-unexpected-inference-var-122549.stderr b/tests/ui/const-generics/ice-unexpected-inference-var-122549.stderr new file mode 100644 index 00000000000..afad3388145 --- /dev/null +++ b/tests/ui/const-generics/ice-unexpected-inference-var-122549.stderr @@ -0,0 +1,67 @@ +error[E0261]: use of undeclared lifetime name `'a` + --> $DIR/ice-unexpected-inference-var-122549.rs:5:70 + | +LL | fn const_chunks_exact<const N: usize>(&self) -> ConstChunksExact<'a, T, { N }>; + | ^^ undeclared lifetime + | +help: consider introducing lifetime `'a` here + | +LL | fn const_chunks_exact<'a, const N: usize>(&self) -> ConstChunksExact<'a, T, { N }>; + | +++ +help: consider introducing lifetime `'a` here + | +LL | trait ConstChunksExactTrait<'a, T> { + | +++ + +error[E0261]: use of undeclared lifetime name `'a` + --> $DIR/ice-unexpected-inference-var-122549.rs:11:34 + | +LL | struct ConstChunksExact<'rem, T: 'a, const N: usize> {} + | - ^^ undeclared lifetime + | | + | help: consider introducing lifetime `'a` here: `'a,` + +error[E0046]: not all trait items implemented, missing: `const_chunks_exact` + --> $DIR/ice-unexpected-inference-var-122549.rs:9:1 + | +LL | fn const_chunks_exact<const N: usize>(&self) -> ConstChunksExact<'a, T, { N }>; + | ------------------------------------------------------------------------------- `const_chunks_exact` from trait +... +LL | impl<T> ConstChunksExactTrait<T> for [T] {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `const_chunks_exact` in implementation + +error[E0392]: lifetime parameter `'rem` is never used + --> $DIR/ice-unexpected-inference-var-122549.rs:11:25 + | +LL | struct ConstChunksExact<'rem, T: 'a, const N: usize> {} + | ^^^^ unused lifetime parameter + | + = help: consider removing `'rem`, referring to it in a field, or using a marker such as `PhantomData` + +error[E0392]: type parameter `T` is never used + --> $DIR/ice-unexpected-inference-var-122549.rs:11:31 + | +LL | struct ConstChunksExact<'rem, T: 'a, const N: usize> {} + | ^ unused type parameter + | + = help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData` + +error[E0207]: the const parameter `N` is not constrained by the impl trait, self type, or predicates + --> $DIR/ice-unexpected-inference-var-122549.rs:15:13 + | +LL | impl<'a, T, const N: usize> Iterator for ConstChunksExact<'a, T, {}> { + | ^^^^^^^^^^^^^^ unconstrained const parameter + | + = note: expressions using a const parameter must map each value to a distinct output value + = note: proving the result of expressions other than the parameter are unique is not supported + +error[E0308]: mismatched types + --> $DIR/ice-unexpected-inference-var-122549.rs:15:66 + | +LL | impl<'a, T, const N: usize> Iterator for ConstChunksExact<'a, T, {}> { + | ^^ expected `usize`, found `()` + +error: aborting due to 7 previous errors + +Some errors have detailed explanations: E0046, E0207, E0261, E0308, E0392. +For more information about an error, try `rustc --explain E0046`. diff --git a/tests/ui/const-generics/intrinsics-type_name-as-const-argument.min.stderr b/tests/ui/const-generics/intrinsics-type_name-as-const-argument.min.stderr index 95f75c32186..5e4acd80e93 100644 --- a/tests/ui/const-generics/intrinsics-type_name-as-const-argument.min.stderr +++ b/tests/ui/const-generics/intrinsics-type_name-as-const-argument.min.stderr @@ -14,7 +14,10 @@ LL | trait Trait<const S: &'static str> {} | ^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: aborting due to 2 previous errors diff --git a/tests/ui/const-generics/issue-93647.stderr b/tests/ui/const-generics/issue-93647.stderr index a87b59940cb..81f50a1b517 100644 --- a/tests/ui/const-generics/issue-93647.stderr +++ b/tests/ui/const-generics/issue-93647.stderr @@ -6,7 +6,10 @@ LL | (||1usize)() | = note: closures need an RFC before allowed to be called in constants = note: calls in constants are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable +help: add `#![feature(const_trait_impl)]` to the crate attributes to enable + | +LL + #![feature(const_trait_impl)] + | error: aborting due to 1 previous error diff --git a/tests/ui/const-generics/issues/issue-56445-1.min.stderr b/tests/ui/const-generics/issues/issue-56445-1.min.stderr index fc10aba0fec..580542bb6da 100644 --- a/tests/ui/const-generics/issues/issue-56445-1.min.stderr +++ b/tests/ui/const-generics/issues/issue-56445-1.min.stderr @@ -13,7 +13,10 @@ LL | struct Bug<'a, const S: &'a str>(PhantomData<&'a ()>); | ^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: aborting due to 2 previous errors diff --git a/tests/ui/const-generics/issues/issue-62878.min.stderr b/tests/ui/const-generics/issues/issue-62878.min.stderr index 984381d1669..5205726d738 100644 --- a/tests/ui/const-generics/issues/issue-62878.min.stderr +++ b/tests/ui/const-generics/issues/issue-62878.min.stderr @@ -13,7 +13,10 @@ LL | fn foo<const N: usize, const A: [u8; N]>() {} | ^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error[E0747]: type provided when a constant was expected --> $DIR/issue-62878.rs:10:11 @@ -22,7 +25,10 @@ LL | foo::<_, { [1] }>(); | ^ | = help: const arguments cannot yet be inferred with `_` - = help: add `#![feature(generic_arg_infer)]` to the crate attributes to enable +help: add `#![feature(generic_arg_infer)]` to the crate attributes to enable + | +LL + #![feature(generic_arg_infer)] + | error: aborting due to 3 previous errors diff --git a/tests/ui/const-generics/issues/issue-63322-forbid-dyn.min.stderr b/tests/ui/const-generics/issues/issue-63322-forbid-dyn.min.stderr index b9588e23e55..7f387cbd5a1 100644 --- a/tests/ui/const-generics/issues/issue-63322-forbid-dyn.min.stderr +++ b/tests/ui/const-generics/issues/issue-63322-forbid-dyn.min.stderr @@ -5,7 +5,10 @@ LL | fn test<const T: &'static dyn A>() { | ^^^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: aborting due to 1 previous error diff --git a/tests/ui/const-generics/issues/issue-67185-2.stderr b/tests/ui/const-generics/issues/issue-67185-2.stderr index 24a2d60f2e1..e39d43205c1 100644 --- a/tests/ui/const-generics/issues/issue-67185-2.stderr +++ b/tests/ui/const-generics/issues/issue-67185-2.stderr @@ -8,7 +8,10 @@ LL | <u8 as Baz>::Quaks: Bar, [u16; 4] [[u16; 3]; 3] = help: see issue #48214 - = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable +help: add `#![feature(trivial_bounds)]` to the crate attributes to enable + | +LL + #![feature(trivial_bounds)] + | error[E0277]: the trait bound `[[u16; 3]; 2]: Bar` is not satisfied --> $DIR/issue-67185-2.rs:14:5 @@ -20,7 +23,10 @@ LL | [<u8 as Baz>::Quaks; 2]: Bar, [u16; 4] [[u16; 3]; 3] = help: see issue #48214 - = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable +help: add `#![feature(trivial_bounds)]` to the crate attributes to enable + | +LL + #![feature(trivial_bounds)] + | error[E0277]: the trait bound `[u16; 3]: Bar` is not satisfied --> $DIR/issue-67185-2.rs:21:6 diff --git a/tests/ui/const-generics/issues/issue-68366.full.stderr b/tests/ui/const-generics/issues/issue-68366.full.stderr index dc20af77310..3363a895e47 100644 --- a/tests/ui/const-generics/issues/issue-68366.full.stderr +++ b/tests/ui/const-generics/issues/issue-68366.full.stderr @@ -5,7 +5,10 @@ LL | struct Collatz<const N: Option<usize>>; | ^^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error[E0207]: the const parameter `N` is not constrained by the impl trait, self type, or predicates --> $DIR/issue-68366.rs:12:7 diff --git a/tests/ui/const-generics/issues/issue-68366.min.stderr b/tests/ui/const-generics/issues/issue-68366.min.stderr index 78e49f46e1a..276f91e76dd 100644 --- a/tests/ui/const-generics/issues/issue-68366.min.stderr +++ b/tests/ui/const-generics/issues/issue-68366.min.stderr @@ -14,7 +14,10 @@ LL | struct Collatz<const N: Option<usize>>; | ^^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error[E0207]: the const parameter `N` is not constrained by the impl trait, self type, or predicates --> $DIR/issue-68366.rs:12:7 diff --git a/tests/ui/const-generics/issues/issue-68615-adt.min.stderr b/tests/ui/const-generics/issues/issue-68615-adt.min.stderr index 20962098bff..2f95eef98c0 100644 --- a/tests/ui/const-generics/issues/issue-68615-adt.min.stderr +++ b/tests/ui/const-generics/issues/issue-68615-adt.min.stderr @@ -5,7 +5,10 @@ LL | struct Const<const V: [usize; 0]> {} | ^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: aborting due to 1 previous error diff --git a/tests/ui/const-generics/issues/issue-68615-array.min.stderr b/tests/ui/const-generics/issues/issue-68615-array.min.stderr index 8c76f9b5d65..6d18f8195d2 100644 --- a/tests/ui/const-generics/issues/issue-68615-array.min.stderr +++ b/tests/ui/const-generics/issues/issue-68615-array.min.stderr @@ -5,7 +5,10 @@ LL | struct Foo<const V: [usize; 0] > {} | ^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: aborting due to 1 previous error diff --git a/tests/ui/const-generics/issues/issue-71169.min.stderr b/tests/ui/const-generics/issues/issue-71169.min.stderr index bba92f32a78..94d11f969ff 100644 --- a/tests/ui/const-generics/issues/issue-71169.min.stderr +++ b/tests/ui/const-generics/issues/issue-71169.min.stderr @@ -13,7 +13,10 @@ LL | fn foo<const LEN: usize, const DATA: [u8; LEN]>() {} | ^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: aborting due to 2 previous errors diff --git a/tests/ui/const-generics/issues/issue-73491.min.stderr b/tests/ui/const-generics/issues/issue-73491.min.stderr index 64df76756ac..8fdd65894ef 100644 --- a/tests/ui/const-generics/issues/issue-73491.min.stderr +++ b/tests/ui/const-generics/issues/issue-73491.min.stderr @@ -5,7 +5,10 @@ LL | fn hoge<const IN: [u32; LEN]>() {} | ^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: aborting due to 1 previous error diff --git a/tests/ui/const-generics/issues/issue-73727-static-reference-array-const-param.min.stderr b/tests/ui/const-generics/issues/issue-73727-static-reference-array-const-param.min.stderr index 2b33f35defd..e9363d42148 100644 --- a/tests/ui/const-generics/issues/issue-73727-static-reference-array-const-param.min.stderr +++ b/tests/ui/const-generics/issues/issue-73727-static-reference-array-const-param.min.stderr @@ -5,7 +5,10 @@ LL | fn a<const X: &'static [u32]>() {} | ^^^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: aborting due to 1 previous error diff --git a/tests/ui/const-generics/issues/issue-74101.min.stderr b/tests/ui/const-generics/issues/issue-74101.min.stderr index 7852ce5bcfc..236556addce 100644 --- a/tests/ui/const-generics/issues/issue-74101.min.stderr +++ b/tests/ui/const-generics/issues/issue-74101.min.stderr @@ -5,7 +5,10 @@ LL | fn test<const N: [u8; 1 + 2]>() {} | ^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: `[u8; 1 + 2]` is forbidden as the type of a const generic parameter --> $DIR/issue-74101.rs:9:21 @@ -14,7 +17,10 @@ LL | struct Foo<const N: [u8; 1 + 2]>; | ^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: aborting due to 2 previous errors diff --git a/tests/ui/const-generics/issues/issue-74255.min.stderr b/tests/ui/const-generics/issues/issue-74255.min.stderr index 63d8fc12fa4..800902860a7 100644 --- a/tests/ui/const-generics/issues/issue-74255.min.stderr +++ b/tests/ui/const-generics/issues/issue-74255.min.stderr @@ -5,7 +5,10 @@ LL | fn ice_struct_fn<const I: IceEnum>() {} | ^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: aborting due to 1 previous error diff --git a/tests/ui/const-generics/issues/issue-74950.min.stderr b/tests/ui/const-generics/issues/issue-74950.min.stderr index a573dac6087..086176d9959 100644 --- a/tests/ui/const-generics/issues/issue-74950.min.stderr +++ b/tests/ui/const-generics/issues/issue-74950.min.stderr @@ -5,7 +5,10 @@ LL | struct Outer<const I: Inner>; | ^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: `Inner` is forbidden as the type of a const generic parameter --> $DIR/issue-74950.rs:19:23 @@ -14,8 +17,11 @@ LL | struct Outer<const I: Inner>; | ^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: `Inner` is forbidden as the type of a const generic parameter --> $DIR/issue-74950.rs:19:23 @@ -24,8 +30,11 @@ LL | struct Outer<const I: Inner>; | ^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: `Inner` is forbidden as the type of a const generic parameter --> $DIR/issue-74950.rs:19:23 @@ -34,8 +43,11 @@ LL | struct Outer<const I: Inner>; | ^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: aborting due to 4 previous errors diff --git a/tests/ui/const-generics/issues/issue-75047.min.stderr b/tests/ui/const-generics/issues/issue-75047.min.stderr index 1d7ac1b0111..f2cc76b9bed 100644 --- a/tests/ui/const-generics/issues/issue-75047.min.stderr +++ b/tests/ui/const-generics/issues/issue-75047.min.stderr @@ -5,7 +5,10 @@ LL | struct Foo<const N: [u8; Bar::<u32>::value()]>; | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: aborting due to 1 previous error diff --git a/tests/ui/const-generics/issues/issue-90318.stderr b/tests/ui/const-generics/issues/issue-90318.stderr index 471a6660ce0..a534e8f8d44 100644 --- a/tests/ui/const-generics/issues/issue-90318.stderr +++ b/tests/ui/const-generics/issues/issue-90318.stderr @@ -29,7 +29,10 @@ LL | If<{ TypeId::of::<T>() != TypeId::of::<()>() }>: True, note: impl defined here, but it is not `const` --> $SRC_DIR/core/src/any.rs:LL:COL = note: calls in constants are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable +help: add `#![feature(const_trait_impl)]` to the crate attributes to enable + | +LL + #![feature(const_trait_impl)] + | error[E0015]: cannot call non-const operator in constants --> $DIR/issue-90318.rs:22:10 @@ -40,7 +43,10 @@ LL | If<{ TypeId::of::<T>() != TypeId::of::<()>() }>: True, note: impl defined here, but it is not `const` --> $SRC_DIR/core/src/any.rs:LL:COL = note: calls in constants are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable +help: add `#![feature(const_trait_impl)]` to the crate attributes to enable + | +LL + #![feature(const_trait_impl)] + | error: aborting due to 4 previous errors diff --git a/tests/ui/const-generics/late-bound-vars/late-bound-in-return-issue-77357.stderr b/tests/ui/const-generics/late-bound-vars/late-bound-in-return-issue-77357.stderr index e42bb6e8cc5..7bef98b1d5d 100644 --- a/tests/ui/const-generics/late-bound-vars/late-bound-in-return-issue-77357.stderr +++ b/tests/ui/const-generics/late-bound-vars/late-bound-in-return-issue-77357.stderr @@ -4,46 +4,5 @@ error: cannot capture late-bound lifetime in constant LL | fn bug<'a, T>() -> &'static dyn MyTrait<[(); { |x: &'a u32| { x }; 4 }]> { | -- lifetime defined here ^^ -error: overly complex generic constant - --> $DIR/late-bound-in-return-issue-77357.rs:9:46 - | -LL | fn bug<'a, T>() -> &'static dyn MyTrait<[(); { |x: &'a u32| { x }; 4 }]> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ blocks are not supported in generic constants - | - = help: consider moving this anonymous constant into a `const` function - = note: this operation may be supported in the future - -error[E0391]: cycle detected when evaluating type-level constant - --> $DIR/late-bound-in-return-issue-77357.rs:9:46 - | -LL | fn bug<'a, T>() -> &'static dyn MyTrait<[(); { |x: &'a u32| { x }; 4 }]> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | -note: ...which requires const-evaluating + checking `bug::{constant#0}`... - --> $DIR/late-bound-in-return-issue-77357.rs:9:46 - | -LL | fn bug<'a, T>() -> &'static dyn MyTrait<[(); { |x: &'a u32| { x }; 4 }]> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ -note: ...which requires caching mir of `bug::{constant#0}` for CTFE... - --> $DIR/late-bound-in-return-issue-77357.rs:9:46 - | -LL | fn bug<'a, T>() -> &'static dyn MyTrait<[(); { |x: &'a u32| { x }; 4 }]> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ -note: ...which requires elaborating drops for `bug::{constant#0}`... - --> $DIR/late-bound-in-return-issue-77357.rs:9:46 - | -LL | fn bug<'a, T>() -> &'static dyn MyTrait<[(); { |x: &'a u32| { x }; 4 }]> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ -note: ...which requires borrow-checking `bug::{constant#0}`... - --> $DIR/late-bound-in-return-issue-77357.rs:9:46 - | -LL | fn bug<'a, T>() -> &'static dyn MyTrait<[(); { |x: &'a u32| { x }; 4 }]> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: ...which requires normalizing `Binder { value: ConstEvaluatable(UnevaluatedConst { def: DefId(0:8 ~ late_bound_in_return_issue_77357[9394]::bug::{constant#0}), args: [T/#0] }: usize), bound_vars: [] }`... - = note: ...which again requires evaluating type-level constant, completing the cycle - = note: cycle used when normalizing `&dyn MyTrait<[(); { |x: &'a u32| { x }; 4 }]>` - = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information - -error: aborting due to 3 previous errors +error: aborting due to 1 previous error -For more information about this error, try `rustc --explain E0391`. diff --git a/tests/ui/const-generics/lifetime-in-const-param.stderr b/tests/ui/const-generics/lifetime-in-const-param.stderr index c2fcdcf1a71..4096725c52a 100644 --- a/tests/ui/const-generics/lifetime-in-const-param.stderr +++ b/tests/ui/const-generics/lifetime-in-const-param.stderr @@ -11,7 +11,10 @@ LL | struct S<'a, const N: S2>(&'a ()); | ^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: aborting due to 2 previous errors diff --git a/tests/ui/const-generics/min_const_generics/complex-types.stderr b/tests/ui/const-generics/min_const_generics/complex-types.stderr index 8cc75dbaff9..8e83ea58194 100644 --- a/tests/ui/const-generics/min_const_generics/complex-types.stderr +++ b/tests/ui/const-generics/min_const_generics/complex-types.stderr @@ -5,7 +5,10 @@ LL | struct Foo<const N: [u8; 0]>; | ^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: `()` is forbidden as the type of a const generic parameter --> $DIR/complex-types.rs:6:21 @@ -14,7 +17,10 @@ LL | struct Bar<const N: ()>; | ^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: `No` is forbidden as the type of a const generic parameter --> $DIR/complex-types.rs:11:21 @@ -23,7 +29,10 @@ LL | struct Fez<const N: No>; | ^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: `&'static u8` is forbidden as the type of a const generic parameter --> $DIR/complex-types.rs:14:21 @@ -32,7 +41,10 @@ LL | struct Faz<const N: &'static u8>; | ^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: `!` is forbidden as the type of a const generic parameter --> $DIR/complex-types.rs:17:21 @@ -49,7 +61,10 @@ LL | enum Goo<const N: ()> { A, B } | ^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: `()` is forbidden as the type of a const generic parameter --> $DIR/complex-types.rs:23:20 @@ -58,7 +73,10 @@ LL | union Boo<const N: ()> { a: () } | ^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: aborting due to 7 previous errors diff --git a/tests/ui/const-generics/min_const_generics/macro-fail.rs b/tests/ui/const-generics/min_const_generics/macro-fail.rs index f3df96d468c..2f101ecfb1f 100644 --- a/tests/ui/const-generics/min_const_generics/macro-fail.rs +++ b/tests/ui/const-generics/min_const_generics/macro-fail.rs @@ -13,6 +13,7 @@ impl<const N: usize> Marker<N> for Example<N> {} fn make_marker() -> impl Marker<gimme_a_const!(marker)> { //~^ ERROR: type provided when a constant was expected + //~| ERROR: type provided when a constant was expected Example::<gimme_a_const!(marker)> //~^ ERROR: type provided when a constant was expected } diff --git a/tests/ui/const-generics/min_const_generics/macro-fail.stderr b/tests/ui/const-generics/min_const_generics/macro-fail.stderr index 06a111008a3..34764982bb0 100644 --- a/tests/ui/const-generics/min_const_generics/macro-fail.stderr +++ b/tests/ui/const-generics/min_const_generics/macro-fail.stderr @@ -1,5 +1,5 @@ error: expected type, found `{` - --> $DIR/macro-fail.rs:29:27 + --> $DIR/macro-fail.rs:30:27 | LL | fn make_marker() -> impl Marker<gimme_a_const!(marker)> { | ---------------------- @@ -13,7 +13,7 @@ LL | ($rusty: ident) => {{ let $rusty = 3; *&$rusty }} = note: this error originates in the macro `gimme_a_const` (in Nightly builds, run with -Z macro-backtrace for more info) error: expected type, found `{` - --> $DIR/macro-fail.rs:29:27 + --> $DIR/macro-fail.rs:30:27 | LL | Example::<gimme_a_const!(marker)> | ---------------------- @@ -41,7 +41,7 @@ LL | let _fail = Example::<external_macro!()>; = note: this error originates in the macro `external_macro` (in Nightly builds, run with -Z macro-backtrace for more info) error: unexpected end of macro invocation - --> $DIR/macro-fail.rs:39:25 + --> $DIR/macro-fail.rs:40:25 | LL | macro_rules! gimme_a_const { | -------------------------- when calling this macro @@ -50,7 +50,7 @@ LL | let _fail = Example::<gimme_a_const!()>; | ^^^^^^^^^^^^^^^^ missing tokens in macro arguments | note: while trying to match meta-variable `$rusty:ident` - --> $DIR/macro-fail.rs:29:8 + --> $DIR/macro-fail.rs:30:8 | LL | ($rusty: ident) => {{ let $rusty = 3; *&$rusty }} | ^^^^^^^^^^^^^ @@ -62,23 +62,31 @@ LL | fn make_marker() -> impl Marker<gimme_a_const!(marker)> { | ^^^^^^^^^^^^^^^^^^^^^^ error[E0747]: type provided when a constant was expected - --> $DIR/macro-fail.rs:16:13 + --> $DIR/macro-fail.rs:14:33 + | +LL | fn make_marker() -> impl Marker<gimme_a_const!(marker)> { + | ^^^^^^^^^^^^^^^^^^^^^^ + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error[E0747]: type provided when a constant was expected + --> $DIR/macro-fail.rs:17:13 | LL | Example::<gimme_a_const!(marker)> | ^^^^^^^^^^^^^^^^^^^^^^ error[E0747]: type provided when a constant was expected - --> $DIR/macro-fail.rs:36:25 + --> $DIR/macro-fail.rs:37:25 | LL | let _fail = Example::<external_macro!()>; | ^^^^^^^^^^^^^^^^^ error[E0747]: type provided when a constant was expected - --> $DIR/macro-fail.rs:39:25 + --> $DIR/macro-fail.rs:40:25 | LL | let _fail = Example::<gimme_a_const!()>; | ^^^^^^^^^^^^^^^^ -error: aborting due to 8 previous errors +error: aborting due to 9 previous errors For more information about this error, try `rustc --explain E0747`. diff --git a/tests/ui/const-generics/nested-type.min.stderr b/tests/ui/const-generics/nested-type.min.stderr index ca5af5f969f..0da2b30e3f1 100644 --- a/tests/ui/const-generics/nested-type.min.stderr +++ b/tests/ui/const-generics/nested-type.min.stderr @@ -30,7 +30,10 @@ LL | | }]>; | |__^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: aborting due to 2 previous errors diff --git a/tests/ui/const-generics/slice-const-param-mismatch.min.stderr b/tests/ui/const-generics/slice-const-param-mismatch.min.stderr index 26f5af6c831..0650dafc685 100644 --- a/tests/ui/const-generics/slice-const-param-mismatch.min.stderr +++ b/tests/ui/const-generics/slice-const-param-mismatch.min.stderr @@ -5,7 +5,10 @@ LL | struct ConstString<const T: &'static str>; | ^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: `&'static [u8]` is forbidden as the type of a const generic parameter --> $DIR/slice-const-param-mismatch.rs:9:28 @@ -14,7 +17,10 @@ LL | struct ConstBytes<const T: &'static [u8]>; | ^^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error[E0308]: mismatched types --> $DIR/slice-const-param-mismatch.rs:14:35 diff --git a/tests/ui/const-generics/std/const-generics-range.min.stderr b/tests/ui/const-generics/std/const-generics-range.min.stderr index d45f749246c..67f137cf1a0 100644 --- a/tests/ui/const-generics/std/const-generics-range.min.stderr +++ b/tests/ui/const-generics/std/const-generics-range.min.stderr @@ -5,7 +5,10 @@ LL | struct _Range<const R: std::ops::Range<usize>>; | ^^^^^^^^^^^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: `RangeFrom<usize>` is forbidden as the type of a const generic parameter --> $DIR/const-generics-range.rs:13:28 @@ -14,7 +17,10 @@ LL | struct _RangeFrom<const R: std::ops::RangeFrom<usize>>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: `RangeFull` is forbidden as the type of a const generic parameter --> $DIR/const-generics-range.rs:18:28 @@ -23,7 +29,10 @@ LL | struct _RangeFull<const R: std::ops::RangeFull>; | ^^^^^^^^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: `RangeInclusive<usize>` is forbidden as the type of a const generic parameter --> $DIR/const-generics-range.rs:24:33 @@ -32,7 +41,10 @@ LL | struct _RangeInclusive<const R: std::ops::RangeInclusive<usize>>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: `RangeTo<usize>` is forbidden as the type of a const generic parameter --> $DIR/const-generics-range.rs:29:26 @@ -41,7 +53,10 @@ LL | struct _RangeTo<const R: std::ops::RangeTo<usize>>; | ^^^^^^^^^^^^^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: `RangeToInclusive<usize>` is forbidden as the type of a const generic parameter --> $DIR/const-generics-range.rs:34:35 @@ -50,7 +65,10 @@ LL | struct _RangeToInclusive<const R: std::ops::RangeToInclusive<usize>>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: aborting due to 6 previous errors diff --git a/tests/ui/const-generics/transmute-const-param-static-reference.min.stderr b/tests/ui/const-generics/transmute-const-param-static-reference.min.stderr index 25bb7ac8039..fdb6ddeb578 100644 --- a/tests/ui/const-generics/transmute-const-param-static-reference.min.stderr +++ b/tests/ui/const-generics/transmute-const-param-static-reference.min.stderr @@ -5,7 +5,10 @@ LL | struct Const<const P: &'static ()>; | ^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: aborting due to 1 previous error diff --git a/tests/ui/const-generics/transmute-fail.rs b/tests/ui/const-generics/transmute-fail.rs index d7bf1b47fb5..90afd232534 100644 --- a/tests/ui/const-generics/transmute-fail.rs +++ b/tests/ui/const-generics/transmute-fail.rs @@ -32,4 +32,79 @@ fn overflow(v: [[[u32; 8888888]; 9999999]; 777777777]) -> [[[u32; 9999999]; 7777 } } +fn transpose<const W: usize, const H: usize>(v: [[u32;H]; W]) -> [[u32; W]; H] { + unsafe { + std::mem::transmute(v) + //~^ ERROR: cannot transmute between types of different sizes, or dependently-sized types + } +} + +fn ident<const W: usize, const H: usize>(v: [[u32; H]; W]) -> [[u32; H]; W] { + unsafe { + std::mem::transmute(v) + } +} + +fn flatten<const W: usize, const H: usize>(v: [[u32; H]; W]) -> [u32; W * H] { + unsafe { + std::mem::transmute(v) + //~^ ERROR: cannot transmute between types of different sizes, or dependently-sized types + } +} + +fn coagulate<const W: usize, const H: usize>(v: [u32; H*W]) -> [[u32; W];H] { + unsafe { + std::mem::transmute(v) + //~^ ERROR: cannot transmute between types of different sizes, or dependently-sized types + } +} + +fn flatten_3d<const W: usize, const H: usize, const D: usize>( + v: [[[u32; D]; H]; W] +) -> [u32; D * W * H] { + unsafe { + std::mem::transmute(v) + //~^ ERROR: cannot transmute between types of different sizes, or dependently-sized types + } +} + +fn flatten_somewhat<const W: usize, const H: usize, const D: usize>( + v: [[[u32; D]; H]; W] +) -> [[u32; D * W]; H] { + unsafe { + std::mem::transmute(v) + //~^ ERROR: cannot transmute between types of different sizes, or dependently-sized types + } +} + +fn known_size<const L: usize>(v: [u16; L]) -> [u8; L * 2] { + unsafe { + std::mem::transmute(v) + //~^ ERROR: cannot transmute between types of different sizes, or dependently-sized types + } +} + +fn condense_bytes<const L: usize>(v: [u8; L * 2]) -> [u16; L] { + unsafe { + std::mem::transmute(v) + //~^ ERROR: cannot transmute between types of different sizes, or dependently-sized types + } +} + +fn singleton_each<const L: usize>(v: [u8; L]) -> [[u8;1]; L] { + unsafe { + std::mem::transmute(v) + //~^ ERROR: cannot transmute between types of different sizes, or dependently-sized types + } +} + +fn transpose_with_const<const W: usize, const H: usize>( + v: [[u32; 2 * H]; W + W] +) -> [[u32; W + W]; 2 * H] { + unsafe { + std::mem::transmute(v) + //~^ ERROR: cannot transmute between types of different sizes, or dependently-sized types + } +} + fn main() {} diff --git a/tests/ui/const-generics/transmute-fail.stderr b/tests/ui/const-generics/transmute-fail.stderr index 12644b9f36d..1b0d1ea50d0 100644 --- a/tests/ui/const-generics/transmute-fail.stderr +++ b/tests/ui/const-generics/transmute-fail.stderr @@ -4,8 +4,8 @@ error[E0512]: cannot transmute between types of different sizes, or dependently- LL | std::mem::transmute(v) | ^^^^^^^^^^^^^^^^^^^ | - = note: source type: `[[u32; H+1]; W]` (generic size {const expr}) - = note: target type: `[[u32; W+1]; H]` (generic size {const expr}) + = note: source type: `[[u32; H+1]; W]` (size can vary because of [u32; H+1]) + = note: target type: `[[u32; W+1]; H]` (size can vary because of [u32; W+1]) error[E0512]: cannot transmute between types of different sizes, or dependently-sized types --> $DIR/transmute-fail.rs:16:5 @@ -22,8 +22,8 @@ error[E0512]: cannot transmute between types of different sizes, or dependently- LL | std::mem::transmute(v) | ^^^^^^^^^^^^^^^^^^^ | - = note: source type: `[[u32; H]; W]` (generic size {const expr}) - = note: target type: `[u32; W * H * H]` (generic size {const expr}) + = note: source type: `[[u32; H]; W]` (size can vary because of [u32; H]) + = note: target type: `[u32; W * H * H]` (this type does not have a fixed size) error[E0512]: cannot transmute between types of different sizes, or dependently-sized types --> $DIR/transmute-fail.rs:30:5 @@ -34,6 +34,87 @@ LL | std::mem::transmute(v) = note: source type: `[[[u32; 8888888]; 9999999]; 777777777]` (values of the type `[[u32; 8888888]; 9999999]` are too big for the current architecture) = note: target type: `[[[u32; 9999999]; 777777777]; 8888888]` (values of the type `[[u32; 9999999]; 777777777]` are too big for the current architecture) +error[E0512]: cannot transmute between types of different sizes, or dependently-sized types + --> $DIR/transmute-fail.rs:37:5 + | +LL | std::mem::transmute(v) + | ^^^^^^^^^^^^^^^^^^^ + | + = note: source type: `[[u32; H]; W]` (size can vary because of [u32; H]) + = note: target type: `[[u32; W]; H]` (size can vary because of [u32; W]) + +error[E0512]: cannot transmute between types of different sizes, or dependently-sized types + --> $DIR/transmute-fail.rs:50:5 + | +LL | std::mem::transmute(v) + | ^^^^^^^^^^^^^^^^^^^ + | + = note: source type: `[[u32; H]; W]` (size can vary because of [u32; H]) + = note: target type: `[u32; W * H]` (this type does not have a fixed size) + +error[E0512]: cannot transmute between types of different sizes, or dependently-sized types + --> $DIR/transmute-fail.rs:57:5 + | +LL | std::mem::transmute(v) + | ^^^^^^^^^^^^^^^^^^^ + | + = note: source type: `[u32; H*W]` (this type does not have a fixed size) + = note: target type: `[[u32; W]; H]` (size can vary because of [u32; W]) + +error[E0512]: cannot transmute between types of different sizes, or dependently-sized types + --> $DIR/transmute-fail.rs:66:5 + | +LL | std::mem::transmute(v) + | ^^^^^^^^^^^^^^^^^^^ + | + = note: source type: `[[[u32; D]; H]; W]` (size can vary because of [u32; D]) + = note: target type: `[u32; D * W * H]` (this type does not have a fixed size) + +error[E0512]: cannot transmute between types of different sizes, or dependently-sized types + --> $DIR/transmute-fail.rs:75:5 + | +LL | std::mem::transmute(v) + | ^^^^^^^^^^^^^^^^^^^ + | + = note: source type: `[[[u32; D]; H]; W]` (size can vary because of [u32; D]) + = note: target type: `[[u32; D * W]; H]` (size can vary because of [u32; D * W]) + +error[E0512]: cannot transmute between types of different sizes, or dependently-sized types + --> $DIR/transmute-fail.rs:82:5 + | +LL | std::mem::transmute(v) + | ^^^^^^^^^^^^^^^^^^^ + | + = note: source type: `[u16; L]` (this type does not have a fixed size) + = note: target type: `[u8; L * 2]` (this type does not have a fixed size) + +error[E0512]: cannot transmute between types of different sizes, or dependently-sized types + --> $DIR/transmute-fail.rs:89:5 + | +LL | std::mem::transmute(v) + | ^^^^^^^^^^^^^^^^^^^ + | + = note: source type: `[u8; L * 2]` (this type does not have a fixed size) + = note: target type: `[u16; L]` (this type does not have a fixed size) + +error[E0512]: cannot transmute between types of different sizes, or dependently-sized types + --> $DIR/transmute-fail.rs:96:5 + | +LL | std::mem::transmute(v) + | ^^^^^^^^^^^^^^^^^^^ + | + = note: source type: `[u8; L]` (this type does not have a fixed size) + = note: target type: `[[u8; 1]; L]` (this type does not have a fixed size) + +error[E0512]: cannot transmute between types of different sizes, or dependently-sized types + --> $DIR/transmute-fail.rs:105:5 + | +LL | std::mem::transmute(v) + | ^^^^^^^^^^^^^^^^^^^ + | + = note: source type: `[[u32; 2 * H]; W + W]` (size can vary because of [u32; 2 * H]) + = note: target type: `[[u32; W + W]; 2 * H]` (size can vary because of [u32; W + W]) + error[E0308]: mismatched types --> $DIR/transmute-fail.rs:12:53 | @@ -46,7 +127,7 @@ error[E0308]: mismatched types LL | fn bar<const W: bool, const H: usize>(v: [[u32; H]; W]) -> [[u32; W]; H] { | ^ expected `usize`, found `bool` -error: aborting due to 6 previous errors +error: aborting due to 15 previous errors Some errors have detailed explanations: E0308, E0512. For more information about an error, try `rustc --explain E0308`. diff --git a/tests/ui/const-generics/transmute.rs b/tests/ui/const-generics/transmute.rs index 245fcf5670e..e8ab8637932 100644 --- a/tests/ui/const-generics/transmute.rs +++ b/tests/ui/const-generics/transmute.rs @@ -3,81 +3,12 @@ #![feature(transmute_generic_consts)] #![allow(incomplete_features)] -fn transpose<const W: usize, const H: usize>(v: [[u32;H]; W]) -> [[u32; W]; H] { - unsafe { - std::mem::transmute(v) - } -} - fn ident<const W: usize, const H: usize>(v: [[u32; H]; W]) -> [[u32; H]; W] { unsafe { std::mem::transmute(v) } } -fn flatten<const W: usize, const H: usize>(v: [[u32; H]; W]) -> [u32; W * H] { - unsafe { - std::mem::transmute(v) - } -} - -fn coagulate<const W: usize, const H: usize>(v: [u32; H*W]) -> [[u32; W];H] { - unsafe { - std::mem::transmute(v) - } -} - -fn flatten_3d<const W: usize, const H: usize, const D: usize>( - v: [[[u32; D]; H]; W] -) -> [u32; D * W * H] { - unsafe { - std::mem::transmute(v) - } -} - -fn flatten_somewhat<const W: usize, const H: usize, const D: usize>( - v: [[[u32; D]; H]; W] -) -> [[u32; D * W]; H] { - unsafe { - std::mem::transmute(v) - } -} - -fn known_size<const L: usize>(v: [u16; L]) -> [u8; L * 2] { - unsafe { - std::mem::transmute(v) - } -} - -fn condense_bytes<const L: usize>(v: [u8; L * 2]) -> [u16; L] { - unsafe { - std::mem::transmute(v) - } -} - -fn singleton_each<const L: usize>(v: [u8; L]) -> [[u8;1]; L] { - unsafe { - std::mem::transmute(v) - } -} - -fn transpose_with_const<const W: usize, const H: usize>( - v: [[u32; 2 * H]; W + W] -) -> [[u32; W + W]; 2 * H] { - unsafe { - std::mem::transmute(v) - } -} - fn main() { - let _ = transpose([[0; 8]; 16]); - let _ = transpose_with_const::<8,4>([[0; 8]; 16]); let _ = ident([[0; 8]; 16]); - let _ = flatten([[0; 13]; 5]); - let _: [[_; 5]; 13] = coagulate([0; 65]); - let _ = flatten_3d([[[0; 3]; 13]; 5]); - let _ = flatten_somewhat([[[0; 3]; 13]; 5]); - let _ = known_size([16; 13]); - let _: [u16; 5] = condense_bytes([16u8; 10]); - let _ = singleton_each([16; 10]); } diff --git a/tests/ui/const-generics/type-dependent/issue-71348.min.stderr b/tests/ui/const-generics/type-dependent/issue-71348.min.stderr index 6490592c1e1..f42a331a8a4 100644 --- a/tests/ui/const-generics/type-dependent/issue-71348.min.stderr +++ b/tests/ui/const-generics/type-dependent/issue-71348.min.stderr @@ -5,7 +5,10 @@ LL | trait Get<'a, const N: &'static str> { | ^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: `&'static str` is forbidden as the type of a const generic parameter --> $DIR/issue-71348.rs:18:25 @@ -14,7 +17,10 @@ LL | fn ask<'a, const N: &'static str>(&'a self) -> &'a <Self as Get<N>>::Ta | ^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: aborting due to 2 previous errors diff --git a/tests/ui/const_prop/ice-type-mismatch-when-copying-112824.rs b/tests/ui/const_prop/ice-type-mismatch-when-copying-112824.rs new file mode 100644 index 00000000000..dc9782295c1 --- /dev/null +++ b/tests/ui/const_prop/ice-type-mismatch-when-copying-112824.rs @@ -0,0 +1,20 @@ +// test for #112824 ICE type mismatching when copying! + +pub struct Opcode(pub u8); + +pub struct Opcode2(&'a S); +//~^ ERROR use of undeclared lifetime name `'a` +//~^^ ERROR cannot find type `S` in this scope + +impl Opcode2 { + pub const OP2: Opcode2 = Opcode2(Opcode(0x1)); +} + +pub fn example2(msg_type: Opcode2) -> impl FnMut(&[u8]) { + move |i| match msg_type { + Opcode2::OP2 => unimplemented!(), + //~^ ERROR could not evaluate constant pattern + } +} + +pub fn main() {} diff --git a/tests/ui/const_prop/ice-type-mismatch-when-copying-112824.stderr b/tests/ui/const_prop/ice-type-mismatch-when-copying-112824.stderr new file mode 100644 index 00000000000..9442eac0cf5 --- /dev/null +++ b/tests/ui/const_prop/ice-type-mismatch-when-copying-112824.stderr @@ -0,0 +1,29 @@ +error[E0261]: use of undeclared lifetime name `'a` + --> $DIR/ice-type-mismatch-when-copying-112824.rs:5:21 + | +LL | pub struct Opcode2(&'a S); + | - ^^ undeclared lifetime + | | + | help: consider introducing lifetime `'a` here: `<'a>` + +error[E0412]: cannot find type `S` in this scope + --> $DIR/ice-type-mismatch-when-copying-112824.rs:5:24 + | +LL | pub struct Opcode2(&'a S); + | ^ not found in this scope + | +help: you might be missing a type parameter + | +LL | pub struct Opcode2<S>(&'a S); + | +++ + +error: could not evaluate constant pattern + --> $DIR/ice-type-mismatch-when-copying-112824.rs:15:9 + | +LL | Opcode2::OP2 => unimplemented!(), + | ^^^^^^^^^^^^ + +error: aborting due to 3 previous errors + +Some errors have detailed explanations: E0261, E0412. +For more information about an error, try `rustc --explain E0261`. diff --git a/tests/ui/consts/const-eval/raw-bytes.32bit.stderr b/tests/ui/consts/const-eval/raw-bytes.32bit.stderr index c06c3074116..c1748c2e237 100644 --- a/tests/ui/consts/const-eval/raw-bytes.32bit.stderr +++ b/tests/ui/consts/const-eval/raw-bytes.32bit.stderr @@ -68,7 +68,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/raw-bytes.rs:59:1 | LL | const NULL_U8: NonZero<u8> = unsafe { mem::transmute(0u8) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered 0, but expected something greater or equal to 1 | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 1, align: 1) { @@ -79,7 +79,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/raw-bytes.rs:61:1 | LL | const NULL_USIZE: NonZero<usize> = unsafe { mem::transmute(0usize) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered 0, but expected something greater or equal to 1 | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 4, align: 4) { diff --git a/tests/ui/consts/const-eval/raw-bytes.64bit.stderr b/tests/ui/consts/const-eval/raw-bytes.64bit.stderr index 0589280524c..eb97eab9db7 100644 --- a/tests/ui/consts/const-eval/raw-bytes.64bit.stderr +++ b/tests/ui/consts/const-eval/raw-bytes.64bit.stderr @@ -68,7 +68,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/raw-bytes.rs:59:1 | LL | const NULL_U8: NonZero<u8> = unsafe { mem::transmute(0u8) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered 0, but expected something greater or equal to 1 | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 1, align: 1) { @@ -79,7 +79,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/raw-bytes.rs:61:1 | LL | const NULL_USIZE: NonZero<usize> = unsafe { mem::transmute(0usize) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered 0, but expected something greater or equal to 1 | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 8) { diff --git a/tests/ui/consts/const-eval/ub-nonnull.stderr b/tests/ui/consts/const-eval/ub-nonnull.stderr index 70b961fe1cd..ab0fb2abdb3 100644 --- a/tests/ui/consts/const-eval/ub-nonnull.stderr +++ b/tests/ui/consts/const-eval/ub-nonnull.stderr @@ -19,7 +19,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-nonnull.rs:24:1 | LL | const NULL_U8: NonZero<u8> = unsafe { mem::transmute(0u8) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered 0, but expected something greater or equal to 1 | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) { @@ -30,7 +30,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-nonnull.rs:26:1 | LL | const NULL_USIZE: NonZero<usize> = unsafe { mem::transmute(0usize) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered 0, but expected something greater or equal to 1 | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) { diff --git a/tests/ui/consts/const-fn-error.stderr b/tests/ui/consts/const-fn-error.stderr index 68c335c71d9..14603e433c1 100644 --- a/tests/ui/consts/const-fn-error.stderr +++ b/tests/ui/consts/const-fn-error.stderr @@ -23,7 +23,10 @@ LL | for i in 0..x { note: impl defined here, but it is not `const` --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable +help: add `#![feature(const_trait_impl)]` to the crate attributes to enable + | +LL + #![feature(const_trait_impl)] + | error[E0658]: mutable references are not allowed in constant functions --> $DIR/const-fn-error.rs:5:14 @@ -42,7 +45,10 @@ LL | for i in 0..x { | ^^^^ | = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable +help: add `#![feature(const_trait_impl)]` to the crate attributes to enable + | +LL + #![feature(const_trait_impl)] + | error: aborting due to 4 previous errors diff --git a/tests/ui/consts/const-for-feature-gate.stderr b/tests/ui/consts/const-for-feature-gate.stderr index 413d144ca0a..0f2f912572e 100644 --- a/tests/ui/consts/const-for-feature-gate.stderr +++ b/tests/ui/consts/const-for-feature-gate.stderr @@ -17,7 +17,10 @@ LL | for _ in 0..5 {} note: impl defined here, but it is not `const` --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL = note: calls in constants are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable +help: add `#![feature(const_trait_impl)]` to the crate attributes to enable + | +LL + #![feature(const_trait_impl)] + | error[E0658]: mutable references are not allowed in constants --> $DIR/const-for-feature-gate.rs:4:14 @@ -36,7 +39,10 @@ LL | for _ in 0..5 {} | ^^^^ | = note: calls in constants are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable +help: add `#![feature(const_trait_impl)]` to the crate attributes to enable + | +LL + #![feature(const_trait_impl)] + | error: aborting due to 4 previous errors diff --git a/tests/ui/consts/const-for.stderr b/tests/ui/consts/const-for.stderr index 3fb9787c0d8..8605fb8eef5 100644 --- a/tests/ui/consts/const-for.stderr +++ b/tests/ui/consts/const-for.stderr @@ -7,7 +7,10 @@ LL | for _ in 0..5 {} note: impl defined here, but it is not `const` --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL = note: calls in constants are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable +help: add `#![feature(const_trait_impl)]` to the crate attributes to enable + | +LL + #![feature(const_trait_impl)] + | error[E0015]: cannot call non-const fn `<std::ops::Range<i32> as Iterator>::next` in constants --> $DIR/const-for.rs:5:14 @@ -16,7 +19,10 @@ LL | for _ in 0..5 {} | ^^^^ | = note: calls in constants are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable +help: add `#![feature(const_trait_impl)]` to the crate attributes to enable + | +LL + #![feature(const_trait_impl)] + | error: aborting due to 2 previous errors diff --git a/tests/ui/consts/const-try-feature-gate.stderr b/tests/ui/consts/const-try-feature-gate.stderr index efa1fb107f6..0c4c16fc56a 100644 --- a/tests/ui/consts/const-try-feature-gate.stderr +++ b/tests/ui/consts/const-try-feature-gate.stderr @@ -17,7 +17,10 @@ LL | Some(())?; note: impl defined here, but it is not `const` --> $SRC_DIR/core/src/option.rs:LL:COL = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable +help: add `#![feature(const_trait_impl)]` to the crate attributes to enable + | +LL + #![feature(const_trait_impl)] + | error[E0015]: `?` cannot convert from residual of `Option<()>` in constant functions --> $DIR/const-try-feature-gate.rs:4:5 @@ -28,7 +31,10 @@ LL | Some(())?; note: impl defined here, but it is not `const` --> $SRC_DIR/core/src/option.rs:LL:COL = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable +help: add `#![feature(const_trait_impl)]` to the crate attributes to enable + | +LL + #![feature(const_trait_impl)] + | error: aborting due to 3 previous errors diff --git a/tests/ui/consts/const-try.stderr b/tests/ui/consts/const-try.stderr index 37a6598af9e..2d91424c8d3 100644 --- a/tests/ui/consts/const-try.stderr +++ b/tests/ui/consts/const-try.stderr @@ -10,7 +10,10 @@ note: impl defined here, but it is not `const` LL | impl const Try for TryMe { | ^^^^^^^^^^^^^^^^^^^^^^^^ = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(effects)]` to the crate attributes to enable +help: add `#![feature(effects)]` to the crate attributes to enable + | +LL + #![feature(effects)] + | error[E0015]: `?` cannot convert from residual of `TryMe` in constant functions --> $DIR/const-try.rs:33:5 @@ -24,7 +27,10 @@ note: impl defined here, but it is not `const` LL | impl const FromResidual<Error> for TryMe { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(effects)]` to the crate attributes to enable +help: add `#![feature(effects)]` to the crate attributes to enable + | +LL + #![feature(effects)] + | error: aborting due to 2 previous errors diff --git a/tests/ui/consts/constifconst-call-in-const-position.stderr b/tests/ui/consts/constifconst-call-in-const-position.stderr index 42ad4125824..09827f29baf 100644 --- a/tests/ui/consts/constifconst-call-in-const-position.stderr +++ b/tests/ui/consts/constifconst-call-in-const-position.stderr @@ -14,7 +14,10 @@ LL | [0; T::a()] | ^^^^^^ | = note: calls in constants are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(effects)]` to the crate attributes to enable +help: add `#![feature(effects)]` to the crate attributes to enable + | +LL + #![feature(effects)] + | error[E0015]: cannot call non-const fn `<T as Tr>::a` in constants --> $DIR/constifconst-call-in-const-position.rs:16:38 @@ -23,7 +26,10 @@ LL | const fn foo<T: ~const Tr>() -> [u8; T::a()] { | ^^^^^^ | = note: calls in constants are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(effects)]` to the crate attributes to enable +help: add `#![feature(effects)]` to the crate attributes to enable + | +LL + #![feature(effects)] + | error: aborting due to 2 previous errors; 1 warning emitted diff --git a/tests/ui/consts/control-flow/dead_branches_dont_eval.rs b/tests/ui/consts/control-flow/dead_branches_dont_eval.rs new file mode 100644 index 00000000000..374349732f9 --- /dev/null +++ b/tests/ui/consts/control-flow/dead_branches_dont_eval.rs @@ -0,0 +1,46 @@ +//@ build-pass + +// issue 122301 - currently the only way to supress +// const eval and codegen of code conditional on some other const + +struct Foo<T, const N: usize>(T); + +impl<T, const N: usize> Foo<T, N> { + const BAR: () = if N == 0 { + panic!() + }; +} + +struct Invoke<T, const N: usize>(T); + +impl<T, const N: usize> Invoke<T, N> { + const FUN: fn() = if N != 0 { + || Foo::<T, N>::BAR + } else { + || {} + }; +} + +// without closures + +struct S<T>(T); +impl<T> S<T> { + const C: () = panic!(); +} + +const fn bar<T>() { S::<T>::C } + +struct ConstIf<T, const N: usize>(T); + +impl<T, const N: usize> ConstIf<T, N> { + const VAL: () = if N != 0 { + bar::<T>() // not called for N == 0, and hence not monomorphized + } else { + () + }; +} + +fn main() { + let _val = Invoke::<(), 0>::FUN(); + let _val = ConstIf::<(), 0>::VAL; +} diff --git a/tests/ui/consts/control-flow/loop.stderr b/tests/ui/consts/control-flow/loop.stderr index e162a404ace..2815b888ccd 100644 --- a/tests/ui/consts/control-flow/loop.stderr +++ b/tests/ui/consts/control-flow/loop.stderr @@ -37,7 +37,10 @@ LL | for i in 0..4 { note: impl defined here, but it is not `const` --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL = note: calls in constants are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable +help: add `#![feature(const_trait_impl)]` to the crate attributes to enable + | +LL + #![feature(const_trait_impl)] + | error[E0658]: mutable references are not allowed in constants --> $DIR/loop.rs:53:14 @@ -56,7 +59,10 @@ LL | for i in 0..4 { | ^^^^ | = note: calls in constants are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable +help: add `#![feature(const_trait_impl)]` to the crate attributes to enable + | +LL + #![feature(const_trait_impl)] + | error[E0015]: cannot convert `std::ops::Range<i32>` into an iterator in constants --> $DIR/loop.rs:60:14 @@ -67,7 +73,10 @@ LL | for i in 0..4 { note: impl defined here, but it is not `const` --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL = note: calls in constants are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable +help: add `#![feature(const_trait_impl)]` to the crate attributes to enable + | +LL + #![feature(const_trait_impl)] + | error[E0658]: mutable references are not allowed in constants --> $DIR/loop.rs:60:14 @@ -86,7 +95,10 @@ LL | for i in 0..4 { | ^^^^ | = note: calls in constants are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable +help: add `#![feature(const_trait_impl)]` to the crate attributes to enable + | +LL + #![feature(const_trait_impl)] + | error: aborting due to 8 previous errors diff --git a/tests/ui/consts/control-flow/try.stderr b/tests/ui/consts/control-flow/try.stderr index f4c42c4d819..e08f52369fa 100644 --- a/tests/ui/consts/control-flow/try.stderr +++ b/tests/ui/consts/control-flow/try.stderr @@ -17,7 +17,10 @@ LL | x?; note: impl defined here, but it is not `const` --> $SRC_DIR/core/src/option.rs:LL:COL = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable +help: add `#![feature(const_trait_impl)]` to the crate attributes to enable + | +LL + #![feature(const_trait_impl)] + | error[E0015]: `?` cannot convert from residual of `Option<i32>` in constant functions --> $DIR/try.rs:6:5 @@ -28,7 +31,10 @@ LL | x?; note: impl defined here, but it is not `const` --> $SRC_DIR/core/src/option.rs:LL:COL = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable +help: add `#![feature(const_trait_impl)]` to the crate attributes to enable + | +LL + #![feature(const_trait_impl)] + | error: aborting due to 3 previous errors diff --git a/tests/ui/consts/fn_trait_refs.stderr b/tests/ui/consts/fn_trait_refs.stderr index 527579d99ea..aad0ae64e85 100644 --- a/tests/ui/consts/fn_trait_refs.stderr +++ b/tests/ui/consts/fn_trait_refs.stderr @@ -81,7 +81,10 @@ LL | assert!(test_one == (1, 1, 1)); | ^^^^^^^^^^^^^^^^^^^^^ | = note: calls in constants are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(effects)]` to the crate attributes to enable +help: add `#![feature(effects)]` to the crate attributes to enable + | +LL + #![feature(effects)] + | error[E0015]: cannot call non-const operator in constants --> $DIR/fn_trait_refs.rs:75:17 @@ -90,7 +93,10 @@ LL | assert!(test_two == (2, 2)); | ^^^^^^^^^^^^^^^^^^ | = note: calls in constants are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(effects)]` to the crate attributes to enable +help: add `#![feature(effects)]` to the crate attributes to enable + | +LL + #![feature(effects)] + | error[E0015]: cannot call non-const closure in constant functions --> $DIR/fn_trait_refs.rs:17:5 @@ -99,11 +105,14 @@ LL | f() | ^^^ | = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(effects)]` to the crate attributes to enable help: consider further restricting this bound | LL | T: ~const Fn<()> + ~const Destruct + ~const std::ops::Fn<()>, | +++++++++++++++++++++++++ +help: add `#![feature(effects)]` to the crate attributes to enable + | +LL + #![feature(effects)] + | error[E0493]: destructor of `T` cannot be evaluated at compile-time --> $DIR/fn_trait_refs.rs:13:23 @@ -121,11 +130,14 @@ LL | f() | ^^^ | = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(effects)]` to the crate attributes to enable help: consider further restricting this bound | LL | T: ~const FnMut<()> + ~const Destruct + ~const std::ops::FnMut<()>, | ++++++++++++++++++++++++++++ +help: add `#![feature(effects)]` to the crate attributes to enable + | +LL + #![feature(effects)] + | error[E0493]: destructor of `T` cannot be evaluated at compile-time --> $DIR/fn_trait_refs.rs:20:27 @@ -143,11 +155,14 @@ LL | f() | ^^^ | = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(effects)]` to the crate attributes to enable help: consider further restricting this bound | LL | T: ~const FnOnce<()> + ~const std::ops::FnOnce<()>, | +++++++++++++++++++++++++++++ +help: add `#![feature(effects)]` to the crate attributes to enable + | +LL + #![feature(effects)] + | error[E0493]: destructor of `T` cannot be evaluated at compile-time --> $DIR/fn_trait_refs.rs:34:21 diff --git a/tests/ui/consts/invalid-inline-const-in-match-arm.stderr b/tests/ui/consts/invalid-inline-const-in-match-arm.stderr index a88c16158f3..7579f7f9692 100644 --- a/tests/ui/consts/invalid-inline-const-in-match-arm.stderr +++ b/tests/ui/consts/invalid-inline-const-in-match-arm.stderr @@ -6,7 +6,10 @@ LL | const { (|| {})() } => {} | = note: closures need an RFC before allowed to be called in constants = note: calls in constants are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable +help: add `#![feature(const_trait_impl)]` to the crate attributes to enable + | +LL + #![feature(const_trait_impl)] + | error: aborting due to 1 previous error diff --git a/tests/ui/consts/issue-103790.stderr b/tests/ui/consts/issue-103790.stderr index abe7366483b..eecaf5ff63a 100644 --- a/tests/ui/consts/issue-103790.stderr +++ b/tests/ui/consts/issue-103790.stderr @@ -62,7 +62,10 @@ LL | struct S<const S: (), const S: S = { S }>; | ^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: aborting due to 5 previous errors diff --git a/tests/ui/consts/issue-28113.stderr b/tests/ui/consts/issue-28113.stderr index 01bbe4bc9b9..c2f53870173 100644 --- a/tests/ui/consts/issue-28113.stderr +++ b/tests/ui/consts/issue-28113.stderr @@ -6,7 +6,10 @@ LL | || -> u8 { 5 }() | = note: closures need an RFC before allowed to be called in constants = note: calls in constants are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable +help: add `#![feature(const_trait_impl)]` to the crate attributes to enable + | +LL + #![feature(const_trait_impl)] + | error: aborting due to 1 previous error diff --git a/tests/ui/consts/issue-56164.stderr b/tests/ui/consts/issue-56164.stderr index 1b267214a02..6ec4ce0fbd7 100644 --- a/tests/ui/consts/issue-56164.stderr +++ b/tests/ui/consts/issue-56164.stderr @@ -6,7 +6,10 @@ LL | const fn foo() { (||{})() } | = note: closures need an RFC before allowed to be called in constant functions = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable +help: add `#![feature(const_trait_impl)]` to the crate attributes to enable + | +LL + #![feature(const_trait_impl)] + | error: function pointer calls are not allowed in constant functions --> $DIR/issue-56164.rs:5:5 diff --git a/tests/ui/consts/issue-68542-closure-in-array-len.stderr b/tests/ui/consts/issue-68542-closure-in-array-len.stderr index 3c0408cbedf..b414a6e0dba 100644 --- a/tests/ui/consts/issue-68542-closure-in-array-len.stderr +++ b/tests/ui/consts/issue-68542-closure-in-array-len.stderr @@ -6,7 +6,10 @@ LL | a: [(); (|| { 0 })()] | = note: closures need an RFC before allowed to be called in constants = note: calls in constants are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable +help: add `#![feature(const_trait_impl)]` to the crate attributes to enable + | +LL + #![feature(const_trait_impl)] + | error: aborting due to 1 previous error diff --git a/tests/ui/consts/issue-73976-monomorphic.stderr b/tests/ui/consts/issue-73976-monomorphic.stderr index 465efc7bfc2..79dbed4bea8 100644 --- a/tests/ui/consts/issue-73976-monomorphic.stderr +++ b/tests/ui/consts/issue-73976-monomorphic.stderr @@ -7,7 +7,10 @@ LL | GetTypeId::<T>::VALUE == GetTypeId::<usize>::VALUE note: impl defined here, but it is not `const` --> $SRC_DIR/core/src/any.rs:LL:COL = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(effects)]` to the crate attributes to enable +help: add `#![feature(effects)]` to the crate attributes to enable + | +LL + #![feature(effects)] + | error: aborting due to 1 previous error diff --git a/tests/ui/consts/issue-90870.fixed b/tests/ui/consts/issue-90870.fixed deleted file mode 100644 index c125501f61c..00000000000 --- a/tests/ui/consts/issue-90870.fixed +++ /dev/null @@ -1,37 +0,0 @@ -// Regression test for issue #90870. - -//@ run-rustfix - -#![allow(dead_code)] - -const fn f(a: &u8, b: &u8) -> bool { - *a == *b - //~^ ERROR: cannot call non-const operator in constant functions [E0015] - //~| HELP: consider dereferencing here - //~| HELP: add `#![feature(const_trait_impl)]` -} - -const fn g(a: &&&&i64, b: &&&&i64) -> bool { - ****a == ****b - //~^ ERROR: cannot call non-const operator in constant functions [E0015] - //~| HELP: consider dereferencing here - //~| HELP: add `#![feature(const_trait_impl)]` -} - -const fn h(mut a: &[u8], mut b: &[u8]) -> bool { - while let ([l, at @ ..], [r, bt @ ..]) = (a, b) { - if *l == *r { - //~^ ERROR: cannot call non-const operator in constant functions [E0015] - //~| HELP: consider dereferencing here - //~| HELP: add `#![feature(const_trait_impl)]` - a = at; - b = bt; - } else { - return false; - } - } - - a.is_empty() && b.is_empty() -} - -fn main() {} diff --git a/tests/ui/consts/issue-90870.rs b/tests/ui/consts/issue-90870.rs index 94254fb27f9..e1929c68c70 100644 --- a/tests/ui/consts/issue-90870.rs +++ b/tests/ui/consts/issue-90870.rs @@ -1,21 +1,20 @@ // Regression test for issue #90870. -//@ run-rustfix - #![allow(dead_code)] const fn f(a: &u8, b: &u8) -> bool { +//~^ HELP: add `#![feature(const_trait_impl)]` +//~| HELP: add `#![feature(const_trait_impl)]` +//~| HELP: add `#![feature(const_trait_impl)]` a == b //~^ ERROR: cannot call non-const operator in constant functions [E0015] //~| HELP: consider dereferencing here - //~| HELP: add `#![feature(const_trait_impl)]` } const fn g(a: &&&&i64, b: &&&&i64) -> bool { a == b //~^ ERROR: cannot call non-const operator in constant functions [E0015] //~| HELP: consider dereferencing here - //~| HELP: add `#![feature(const_trait_impl)]` } const fn h(mut a: &[u8], mut b: &[u8]) -> bool { @@ -23,7 +22,6 @@ const fn h(mut a: &[u8], mut b: &[u8]) -> bool { if l == r { //~^ ERROR: cannot call non-const operator in constant functions [E0015] //~| HELP: consider dereferencing here - //~| HELP: add `#![feature(const_trait_impl)]` a = at; b = bt; } else { diff --git a/tests/ui/consts/issue-90870.stderr b/tests/ui/consts/issue-90870.stderr index 8825efd1449..df88a0c95cc 100644 --- a/tests/ui/consts/issue-90870.stderr +++ b/tests/ui/consts/issue-90870.stderr @@ -1,15 +1,18 @@ error[E0015]: cannot call non-const operator in constant functions - --> $DIR/issue-90870.rs:8:5 + --> $DIR/issue-90870.rs:9:5 | LL | a == b | ^^^^^^ | = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable help: consider dereferencing here | LL | *a == *b | + + +help: add `#![feature(const_trait_impl)]` to the crate attributes to enable + | +LL + #![feature(const_trait_impl)] + | error[E0015]: cannot call non-const operator in constant functions --> $DIR/issue-90870.rs:15:5 @@ -18,24 +21,30 @@ LL | a == b | ^^^^^^ | = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable help: consider dereferencing here | LL | ****a == ****b | ++++ ++++ +help: add `#![feature(const_trait_impl)]` to the crate attributes to enable + | +LL + #![feature(const_trait_impl)] + | error[E0015]: cannot call non-const operator in constant functions - --> $DIR/issue-90870.rs:23:12 + --> $DIR/issue-90870.rs:22:12 | LL | if l == r { | ^^^^^^ | = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable help: consider dereferencing here | LL | if *l == *r { | + + +help: add `#![feature(const_trait_impl)]` to the crate attributes to enable + | +LL + #![feature(const_trait_impl)] + | error: aborting due to 3 previous errors diff --git a/tests/ui/consts/issue-94675.stderr b/tests/ui/consts/issue-94675.stderr index 60a56f85c11..ebfa09b2e5d 100644 --- a/tests/ui/consts/issue-94675.stderr +++ b/tests/ui/consts/issue-94675.stderr @@ -15,7 +15,10 @@ LL | self.bar[0] = baz.len(); note: impl defined here, but it is not `const` --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(effects)]` to the crate attributes to enable +help: add `#![feature(effects)]` to the crate attributes to enable + | +LL + #![feature(effects)] + | error: aborting due to 2 previous errors diff --git a/tests/ui/consts/required-consts/collect-in-called-fn.noopt.stderr b/tests/ui/consts/required-consts/collect-in-called-fn.noopt.stderr index 14a4cb0217f..c3b641a899a 100644 --- a/tests/ui/consts/required-consts/collect-in-called-fn.noopt.stderr +++ b/tests/ui/consts/required-consts/collect-in-called-fn.noopt.stderr @@ -1,19 +1,19 @@ error[E0080]: evaluation of `Fail::<i32>::C` failed - --> $DIR/collect-in-called-fn.rs:9:19 + --> $DIR/collect-in-called-fn.rs:10:19 | LL | const C: () = panic!(); - | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-called-fn.rs:9:19 + | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-called-fn.rs:10:19 | = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) note: erroneous constant encountered - --> $DIR/collect-in-called-fn.rs:18:17 + --> $DIR/collect-in-called-fn.rs:19:17 | LL | let _ = Fail::<T>::C; | ^^^^^^^^^^^^ note: the above error was encountered while instantiating `fn called::<i32>` - --> $DIR/collect-in-called-fn.rs:23:5 + --> $DIR/collect-in-called-fn.rs:24:5 | LL | called::<i32>(); | ^^^^^^^^^^^^^^^ diff --git a/tests/ui/consts/required-consts/collect-in-called-fn.opt.stderr b/tests/ui/consts/required-consts/collect-in-called-fn.opt.stderr index 14a4cb0217f..c3b641a899a 100644 --- a/tests/ui/consts/required-consts/collect-in-called-fn.opt.stderr +++ b/tests/ui/consts/required-consts/collect-in-called-fn.opt.stderr @@ -1,19 +1,19 @@ error[E0080]: evaluation of `Fail::<i32>::C` failed - --> $DIR/collect-in-called-fn.rs:9:19 + --> $DIR/collect-in-called-fn.rs:10:19 | LL | const C: () = panic!(); - | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-called-fn.rs:9:19 + | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-called-fn.rs:10:19 | = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) note: erroneous constant encountered - --> $DIR/collect-in-called-fn.rs:18:17 + --> $DIR/collect-in-called-fn.rs:19:17 | LL | let _ = Fail::<T>::C; | ^^^^^^^^^^^^ note: the above error was encountered while instantiating `fn called::<i32>` - --> $DIR/collect-in-called-fn.rs:23:5 + --> $DIR/collect-in-called-fn.rs:24:5 | LL | called::<i32>(); | ^^^^^^^^^^^^^^^ diff --git a/tests/ui/consts/required-consts/collect-in-called-fn.rs b/tests/ui/consts/required-consts/collect-in-called-fn.rs index 55133a10cd9..93947950af2 100644 --- a/tests/ui/consts/required-consts/collect-in-called-fn.rs +++ b/tests/ui/consts/required-consts/collect-in-called-fn.rs @@ -1,5 +1,6 @@ //@revisions: noopt opt //@ build-fail +//@[noopt] compile-flags: -Copt-level=0 //@[opt] compile-flags: -O //! Make sure we detect erroneous constants post-monomorphization even when they are unused. This is //! crucial, people rely on it for soundness. (https://github.com/rust-lang/rust/issues/112090) diff --git a/tests/ui/consts/required-consts/collect-in-dead-closure.noopt.stderr b/tests/ui/consts/required-consts/collect-in-dead-closure.noopt.stderr new file mode 100644 index 00000000000..75c3575a110 --- /dev/null +++ b/tests/ui/consts/required-consts/collect-in-dead-closure.noopt.stderr @@ -0,0 +1,23 @@ +error[E0080]: evaluation of `Fail::<i32>::C` failed + --> $DIR/collect-in-dead-closure.rs:9:19 + | +LL | const C: () = panic!(); + | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-closure.rs:9:19 + | + = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) + +note: erroneous constant encountered + --> $DIR/collect-in-dead-closure.rs:17:17 + | +LL | let _ = Fail::<T>::C; + | ^^^^^^^^^^^^ + +note: the above error was encountered while instantiating `fn not_called::<i32>` + --> $DIR/collect-in-dead-closure.rs:24:33 + | +LL | let _closure: fn() = || not_called::<T>(); + | ^^^^^^^^^^^^^^^^^ + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0080`. diff --git a/tests/ui/consts/required-consts/collect-in-dead-closure.opt.stderr b/tests/ui/consts/required-consts/collect-in-dead-closure.opt.stderr new file mode 100644 index 00000000000..75c3575a110 --- /dev/null +++ b/tests/ui/consts/required-consts/collect-in-dead-closure.opt.stderr @@ -0,0 +1,23 @@ +error[E0080]: evaluation of `Fail::<i32>::C` failed + --> $DIR/collect-in-dead-closure.rs:9:19 + | +LL | const C: () = panic!(); + | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-closure.rs:9:19 + | + = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) + +note: erroneous constant encountered + --> $DIR/collect-in-dead-closure.rs:17:17 + | +LL | let _ = Fail::<T>::C; + | ^^^^^^^^^^^^ + +note: the above error was encountered while instantiating `fn not_called::<i32>` + --> $DIR/collect-in-dead-closure.rs:24:33 + | +LL | let _closure: fn() = || not_called::<T>(); + | ^^^^^^^^^^^^^^^^^ + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0080`. diff --git a/tests/ui/consts/required-consts/collect-in-dead-closure.rs b/tests/ui/consts/required-consts/collect-in-dead-closure.rs new file mode 100644 index 00000000000..a00214c62db --- /dev/null +++ b/tests/ui/consts/required-consts/collect-in-dead-closure.rs @@ -0,0 +1,30 @@ +//@revisions: noopt opt +//@ build-fail +//@[noopt] compile-flags: -Copt-level=0 +//@[opt] compile-flags: -O +//! This fails without optimizations, so it should also fail with optimizations. + +struct Fail<T>(T); +impl<T> Fail<T> { + const C: () = panic!(); //~ERROR evaluation of `Fail::<i32>::C` failed +} + +// This function is not actually called, but it is mentioned in a closure that is coerced to a +// function pointer in dead code in a function that is called. Make sure we still find this error. +#[inline(never)] +fn not_called<T>() { + if false { + let _ = Fail::<T>::C; + } +} + +#[inline(never)] +fn called<T>() { + if false { + let _closure: fn() = || not_called::<T>(); + } +} + +pub fn main() { + called::<i32>(); +} diff --git a/tests/ui/consts/required-consts/collect-in-dead-drop.noopt.stderr b/tests/ui/consts/required-consts/collect-in-dead-drop.noopt.stderr index 0bf231d09f1..73790f7517d 100644 --- a/tests/ui/consts/required-consts/collect-in-dead-drop.noopt.stderr +++ b/tests/ui/consts/required-consts/collect-in-dead-drop.noopt.stderr @@ -1,13 +1,13 @@ error[E0080]: evaluation of `Fail::<i32>::C` failed - --> $DIR/collect-in-dead-drop.rs:12:19 + --> $DIR/collect-in-dead-drop.rs:9:19 | LL | const C: () = panic!(); - | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-drop.rs:12:19 + | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-drop.rs:9:19 | = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) note: erroneous constant encountered - --> $DIR/collect-in-dead-drop.rs:19:17 + --> $DIR/collect-in-dead-drop.rs:16:17 | LL | let _ = Fail::<T>::C; | ^^^^^^^^^^^^ diff --git a/tests/ui/consts/required-consts/collect-in-dead-drop.opt.stderr b/tests/ui/consts/required-consts/collect-in-dead-drop.opt.stderr new file mode 100644 index 00000000000..73790f7517d --- /dev/null +++ b/tests/ui/consts/required-consts/collect-in-dead-drop.opt.stderr @@ -0,0 +1,20 @@ +error[E0080]: evaluation of `Fail::<i32>::C` failed + --> $DIR/collect-in-dead-drop.rs:9:19 + | +LL | const C: () = panic!(); + | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-drop.rs:9:19 + | + = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) + +note: erroneous constant encountered + --> $DIR/collect-in-dead-drop.rs:16:17 + | +LL | let _ = Fail::<T>::C; + | ^^^^^^^^^^^^ + +note: the above error was encountered while instantiating `fn <Fail<i32> as std::ops::Drop>::drop` + --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0080`. diff --git a/tests/ui/consts/required-consts/collect-in-dead-drop.rs b/tests/ui/consts/required-consts/collect-in-dead-drop.rs index c9ffcec6903..389fcf5dfc9 100644 --- a/tests/ui/consts/required-consts/collect-in-dead-drop.rs +++ b/tests/ui/consts/required-consts/collect-in-dead-drop.rs @@ -1,15 +1,12 @@ //@revisions: noopt opt -//@[noopt] build-fail +//@ build-fail +//@[noopt] compile-flags: -Copt-level=0 //@[opt] compile-flags: -O -//FIXME: `opt` revision currently does not stop with an error due to -//<https://github.com/rust-lang/rust/issues/107503>. -//@[opt] build-pass -//! Make sure we detect erroneous constants post-monomorphization even when they are unused. This is -//! crucial, people rely on it for soundness. (https://github.com/rust-lang/rust/issues/112090) +//! This fails without optimizations, so it should also fail with optimizations. struct Fail<T>(T); impl<T> Fail<T> { - const C: () = panic!(); //[noopt]~ERROR evaluation of `Fail::<i32>::C` failed + const C: () = panic!(); //~ERROR evaluation of `Fail::<i32>::C` failed } // This function is not actually called, but is mentioned implicitly as destructor in dead code in a diff --git a/tests/ui/consts/required-consts/collect-in-dead-fn-behind-assoc-type.noopt.stderr b/tests/ui/consts/required-consts/collect-in-dead-fn-behind-assoc-type.noopt.stderr new file mode 100644 index 00000000000..706c0d55b62 --- /dev/null +++ b/tests/ui/consts/required-consts/collect-in-dead-fn-behind-assoc-type.noopt.stderr @@ -0,0 +1,20 @@ +error[E0080]: evaluation of `Fail::<i32>::C` failed + --> $DIR/collect-in-dead-fn-behind-assoc-type.rs:10:19 + | +LL | const C: () = panic!(); + | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn-behind-assoc-type.rs:10:19 + | + = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) + +note: erroneous constant encountered + --> $DIR/collect-in-dead-fn-behind-assoc-type.rs:16:17 + | +LL | let _ = Fail::<T>::C; + | ^^^^^^^^^^^^ + +note: the above error was encountered while instantiating `fn not_called::<i32>` + --> $SRC_DIR/core/src/ops/function.rs:LL:COL + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0080`. diff --git a/tests/ui/consts/required-consts/collect-in-dead-fn-behind-assoc-type.opt.stderr b/tests/ui/consts/required-consts/collect-in-dead-fn-behind-assoc-type.opt.stderr new file mode 100644 index 00000000000..706c0d55b62 --- /dev/null +++ b/tests/ui/consts/required-consts/collect-in-dead-fn-behind-assoc-type.opt.stderr @@ -0,0 +1,20 @@ +error[E0080]: evaluation of `Fail::<i32>::C` failed + --> $DIR/collect-in-dead-fn-behind-assoc-type.rs:10:19 + | +LL | const C: () = panic!(); + | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn-behind-assoc-type.rs:10:19 + | + = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) + +note: erroneous constant encountered + --> $DIR/collect-in-dead-fn-behind-assoc-type.rs:16:17 + | +LL | let _ = Fail::<T>::C; + | ^^^^^^^^^^^^ + +note: the above error was encountered while instantiating `fn not_called::<i32>` + --> $SRC_DIR/core/src/ops/function.rs:LL:COL + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0080`. diff --git a/tests/ui/consts/required-consts/collect-in-dead-fn-behind-assoc-type.rs b/tests/ui/consts/required-consts/collect-in-dead-fn-behind-assoc-type.rs new file mode 100644 index 00000000000..9c36af50bb7 --- /dev/null +++ b/tests/ui/consts/required-consts/collect-in-dead-fn-behind-assoc-type.rs @@ -0,0 +1,49 @@ +#![feature(impl_trait_in_assoc_type)] +//@revisions: noopt opt +//@ build-fail +//@[noopt] compile-flags: -Copt-level=0 +//@[opt] compile-flags: -O +//! This fails without optimizations, so it should also fail with optimizations. + +struct Fail<T>(T); +impl<T> Fail<T> { + const C: () = panic!(); //~ERROR evaluation of `Fail::<i32>::C` failed +} + +#[inline(never)] +fn not_called<T>() { + if false { + let _ = Fail::<T>::C; + } +} + +#[inline(never)] +fn callit_not(f: impl Fn()) { + if false { + f(); + } +} + +// Using `Fn` here is important; with `FnOnce` another shim gets involved which somehow makes this +// easier to collect properly. +trait Hideaway { + type T: Fn(); + const C: Self::T; +} +impl Hideaway for () { + type T = impl Fn(); + const C: Self::T = not_called::<i32>; +} + +#[inline(never)] +fn reveal<T: Hideaway>() { + if false { + callit_not(T::C); + } +} + +fn main() { + if false { + reveal::<()>() + } +} diff --git a/tests/ui/consts/required-consts/collect-in-dead-fn-behind-generic.noopt.stderr b/tests/ui/consts/required-consts/collect-in-dead-fn-behind-generic.noopt.stderr new file mode 100644 index 00000000000..581edd2b7b8 --- /dev/null +++ b/tests/ui/consts/required-consts/collect-in-dead-fn-behind-generic.noopt.stderr @@ -0,0 +1,20 @@ +error[E0080]: evaluation of `Fail::<i32>::C` failed + --> $DIR/collect-in-dead-fn-behind-generic.rs:9:19 + | +LL | const C: () = panic!(); + | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn-behind-generic.rs:9:19 + | + = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) + +note: erroneous constant encountered + --> $DIR/collect-in-dead-fn-behind-generic.rs:15:17 + | +LL | let _ = Fail::<T>::C; + | ^^^^^^^^^^^^ + +note: the above error was encountered while instantiating `fn not_called::<i32>` + --> $SRC_DIR/core/src/ops/function.rs:LL:COL + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0080`. diff --git a/tests/ui/consts/required-consts/collect-in-dead-fn-behind-generic.opt.stderr b/tests/ui/consts/required-consts/collect-in-dead-fn-behind-generic.opt.stderr new file mode 100644 index 00000000000..581edd2b7b8 --- /dev/null +++ b/tests/ui/consts/required-consts/collect-in-dead-fn-behind-generic.opt.stderr @@ -0,0 +1,20 @@ +error[E0080]: evaluation of `Fail::<i32>::C` failed + --> $DIR/collect-in-dead-fn-behind-generic.rs:9:19 + | +LL | const C: () = panic!(); + | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn-behind-generic.rs:9:19 + | + = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) + +note: erroneous constant encountered + --> $DIR/collect-in-dead-fn-behind-generic.rs:15:17 + | +LL | let _ = Fail::<T>::C; + | ^^^^^^^^^^^^ + +note: the above error was encountered while instantiating `fn not_called::<i32>` + --> $SRC_DIR/core/src/ops/function.rs:LL:COL + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0080`. diff --git a/tests/ui/consts/required-consts/collect-in-dead-fn-behind-generic.rs b/tests/ui/consts/required-consts/collect-in-dead-fn-behind-generic.rs new file mode 100644 index 00000000000..5829d914ee1 --- /dev/null +++ b/tests/ui/consts/required-consts/collect-in-dead-fn-behind-generic.rs @@ -0,0 +1,30 @@ +//@revisions: noopt opt +//@ build-fail +//@[noopt] compile-flags: -Copt-level=0 +//@[opt] compile-flags: -O +//! This fails without optimizations, so it should also fail with optimizations. + +struct Fail<T>(T); +impl<T> Fail<T> { + const C: () = panic!(); //~ERROR evaluation of `Fail::<i32>::C` failed +} + +#[inline(never)] +fn not_called<T>() { + if false { + let _ = Fail::<T>::C; + } +} + +#[inline(never)] +fn callit_not(f: impl Fn()) { + if false { + f(); + } +} + +fn main() { + if false { + callit_not(not_called::<i32>) + } +} diff --git a/tests/ui/consts/required-consts/collect-in-dead-fn-behind-opaque-type.noopt.stderr b/tests/ui/consts/required-consts/collect-in-dead-fn-behind-opaque-type.noopt.stderr new file mode 100644 index 00000000000..07e46b8a816 --- /dev/null +++ b/tests/ui/consts/required-consts/collect-in-dead-fn-behind-opaque-type.noopt.stderr @@ -0,0 +1,20 @@ +error[E0080]: evaluation of `m::Fail::<i32>::C` failed + --> $DIR/collect-in-dead-fn-behind-opaque-type.rs:11:23 + | +LL | const C: () = panic!(); + | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn-behind-opaque-type.rs:11:23 + | + = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) + +note: erroneous constant encountered + --> $DIR/collect-in-dead-fn-behind-opaque-type.rs:19:21 + | +LL | let _ = Fail::<T>::C; + | ^^^^^^^^^^^^ + +note: the above error was encountered while instantiating `fn m::not_called::<i32>` + --> $SRC_DIR/core/src/ops/function.rs:LL:COL + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0080`. diff --git a/tests/ui/consts/required-consts/collect-in-dead-fn-behind-opaque-type.opt.stderr b/tests/ui/consts/required-consts/collect-in-dead-fn-behind-opaque-type.opt.stderr new file mode 100644 index 00000000000..07e46b8a816 --- /dev/null +++ b/tests/ui/consts/required-consts/collect-in-dead-fn-behind-opaque-type.opt.stderr @@ -0,0 +1,20 @@ +error[E0080]: evaluation of `m::Fail::<i32>::C` failed + --> $DIR/collect-in-dead-fn-behind-opaque-type.rs:11:23 + | +LL | const C: () = panic!(); + | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn-behind-opaque-type.rs:11:23 + | + = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) + +note: erroneous constant encountered + --> $DIR/collect-in-dead-fn-behind-opaque-type.rs:19:21 + | +LL | let _ = Fail::<T>::C; + | ^^^^^^^^^^^^ + +note: the above error was encountered while instantiating `fn m::not_called::<i32>` + --> $SRC_DIR/core/src/ops/function.rs:LL:COL + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0080`. diff --git a/tests/ui/consts/required-consts/collect-in-dead-fn-behind-opaque-type.rs b/tests/ui/consts/required-consts/collect-in-dead-fn-behind-opaque-type.rs new file mode 100644 index 00000000000..795e021ceb0 --- /dev/null +++ b/tests/ui/consts/required-consts/collect-in-dead-fn-behind-opaque-type.rs @@ -0,0 +1,37 @@ +//@revisions: noopt opt +//@ build-fail +//@[noopt] compile-flags: -Copt-level=0 +//@[opt] compile-flags: -O +//! This fails without optimizations, so it should also fail with optimizations. +#![feature(type_alias_impl_trait)] + +mod m { + struct Fail<T>(T); + impl<T> Fail<T> { + const C: () = panic!(); //~ERROR evaluation of `m::Fail::<i32>::C` failed + } + + pub type NotCalledFn = impl Fn(); + + #[inline(never)] + fn not_called<T>() { + if false { + let _ = Fail::<T>::C; + } + } + + fn mk_not_called() -> NotCalledFn { + not_called::<i32> + } +} + +fn main() { + // This does not involve a constant of `FnDef` type, it generates the value via unsafe + // shenanigans instead. This ensures that we check all `FnDef` types that occur in a function, + // not just those of constants. Furthermore the `FnDef` is behind an opaque type which bust be + // normalized away to reveal the function type. + if false { + let x: m::NotCalledFn = unsafe { std::mem::transmute(()) }; + x(); + } +} diff --git a/tests/ui/consts/required-consts/collect-in-dead-fn.noopt.stderr b/tests/ui/consts/required-consts/collect-in-dead-fn.noopt.stderr index 8bb99efe8e4..52462076ff9 100644 --- a/tests/ui/consts/required-consts/collect-in-dead-fn.noopt.stderr +++ b/tests/ui/consts/required-consts/collect-in-dead-fn.noopt.stderr @@ -1,19 +1,19 @@ error[E0080]: evaluation of `Fail::<i32>::C` failed - --> $DIR/collect-in-dead-fn.rs:12:19 + --> $DIR/collect-in-dead-fn.rs:9:19 | LL | const C: () = panic!(); - | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn.rs:12:19 + | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn.rs:9:19 | = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) note: erroneous constant encountered - --> $DIR/collect-in-dead-fn.rs:22:17 + --> $DIR/collect-in-dead-fn.rs:19:17 | LL | let _ = Fail::<T>::C; | ^^^^^^^^^^^^ note: the above error was encountered while instantiating `fn not_called::<i32>` - --> $DIR/collect-in-dead-fn.rs:29:9 + --> $DIR/collect-in-dead-fn.rs:26:9 | LL | not_called::<T>(); | ^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/consts/required-consts/collect-in-dead-fn.opt.stderr b/tests/ui/consts/required-consts/collect-in-dead-fn.opt.stderr new file mode 100644 index 00000000000..52462076ff9 --- /dev/null +++ b/tests/ui/consts/required-consts/collect-in-dead-fn.opt.stderr @@ -0,0 +1,23 @@ +error[E0080]: evaluation of `Fail::<i32>::C` failed + --> $DIR/collect-in-dead-fn.rs:9:19 + | +LL | const C: () = panic!(); + | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fn.rs:9:19 + | + = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) + +note: erroneous constant encountered + --> $DIR/collect-in-dead-fn.rs:19:17 + | +LL | let _ = Fail::<T>::C; + | ^^^^^^^^^^^^ + +note: the above error was encountered while instantiating `fn not_called::<i32>` + --> $DIR/collect-in-dead-fn.rs:26:9 + | +LL | not_called::<T>(); + | ^^^^^^^^^^^^^^^^^ + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0080`. diff --git a/tests/ui/consts/required-consts/collect-in-dead-fn.rs b/tests/ui/consts/required-consts/collect-in-dead-fn.rs index 9e6b1519153..1c95e0c303f 100644 --- a/tests/ui/consts/required-consts/collect-in-dead-fn.rs +++ b/tests/ui/consts/required-consts/collect-in-dead-fn.rs @@ -1,15 +1,12 @@ //@revisions: noopt opt -//@[noopt] build-fail +//@ build-fail +//@[noopt] compile-flags: -Copt-level=0 //@[opt] compile-flags: -O -//FIXME: `opt` revision currently does not stop with an error due to -//<https://github.com/rust-lang/rust/issues/107503>. -//@[opt] build-pass -//! Make sure we detect erroneous constants post-monomorphization even when they are unused. This is -//! crucial, people rely on it for soundness. (https://github.com/rust-lang/rust/issues/112090) +//! This fails without optimizations, so it should also fail with optimizations. struct Fail<T>(T); impl<T> Fail<T> { - const C: () = panic!(); //[noopt]~ERROR evaluation of `Fail::<i32>::C` failed + const C: () = panic!(); //~ERROR evaluation of `Fail::<i32>::C` failed } // This function is not actually called, but it is mentioned in dead code in a function that is diff --git a/tests/ui/consts/required-consts/collect-in-dead-fnptr-in-const.noopt.stderr b/tests/ui/consts/required-consts/collect-in-dead-fnptr-in-const.noopt.stderr new file mode 100644 index 00000000000..dea2a342383 --- /dev/null +++ b/tests/ui/consts/required-consts/collect-in-dead-fnptr-in-const.noopt.stderr @@ -0,0 +1,20 @@ +error[E0080]: evaluation of `Late::<i32>::FAIL` failed + --> $DIR/collect-in-dead-fnptr-in-const.rs:9:22 + | +LL | const FAIL: () = panic!(); + | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fnptr-in-const.rs:9:22 + | + = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) + +note: erroneous constant encountered + --> $DIR/collect-in-dead-fnptr-in-const.rs:10:28 + | +LL | const FNPTR: fn() = || Self::FAIL; + | ^^^^^^^^^^ + +note: the above error was encountered while instantiating `fn Late::<i32>::FNPTR::{closure#0}` + --> $SRC_DIR/core/src/ops/function.rs:LL:COL + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0080`. diff --git a/tests/ui/consts/required-consts/collect-in-dead-fnptr-in-const.opt.stderr b/tests/ui/consts/required-consts/collect-in-dead-fnptr-in-const.opt.stderr new file mode 100644 index 00000000000..dea2a342383 --- /dev/null +++ b/tests/ui/consts/required-consts/collect-in-dead-fnptr-in-const.opt.stderr @@ -0,0 +1,20 @@ +error[E0080]: evaluation of `Late::<i32>::FAIL` failed + --> $DIR/collect-in-dead-fnptr-in-const.rs:9:22 + | +LL | const FAIL: () = panic!(); + | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fnptr-in-const.rs:9:22 + | + = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) + +note: erroneous constant encountered + --> $DIR/collect-in-dead-fnptr-in-const.rs:10:28 + | +LL | const FNPTR: fn() = || Self::FAIL; + | ^^^^^^^^^^ + +note: the above error was encountered while instantiating `fn Late::<i32>::FNPTR::{closure#0}` + --> $SRC_DIR/core/src/ops/function.rs:LL:COL + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0080`. diff --git a/tests/ui/consts/required-consts/collect-in-dead-fnptr-in-const.rs b/tests/ui/consts/required-consts/collect-in-dead-fnptr-in-const.rs new file mode 100644 index 00000000000..8b6344c93f3 --- /dev/null +++ b/tests/ui/consts/required-consts/collect-in-dead-fnptr-in-const.rs @@ -0,0 +1,34 @@ +//@revisions: noopt opt +//@ build-fail +//@[noopt] compile-flags: -Copt-level=0 +//@[opt] compile-flags: -O +//! This fails without optimizations, so it should also fail with optimizations. + +struct Late<T>(T); +impl<T> Late<T> { + const FAIL: () = panic!(); //~ERROR evaluation of `Late::<i32>::FAIL` failed + const FNPTR: fn() = || Self::FAIL; +} + +// This function is not actually called, but it is mentioned in dead code in a function that is +// called. The function then mentions a const that evaluates to a fnptr that points to a function +// that used a const that fails to evaluate. +// This tests that when processing mentioned items, we also check the fnptrs in the final values +// of consts that we encounter. +#[inline(never)] +fn not_called<T>() { + if false { + let _ = Late::<T>::FNPTR; + } +} + +#[inline(never)] +fn called<T>() { + if false { + not_called::<T>(); + } +} + +pub fn main() { + called::<i32>(); +} diff --git a/tests/ui/consts/required-consts/collect-in-dead-fnptr.noopt.stderr b/tests/ui/consts/required-consts/collect-in-dead-fnptr.noopt.stderr new file mode 100644 index 00000000000..51c68782687 --- /dev/null +++ b/tests/ui/consts/required-consts/collect-in-dead-fnptr.noopt.stderr @@ -0,0 +1,23 @@ +error[E0080]: evaluation of `Fail::<i32>::C` failed + --> $DIR/collect-in-dead-fnptr.rs:9:19 + | +LL | const C: () = panic!(); + | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fnptr.rs:9:19 + | + = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) + +note: erroneous constant encountered + --> $DIR/collect-in-dead-fnptr.rs:18:17 + | +LL | let _ = Fail::<T>::C; + | ^^^^^^^^^^^^ + +note: the above error was encountered while instantiating `fn not_called::<i32>` + --> $DIR/collect-in-dead-fnptr.rs:27:28 + | +LL | let _fnptr: fn() = not_called::<T>; + | ^^^^^^^^^^^^^^^ + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0080`. diff --git a/tests/ui/consts/required-consts/collect-in-dead-fnptr.opt.stderr b/tests/ui/consts/required-consts/collect-in-dead-fnptr.opt.stderr new file mode 100644 index 00000000000..51c68782687 --- /dev/null +++ b/tests/ui/consts/required-consts/collect-in-dead-fnptr.opt.stderr @@ -0,0 +1,23 @@ +error[E0080]: evaluation of `Fail::<i32>::C` failed + --> $DIR/collect-in-dead-fnptr.rs:9:19 + | +LL | const C: () = panic!(); + | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-fnptr.rs:9:19 + | + = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) + +note: erroneous constant encountered + --> $DIR/collect-in-dead-fnptr.rs:18:17 + | +LL | let _ = Fail::<T>::C; + | ^^^^^^^^^^^^ + +note: the above error was encountered while instantiating `fn not_called::<i32>` + --> $DIR/collect-in-dead-fnptr.rs:27:28 + | +LL | let _fnptr: fn() = not_called::<T>; + | ^^^^^^^^^^^^^^^ + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0080`. diff --git a/tests/ui/consts/required-consts/collect-in-dead-fnptr.rs b/tests/ui/consts/required-consts/collect-in-dead-fnptr.rs new file mode 100644 index 00000000000..acbe34829e8 --- /dev/null +++ b/tests/ui/consts/required-consts/collect-in-dead-fnptr.rs @@ -0,0 +1,33 @@ +//@revisions: noopt opt +//@ build-fail +//@[noopt] compile-flags: -Copt-level=0 +//@[opt] compile-flags: -O +//! This fails without optimizations, so it should also fail with optimizations. + +struct Fail<T>(T); +impl<T> Fail<T> { + const C: () = panic!(); //~ERROR evaluation of `Fail::<i32>::C` failed +} + +// This function is not actually called, but it is mentioned in dead code in a function that is +// called. Make sure we still find this error. +// This ensures that we consider ReifyFnPointer coercions when gathering "mentioned" items. +#[inline(never)] +fn not_called<T>() { + if false { + let _ = Fail::<T>::C; + } +} + +#[inline(never)] +fn called<T>() { + if false { + // We don't call the function, but turn it to a function pointer. + // Make sure it still gest added to `mentioned_items`. + let _fnptr: fn() = not_called::<T>; + } +} + +pub fn main() { + called::<i32>(); +} diff --git a/tests/ui/consts/required-consts/collect-in-dead-forget.rs b/tests/ui/consts/required-consts/collect-in-dead-forget.rs index 720b7a499f7..7586004116c 100644 --- a/tests/ui/consts/required-consts/collect-in-dead-forget.rs +++ b/tests/ui/consts/required-consts/collect-in-dead-forget.rs @@ -1,8 +1,8 @@ //@revisions: noopt opt //@build-pass +//@[noopt] compile-flags: -Copt-level=0 //@[opt] compile-flags: -O -//! Make sure we detect erroneous constants post-monomorphization even when they are unused. This is -//! crucial, people rely on it for soundness. (https://github.com/rust-lang/rust/issues/112090) +//! This passes without optimizations, so it can (and should) also pass with optimizations. struct Fail<T>(T); impl<T> Fail<T> { diff --git a/tests/ui/consts/required-consts/collect-in-dead-move.noopt.stderr b/tests/ui/consts/required-consts/collect-in-dead-move.noopt.stderr index 5b1df78b232..2ab1f80e2d3 100644 --- a/tests/ui/consts/required-consts/collect-in-dead-move.noopt.stderr +++ b/tests/ui/consts/required-consts/collect-in-dead-move.noopt.stderr @@ -1,13 +1,13 @@ error[E0080]: evaluation of `Fail::<i32>::C` failed - --> $DIR/collect-in-dead-move.rs:12:19 + --> $DIR/collect-in-dead-move.rs:9:19 | LL | const C: () = panic!(); - | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-move.rs:12:19 + | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-move.rs:9:19 | = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) note: erroneous constant encountered - --> $DIR/collect-in-dead-move.rs:19:17 + --> $DIR/collect-in-dead-move.rs:16:17 | LL | let _ = Fail::<T>::C; | ^^^^^^^^^^^^ diff --git a/tests/ui/consts/required-consts/collect-in-dead-move.opt.stderr b/tests/ui/consts/required-consts/collect-in-dead-move.opt.stderr new file mode 100644 index 00000000000..2ab1f80e2d3 --- /dev/null +++ b/tests/ui/consts/required-consts/collect-in-dead-move.opt.stderr @@ -0,0 +1,20 @@ +error[E0080]: evaluation of `Fail::<i32>::C` failed + --> $DIR/collect-in-dead-move.rs:9:19 + | +LL | const C: () = panic!(); + | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-move.rs:9:19 + | + = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) + +note: erroneous constant encountered + --> $DIR/collect-in-dead-move.rs:16:17 + | +LL | let _ = Fail::<T>::C; + | ^^^^^^^^^^^^ + +note: the above error was encountered while instantiating `fn <Fail<i32> as std::ops::Drop>::drop` + --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0080`. diff --git a/tests/ui/consts/required-consts/collect-in-dead-move.rs b/tests/ui/consts/required-consts/collect-in-dead-move.rs index f3a6ba8a657..6a224a375cf 100644 --- a/tests/ui/consts/required-consts/collect-in-dead-move.rs +++ b/tests/ui/consts/required-consts/collect-in-dead-move.rs @@ -1,15 +1,12 @@ //@revisions: noopt opt -//@[noopt] build-fail +//@ build-fail +//@[noopt] compile-flags: -Copt-level=0 //@[opt] compile-flags: -O -//FIXME: `opt` revision currently does not stop with an error due to -//<https://github.com/rust-lang/rust/issues/107503>. -//@[opt] build-pass -//! Make sure we detect erroneous constants post-monomorphization even when they are unused. This is -//! crucial, people rely on it for soundness. (https://github.com/rust-lang/rust/issues/112090) +//! This fails without optimizations, so it should also fail with optimizations. struct Fail<T>(T); impl<T> Fail<T> { - const C: () = panic!(); //[noopt]~ERROR evaluation of `Fail::<i32>::C` failed + const C: () = panic!(); //~ERROR evaluation of `Fail::<i32>::C` failed } // This function is not actually called, but is mentioned implicitly as destructor in dead code in a diff --git a/tests/ui/consts/required-consts/collect-in-dead-vtable.noopt.stderr b/tests/ui/consts/required-consts/collect-in-dead-vtable.noopt.stderr index 56b6989b441..b4e18706489 100644 --- a/tests/ui/consts/required-consts/collect-in-dead-vtable.noopt.stderr +++ b/tests/ui/consts/required-consts/collect-in-dead-vtable.noopt.stderr @@ -1,21 +1,21 @@ error[E0080]: evaluation of `Fail::<i32>::C` failed - --> $DIR/collect-in-dead-vtable.rs:12:19 + --> $DIR/collect-in-dead-vtable.rs:9:19 | LL | const C: () = panic!(); - | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-vtable.rs:12:19 + | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-vtable.rs:9:19 | = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) note: erroneous constant encountered - --> $DIR/collect-in-dead-vtable.rs:26:21 + --> $DIR/collect-in-dead-vtable.rs:22:21 | LL | let _ = Fail::<T>::C; | ^^^^^^^^^^^^ note: the above error was encountered while instantiating `fn <std::vec::Vec<i32> as MyTrait>::not_called` - --> $DIR/collect-in-dead-vtable.rs:35:40 + --> $DIR/collect-in-dead-vtable.rs:31:40 | -LL | let gen_vtable: &dyn MyTrait = &v; // vtable "appears" here +LL | let gen_vtable: &dyn MyTrait = &v; // vtable is "mentioned" here | ^^ error: aborting due to 1 previous error diff --git a/tests/ui/consts/required-consts/collect-in-dead-vtable.opt.stderr b/tests/ui/consts/required-consts/collect-in-dead-vtable.opt.stderr new file mode 100644 index 00000000000..b4e18706489 --- /dev/null +++ b/tests/ui/consts/required-consts/collect-in-dead-vtable.opt.stderr @@ -0,0 +1,23 @@ +error[E0080]: evaluation of `Fail::<i32>::C` failed + --> $DIR/collect-in-dead-vtable.rs:9:19 + | +LL | const C: () = panic!(); + | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/collect-in-dead-vtable.rs:9:19 + | + = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) + +note: erroneous constant encountered + --> $DIR/collect-in-dead-vtable.rs:22:21 + | +LL | let _ = Fail::<T>::C; + | ^^^^^^^^^^^^ + +note: the above error was encountered while instantiating `fn <std::vec::Vec<i32> as MyTrait>::not_called` + --> $DIR/collect-in-dead-vtable.rs:31:40 + | +LL | let gen_vtable: &dyn MyTrait = &v; // vtable is "mentioned" here + | ^^ + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0080`. diff --git a/tests/ui/consts/required-consts/collect-in-dead-vtable.rs b/tests/ui/consts/required-consts/collect-in-dead-vtable.rs index f21a1cc1fc2..f63207eafec 100644 --- a/tests/ui/consts/required-consts/collect-in-dead-vtable.rs +++ b/tests/ui/consts/required-consts/collect-in-dead-vtable.rs @@ -1,15 +1,12 @@ //@revisions: noopt opt -//@[noopt] build-fail +//@ build-fail +//@[noopt] compile-flags: -Copt-level=0 //@[opt] compile-flags: -O -//FIXME: `opt` revision currently does not stop with an error due to -//<https://github.com/rust-lang/rust/issues/107503>. -//@[opt] build-pass -//! Make sure we detect erroneous constants post-monomorphization even when they are unused. This is -//! crucial, people rely on it for soundness. (https://github.com/rust-lang/rust/issues/112090) +//! This fails without optimizations, so it should also fail with optimizations. struct Fail<T>(T); impl<T> Fail<T> { - const C: () = panic!(); //[noopt]~ERROR evaluation of `Fail::<i32>::C` failed + const C: () = panic!(); //~ERROR evaluation of `Fail::<i32>::C` failed } trait MyTrait { @@ -18,8 +15,7 @@ trait MyTrait { // This function is not actually called, but it is mentioned in a vtable in a function that is // called. Make sure we still find this error. -// This relies on mono-item collection checking `required_consts` in functions that are referenced -// in vtables that syntactically appear in collected functions (even inside dead code). +// This ensures that we are properly considering vtables when gathering "mentioned" items. impl<T> MyTrait for Vec<T> { fn not_called(&self) { if false { @@ -32,7 +28,7 @@ impl<T> MyTrait for Vec<T> { fn called<T>() { if false { let v: Vec<T> = Vec::new(); - let gen_vtable: &dyn MyTrait = &v; // vtable "appears" here + let gen_vtable: &dyn MyTrait = &v; // vtable is "mentioned" here } } diff --git a/tests/ui/consts/required-consts/interpret-in-const-called-fn.noopt.stderr b/tests/ui/consts/required-consts/interpret-in-const-called-fn.noopt.stderr index 75304591b9f..0e3bbbcc2ec 100644 --- a/tests/ui/consts/required-consts/interpret-in-const-called-fn.noopt.stderr +++ b/tests/ui/consts/required-consts/interpret-in-const-called-fn.noopt.stderr @@ -1,13 +1,13 @@ error[E0080]: evaluation of `Fail::<i32>::C` failed - --> $DIR/interpret-in-const-called-fn.rs:7:19 + --> $DIR/interpret-in-const-called-fn.rs:8:19 | LL | const C: () = panic!(); - | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/interpret-in-const-called-fn.rs:7:19 + | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/interpret-in-const-called-fn.rs:8:19 | = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) note: erroneous constant encountered - --> $DIR/interpret-in-const-called-fn.rs:16:9 + --> $DIR/interpret-in-const-called-fn.rs:17:9 | LL | Fail::<T>::C; | ^^^^^^^^^^^^ diff --git a/tests/ui/consts/required-consts/interpret-in-const-called-fn.opt.stderr b/tests/ui/consts/required-consts/interpret-in-const-called-fn.opt.stderr index 75304591b9f..0e3bbbcc2ec 100644 --- a/tests/ui/consts/required-consts/interpret-in-const-called-fn.opt.stderr +++ b/tests/ui/consts/required-consts/interpret-in-const-called-fn.opt.stderr @@ -1,13 +1,13 @@ error[E0080]: evaluation of `Fail::<i32>::C` failed - --> $DIR/interpret-in-const-called-fn.rs:7:19 + --> $DIR/interpret-in-const-called-fn.rs:8:19 | LL | const C: () = panic!(); - | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/interpret-in-const-called-fn.rs:7:19 + | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/interpret-in-const-called-fn.rs:8:19 | = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) note: erroneous constant encountered - --> $DIR/interpret-in-const-called-fn.rs:16:9 + --> $DIR/interpret-in-const-called-fn.rs:17:9 | LL | Fail::<T>::C; | ^^^^^^^^^^^^ diff --git a/tests/ui/consts/required-consts/interpret-in-const-called-fn.rs b/tests/ui/consts/required-consts/interpret-in-const-called-fn.rs index c409fae0bb9..f2e83f56f37 100644 --- a/tests/ui/consts/required-consts/interpret-in-const-called-fn.rs +++ b/tests/ui/consts/required-consts/interpret-in-const-called-fn.rs @@ -1,4 +1,5 @@ //@revisions: noopt opt +//@[noopt] compile-flags: -Copt-level=0 //@[opt] compile-flags: -O //! Make sure we error on erroneous consts even if they are unused. diff --git a/tests/ui/consts/required-consts/interpret-in-promoted.noopt.stderr b/tests/ui/consts/required-consts/interpret-in-promoted.noopt.stderr index 491131daf8d..6ab991b6471 100644 --- a/tests/ui/consts/required-consts/interpret-in-promoted.noopt.stderr +++ b/tests/ui/consts/required-consts/interpret-in-promoted.noopt.stderr @@ -6,18 +6,18 @@ error[E0080]: evaluation of constant value failed note: inside `unreachable_unchecked` --> $SRC_DIR/core/src/hint.rs:LL:COL note: inside `ub` - --> $DIR/interpret-in-promoted.rs:6:5 + --> $DIR/interpret-in-promoted.rs:7:5 | LL | std::hint::unreachable_unchecked(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `FOO` - --> $DIR/interpret-in-promoted.rs:12:28 + --> $DIR/interpret-in-promoted.rs:13:28 | LL | let _x: &'static () = &ub(); | ^^^^ note: erroneous constant encountered - --> $DIR/interpret-in-promoted.rs:12:27 + --> $DIR/interpret-in-promoted.rs:13:27 | LL | let _x: &'static () = &ub(); | ^^^^^ diff --git a/tests/ui/consts/required-consts/interpret-in-promoted.opt.stderr b/tests/ui/consts/required-consts/interpret-in-promoted.opt.stderr index 491131daf8d..6ab991b6471 100644 --- a/tests/ui/consts/required-consts/interpret-in-promoted.opt.stderr +++ b/tests/ui/consts/required-consts/interpret-in-promoted.opt.stderr @@ -6,18 +6,18 @@ error[E0080]: evaluation of constant value failed note: inside `unreachable_unchecked` --> $SRC_DIR/core/src/hint.rs:LL:COL note: inside `ub` - --> $DIR/interpret-in-promoted.rs:6:5 + --> $DIR/interpret-in-promoted.rs:7:5 | LL | std::hint::unreachable_unchecked(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: inside `FOO` - --> $DIR/interpret-in-promoted.rs:12:28 + --> $DIR/interpret-in-promoted.rs:13:28 | LL | let _x: &'static () = &ub(); | ^^^^ note: erroneous constant encountered - --> $DIR/interpret-in-promoted.rs:12:27 + --> $DIR/interpret-in-promoted.rs:13:27 | LL | let _x: &'static () = &ub(); | ^^^^^ diff --git a/tests/ui/consts/required-consts/interpret-in-promoted.rs b/tests/ui/consts/required-consts/interpret-in-promoted.rs index 9c2cf4e70d3..187494180ad 100644 --- a/tests/ui/consts/required-consts/interpret-in-promoted.rs +++ b/tests/ui/consts/required-consts/interpret-in-promoted.rs @@ -1,4 +1,5 @@ //@revisions: noopt opt +//@[noopt] compile-flags: -Copt-level=0 //@[opt] compile-flags: -O //! Make sure we error on erroneous consts even if they are unused. diff --git a/tests/ui/consts/required-consts/interpret-in-static.noopt.stderr b/tests/ui/consts/required-consts/interpret-in-static.noopt.stderr index 159c9449fc0..5e8da609e76 100644 --- a/tests/ui/consts/required-consts/interpret-in-static.noopt.stderr +++ b/tests/ui/consts/required-consts/interpret-in-static.noopt.stderr @@ -1,13 +1,13 @@ error[E0080]: evaluation of `Fail::<i32>::C` failed - --> $DIR/interpret-in-static.rs:7:19 + --> $DIR/interpret-in-static.rs:8:19 | LL | const C: () = panic!(); - | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/interpret-in-static.rs:7:19 + | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/interpret-in-static.rs:8:19 | = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) note: erroneous constant encountered - --> $DIR/interpret-in-static.rs:15:9 + --> $DIR/interpret-in-static.rs:16:9 | LL | Fail::<i32>::C; | ^^^^^^^^^^^^^^ diff --git a/tests/ui/consts/required-consts/interpret-in-static.opt.stderr b/tests/ui/consts/required-consts/interpret-in-static.opt.stderr index 159c9449fc0..5e8da609e76 100644 --- a/tests/ui/consts/required-consts/interpret-in-static.opt.stderr +++ b/tests/ui/consts/required-consts/interpret-in-static.opt.stderr @@ -1,13 +1,13 @@ error[E0080]: evaluation of `Fail::<i32>::C` failed - --> $DIR/interpret-in-static.rs:7:19 + --> $DIR/interpret-in-static.rs:8:19 | LL | const C: () = panic!(); - | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/interpret-in-static.rs:7:19 + | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/interpret-in-static.rs:8:19 | = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) note: erroneous constant encountered - --> $DIR/interpret-in-static.rs:15:9 + --> $DIR/interpret-in-static.rs:16:9 | LL | Fail::<i32>::C; | ^^^^^^^^^^^^^^ diff --git a/tests/ui/consts/required-consts/interpret-in-static.rs b/tests/ui/consts/required-consts/interpret-in-static.rs index 559e281b2b0..8bacd030440 100644 --- a/tests/ui/consts/required-consts/interpret-in-static.rs +++ b/tests/ui/consts/required-consts/interpret-in-static.rs @@ -1,4 +1,5 @@ //@revisions: noopt opt +//@[noopt] compile-flags: -Copt-level=0 //@[opt] compile-flags: -O //! Make sure we error on erroneous consts even if they are unused. diff --git a/tests/ui/consts/try-operator.stderr b/tests/ui/consts/try-operator.stderr index c19d1a6199d..2c8b4c7fcd9 100644 --- a/tests/ui/consts/try-operator.stderr +++ b/tests/ui/consts/try-operator.stderr @@ -13,7 +13,10 @@ LL | Err(())?; note: impl defined here, but it is not `const` --> $SRC_DIR/core/src/result.rs:LL:COL = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(effects)]` to the crate attributes to enable +help: add `#![feature(effects)]` to the crate attributes to enable + | +LL + #![feature(effects)] + | error[E0015]: `?` cannot convert from residual of `Result<bool, ()>` in constant functions --> $DIR/try-operator.rs:10:9 @@ -24,7 +27,10 @@ LL | Err(())?; note: impl defined here, but it is not `const` --> $SRC_DIR/core/src/result.rs:LL:COL = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(effects)]` to the crate attributes to enable +help: add `#![feature(effects)]` to the crate attributes to enable + | +LL + #![feature(effects)] + | error[E0015]: `?` cannot determine the branch of `Option<()>` in constant functions --> $DIR/try-operator.rs:18:9 @@ -35,7 +41,10 @@ LL | None?; note: impl defined here, but it is not `const` --> $SRC_DIR/core/src/option.rs:LL:COL = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(effects)]` to the crate attributes to enable +help: add `#![feature(effects)]` to the crate attributes to enable + | +LL + #![feature(effects)] + | error[E0015]: `?` cannot convert from residual of `Option<()>` in constant functions --> $DIR/try-operator.rs:18:9 @@ -46,7 +55,10 @@ LL | None?; note: impl defined here, but it is not `const` --> $SRC_DIR/core/src/option.rs:LL:COL = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(effects)]` to the crate attributes to enable +help: add `#![feature(effects)]` to the crate attributes to enable + | +LL + #![feature(effects)] + | error: aborting due to 5 previous errors diff --git a/tests/ui/consts/unstable-const-fn-in-libcore.stderr b/tests/ui/consts/unstable-const-fn-in-libcore.stderr index ee4a0f6a843..9590b3372e3 100644 --- a/tests/ui/consts/unstable-const-fn-in-libcore.stderr +++ b/tests/ui/consts/unstable-const-fn-in-libcore.stderr @@ -11,11 +11,14 @@ LL | Opt::None => f(), | ^^^ | = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(effects)]` to the crate attributes to enable help: consider further restricting this bound | LL | const fn unwrap_or_else<F: ~const FnOnce() -> T + ~const std::ops::FnOnce<()>>(self, f: F) -> T { | +++++++++++++++++++++++++++++ +help: add `#![feature(effects)]` to the crate attributes to enable + | +LL + #![feature(effects)] + | error[E0493]: destructor of `F` cannot be evaluated at compile-time --> $DIR/unstable-const-fn-in-libcore.rs:19:60 diff --git a/tests/ui/coroutine/gen_block_is_fused_iter.rs b/tests/ui/coroutine/gen_block_is_fused_iter.rs new file mode 100644 index 00000000000..f3e19a7f54f --- /dev/null +++ b/tests/ui/coroutine/gen_block_is_fused_iter.rs @@ -0,0 +1,21 @@ +//@ revisions: next old +//@compile-flags: --edition 2024 -Zunstable-options +//@[next] compile-flags: -Znext-solver +//@ check-pass +#![feature(gen_blocks)] + +use std::iter::FusedIterator; + +fn foo() -> impl FusedIterator { + gen { yield 42 } +} + +fn bar() -> impl FusedIterator<Item = u16> { + gen { yield 42 } +} + +fn baz() -> impl FusedIterator + Iterator<Item = i64> { + gen { yield 42 } +} + +fn main() {} diff --git a/tests/ui/coroutine/issue-68112.rs b/tests/ui/coroutine/issue-68112.rs index e2be704dab7..ccec2acc976 100644 --- a/tests/ui/coroutine/issue-68112.rs +++ b/tests/ui/coroutine/issue-68112.rs @@ -65,7 +65,6 @@ fn test2() { //~^ ERROR `RefCell<i32>` cannot be shared between threads safely //~| NOTE `RefCell<i32>` cannot be shared between threads safely //~| NOTE required for - //~| NOTE captures the following types //~| NOTE use `std::sync::RwLock` instead } diff --git a/tests/ui/coroutine/issue-68112.stderr b/tests/ui/coroutine/issue-68112.stderr index ded325eda54..443195d36a3 100644 --- a/tests/ui/coroutine/issue-68112.stderr +++ b/tests/ui/coroutine/issue-68112.stderr @@ -44,7 +44,6 @@ note: required because it appears within the type `impl Coroutine<Return = Arc<R | LL | fn make_non_send_coroutine2() -> impl Coroutine<Return = Arc<RefCell<i32>>> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: required because it captures the following types: `impl Coroutine<Return = Arc<RefCell<i32>>>` note: required because it's used within this coroutine --> $DIR/issue-68112.rs:60:20 | diff --git a/tests/ui/coroutine/print/coroutine-print-verbose-1.stderr b/tests/ui/coroutine/print/coroutine-print-verbose-1.stderr index 1b9ca632f0c..37db83d57f7 100644 --- a/tests/ui/coroutine/print/coroutine-print-verbose-1.stderr +++ b/tests/ui/coroutine/print/coroutine-print-verbose-1.stderr @@ -43,7 +43,6 @@ note: required because it appears within the type `Opaque(DefId(0:36 ~ coroutine | LL | fn make_non_send_coroutine2() -> impl Coroutine<Return = Arc<RefCell<i32>>> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: required because it captures the following types: `Opaque(DefId(0:36 ~ coroutine_print_verbose_1[75fb]::make_non_send_coroutine2::{opaque#0}), [])` note: required because it's used within this coroutine --> $DIR/coroutine-print-verbose-1.rs:52:20 | diff --git a/tests/ui/cross-crate/auxiliary/static_init_aux.rs b/tests/ui/cross-crate/auxiliary/static_init_aux.rs index 5e172ef3198..dca708733b9 100644 --- a/tests/ui/cross-crate/auxiliary/static_init_aux.rs +++ b/tests/ui/cross-crate/auxiliary/static_init_aux.rs @@ -1,6 +1,8 @@ pub static V: &u32 = &X; pub static F: fn() = f; pub static G: fn() = G0; +pub static H: &(dyn Fn() + Sync) = &h; +pub static I: fn() = Helper(j).mk(); static X: u32 = 42; static G0: fn() = g; @@ -12,3 +14,22 @@ pub fn v() -> *const u32 { fn f() {} fn g() {} + +fn h() {} + +#[derive(Copy, Clone)] +struct Helper<T: Copy>(T); + +impl<T: Copy + FnOnce()> Helper<T> { + const fn mk(self) -> fn() { + i::<T> + } +} + +fn i<T: FnOnce()>() { + assert_eq!(std::mem::size_of::<T>(), 0); + // unsafe to work around the lack of a `Default` impl for function items + unsafe { (std::mem::transmute_copy::<(), T>(&()))() } +} + +fn j() {} diff --git a/tests/ui/cross-crate/static-init.rs b/tests/ui/cross-crate/static-init.rs index 090ad5f810e..c4697a1d010 100644 --- a/tests/ui/cross-crate/static-init.rs +++ b/tests/ui/cross-crate/static-init.rs @@ -6,6 +6,8 @@ extern crate static_init_aux as aux; static V: &u32 = aux::V; static F: fn() = aux::F; static G: fn() = aux::G; +static H: &(dyn Fn() + Sync) = aux::H; +static I: fn() = aux::I; fn v() -> *const u32 { V @@ -15,4 +17,6 @@ fn main() { assert_eq!(aux::v(), crate::v()); F(); G(); + H(); + I(); } diff --git a/tests/ui/cross/cross-fn-cache-hole.stderr b/tests/ui/cross/cross-fn-cache-hole.stderr index dec2f2553c2..b7bcbc8933f 100644 --- a/tests/ui/cross/cross-fn-cache-hole.stderr +++ b/tests/ui/cross/cross-fn-cache-hole.stderr @@ -10,7 +10,10 @@ help: this trait has no implementations, consider adding one LL | trait Bar<X> { } | ^^^^^^^^^^^^ = help: see issue #48214 - = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable +help: add `#![feature(trivial_bounds)]` to the crate attributes to enable + | +LL + #![feature(trivial_bounds)] + | error[E0277]: the trait bound `i32: Bar<u32>` is not satisfied --> $DIR/cross-fn-cache-hole.rs:30:15 diff --git a/tests/ui/delegation/duplicate-definition-inside-trait-impl.rs b/tests/ui/delegation/duplicate-definition-inside-trait-impl.rs new file mode 100644 index 00000000000..bd685b40b2f --- /dev/null +++ b/tests/ui/delegation/duplicate-definition-inside-trait-impl.rs @@ -0,0 +1,23 @@ +#![feature(fn_delegation)] +//~^ WARN the feature `fn_delegation` is incomplete + +trait Trait { + fn foo(&self) -> u32 { 0 } +} + +struct F; +struct S; + +mod to_reuse { + use crate::S; + + pub fn foo(_: &S) -> u32 { 0 } +} + +impl Trait for S { + reuse to_reuse::foo { self } + reuse Trait::foo; + //~^ ERROR duplicate definitions with name `foo` +} + +fn main() {} diff --git a/tests/ui/delegation/duplicate-definition-inside-trait-impl.stderr b/tests/ui/delegation/duplicate-definition-inside-trait-impl.stderr new file mode 100644 index 00000000000..a5f9e6ad0bf --- /dev/null +++ b/tests/ui/delegation/duplicate-definition-inside-trait-impl.stderr @@ -0,0 +1,23 @@ +error[E0201]: duplicate definitions with name `foo`: + --> $DIR/duplicate-definition-inside-trait-impl.rs:19:5 + | +LL | fn foo(&self) -> u32 { 0 } + | -------------------------- item in trait +... +LL | reuse to_reuse::foo { self } + | ---------------------------- previous definition here +LL | reuse Trait::foo; + | ^^^^^^^^^^^^^^^^^ duplicate definition + +warning: the feature `fn_delegation` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/duplicate-definition-inside-trait-impl.rs:1:12 + | +LL | #![feature(fn_delegation)] + | ^^^^^^^^^^^^^ + | + = note: see issue #118212 <https://github.com/rust-lang/rust/issues/118212> for more information + = note: `#[warn(incomplete_features)]` on by default + +error: aborting due to 1 previous error; 1 warning emitted + +For more information about this error, try `rustc --explain E0201`. diff --git a/tests/ui/diagnostic-flags/colored-session-opt-error.svg b/tests/ui/diagnostic-flags/colored-session-opt-error.svg index e8835534e04..69f452f29f3 100644 --- a/tests/ui/diagnostic-flags/colored-session-opt-error.svg +++ b/tests/ui/diagnostic-flags/colored-session-opt-error.svg @@ -1,4 +1,4 @@ -<svg width="740px" height="74px" xmlns="http://www.w3.org/2000/svg"> +<svg width="750px" height="74px" xmlns="http://www.w3.org/2000/svg"> <style> .fg { fill: #AAAAAA } .bg { background: #000000 } diff --git a/tests/ui/diagnostic_namespace/on_unimplemented/broken_format.rs b/tests/ui/diagnostic_namespace/on_unimplemented/broken_format.rs new file mode 100644 index 00000000000..8d8917fd319 --- /dev/null +++ b/tests/ui/diagnostic_namespace/on_unimplemented/broken_format.rs @@ -0,0 +1,45 @@ +#[diagnostic::on_unimplemented(message = "{{Test } thing")] +//~^WARN unmatched `}` found +//~|WARN unmatched `}` found +trait ImportantTrait1 {} + +#[diagnostic::on_unimplemented(message = "Test {}")] +//~^WARN positional format arguments are not allowed here +//~|WARN positional format arguments are not allowed here +trait ImportantTrait2 {} + +#[diagnostic::on_unimplemented(message = "Test {1:}")] +//~^WARN positional format arguments are not allowed here +//~|WARN positional format arguments are not allowed here +trait ImportantTrait3 {} + +#[diagnostic::on_unimplemented(message = "Test {Self:123}")] +//~^WARN invalid format specifier +//~|WARN invalid format specifier +trait ImportantTrait4 {} + +#[diagnostic::on_unimplemented(message = "Test {Self:!}")] +//~^WARN expected `'}'`, found `'!'` +//~|WARN expected `'}'`, found `'!'` +//~|WARN unmatched `}` found +//~|WARN unmatched `}` found +trait ImportantTrait5 {} + +fn check_1(_: impl ImportantTrait1) {} +fn check_2(_: impl ImportantTrait2) {} +fn check_3(_: impl ImportantTrait3) {} +fn check_4(_: impl ImportantTrait4) {} +fn check_5(_: impl ImportantTrait5) {} + +fn main() { + check_1(()); + //~^ERROR {{Test } thing + check_2(()); + //~^ERROR Test {} + check_3(()); + //~^ERROR Test {1} + check_4(()); + //~^ERROR Test () + check_5(()); + //~^ERROR Test {Self:!} +} diff --git a/tests/ui/diagnostic_namespace/on_unimplemented/broken_format.stderr b/tests/ui/diagnostic_namespace/on_unimplemented/broken_format.stderr new file mode 100644 index 00000000000..932e81ca48e --- /dev/null +++ b/tests/ui/diagnostic_namespace/on_unimplemented/broken_format.stderr @@ -0,0 +1,193 @@ +warning: unmatched `}` found + --> $DIR/broken_format.rs:1:32 + | +LL | #[diagnostic::on_unimplemented(message = "{{Test } thing")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(unknown_or_malformed_diagnostic_attributes)]` on by default + +warning: positional format arguments are not allowed here + --> $DIR/broken_format.rs:6:32 + | +LL | #[diagnostic::on_unimplemented(message = "Test {}")] + | ^^^^^^^^^^^^^^^^^^^ + | + = help: only named format arguments with the name of one of the generic types are allowed in this context + +warning: positional format arguments are not allowed here + --> $DIR/broken_format.rs:11:32 + | +LL | #[diagnostic::on_unimplemented(message = "Test {1:}")] + | ^^^^^^^^^^^^^^^^^^^^^ + | + = help: only named format arguments with the name of one of the generic types are allowed in this context + +warning: invalid format specifier + --> $DIR/broken_format.rs:16:32 + | +LL | #[diagnostic::on_unimplemented(message = "Test {Self:123}")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: no format specifier are supported in this position + +warning: expected `'}'`, found `'!'` + --> $DIR/broken_format.rs:21:32 + | +LL | #[diagnostic::on_unimplemented(message = "Test {Self:!}")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: unmatched `}` found + --> $DIR/broken_format.rs:21:32 + | +LL | #[diagnostic::on_unimplemented(message = "Test {Self:!}")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: unmatched `}` found + --> $DIR/broken_format.rs:1:32 + | +LL | #[diagnostic::on_unimplemented(message = "{{Test } thing")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error[E0277]: {{Test } thing + --> $DIR/broken_format.rs:35:13 + | +LL | check_1(()); + | ------- ^^ the trait `ImportantTrait1` is not implemented for `()` + | | + | required by a bound introduced by this call + | +help: this trait has no implementations, consider adding one + --> $DIR/broken_format.rs:4:1 + | +LL | trait ImportantTrait1 {} + | ^^^^^^^^^^^^^^^^^^^^^ +note: required by a bound in `check_1` + --> $DIR/broken_format.rs:28:20 + | +LL | fn check_1(_: impl ImportantTrait1) {} + | ^^^^^^^^^^^^^^^ required by this bound in `check_1` + +warning: positional format arguments are not allowed here + --> $DIR/broken_format.rs:6:32 + | +LL | #[diagnostic::on_unimplemented(message = "Test {}")] + | ^^^^^^^^^^^^^^^^^^^ + | + = help: only named format arguments with the name of one of the generic types are allowed in this context + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error[E0277]: Test {} + --> $DIR/broken_format.rs:37:13 + | +LL | check_2(()); + | ------- ^^ the trait `ImportantTrait2` is not implemented for `()` + | | + | required by a bound introduced by this call + | +help: this trait has no implementations, consider adding one + --> $DIR/broken_format.rs:9:1 + | +LL | trait ImportantTrait2 {} + | ^^^^^^^^^^^^^^^^^^^^^ +note: required by a bound in `check_2` + --> $DIR/broken_format.rs:29:20 + | +LL | fn check_2(_: impl ImportantTrait2) {} + | ^^^^^^^^^^^^^^^ required by this bound in `check_2` + +warning: positional format arguments are not allowed here + --> $DIR/broken_format.rs:11:32 + | +LL | #[diagnostic::on_unimplemented(message = "Test {1:}")] + | ^^^^^^^^^^^^^^^^^^^^^ + | + = help: only named format arguments with the name of one of the generic types are allowed in this context + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error[E0277]: Test {1} + --> $DIR/broken_format.rs:39:13 + | +LL | check_3(()); + | ------- ^^ the trait `ImportantTrait3` is not implemented for `()` + | | + | required by a bound introduced by this call + | +help: this trait has no implementations, consider adding one + --> $DIR/broken_format.rs:14:1 + | +LL | trait ImportantTrait3 {} + | ^^^^^^^^^^^^^^^^^^^^^ +note: required by a bound in `check_3` + --> $DIR/broken_format.rs:30:20 + | +LL | fn check_3(_: impl ImportantTrait3) {} + | ^^^^^^^^^^^^^^^ required by this bound in `check_3` + +warning: invalid format specifier + --> $DIR/broken_format.rs:16:32 + | +LL | #[diagnostic::on_unimplemented(message = "Test {Self:123}")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: no format specifier are supported in this position + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error[E0277]: Test () + --> $DIR/broken_format.rs:41:13 + | +LL | check_4(()); + | ------- ^^ the trait `ImportantTrait4` is not implemented for `()` + | | + | required by a bound introduced by this call + | +help: this trait has no implementations, consider adding one + --> $DIR/broken_format.rs:19:1 + | +LL | trait ImportantTrait4 {} + | ^^^^^^^^^^^^^^^^^^^^^ +note: required by a bound in `check_4` + --> $DIR/broken_format.rs:31:20 + | +LL | fn check_4(_: impl ImportantTrait4) {} + | ^^^^^^^^^^^^^^^ required by this bound in `check_4` + +warning: expected `'}'`, found `'!'` + --> $DIR/broken_format.rs:21:32 + | +LL | #[diagnostic::on_unimplemented(message = "Test {Self:!}")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +warning: unmatched `}` found + --> $DIR/broken_format.rs:21:32 + | +LL | #[diagnostic::on_unimplemented(message = "Test {Self:!}")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error[E0277]: Test {Self:!} + --> $DIR/broken_format.rs:43:13 + | +LL | check_5(()); + | ------- ^^ the trait `ImportantTrait5` is not implemented for `()` + | | + | required by a bound introduced by this call + | +help: this trait has no implementations, consider adding one + --> $DIR/broken_format.rs:26:1 + | +LL | trait ImportantTrait5 {} + | ^^^^^^^^^^^^^^^^^^^^^ +note: required by a bound in `check_5` + --> $DIR/broken_format.rs:32:20 + | +LL | fn check_5(_: impl ImportantTrait5) {} + | ^^^^^^^^^^^^^^^ required by this bound in `check_5` + +error: aborting due to 5 previous errors; 12 warnings emitted + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/entry-point/imported_main_conflict.rs b/tests/ui/entry-point/imported_main_conflict.rs index e8c70b06513..06178dbeff7 100644 --- a/tests/ui/entry-point/imported_main_conflict.rs +++ b/tests/ui/entry-point/imported_main_conflict.rs @@ -1,5 +1,4 @@ -#![feature(imported_main)] -//~^ ERROR `main` is ambiguous +//~ ERROR `main` is ambiguous mod m1 { pub(crate) fn main() {} } mod m2 { pub(crate) fn main() {} } diff --git a/tests/ui/entry-point/imported_main_conflict.stderr b/tests/ui/entry-point/imported_main_conflict.stderr index 783e9345acf..3ef34962524 100644 --- a/tests/ui/entry-point/imported_main_conflict.stderr +++ b/tests/ui/entry-point/imported_main_conflict.stderr @@ -2,13 +2,13 @@ error[E0659]: `main` is ambiguous | = note: ambiguous because of multiple glob imports of a name in the same module note: `main` could refer to the function imported here - --> $DIR/imported_main_conflict.rs:6:5 + --> $DIR/imported_main_conflict.rs:5:5 | LL | use m1::*; | ^^^^^ = help: consider adding an explicit import of `main` to disambiguate note: `main` could also refer to the function imported here - --> $DIR/imported_main_conflict.rs:7:5 + --> $DIR/imported_main_conflict.rs:6:5 | LL | use m2::*; | ^^^^^ diff --git a/tests/ui/entry-point/imported_main_const_fn_item_type_forbidden.rs b/tests/ui/entry-point/imported_main_const_fn_item_type_forbidden.rs index 405d6e2a9f5..d0be240e07b 100644 --- a/tests/ui/entry-point/imported_main_const_fn_item_type_forbidden.rs +++ b/tests/ui/entry-point/imported_main_const_fn_item_type_forbidden.rs @@ -1,4 +1,3 @@ -#![feature(imported_main)] #![feature(type_alias_impl_trait)] #![allow(incomplete_features)] pub mod foo { diff --git a/tests/ui/entry-point/imported_main_const_fn_item_type_forbidden.stderr b/tests/ui/entry-point/imported_main_const_fn_item_type_forbidden.stderr index 1e7d82a73bc..50e4cd7d39f 100644 --- a/tests/ui/entry-point/imported_main_const_fn_item_type_forbidden.stderr +++ b/tests/ui/entry-point/imported_main_const_fn_item_type_forbidden.stderr @@ -1,5 +1,5 @@ error[E0601]: `main` function not found in crate `imported_main_const_fn_item_type_forbidden` - --> $DIR/imported_main_const_fn_item_type_forbidden.rs:11:22 + --> $DIR/imported_main_const_fn_item_type_forbidden.rs:10:22 | LL | use foo::BAR as main; | ---------------- ^ consider adding a `main` function to `$DIR/imported_main_const_fn_item_type_forbidden.rs` diff --git a/tests/ui/entry-point/imported_main_const_forbidden.rs b/tests/ui/entry-point/imported_main_const_forbidden.rs index 1508280c0fa..c478e004603 100644 --- a/tests/ui/entry-point/imported_main_const_forbidden.rs +++ b/tests/ui/entry-point/imported_main_const_forbidden.rs @@ -1,4 +1,3 @@ -#![feature(imported_main)] pub mod foo { pub const BAR: usize = 42; } diff --git a/tests/ui/entry-point/imported_main_const_forbidden.stderr b/tests/ui/entry-point/imported_main_const_forbidden.stderr index 6f34015a2cd..eb768b1b250 100644 --- a/tests/ui/entry-point/imported_main_const_forbidden.stderr +++ b/tests/ui/entry-point/imported_main_const_forbidden.stderr @@ -1,5 +1,5 @@ error[E0601]: `main` function not found in crate `imported_main_const_forbidden` - --> $DIR/imported_main_const_forbidden.rs:6:22 + --> $DIR/imported_main_const_forbidden.rs:5:22 | LL | use foo::BAR as main; | ---------------- ^ consider adding a `main` function to `$DIR/imported_main_const_forbidden.rs` diff --git a/tests/ui/entry-point/imported_main_from_extern_crate.rs b/tests/ui/entry-point/imported_main_from_extern_crate.rs index abcf2cbc05b..6d1c497052e 100644 --- a/tests/ui/entry-point/imported_main_from_extern_crate.rs +++ b/tests/ui/entry-point/imported_main_from_extern_crate.rs @@ -1,7 +1,5 @@ //@ run-pass //@ aux-build:main_functions.rs -#![feature(imported_main)] - extern crate main_functions; pub use main_functions::boilerplate as main; diff --git a/tests/ui/entry-point/imported_main_from_extern_crate_wrong_type.rs b/tests/ui/entry-point/imported_main_from_extern_crate_wrong_type.rs index 82d81a93d9d..d8ae12d200f 100644 --- a/tests/ui/entry-point/imported_main_from_extern_crate_wrong_type.rs +++ b/tests/ui/entry-point/imported_main_from_extern_crate_wrong_type.rs @@ -1,6 +1,4 @@ //@ aux-build:bad_main_functions.rs -#![feature(imported_main)] - extern crate bad_main_functions; pub use bad_main_functions::boilerplate as main; diff --git a/tests/ui/entry-point/imported_main_from_inner_mod.rs b/tests/ui/entry-point/imported_main_from_inner_mod.rs index 7212dd6182c..cede1766118 100644 --- a/tests/ui/entry-point/imported_main_from_inner_mod.rs +++ b/tests/ui/entry-point/imported_main_from_inner_mod.rs @@ -1,5 +1,4 @@ //@ run-pass -#![feature(imported_main)] pub mod foo { pub fn bar() { diff --git a/tests/ui/extenv/extenv-arg-2-not-string-literal.rs b/tests/ui/env-macro/env-arg-2-not-string-literal.rs index 66dced478f9..66dced478f9 100644 --- a/tests/ui/extenv/extenv-arg-2-not-string-literal.rs +++ b/tests/ui/env-macro/env-arg-2-not-string-literal.rs diff --git a/tests/ui/extenv/extenv-arg-2-not-string-literal.stderr b/tests/ui/env-macro/env-arg-2-not-string-literal.stderr index 9db1c0be746..843ce4823ea 100644 --- a/tests/ui/extenv/extenv-arg-2-not-string-literal.stderr +++ b/tests/ui/env-macro/env-arg-2-not-string-literal.stderr @@ -1,5 +1,5 @@ error: expected string literal - --> $DIR/extenv-arg-2-not-string-literal.rs:1:25 + --> $DIR/env-arg-2-not-string-literal.rs:1:25 | LL | fn main() { env!("one", 10); } | ^^ diff --git a/tests/ui/extenv/extenv-env-overload.rs b/tests/ui/env-macro/env-env-overload.rs index b3497ffbc88..b3497ffbc88 100644 --- a/tests/ui/extenv/extenv-env-overload.rs +++ b/tests/ui/env-macro/env-env-overload.rs diff --git a/tests/ui/extenv/extenv-env.rs b/tests/ui/env-macro/env-env.rs index 18226256b64..18226256b64 100644 --- a/tests/ui/extenv/extenv-env.rs +++ b/tests/ui/env-macro/env-env.rs diff --git a/tests/ui/extenv/extenv-escaped-var.rs b/tests/ui/env-macro/env-escaped-var.rs index d898feb78c6..d898feb78c6 100644 --- a/tests/ui/extenv/extenv-escaped-var.rs +++ b/tests/ui/env-macro/env-escaped-var.rs diff --git a/tests/ui/extenv/extenv-escaped-var.stderr b/tests/ui/env-macro/env-escaped-var.stderr index ef5e654d054..53a2ead6742 100644 --- a/tests/ui/extenv/extenv-escaped-var.stderr +++ b/tests/ui/env-macro/env-escaped-var.stderr @@ -1,5 +1,5 @@ error: environment variable `\t` not defined at compile time - --> $DIR/extenv-escaped-var.rs:2:5 + --> $DIR/env-escaped-var.rs:2:5 | LL | env!("\t"); | ^^^^^^^^^^ diff --git a/tests/ui/extenv/extenv-no-args.rs b/tests/ui/env-macro/env-no-args.rs index 2ff6d242b27..2ff6d242b27 100644 --- a/tests/ui/extenv/extenv-no-args.rs +++ b/tests/ui/env-macro/env-no-args.rs diff --git a/tests/ui/extenv/extenv-no-args.stderr b/tests/ui/env-macro/env-no-args.stderr index 36d485676c2..3a94b36cd0f 100644 --- a/tests/ui/extenv/extenv-no-args.stderr +++ b/tests/ui/env-macro/env-no-args.stderr @@ -1,5 +1,5 @@ error: `env!()` takes 1 or 2 arguments - --> $DIR/extenv-no-args.rs:1:13 + --> $DIR/env-no-args.rs:1:13 | LL | fn main() { env!(); } | ^^^^^^ diff --git a/tests/ui/extenv/extenv-not-defined-custom.rs b/tests/ui/env-macro/env-not-defined-custom.rs index 30b72783f5c..30b72783f5c 100644 --- a/tests/ui/extenv/extenv-not-defined-custom.rs +++ b/tests/ui/env-macro/env-not-defined-custom.rs diff --git a/tests/ui/extenv/extenv-not-defined-custom.stderr b/tests/ui/env-macro/env-not-defined-custom.stderr index 9b6e32bc95f..70c41bcc52e 100644 --- a/tests/ui/extenv/extenv-not-defined-custom.stderr +++ b/tests/ui/env-macro/env-not-defined-custom.stderr @@ -1,5 +1,5 @@ error: my error message - --> $DIR/extenv-not-defined-custom.rs:1:13 + --> $DIR/env-not-defined-custom.rs:1:13 | LL | fn main() { env!("__HOPEFULLY_NOT_DEFINED__", "my error message"); } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/extenv/extenv-not-defined-default.rs b/tests/ui/env-macro/env-not-defined-default.rs index 1fb046c78f2..1fb046c78f2 100644 --- a/tests/ui/extenv/extenv-not-defined-default.rs +++ b/tests/ui/env-macro/env-not-defined-default.rs diff --git a/tests/ui/extenv/extenv-not-defined-default.stderr b/tests/ui/env-macro/env-not-defined-default.stderr index 5198818f89c..efd7fdb4e53 100644 --- a/tests/ui/extenv/extenv-not-defined-default.stderr +++ b/tests/ui/env-macro/env-not-defined-default.stderr @@ -1,5 +1,5 @@ error: environment variable `CARGO__HOPEFULLY_NOT_DEFINED__` not defined at compile time - --> $DIR/extenv-not-defined-default.rs:2:5 + --> $DIR/env-not-defined-default.rs:2:5 | LL | env!("CARGO__HOPEFULLY_NOT_DEFINED__"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/extenv/extenv-not-env.rs b/tests/ui/env-macro/env-not-env.rs index e903eab4e96..e903eab4e96 100644 --- a/tests/ui/extenv/extenv-not-env.rs +++ b/tests/ui/env-macro/env-not-env.rs diff --git a/tests/ui/extenv/extenv-not-string-literal.rs b/tests/ui/env-macro/env-not-string-literal.rs index 3eaa0b5daaf..3eaa0b5daaf 100644 --- a/tests/ui/extenv/extenv-not-string-literal.rs +++ b/tests/ui/env-macro/env-not-string-literal.rs diff --git a/tests/ui/extenv/extenv-not-string-literal.stderr b/tests/ui/env-macro/env-not-string-literal.stderr index 85ed442e2fe..0985459eff9 100644 --- a/tests/ui/extenv/extenv-not-string-literal.stderr +++ b/tests/ui/env-macro/env-not-string-literal.stderr @@ -1,5 +1,5 @@ error: expected string literal - --> $DIR/extenv-not-string-literal.rs:1:18 + --> $DIR/env-not-string-literal.rs:1:18 | LL | fn main() { env!(10, "two"); } | ^^ diff --git a/tests/ui/extenv/extenv-too-many-args.rs b/tests/ui/env-macro/env-too-many-args.rs index ffad1c51303..ffad1c51303 100644 --- a/tests/ui/extenv/extenv-too-many-args.rs +++ b/tests/ui/env-macro/env-too-many-args.rs diff --git a/tests/ui/extenv/extenv-too-many-args.stderr b/tests/ui/env-macro/env-too-many-args.stderr index c0fd5d57251..f156026846a 100644 --- a/tests/ui/extenv/extenv-too-many-args.stderr +++ b/tests/ui/env-macro/env-too-many-args.stderr @@ -1,5 +1,5 @@ error: `env!()` takes 1 or 2 arguments - --> $DIR/extenv-too-many-args.rs:1:13 + --> $DIR/env-too-many-args.rs:1:13 | LL | fn main() { env!("one", "two", "three"); } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/extenv/issue-55897.rs b/tests/ui/env-macro/error-recovery-issue-55897.rs index b6500e54059..b6500e54059 100644 --- a/tests/ui/extenv/issue-55897.rs +++ b/tests/ui/env-macro/error-recovery-issue-55897.rs diff --git a/tests/ui/extenv/issue-55897.stderr b/tests/ui/env-macro/error-recovery-issue-55897.stderr index 2e8c05cca86..5a20bf8b168 100644 --- a/tests/ui/extenv/issue-55897.stderr +++ b/tests/ui/env-macro/error-recovery-issue-55897.stderr @@ -1,5 +1,5 @@ error: environment variable `NON_EXISTENT` not defined at compile time - --> $DIR/issue-55897.rs:10:22 + --> $DIR/error-recovery-issue-55897.rs:10:22 | LL | include!(concat!(env!("NON_EXISTENT"), "/data.rs")); | ^^^^^^^^^^^^^^^^^^^^ @@ -8,13 +8,13 @@ LL | include!(concat!(env!("NON_EXISTENT"), "/data.rs")); = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info) error: suffixes on string literals are invalid - --> $DIR/issue-55897.rs:15:22 + --> $DIR/error-recovery-issue-55897.rs:15:22 | LL | include!(concat!("NON_EXISTENT"suffix, "/data.rs")); | ^^^^^^^^^^^^^^^^^^^^ invalid suffix `suffix` error[E0432]: unresolved import `prelude` - --> $DIR/issue-55897.rs:1:5 + --> $DIR/error-recovery-issue-55897.rs:1:5 | LL | use prelude::*; | ^^^^^^^ @@ -23,7 +23,7 @@ LL | use prelude::*; | help: a similar path exists: `std::prelude` error[E0432]: unresolved import `env` - --> $DIR/issue-55897.rs:4:9 + --> $DIR/error-recovery-issue-55897.rs:4:9 | LL | use env; | ^^^ no `env` in the root diff --git a/tests/ui/extenv/issue-110547.rs b/tests/ui/env-macro/name-whitespace-issue-110547.rs index 2acfb2e671e..2acfb2e671e 100644 --- a/tests/ui/extenv/issue-110547.rs +++ b/tests/ui/env-macro/name-whitespace-issue-110547.rs diff --git a/tests/ui/extenv/issue-110547.stderr b/tests/ui/env-macro/name-whitespace-issue-110547.stderr index 10589ec2f54..5f34904d4ae 100644 --- a/tests/ui/extenv/issue-110547.stderr +++ b/tests/ui/env-macro/name-whitespace-issue-110547.stderr @@ -1,5 +1,5 @@ error: environment variable `\t` not defined at compile time - --> $DIR/issue-110547.rs:4:5 + --> $DIR/name-whitespace-issue-110547.rs:4:5 | LL | env!{"\t"}; | ^^^^^^^^^^ @@ -8,7 +8,7 @@ LL | env!{"\t"}; = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info) error: environment variable `\t` not defined at compile time - --> $DIR/issue-110547.rs:5:5 + --> $DIR/name-whitespace-issue-110547.rs:5:5 | LL | env!("\t"); | ^^^^^^^^^^ @@ -17,7 +17,7 @@ LL | env!("\t"); = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info) error: environment variable `\u{2069}` not defined at compile time - --> $DIR/issue-110547.rs:6:5 + --> $DIR/name-whitespace-issue-110547.rs:6:5 | LL | env!("\u{2069}"); | ^^^^^^^^^^^^^^^^ diff --git a/tests/ui/extoption_env-no-args.rs b/tests/ui/env-macro/option_env-no-args.rs index bc5f77bc62e..bc5f77bc62e 100644 --- a/tests/ui/extoption_env-no-args.rs +++ b/tests/ui/env-macro/option_env-no-args.rs diff --git a/tests/ui/extoption_env-no-args.stderr b/tests/ui/env-macro/option_env-no-args.stderr index d40f905b665..d621aff770d 100644 --- a/tests/ui/extoption_env-no-args.stderr +++ b/tests/ui/env-macro/option_env-no-args.stderr @@ -1,5 +1,5 @@ error: option_env! takes 1 argument - --> $DIR/extoption_env-no-args.rs:1:13 + --> $DIR/option_env-no-args.rs:1:13 | LL | fn main() { option_env!(); } | ^^^^^^^^^^^^^ diff --git a/tests/ui/extoption_env-not-defined.rs b/tests/ui/env-macro/option_env-not-defined.rs index 90a01a80313..90a01a80313 100644 --- a/tests/ui/extoption_env-not-defined.rs +++ b/tests/ui/env-macro/option_env-not-defined.rs diff --git a/tests/ui/extoption_env-not-string-literal.rs b/tests/ui/env-macro/option_env-not-string-literal.rs index 27c3a8e83db..27c3a8e83db 100644 --- a/tests/ui/extoption_env-not-string-literal.rs +++ b/tests/ui/env-macro/option_env-not-string-literal.rs diff --git a/tests/ui/extoption_env-not-string-literal.stderr b/tests/ui/env-macro/option_env-not-string-literal.stderr index d4fec1b45c9..3d2542a0e6c 100644 --- a/tests/ui/extoption_env-not-string-literal.stderr +++ b/tests/ui/env-macro/option_env-not-string-literal.stderr @@ -1,5 +1,5 @@ error: argument must be a string literal - --> $DIR/extoption_env-not-string-literal.rs:1:25 + --> $DIR/option_env-not-string-literal.rs:1:25 | LL | fn main() { option_env!(10); } | ^^ diff --git a/tests/ui/extoption_env-too-many-args.rs b/tests/ui/env-macro/option_env-too-many-args.rs index ecc8b61ac85..ecc8b61ac85 100644 --- a/tests/ui/extoption_env-too-many-args.rs +++ b/tests/ui/env-macro/option_env-too-many-args.rs diff --git a/tests/ui/extoption_env-too-many-args.stderr b/tests/ui/env-macro/option_env-too-many-args.stderr index c7aeaac75dd..b4da3670787 100644 --- a/tests/ui/extoption_env-too-many-args.stderr +++ b/tests/ui/env-macro/option_env-too-many-args.stderr @@ -1,5 +1,5 @@ error: option_env! takes 1 argument - --> $DIR/extoption_env-too-many-args.rs:1:13 + --> $DIR/option_env-too-many-args.rs:1:13 | LL | fn main() { option_env!("one", "two"); } | ^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/error-codes/E0637.rs b/tests/ui/error-codes/E0637.rs index e107ea9521b..382ce3ed01f 100644 --- a/tests/ui/error-codes/E0637.rs +++ b/tests/ui/error-codes/E0637.rs @@ -2,9 +2,9 @@ fn underscore_lifetime<'_>(str1: &'_ str, str2: &'_ str) -> &'_ str { //~^ ERROR: `'_` cannot be used here [E0637] //~| ERROR: missing lifetime specifier if str1.len() > str2.len() { - str1 //~ ERROR: lifetime may not live long enough + str1 } else { - str2 //~ ERROR: lifetime may not live long enough + str2 } } diff --git a/tests/ui/error-codes/E0637.stderr b/tests/ui/error-codes/E0637.stderr index 217881b8e7c..d9db89ddb0c 100644 --- a/tests/ui/error-codes/E0637.stderr +++ b/tests/ui/error-codes/E0637.stderr @@ -27,25 +27,7 @@ help: consider introducing a higher-ranked lifetime here LL | T: for<'a> Into<&'a u32>, | +++++++ ++ -error: lifetime may not live long enough - --> $DIR/E0637.rs:5:9 - | -LL | fn underscore_lifetime<'_>(str1: &'_ str, str2: &'_ str) -> &'_ str { - | - let's call the lifetime of this reference `'1` -... -LL | str1 - | ^^^^ returning this value requires that `'1` must outlive `'static` - -error: lifetime may not live long enough - --> $DIR/E0637.rs:7:9 - | -LL | fn underscore_lifetime<'_>(str1: &'_ str, str2: &'_ str) -> &'_ str { - | - let's call the lifetime of this reference `'2` -... -LL | str2 - | ^^^^ returning this value requires that `'2` must outlive `'static` - -error: aborting due to 5 previous errors +error: aborting due to 3 previous errors Some errors have detailed explanations: E0106, E0637. For more information about an error, try `rustc --explain E0106`. diff --git a/tests/ui/feature-gates/feature-gate-adt_const_params.stderr b/tests/ui/feature-gates/feature-gate-adt_const_params.stderr index e6eeca2e098..fcb9b8a6fc5 100644 --- a/tests/ui/feature-gates/feature-gate-adt_const_params.stderr +++ b/tests/ui/feature-gates/feature-gate-adt_const_params.stderr @@ -5,7 +5,10 @@ LL | struct Foo<const NAME: &'static str>; | ^^^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: aborting due to 1 previous error diff --git a/tests/ui/feature-gates/feature-gate-associated_type_bounds.rs b/tests/ui/feature-gates/feature-gate-associated_type_bounds.rs deleted file mode 100644 index 717da41f871..00000000000 --- a/tests/ui/feature-gates/feature-gate-associated_type_bounds.rs +++ /dev/null @@ -1,61 +0,0 @@ -use std::mem::ManuallyDrop; - -trait Tr1 { type As1: Copy; } -trait Tr2 { type As2: Copy; } - -struct S1; -#[derive(Copy, Clone)] -struct S2; -impl Tr1 for S1 { type As1 = S2; } - -trait _Tr3 { - type A: Iterator<Item: Copy>; - //~^ ERROR associated type bounds are unstable - - type B: Iterator<Item: 'static>; - //~^ ERROR associated type bounds are unstable -} - -struct _St1<T: Tr1<As1: Tr2>> { -//~^ ERROR associated type bounds are unstable - outest: T, - outer: T::As1, - inner: <T::As1 as Tr2>::As2, -} - -enum _En1<T: Tr1<As1: Tr2>> { -//~^ ERROR associated type bounds are unstable - Outest(T), - Outer(T::As1), - Inner(<T::As1 as Tr2>::As2), -} - -union _Un1<T: Tr1<As1: Tr2>> { -//~^ ERROR associated type bounds are unstable - outest: ManuallyDrop<T>, - outer: ManuallyDrop<T::As1>, - inner: ManuallyDrop<<T::As1 as Tr2>::As2>, -} - -type _TaWhere1<T> where T: Iterator<Item: Copy> = T; -//~^ ERROR associated type bounds are unstable - -fn _apit(_: impl Tr1<As1: Copy>) {} -//~^ ERROR associated type bounds are unstable - -fn _rpit() -> impl Tr1<As1: Copy> { S1 } -//~^ ERROR associated type bounds are unstable - -const _cdef: impl Tr1<As1: Copy> = S1; -//~^ ERROR associated type bounds are unstable -//~| ERROR `impl Trait` is not allowed in const types - -static _sdef: impl Tr1<As1: Copy> = S1; -//~^ ERROR associated type bounds are unstable -//~| ERROR `impl Trait` is not allowed in static types - -fn main() { - let _: impl Tr1<As1: Copy> = S1; - //~^ ERROR associated type bounds are unstable - //~| ERROR `impl Trait` is not allowed in the type of variable bindings -} diff --git a/tests/ui/feature-gates/feature-gate-associated_type_bounds.stderr b/tests/ui/feature-gates/feature-gate-associated_type_bounds.stderr deleted file mode 100644 index 1838eab5cda..00000000000 --- a/tests/ui/feature-gates/feature-gate-associated_type_bounds.stderr +++ /dev/null @@ -1,138 +0,0 @@ -error[E0658]: associated type bounds are unstable - --> $DIR/feature-gate-associated_type_bounds.rs:12:22 - | -LL | type A: Iterator<Item: Copy>; - | ^^^^^^^^^^ - | - = note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information - = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error[E0658]: associated type bounds are unstable - --> $DIR/feature-gate-associated_type_bounds.rs:15:22 - | -LL | type B: Iterator<Item: 'static>; - | ^^^^^^^^^^^^^ - | - = note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information - = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error[E0658]: associated type bounds are unstable - --> $DIR/feature-gate-associated_type_bounds.rs:19:20 - | -LL | struct _St1<T: Tr1<As1: Tr2>> { - | ^^^^^^^^ - | - = note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information - = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error[E0658]: associated type bounds are unstable - --> $DIR/feature-gate-associated_type_bounds.rs:26:18 - | -LL | enum _En1<T: Tr1<As1: Tr2>> { - | ^^^^^^^^ - | - = note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information - = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error[E0658]: associated type bounds are unstable - --> $DIR/feature-gate-associated_type_bounds.rs:33:19 - | -LL | union _Un1<T: Tr1<As1: Tr2>> { - | ^^^^^^^^ - | - = note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information - = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error[E0658]: associated type bounds are unstable - --> $DIR/feature-gate-associated_type_bounds.rs:40:37 - | -LL | type _TaWhere1<T> where T: Iterator<Item: Copy> = T; - | ^^^^^^^^^^ - | - = note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information - = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error[E0658]: associated type bounds are unstable - --> $DIR/feature-gate-associated_type_bounds.rs:43:22 - | -LL | fn _apit(_: impl Tr1<As1: Copy>) {} - | ^^^^^^^^^ - | - = note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information - = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error[E0658]: associated type bounds are unstable - --> $DIR/feature-gate-associated_type_bounds.rs:46:24 - | -LL | fn _rpit() -> impl Tr1<As1: Copy> { S1 } - | ^^^^^^^^^ - | - = note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information - = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error[E0658]: associated type bounds are unstable - --> $DIR/feature-gate-associated_type_bounds.rs:49:23 - | -LL | const _cdef: impl Tr1<As1: Copy> = S1; - | ^^^^^^^^^ - | - = note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information - = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error[E0658]: associated type bounds are unstable - --> $DIR/feature-gate-associated_type_bounds.rs:53:24 - | -LL | static _sdef: impl Tr1<As1: Copy> = S1; - | ^^^^^^^^^ - | - = note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information - = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error[E0658]: associated type bounds are unstable - --> $DIR/feature-gate-associated_type_bounds.rs:58:21 - | -LL | let _: impl Tr1<As1: Copy> = S1; - | ^^^^^^^^^ - | - = note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information - = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error[E0562]: `impl Trait` is not allowed in const types - --> $DIR/feature-gate-associated_type_bounds.rs:49:14 - | -LL | const _cdef: impl Tr1<As1: Copy> = S1; - | ^^^^^^^^^^^^^^^^^^^ - | - = note: `impl Trait` is only allowed in arguments and return types of functions and methods - -error[E0562]: `impl Trait` is not allowed in static types - --> $DIR/feature-gate-associated_type_bounds.rs:53:15 - | -LL | static _sdef: impl Tr1<As1: Copy> = S1; - | ^^^^^^^^^^^^^^^^^^^ - | - = note: `impl Trait` is only allowed in arguments and return types of functions and methods - -error[E0562]: `impl Trait` is not allowed in the type of variable bindings - --> $DIR/feature-gate-associated_type_bounds.rs:58:12 - | -LL | let _: impl Tr1<As1: Copy> = S1; - | ^^^^^^^^^^^^^^^^^^^ - | - = note: `impl Trait` is only allowed in arguments and return types of functions and methods - -error: aborting due to 14 previous errors - -Some errors have detailed explanations: E0562, E0658. -For more information about an error, try `rustc --explain E0562`. diff --git a/tests/ui/feature-gates/feature-gate-deref_patterns.rs b/tests/ui/feature-gates/feature-gate-deref_patterns.rs new file mode 100644 index 00000000000..b43001f2d53 --- /dev/null +++ b/tests/ui/feature-gates/feature-gate-deref_patterns.rs @@ -0,0 +1,9 @@ +fn main() { + // We reuse the `box` syntax so this doesn't actually test the feature gate but eh. + let box x = Box::new('c'); //~ ERROR box pattern syntax is experimental + println!("x: {}", x); + + // `box` syntax is allowed to be cfg-ed out for historical reasons (#65742). + #[cfg(FALSE)] + let box _x = Box::new('c'); +} diff --git a/tests/ui/feature-gates/feature-gate-deref_patterns.stderr b/tests/ui/feature-gates/feature-gate-deref_patterns.stderr new file mode 100644 index 00000000000..48426b50d89 --- /dev/null +++ b/tests/ui/feature-gates/feature-gate-deref_patterns.stderr @@ -0,0 +1,13 @@ +error[E0658]: box pattern syntax is experimental + --> $DIR/feature-gate-deref_patterns.rs:3:9 + | +LL | let box x = Box::new('c'); + | ^^^^^ + | + = note: see issue #29641 <https://github.com/rust-lang/rust/issues/29641> for more information + = help: add `#![feature(box_patterns)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/feature-gates/feature-gate-f128.rs b/tests/ui/feature-gates/feature-gate-f128.rs new file mode 100644 index 00000000000..7f60fb6afa0 --- /dev/null +++ b/tests/ui/feature-gates/feature-gate-f128.rs @@ -0,0 +1,15 @@ +#![allow(unused)] + +const A: f128 = 10.0; //~ ERROR the type `f128` is unstable + +pub fn main() { + let a: f128 = 100.0; //~ ERROR the type `f128` is unstable + let b = 0.0f128; //~ ERROR the type `f128` is unstable + foo(1.23); +} + +fn foo(a: f128) {} //~ ERROR the type `f128` is unstable + +struct Bar { + a: f128, //~ ERROR the type `f128` is unstable +} diff --git a/tests/ui/feature-gates/feature-gate-f128.stderr b/tests/ui/feature-gates/feature-gate-f128.stderr new file mode 100644 index 00000000000..299375c9aed --- /dev/null +++ b/tests/ui/feature-gates/feature-gate-f128.stderr @@ -0,0 +1,53 @@ +error[E0658]: the type `f128` is unstable + --> $DIR/feature-gate-f128.rs:3:10 + | +LL | const A: f128 = 10.0; + | ^^^^ + | + = note: see issue #116909 <https://github.com/rust-lang/rust/issues/116909> for more information + = help: add `#![feature(f128)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: the type `f128` is unstable + --> $DIR/feature-gate-f128.rs:6:12 + | +LL | let a: f128 = 100.0; + | ^^^^ + | + = note: see issue #116909 <https://github.com/rust-lang/rust/issues/116909> for more information + = help: add `#![feature(f128)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: the type `f128` is unstable + --> $DIR/feature-gate-f128.rs:11:11 + | +LL | fn foo(a: f128) {} + | ^^^^ + | + = note: see issue #116909 <https://github.com/rust-lang/rust/issues/116909> for more information + = help: add `#![feature(f128)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: the type `f128` is unstable + --> $DIR/feature-gate-f128.rs:14:8 + | +LL | a: f128, + | ^^^^ + | + = note: see issue #116909 <https://github.com/rust-lang/rust/issues/116909> for more information + = help: add `#![feature(f128)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: the type `f128` is unstable + --> $DIR/feature-gate-f128.rs:7:13 + | +LL | let b = 0.0f128; + | ^^^^^^^ + | + = note: see issue #116909 <https://github.com/rust-lang/rust/issues/116909> for more information + = help: add `#![feature(f128)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error: aborting due to 5 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/feature-gates/feature-gate-f16.rs b/tests/ui/feature-gates/feature-gate-f16.rs new file mode 100644 index 00000000000..31d8f87f3ba --- /dev/null +++ b/tests/ui/feature-gates/feature-gate-f16.rs @@ -0,0 +1,15 @@ +#![allow(unused)] + +const A: f16 = 10.0; //~ ERROR the type `f16` is unstable + +pub fn main() { + let a: f16 = 100.0; //~ ERROR the type `f16` is unstable + let b = 0.0f16; //~ ERROR the type `f16` is unstable + foo(1.23); +} + +fn foo(a: f16) {} //~ ERROR the type `f16` is unstable + +struct Bar { + a: f16, //~ ERROR the type `f16` is unstable +} diff --git a/tests/ui/feature-gates/feature-gate-f16.stderr b/tests/ui/feature-gates/feature-gate-f16.stderr new file mode 100644 index 00000000000..e54b54a47bd --- /dev/null +++ b/tests/ui/feature-gates/feature-gate-f16.stderr @@ -0,0 +1,53 @@ +error[E0658]: the type `f16` is unstable + --> $DIR/feature-gate-f16.rs:3:10 + | +LL | const A: f16 = 10.0; + | ^^^ + | + = note: see issue #116909 <https://github.com/rust-lang/rust/issues/116909> for more information + = help: add `#![feature(f16)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: the type `f16` is unstable + --> $DIR/feature-gate-f16.rs:6:12 + | +LL | let a: f16 = 100.0; + | ^^^ + | + = note: see issue #116909 <https://github.com/rust-lang/rust/issues/116909> for more information + = help: add `#![feature(f16)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: the type `f16` is unstable + --> $DIR/feature-gate-f16.rs:11:11 + | +LL | fn foo(a: f16) {} + | ^^^ + | + = note: see issue #116909 <https://github.com/rust-lang/rust/issues/116909> for more information + = help: add `#![feature(f16)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: the type `f16` is unstable + --> $DIR/feature-gate-f16.rs:14:8 + | +LL | a: f16, + | ^^^ + | + = note: see issue #116909 <https://github.com/rust-lang/rust/issues/116909> for more information + = help: add `#![feature(f16)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: the type `f16` is unstable + --> $DIR/feature-gate-f16.rs:7:13 + | +LL | let b = 0.0f16; + | ^^^^^^ + | + = note: see issue #116909 <https://github.com/rust-lang/rust/issues/116909> for more information + = help: add `#![feature(f16)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error: aborting due to 5 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/feature-gates/feature-gate-generic_arg_infer.normal.stderr b/tests/ui/feature-gates/feature-gate-generic_arg_infer.normal.stderr index bc022476c19..97370f0489b 100644 --- a/tests/ui/feature-gates/feature-gate-generic_arg_infer.normal.stderr +++ b/tests/ui/feature-gates/feature-gate-generic_arg_infer.normal.stderr @@ -27,7 +27,10 @@ LL | let _x = foo::<_>([1,2]); | ^ | = help: const arguments cannot yet be inferred with `_` - = help: add `#![feature(generic_arg_infer)]` to the crate attributes to enable +help: add `#![feature(generic_arg_infer)]` to the crate attributes to enable + | +LL + #![feature(generic_arg_infer)] + | error[E0658]: using `_` for array lengths is unstable --> $DIR/feature-gate-generic_arg_infer.rs:11:27 diff --git a/tests/ui/feature-gates/feature-gate-imported_main.rs b/tests/ui/feature-gates/feature-gate-imported_main.rs deleted file mode 100644 index b351d0d0e9a..00000000000 --- a/tests/ui/feature-gates/feature-gate-imported_main.rs +++ /dev/null @@ -1,6 +0,0 @@ -pub mod foo { - pub fn bar() { - println!("Hello world!"); - } -} -use foo::bar as main; //~ ERROR using an imported function as entry point diff --git a/tests/ui/feature-gates/feature-gate-imported_main.stderr b/tests/ui/feature-gates/feature-gate-imported_main.stderr deleted file mode 100644 index 987bda7059c..00000000000 --- a/tests/ui/feature-gates/feature-gate-imported_main.stderr +++ /dev/null @@ -1,13 +0,0 @@ -error[E0658]: using an imported function as entry point `main` is experimental - --> $DIR/feature-gate-imported_main.rs:6:5 - | -LL | use foo::bar as main; - | ^^^^^^^^^^^^^^^^ - | - = note: see issue #28937 <https://github.com/rust-lang/rust/issues/28937> for more information - = help: add `#![feature(imported_main)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/feature-gates/feature-gate-postfix_match.rs b/tests/ui/feature-gates/feature-gate-postfix_match.rs new file mode 100644 index 00000000000..dce7e81a9ae --- /dev/null +++ b/tests/ui/feature-gates/feature-gate-postfix_match.rs @@ -0,0 +1,17 @@ +// Testing that postfix match doesn't work without enabling the feature + +fn main() { + let val = Some(42); + + val.match { //~ ERROR postfix match is experimental + Some(42) => "the answer to life, the universe, and everything", + _ => "might be the answer to something" + }; + + // Test that the gate works behind a cfg + #[cfg(FALSE)] + val.match { //~ ERROR postfix match is experimental + Some(42) => "the answer to life, the universe, and everything", + _ => "might be the answer to something" + }; +} diff --git a/tests/ui/feature-gates/feature-gate-postfix_match.stderr b/tests/ui/feature-gates/feature-gate-postfix_match.stderr new file mode 100644 index 00000000000..136838788dd --- /dev/null +++ b/tests/ui/feature-gates/feature-gate-postfix_match.stderr @@ -0,0 +1,23 @@ +error[E0658]: postfix match is experimental + --> $DIR/feature-gate-postfix_match.rs:6:9 + | +LL | val.match { + | ^^^^^ + | + = note: see issue #121618 <https://github.com/rust-lang/rust/issues/121618> for more information + = help: add `#![feature(postfix_match)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: postfix match is experimental + --> $DIR/feature-gate-postfix_match.rs:13:9 + | +LL | val.match { + | ^^^^^ + | + = note: see issue #121618 <https://github.com/rust-lang/rust/issues/121618> for more information + = help: add `#![feature(postfix_match)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/feature-gates/feature-gate-trivial_bounds.stderr b/tests/ui/feature-gates/feature-gate-trivial_bounds.stderr index 5e62221628d..0ee2d93fb26 100644 --- a/tests/ui/feature-gates/feature-gate-trivial_bounds.stderr +++ b/tests/ui/feature-gates/feature-gate-trivial_bounds.stderr @@ -6,7 +6,10 @@ LL | enum E where i32: Foo { V } | = help: the trait `Foo` is implemented for `()` = help: see issue #48214 - = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable +help: add `#![feature(trivial_bounds)]` to the crate attributes to enable + | +LL + #![feature(trivial_bounds)] + | error[E0277]: the trait bound `i32: Foo` is not satisfied --> $DIR/feature-gate-trivial_bounds.rs:12:16 @@ -16,7 +19,10 @@ LL | struct S where i32: Foo; | = help: the trait `Foo` is implemented for `()` = help: see issue #48214 - = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable +help: add `#![feature(trivial_bounds)]` to the crate attributes to enable + | +LL + #![feature(trivial_bounds)] + | error[E0277]: the trait bound `i32: Foo` is not satisfied --> $DIR/feature-gate-trivial_bounds.rs:14:15 @@ -26,7 +32,10 @@ LL | trait T where i32: Foo {} | = help: the trait `Foo` is implemented for `()` = help: see issue #48214 - = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable +help: add `#![feature(trivial_bounds)]` to the crate attributes to enable + | +LL + #![feature(trivial_bounds)] + | error[E0277]: the trait bound `i32: Foo` is not satisfied --> $DIR/feature-gate-trivial_bounds.rs:16:15 @@ -36,7 +45,10 @@ LL | union U where i32: Foo { f: i32 } | = help: the trait `Foo` is implemented for `()` = help: see issue #48214 - = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable +help: add `#![feature(trivial_bounds)]` to the crate attributes to enable + | +LL + #![feature(trivial_bounds)] + | error[E0277]: the trait bound `i32: Foo` is not satisfied --> $DIR/feature-gate-trivial_bounds.rs:20:23 @@ -46,7 +58,10 @@ LL | impl Foo for () where i32: Foo { | = help: the trait `Foo` is implemented for `()` = help: see issue #48214 - = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable +help: add `#![feature(trivial_bounds)]` to the crate attributes to enable + | +LL + #![feature(trivial_bounds)] + | error[E0277]: the trait bound `i32: Foo` is not satisfied --> $DIR/feature-gate-trivial_bounds.rs:28:14 @@ -56,7 +71,10 @@ LL | fn f() where i32: Foo | = help: the trait `Foo` is implemented for `()` = help: see issue #48214 - = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable +help: add `#![feature(trivial_bounds)]` to the crate attributes to enable + | +LL + #![feature(trivial_bounds)] + | error[E0277]: the trait bound `String: Neg` is not satisfied --> $DIR/feature-gate-trivial_bounds.rs:36:38 @@ -65,7 +83,10 @@ LL | fn use_op(s: String) -> String where String: ::std::ops::Neg<Output=String> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Neg` is not implemented for `String` | = help: see issue #48214 - = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable +help: add `#![feature(trivial_bounds)]` to the crate attributes to enable + | +LL + #![feature(trivial_bounds)] + | error[E0277]: `i32` is not an iterator --> $DIR/feature-gate-trivial_bounds.rs:40:20 @@ -75,7 +96,10 @@ LL | fn use_for() where i32: Iterator { | = help: the trait `Iterator` is not implemented for `i32` = help: see issue #48214 - = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable +help: add `#![feature(trivial_bounds)]` to the crate attributes to enable + | +LL + #![feature(trivial_bounds)] + | error[E0277]: the size for values of type `str` cannot be known at compilation time --> $DIR/feature-gate-trivial_bounds.rs:52:32 @@ -85,7 +109,10 @@ LL | struct TwoStrs(str, str) where str: Sized; | = help: the trait `Sized` is not implemented for `str` = help: see issue #48214 - = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable +help: add `#![feature(trivial_bounds)]` to the crate attributes to enable + | +LL + #![feature(trivial_bounds)] + | error[E0277]: the size for values of type `(dyn A + 'static)` cannot be known at compilation time --> $DIR/feature-gate-trivial_bounds.rs:55:26 @@ -100,7 +127,10 @@ note: required because it appears within the type `Dst<(dyn A + 'static)>` LL | struct Dst<X: ?Sized> { | ^^^ = help: see issue #48214 - = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable +help: add `#![feature(trivial_bounds)]` to the crate attributes to enable + | +LL + #![feature(trivial_bounds)] + | error[E0277]: the size for values of type `str` cannot be known at compilation time --> $DIR/feature-gate-trivial_bounds.rs:59:30 @@ -110,7 +140,10 @@ LL | fn return_str() -> str where str: Sized { | = help: the trait `Sized` is not implemented for `str` = help: see issue #48214 - = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable +help: add `#![feature(trivial_bounds)]` to the crate attributes to enable + | +LL + #![feature(trivial_bounds)] + | error: aborting due to 11 previous errors diff --git a/tests/ui/fmt/format-args-non-identifier-diagnostics.fixed b/tests/ui/fmt/format-args-non-identifier-diagnostics.fixed new file mode 100644 index 00000000000..bd4db948067 --- /dev/null +++ b/tests/ui/fmt/format-args-non-identifier-diagnostics.fixed @@ -0,0 +1,10 @@ +// Checks that there is a suggestion for simple tuple index access expression (used where an +// identifier is expected in a format arg) to use positional arg instead. +// Issue: <https://github.com/rust-lang/rust/issues/122535>. +//@ run-rustfix + +fn main() { + let x = (1,); + println!("{0}", x.0); + //~^ ERROR invalid format string +} diff --git a/tests/ui/fmt/format-args-non-identifier-diagnostics.rs b/tests/ui/fmt/format-args-non-identifier-diagnostics.rs new file mode 100644 index 00000000000..aab705341f7 --- /dev/null +++ b/tests/ui/fmt/format-args-non-identifier-diagnostics.rs @@ -0,0 +1,10 @@ +// Checks that there is a suggestion for simple tuple index access expression (used where an +// identifier is expected in a format arg) to use positional arg instead. +// Issue: <https://github.com/rust-lang/rust/issues/122535>. +//@ run-rustfix + +fn main() { + let x = (1,); + println!("{x.0}"); + //~^ ERROR invalid format string +} diff --git a/tests/ui/fmt/format-args-non-identifier-diagnostics.stderr b/tests/ui/fmt/format-args-non-identifier-diagnostics.stderr new file mode 100644 index 00000000000..08abba2854e --- /dev/null +++ b/tests/ui/fmt/format-args-non-identifier-diagnostics.stderr @@ -0,0 +1,13 @@ +error: invalid format string: tuple index access isn't supported + --> $DIR/format-args-non-identifier-diagnostics.rs:8:16 + | +LL | println!("{x.0}"); + | ^^^ not supported in format string + | +help: consider using a positional formatting argument instead + | +LL | println!("{0}", x.0); + | ~ +++++ + +error: aborting due to 1 previous error + diff --git a/tests/ui/fmt/nested-awaits-issue-122674.rs b/tests/ui/fmt/nested-awaits-issue-122674.rs new file mode 100644 index 00000000000..f250933dadb --- /dev/null +++ b/tests/ui/fmt/nested-awaits-issue-122674.rs @@ -0,0 +1,22 @@ +// Non-regression test for issue #122674: a change in the format args visitor missed nested awaits. + +//@ edition: 2021 +//@ check-pass + +pub fn f1() -> impl std::future::Future<Output = Result<(), String>> + Send { + async { + should_work().await?; + Ok(()) + } +} + +async fn should_work() -> Result<String, String> { + let x = 1; + Err(format!("test: {}: {}", x, inner().await?)) +} + +async fn inner() -> Result<String, String> { + Ok("test".to_string()) +} + +fn main() {} diff --git a/tests/ui/generic-associated-types/issue-102335-gat.rs b/tests/ui/generic-associated-types/issue-102335-gat.rs index a7255fdcbf5..3a4a0c10771 100644 --- a/tests/ui/generic-associated-types/issue-102335-gat.rs +++ b/tests/ui/generic-associated-types/issue-102335-gat.rs @@ -1,6 +1,7 @@ trait T { type A: S<C<(), i32 = ()> = ()>; //~^ ERROR associated type bindings are not allowed here + //~| ERROR associated type bindings are not allowed here } trait Q {} diff --git a/tests/ui/generic-associated-types/issue-102335-gat.stderr b/tests/ui/generic-associated-types/issue-102335-gat.stderr index 39ca7954ede..f5e782e92fc 100644 --- a/tests/ui/generic-associated-types/issue-102335-gat.stderr +++ b/tests/ui/generic-associated-types/issue-102335-gat.stderr @@ -4,6 +4,14 @@ error[E0229]: associated type bindings are not allowed here LL | type A: S<C<(), i32 = ()> = ()>; | ^^^^^^^^ associated type not allowed here -error: aborting due to 1 previous error +error[E0229]: associated type bindings are not allowed here + --> $DIR/issue-102335-gat.rs:2:21 + | +LL | type A: S<C<(), i32 = ()> = ()>; + | ^^^^^^^^ associated type not allowed here + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0229`. diff --git a/tests/ui/generic-associated-types/issue-119942-unsatisified-gat-bound-during-assoc-ty-selection.rs b/tests/ui/generic-associated-types/issue-119942-unsatisified-gat-bound-during-assoc-ty-selection.rs index 252dc7d751e..86da6ebfaaa 100644 --- a/tests/ui/generic-associated-types/issue-119942-unsatisified-gat-bound-during-assoc-ty-selection.rs +++ b/tests/ui/generic-associated-types/issue-119942-unsatisified-gat-bound-during-assoc-ty-selection.rs @@ -29,5 +29,5 @@ where fn main() { let mut list = RcNode::<i32>::new(); - //~^ ERROR the size for values of type `Node<i32, RcFamily>` cannot be known at compilation time + //~^ ERROR trait bounds were not satisfied } diff --git a/tests/ui/generic-associated-types/issue-119942-unsatisified-gat-bound-during-assoc-ty-selection.stderr b/tests/ui/generic-associated-types/issue-119942-unsatisified-gat-bound-during-assoc-ty-selection.stderr index 7813370ae63..b31689dbf73 100644 --- a/tests/ui/generic-associated-types/issue-119942-unsatisified-gat-bound-during-assoc-ty-selection.stderr +++ b/tests/ui/generic-associated-types/issue-119942-unsatisified-gat-bound-during-assoc-ty-selection.stderr @@ -15,20 +15,15 @@ help: consider relaxing the implicit `Sized` restriction LL | type Pointer<T>: Deref<Target = T> + ?Sized; | ++++++++ -error[E0599]: the size for values of type `Node<i32, RcFamily>` cannot be known at compilation time +error[E0599]: the variant or associated item `new` exists for enum `Node<i32, RcFamily>`, but its trait bounds were not satisfied --> $DIR/issue-119942-unsatisified-gat-bound-during-assoc-ty-selection.rs:31:35 | LL | enum Node<T, P: PointerFamily> { - | ------------------------------ variant or associated item `new` not found for this enum because it doesn't satisfy `Node<i32, RcFamily>: Sized` + | ------------------------------ variant or associated item `new` not found for this enum ... LL | let mut list = RcNode::<i32>::new(); - | ^^^ doesn't have a size known at compile-time + | ^^^ variant or associated item cannot be called on `Node<i32, RcFamily>` due to unsatisfied trait bounds | -note: trait bound `Node<i32, RcFamily>: Sized` was not satisfied - --> $DIR/issue-119942-unsatisified-gat-bound-during-assoc-ty-selection.rs:4:18 - | -LL | type Pointer<T>: Deref<Target = T>; - | ------- ^ unsatisfied trait bound introduced here note: trait bound `(dyn Deref<Target = Node<i32, RcFamily>> + 'static): Sized` was not satisfied --> $DIR/issue-119942-unsatisified-gat-bound-during-assoc-ty-selection.rs:23:29 | @@ -37,8 +32,6 @@ LL | impl<T, P: PointerFamily> Node<T, P> LL | where LL | P::Pointer<Node<T, P>>: Sized, | ^^^^^ unsatisfied trait bound introduced here -note: the trait `Sized` must be implemented - --> $SRC_DIR/core/src/marker.rs:LL:COL error: aborting due to 2 previous errors diff --git a/tests/ui/generic-associated-types/issue-80433.rs b/tests/ui/generic-associated-types/issue-80433.rs index 6d23427f16f..53057542440 100644 --- a/tests/ui/generic-associated-types/issue-80433.rs +++ b/tests/ui/generic-associated-types/issue-80433.rs @@ -29,5 +29,5 @@ fn test_simpler<'a>(dst: &'a mut impl TestMut<Output = &'a mut f32>) fn main() { let mut t1: E<f32> = Default::default(); - test_simpler(&mut t1); //~ ERROR does not live long enough + test_simpler(&mut t1); } diff --git a/tests/ui/generic-associated-types/issue-80433.stderr b/tests/ui/generic-associated-types/issue-80433.stderr index 1ca080f5df2..a9a14d3f51c 100644 --- a/tests/ui/generic-associated-types/issue-80433.stderr +++ b/tests/ui/generic-associated-types/issue-80433.stderr @@ -48,20 +48,7 @@ LL | *dst.test_mut() = n.into(); | `dst` escapes the function body here | argument requires that `'a` must outlive `'static` -error[E0597]: `t1` does not live long enough - --> $DIR/issue-80433.rs:32:18 - | -LL | let mut t1: E<f32> = Default::default(); - | ------ binding `t1` declared here -LL | test_simpler(&mut t1); - | -------------^^^^^^^- - | | | - | | borrowed value does not live long enough - | argument requires that `t1` is borrowed for `'static` -LL | } - | - `t1` dropped here while still borrowed - -error: aborting due to 5 previous errors +error: aborting due to 4 previous errors -Some errors have detailed explanations: E0107, E0499, E0521, E0597. +Some errors have detailed explanations: E0107, E0499, E0521. For more information about an error, try `rustc --explain E0107`. diff --git a/tests/ui/generic-associated-types/issue-81712-cyclic-traits.rs b/tests/ui/generic-associated-types/issue-81712-cyclic-traits.rs index a7cc9a6053e..412eeb6e29a 100644 --- a/tests/ui/generic-associated-types/issue-81712-cyclic-traits.rs +++ b/tests/ui/generic-associated-types/issue-81712-cyclic-traits.rs @@ -13,6 +13,7 @@ trait C { trait D<T> { type CType: C<DType = Self>; //~^ ERROR missing generics for associated type + //~| ERROR missing generics for associated type } fn main() {} diff --git a/tests/ui/generic-associated-types/issue-81712-cyclic-traits.stderr b/tests/ui/generic-associated-types/issue-81712-cyclic-traits.stderr index 5eb988ea042..33c40f88f87 100644 --- a/tests/ui/generic-associated-types/issue-81712-cyclic-traits.stderr +++ b/tests/ui/generic-associated-types/issue-81712-cyclic-traits.stderr @@ -14,6 +14,23 @@ help: add missing generic argument LL | type CType: C<DType<T> = Self>; | +++ -error: aborting due to 1 previous error +error[E0107]: missing generics for associated type `C::DType` + --> $DIR/issue-81712-cyclic-traits.rs:14:19 + | +LL | type CType: C<DType = Self>; + | ^^^^^ expected 1 generic argument + | +note: associated type defined here, with 1 generic parameter: `T` + --> $DIR/issue-81712-cyclic-traits.rs:11:10 + | +LL | type DType<T>: D<T, CType = Self>; + | ^^^^^ - + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` +help: add missing generic argument + | +LL | type CType: C<DType<T> = Self>; + | +++ + +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0107`. diff --git a/tests/ui/generic-const-items/elided-lifetimes.stderr b/tests/ui/generic-const-items/elided-lifetimes.stderr index e7df8ca5cfd..1d4a997ff60 100644 --- a/tests/ui/generic-const-items/elided-lifetimes.stderr +++ b/tests/ui/generic-const-items/elided-lifetimes.stderr @@ -28,7 +28,10 @@ LL | const I<const S: &str>: &str = ""; | ^^^^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: aborting due to 4 previous errors diff --git a/tests/ui/impl-trait/erased-regions-in-hidden-ty.current.stderr b/tests/ui/impl-trait/erased-regions-in-hidden-ty.current.stderr index 5fea5353ba5..1d648162113 100644 --- a/tests/ui/impl-trait/erased-regions-in-hidden-ty.current.stderr +++ b/tests/ui/impl-trait/erased-regions-in-hidden-ty.current.stderr @@ -1,10 +1,10 @@ -error: {foo<ReEarlyParam(DefId(..), 0, 'a)>::{closure#0} closure_kind_ty=i8 closure_sig_as_fn_ptr_ty=extern "rust-call" fn(()) upvar_tys=()} +error: {foo<DefId(..)_'a/#0>::{closure#0} closure_kind_ty=i8 closure_sig_as_fn_ptr_ty=extern "rust-call" fn(()) upvar_tys=()} --> $DIR/erased-regions-in-hidden-ty.rs:12:36 | LL | fn foo<'a: 'a>(x: &'a Vec<i32>) -> impl Fn() + 'static { | ^^^^^^^^^^^^^^^^^^^ -error: Opaque(DefId(..), [ReErased]) +error: Opaque(DefId(..), ['{erased}]) --> $DIR/erased-regions-in-hidden-ty.rs:18:13 | LL | fn bar() -> impl Fn() + 'static { diff --git a/tests/ui/impl-trait/erased-regions-in-hidden-ty.next.stderr b/tests/ui/impl-trait/erased-regions-in-hidden-ty.next.stderr index 5fea5353ba5..1d648162113 100644 --- a/tests/ui/impl-trait/erased-regions-in-hidden-ty.next.stderr +++ b/tests/ui/impl-trait/erased-regions-in-hidden-ty.next.stderr @@ -1,10 +1,10 @@ -error: {foo<ReEarlyParam(DefId(..), 0, 'a)>::{closure#0} closure_kind_ty=i8 closure_sig_as_fn_ptr_ty=extern "rust-call" fn(()) upvar_tys=()} +error: {foo<DefId(..)_'a/#0>::{closure#0} closure_kind_ty=i8 closure_sig_as_fn_ptr_ty=extern "rust-call" fn(()) upvar_tys=()} --> $DIR/erased-regions-in-hidden-ty.rs:12:36 | LL | fn foo<'a: 'a>(x: &'a Vec<i32>) -> impl Fn() + 'static { | ^^^^^^^^^^^^^^^^^^^ -error: Opaque(DefId(..), [ReErased]) +error: Opaque(DefId(..), ['{erased}]) --> $DIR/erased-regions-in-hidden-ty.rs:18:13 | LL | fn bar() -> impl Fn() + 'static { diff --git a/tests/ui/impl-trait/erased-regions-in-hidden-ty.rs b/tests/ui/impl-trait/erased-regions-in-hidden-ty.rs index c18df16bd6c..9d71685f179 100644 --- a/tests/ui/impl-trait/erased-regions-in-hidden-ty.rs +++ b/tests/ui/impl-trait/erased-regions-in-hidden-ty.rs @@ -10,14 +10,14 @@ // Make sure that the compiler can handle `ReErased` in the hidden type of an opaque. fn foo<'a: 'a>(x: &'a Vec<i32>) -> impl Fn() + 'static { -//~^ ERROR 0, 'a)>::{closure#0} closure_kind_ty=i8 closure_sig_as_fn_ptr_ty=extern "rust-call" fn(()) upvar_tys=()} -// Can't write whole type because of lack of path sanitization + //~^ ERROR 'a/#0>::{closure#0} closure_kind_ty=i8 closure_sig_as_fn_ptr_ty=extern "rust-call" fn(()) upvar_tys=()} + // Can't write whole type because of lack of path sanitization || () } fn bar() -> impl Fn() + 'static { -//~^ ERROR , [ReErased]) -// Can't write whole type because of lack of path sanitization + //~^ ERROR , ['{erased}]) + // Can't write whole type because of lack of path sanitization foo(&vec![]) } diff --git a/tests/ui/impl-trait/fresh-lifetime-from-bare-trait-obj-114664.rs b/tests/ui/impl-trait/fresh-lifetime-from-bare-trait-obj-114664.rs index 41c5b9f5074..e75cfc88ef4 100644 --- a/tests/ui/impl-trait/fresh-lifetime-from-bare-trait-obj-114664.rs +++ b/tests/ui/impl-trait/fresh-lifetime-from-bare-trait-obj-114664.rs @@ -5,6 +5,8 @@ fn ice() -> impl AsRef<Fn(&())> { //~^ WARN trait objects without an explicit `dyn` are deprecated //~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! + //~| WARN trait objects without an explicit `dyn` are deprecated + //~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! Foo } diff --git a/tests/ui/impl-trait/fresh-lifetime-from-bare-trait-obj-114664.stderr b/tests/ui/impl-trait/fresh-lifetime-from-bare-trait-obj-114664.stderr index 3cb3af89bfc..d82b2c0f606 100644 --- a/tests/ui/impl-trait/fresh-lifetime-from-bare-trait-obj-114664.stderr +++ b/tests/ui/impl-trait/fresh-lifetime-from-bare-trait-obj-114664.stderr @@ -12,5 +12,19 @@ help: if this is an object-safe trait, use `dyn` LL | fn ice() -> impl AsRef<dyn Fn(&())> { | +++ -warning: 1 warning emitted +warning: trait objects without an explicit `dyn` are deprecated + --> $DIR/fresh-lifetime-from-bare-trait-obj-114664.rs:5:24 + | +LL | fn ice() -> impl AsRef<Fn(&())> { + | ^^^^^^^ + | + = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! + = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` +help: if this is an object-safe trait, use `dyn` + | +LL | fn ice() -> impl AsRef<dyn Fn(&())> { + | +++ + +warning: 2 warnings emitted diff --git a/tests/ui/impl-trait/ice-unexpected-param-type-whensubstituting-in-region-112823.rs b/tests/ui/impl-trait/ice-unexpected-param-type-whensubstituting-in-region-112823.rs new file mode 100644 index 00000000000..d6fa56663a3 --- /dev/null +++ b/tests/ui/impl-trait/ice-unexpected-param-type-whensubstituting-in-region-112823.rs @@ -0,0 +1,30 @@ +// test for ICE #112823 +// Unexpected parameter Type(Repr) when substituting in region + +#![feature(impl_trait_in_assoc_type)] + +use std::future::Future; + +trait Stream {} + +trait X { + type LineStream<'a, Repr> + where + Self: 'a; + type LineStreamFut<'a, Repr> + where + Self: 'a; +} + +struct Y; + +impl X for Y { + type LineStream<'c, 'd> = impl Stream; + //~^ ERROR type `LineStream` has 0 type parameters but its trait declaration has 1 type parameter + type LineStreamFut<'a, Repr> = impl Future<Output = Self::LineStream<'a, Repr>>; + fn line_stream<'a, Repr>(&'a self) -> Self::LineStreamFut<'a, Repr> {} + //~^ ERROR `()` is not a future + //~^^ method `line_stream` is not a member of trait `X` +} + +pub fn main() {} diff --git a/tests/ui/impl-trait/ice-unexpected-param-type-whensubstituting-in-region-112823.stderr b/tests/ui/impl-trait/ice-unexpected-param-type-whensubstituting-in-region-112823.stderr new file mode 100644 index 00000000000..28a0f7461e2 --- /dev/null +++ b/tests/ui/impl-trait/ice-unexpected-param-type-whensubstituting-in-region-112823.stderr @@ -0,0 +1,31 @@ +error[E0407]: method `line_stream` is not a member of trait `X` + --> $DIR/ice-unexpected-param-type-whensubstituting-in-region-112823.rs:25:5 + | +LL | fn line_stream<'a, Repr>(&'a self) -> Self::LineStreamFut<'a, Repr> {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a member of trait `X` + +error[E0049]: type `LineStream` has 0 type parameters but its trait declaration has 1 type parameter + --> $DIR/ice-unexpected-param-type-whensubstituting-in-region-112823.rs:22:21 + | +LL | type LineStream<'a, Repr> + | -- ---- + | | + | expected 1 type parameter +... +LL | type LineStream<'c, 'd> = impl Stream; + | ^^ ^^ + | | + | found 0 type parameters + +error[E0277]: `()` is not a future + --> $DIR/ice-unexpected-param-type-whensubstituting-in-region-112823.rs:25:43 + | +LL | fn line_stream<'a, Repr>(&'a self) -> Self::LineStreamFut<'a, Repr> {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `()` is not a future + | + = help: the trait `Future` is not implemented for `()` + +error: aborting due to 3 previous errors + +Some errors have detailed explanations: E0049, E0277, E0407. +For more information about an error, try `rustc --explain E0049`. diff --git a/tests/ui/impl-trait/impl-fn-hrtb-bounds.rs b/tests/ui/impl-trait/impl-fn-hrtb-bounds.rs index a9ea657f10e..da7530b4e7a 100644 --- a/tests/ui/impl-trait/impl-fn-hrtb-bounds.rs +++ b/tests/ui/impl-trait/impl-fn-hrtb-bounds.rs @@ -4,19 +4,16 @@ use std::fmt::Debug; fn a() -> impl Fn(&u8) -> (impl Debug + '_) { //~^ ERROR `impl Trait` cannot capture higher-ranked lifetime from outer `impl Trait` |x| x - //~^ ERROR lifetime may not live long enough } fn b() -> impl for<'a> Fn(&'a u8) -> (impl Debug + 'a) { //~^ ERROR `impl Trait` cannot capture higher-ranked lifetime from outer `impl Trait` |x| x - //~^ ERROR lifetime may not live long enough } fn c() -> impl for<'a> Fn(&'a u8) -> (impl Debug + '_) { //~^ ERROR `impl Trait` cannot capture higher-ranked lifetime from outer `impl Trait` |x| x - //~^ ERROR lifetime may not live long enough } fn d() -> impl Fn() -> (impl Debug + '_) { diff --git a/tests/ui/impl-trait/impl-fn-hrtb-bounds.stderr b/tests/ui/impl-trait/impl-fn-hrtb-bounds.stderr index bdb099619b7..7d108b30b76 100644 --- a/tests/ui/impl-trait/impl-fn-hrtb-bounds.stderr +++ b/tests/ui/impl-trait/impl-fn-hrtb-bounds.stderr @@ -1,5 +1,5 @@ error[E0106]: missing lifetime specifier - --> $DIR/impl-fn-hrtb-bounds.rs:22:38 + --> $DIR/impl-fn-hrtb-bounds.rs:19:38 | LL | fn d() -> impl Fn() -> (impl Debug + '_) { | ^^ expected named lifetime parameter @@ -22,58 +22,31 @@ note: lifetime declared here LL | fn a() -> impl Fn(&u8) -> (impl Debug + '_) { | ^ -error: lifetime may not live long enough - --> $DIR/impl-fn-hrtb-bounds.rs:6:9 - | -LL | |x| x - | -- ^ returning this value requires that `'1` must outlive `'2` - | || - | |return type of closure is impl Debug + '2 - | has type `&'1 u8` - error[E0657]: `impl Trait` cannot capture higher-ranked lifetime from outer `impl Trait` - --> $DIR/impl-fn-hrtb-bounds.rs:10:52 + --> $DIR/impl-fn-hrtb-bounds.rs:9:52 | LL | fn b() -> impl for<'a> Fn(&'a u8) -> (impl Debug + 'a) { | ^^ | note: lifetime declared here - --> $DIR/impl-fn-hrtb-bounds.rs:10:20 + --> $DIR/impl-fn-hrtb-bounds.rs:9:20 | LL | fn b() -> impl for<'a> Fn(&'a u8) -> (impl Debug + 'a) { | ^^ -error: lifetime may not live long enough - --> $DIR/impl-fn-hrtb-bounds.rs:12:9 - | -LL | |x| x - | -- ^ returning this value requires that `'1` must outlive `'2` - | || - | |return type of closure is impl Debug + '2 - | has type `&'1 u8` - error[E0657]: `impl Trait` cannot capture higher-ranked lifetime from outer `impl Trait` - --> $DIR/impl-fn-hrtb-bounds.rs:16:52 + --> $DIR/impl-fn-hrtb-bounds.rs:14:52 | LL | fn c() -> impl for<'a> Fn(&'a u8) -> (impl Debug + '_) { | ^^ | note: lifetime declared here - --> $DIR/impl-fn-hrtb-bounds.rs:16:20 + --> $DIR/impl-fn-hrtb-bounds.rs:14:20 | LL | fn c() -> impl for<'a> Fn(&'a u8) -> (impl Debug + '_) { | ^^ -error: lifetime may not live long enough - --> $DIR/impl-fn-hrtb-bounds.rs:18:9 - | -LL | |x| x - | -- ^ returning this value requires that `'1` must outlive `'2` - | || - | |return type of closure is impl Debug + '2 - | has type `&'1 u8` - -error: aborting due to 7 previous errors +error: aborting due to 4 previous errors Some errors have detailed explanations: E0106, E0657. For more information about an error, try `rustc --explain E0106`. diff --git a/tests/ui/impl-trait/impl-fn-parsing-ambiguities.rs b/tests/ui/impl-trait/impl-fn-parsing-ambiguities.rs index ef9d8733509..7679b7ec478 100644 --- a/tests/ui/impl-trait/impl-fn-parsing-ambiguities.rs +++ b/tests/ui/impl-trait/impl-fn-parsing-ambiguities.rs @@ -5,7 +5,6 @@ fn a() -> impl Fn(&u8) -> impl Debug + '_ { //~^ ERROR ambiguous `+` in a type //~| ERROR cannot capture higher-ranked lifetime from outer `impl Trait` |x| x - //~^ ERROR lifetime may not live long enough } fn b() -> impl Fn() -> impl Debug + Send { diff --git a/tests/ui/impl-trait/impl-fn-parsing-ambiguities.stderr b/tests/ui/impl-trait/impl-fn-parsing-ambiguities.stderr index 3881b37a0cb..e0955faac7c 100644 --- a/tests/ui/impl-trait/impl-fn-parsing-ambiguities.stderr +++ b/tests/ui/impl-trait/impl-fn-parsing-ambiguities.stderr @@ -5,7 +5,7 @@ LL | fn a() -> impl Fn(&u8) -> impl Debug + '_ { | ^^^^^^^^^^^^^^^ help: use parentheses to disambiguate: `(impl Debug + '_)` error: ambiguous `+` in a type - --> $DIR/impl-fn-parsing-ambiguities.rs:11:24 + --> $DIR/impl-fn-parsing-ambiguities.rs:10:24 | LL | fn b() -> impl Fn() -> impl Debug + Send { | ^^^^^^^^^^^^^^^^^ help: use parentheses to disambiguate: `(impl Debug + Send)` @@ -22,15 +22,6 @@ note: lifetime declared here LL | fn a() -> impl Fn(&u8) -> impl Debug + '_ { | ^ -error: lifetime may not live long enough - --> $DIR/impl-fn-parsing-ambiguities.rs:7:9 - | -LL | |x| x - | -- ^ returning this value requires that `'1` must outlive `'2` - | || - | |return type of closure is impl Debug + '2 - | has type `&'1 u8` - -error: aborting due to 4 previous errors +error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0657`. diff --git a/tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit.stderr b/tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit.stderr index c898d17f4b7..022df6f906c 100644 --- a/tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit.stderr +++ b/tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit.stderr @@ -22,7 +22,8 @@ LL | fn iter(&self) -> impl 'a + Iterator<Item = I::Item<'a>> { | ^^ this bound is stronger than that defined on the trait | = note: add `#[allow(refining_impl_trait)]` if it is intended for this to be part of the public API of this crate - = note: `#[warn(refining_impl_trait)]` on by default + = note: we are soliciting feedback, see issue #121718 <https://github.com/rust-lang/rust/issues/121718> for more information + = note: `#[warn(refining_impl_trait_reachable)]` on by default help: replace the return type so that it matches the trait | LL | fn iter(&self) -> impl Iterator<Item = <Self as Iterable>::Item<'_>> + '_ { diff --git a/tests/ui/impl-trait/in-trait/foreign.rs b/tests/ui/impl-trait/in-trait/foreign.rs index e28bc9e00cb..ca759afc2e6 100644 --- a/tests/ui/impl-trait/in-trait/foreign.rs +++ b/tests/ui/impl-trait/in-trait/foreign.rs @@ -17,9 +17,29 @@ impl Foo for Local { } } -struct LocalIgnoreRefining; -impl Foo for LocalIgnoreRefining { - #[deny(refining_impl_trait)] +struct LocalOnlyRefiningA; +impl Foo for LocalOnlyRefiningA { + #[warn(refining_impl_trait)] + fn bar(self) -> Arc<String> { + //~^ WARN impl method signature does not match trait method signature + Arc::new(String::new()) + } +} + +struct LocalOnlyRefiningB; +impl Foo for LocalOnlyRefiningB { + #[warn(refining_impl_trait)] + #[allow(refining_impl_trait_reachable)] + fn bar(self) -> Arc<String> { + //~^ WARN impl method signature does not match trait method signature + Arc::new(String::new()) + } +} + +struct LocalOnlyRefiningC; +impl Foo for LocalOnlyRefiningC { + #[warn(refining_impl_trait)] + #[allow(refining_impl_trait_internal)] fn bar(self) -> Arc<String> { Arc::new(String::new()) } @@ -34,5 +54,7 @@ fn main() { let &() = Foreign.bar(); let x: Arc<String> = Local.bar(); - let x: Arc<String> = LocalIgnoreRefining.bar(); + let x: Arc<String> = LocalOnlyRefiningA.bar(); + let x: Arc<String> = LocalOnlyRefiningB.bar(); + let x: Arc<String> = LocalOnlyRefiningC.bar(); } diff --git a/tests/ui/impl-trait/in-trait/foreign.stderr b/tests/ui/impl-trait/in-trait/foreign.stderr new file mode 100644 index 00000000000..1a5a4f2432b --- /dev/null +++ b/tests/ui/impl-trait/in-trait/foreign.stderr @@ -0,0 +1,39 @@ +warning: impl trait in impl method signature does not match trait method signature + --> $DIR/foreign.rs:23:21 + | +LL | fn bar(self) -> Arc<String> { + | ^^^^^^^^^^^ + | + = note: add `#[allow(refining_impl_trait)]` if it is intended for this to be part of the public API of this crate + = note: we are soliciting feedback, see issue #121718 <https://github.com/rust-lang/rust/issues/121718> for more information +note: the lint level is defined here + --> $DIR/foreign.rs:22:12 + | +LL | #[warn(refining_impl_trait)] + | ^^^^^^^^^^^^^^^^^^^ + = note: `#[warn(refining_impl_trait_internal)]` implied by `#[warn(refining_impl_trait)]` +help: replace the return type so that it matches the trait + | +LL | fn bar(self) -> impl Deref<Target = impl Sized> { + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +warning: impl trait in impl method signature does not match trait method signature + --> $DIR/foreign.rs:33:21 + | +LL | fn bar(self) -> Arc<String> { + | ^^^^^^^^^^^ + | + = note: add `#[allow(refining_impl_trait)]` if it is intended for this to be part of the public API of this crate + = note: we are soliciting feedback, see issue #121718 <https://github.com/rust-lang/rust/issues/121718> for more information +note: the lint level is defined here + --> $DIR/foreign.rs:31:12 + | +LL | #[warn(refining_impl_trait)] + | ^^^^^^^^^^^^^^^^^^^ +help: replace the return type so that it matches the trait + | +LL | fn bar(self) -> impl Deref<Target = impl Sized> { + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +warning: 2 warnings emitted + diff --git a/tests/ui/impl-trait/in-trait/lifetime-in-associated-trait-bound.rs b/tests/ui/impl-trait/in-trait/lifetime-in-associated-trait-bound.rs index e0d4f461974..b29d71437b9 100644 --- a/tests/ui/impl-trait/in-trait/lifetime-in-associated-trait-bound.rs +++ b/tests/ui/impl-trait/in-trait/lifetime-in-associated-trait-bound.rs @@ -1,7 +1,5 @@ //@ check-pass -#![feature(associated_type_bounds)] - trait Trait { type Type; diff --git a/tests/ui/impl-trait/in-trait/refine.rs b/tests/ui/impl-trait/in-trait/refine.rs index 100e6da06a8..6813c3bbf27 100644 --- a/tests/ui/impl-trait/in-trait/refine.rs +++ b/tests/ui/impl-trait/in-trait/refine.rs @@ -25,6 +25,7 @@ impl Foo for C { struct Private; impl Foo for Private { fn bar() -> () {} + //~^ ERROR impl method signature does not match trait method signature } pub trait Arg<A> { @@ -32,6 +33,7 @@ pub trait Arg<A> { } impl Arg<Private> for A { fn bar() -> () {} + //~^ ERROR impl method signature does not match trait method signature } pub trait Late { @@ -52,6 +54,7 @@ mod unreachable { struct E; impl UnreachablePub for E { fn bar() {} + //~^ ERROR impl method signature does not match trait method signature } } diff --git a/tests/ui/impl-trait/in-trait/refine.stderr b/tests/ui/impl-trait/in-trait/refine.stderr index 96a9bc059c8..8d30b035921 100644 --- a/tests/ui/impl-trait/in-trait/refine.stderr +++ b/tests/ui/impl-trait/in-trait/refine.stderr @@ -8,11 +8,13 @@ LL | fn bar() -> impl Copy {} | ^^^^ this bound is stronger than that defined on the trait | = note: add `#[allow(refining_impl_trait)]` if it is intended for this to be part of the public API of this crate + = note: we are soliciting feedback, see issue #121718 <https://github.com/rust-lang/rust/issues/121718> for more information note: the lint level is defined here --> $DIR/refine.rs:1:9 | LL | #![deny(refining_impl_trait)] | ^^^^^^^^^^^^^^^^^^^ + = note: `#[deny(refining_impl_trait_reachable)]` implied by `#[deny(refining_impl_trait)]` help: replace the return type so that it matches the trait | LL | fn bar() -> impl Sized {} @@ -28,6 +30,7 @@ LL | fn bar() {} | ^^^^^^^^ | = note: add `#[allow(refining_impl_trait)]` if it is intended for this to be part of the public API of this crate + = note: we are soliciting feedback, see issue #121718 <https://github.com/rust-lang/rust/issues/121718> for more information help: replace the return type so that it matches the trait | LL | fn bar()-> impl Sized {} @@ -43,13 +46,47 @@ LL | fn bar() -> () {} | ^^ | = note: add `#[allow(refining_impl_trait)]` if it is intended for this to be part of the public API of this crate + = note: we are soliciting feedback, see issue #121718 <https://github.com/rust-lang/rust/issues/121718> for more information help: replace the return type so that it matches the trait | LL | fn bar() -> impl Sized {} | ~~~~~~~~~~ error: impl trait in impl method signature does not match trait method signature - --> $DIR/refine.rs:43:27 + --> $DIR/refine.rs:27:17 + | +LL | fn bar() -> impl Sized; + | ---------- return type from trait method defined here +... +LL | fn bar() -> () {} + | ^^ + | + = note: add `#[allow(refining_impl_trait)]` if it is intended for this to be part of the public API of this crate + = note: we are soliciting feedback, see issue #121718 <https://github.com/rust-lang/rust/issues/121718> for more information + = note: `#[deny(refining_impl_trait_internal)]` implied by `#[deny(refining_impl_trait)]` +help: replace the return type so that it matches the trait + | +LL | fn bar() -> impl Sized {} + | ~~~~~~~~~~ + +error: impl trait in impl method signature does not match trait method signature + --> $DIR/refine.rs:35:17 + | +LL | fn bar() -> impl Sized; + | ---------- return type from trait method defined here +... +LL | fn bar() -> () {} + | ^^ + | + = note: add `#[allow(refining_impl_trait)]` if it is intended for this to be part of the public API of this crate + = note: we are soliciting feedback, see issue #121718 <https://github.com/rust-lang/rust/issues/121718> for more information +help: replace the return type so that it matches the trait + | +LL | fn bar() -> impl Sized {} + | ~~~~~~~~~~ + +error: impl trait in impl method signature does not match trait method signature + --> $DIR/refine.rs:45:27 | LL | fn bar<'a>(&'a self) -> impl Sized + 'a; | --------------- return type from trait method defined here @@ -58,10 +95,27 @@ LL | fn bar(&self) -> impl Copy + '_ {} | ^^^^ this bound is stronger than that defined on the trait | = note: add `#[allow(refining_impl_trait)]` if it is intended for this to be part of the public API of this crate + = note: we are soliciting feedback, see issue #121718 <https://github.com/rust-lang/rust/issues/121718> for more information help: replace the return type so that it matches the trait | LL | fn bar(&self) -> impl Sized + '_ {} | ~~~~~~~~~~~~~~~ -error: aborting due to 4 previous errors +error: impl trait in impl method signature does not match trait method signature + --> $DIR/refine.rs:56:9 + | +LL | fn bar() -> impl Sized; + | ---------- return type from trait method defined here +... +LL | fn bar() {} + | ^^^^^^^^ + | + = note: add `#[allow(refining_impl_trait)]` if it is intended for this to be part of the public API of this crate + = note: we are soliciting feedback, see issue #121718 <https://github.com/rust-lang/rust/issues/121718> for more information +help: replace the return type so that it matches the trait + | +LL | fn bar()-> impl Sized {} + | +++++++++++++ + +error: aborting due to 7 previous errors diff --git a/tests/ui/impl-trait/in-trait/span-bug-issue-121457.rs b/tests/ui/impl-trait/in-trait/span-bug-issue-121457.rs index 10167ee9352..ab21dae7dc5 100644 --- a/tests/ui/impl-trait/in-trait/span-bug-issue-121457.rs +++ b/tests/ui/impl-trait/in-trait/span-bug-issue-121457.rs @@ -12,6 +12,7 @@ impl<'a, I: 'a + Iterable> Iterable for &'a I { fn iter(&self) -> impl for<'missing> Iterator<Item = Self::Item<'missing>> {} //~^ ERROR binding for associated type `Item` references lifetime `'missing` + //~| ERROR binding for associated type `Item` references lifetime `'missing` //~| ERROR `()` is not an iterator } diff --git a/tests/ui/impl-trait/in-trait/span-bug-issue-121457.stderr b/tests/ui/impl-trait/in-trait/span-bug-issue-121457.stderr index 96c3644f893..d8a2eef94a1 100644 --- a/tests/ui/impl-trait/in-trait/span-bug-issue-121457.stderr +++ b/tests/ui/impl-trait/in-trait/span-bug-issue-121457.stderr @@ -4,6 +4,14 @@ error[E0582]: binding for associated type `Item` references lifetime `'missing`, LL | fn iter(&self) -> impl for<'missing> Iterator<Item = Self::Item<'missing>> {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +error[E0582]: binding for associated type `Item` references lifetime `'missing`, which does not appear in the trait input types + --> $DIR/span-bug-issue-121457.rs:13:51 + | +LL | fn iter(&self) -> impl for<'missing> Iterator<Item = Self::Item<'missing>> {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + error[E0195]: lifetime parameters or bounds on type `Item` do not match the trait declaration --> $DIR/span-bug-issue-121457.rs:10:14 | @@ -24,7 +32,7 @@ LL | fn iter(&self) -> impl for<'missing> Iterator<Item = Self::Item<'missin | = help: the trait `Iterator` is not implemented for `()` -error: aborting due to 3 previous errors +error: aborting due to 4 previous errors Some errors have detailed explanations: E0195, E0277, E0582. For more information about an error, try `rustc --explain E0195`. diff --git a/tests/ui/impl-trait/issue-86465.rs b/tests/ui/impl-trait/issue-86465.rs deleted file mode 100644 index a79bb6474d8..00000000000 --- a/tests/ui/impl-trait/issue-86465.rs +++ /dev/null @@ -1,10 +0,0 @@ -#![feature(type_alias_impl_trait)] - -type X<'a, 'b> = impl std::fmt::Debug; - -fn f<'t, 'u>(a: &'t u32, b: &'u u32) -> (X<'t, 'u>, X<'u, 't>) { - (a, a) - //~^ ERROR concrete type differs from previous defining opaque type use -} - -fn main() {} diff --git a/tests/ui/impl-trait/issue-86465.stderr b/tests/ui/impl-trait/issue-86465.stderr deleted file mode 100644 index e330d178d4e..00000000000 --- a/tests/ui/impl-trait/issue-86465.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: concrete type differs from previous defining opaque type use - --> $DIR/issue-86465.rs:6:5 - | -LL | (a, a) - | ^^^^^^ - | | - | expected `&'a u32`, got `&'b u32` - | this expression supplies two conflicting concrete types for the same opaque type - -error: aborting due to 1 previous error - diff --git a/tests/ui/impl-trait/issues/issue-92305.rs b/tests/ui/impl-trait/issues/issue-92305.rs index 5ecb6984cfe..be98ce807ec 100644 --- a/tests/ui/impl-trait/issues/issue-92305.rs +++ b/tests/ui/impl-trait/issues/issue-92305.rs @@ -4,6 +4,7 @@ use std::iter; fn f<T>(data: &[T]) -> impl Iterator<Item = Vec> { //~^ ERROR: missing generics for struct `Vec` [E0107] + //~| ERROR: missing generics for struct `Vec` [E0107] iter::empty() } diff --git a/tests/ui/impl-trait/issues/issue-92305.stderr b/tests/ui/impl-trait/issues/issue-92305.stderr index 88fb1fb2707..4591d2c53f7 100644 --- a/tests/ui/impl-trait/issues/issue-92305.stderr +++ b/tests/ui/impl-trait/issues/issue-92305.stderr @@ -9,6 +9,18 @@ help: add missing generic argument LL | fn f<T>(data: &[T]) -> impl Iterator<Item = Vec<T>> { | +++ -error: aborting due to 1 previous error +error[E0107]: missing generics for struct `Vec` + --> $DIR/issue-92305.rs:5:45 + | +LL | fn f<T>(data: &[T]) -> impl Iterator<Item = Vec> { + | ^^^ expected at least 1 generic argument + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` +help: add missing generic argument + | +LL | fn f<T>(data: &[T]) -> impl Iterator<Item = Vec<T>> { + | +++ + +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0107`. diff --git a/tests/ui/impl-trait/nested-rpit-hrtb.rs b/tests/ui/impl-trait/nested-rpit-hrtb.rs index c10bfbfe4dc..a696e1710f0 100644 --- a/tests/ui/impl-trait/nested-rpit-hrtb.rs +++ b/tests/ui/impl-trait/nested-rpit-hrtb.rs @@ -35,7 +35,6 @@ fn one_hrtb_outlives_uses() -> impl for<'a> Bar<'a, Assoc = impl Sized + 'a> {} fn one_hrtb_trait_param_uses() -> impl for<'a> Bar<'a, Assoc = impl Qux<'a>> {} //~^ ERROR `impl Trait` cannot capture higher-ranked lifetime from outer `impl Trait` -//~| ERROR: the trait bound `for<'a> &'a (): Qux<'_>` is not satisfied // This should resolve. fn one_hrtb_mention_fn_trait_param<'b>() -> impl for<'a> Foo<'a, Assoc = impl Qux<'b>> {} @@ -45,7 +44,7 @@ fn one_hrtb_mention_fn_outlives<'b>() -> impl for<'a> Foo<'a, Assoc = impl Sized // This should resolve. fn one_hrtb_mention_fn_trait_param_uses<'b>() -> impl for<'a> Bar<'a, Assoc = impl Qux<'b>> {} -//~^ ERROR: the trait bound `for<'a> &'a (): Qux<'b>` is not satisfied +//~^ ERROR type annotations needed: cannot satisfy `for<'a> &'a (): Qux<'b>` // This should resolve. fn one_hrtb_mention_fn_outlives_uses<'b>() -> impl for<'a> Bar<'a, Assoc = impl Sized + 'b> {} diff --git a/tests/ui/impl-trait/nested-rpit-hrtb.stderr b/tests/ui/impl-trait/nested-rpit-hrtb.stderr index 2779694a517..64f801ea685 100644 --- a/tests/ui/impl-trait/nested-rpit-hrtb.stderr +++ b/tests/ui/impl-trait/nested-rpit-hrtb.stderr @@ -1,5 +1,5 @@ error[E0261]: use of undeclared lifetime name `'b` - --> $DIR/nested-rpit-hrtb.rs:58:77 + --> $DIR/nested-rpit-hrtb.rs:57:77 | LL | fn two_htrb_outlives() -> impl for<'a> Foo<'a, Assoc = impl for<'b> Sized + 'b> {} | ^^ undeclared lifetime @@ -15,7 +15,7 @@ LL | fn two_htrb_outlives<'b>() -> impl for<'a> Foo<'a, Assoc = impl for<'b> Siz | ++++ error[E0261]: use of undeclared lifetime name `'b` - --> $DIR/nested-rpit-hrtb.rs:66:82 + --> $DIR/nested-rpit-hrtb.rs:65:82 | LL | fn two_htrb_outlives_uses() -> impl for<'a> Bar<'a, Assoc = impl for<'b> Sized + 'b> {} | ^^ undeclared lifetime @@ -86,26 +86,18 @@ note: lifetime declared here LL | fn one_hrtb_trait_param_uses() -> impl for<'a> Bar<'a, Assoc = impl Qux<'a>> {} | ^^ -error[E0277]: the trait bound `for<'a> &'a (): Qux<'_>` is not satisfied - --> $DIR/nested-rpit-hrtb.rs:36:64 - | -LL | fn one_hrtb_trait_param_uses() -> impl for<'a> Bar<'a, Assoc = impl Qux<'a>> {} - | ^^^^^^^^^^^^ the trait `for<'a> Qux<'_>` is not implemented for `&'a ()` - | - = help: the trait `Qux<'_>` is implemented for `()` - = help: for that trait implementation, expected `()`, found `&'a ()` - -error[E0277]: the trait bound `for<'a> &'a (): Qux<'b>` is not satisfied - --> $DIR/nested-rpit-hrtb.rs:47:79 +error[E0283]: type annotations needed: cannot satisfy `for<'a> &'a (): Qux<'b>` + --> $DIR/nested-rpit-hrtb.rs:46:79 | LL | fn one_hrtb_mention_fn_trait_param_uses<'b>() -> impl for<'a> Bar<'a, Assoc = impl Qux<'b>> {} - | ^^^^^^^^^^^^ the trait `for<'a> Qux<'b>` is not implemented for `&'a ()` + | ^^^^^^^^^^^^ | + = note: cannot satisfy `for<'a> &'a (): Qux<'b>` = help: the trait `Qux<'_>` is implemented for `()` = help: for that trait implementation, expected `()`, found `&'a ()` error: implementation of `Bar` is not general enough - --> $DIR/nested-rpit-hrtb.rs:51:93 + --> $DIR/nested-rpit-hrtb.rs:50:93 | LL | fn one_hrtb_mention_fn_outlives_uses<'b>() -> impl for<'a> Bar<'a, Assoc = impl Sized + 'b> {} | ^^ implementation of `Bar` is not general enough @@ -114,7 +106,7 @@ LL | fn one_hrtb_mention_fn_outlives_uses<'b>() -> impl for<'a> Bar<'a, Assoc = = note: ...but it actually implements `Bar<'0>`, for some specific lifetime `'0` error[E0277]: the trait bound `for<'a, 'b> &'a (): Qux<'b>` is not satisfied - --> $DIR/nested-rpit-hrtb.rs:62:64 + --> $DIR/nested-rpit-hrtb.rs:61:64 | LL | fn two_htrb_trait_param_uses() -> impl for<'a> Bar<'a, Assoc = impl for<'b> Qux<'b>> {} | ^^^^^^^^^^^^^^^^^^^^ the trait `for<'a, 'b> Qux<'b>` is not implemented for `&'a ()` @@ -123,7 +115,7 @@ LL | fn two_htrb_trait_param_uses() -> impl for<'a> Bar<'a, Assoc = impl for<'b> = help: for that trait implementation, expected `()`, found `&'a ()` error: implementation of `Bar` is not general enough - --> $DIR/nested-rpit-hrtb.rs:66:86 + --> $DIR/nested-rpit-hrtb.rs:65:86 | LL | fn two_htrb_outlives_uses() -> impl for<'a> Bar<'a, Assoc = impl for<'b> Sized + 'b> {} | ^^ implementation of `Bar` is not general enough @@ -131,7 +123,7 @@ LL | fn two_htrb_outlives_uses() -> impl for<'a> Bar<'a, Assoc = impl for<'b> Si = note: `()` must implement `Bar<'a>` = note: ...but it actually implements `Bar<'0>`, for some specific lifetime `'0` -error: aborting due to 12 previous errors +error: aborting due to 11 previous errors -Some errors have detailed explanations: E0261, E0277, E0657. +Some errors have detailed explanations: E0261, E0277, E0283, E0657. For more information about an error, try `rustc --explain E0261`. diff --git a/tests/ui/impl-trait/normalize-tait-in-const.stderr b/tests/ui/impl-trait/normalize-tait-in-const.stderr index f77b4bd517f..7ae8306d74d 100644 --- a/tests/ui/impl-trait/normalize-tait-in-const.stderr +++ b/tests/ui/impl-trait/normalize-tait-in-const.stderr @@ -11,11 +11,14 @@ LL | fun(filter_positive()); | ^^^^^^^^^^^^^^^^^^^^^^ | = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(effects)]` to the crate attributes to enable help: consider further restricting this bound | LL | const fn with_positive<F: ~const for<'a> Fn(&'a Alias<'a>) + ~const Destruct + ~const std::ops::Fn<(&Alias<'_>,)>>(fun: F) { | ++++++++++++++++++++++++++++++++++++ +help: add `#![feature(effects)]` to the crate attributes to enable + | +LL + #![feature(effects)] + | error[E0493]: destructor of `F` cannot be evaluated at compile-time --> $DIR/normalize-tait-in-const.rs:25:79 diff --git a/tests/ui/impl-trait/opaque-used-in-extraneous-argument.rs b/tests/ui/impl-trait/opaque-used-in-extraneous-argument.rs index 529913479ef..8d4855c101c 100644 --- a/tests/ui/impl-trait/opaque-used-in-extraneous-argument.rs +++ b/tests/ui/impl-trait/opaque-used-in-extraneous-argument.rs @@ -7,6 +7,7 @@ fn frob() -> impl Fn<P, Output = T> + '_ {} //~| ERROR cannot find type `P` //~| ERROR cannot find type `T` //~| ERROR `Fn`-family traits' type parameters is subject to change +//~| ERROR `Fn`-family traits' type parameters is subject to change fn open_parent<'path>() { todo!() diff --git a/tests/ui/impl-trait/opaque-used-in-extraneous-argument.stderr b/tests/ui/impl-trait/opaque-used-in-extraneous-argument.stderr index b54b9f908b2..6d417488533 100644 --- a/tests/ui/impl-trait/opaque-used-in-extraneous-argument.stderr +++ b/tests/ui/impl-trait/opaque-used-in-extraneous-argument.stderr @@ -42,8 +42,19 @@ LL | fn frob() -> impl Fn<P, Output = T> + '_ {} = help: add `#![feature(unboxed_closures)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date +error[E0658]: the precise format of `Fn`-family traits' type parameters is subject to change + --> $DIR/opaque-used-in-extraneous-argument.rs:5:19 + | +LL | fn frob() -> impl Fn<P, Output = T> + '_ {} + | ^^^^^^^^^^^^^^^^^ help: use parenthetical notation instead: `Fn(P) -> T` + | + = note: see issue #29625 <https://github.com/rust-lang/rust/issues/29625> for more information + = help: add `#![feature(unboxed_closures)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + error[E0061]: this function takes 0 arguments but 1 argument was supplied - --> $DIR/opaque-used-in-extraneous-argument.rs:16:20 + --> $DIR/opaque-used-in-extraneous-argument.rs:17:20 | LL | let old_path = frob("hello"); | ^^^^ ------- @@ -58,7 +69,7 @@ LL | fn frob() -> impl Fn<P, Output = T> + '_ {} | ^^^^ error[E0061]: this function takes 0 arguments but 1 argument was supplied - --> $DIR/opaque-used-in-extraneous-argument.rs:19:5 + --> $DIR/opaque-used-in-extraneous-argument.rs:20:5 | LL | open_parent(&old_path) | ^^^^^^^^^^^ --------- @@ -67,12 +78,12 @@ LL | open_parent(&old_path) | help: remove the extra argument | note: function defined here - --> $DIR/opaque-used-in-extraneous-argument.rs:11:4 + --> $DIR/opaque-used-in-extraneous-argument.rs:12:4 | LL | fn open_parent<'path>() { | ^^^^^^^^^^^ -error: aborting due to 6 previous errors +error: aborting due to 7 previous errors Some errors have detailed explanations: E0061, E0106, E0412, E0658. For more information about an error, try `rustc --explain E0061`. diff --git a/tests/ui/impl-trait/stranded-opaque.rs b/tests/ui/impl-trait/stranded-opaque.rs index c7ab390e1fd..6ce5cbd3b55 100644 --- a/tests/ui/impl-trait/stranded-opaque.rs +++ b/tests/ui/impl-trait/stranded-opaque.rs @@ -7,6 +7,7 @@ impl Trait for i32 {} // ICE in this case. fn produce<T>() -> impl Trait<Assoc = impl Trait> { //~^ ERROR associated type `Assoc` not found for `Trait` + //~| ERROR associated type `Assoc` not found for `Trait` 16 } diff --git a/tests/ui/impl-trait/stranded-opaque.stderr b/tests/ui/impl-trait/stranded-opaque.stderr index 75f5480bc8b..5bea3e2af6b 100644 --- a/tests/ui/impl-trait/stranded-opaque.stderr +++ b/tests/ui/impl-trait/stranded-opaque.stderr @@ -4,6 +4,14 @@ error[E0220]: associated type `Assoc` not found for `Trait` LL | fn produce<T>() -> impl Trait<Assoc = impl Trait> { | ^^^^^ associated type `Assoc` not found -error: aborting due to 1 previous error +error[E0220]: associated type `Assoc` not found for `Trait` + --> $DIR/stranded-opaque.rs:8:31 + | +LL | fn produce<T>() -> impl Trait<Assoc = impl Trait> { + | ^^^^^ associated type `Assoc` not found + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0220`. diff --git a/tests/ui/inference/ice-cannot-relate-region-109178.rs b/tests/ui/inference/ice-cannot-relate-region-109178.rs new file mode 100644 index 00000000000..3282f95a992 --- /dev/null +++ b/tests/ui/inference/ice-cannot-relate-region-109178.rs @@ -0,0 +1,14 @@ +// test for ice #109178 cannot relate region: LUB(ReErased, ReError) + +#![allow(incomplete_features)] +#![crate_type = "lib"] +#![feature(adt_const_params, generic_const_exprs)] + +struct Changes<const CHANGES: &[&'static str]> +//~^ ERROR `&` without an explicit lifetime name cannot be used here +where + [(); CHANGES.len()]:, {} + +impl<const CHANGES: &[&str]> Changes<CHANGES> where [(); CHANGES.len()]: {} +//~^ ERROR `&` without an explicit lifetime name cannot be used here +//~^^ ERROR `&` without an explicit lifetime name cannot be used here diff --git a/tests/ui/inference/ice-cannot-relate-region-109178.stderr b/tests/ui/inference/ice-cannot-relate-region-109178.stderr new file mode 100644 index 00000000000..0ac924452c0 --- /dev/null +++ b/tests/ui/inference/ice-cannot-relate-region-109178.stderr @@ -0,0 +1,21 @@ +error[E0637]: `&` without an explicit lifetime name cannot be used here + --> $DIR/ice-cannot-relate-region-109178.rs:7:31 + | +LL | struct Changes<const CHANGES: &[&'static str]> + | ^ explicit lifetime name needed here + +error[E0637]: `&` without an explicit lifetime name cannot be used here + --> $DIR/ice-cannot-relate-region-109178.rs:12:21 + | +LL | impl<const CHANGES: &[&str]> Changes<CHANGES> where [(); CHANGES.len()]: {} + | ^ explicit lifetime name needed here + +error[E0637]: `&` without an explicit lifetime name cannot be used here + --> $DIR/ice-cannot-relate-region-109178.rs:12:23 + | +LL | impl<const CHANGES: &[&str]> Changes<CHANGES> where [(); CHANGES.len()]: {} + | ^ explicit lifetime name needed here + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0637`. diff --git a/tests/ui/inference/ice-ifer-var-leaked-out-of-rollback-122098.rs b/tests/ui/inference/ice-ifer-var-leaked-out-of-rollback-122098.rs new file mode 100644 index 00000000000..3c2aa176c0f --- /dev/null +++ b/tests/ui/inference/ice-ifer-var-leaked-out-of-rollback-122098.rs @@ -0,0 +1,25 @@ +// test for #122098 ICE snapshot_vec.rs: index out of bounds: the len is 4 but the index is 4 + +trait LendingIterator { + type Item<'q>: 'a; + //~^ ERROR use of undeclared lifetime name `'a` + + fn for_each(mut self, mut f: Box<dyn FnMut(Self::Item<'_>) + 'static>) {} + //~^ ERROR the size for values of type `Self` cannot be known at compilation time +} + +struct Query<'q> {} +//~^ ERROR lifetime parameter `'q` is never used + +impl<'static> Query<'q> { +//~^ ERROR invalid lifetime parameter name: `'static` +//~^^ ERROR use of undeclared lifetime name `'q` + pub fn new() -> Self {} +} + +fn data() { + LendingIterator::for_each(Query::new(&data), Box::new); + //~^ ERROR this function takes 0 arguments but 1 argument was supplied +} + +pub fn main() {} diff --git a/tests/ui/inference/ice-ifer-var-leaked-out-of-rollback-122098.stderr b/tests/ui/inference/ice-ifer-var-leaked-out-of-rollback-122098.stderr new file mode 100644 index 00000000000..e2ddf474c4a --- /dev/null +++ b/tests/ui/inference/ice-ifer-var-leaked-out-of-rollback-122098.stderr @@ -0,0 +1,72 @@ +error[E0261]: use of undeclared lifetime name `'a` + --> $DIR/ice-ifer-var-leaked-out-of-rollback-122098.rs:4:20 + | +LL | type Item<'q>: 'a; + | ^^ undeclared lifetime + | +help: consider introducing lifetime `'a` here + | +LL | type Item<'a, 'q>: 'a; + | +++ +help: consider introducing lifetime `'a` here + | +LL | trait LendingIterator<'a> { + | ++++ + +error[E0262]: invalid lifetime parameter name: `'static` + --> $DIR/ice-ifer-var-leaked-out-of-rollback-122098.rs:14:6 + | +LL | impl<'static> Query<'q> { + | ^^^^^^^ 'static is a reserved lifetime name + +error[E0261]: use of undeclared lifetime name `'q` + --> $DIR/ice-ifer-var-leaked-out-of-rollback-122098.rs:14:21 + | +LL | impl<'static> Query<'q> { + | - ^^ undeclared lifetime + | | + | help: consider introducing lifetime `'q` here: `'q,` + +error[E0392]: lifetime parameter `'q` is never used + --> $DIR/ice-ifer-var-leaked-out-of-rollback-122098.rs:11:14 + | +LL | struct Query<'q> {} + | ^^ unused lifetime parameter + | + = help: consider removing `'q`, referring to it in a field, or using a marker such as `PhantomData` + +error[E0277]: the size for values of type `Self` cannot be known at compilation time + --> $DIR/ice-ifer-var-leaked-out-of-rollback-122098.rs:7:17 + | +LL | fn for_each(mut self, mut f: Box<dyn FnMut(Self::Item<'_>) + 'static>) {} + | ^^^^^^^^ doesn't have a size known at compile-time + | + = help: unsized fn params are gated as an unstable feature +help: consider further restricting `Self` + | +LL | fn for_each(mut self, mut f: Box<dyn FnMut(Self::Item<'_>) + 'static>) where Self: Sized {} + | +++++++++++++++++ +help: function arguments must have a statically known size, borrowed types always have a known size + | +LL | fn for_each(mut &self, mut f: Box<dyn FnMut(Self::Item<'_>) + 'static>) {} + | + + +error[E0061]: this function takes 0 arguments but 1 argument was supplied + --> $DIR/ice-ifer-var-leaked-out-of-rollback-122098.rs:21:31 + | +LL | LendingIterator::for_each(Query::new(&data), Box::new); + | ^^^^^^^^^^ ----- + | | + | unexpected argument of type `&fn() {data}` + | help: remove the extra argument + | +note: associated function defined here + --> $DIR/ice-ifer-var-leaked-out-of-rollback-122098.rs:17:12 + | +LL | pub fn new() -> Self {} + | ^^^ + +error: aborting due to 6 previous errors + +Some errors have detailed explanations: E0061, E0261, E0262, E0277, E0392. +For more information about an error, try `rustc --explain E0061`. diff --git a/tests/ui/inference/inference_unstable.stderr b/tests/ui/inference/inference_unstable.stderr index c48aaf9f495..51f086177db 100644 --- a/tests/ui/inference/inference_unstable.stderr +++ b/tests/ui/inference/inference_unstable.stderr @@ -7,8 +7,11 @@ LL | assert_eq!('x'.ipu_flatten(), 1); = warning: once this associated item is added to the standard library, the ambiguity may cause an error or change in behavior! = note: for more information, see issue #48919 <https://github.com/rust-lang/rust/issues/48919> = help: call with fully qualified syntax `inference_unstable_itertools::IpuItertools::ipu_flatten(...)` to keep using the current method - = help: add `#![feature(ipu_flatten)]` to the crate attributes to enable `inference_unstable_iterator::IpuIterator::ipu_flatten` = note: `#[warn(unstable_name_collisions)]` on by default +help: add `#![feature(ipu_flatten)]` to the crate attributes to enable `inference_unstable_iterator::IpuIterator::ipu_flatten` + | +LL + #![feature(ipu_flatten)] + | warning: a method with this name may be added to the standard library in the future --> $DIR/inference_unstable.rs:19:20 @@ -19,7 +22,10 @@ LL | assert_eq!('x'.ipu_by_value_vs_by_ref(), 1); = warning: once this associated item is added to the standard library, the ambiguity may cause an error or change in behavior! = note: for more information, see issue #48919 <https://github.com/rust-lang/rust/issues/48919> = help: call with fully qualified syntax `inference_unstable_itertools::IpuItertools::ipu_by_value_vs_by_ref(...)` to keep using the current method - = help: add `#![feature(ipu_flatten)]` to the crate attributes to enable `inference_unstable_iterator::IpuIterator::ipu_by_value_vs_by_ref` +help: add `#![feature(ipu_flatten)]` to the crate attributes to enable `inference_unstable_iterator::IpuIterator::ipu_by_value_vs_by_ref` + | +LL + #![feature(ipu_flatten)] + | warning: a method with this name may be added to the standard library in the future --> $DIR/inference_unstable.rs:22:20 @@ -30,7 +36,10 @@ LL | assert_eq!('x'.ipu_by_ref_vs_by_ref_mut(), 1); = warning: once this associated item is added to the standard library, the ambiguity may cause an error or change in behavior! = note: for more information, see issue #48919 <https://github.com/rust-lang/rust/issues/48919> = help: call with fully qualified syntax `inference_unstable_itertools::IpuItertools::ipu_by_ref_vs_by_ref_mut(...)` to keep using the current method - = help: add `#![feature(ipu_flatten)]` to the crate attributes to enable `inference_unstable_iterator::IpuIterator::ipu_by_ref_vs_by_ref_mut` +help: add `#![feature(ipu_flatten)]` to the crate attributes to enable `inference_unstable_iterator::IpuIterator::ipu_by_ref_vs_by_ref_mut` + | +LL + #![feature(ipu_flatten)] + | warning: a method with this name may be added to the standard library in the future --> $DIR/inference_unstable.rs:25:40 @@ -41,17 +50,27 @@ LL | assert_eq!((&mut 'x' as *mut char).ipu_by_mut_ptr_vs_by_const_ptr(), 1) = warning: once this associated item is added to the standard library, the ambiguity may cause an error or change in behavior! = note: for more information, see issue #48919 <https://github.com/rust-lang/rust/issues/48919> = help: call with fully qualified syntax `inference_unstable_itertools::IpuItertools::ipu_by_mut_ptr_vs_by_const_ptr(...)` to keep using the current method - = help: add `#![feature(ipu_flatten)]` to the crate attributes to enable `inference_unstable_iterator::IpuIterator::ipu_by_mut_ptr_vs_by_const_ptr` +help: add `#![feature(ipu_flatten)]` to the crate attributes to enable `inference_unstable_iterator::IpuIterator::ipu_by_mut_ptr_vs_by_const_ptr` + | +LL + #![feature(ipu_flatten)] + | warning: an associated constant with this name may be added to the standard library in the future --> $DIR/inference_unstable.rs:28:16 | LL | assert_eq!(char::C, 1); - | ^^^^^^^ help: use the fully qualified path to the associated const: `<char as IpuItertools>::C` + | ^^^^^^^ | = warning: once this associated item is added to the standard library, the ambiguity may cause an error or change in behavior! = note: for more information, see issue #48919 <https://github.com/rust-lang/rust/issues/48919> - = help: add `#![feature(assoc_const_ipu_iter)]` to the crate attributes to enable `inference_unstable_iterator::IpuIterator::C` +help: use the fully qualified path to the associated const + | +LL | assert_eq!(<char as IpuItertools>::C, 1); + | ~~~~~~~~~~~~~~~~~~~~~~~~~ +help: add `#![feature(assoc_const_ipu_iter)]` to the crate attributes to enable `inference_unstable_iterator::IpuIterator::C` + | +LL + #![feature(assoc_const_ipu_iter)] + | warning: 5 warnings emitted diff --git a/tests/ui/inference/issue-107090.rs b/tests/ui/inference/issue-107090.rs index d1c86fb03d7..799c3641833 100644 --- a/tests/ui/inference/issue-107090.rs +++ b/tests/ui/inference/issue-107090.rs @@ -19,7 +19,7 @@ impl<'long: 'short, 'short, T> Convert<'long, 'b> for Foo<'short, 'out, T> { fn badboi<'in_, 'out, T>(x: Foo<'in_, 'out, T>, sadness: &'in_ Foo<'short, 'out, T>) -> &'out T { //~^ ERROR use of undeclared lifetime name - sadness.cast() //~ ERROR: mismatched types + sadness.cast() } fn main() {} diff --git a/tests/ui/inference/issue-107090.stderr b/tests/ui/inference/issue-107090.stderr index 55825f7765b..e509e262fb1 100644 --- a/tests/ui/inference/issue-107090.stderr +++ b/tests/ui/inference/issue-107090.stderr @@ -66,19 +66,6 @@ LL | fn badboi<'in_, 'out, T>(x: Foo<'in_, 'out, T>, sadness: &'in_ Foo<'short, | | | help: consider introducing lifetime `'short` here: `'short,` -error[E0308]: mismatched types - --> $DIR/issue-107090.rs:22:5 - | -LL | fn badboi<'in_, 'out, T>(x: Foo<'in_, 'out, T>, sadness: &'in_ Foo<'short, 'out, T>) -> &'out T { - | - expected this type parameter ------- expected `&'out T` because of return type -LL | -LL | sadness.cast() - | ^^^^^^^^^^^^^^ expected `&T`, found `&Foo<'_, '_, T>` - | - = note: expected reference `&'out T` - found reference `&Foo<'_, '_, T>` - -error: aborting due to 7 previous errors +error: aborting due to 6 previous errors -Some errors have detailed explanations: E0261, E0308. -For more information about an error, try `rustc --explain E0261`. +For more information about this error, try `rustc --explain E0261`. diff --git a/tests/ui/issues/issue-10412.rs b/tests/ui/issues/issue-10412.rs index 0de170161b5..68ce0c2ea3c 100644 --- a/tests/ui/issues/issue-10412.rs +++ b/tests/ui/issues/issue-10412.rs @@ -8,7 +8,6 @@ impl<'self> Serializable<str> for &'self str { //~^ ERROR lifetimes cannot use keyword names //~| ERROR lifetimes cannot use keyword names //~| ERROR implicit elided lifetime not allowed here - //~| ERROR the size for values of type `str` cannot be known at compilation time [E0277] fn serialize(val: &'self str) -> Vec<u8> { //~^ ERROR lifetimes cannot use keyword names vec![1] diff --git a/tests/ui/issues/issue-10412.stderr b/tests/ui/issues/issue-10412.stderr index 02a26034f9a..c74ba1306cc 100644 --- a/tests/ui/issues/issue-10412.stderr +++ b/tests/ui/issues/issue-10412.stderr @@ -29,13 +29,13 @@ LL | impl<'self> Serializable<str> for &'self str { | ^^^^^ error: lifetimes cannot use keyword names - --> $DIR/issue-10412.rs:12:24 + --> $DIR/issue-10412.rs:11:24 | LL | fn serialize(val: &'self str) -> Vec<u8> { | ^^^^^ error: lifetimes cannot use keyword names - --> $DIR/issue-10412.rs:16:37 + --> $DIR/issue-10412.rs:15:37 | LL | fn deserialize(repr: &[u8]) -> &'self str { | ^^^^^ @@ -51,24 +51,6 @@ help: indicate the anonymous lifetime LL | impl<'self> Serializable<'_, str> for &'self str { | +++ -error[E0277]: the size for values of type `str` cannot be known at compilation time - --> $DIR/issue-10412.rs:7:13 - | -LL | impl<'self> Serializable<str> for &'self str { - | ^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `str` -note: required by an implicit `Sized` bound in `Serializable` - --> $DIR/issue-10412.rs:1:27 - | -LL | trait Serializable<'self, T> { - | ^ required by the implicit `Sized` requirement on this type parameter in `Serializable` -help: consider relaxing the implicit `Sized` restriction - | -LL | trait Serializable<'self, T: ?Sized> { - | ++++++++ - -error: aborting due to 9 previous errors +error: aborting due to 8 previous errors -Some errors have detailed explanations: E0277, E0726. -For more information about an error, try `rustc --explain E0277`. +For more information about this error, try `rustc --explain E0726`. diff --git a/tests/ui/issues/issue-17361.rs b/tests/ui/issues/issue-17361.rs index 8e85f0791d6..1b1eeb5a252 100644 --- a/tests/ui/issues/issue-17361.rs +++ b/tests/ui/issues/issue-17361.rs @@ -1,5 +1,5 @@ //@ run-pass -// Test that astconv doesn't forget about mutability of &mut str +// Test that HIR ty lowering doesn't forget about mutability of `&mut str`. //@ pretty-expanded FIXME #23616 diff --git a/tests/ui/issues/issue-25901.stderr b/tests/ui/issues/issue-25901.stderr index 673f29fff18..5c19abffa02 100644 --- a/tests/ui/issues/issue-25901.stderr +++ b/tests/ui/issues/issue-25901.stderr @@ -16,8 +16,11 @@ note: impl defined here, but it is not `const` LL | impl Deref for A { | ^^^^^^^^^^^^^^^^ = note: calls in statics are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable = note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell +help: add `#![feature(const_trait_impl)]` to the crate attributes to enable + | +LL + #![feature(const_trait_impl)] + | error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-27942.stderr b/tests/ui/issues/issue-27942.stderr index 7ea9345a668..8ea46bae26d 100644 --- a/tests/ui/issues/issue-27942.stderr +++ b/tests/ui/issues/issue-27942.stderr @@ -6,16 +6,16 @@ LL | fn select(&self) -> BufferViewHandle<R>; | = note: expected trait `Resources<'_>` found trait `Resources<'a>` -note: the anonymous lifetime defined here... - --> $DIR/issue-27942.rs:5:15 - | -LL | fn select(&self) -> BufferViewHandle<R>; - | ^^^^^ -note: ...does not necessarily outlive the lifetime `'a` as defined here +note: the lifetime `'a` as defined here... --> $DIR/issue-27942.rs:3:18 | LL | pub trait Buffer<'a, R: Resources<'a>> { | ^^ +note: ...does not necessarily outlive the anonymous lifetime defined here + --> $DIR/issue-27942.rs:5:15 + | +LL | fn select(&self) -> BufferViewHandle<R>; + | ^^^^^ error[E0308]: mismatched types --> $DIR/issue-27942.rs:5:25 @@ -25,16 +25,16 @@ LL | fn select(&self) -> BufferViewHandle<R>; | = note: expected trait `Resources<'_>` found trait `Resources<'a>` -note: the lifetime `'a` as defined here... - --> $DIR/issue-27942.rs:3:18 - | -LL | pub trait Buffer<'a, R: Resources<'a>> { - | ^^ -note: ...does not necessarily outlive the anonymous lifetime defined here +note: the anonymous lifetime defined here... --> $DIR/issue-27942.rs:5:15 | LL | fn select(&self) -> BufferViewHandle<R>; | ^^^^^ +note: ...does not necessarily outlive the lifetime `'a` as defined here + --> $DIR/issue-27942.rs:3:18 + | +LL | pub trait Buffer<'a, R: Resources<'a>> { + | ^^ error: aborting due to 2 previous errors diff --git a/tests/ui/issues/issue-87199.rs b/tests/ui/issues/issue-87199.rs index 081c45d6151..34879c5a7ca 100644 --- a/tests/ui/issues/issue-87199.rs +++ b/tests/ui/issues/issue-87199.rs @@ -11,6 +11,7 @@ fn ref_arg<T: ?Send>(_: &T) {} //~^ warning: relaxing a default bound only does something for `?Sized` fn ret() -> impl Iterator<Item = ()> + ?Send { std::iter::empty() } //~^ warning: relaxing a default bound only does something for `?Sized` +//~| warning: relaxing a default bound only does something for `?Sized` // Check that there's no `?Sized` relaxation! fn main() { diff --git a/tests/ui/issues/issue-87199.stderr b/tests/ui/issues/issue-87199.stderr index 34433eef5c7..a0ed2946fb4 100644 --- a/tests/ui/issues/issue-87199.stderr +++ b/tests/ui/issues/issue-87199.stderr @@ -16,8 +16,16 @@ warning: relaxing a default bound only does something for `?Sized`; all other tr LL | fn ret() -> impl Iterator<Item = ()> + ?Send { std::iter::empty() } | ^^^^^ +warning: relaxing a default bound only does something for `?Sized`; all other traits are not bound by default + --> $DIR/issue-87199.rs:12:40 + | +LL | fn ret() -> impl Iterator<Item = ()> + ?Send { std::iter::empty() } + | ^^^^^ + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + error[E0277]: the size for values of type `[i32]` cannot be known at compilation time - --> $DIR/issue-87199.rs:18:15 + --> $DIR/issue-87199.rs:19:15 | LL | ref_arg::<[i32]>(&[5]); | ^^^^^ doesn't have a size known at compile-time @@ -33,6 +41,6 @@ help: consider relaxing the implicit `Sized` restriction LL | fn ref_arg<T: ?Send + ?Sized>(_: &T) {} | ++++++++ -error: aborting due to 1 previous error; 3 warnings emitted +error: aborting due to 1 previous error; 4 warnings emitted For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/lifetimes/could-not-resolve-issue-121503.rs b/tests/ui/lifetimes/could-not-resolve-issue-121503.rs index 6bc70a907d9..363162370f2 100644 --- a/tests/ui/lifetimes/could-not-resolve-issue-121503.rs +++ b/tests/ui/lifetimes/could-not-resolve-issue-121503.rs @@ -4,8 +4,7 @@ struct Struct; impl Struct { async fn box_ref_Struct(self: Box<Self, impl FnMut(&mut Self)>) -> &u32 { - //~^ ERROR the trait bound `impl FnMut(&mut Self): Allocator` is not satisfied - //~| ERROR Box<Struct, impl FnMut(&mut Self)>` cannot be used as the type of `self` without + //~^ ERROR Box<Struct, impl FnMut(&mut Self)>` cannot be used as the type of `self` without &1 } } diff --git a/tests/ui/lifetimes/could-not-resolve-issue-121503.stderr b/tests/ui/lifetimes/could-not-resolve-issue-121503.stderr index a5d8239a2df..3babf63347c 100644 --- a/tests/ui/lifetimes/could-not-resolve-issue-121503.stderr +++ b/tests/ui/lifetimes/could-not-resolve-issue-121503.stderr @@ -1,16 +1,3 @@ -error[E0277]: the trait bound `impl FnMut(&mut Self): Allocator` is not satisfied - --> $DIR/could-not-resolve-issue-121503.rs:6:5 - | -LL | async fn box_ref_Struct(self: Box<Self, impl FnMut(&mut Self)>) -> &u32 { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Allocator` is not implemented for `impl FnMut(&mut Self)` - | -note: required by a bound in `Box` - --> $SRC_DIR/alloc/src/boxed.rs:LL:COL -help: consider further restricting this bound - | -LL | async fn box_ref_Struct(self: Box<Self, impl FnMut(&mut Self) + std::alloc::Allocator>) -> &u32 { - | +++++++++++++++++++++++ - error[E0658]: `Box<Struct, impl FnMut(&mut Self)>` cannot be used as the type of `self` without the `arbitrary_self_types` feature --> $DIR/could-not-resolve-issue-121503.rs:6:35 | @@ -22,7 +9,6 @@ LL | async fn box_ref_Struct(self: Box<Self, impl FnMut(&mut Self)>) -> &u32 = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date = help: consider changing to `self`, `&self`, `&mut self`, `self: Box<Self>`, `self: Rc<Self>`, `self: Arc<Self>`, or `self: Pin<P>` (where P is one of the previous types except `Self`) -error: aborting due to 2 previous errors +error: aborting due to 1 previous error -Some errors have detailed explanations: E0277, E0658. -For more information about an error, try `rustc --explain E0277`. +For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/lifetimes/issue-26638.rs b/tests/ui/lifetimes/issue-26638.rs index 4bec3b3415b..11c730165f2 100644 --- a/tests/ui/lifetimes/issue-26638.rs +++ b/tests/ui/lifetimes/issue-26638.rs @@ -1,6 +1,5 @@ fn parse_type(iter: Box<dyn Iterator<Item=&str>+'static>) -> &str { iter.next() } //~^ ERROR missing lifetime specifier [E0106] -//~| ERROR mismatched types fn parse_type_2(iter: fn(&u8)->&u8) -> &str { iter() } //~^ ERROR missing lifetime specifier [E0106] diff --git a/tests/ui/lifetimes/issue-26638.stderr b/tests/ui/lifetimes/issue-26638.stderr index ee958686259..403a8c67ccb 100644 --- a/tests/ui/lifetimes/issue-26638.stderr +++ b/tests/ui/lifetimes/issue-26638.stderr @@ -11,7 +11,7 @@ LL | fn parse_type<'a>(iter: Box<dyn Iterator<Item=&'a str>+'static>) -> &'a str | ++++ ++ ++ error[E0106]: missing lifetime specifier - --> $DIR/issue-26638.rs:5:40 + --> $DIR/issue-26638.rs:4:40 | LL | fn parse_type_2(iter: fn(&u8)->&u8) -> &str { iter() } | ^ expected named lifetime parameter @@ -31,7 +31,7 @@ LL | fn parse_type_2(iter: fn(&u8)->&u8) -> String { iter() } | ~~~~~~ error[E0106]: missing lifetime specifier - --> $DIR/issue-26638.rs:10:22 + --> $DIR/issue-26638.rs:9:22 | LL | fn parse_type_3() -> &str { unimplemented!() } | ^ expected named lifetime parameter @@ -46,23 +46,8 @@ help: instead, you are more likely to want to return an owned value LL | fn parse_type_3() -> String { unimplemented!() } | ~~~~~~ -error[E0308]: mismatched types - --> $DIR/issue-26638.rs:1:69 - | -LL | fn parse_type(iter: Box<dyn Iterator<Item=&str>+'static>) -> &str { iter.next() } - | ---- ^^^^^^^^^^^ expected `&str`, found `Option<&str>` - | | - | expected `&str` because of return type - | - = note: expected reference `&str` - found enum `Option<&str>` -help: consider using `Option::expect` to unwrap the `Option<&str>` value, panicking if the value is an `Option::None` - | -LL | fn parse_type(iter: Box<dyn Iterator<Item=&str>+'static>) -> &str { iter.next().expect("REASON") } - | +++++++++++++++++ - error[E0061]: this function takes 1 argument but 0 arguments were supplied - --> $DIR/issue-26638.rs:5:47 + --> $DIR/issue-26638.rs:4:47 | LL | fn parse_type_2(iter: fn(&u8)->&u8) -> &str { iter() } | ^^^^-- an argument of type `&u8` is missing @@ -73,7 +58,7 @@ LL | fn parse_type_2(iter: fn(&u8)->&u8) -> &str { iter(/* &u8 */) } | ~~~~~~~~~~~ error[E0308]: mismatched types - --> $DIR/issue-26638.rs:5:47 + --> $DIR/issue-26638.rs:4:47 | LL | fn parse_type_2(iter: fn(&u8)->&u8) -> &str { iter() } | ---- ^^^^^^ expected `&str`, found `&u8` @@ -83,7 +68,7 @@ LL | fn parse_type_2(iter: fn(&u8)->&u8) -> &str { iter() } = note: expected reference `&'static str` found reference `&u8` -error: aborting due to 6 previous errors +error: aborting due to 5 previous errors Some errors have detailed explanations: E0061, E0106, E0308. For more information about an error, try `rustc --explain E0061`. diff --git a/tests/ui/lifetimes/lifetime-errors/ex1b-return-no-names-if-else.rs b/tests/ui/lifetimes/lifetime-errors/ex1b-return-no-names-if-else.rs index 56f89b70410..d6c918843c7 100644 --- a/tests/ui/lifetimes/lifetime-errors/ex1b-return-no-names-if-else.rs +++ b/tests/ui/lifetimes/lifetime-errors/ex1b-return-no-names-if-else.rs @@ -1,7 +1,5 @@ fn foo(x: &i32, y: &i32) -> &i32 { //~ ERROR missing lifetime if x > y { x } else { y } - //~^ ERROR: lifetime may not live long enough - //~| ERROR: lifetime may not live long enough } fn main() {} diff --git a/tests/ui/lifetimes/lifetime-errors/ex1b-return-no-names-if-else.stderr b/tests/ui/lifetimes/lifetime-errors/ex1b-return-no-names-if-else.stderr index db5b039d1c2..62b0a8a04bf 100644 --- a/tests/ui/lifetimes/lifetime-errors/ex1b-return-no-names-if-else.stderr +++ b/tests/ui/lifetimes/lifetime-errors/ex1b-return-no-names-if-else.stderr @@ -10,22 +10,6 @@ help: consider introducing a named lifetime parameter LL | fn foo<'a>(x: &'a i32, y: &'a i32) -> &'a i32 { | ++++ ++ ++ ++ -error: lifetime may not live long enough - --> $DIR/ex1b-return-no-names-if-else.rs:2:16 - | -LL | fn foo(x: &i32, y: &i32) -> &i32 { - | - let's call the lifetime of this reference `'1` -LL | if x > y { x } else { y } - | ^ returning this value requires that `'1` must outlive `'static` - -error: lifetime may not live long enough - --> $DIR/ex1b-return-no-names-if-else.rs:2:27 - | -LL | fn foo(x: &i32, y: &i32) -> &i32 { - | - let's call the lifetime of this reference `'2` -LL | if x > y { x } else { y } - | ^ returning this value requires that `'2` must outlive `'static` - -error: aborting due to 3 previous errors +error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0106`. diff --git a/tests/ui/lifetimes/unusual-rib-combinations.stderr b/tests/ui/lifetimes/unusual-rib-combinations.stderr index e3b70232ef8..320e64a2f77 100644 --- a/tests/ui/lifetimes/unusual-rib-combinations.stderr +++ b/tests/ui/lifetimes/unusual-rib-combinations.stderr @@ -56,7 +56,10 @@ LL | fn d<const C: S>() {} | ^ | = note: the only supported types are integers, `bool` and `char` - = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types +help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types + | +LL + #![feature(adt_const_params)] + | error: aborting due to 8 previous errors diff --git a/tests/ui/lint/decorate-ice/decorate-can-emit-warnings.rs b/tests/ui/lint/decorate-ice/decorate-can-emit-warnings.rs new file mode 100644 index 00000000000..5adb5f526dc --- /dev/null +++ b/tests/ui/lint/decorate-ice/decorate-can-emit-warnings.rs @@ -0,0 +1,11 @@ +// Checks that the following does not ICE because `decorate` is incorrectly skipped. + +//@ compile-flags: -Dunused_must_use -Awarnings --crate-type=lib + +#[must_use] +fn f() {} + +pub fn g() { + f(); + //~^ ERROR unused return value +} diff --git a/tests/ui/lint/decorate-ice/decorate-can-emit-warnings.stderr b/tests/ui/lint/decorate-ice/decorate-can-emit-warnings.stderr new file mode 100644 index 00000000000..fde81de6136 --- /dev/null +++ b/tests/ui/lint/decorate-ice/decorate-can-emit-warnings.stderr @@ -0,0 +1,14 @@ +error: unused return value of `f` that must be used + --> $DIR/decorate-can-emit-warnings.rs:9:5 + | +LL | f(); + | ^^^ + | + = note: requested on the command line with `-D unused-must-use` +help: use `let _ = ...` to ignore the resulting value + | +LL | let _ = f(); + | +++++++ + +error: aborting due to 1 previous error + diff --git a/tests/ui/lint/decorate-ice/decorate-def-path-str-ice.rs b/tests/ui/lint/decorate-ice/decorate-def-path-str-ice.rs new file mode 100644 index 00000000000..8116e36ed0d --- /dev/null +++ b/tests/ui/lint/decorate-ice/decorate-def-path-str-ice.rs @@ -0,0 +1,30 @@ +// Checks that the following does not ICE. +// +// Previously, this test ICEs when the `unused_must_use` lint is suppressed via the combination of +// `-A warnings` and `--cap-lints=warn`, because: +// +// - Its lint diagnostic struct `UnusedDef` implements `LintDiagnostic` manually and in the impl +// `def_path_str` was called (which calls `trimmed_def_path`, which will produce a +// `must_produce_diag` ICE if a trimmed def path is constructed but never emitted in a diagnostic +// because it is expensive to compute). +// - A `LintDiagnostic` has a `decorate_lint` method which decorates a `Diag` with lint-specific +// information. This method is wrapped by a `decorate` closure in `TyCtxt` diagnostic emission +// machinery, and the `decorate` closure called as late as possible. +// - `decorate`'s invocation is delayed as late as possible until `lint_level` is called. +// - If a lint's corresponding diagnostic is suppressed (to be effectively allow at the final +// emission time) via `-A warnings` or `--cap-lints=allow` (or `-A warnings` + `--cap-lints=warn` +// like in this test case), `decorate` is still called and a diagnostic is still constructed -- +// but the diagnostic is never eventually emitted, triggering the aforementioned +// `must_produce_diag` ICE due to use of `trimmed_def_path`. +// +// Issue: <https://github.com/rust-lang/rust/issues/121774>. + +//@ compile-flags: -Dunused_must_use -Awarnings --cap-lints=warn --crate-type=lib +//@ check-pass + +#[must_use] +fn f() {} + +pub fn g() { + f(); +} diff --git a/tests/ui/lint/decorate-ice/decorate-force-warn.rs b/tests/ui/lint/decorate-ice/decorate-force-warn.rs new file mode 100644 index 00000000000..e33210ed0ce --- /dev/null +++ b/tests/ui/lint/decorate-ice/decorate-force-warn.rs @@ -0,0 +1,13 @@ +// Checks that the following does not ICE because `decorate` is incorrectly skipped due to +// `--force-warn`. + +//@ compile-flags: -Dunused_must_use -Awarnings --force-warn unused_must_use --crate-type=lib +//@ check-pass + +#[must_use] +fn f() {} + +pub fn g() { + f(); + //~^ WARN unused return value +} diff --git a/tests/ui/lint/decorate-ice/decorate-force-warn.stderr b/tests/ui/lint/decorate-ice/decorate-force-warn.stderr new file mode 100644 index 00000000000..5e6b74d414b --- /dev/null +++ b/tests/ui/lint/decorate-ice/decorate-force-warn.stderr @@ -0,0 +1,14 @@ +warning: unused return value of `f` that must be used + --> $DIR/decorate-force-warn.rs:11:5 + | +LL | f(); + | ^^^ + | + = note: requested on the command line with `--force-warn unused-must-use` +help: use `let _ = ...` to ignore the resulting value + | +LL | let _ = f(); + | +++++++ + +warning: 1 warning emitted + diff --git a/tests/ui/lint/invalid_value.stderr b/tests/ui/lint/invalid_value.stderr index 955d01bd5d9..b4e7421829f 100644 --- a/tests/ui/lint/invalid_value.stderr +++ b/tests/ui/lint/invalid_value.stderr @@ -320,23 +320,19 @@ error: the type `(NonZero<u32>, i32)` does not permit zero-initialization --> $DIR/invalid_value.rs:94:41 | LL | let _val: (NonZero<u32>, i32) = mem::zeroed(); - | ^^^^^^^^^^^^^ - | | - | this code causes undefined behavior when executed - | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done + | ^^^^^^^^^^^^^ this code causes undefined behavior when executed | = note: `std::num::NonZero<u32>` must be non-null + = note: because `core::num::nonzero::private::NonZeroU32Inner` must be non-null error: the type `(NonZero<u32>, i32)` does not permit being left uninitialized --> $DIR/invalid_value.rs:95:41 | LL | let _val: (NonZero<u32>, i32) = mem::uninitialized(); - | ^^^^^^^^^^^^^^^^^^^^ - | | - | this code causes undefined behavior when executed - | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done + | ^^^^^^^^^^^^^^^^^^^^ this code causes undefined behavior when executed | = note: `std::num::NonZero<u32>` must be non-null + = note: because `core::num::nonzero::private::NonZeroU32Inner` must be non-null = note: integers must be initialized error: the type `*const dyn Send` does not permit zero-initialization @@ -411,10 +407,7 @@ error: the type `OneFruitNonZero` does not permit zero-initialization --> $DIR/invalid_value.rs:106:37 | LL | let _val: OneFruitNonZero = mem::zeroed(); - | ^^^^^^^^^^^^^ - | | - | this code causes undefined behavior when executed - | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done + | ^^^^^^^^^^^^^ this code causes undefined behavior when executed | = note: `OneFruitNonZero` must be non-null note: because `std::num::NonZero<u32>` must be non-null (in this field of the only potentially inhabited enum variant) @@ -422,15 +415,13 @@ note: because `std::num::NonZero<u32>` must be non-null (in this field of the on | LL | Banana(NonZero<u32>), | ^^^^^^^^^^^^ + = note: because `core::num::nonzero::private::NonZeroU32Inner` must be non-null error: the type `OneFruitNonZero` does not permit being left uninitialized --> $DIR/invalid_value.rs:107:37 | LL | let _val: OneFruitNonZero = mem::uninitialized(); - | ^^^^^^^^^^^^^^^^^^^^ - | | - | this code causes undefined behavior when executed - | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done + | ^^^^^^^^^^^^^^^^^^^^ this code causes undefined behavior when executed | = note: `OneFruitNonZero` must be non-null note: because `std::num::NonZero<u32>` must be non-null (in this field of the only potentially inhabited enum variant) @@ -438,6 +429,7 @@ note: because `std::num::NonZero<u32>` must be non-null (in this field of the on | LL | Banana(NonZero<u32>), | ^^^^^^^^^^^^ + = note: because `core::num::nonzero::private::NonZeroU32Inner` must be non-null = note: integers must be initialized error: the type `bool` does not permit being left uninitialized @@ -607,12 +599,10 @@ error: the type `NonZero<u32>` does not permit zero-initialization --> $DIR/invalid_value.rs:153:34 | LL | let _val: NonZero<u32> = mem::transmute(0); - | ^^^^^^^^^^^^^^^^^ - | | - | this code causes undefined behavior when executed - | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done + | ^^^^^^^^^^^^^^^^^ this code causes undefined behavior when executed | = note: `std::num::NonZero<u32>` must be non-null + = note: because `core::num::nonzero::private::NonZeroU32Inner` must be non-null error: the type `NonNull<i32>` does not permit zero-initialization --> $DIR/invalid_value.rs:156:34 diff --git a/tests/ui/lint/lint-qualification.fixed b/tests/ui/lint/lint-qualification.fixed index 6fe6ba2792f..7c8fd5236e6 100644 --- a/tests/ui/lint/lint-qualification.fixed +++ b/tests/ui/lint/lint-qualification.fixed @@ -16,7 +16,6 @@ fn main() { let _ = || -> Result<(), ()> { try!(Ok(())); Ok(()) }; // issue #37345 let _ = String::new(); //~ ERROR: unnecessary qualification - let _ = std::env::current_dir(); //~ ERROR: unnecessary qualification let _: Vec<String> = Vec::<String>::new(); //~^ ERROR: unnecessary qualification @@ -27,7 +26,7 @@ fn main() { let _: std::fmt::Result = Ok(()); // don't report unnecessary qualification because fix(#122373) for issue #121331 - let _ = <bool as Default>::default(); // issue #121999 + let _ = <bool as Default>::default(); // issue #121999 (modified) //~^ ERROR: unnecessary qualification macro_rules! m { ($a:ident, $b:ident) => { @@ -36,6 +35,7 @@ fn main() { foo::bar(); foo::$b(); // issue #96698 $a::bar(); + $a::$b(); } } m!(foo, bar); } diff --git a/tests/ui/lint/lint-qualification.rs b/tests/ui/lint/lint-qualification.rs index 19d339b006c..009b3080d5c 100644 --- a/tests/ui/lint/lint-qualification.rs +++ b/tests/ui/lint/lint-qualification.rs @@ -16,7 +16,6 @@ fn main() { let _ = || -> Result<(), ()> { try!(Ok(())); Ok(()) }; // issue #37345 let _ = std::string::String::new(); //~ ERROR: unnecessary qualification - let _ = ::std::env::current_dir(); //~ ERROR: unnecessary qualification let _: std::vec::Vec<String> = std::vec::Vec::<String>::new(); //~^ ERROR: unnecessary qualification @@ -27,7 +26,7 @@ fn main() { let _: std::fmt::Result = Ok(()); // don't report unnecessary qualification because fix(#122373) for issue #121331 - let _ = <bool as ::std::default::Default>::default(); // issue #121999 + let _ = <bool as std::default::Default>::default(); // issue #121999 (modified) //~^ ERROR: unnecessary qualification macro_rules! m { ($a:ident, $b:ident) => { @@ -36,6 +35,7 @@ fn main() { foo::bar(); foo::$b(); // issue #96698 $a::bar(); + $a::$b(); } } m!(foo, bar); } diff --git a/tests/ui/lint/lint-qualification.stderr b/tests/ui/lint/lint-qualification.stderr index 9e5c9b2df13..cefa54a12ae 100644 --- a/tests/ui/lint/lint-qualification.stderr +++ b/tests/ui/lint/lint-qualification.stderr @@ -40,19 +40,7 @@ LL + let _ = String::new(); | error: unnecessary qualification - --> $DIR/lint-qualification.rs:19:13 - | -LL | let _ = ::std::env::current_dir(); - | ^^^^^^^^^^^^^^^^^^^^^^^ - | -help: remove the unnecessary path segments - | -LL - let _ = ::std::env::current_dir(); -LL + let _ = std::env::current_dir(); - | - -error: unnecessary qualification - --> $DIR/lint-qualification.rs:21:12 + --> $DIR/lint-qualification.rs:20:12 | LL | let _: std::vec::Vec<String> = std::vec::Vec::<String>::new(); | ^^^^^^^^^^^^^^^^^^^^^ @@ -64,7 +52,7 @@ LL + let _: Vec<String> = std::vec::Vec::<String>::new(); | error: unnecessary qualification - --> $DIR/lint-qualification.rs:21:36 + --> $DIR/lint-qualification.rs:20:36 | LL | let _: std::vec::Vec<String> = std::vec::Vec::<String>::new(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -76,7 +64,7 @@ LL + let _: std::vec::Vec<String> = Vec::<String>::new(); | error: unused import: `std::fmt` - --> $DIR/lint-qualification.rs:25:9 + --> $DIR/lint-qualification.rs:24:9 | LL | use std::fmt; | ^^^^^^^^ @@ -88,16 +76,16 @@ LL | #![deny(unused_imports)] | ^^^^^^^^^^^^^^ error: unnecessary qualification - --> $DIR/lint-qualification.rs:30:13 + --> $DIR/lint-qualification.rs:29:13 | -LL | let _ = <bool as ::std::default::Default>::default(); // issue #121999 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | let _ = <bool as std::default::Default>::default(); // issue #121999 (modified) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | help: remove the unnecessary path segments | -LL - let _ = <bool as ::std::default::Default>::default(); // issue #121999 -LL + let _ = <bool as Default>::default(); // issue #121999 +LL - let _ = <bool as std::default::Default>::default(); // issue #121999 (modified) +LL + let _ = <bool as Default>::default(); // issue #121999 (modified) | -error: aborting due to 8 previous errors +error: aborting due to 7 previous errors diff --git a/tests/ui/lint/must_not_suspend/allocator.rs b/tests/ui/lint/must_not_suspend/allocator.rs new file mode 100644 index 00000000000..c2ceb3297f3 --- /dev/null +++ b/tests/ui/lint/must_not_suspend/allocator.rs @@ -0,0 +1,30 @@ +//@ edition: 2021 + +#![feature(must_not_suspend, allocator_api)] +#![deny(must_not_suspend)] + +use std::alloc::*; +use std::ptr::NonNull; + +#[must_not_suspend] +struct MyAllocatorWhichMustNotSuspend; + +unsafe impl Allocator for MyAllocatorWhichMustNotSuspend { + fn allocate(&self, l: Layout) -> Result<NonNull<[u8]>, AllocError> { + Global.allocate(l) + } + unsafe fn deallocate(&self, p: NonNull<u8>, l: Layout) { + Global.deallocate(p, l) + } +} + +async fn suspend() {} + +async fn foo() { + let x = Box::new_in(1i32, MyAllocatorWhichMustNotSuspend); + //~^ ERROR allocator `MyAllocatorWhichMustNotSuspend` held across a suspend point, but should not be + suspend().await; + drop(x); +} + +fn main() {} diff --git a/tests/ui/lint/must_not_suspend/allocator.stderr b/tests/ui/lint/must_not_suspend/allocator.stderr new file mode 100644 index 00000000000..959945f2626 --- /dev/null +++ b/tests/ui/lint/must_not_suspend/allocator.stderr @@ -0,0 +1,22 @@ +error: allocator `MyAllocatorWhichMustNotSuspend` held across a suspend point, but should not be + --> $DIR/allocator.rs:24:9 + | +LL | let x = Box::new_in(1i32, MyAllocatorWhichMustNotSuspend); + | ^ +LL | +LL | suspend().await; + | ----- the value is held across this suspend point + | +help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point + --> $DIR/allocator.rs:24:9 + | +LL | let x = Box::new_in(1i32, MyAllocatorWhichMustNotSuspend); + | ^ +note: the lint level is defined here + --> $DIR/allocator.rs:4:9 + | +LL | #![deny(must_not_suspend)] + | ^^^^^^^^^^^^^^^^ + +error: aborting due to 1 previous error + diff --git a/tests/ui/lint/unused-qualifications-global-paths.rs b/tests/ui/lint/unused-qualifications-global-paths.rs new file mode 100644 index 00000000000..8265c8a1694 --- /dev/null +++ b/tests/ui/lint/unused-qualifications-global-paths.rs @@ -0,0 +1,12 @@ +// Checks that `unused_qualifications` don't fire on explicit global paths. +// Issue: <https://github.com/rust-lang/rust/issues/122374>. + +//@ check-pass + +#![deny(unused_qualifications)] + +pub fn bar() -> u64 { + ::std::default::Default::default() +} + +fn main() {} diff --git a/tests/ui/lint/unused/unused-associated-item.rs b/tests/ui/lint/unused/unused-associated-item.rs new file mode 100644 index 00000000000..27cb4e979f1 --- /dev/null +++ b/tests/ui/lint/unused/unused-associated-item.rs @@ -0,0 +1,21 @@ +//@ check-pass + +#![deny(unused_must_use)] + +use std::future::Future; +use std::pin::Pin; + +trait Factory { + type Output; +} + +impl Factory for () { + type Output = Pin<Box<dyn Future<Output = ()> + 'static>>; +} + +// Make sure we don't get an `unused_must_use` error on the *associated type bound*. +fn f() -> impl Factory<Output: Future> {} + +fn main() { + f(); +} diff --git a/tests/ui/macros/derive-in-eager-expansion-hang.stderr b/tests/ui/macros/derive-in-eager-expansion-hang.stderr index e0f6d5b2de0..b61ef2a9bab 100644 --- a/tests/ui/macros/derive-in-eager-expansion-hang.stderr +++ b/tests/ui/macros/derive-in-eager-expansion-hang.stderr @@ -4,8 +4,7 @@ error: format argument must be a string literal LL | / { LL | | #[derive(Clone)] LL | | struct S; -LL | | -LL | | "" +... | LL | | } | |_____^ ... diff --git a/tests/ui/macros/paren-or-brace-expected.rs b/tests/ui/macros/paren-or-brace-expected.rs new file mode 100644 index 00000000000..1776fa78884 --- /dev/null +++ b/tests/ui/macros/paren-or-brace-expected.rs @@ -0,0 +1,9 @@ +macro_rules! foo { + ( $( $i:ident ),* ) => { + $[count($i)] + //~^ ERROR expected `(` or `{`, found `[` + //~| ERROR + }; +} + +fn main() {} diff --git a/tests/ui/macros/paren-or-brace-expected.stderr b/tests/ui/macros/paren-or-brace-expected.stderr new file mode 100644 index 00000000000..4d1dda97751 --- /dev/null +++ b/tests/ui/macros/paren-or-brace-expected.stderr @@ -0,0 +1,14 @@ +error: expected `(` or `{`, found `[` + --> $DIR/paren-or-brace-expected.rs:3:10 + | +LL | $[count($i)] + | ^^^^^^^^^^^ + +error: expected one of: `*`, `+`, or `?` + --> $DIR/paren-or-brace-expected.rs:3:10 + | +LL | $[count($i)] + | ^^^^^^^^^^^ + +error: aborting due to 2 previous errors + diff --git a/tests/ui/match/postfix-match/pf-match-chain.rs b/tests/ui/match/postfix-match/pf-match-chain.rs new file mode 100644 index 00000000000..80546e1963b --- /dev/null +++ b/tests/ui/match/postfix-match/pf-match-chain.rs @@ -0,0 +1,16 @@ +//@ run-pass + +#![feature(postfix_match)] + +fn main() { + 1.match { + 2 => Some(0), + _ => None, + }.match { + None => Ok(true), + Some(_) => Err("nope") + }.match { + Ok(_) => (), + Err(_) => panic!() + } +} diff --git a/tests/ui/match/postfix-match/pf-match-exhaustiveness.rs b/tests/ui/match/postfix-match/pf-match-exhaustiveness.rs new file mode 100644 index 00000000000..f4cac46f7cd --- /dev/null +++ b/tests/ui/match/postfix-match/pf-match-exhaustiveness.rs @@ -0,0 +1,7 @@ +#![feature(postfix_match)] + +fn main() { + Some(1).match { //~ non-exhaustive patterns + None => {}, + } +} diff --git a/tests/ui/match/postfix-match/pf-match-exhaustiveness.stderr b/tests/ui/match/postfix-match/pf-match-exhaustiveness.stderr new file mode 100644 index 00000000000..f458218bb5d --- /dev/null +++ b/tests/ui/match/postfix-match/pf-match-exhaustiveness.stderr @@ -0,0 +1,21 @@ +error[E0004]: non-exhaustive patterns: `Some(_)` not covered + --> $DIR/pf-match-exhaustiveness.rs:4:5 + | +LL | Some(1).match { + | ^^^^^^^ pattern `Some(_)` not covered + | +note: `Option<i32>` defined here + --> $SRC_DIR/core/src/option.rs:LL:COL + ::: $SRC_DIR/core/src/option.rs:LL:COL + | + = note: not covered + = note: the matched value is of type `Option<i32>` +help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown + | +LL ~ None => {}, +LL ~ Some(_) => todo!(), + | + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0004`. diff --git a/tests/ui/match/postfix-match/pf-match-types.rs b/tests/ui/match/postfix-match/pf-match-types.rs new file mode 100644 index 00000000000..af205926fb6 --- /dev/null +++ b/tests/ui/match/postfix-match/pf-match-types.rs @@ -0,0 +1,15 @@ +#![feature(postfix_match)] + +fn main() { + Some(10).match { + //~^ NOTE `match` arms have incompatible types + Some(5) => false, + //~^ NOTE this is found to be of type `bool` + Some(2) => true, + //~^ NOTE this is found to be of type `bool` + None => (), + //~^ ERROR `match` arms have incompatible types + //~| NOTE expected `bool`, found `()` + _ => true + } +} diff --git a/tests/ui/match/postfix-match/pf-match-types.stderr b/tests/ui/match/postfix-match/pf-match-types.stderr new file mode 100644 index 00000000000..0cfc1363d5f --- /dev/null +++ b/tests/ui/match/postfix-match/pf-match-types.stderr @@ -0,0 +1,21 @@ +error[E0308]: `match` arms have incompatible types + --> $DIR/pf-match-types.rs:10:20 + | +LL | / Some(10).match { +LL | | +LL | | Some(5) => false, + | | ----- this is found to be of type `bool` +LL | | +LL | | Some(2) => true, + | | ---- this is found to be of type `bool` +LL | | +LL | | None => (), + | | ^^ expected `bool`, found `()` +... | +LL | | _ => true +LL | | } + | |_____- `match` arms have incompatible types + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/match/postfix-match/postfix-match.rs b/tests/ui/match/postfix-match/postfix-match.rs new file mode 100644 index 00000000000..03c4e8ab545 --- /dev/null +++ b/tests/ui/match/postfix-match/postfix-match.rs @@ -0,0 +1,62 @@ +//@ run-pass + +#![feature(postfix_match)] + +struct Bar { + foo: u8, + baz: u8, +} + +pub fn main() { + let thing = Some("thing"); + + thing.match { + Some("nothing") => {}, + Some(text) if text.eq_ignore_ascii_case("tapir") => {}, + Some("true") | Some("false") => {}, + Some("thing") => {}, + Some(_) => {}, + None => {} + }; + + let num = 2u8; + + num.match { + 0 => {}, + 1..=5 => {}, + _ => {}, + }; + + let slic = &[1, 2, 3, 4][..]; + + slic.match { + [1] => {}, + [2, _tail @ ..] => {}, + [1, _] => {}, + _ => {}, + }; + + slic[0].match { + 1 => 0, + i => i, + }; + + let out = (1, 2).match { + (1, 3) => 0, + (_, 1) => 0, + (1, i) => i, + _ => 3, + }; + assert!(out == 2); + + let strct = Bar { + foo: 3, + baz: 4 + }; + + strct.match { + Bar { foo: 1, .. } => {}, + Bar { baz: 2, .. } => {}, + _ => (), + }; +} diff --git a/tests/ui/moves/nested-loop-moved-value-wrong-continue.rs b/tests/ui/moves/nested-loop-moved-value-wrong-continue.rs new file mode 100644 index 00000000000..0235b291df5 --- /dev/null +++ b/tests/ui/moves/nested-loop-moved-value-wrong-continue.rs @@ -0,0 +1,50 @@ +fn foo() { + let foos = vec![String::new()]; + let bars = vec![""]; + let mut baz = vec![]; + let mut qux = vec![]; + for foo in foos { for bar in &bars { if foo == *bar { + //~^ NOTE this reinitialization might get skipped + //~| NOTE move occurs because `foo` has type `String` + //~| NOTE inside of this loop + //~| HELP consider moving the expression out of the loop + //~| NOTE in this expansion of desugaring of `for` loop + baz.push(foo); + //~^ NOTE value moved here + //~| HELP consider cloning the value + continue; + //~^ NOTE verify that your loop breaking logic is correct + //~| NOTE this `continue` advances the loop at $DIR/nested-loop-moved-value-wrong-continue.rs:6:23 + } } + qux.push(foo); + //~^ ERROR use of moved value + //~| NOTE value used here + } +} + +fn main() { + let foos = vec![String::new()]; + let bars = vec![""]; + let mut baz = vec![]; + let mut qux = vec![]; + for foo in foos { + //~^ NOTE this reinitialization might get skipped + //~| NOTE move occurs because `foo` has type `String` + for bar in &bars { + //~^ NOTE inside of this loop + //~| HELP consider moving the expression out of the loop + //~| NOTE in this expansion of desugaring of `for` loop + if foo == *bar { + baz.push(foo); + //~^ NOTE value moved here + //~| HELP consider cloning the value + continue; + //~^ NOTE verify that your loop breaking logic is correct + //~| NOTE this `continue` advances the loop at line 33 + } + } + qux.push(foo); + //~^ ERROR use of moved value + //~| NOTE value used here + } +} diff --git a/tests/ui/moves/nested-loop-moved-value-wrong-continue.stderr b/tests/ui/moves/nested-loop-moved-value-wrong-continue.stderr new file mode 100644 index 00000000000..3247513d42c --- /dev/null +++ b/tests/ui/moves/nested-loop-moved-value-wrong-continue.stderr @@ -0,0 +1,83 @@ +error[E0382]: use of moved value: `foo` + --> $DIR/nested-loop-moved-value-wrong-continue.rs:19:14 + | +LL | for foo in foos { for bar in &bars { if foo == *bar { + | --- ---------------- inside of this loop + | | + | this reinitialization might get skipped + | move occurs because `foo` has type `String`, which does not implement the `Copy` trait +... +LL | baz.push(foo); + | --- value moved here, in previous iteration of loop +... +LL | qux.push(foo); + | ^^^ value used here after move + | +note: verify that your loop breaking logic is correct + --> $DIR/nested-loop-moved-value-wrong-continue.rs:15:9 + | +LL | for foo in foos { for bar in &bars { if foo == *bar { + | --------------- ---------------- +... +LL | continue; + | ^^^^^^^^ this `continue` advances the loop at $DIR/nested-loop-moved-value-wrong-continue.rs:6:23: 18:8 +help: consider moving the expression out of the loop so it is only moved once + | +LL ~ for foo in foos { let mut value = baz.push(foo); +LL ~ for bar in &bars { if foo == *bar { +LL | + ... +LL | +LL ~ value; + | +help: consider cloning the value if the performance cost is acceptable + | +LL | baz.push(foo.clone()); + | ++++++++ + +error[E0382]: use of moved value: `foo` + --> $DIR/nested-loop-moved-value-wrong-continue.rs:46:18 + | +LL | for foo in foos { + | --- + | | + | this reinitialization might get skipped + | move occurs because `foo` has type `String`, which does not implement the `Copy` trait +... +LL | for bar in &bars { + | ---------------- inside of this loop +... +LL | baz.push(foo); + | --- value moved here, in previous iteration of loop +... +LL | qux.push(foo); + | ^^^ value used here after move + | +note: verify that your loop breaking logic is correct + --> $DIR/nested-loop-moved-value-wrong-continue.rs:41:17 + | +LL | for foo in foos { + | --------------- +... +LL | for bar in &bars { + | ---------------- +... +LL | continue; + | ^^^^^^^^ this `continue` advances the loop at line 33 +help: consider moving the expression out of the loop so it is only moved once + | +LL ~ let mut value = baz.push(foo); +LL ~ for bar in &bars { +LL | + ... +LL | if foo == *bar { +LL ~ value; + | +help: consider cloning the value if the performance cost is acceptable + | +LL | baz.push(foo.clone()); + | ++++++++ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0382`. diff --git a/tests/ui/moves/recreating-value-in-loop-condition.rs b/tests/ui/moves/recreating-value-in-loop-condition.rs new file mode 100644 index 00000000000..ad012ff2978 --- /dev/null +++ b/tests/ui/moves/recreating-value-in-loop-condition.rs @@ -0,0 +1,65 @@ +fn iter<T>(vec: Vec<T>) -> impl Iterator<Item = T> { + vec.into_iter() +} +fn foo() { + let vec = vec!["one", "two", "three"]; + while let Some(item) = iter(vec).next() { //~ ERROR use of moved value + //~^ HELP consider moving the expression out of the loop so it is only moved once + println!("{:?}", item); + } +} +fn bar() { + let vec = vec!["one", "two", "three"]; + loop { + //~^ HELP consider moving the expression out of the loop so it is only moved once + let Some(item) = iter(vec).next() else { //~ ERROR use of moved value + break; + }; + println!("{:?}", item); + } +} +fn baz() { + let vec = vec!["one", "two", "three"]; + loop { + //~^ HELP consider moving the expression out of the loop so it is only moved once + let item = iter(vec).next(); //~ ERROR use of moved value + //~^ HELP consider cloning + if item.is_none() { + break; + } + println!("{:?}", item); + } +} +fn qux() { + let vec = vec!["one", "two", "three"]; + loop { + //~^ HELP consider moving the expression out of the loop so it is only moved once + if let Some(item) = iter(vec).next() { //~ ERROR use of moved value + println!("{:?}", item); + break; + } + } +} +fn zap() { + loop { + let vec = vec!["one", "two", "three"]; + loop { + //~^ HELP consider moving the expression out of the loop so it is only moved once + loop { + loop { + if let Some(item) = iter(vec).next() { //~ ERROR use of moved value + println!("{:?}", item); + break; + } + } + } + } + } +} +fn main() { + foo(); + bar(); + baz(); + qux(); + zap(); +} diff --git a/tests/ui/moves/recreating-value-in-loop-condition.stderr b/tests/ui/moves/recreating-value-in-loop-condition.stderr new file mode 100644 index 00000000000..75c9633bc0a --- /dev/null +++ b/tests/ui/moves/recreating-value-in-loop-condition.stderr @@ -0,0 +1,157 @@ +error[E0382]: use of moved value: `vec` + --> $DIR/recreating-value-in-loop-condition.rs:6:33 + | +LL | let vec = vec!["one", "two", "three"]; + | --- move occurs because `vec` has type `Vec<&str>`, which does not implement the `Copy` trait +LL | while let Some(item) = iter(vec).next() { + | ----------------------------^^^-------- + | | | + | | value moved here, in previous iteration of loop + | inside of this loop + | +note: consider changing this parameter type in function `iter` to borrow instead if owning the value isn't necessary + --> $DIR/recreating-value-in-loop-condition.rs:1:17 + | +LL | fn iter<T>(vec: Vec<T>) -> impl Iterator<Item = T> { + | ---- ^^^^^^ this parameter takes ownership of the value + | | + | in this function +help: consider moving the expression out of the loop so it is only moved once + | +LL ~ let mut value = iter(vec); +LL ~ while let Some(item) = value.next() { + | + +error[E0382]: use of moved value: `vec` + --> $DIR/recreating-value-in-loop-condition.rs:15:31 + | +LL | let vec = vec!["one", "two", "three"]; + | --- move occurs because `vec` has type `Vec<&str>`, which does not implement the `Copy` trait +LL | loop { + | ---- inside of this loop +LL | +LL | let Some(item) = iter(vec).next() else { + | ^^^ value moved here, in previous iteration of loop + | +note: consider changing this parameter type in function `iter` to borrow instead if owning the value isn't necessary + --> $DIR/recreating-value-in-loop-condition.rs:1:17 + | +LL | fn iter<T>(vec: Vec<T>) -> impl Iterator<Item = T> { + | ---- ^^^^^^ this parameter takes ownership of the value + | | + | in this function +help: consider moving the expression out of the loop so it is only moved once + | +LL ~ let mut value = iter(vec); +LL ~ loop { +LL | +LL ~ let Some(item) = value.next() else { + | + +error[E0382]: use of moved value: `vec` + --> $DIR/recreating-value-in-loop-condition.rs:25:25 + | +LL | let vec = vec!["one", "two", "three"]; + | --- move occurs because `vec` has type `Vec<&str>`, which does not implement the `Copy` trait +LL | loop { + | ---- inside of this loop +LL | +LL | let item = iter(vec).next(); + | ^^^ value moved here, in previous iteration of loop + | +note: consider changing this parameter type in function `iter` to borrow instead if owning the value isn't necessary + --> $DIR/recreating-value-in-loop-condition.rs:1:17 + | +LL | fn iter<T>(vec: Vec<T>) -> impl Iterator<Item = T> { + | ---- ^^^^^^ this parameter takes ownership of the value + | | + | in this function +help: consider moving the expression out of the loop so it is only moved once + | +LL ~ let mut value = iter(vec); +LL ~ loop { +LL | +LL ~ let item = value.next(); + | +help: consider cloning the value if the performance cost is acceptable + | +LL | let item = iter(vec.clone()).next(); + | ++++++++ + +error[E0382]: use of moved value: `vec` + --> $DIR/recreating-value-in-loop-condition.rs:37:34 + | +LL | let vec = vec!["one", "two", "three"]; + | --- move occurs because `vec` has type `Vec<&str>`, which does not implement the `Copy` trait +LL | loop { + | ---- inside of this loop +LL | +LL | if let Some(item) = iter(vec).next() { + | ^^^ value moved here, in previous iteration of loop + | +note: consider changing this parameter type in function `iter` to borrow instead if owning the value isn't necessary + --> $DIR/recreating-value-in-loop-condition.rs:1:17 + | +LL | fn iter<T>(vec: Vec<T>) -> impl Iterator<Item = T> { + | ---- ^^^^^^ this parameter takes ownership of the value + | | + | in this function +help: consider moving the expression out of the loop so it is only moved once + | +LL ~ let mut value = iter(vec); +LL ~ loop { +LL | +LL ~ if let Some(item) = value.next() { + | + +error[E0382]: use of moved value: `vec` + --> $DIR/recreating-value-in-loop-condition.rs:50:46 + | +LL | let vec = vec!["one", "two", "three"]; + | --- move occurs because `vec` has type `Vec<&str>`, which does not implement the `Copy` trait +LL | loop { + | ---- inside of this loop +LL | +LL | loop { + | ---- inside of this loop +LL | loop { + | ---- inside of this loop +LL | if let Some(item) = iter(vec).next() { + | ^^^ value moved here, in previous iteration of loop + | +note: consider changing this parameter type in function `iter` to borrow instead if owning the value isn't necessary + --> $DIR/recreating-value-in-loop-condition.rs:1:17 + | +LL | fn iter<T>(vec: Vec<T>) -> impl Iterator<Item = T> { + | ---- ^^^^^^ this parameter takes ownership of the value + | | + | in this function +note: verify that your loop breaking logic is correct + --> $DIR/recreating-value-in-loop-condition.rs:52:25 + | +LL | loop { + | ---- +LL | let vec = vec!["one", "two", "three"]; +LL | loop { + | ---- +LL | +LL | loop { + | ---- +LL | loop { + | ---- +... +LL | break; + | ^^^^^ this `break` exits the loop at line 49 +help: consider moving the expression out of the loop so it is only moved once + | +LL ~ let mut value = iter(vec); +LL ~ loop { +LL | +LL | loop { +LL | loop { +LL ~ if let Some(item) = value.next() { + | + +error: aborting due to 5 previous errors + +For more information about this error, try `rustc --explain E0382`. diff --git a/tests/ui/never_type/issue-52443.stderr b/tests/ui/never_type/issue-52443.stderr index 83afd9ef2f2..bab47064f6c 100644 --- a/tests/ui/never_type/issue-52443.stderr +++ b/tests/ui/never_type/issue-52443.stderr @@ -50,7 +50,10 @@ LL | [(); { for _ in 0usize.. {}; 0}]; note: impl defined here, but it is not `const` --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL = note: calls in constants are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable +help: add `#![feature(const_trait_impl)]` to the crate attributes to enable + | +LL + #![feature(const_trait_impl)] + | error[E0658]: mutable references are not allowed in constants --> $DIR/issue-52443.rs:9:21 @@ -69,7 +72,10 @@ LL | [(); { for _ in 0usize.. {}; 0}]; | ^^^^^^^^ | = note: calls in constants are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable +help: add `#![feature(const_trait_impl)]` to the crate attributes to enable + | +LL + #![feature(const_trait_impl)] + | error: aborting due to 6 previous errors; 1 warning emitted diff --git a/tests/ui/nll/closure-requirements/escape-argument-callee.stderr b/tests/ui/nll/closure-requirements/escape-argument-callee.stderr index 8debea6a0a2..a7a59dccf22 100644 --- a/tests/ui/nll/closure-requirements/escape-argument-callee.stderr +++ b/tests/ui/nll/closure-requirements/escape-argument-callee.stderr @@ -6,7 +6,7 @@ LL | let mut closure = expect_sig(|p, y| *p = y); | = note: defining type: test::{closure#0} with closure args [ i16, - for<Region(BrAnon), Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((&ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }) mut &ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) i32, &ReBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon }) i32)), + for<Region(BrAnon), Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((&'^0 mut &'^1 i32, &'^2 i32)), (), ] diff --git a/tests/ui/nll/closure-requirements/escape-argument.stderr b/tests/ui/nll/closure-requirements/escape-argument.stderr index b050c0566c6..7fd1cd8c3e4 100644 --- a/tests/ui/nll/closure-requirements/escape-argument.stderr +++ b/tests/ui/nll/closure-requirements/escape-argument.stderr @@ -6,7 +6,7 @@ LL | let mut closure = expect_sig(|p, y| *p = y); | = note: defining type: test::{closure#0} with closure args [ i16, - for<Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((&ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }) mut &ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) i32, &ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) i32)), + for<Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((&'^0 mut &'^1 i32, &'^1 i32)), (), ] diff --git a/tests/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr b/tests/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr index bffd365b9cc..f37ce967a1b 100644 --- a/tests/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr +++ b/tests/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr @@ -6,7 +6,7 @@ LL | |_outlives1, _outlives2, _outlives3, x, y| { | = note: defining type: supply::{closure#0} with closure args [ i16, - for<Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((std::cell::Cell<&'?1 &ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }) u32>, std::cell::Cell<&'?2 &ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }) u32>, std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) &'?3 u32>, std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }) u32>, std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) u32>)), + for<Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((std::cell::Cell<&'?1 &'^0 u32>, std::cell::Cell<&'?2 &'^0 u32>, std::cell::Cell<&'^1 &'?3 u32>, std::cell::Cell<&'^0 u32>, std::cell::Cell<&'^1 u32>)), (), ] = note: late-bound region is '?4 diff --git a/tests/ui/nll/closure-requirements/propagate-approximated-ref.stderr b/tests/ui/nll/closure-requirements/propagate-approximated-ref.stderr index 843d307b80b..e2d0b105ab1 100644 --- a/tests/ui/nll/closure-requirements/propagate-approximated-ref.stderr +++ b/tests/ui/nll/closure-requirements/propagate-approximated-ref.stderr @@ -6,7 +6,7 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y | = note: defining type: supply::{closure#0} with closure args [ i16, - for<Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((&ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }) std::cell::Cell<&'?1 &ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) u32>, &ReBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon }) std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon }) &'?2 u32>, &ReBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrAnon }) std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) u32>, &ReBound(DebruijnIndex(0), BoundRegion { var: 5, kind: BrAnon }) std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon }) u32>)), + for<Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((&'^0 std::cell::Cell<&'?1 &'^1 u32>, &'^2 std::cell::Cell<&'^3 &'?2 u32>, &'^4 std::cell::Cell<&'^1 u32>, &'^5 std::cell::Cell<&'^3 u32>)), (), ] = note: late-bound region is '?3 diff --git a/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr b/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr index 5ce3dae5a33..d7933a39eaa 100644 --- a/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr +++ b/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr @@ -6,7 +6,7 @@ LL | foo(cell, |cell_a, cell_x| { | = note: defining type: case1::{closure#0} with closure args [ i32, - for<Region(BrAnon)> extern "rust-call" fn((std::cell::Cell<&'?1 u32>, std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }) u32>)), + for<Region(BrAnon)> extern "rust-call" fn((std::cell::Cell<&'?1 u32>, std::cell::Cell<&'^0 u32>)), (), ] @@ -36,7 +36,7 @@ LL | foo(cell, |cell_a, cell_x| { | = note: defining type: case2::{closure#0} with closure args [ i32, - for<Region(BrAnon)> extern "rust-call" fn((std::cell::Cell<&'?1 u32>, std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }) u32>)), + for<Region(BrAnon)> extern "rust-call" fn((std::cell::Cell<&'?1 u32>, std::cell::Cell<&'^0 u32>)), (), ] = note: number of external vids: 2 @@ -53,17 +53,16 @@ LL | fn case2() { error[E0597]: `a` does not live long enough --> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:30:26 | -LL | let a = 0; - | - binding `a` declared here -LL | let cell = Cell::new(&a); - | ^^ borrowed value does not live long enough +LL | let a = 0; + | - binding `a` declared here +LL | let cell = Cell::new(&a); + | ----------^^- + | | | + | | borrowed value does not live long enough + | argument requires that `a` is borrowed for `'static` ... -LL | / foo(cell, |cell_a, cell_x| { -LL | | cell_x.set(cell_a.get()); // forces 'a: 'x, implies 'a = 'static -> borrow error -LL | | }) - | |______- argument requires that `a` is borrowed for `'static` -LL | } - | - `a` dropped here while still borrowed +LL | } + | - `a` dropped here while still borrowed error: aborting due to 2 previous errors diff --git a/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr b/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr index 54784df5275..ca7d187ac57 100644 --- a/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr +++ b/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr @@ -6,7 +6,7 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| { | = note: defining type: supply::{closure#0} with closure args [ i16, - for<Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((&ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }) std::cell::Cell<&'?1 &ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) u32>, &ReBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon }) std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) u32>, &ReBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon }) std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrAnon }) u32>)), + for<Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((&'^0 std::cell::Cell<&'?1 &'^1 u32>, &'^2 std::cell::Cell<&'^1 u32>, &'^3 std::cell::Cell<&'^4 u32>)), (), ] = note: late-bound region is '?2 diff --git a/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr b/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr index 53547afbfea..d11a64272a9 100644 --- a/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr +++ b/tests/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr @@ -6,7 +6,7 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y | = note: defining type: supply::{closure#0} with closure args [ i16, - for<Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((&ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }) std::cell::Cell<&'?1 &ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) u32>, &ReBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon }) std::cell::Cell<&'?2 &ReBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon }) u32>, &ReBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrAnon }) std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) u32>, &ReBound(DebruijnIndex(0), BoundRegion { var: 5, kind: BrAnon }) std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon }) u32>)), + for<Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((&'^0 std::cell::Cell<&'?1 &'^1 u32>, &'^2 std::cell::Cell<&'?2 &'^3 u32>, &'^4 std::cell::Cell<&'^1 u32>, &'^5 std::cell::Cell<&'^3 u32>)), (), ] = note: late-bound region is '?3 diff --git a/tests/ui/nll/closure-requirements/propagate-approximated-val.stderr b/tests/ui/nll/closure-requirements/propagate-approximated-val.stderr index 5566c76d854..4787577a6e1 100644 --- a/tests/ui/nll/closure-requirements/propagate-approximated-val.stderr +++ b/tests/ui/nll/closure-requirements/propagate-approximated-val.stderr @@ -6,7 +6,7 @@ LL | establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| { | = note: defining type: test::{closure#0} with closure args [ i16, - for<Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((std::cell::Cell<&'?1 &ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }) u32>, std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) &'?2 u32>, std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }) u32>, std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) u32>)), + for<Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((std::cell::Cell<&'?1 &'^0 u32>, std::cell::Cell<&'^1 &'?2 u32>, std::cell::Cell<&'^0 u32>, std::cell::Cell<&'^1 u32>)), (), ] = note: late-bound region is '?3 diff --git a/tests/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr b/tests/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr index 0dd53f81ae1..49c65d77ddd 100644 --- a/tests/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr +++ b/tests/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr @@ -6,7 +6,7 @@ LL | |_outlives1, _outlives2, x, y| { | = note: defining type: supply::{closure#0} with closure args [ i16, - for<Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((std::cell::Cell<&'?1 &ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }) u32>, std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) &'?2 u32>, std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }) u32>, std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) u32>)), + for<Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((std::cell::Cell<&'?1 &'^0 u32>, std::cell::Cell<&'^1 &'?2 u32>, std::cell::Cell<&'^0 u32>, std::cell::Cell<&'^1 u32>)), (), ] = note: late-bound region is '?3 diff --git a/tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr b/tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr index 64deaa00fa3..669b56a0be7 100644 --- a/tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr +++ b/tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr @@ -6,7 +6,7 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| { | = note: defining type: supply::{closure#0} with closure args [ i16, - for<Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((&ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }) std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) &'?1 u32>, &ReBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon }) std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon }) u32>, &ReBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrAnon }) std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) u32>)), + for<Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((&'^0 std::cell::Cell<&'^1 &'?1 u32>, &'^2 std::cell::Cell<&'^3 u32>, &'^4 std::cell::Cell<&'^1 u32>)), (), ] = note: late-bound region is '?2 diff --git a/tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr b/tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr index ee49b4dac22..75f476ac5f1 100644 --- a/tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr +++ b/tests/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr @@ -6,7 +6,7 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y | = note: defining type: supply::{closure#0} with closure args [ i16, - for<Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((&ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }) std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) &'?1 u32>, &ReBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrAnon }) std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon }) &'?2 u32>, &ReBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrAnon }) std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) u32>, &ReBound(DebruijnIndex(0), BoundRegion { var: 5, kind: BrAnon }) std::cell::Cell<&ReBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrAnon }) u32>)), + for<Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((&'^0 std::cell::Cell<&'^1 &'?1 u32>, &'^2 std::cell::Cell<&'^3 &'?2 u32>, &'^4 std::cell::Cell<&'^1 u32>, &'^5 std::cell::Cell<&'^3 u32>)), (), ] = note: late-bound region is '?3 diff --git a/tests/ui/nll/closure-requirements/return-wrong-bound-region.stderr b/tests/ui/nll/closure-requirements/return-wrong-bound-region.stderr index a13caf8c298..bc5c04a27a3 100644 --- a/tests/ui/nll/closure-requirements/return-wrong-bound-region.stderr +++ b/tests/ui/nll/closure-requirements/return-wrong-bound-region.stderr @@ -6,7 +6,7 @@ LL | expect_sig(|a, b| b); // ought to return `a` | = note: defining type: test::{closure#0} with closure args [ i16, - for<Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((&ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }) i32, &ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) i32)) -> &ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }) i32, + for<Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((&'^0 i32, &'^1 i32)) -> &'^0 i32, (), ] diff --git a/tests/ui/nll/issue-54189.rs b/tests/ui/nll/issue-54189.rs index 70aecc384ef..2339a722a7b 100644 --- a/tests/ui/nll/issue-54189.rs +++ b/tests/ui/nll/issue-54189.rs @@ -1,5 +1,6 @@ fn bug() -> impl for <'r> Fn() -> &'r () { || { &() } } //~^ ERROR binding for associated type `Output` references lifetime `'r` +//~| ERROR binding for associated type `Output` references lifetime `'r` fn main() { let f = bug(); diff --git a/tests/ui/nll/issue-54189.stderr b/tests/ui/nll/issue-54189.stderr index 14ed2bb222d..ce756a91f56 100644 --- a/tests/ui/nll/issue-54189.stderr +++ b/tests/ui/nll/issue-54189.stderr @@ -4,6 +4,14 @@ error[E0582]: binding for associated type `Output` references lifetime `'r`, whi LL | fn bug() -> impl for <'r> Fn() -> &'r () { || { &() } } | ^^^^^^ -error: aborting due to 1 previous error +error[E0582]: binding for associated type `Output` references lifetime `'r`, which does not appear in the trait input types + --> $DIR/issue-54189.rs:1:35 + | +LL | fn bug() -> impl for <'r> Fn() -> &'r () { || { &() } } + | ^^^^^^ + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0582`. diff --git a/tests/ui/nll/ty-outlives/impl-trait-captures.stderr b/tests/ui/nll/ty-outlives/impl-trait-captures.stderr index 693c5b8b0a3..3893cdf482e 100644 --- a/tests/ui/nll/ty-outlives/impl-trait-captures.stderr +++ b/tests/ui/nll/ty-outlives/impl-trait-captures.stderr @@ -1,4 +1,4 @@ -error[E0700]: hidden type for `Opaque(DefId(0:13 ~ impl_trait_captures[aeb9]::foo::{opaque#0}), [ReEarlyParam(DefId(0:9 ~ impl_trait_captures[aeb9]::foo::'a), 0, 'a), T, ReEarlyParam(DefId(0:9 ~ impl_trait_captures[aeb9]::foo::'a), 0, 'a)])` captures lifetime that does not appear in bounds +error[E0700]: hidden type for `Opaque(DefId(0:13 ~ impl_trait_captures[aeb9]::foo::{opaque#0}), [DefId(0:9 ~ impl_trait_captures[aeb9]::foo::'a)_'a/#0, T, DefId(0:9 ~ impl_trait_captures[aeb9]::foo::'a)_'a/#0])` captures lifetime that does not appear in bounds --> $DIR/impl-trait-captures.rs:11:5 | LL | fn foo<'a, T>(x: &T) -> impl Foo<'a> { @@ -8,7 +8,7 @@ LL | fn foo<'a, T>(x: &T) -> impl Foo<'a> { LL | x | ^ | -help: to declare that `Opaque(DefId(0:13 ~ impl_trait_captures[aeb9]::foo::{opaque#0}), [ReEarlyParam(DefId(0:9 ~ impl_trait_captures[aeb9]::foo::'a), 0, 'a), T, ReEarlyParam(DefId(0:14 ~ impl_trait_captures[aeb9]::foo::{opaque#0}::'a), 2, 'a)])` captures `ReLateParam(DefId(0:8 ~ impl_trait_captures[aeb9]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[aeb9]::foo::'_), '_))`, you can add an explicit `ReLateParam(DefId(0:8 ~ impl_trait_captures[aeb9]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[aeb9]::foo::'_), '_))` lifetime bound +help: to declare that `Opaque(DefId(0:13 ~ impl_trait_captures[aeb9]::foo::{opaque#0}), [DefId(0:9 ~ impl_trait_captures[aeb9]::foo::'a)_'a/#0, T, DefId(0:14 ~ impl_trait_captures[aeb9]::foo::{opaque#0}::'a)_'a/#2])` captures `ReLateParam(DefId(0:8 ~ impl_trait_captures[aeb9]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[aeb9]::foo::'_), '_))`, you can add an explicit `ReLateParam(DefId(0:8 ~ impl_trait_captures[aeb9]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[aeb9]::foo::'_), '_))` lifetime bound | LL | fn foo<'a, T>(x: &T) -> impl Foo<'a> + ReLateParam(DefId(0:8 ~ impl_trait_captures[aeb9]::foo), BrNamed(DefId(0:12 ~ impl_trait_captures[aeb9]::foo::'_), '_)) { | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/tests/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr b/tests/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr index acbcb9f0b70..e58764354c0 100644 --- a/tests/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr +++ b/tests/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr @@ -6,7 +6,7 @@ LL | twice(cell, value, |a, b| invoke(a, b)); | = note: defining type: generic::<T>::{closure#0} with closure args [ i16, - for<Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'?1 &ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }) ()>>, &ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) T)), + for<Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'?1 &'^0 ()>>, &'^1 T)), (), ] = note: number of external vids: 2 @@ -28,7 +28,7 @@ LL | twice(cell, value, |a, b| invoke(a, b)); | = note: defining type: generic_fail::<T>::{closure#0} with closure args [ i16, - for<Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'?1 &ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon }) ()>>, &ReBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon }) T)), + for<Region(BrAnon), Region(BrAnon)> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'?1 &'^0 ()>>, &'^1 T)), (), ] = note: late-bound region is '?2 diff --git a/tests/ui/nll/user-annotations/adt-nullary-enums.stderr b/tests/ui/nll/user-annotations/adt-nullary-enums.stderr index 5b385feeedc..644fc94f730 100644 --- a/tests/ui/nll/user-annotations/adt-nullary-enums.stderr +++ b/tests/ui/nll/user-annotations/adt-nullary-enums.stderr @@ -1,16 +1,17 @@ error[E0597]: `c` does not live long enough --> $DIR/adt-nullary-enums.rs:33:41 | -LL | let c = 66; - | - binding `c` declared here -LL | / combine( -LL | | SomeEnum::SomeVariant(Cell::new(&c)), - | | ^^ borrowed value does not live long enough -LL | | SomeEnum::SomeOtherVariant::<Cell<&'static u32>>, -LL | | ); - | |_____- argument requires that `c` is borrowed for `'static` -LL | } - | - `c` dropped here while still borrowed +LL | let c = 66; + | - binding `c` declared here +LL | combine( +LL | SomeEnum::SomeVariant(Cell::new(&c)), + | ----------^^- + | | | + | | borrowed value does not live long enough + | argument requires that `c` is borrowed for `'static` +... +LL | } + | - `c` dropped here while still borrowed error[E0597]: `c` does not live long enough --> $DIR/adt-nullary-enums.rs:41:41 diff --git a/tests/ui/nll/user-annotations/dump-adt-brace-struct.rs b/tests/ui/nll/user-annotations/dump-adt-brace-struct.rs index 9a6587a9a74..45f2b029d14 100644 --- a/tests/ui/nll/user-annotations/dump-adt-brace-struct.rs +++ b/tests/ui/nll/user-annotations/dump-adt-brace-struct.rs @@ -6,7 +6,9 @@ #![allow(warnings)] #![feature(rustc_attrs)] -struct SomeStruct<T> { t: T } +struct SomeStruct<T> { + t: T, +} #[rustc_dump_user_args] fn main() { @@ -16,5 +18,5 @@ fn main() { SomeStruct::<u32> { t: 22 }; // No lifetime bounds given. - SomeStruct::<&'static u32> { t: &22 }; //~ ERROR [&ReStatic u32] + SomeStruct::<&'static u32> { t: &22 }; //~ ERROR [&'static u32] } diff --git a/tests/ui/nll/user-annotations/dump-adt-brace-struct.stderr b/tests/ui/nll/user-annotations/dump-adt-brace-struct.stderr index 0cabc02c6b5..edf82593cee 100644 --- a/tests/ui/nll/user-annotations/dump-adt-brace-struct.stderr +++ b/tests/ui/nll/user-annotations/dump-adt-brace-struct.stderr @@ -1,5 +1,5 @@ -error: user args: UserArgs { args: [&ReStatic u32], user_self_ty: None } - --> $DIR/dump-adt-brace-struct.rs:19:5 +error: user args: UserArgs { args: [&'static u32], user_self_ty: None } + --> $DIR/dump-adt-brace-struct.rs:21:5 | LL | SomeStruct::<&'static u32> { t: &22 }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/nll/user-annotations/dump-fn-method.rs b/tests/ui/nll/user-annotations/dump-fn-method.rs index 40e705ac538..26714b6ffe3 100644 --- a/tests/ui/nll/user-annotations/dump-fn-method.rs +++ b/tests/ui/nll/user-annotations/dump-fn-method.rs @@ -7,13 +7,12 @@ // Note: we reference the names T and U in the comments below. trait Bazoom<T> { - fn method<U>(&self, arg: T, arg2: U) { } + fn method<U>(&self, arg: T, arg2: U) {} } -impl<S, T> Bazoom<T> for S { -} +impl<S, T> Bazoom<T> for S {} -fn foo<'a, T>(_: T) { } +fn foo<'a, T>(_: T) {} #[rustc_dump_user_args] fn main() { @@ -26,7 +25,7 @@ fn main() { let x = foo::<u32>; x(22); - let x = foo::<&'static u32>; //~ ERROR [&ReStatic u32] + let x = foo::<&'static u32>; //~ ERROR [&'static u32] x(&22); // Here: we only want the `T` to be given, the rest should be variables. @@ -41,7 +40,7 @@ fn main() { x(&22, 44, 66); // Here: all are given and we have a lifetime. - let x = <u8 as Bazoom<&'static u16>>::method::<u32>; //~ ERROR [u8, &ReStatic u16, u32] + let x = <u8 as Bazoom<&'static u16>>::method::<u32>; //~ ERROR [u8, &'static u16, u32] x(&22, &44, 66); // Here: we want in particular that *only* the method `U` diff --git a/tests/ui/nll/user-annotations/dump-fn-method.stderr b/tests/ui/nll/user-annotations/dump-fn-method.stderr index 1daf4982511..8e847b464e1 100644 --- a/tests/ui/nll/user-annotations/dump-fn-method.stderr +++ b/tests/ui/nll/user-annotations/dump-fn-method.stderr @@ -1,23 +1,23 @@ -error: user args: UserArgs { args: [&ReStatic u32], user_self_ty: None } - --> $DIR/dump-fn-method.rs:29:13 +error: user args: UserArgs { args: [&'static u32], user_self_ty: None } + --> $DIR/dump-fn-method.rs:28:13 | LL | let x = foo::<&'static u32>; | ^^^^^^^^^^^^^^^^^^^ error: user args: UserArgs { args: [^0, u32, ^1], user_self_ty: None } - --> $DIR/dump-fn-method.rs:35:13 + --> $DIR/dump-fn-method.rs:34:13 | LL | let x = <_ as Bazoom<u32>>::method::<_>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: user args: UserArgs { args: [u8, &ReStatic u16, u32], user_self_ty: None } - --> $DIR/dump-fn-method.rs:44:13 +error: user args: UserArgs { args: [u8, &'static u16, u32], user_self_ty: None } + --> $DIR/dump-fn-method.rs:43:13 | LL | let x = <u8 as Bazoom<&'static u16>>::method::<u32>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: user args: UserArgs { args: [^0, ^1, u32], user_self_ty: None } - --> $DIR/dump-fn-method.rs:52:5 + --> $DIR/dump-fn-method.rs:51:5 | LL | y.method::<u32>(44, 66); | ^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/nll/user-annotations/region-error-ice-109072.rs b/tests/ui/nll/user-annotations/region-error-ice-109072.rs index 3f2ad3ccbf5..bcdc6651cf5 100644 --- a/tests/ui/nll/user-annotations/region-error-ice-109072.rs +++ b/tests/ui/nll/user-annotations/region-error-ice-109072.rs @@ -11,4 +11,5 @@ impl Lt<'missing> for () { //~ ERROR undeclared lifetime fn main() { let _: <() as Lt<'_>>::T = &(); + //~^ ERROR the trait bound `(): Lt<'_>` is not satisfied } diff --git a/tests/ui/nll/user-annotations/region-error-ice-109072.stderr b/tests/ui/nll/user-annotations/region-error-ice-109072.stderr index d90971bed25..c187c17d98c 100644 --- a/tests/ui/nll/user-annotations/region-error-ice-109072.stderr +++ b/tests/ui/nll/user-annotations/region-error-ice-109072.stderr @@ -21,6 +21,13 @@ help: consider introducing lifetime `'missing` here LL | impl<'missing> Lt<'missing> for () { | ++++++++++ -error: aborting due to 2 previous errors +error[E0277]: the trait bound `(): Lt<'_>` is not satisfied + --> $DIR/region-error-ice-109072.rs:13:13 + | +LL | let _: <() as Lt<'_>>::T = &(); + | ^^ the trait `Lt<'_>` is not implemented for `()` + +error: aborting due to 3 previous errors -For more information about this error, try `rustc --explain E0261`. +Some errors have detailed explanations: E0261, E0277. +For more information about an error, try `rustc --explain E0261`. diff --git a/tests/ui/object-lifetime/object-lifetime-default-dyn-binding-nonstatic3.rs b/tests/ui/object-lifetime/object-lifetime-default-dyn-binding-nonstatic3.rs index 345c8a25f79..51be999a632 100644 --- a/tests/ui/object-lifetime/object-lifetime-default-dyn-binding-nonstatic3.rs +++ b/tests/ui/object-lifetime/object-lifetime-default-dyn-binding-nonstatic3.rs @@ -15,7 +15,6 @@ fn is_static<T>(_: T) where T: 'static { } // code forces us into a conservative, hacky path. fn bar(x: &str) -> &dyn Foo<Item = dyn Bar> { &() } //~^ ERROR please supply an explicit bound -//~| ERROR `(): Foo<'_>` is not satisfied fn main() { let s = format!("foo"); diff --git a/tests/ui/object-lifetime/object-lifetime-default-dyn-binding-nonstatic3.stderr b/tests/ui/object-lifetime/object-lifetime-default-dyn-binding-nonstatic3.stderr index d227c8778fe..688f8af0822 100644 --- a/tests/ui/object-lifetime/object-lifetime-default-dyn-binding-nonstatic3.stderr +++ b/tests/ui/object-lifetime/object-lifetime-default-dyn-binding-nonstatic3.stderr @@ -4,20 +4,6 @@ error[E0228]: the lifetime bound for this object type cannot be deduced from con LL | fn bar(x: &str) -> &dyn Foo<Item = dyn Bar> { &() } | ^^^^^^^ -error[E0277]: the trait bound `(): Foo<'_>` is not satisfied - --> $DIR/object-lifetime-default-dyn-binding-nonstatic3.rs:16:47 - | -LL | fn bar(x: &str) -> &dyn Foo<Item = dyn Bar> { &() } - | ^^^ the trait `Foo<'_>` is not implemented for `()` - | -help: this trait has no implementations, consider adding one - --> $DIR/object-lifetime-default-dyn-binding-nonstatic3.rs:4:1 - | -LL | trait Foo<'a> { - | ^^^^^^^^^^^^^ - = note: required for the cast from `&()` to `&dyn Foo<'_, Item = dyn Bar>` - -error: aborting due to 2 previous errors +error: aborting due to 1 previous error -Some errors have detailed explanations: E0228, E0277. -For more information about an error, try `rustc --explain E0228`. +For more information about this error, try `rustc --explain E0228`. diff --git a/tests/ui/offset-of/offset-of-tuple.stderr b/tests/ui/offset-of/offset-of-tuple.stderr index e9aa495becd..1e2d9240267 100644 --- a/tests/ui/offset-of/offset-of-tuple.stderr +++ b/tests/ui/offset-of/offset-of-tuple.stderr @@ -202,7 +202,6 @@ LL | offset_of!(((u8, u16), (u32, u16, u8)), 0.2); | | in this macro invocation LL | | offset_of!(((u8, u16), (u32, u16, u8)), 1.2); LL | | offset_of!(((u8, u16), (u32, u16, u8)), 1.2.0); -LL | | ... | | = note: this error originates in the macro `offset_of` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/parser/attribute/attr-bad-meta-4.rs b/tests/ui/parser/attribute/attr-bad-meta-4.rs new file mode 100644 index 00000000000..cedbd1d6686 --- /dev/null +++ b/tests/ui/parser/attribute/attr-bad-meta-4.rs @@ -0,0 +1,12 @@ +macro_rules! mac { + ($attr_item: meta) => { + #[cfg($attr_item)] + //~^ ERROR expected unsuffixed literal or identifier, found `an(arbitrary token stream)` + //~| ERROR expected unsuffixed literal or identifier, found `an(arbitrary token stream)` + struct S; + } +} + +mac!(an(arbitrary token stream)); + +fn main() {} diff --git a/tests/ui/parser/attribute/attr-bad-meta-4.stderr b/tests/ui/parser/attribute/attr-bad-meta-4.stderr new file mode 100644 index 00000000000..a543bcb692e --- /dev/null +++ b/tests/ui/parser/attribute/attr-bad-meta-4.stderr @@ -0,0 +1,25 @@ +error: expected unsuffixed literal or identifier, found `an(arbitrary token stream)` + --> $DIR/attr-bad-meta-4.rs:3:15 + | +LL | #[cfg($attr_item)] + | ^^^^^^^^^^ +... +LL | mac!(an(arbitrary token stream)); + | -------------------------------- in this macro invocation + | + = note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: expected unsuffixed literal or identifier, found `an(arbitrary token stream)` + --> $DIR/attr-bad-meta-4.rs:3:15 + | +LL | #[cfg($attr_item)] + | ^^^^^^^^^^ +... +LL | mac!(an(arbitrary token stream)); + | -------------------------------- in this macro invocation + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + = note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: aborting due to 2 previous errors + diff --git a/tests/ui/parser/constraints-before-generic-args-syntactic-pass.rs b/tests/ui/parser/constraints-before-generic-args-syntactic-pass.rs index 6566d8a1115..ed3ffed2f80 100644 --- a/tests/ui/parser/constraints-before-generic-args-syntactic-pass.rs +++ b/tests/ui/parser/constraints-before-generic-args-syntactic-pass.rs @@ -3,11 +3,7 @@ #[cfg(FALSE)] fn syntax() { foo::<T = u8, T: Ord, String>(); - //~^ WARN associated type bounds are unstable - //~| WARN unstable syntax foo::<T = u8, 'a, T: Ord>(); - //~^ WARN associated type bounds are unstable - //~| WARN unstable syntax } fn main() {} diff --git a/tests/ui/parser/constraints-before-generic-args-syntactic-pass.stderr b/tests/ui/parser/constraints-before-generic-args-syntactic-pass.stderr deleted file mode 100644 index 393ed704b41..00000000000 --- a/tests/ui/parser/constraints-before-generic-args-syntactic-pass.stderr +++ /dev/null @@ -1,26 +0,0 @@ -warning: associated type bounds are unstable - --> $DIR/constraints-before-generic-args-syntactic-pass.rs:5:19 - | -LL | foo::<T = u8, T: Ord, String>(); - | ^^^^^^ - | - = note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information - = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - = warning: unstable syntax can change at any point in the future, causing a hard error! - = note: for more information, see issue #65860 <https://github.com/rust-lang/rust/issues/65860> - -warning: associated type bounds are unstable - --> $DIR/constraints-before-generic-args-syntactic-pass.rs:8:23 - | -LL | foo::<T = u8, 'a, T: Ord>(); - | ^^^^^^ - | - = note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information - = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - = warning: unstable syntax can change at any point in the future, causing a hard error! - = note: for more information, see issue #65860 <https://github.com/rust-lang/rust/issues/65860> - -warning: 2 warnings emitted - diff --git a/tests/ui/parser/f16-f128.rs b/tests/ui/parser/f16-f128.rs deleted file mode 100644 index 4f31dccce3c..00000000000 --- a/tests/ui/parser/f16-f128.rs +++ /dev/null @@ -1,37 +0,0 @@ -// Make sure we don't ICE while incrementally adding f16 and f128 support - -mod f16_checks { - const A: f16 = 10.0; //~ ERROR cannot find type `f16` in this scope - - pub fn main() { - let a: f16 = 100.0; //~ ERROR cannot find type `f16` in this scope - let b = 0.0f16; //~ ERROR invalid width `16` for float literal - - foo(1.23); - } - - fn foo(a: f16) {} //~ ERROR cannot find type `f16` in this scope - - struct Bar { - a: f16, //~ ERROR cannot find type `f16` in this scope - } -} - -mod f128_checks { - const A: f128 = 10.0; //~ ERROR cannot find type `f128` in this scope - - pub fn main() { - let a: f128 = 100.0; //~ ERROR cannot find type `f128` in this scope - let b = 0.0f128; //~ ERROR invalid width `128` for float literal - - foo(1.23); - } - - fn foo(a: f128) {} //~ ERROR cannot find type `f128` in this scope - - struct Bar { - a: f128, //~ ERROR cannot find type `f128` in this scope - } -} - -fn main() {} diff --git a/tests/ui/parser/f16-f128.stderr b/tests/ui/parser/f16-f128.stderr deleted file mode 100644 index d3f2227acd7..00000000000 --- a/tests/ui/parser/f16-f128.stderr +++ /dev/null @@ -1,67 +0,0 @@ -error[E0412]: cannot find type `f16` in this scope - --> $DIR/f16-f128.rs:4:14 - | -LL | const A: f16 = 10.0; - | ^^^ help: a builtin type with a similar name exists: `i16` - -error[E0412]: cannot find type `f16` in this scope - --> $DIR/f16-f128.rs:7:16 - | -LL | let a: f16 = 100.0; - | ^^^ help: a builtin type with a similar name exists: `i16` - -error[E0412]: cannot find type `f16` in this scope - --> $DIR/f16-f128.rs:13:15 - | -LL | fn foo(a: f16) {} - | ^^^ help: a builtin type with a similar name exists: `i16` - -error[E0412]: cannot find type `f16` in this scope - --> $DIR/f16-f128.rs:16:12 - | -LL | a: f16, - | ^^^ help: a builtin type with a similar name exists: `i16` - -error[E0412]: cannot find type `f128` in this scope - --> $DIR/f16-f128.rs:21:14 - | -LL | const A: f128 = 10.0; - | ^^^^ help: a builtin type with a similar name exists: `i128` - -error[E0412]: cannot find type `f128` in this scope - --> $DIR/f16-f128.rs:24:16 - | -LL | let a: f128 = 100.0; - | ^^^^ help: a builtin type with a similar name exists: `i128` - -error[E0412]: cannot find type `f128` in this scope - --> $DIR/f16-f128.rs:30:15 - | -LL | fn foo(a: f128) {} - | ^^^^ help: a builtin type with a similar name exists: `i128` - -error[E0412]: cannot find type `f128` in this scope - --> $DIR/f16-f128.rs:33:12 - | -LL | a: f128, - | ^^^^ help: a builtin type with a similar name exists: `i128` - -error: invalid width `16` for float literal - --> $DIR/f16-f128.rs:8:17 - | -LL | let b = 0.0f16; - | ^^^^^^ - | - = help: valid widths are 32 and 64 - -error: invalid width `128` for float literal - --> $DIR/f16-f128.rs:25:17 - | -LL | let b = 0.0f128; - | ^^^^^^^ - | - = help: valid widths are 32 and 64 - -error: aborting due to 10 previous errors - -For more information about this error, try `rustc --explain E0412`. diff --git a/tests/ui/parser/impl-item-type-no-body-semantic-fail.stderr b/tests/ui/parser/impl-item-type-no-body-semantic-fail.stderr index 29b0b25a564..9800420072b 100644 --- a/tests/ui/parser/impl-item-type-no-body-semantic-fail.stderr +++ b/tests/ui/parser/impl-item-type-no-body-semantic-fail.stderr @@ -89,12 +89,15 @@ LL | type W: Ord where Self: Eq; | ^^^^^^^^ the trait `Eq` is not implemented for `X` | = help: see issue #48214 - = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable help: consider annotating `X` with `#[derive(Eq)]` | LL + #[derive(Eq)] LL | struct X; | +help: add `#![feature(trivial_bounds)]` to the crate attributes to enable + | +LL + #![feature(trivial_bounds)] + | error[E0277]: the trait bound `X: Eq` is not satisfied --> $DIR/impl-item-type-no-body-semantic-fail.rs:18:18 @@ -103,12 +106,15 @@ LL | type W where Self: Eq; | ^^^^^^^^ the trait `Eq` is not implemented for `X` | = help: see issue #48214 - = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable help: consider annotating `X` with `#[derive(Eq)]` | LL + #[derive(Eq)] LL | struct X; | +help: add `#![feature(trivial_bounds)]` to the crate attributes to enable + | +LL + #![feature(trivial_bounds)] + | error[E0592]: duplicate definitions with name `W` --> $DIR/impl-item-type-no-body-semantic-fail.rs:18:5 diff --git a/tests/ui/parser/issues/issue-35813-postfix-after-cast.stderr b/tests/ui/parser/issues/issue-35813-postfix-after-cast.stderr index 6a8cbd9389b..7b896ce1426 100644 --- a/tests/ui/parser/issues/issue-35813-postfix-after-cast.stderr +++ b/tests/ui/parser/issues/issue-35813-postfix-after-cast.stderr @@ -352,8 +352,11 @@ LL | static bar: &[i32] = &(&[1,2,3] as &[i32][0..1]); | ^^^^^^ | = note: calls in statics are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable = note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell +help: add `#![feature(const_trait_impl)]` to the crate attributes to enable + | +LL + #![feature(const_trait_impl)] + | error: aborting due to 40 previous errors diff --git a/tests/ui/parser/survive-peano-lesson-queue.rs b/tests/ui/parser/survive-peano-lesson-queue.rs new file mode 100644 index 00000000000..3608728594e --- /dev/null +++ b/tests/ui/parser/survive-peano-lesson-queue.rs @@ -0,0 +1,4907 @@ +//@ build-pass +// ignore-tidy-filelength +// ignore-tidy-linelength +// some very lightly modified generated code from issue rust-lang/rust#122715 +// the main differences are to strip the dependency on bumpalo so it can be tested separately +// the original purpose of this code was to implement a binomial queue, however it is extracted from Gallina +// which means that it uses an incredibly naive Peano representation of the natural numbers. +// this is fairly standard "someone did something very silly and we should try to gracefully handle it" + +#![allow(dead_code)] +#![allow(non_camel_case_types)] +#![allow(unused_imports)] +#![allow(non_snake_case)] +#![allow(unused_variables)] + +use std::marker::PhantomData; + +fn __nat_succ(x: u64) -> u64 { + x.checked_add(1).unwrap() +} + +macro_rules! __nat_elim { + ($zcase:expr, $pred:ident, $scase:expr, $val:expr) => { + { let v = $val; + if v == 0 { $zcase } else { let $pred = v - 1; $scase } } + } +} + +macro_rules! __andb { ($b1:expr, $b2:expr) => { $b1 && $b2 } } +macro_rules! __orb { ($b1:expr, $b2:expr) => { $b1 || $b2 } } + +fn __pos_onebit(x: u64) -> u64 { + x.checked_mul(2).unwrap() + 1 +} + +fn __pos_zerobit(x: u64) -> u64 { + x.checked_mul(2).unwrap() +} + +macro_rules! __pos_elim { + ($p:ident, $onebcase:expr, $p2:ident, $zerobcase:expr, $onecase:expr, $val:expr) => { + { + let n = $val; + if n == 1 { + $onecase + } else if (n & 1) == 0 { + let $p2 = n >> 1; + $zerobcase + } else { + let $p = n >> 1; + $onebcase + } + } + } +} + +fn __Z_frompos(z: u64) -> i64 { + use std::convert::TryFrom; + + i64::try_from(z).unwrap() +} + +fn __Z_fromneg(z : u64) -> i64 { + use std::convert::TryFrom; + + i64::try_from(z).unwrap().checked_neg().unwrap() +} + +macro_rules! __Z_elim { + ($zero_case:expr, $p:ident, $pos_case:expr, $p2:ident, $neg_case:expr, $val:expr) => { + { + let n = $val; + if n == 0 { + $zero_case + } else if n < 0 { + let $p2 = n.unsigned_abs(); + $neg_case + } else { + let $p = n as u64; + $pos_case + } + } + } +} + +fn __N_frompos(z: u64) -> u64 { + z +} + +macro_rules! __N_elim { + ($zero_case:expr, $p:ident, $pos_case:expr, $val:expr) => { + { let $p = $val; if $p == 0 { $zero_case } else { $pos_case } } + } +} + +type __pair<A, B> = (A, B); + +macro_rules! __pair_elim { + ($fst:ident, $snd:ident, $body:expr, $p:expr) => { + { let ($fst, $snd) = $p; $body } + } +} + +fn __mk_pair<A: Copy, B: Copy>(a: A, b: B) -> __pair<A, B> { (a, b) } + +fn hint_app<TArg, TRet>(f: &dyn Fn(TArg) -> TRet) -> &dyn Fn(TArg) -> TRet { + f +} + +#[derive(Debug, Clone)] +pub enum Coq_Init_Datatypes_list<'a, A> { + nil(PhantomData<&'a A>), + cons(PhantomData<&'a A>, A, &'a Coq_Init_Datatypes_list<'a, A>) +} + +type CertiCoq_Benchmarks_lib_Binom_key<'a> = u64; + +#[derive(Debug, Clone)] +pub enum CertiCoq_Benchmarks_lib_Binom_tree<'a> { + Node(PhantomData<&'a ()>, CertiCoq_Benchmarks_lib_Binom_key<'a>, &'a CertiCoq_Benchmarks_lib_Binom_tree<'a>, &'a CertiCoq_Benchmarks_lib_Binom_tree<'a>), + Leaf(PhantomData<&'a ()>) +} + +type CertiCoq_Benchmarks_lib_Binom_priqueue<'a> = &'a Coq_Init_Datatypes_list<'a, &'a CertiCoq_Benchmarks_lib_Binom_tree<'a>>; + +struct Program { +} + +impl<'a> Program { +fn new() -> Self { + Program { + } +} + +fn alloc<T>(&'a self, t: T) -> &'a T { + let _alloc = Box::new(t); + Box::leak(_alloc) +} + +fn closure<TArg, TRet>(&'a self, f: impl Fn(TArg) -> TRet + 'a) -> &'a dyn Fn(TArg) -> TRet { + let _alloc = Box::new(f); + Box::leak(_alloc) +} + +fn Coq_Init_Nat_leb(&'a self, n: u64, m: u64) -> bool { + __nat_elim!( + { + true + }, + n2, { + __nat_elim!( + { + false + }, + m2, { + self.Coq_Init_Nat_leb( + n2, + m2) + }, + m) + }, + n) +} +fn Coq_Init_Nat_leb__curried(&'a self) -> &'a dyn Fn(u64) -> &'a dyn Fn(u64) -> bool { + self.closure(move |n| { + self.closure(move |m| { + self.Coq_Init_Nat_leb( + n, + m) + }) + }) +} + +fn Coq_Init_Nat_ltb(&'a self, n: u64, m: u64) -> bool { + self.Coq_Init_Nat_leb( + __nat_succ( + n), + m) +} +fn Coq_Init_Nat_ltb__curried(&'a self) -> &'a dyn Fn(u64) -> &'a dyn Fn(u64) -> bool { + self.closure(move |n| { + self.closure(move |m| { + self.Coq_Init_Nat_ltb( + n, + m) + }) + }) +} + +fn CertiCoq_Benchmarks_lib_Binom_smash(&'a self, t: &'a CertiCoq_Benchmarks_lib_Binom_tree<'a>, u: &'a CertiCoq_Benchmarks_lib_Binom_tree<'a>) -> &'a CertiCoq_Benchmarks_lib_Binom_tree<'a> { + match t { + &CertiCoq_Benchmarks_lib_Binom_tree::Node(_, x, t1, t0) => { + match t0 { + &CertiCoq_Benchmarks_lib_Binom_tree::Node(_, k, t2, t3) => { + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Leaf( + PhantomData)) + }, + &CertiCoq_Benchmarks_lib_Binom_tree::Leaf(_) => { + match u { + &CertiCoq_Benchmarks_lib_Binom_tree::Node(_, y, u1, t2) => { + match t2 { + &CertiCoq_Benchmarks_lib_Binom_tree::Node(_, k, t3, t4) => { + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Leaf( + PhantomData)) + }, + &CertiCoq_Benchmarks_lib_Binom_tree::Leaf(_) => { + match self.Coq_Init_Nat_ltb( + y, + x) { + true => { + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Node( + PhantomData, + x, + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Node( + PhantomData, + y, + u1, + t1)), + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Leaf( + PhantomData)))) + }, + false => { + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Node( + PhantomData, + y, + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Node( + PhantomData, + x, + t1, + u1)), + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Leaf( + PhantomData)))) + }, + } + }, + } + }, + &CertiCoq_Benchmarks_lib_Binom_tree::Leaf(_) => { + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Leaf( + PhantomData)) + }, + } + }, + } + }, + &CertiCoq_Benchmarks_lib_Binom_tree::Leaf(_) => { + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Leaf( + PhantomData)) + }, + } +} +fn CertiCoq_Benchmarks_lib_Binom_smash__curried(&'a self) -> &'a dyn Fn(&'a CertiCoq_Benchmarks_lib_Binom_tree<'a>) -> &'a dyn Fn(&'a CertiCoq_Benchmarks_lib_Binom_tree<'a>) -> &'a CertiCoq_Benchmarks_lib_Binom_tree<'a> { + self.closure(move |t| { + self.closure(move |u| { + self.CertiCoq_Benchmarks_lib_Binom_smash( + t, + u) + }) + }) +} + +fn CertiCoq_Benchmarks_lib_Binom_carry(&'a self, q: &'a Coq_Init_Datatypes_list<'a, &'a CertiCoq_Benchmarks_lib_Binom_tree<'a>>, t: &'a CertiCoq_Benchmarks_lib_Binom_tree<'a>) -> &'a Coq_Init_Datatypes_list<'a, &'a CertiCoq_Benchmarks_lib_Binom_tree<'a>> { + match q { + &Coq_Init_Datatypes_list::nil(_) => { + match t { + &CertiCoq_Benchmarks_lib_Binom_tree::Node(_, k, t0, t1) => { + self.alloc( + Coq_Init_Datatypes_list::cons( + PhantomData, + t, + self.alloc( + Coq_Init_Datatypes_list::nil( + PhantomData)))) + }, + &CertiCoq_Benchmarks_lib_Binom_tree::Leaf(_) => { + self.alloc( + Coq_Init_Datatypes_list::nil( + PhantomData)) + }, + } + }, + &Coq_Init_Datatypes_list::cons(_, u, q2) => { + match u { + &CertiCoq_Benchmarks_lib_Binom_tree::Node(_, k, t0, t1) => { + match t { + &CertiCoq_Benchmarks_lib_Binom_tree::Node(_, k0, t2, t3) => { + self.alloc( + Coq_Init_Datatypes_list::cons( + PhantomData, + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Leaf( + PhantomData)), + self.CertiCoq_Benchmarks_lib_Binom_carry( + q2, + self.CertiCoq_Benchmarks_lib_Binom_smash( + t, + u)))) + }, + &CertiCoq_Benchmarks_lib_Binom_tree::Leaf(_) => { + self.alloc( + Coq_Init_Datatypes_list::cons( + PhantomData, + u, + q2)) + }, + } + }, + &CertiCoq_Benchmarks_lib_Binom_tree::Leaf(_) => { + self.alloc( + Coq_Init_Datatypes_list::cons( + PhantomData, + t, + q2)) + }, + } + }, + } +} +fn CertiCoq_Benchmarks_lib_Binom_carry__curried(&'a self) -> &'a dyn Fn(&'a Coq_Init_Datatypes_list<'a, &'a CertiCoq_Benchmarks_lib_Binom_tree<'a>>) -> &'a dyn Fn(&'a CertiCoq_Benchmarks_lib_Binom_tree<'a>) -> &'a Coq_Init_Datatypes_list<'a, &'a CertiCoq_Benchmarks_lib_Binom_tree<'a>> { + self.closure(move |q| { + self.closure(move |t| { + self.CertiCoq_Benchmarks_lib_Binom_carry( + q, + t) + }) + }) +} + +fn CertiCoq_Benchmarks_lib_Binom_insert(&'a self, x: CertiCoq_Benchmarks_lib_Binom_key<'a>, q: CertiCoq_Benchmarks_lib_Binom_priqueue<'a>) -> CertiCoq_Benchmarks_lib_Binom_priqueue<'a> { + self.CertiCoq_Benchmarks_lib_Binom_carry( + q, + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Node( + PhantomData, + x, + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Leaf( + PhantomData)), + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Leaf( + PhantomData))))) +} +fn CertiCoq_Benchmarks_lib_Binom_insert__curried(&'a self) -> &'a dyn Fn(CertiCoq_Benchmarks_lib_Binom_key<'a>) -> &'a dyn Fn(CertiCoq_Benchmarks_lib_Binom_priqueue<'a>) -> CertiCoq_Benchmarks_lib_Binom_priqueue<'a> { + self.closure(move |x| { + self.closure(move |q| { + self.CertiCoq_Benchmarks_lib_Binom_insert( + x, + q) + }) + }) +} + +fn CertiCoq_Benchmarks_lib_Binom_insert_list(&'a self, l: &'a Coq_Init_Datatypes_list<'a, u64>, q: CertiCoq_Benchmarks_lib_Binom_priqueue<'a>) -> CertiCoq_Benchmarks_lib_Binom_priqueue<'a> { + match l { + &Coq_Init_Datatypes_list::nil(_) => { + q + }, + &Coq_Init_Datatypes_list::cons(_, x, l2) => { + self.CertiCoq_Benchmarks_lib_Binom_insert_list( + l2, + self.CertiCoq_Benchmarks_lib_Binom_insert( + x, + q)) + }, + } +} +fn CertiCoq_Benchmarks_lib_Binom_insert_list__curried(&'a self) -> &'a dyn Fn(&'a Coq_Init_Datatypes_list<'a, u64>) -> &'a dyn Fn(CertiCoq_Benchmarks_lib_Binom_priqueue<'a>) -> CertiCoq_Benchmarks_lib_Binom_priqueue<'a> { + self.closure(move |l| { + self.closure(move |q| { + self.CertiCoq_Benchmarks_lib_Binom_insert_list( + l, + q) + }) + }) +} + +fn CertiCoq_Benchmarks_lib_Binom_make_list(&'a self, n: u64, l: &'a Coq_Init_Datatypes_list<'a, u64>) -> &'a Coq_Init_Datatypes_list<'a, u64> { + __nat_elim!( + { + self.alloc( + Coq_Init_Datatypes_list::cons( + PhantomData, + 0, + l)) + }, + n0, { + __nat_elim!( + { + self.alloc( + Coq_Init_Datatypes_list::cons( + PhantomData, + __nat_succ( + 0), + l)) + }, + n2, { + self.CertiCoq_Benchmarks_lib_Binom_make_list( + n2, + self.alloc( + Coq_Init_Datatypes_list::cons( + PhantomData, + __nat_succ( + __nat_succ( + n2)), + l))) + }, + n0) + }, + n) +} +fn CertiCoq_Benchmarks_lib_Binom_make_list__curried(&'a self) -> &'a dyn Fn(u64) -> &'a dyn Fn(&'a Coq_Init_Datatypes_list<'a, u64>) -> &'a Coq_Init_Datatypes_list<'a, u64> { + self.closure(move |n| { + self.closure(move |l| { + self.CertiCoq_Benchmarks_lib_Binom_make_list( + n, + l) + }) + }) +} + +fn CertiCoq_Benchmarks_lib_Binom_empty(&'a self) -> CertiCoq_Benchmarks_lib_Binom_priqueue<'a> { + self.alloc( + Coq_Init_Datatypes_list::nil( + PhantomData)) +} + +fn CertiCoq_Benchmarks_lib_Binom_join(&'a self, p: CertiCoq_Benchmarks_lib_Binom_priqueue<'a>, q: CertiCoq_Benchmarks_lib_Binom_priqueue<'a>, c: &'a CertiCoq_Benchmarks_lib_Binom_tree<'a>) -> CertiCoq_Benchmarks_lib_Binom_priqueue<'a> { + match p { + &Coq_Init_Datatypes_list::nil(_) => { + self.CertiCoq_Benchmarks_lib_Binom_carry( + q, + c) + }, + &Coq_Init_Datatypes_list::cons(_, p1, p2) => { + match p1 { + &CertiCoq_Benchmarks_lib_Binom_tree::Node(_, k, t, t0) => { + match q { + &Coq_Init_Datatypes_list::nil(_) => { + self.CertiCoq_Benchmarks_lib_Binom_carry( + p, + c) + }, + &Coq_Init_Datatypes_list::cons(_, q1, q2) => { + match q1 { + &CertiCoq_Benchmarks_lib_Binom_tree::Node(_, k0, t1, t2) => { + self.alloc( + Coq_Init_Datatypes_list::cons( + PhantomData, + c, + self.CertiCoq_Benchmarks_lib_Binom_join( + p2, + q2, + self.CertiCoq_Benchmarks_lib_Binom_smash( + p1, + q1)))) + }, + &CertiCoq_Benchmarks_lib_Binom_tree::Leaf(_) => { + match c { + &CertiCoq_Benchmarks_lib_Binom_tree::Node(_, k0, t1, t2) => { + self.alloc( + Coq_Init_Datatypes_list::cons( + PhantomData, + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Leaf( + PhantomData)), + self.CertiCoq_Benchmarks_lib_Binom_join( + p2, + q2, + self.CertiCoq_Benchmarks_lib_Binom_smash( + c, + p1)))) + }, + &CertiCoq_Benchmarks_lib_Binom_tree::Leaf(_) => { + self.alloc( + Coq_Init_Datatypes_list::cons( + PhantomData, + p1, + self.CertiCoq_Benchmarks_lib_Binom_join( + p2, + q2, + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Leaf( + PhantomData))))) + }, + } + }, + } + }, + } + }, + &CertiCoq_Benchmarks_lib_Binom_tree::Leaf(_) => { + match q { + &Coq_Init_Datatypes_list::nil(_) => { + self.CertiCoq_Benchmarks_lib_Binom_carry( + p, + c) + }, + &Coq_Init_Datatypes_list::cons(_, q1, q2) => { + match q1 { + &CertiCoq_Benchmarks_lib_Binom_tree::Node(_, k, t, t0) => { + match c { + &CertiCoq_Benchmarks_lib_Binom_tree::Node(_, k0, t1, t2) => { + self.alloc( + Coq_Init_Datatypes_list::cons( + PhantomData, + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Leaf( + PhantomData)), + self.CertiCoq_Benchmarks_lib_Binom_join( + p2, + q2, + self.CertiCoq_Benchmarks_lib_Binom_smash( + c, + q1)))) + }, + &CertiCoq_Benchmarks_lib_Binom_tree::Leaf(_) => { + self.alloc( + Coq_Init_Datatypes_list::cons( + PhantomData, + q1, + self.CertiCoq_Benchmarks_lib_Binom_join( + p2, + q2, + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Leaf( + PhantomData))))) + }, + } + }, + &CertiCoq_Benchmarks_lib_Binom_tree::Leaf(_) => { + self.alloc( + Coq_Init_Datatypes_list::cons( + PhantomData, + c, + self.CertiCoq_Benchmarks_lib_Binom_join( + p2, + q2, + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Leaf( + PhantomData))))) + }, + } + }, + } + }, + } + }, + } +} +fn CertiCoq_Benchmarks_lib_Binom_join__curried(&'a self) -> &'a dyn Fn(CertiCoq_Benchmarks_lib_Binom_priqueue<'a>) -> &'a dyn Fn(CertiCoq_Benchmarks_lib_Binom_priqueue<'a>) -> &'a dyn Fn(&'a CertiCoq_Benchmarks_lib_Binom_tree<'a>) -> CertiCoq_Benchmarks_lib_Binom_priqueue<'a> { + self.closure(move |p| { + self.closure(move |q| { + self.closure(move |c| { + self.CertiCoq_Benchmarks_lib_Binom_join( + p, + q, + c) + }) + }) + }) +} + +fn CertiCoq_Benchmarks_lib_Binom_merge(&'a self, p: CertiCoq_Benchmarks_lib_Binom_priqueue<'a>, q: CertiCoq_Benchmarks_lib_Binom_priqueue<'a>) -> CertiCoq_Benchmarks_lib_Binom_priqueue<'a> { + self.CertiCoq_Benchmarks_lib_Binom_join( + p, + q, + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Leaf( + PhantomData))) +} +fn CertiCoq_Benchmarks_lib_Binom_merge__curried(&'a self) -> &'a dyn Fn(CertiCoq_Benchmarks_lib_Binom_priqueue<'a>) -> &'a dyn Fn(CertiCoq_Benchmarks_lib_Binom_priqueue<'a>) -> CertiCoq_Benchmarks_lib_Binom_priqueue<'a> { + self.closure(move |p| { + self.closure(move |q| { + self.CertiCoq_Benchmarks_lib_Binom_merge( + p, + q) + }) + }) +} + +fn CertiCoq_Benchmarks_lib_Binom_find_max_(&'a self, current: CertiCoq_Benchmarks_lib_Binom_key<'a>, q: CertiCoq_Benchmarks_lib_Binom_priqueue<'a>) -> CertiCoq_Benchmarks_lib_Binom_key<'a> { + match q { + &Coq_Init_Datatypes_list::nil(_) => { + current + }, + &Coq_Init_Datatypes_list::cons(_, t, q2) => { + match t { + &CertiCoq_Benchmarks_lib_Binom_tree::Node(_, x, t0, t1) => { + self.CertiCoq_Benchmarks_lib_Binom_find_max_( + match self.Coq_Init_Nat_ltb( + current, + x) { + true => { + x + }, + false => { + current + }, + }, + q2) + }, + &CertiCoq_Benchmarks_lib_Binom_tree::Leaf(_) => { + self.CertiCoq_Benchmarks_lib_Binom_find_max_( + current, + q2) + }, + } + }, + } +} +fn CertiCoq_Benchmarks_lib_Binom_find_max___curried(&'a self) -> &'a dyn Fn(CertiCoq_Benchmarks_lib_Binom_key<'a>) -> &'a dyn Fn(CertiCoq_Benchmarks_lib_Binom_priqueue<'a>) -> CertiCoq_Benchmarks_lib_Binom_key<'a> { + self.closure(move |current| { + self.closure(move |q| { + self.CertiCoq_Benchmarks_lib_Binom_find_max_( + current, + q) + }) + }) +} + +fn CertiCoq_Benchmarks_lib_Binom_find_max(&'a self, q: CertiCoq_Benchmarks_lib_Binom_priqueue<'a>) -> Option<CertiCoq_Benchmarks_lib_Binom_key<'a>> { + match q { + &Coq_Init_Datatypes_list::nil(_) => { + None + }, + &Coq_Init_Datatypes_list::cons(_, t, q2) => { + match t { + &CertiCoq_Benchmarks_lib_Binom_tree::Node(_, x, t0, t1) => { + Some( + self.CertiCoq_Benchmarks_lib_Binom_find_max_( + x, + q2)) + }, + &CertiCoq_Benchmarks_lib_Binom_tree::Leaf(_) => { + self.CertiCoq_Benchmarks_lib_Binom_find_max( + q2) + }, + } + }, + } +} +fn CertiCoq_Benchmarks_lib_Binom_find_max__curried(&'a self) -> &'a dyn Fn(CertiCoq_Benchmarks_lib_Binom_priqueue<'a>) -> Option<CertiCoq_Benchmarks_lib_Binom_key<'a>> { + self.closure(move |q| { + self.CertiCoq_Benchmarks_lib_Binom_find_max( + q) + }) +} + +fn CertiCoq_Benchmarks_lib_Binom_unzip(&'a self, t: &'a CertiCoq_Benchmarks_lib_Binom_tree<'a>, cont: &'a dyn Fn(CertiCoq_Benchmarks_lib_Binom_priqueue<'a>) -> CertiCoq_Benchmarks_lib_Binom_priqueue<'a>) -> CertiCoq_Benchmarks_lib_Binom_priqueue<'a> { + match t { + &CertiCoq_Benchmarks_lib_Binom_tree::Node(_, x, t1, t2) => { + self.CertiCoq_Benchmarks_lib_Binom_unzip( + t2, + self.closure(move |q| { + self.alloc( + Coq_Init_Datatypes_list::cons( + PhantomData, + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Node( + PhantomData, + x, + t1, + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Leaf( + PhantomData)))), + hint_app(cont)(q))) + })) + }, + &CertiCoq_Benchmarks_lib_Binom_tree::Leaf(_) => { + hint_app(cont)(self.alloc( + Coq_Init_Datatypes_list::nil( + PhantomData))) + }, + } +} +fn CertiCoq_Benchmarks_lib_Binom_unzip__curried(&'a self) -> &'a dyn Fn(&'a CertiCoq_Benchmarks_lib_Binom_tree<'a>) -> &'a dyn Fn(&'a dyn Fn(CertiCoq_Benchmarks_lib_Binom_priqueue<'a>) -> CertiCoq_Benchmarks_lib_Binom_priqueue<'a>) -> CertiCoq_Benchmarks_lib_Binom_priqueue<'a> { + self.closure(move |t| { + self.closure(move |cont| { + self.CertiCoq_Benchmarks_lib_Binom_unzip( + t, + cont) + }) + }) +} + +fn CertiCoq_Benchmarks_lib_Binom_heap_delete_max(&'a self, t: &'a CertiCoq_Benchmarks_lib_Binom_tree<'a>) -> CertiCoq_Benchmarks_lib_Binom_priqueue<'a> { + match t { + &CertiCoq_Benchmarks_lib_Binom_tree::Node(_, x, t1, t0) => { + match t0 { + &CertiCoq_Benchmarks_lib_Binom_tree::Node(_, k, t2, t3) => { + self.alloc( + Coq_Init_Datatypes_list::nil( + PhantomData)) + }, + &CertiCoq_Benchmarks_lib_Binom_tree::Leaf(_) => { + self.CertiCoq_Benchmarks_lib_Binom_unzip( + t1, + self.closure(move |u| { + u + })) + }, + } + }, + &CertiCoq_Benchmarks_lib_Binom_tree::Leaf(_) => { + self.alloc( + Coq_Init_Datatypes_list::nil( + PhantomData)) + }, + } +} +fn CertiCoq_Benchmarks_lib_Binom_heap_delete_max__curried(&'a self) -> &'a dyn Fn(&'a CertiCoq_Benchmarks_lib_Binom_tree<'a>) -> CertiCoq_Benchmarks_lib_Binom_priqueue<'a> { + self.closure(move |t| { + self.CertiCoq_Benchmarks_lib_Binom_heap_delete_max( + t) + }) +} + +fn CertiCoq_Benchmarks_lib_Binom_delete_max_aux(&'a self, m: CertiCoq_Benchmarks_lib_Binom_key<'a>, p: CertiCoq_Benchmarks_lib_Binom_priqueue<'a>) -> __pair<CertiCoq_Benchmarks_lib_Binom_priqueue<'a>, CertiCoq_Benchmarks_lib_Binom_priqueue<'a>> { + match p { + &Coq_Init_Datatypes_list::nil(_) => { + __mk_pair( + self.alloc( + Coq_Init_Datatypes_list::nil( + PhantomData)), + self.alloc( + Coq_Init_Datatypes_list::nil( + PhantomData))) + }, + &Coq_Init_Datatypes_list::cons(_, t, p2) => { + match t { + &CertiCoq_Benchmarks_lib_Binom_tree::Node(_, x, t1, t0) => { + match t0 { + &CertiCoq_Benchmarks_lib_Binom_tree::Node(_, k, t2, t3) => { + __mk_pair( + self.alloc( + Coq_Init_Datatypes_list::nil( + PhantomData)), + self.alloc( + Coq_Init_Datatypes_list::nil( + PhantomData))) + }, + &CertiCoq_Benchmarks_lib_Binom_tree::Leaf(_) => { + match self.Coq_Init_Nat_ltb( + x, + m) { + true => { + __pair_elim!( + k, j, { + __mk_pair( + self.alloc( + Coq_Init_Datatypes_list::cons( + PhantomData, + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Node( + PhantomData, + x, + t1, + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Leaf( + PhantomData)))), + k)), + j) + }, + self.CertiCoq_Benchmarks_lib_Binom_delete_max_aux( + m, + p2)) + }, + false => { + __mk_pair( + self.alloc( + Coq_Init_Datatypes_list::cons( + PhantomData, + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Leaf( + PhantomData)), + p2)), + self.CertiCoq_Benchmarks_lib_Binom_heap_delete_max( + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Node( + PhantomData, + x, + t1, + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Leaf( + PhantomData)))))) + }, + } + }, + } + }, + &CertiCoq_Benchmarks_lib_Binom_tree::Leaf(_) => { + __pair_elim!( + k, j, { + __mk_pair( + self.alloc( + Coq_Init_Datatypes_list::cons( + PhantomData, + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Leaf( + PhantomData)), + k)), + j) + }, + self.CertiCoq_Benchmarks_lib_Binom_delete_max_aux( + m, + p2)) + }, + } + }, + } +} +fn CertiCoq_Benchmarks_lib_Binom_delete_max_aux__curried(&'a self) -> &'a dyn Fn(CertiCoq_Benchmarks_lib_Binom_key<'a>) -> &'a dyn Fn(CertiCoq_Benchmarks_lib_Binom_priqueue<'a>) -> __pair<CertiCoq_Benchmarks_lib_Binom_priqueue<'a>, CertiCoq_Benchmarks_lib_Binom_priqueue<'a>> { + self.closure(move |m| { + self.closure(move |p| { + self.CertiCoq_Benchmarks_lib_Binom_delete_max_aux( + m, + p) + }) + }) +} + +fn CertiCoq_Benchmarks_lib_Binom_delete_max(&'a self, q: CertiCoq_Benchmarks_lib_Binom_priqueue<'a>) -> Option<__pair<CertiCoq_Benchmarks_lib_Binom_key<'a>, CertiCoq_Benchmarks_lib_Binom_priqueue<'a>>> { + match self.CertiCoq_Benchmarks_lib_Binom_find_max( + q) { + Some(m) => { + __pair_elim!( + q2, p, { + Some( + __mk_pair( + m, + self.CertiCoq_Benchmarks_lib_Binom_join( + q2, + p, + self.alloc( + CertiCoq_Benchmarks_lib_Binom_tree::Leaf( + PhantomData))))) + }, + self.CertiCoq_Benchmarks_lib_Binom_delete_max_aux( + m, + q)) + }, + None => { + None + }, + } +} +fn CertiCoq_Benchmarks_lib_Binom_delete_max__curried(&'a self) -> &'a dyn Fn(CertiCoq_Benchmarks_lib_Binom_priqueue<'a>) -> Option<__pair<CertiCoq_Benchmarks_lib_Binom_key<'a>, CertiCoq_Benchmarks_lib_Binom_priqueue<'a>>> { + self.closure(move |q| { + self.CertiCoq_Benchmarks_lib_Binom_delete_max( + q) + }) +} + +fn CertiCoq_Benchmarks_lib_Binom_main(&'a self) -> CertiCoq_Benchmarks_lib_Binom_key<'a> { + let a = + self.CertiCoq_Benchmarks_lib_Binom_insert_list( + self.CertiCoq_Benchmarks_lib_Binom_make_list( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + 0)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))), + self.alloc( + Coq_Init_Datatypes_list::nil( + PhantomData))), + self.CertiCoq_Benchmarks_lib_Binom_empty()); + let b = + self.CertiCoq_Benchmarks_lib_Binom_insert_list( + self.CertiCoq_Benchmarks_lib_Binom_make_list( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + __nat_succ( + 0))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))), + self.alloc( + Coq_Init_Datatypes_list::nil( + PhantomData))), + self.CertiCoq_Benchmarks_lib_Binom_empty()); + let c = + self.CertiCoq_Benchmarks_lib_Binom_merge( + a, + b); + match self.CertiCoq_Benchmarks_lib_Binom_delete_max( + c) { + Some(p) => { + __pair_elim!( + p0, k, { + p0 + }, + p) + }, + None => { + 0 + }, + } +} + +fn CertiCoq_Benchmarks_tests_binom(&'a self) -> CertiCoq_Benchmarks_lib_Binom_key<'a> { + self.CertiCoq_Benchmarks_lib_Binom_main() +} +} +fn main() { + println!("{:?}", Program::new().CertiCoq_Benchmarks_tests_binom()) +} diff --git a/tests/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.stderr b/tests/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.stderr index 25838fbf0ab..16a93a0d47d 100644 --- a/tests/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.stderr +++ b/tests/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.stderr @@ -13,7 +13,7 @@ LL | Some(_z @ ref _y) => {} | ^^ ------ value borrowed here after move | | | value moved into `_z` here - | move occurs because `_z` has type `X` which does not implement the `Copy` trait + | move occurs because `_z` has type `X`, which does not implement the `Copy` trait | help: borrow this binding in the pattern to avoid moving the value | @@ -35,7 +35,7 @@ LL | Some(_z @ ref mut _y) => {} | ^^ ---------- value borrowed here after move | | | value moved into `_z` here - | move occurs because `_z` has type `X` which does not implement the `Copy` trait + | move occurs because `_z` has type `X`, which does not implement the `Copy` trait | help: borrow this binding in the pattern to avoid moving the value | diff --git a/tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse-promotion.stderr b/tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse-promotion.stderr index 815a4ade995..ea04d4bc055 100644 --- a/tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse-promotion.stderr +++ b/tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse-promotion.stderr @@ -5,7 +5,7 @@ LL | let a @ ref b = U; | ^ ----- value borrowed here after move | | | value moved into `a` here - | move occurs because `a` has type `U` which does not implement the `Copy` trait + | move occurs because `a` has type `U`, which does not implement the `Copy` trait | help: borrow this binding in the pattern to avoid moving the value | diff --git a/tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.stderr b/tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.stderr index fd7a51388bc..25c940a3200 100644 --- a/tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.stderr +++ b/tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.stderr @@ -5,7 +5,7 @@ LL | let a @ ref b = U; | ^ ----- value borrowed here after move | | | value moved into `a` here - | move occurs because `a` has type `U` which does not implement the `Copy` trait + | move occurs because `a` has type `U`, which does not implement the `Copy` trait | help: borrow this binding in the pattern to avoid moving the value | @@ -20,7 +20,7 @@ LL | let a @ (mut b @ ref mut c, d @ ref e) = (U, U); | | | | | value borrowed here after move | value moved into `a` here - | move occurs because `a` has type `(U, U)` which does not implement the `Copy` trait + | move occurs because `a` has type `(U, U)`, which does not implement the `Copy` trait | help: borrow this binding in the pattern to avoid moving the value | @@ -34,7 +34,7 @@ LL | let a @ (mut b @ ref mut c, d @ ref e) = (U, U); | ^^^^^ --------- value borrowed here after move | | | value moved into `b` here - | move occurs because `b` has type `U` which does not implement the `Copy` trait + | move occurs because `b` has type `U`, which does not implement the `Copy` trait | help: borrow this binding in the pattern to avoid moving the value | @@ -48,7 +48,7 @@ LL | let a @ (mut b @ ref mut c, d @ ref e) = (U, U); | ^ ----- value borrowed here after move | | | value moved into `d` here - | move occurs because `d` has type `U` which does not implement the `Copy` trait + | move occurs because `d` has type `U`, which does not implement the `Copy` trait | help: borrow this binding in the pattern to avoid moving the value | @@ -63,7 +63,7 @@ LL | let a @ [ref mut b, ref c] = [U, U]; | | | | | value borrowed here after move | value moved into `a` here - | move occurs because `a` has type `[U; 2]` which does not implement the `Copy` trait + | move occurs because `a` has type `[U; 2]`, which does not implement the `Copy` trait | help: borrow this binding in the pattern to avoid moving the value | @@ -77,7 +77,7 @@ LL | let a @ ref b = u(); | ^ ----- value borrowed here after move | | | value moved into `a` here - | move occurs because `a` has type `U` which does not implement the `Copy` trait + | move occurs because `a` has type `U`, which does not implement the `Copy` trait | help: borrow this binding in the pattern to avoid moving the value | @@ -92,7 +92,7 @@ LL | let a @ (mut b @ ref mut c, d @ ref e) = (u(), u()); | | | | | value borrowed here after move | value moved into `a` here - | move occurs because `a` has type `(U, U)` which does not implement the `Copy` trait + | move occurs because `a` has type `(U, U)`, which does not implement the `Copy` trait | help: borrow this binding in the pattern to avoid moving the value | @@ -106,7 +106,7 @@ LL | let a @ (mut b @ ref mut c, d @ ref e) = (u(), u()); | ^^^^^ --------- value borrowed here after move | | | value moved into `b` here - | move occurs because `b` has type `U` which does not implement the `Copy` trait + | move occurs because `b` has type `U`, which does not implement the `Copy` trait | help: borrow this binding in the pattern to avoid moving the value | @@ -120,7 +120,7 @@ LL | let a @ (mut b @ ref mut c, d @ ref e) = (u(), u()); | ^ ----- value borrowed here after move | | | value moved into `d` here - | move occurs because `d` has type `U` which does not implement the `Copy` trait + | move occurs because `d` has type `U`, which does not implement the `Copy` trait | help: borrow this binding in the pattern to avoid moving the value | @@ -135,7 +135,7 @@ LL | let a @ [ref mut b, ref c] = [u(), u()]; | | | | | value borrowed here after move | value moved into `a` here - | move occurs because `a` has type `[U; 2]` which does not implement the `Copy` trait + | move occurs because `a` has type `[U; 2]`, which does not implement the `Copy` trait | help: borrow this binding in the pattern to avoid moving the value | @@ -149,7 +149,7 @@ LL | a @ Some(ref b) => {} | ^ ----- value borrowed here after move | | | value moved into `a` here - | move occurs because `a` has type `Option<U>` which does not implement the `Copy` trait + | move occurs because `a` has type `Option<U>`, which does not implement the `Copy` trait | help: borrow this binding in the pattern to avoid moving the value | @@ -164,7 +164,7 @@ LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {} | | | | | value borrowed here after move | value moved into `a` here - | move occurs because `a` has type `Option<(U, U)>` which does not implement the `Copy` trait + | move occurs because `a` has type `Option<(U, U)>`, which does not implement the `Copy` trait | help: borrow this binding in the pattern to avoid moving the value | @@ -178,7 +178,7 @@ LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {} | ^^^^^ --------- value borrowed here after move | | | value moved into `b` here - | move occurs because `b` has type `U` which does not implement the `Copy` trait + | move occurs because `b` has type `U`, which does not implement the `Copy` trait | help: borrow this binding in the pattern to avoid moving the value | @@ -192,7 +192,7 @@ LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {} | ^ ----- value borrowed here after move | | | value moved into `d` here - | move occurs because `d` has type `U` which does not implement the `Copy` trait + | move occurs because `d` has type `U`, which does not implement the `Copy` trait | help: borrow this binding in the pattern to avoid moving the value | @@ -207,7 +207,7 @@ LL | mut a @ Some([ref b, ref mut c]) => {} | | | | | value borrowed here after move | value moved into `a` here - | move occurs because `a` has type `Option<[U; 2]>` which does not implement the `Copy` trait + | move occurs because `a` has type `Option<[U; 2]>`, which does not implement the `Copy` trait | help: borrow this binding in the pattern to avoid moving the value | @@ -221,7 +221,7 @@ LL | a @ Some(ref b) => {} | ^ ----- value borrowed here after move | | | value moved into `a` here - | move occurs because `a` has type `Option<U>` which does not implement the `Copy` trait + | move occurs because `a` has type `Option<U>`, which does not implement the `Copy` trait | help: borrow this binding in the pattern to avoid moving the value | @@ -236,7 +236,7 @@ LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {} | | | | | value borrowed here after move | value moved into `a` here - | move occurs because `a` has type `Option<(U, U)>` which does not implement the `Copy` trait + | move occurs because `a` has type `Option<(U, U)>`, which does not implement the `Copy` trait | help: borrow this binding in the pattern to avoid moving the value | @@ -250,7 +250,7 @@ LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {} | ^^^^^ --------- value borrowed here after move | | | value moved into `b` here - | move occurs because `b` has type `U` which does not implement the `Copy` trait + | move occurs because `b` has type `U`, which does not implement the `Copy` trait | help: borrow this binding in the pattern to avoid moving the value | @@ -264,7 +264,7 @@ LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {} | ^ ----- value borrowed here after move | | | value moved into `d` here - | move occurs because `d` has type `U` which does not implement the `Copy` trait + | move occurs because `d` has type `U`, which does not implement the `Copy` trait | help: borrow this binding in the pattern to avoid moving the value | @@ -279,7 +279,7 @@ LL | mut a @ Some([ref b, ref mut c]) => {} | | | | | value borrowed here after move | value moved into `a` here - | move occurs because `a` has type `Option<[U; 2]>` which does not implement the `Copy` trait + | move occurs because `a` has type `Option<[U; 2]>`, which does not implement the `Copy` trait | help: borrow this binding in the pattern to avoid moving the value | @@ -349,7 +349,7 @@ LL | fn f1(a @ ref b: U) {} | ^ ----- value borrowed here after move | | | value moved into `a` here - | move occurs because `a` has type `U` which does not implement the `Copy` trait + | move occurs because `a` has type `U`, which does not implement the `Copy` trait | help: borrow this binding in the pattern to avoid moving the value | @@ -364,7 +364,7 @@ LL | fn f2(mut a @ (b @ ref c, mut d @ ref e): (U, U)) {} | | | | | value borrowed here after move | value moved into `a` here - | move occurs because `a` has type `(U, U)` which does not implement the `Copy` trait + | move occurs because `a` has type `(U, U)`, which does not implement the `Copy` trait | help: borrow this binding in the pattern to avoid moving the value | @@ -378,7 +378,7 @@ LL | fn f2(mut a @ (b @ ref c, mut d @ ref e): (U, U)) {} | ^ ----- value borrowed here after move | | | value moved into `b` here - | move occurs because `b` has type `U` which does not implement the `Copy` trait + | move occurs because `b` has type `U`, which does not implement the `Copy` trait | help: borrow this binding in the pattern to avoid moving the value | @@ -392,7 +392,7 @@ LL | fn f2(mut a @ (b @ ref c, mut d @ ref e): (U, U)) {} | ^^^^^ ----- value borrowed here after move | | | value moved into `d` here - | move occurs because `d` has type `U` which does not implement the `Copy` trait + | move occurs because `d` has type `U`, which does not implement the `Copy` trait | help: borrow this binding in the pattern to avoid moving the value | @@ -417,7 +417,7 @@ LL | fn f3(a @ [ref mut b, ref c]: [U; 2]) {} | | | | | value borrowed here after move | value moved into `a` here - | move occurs because `a` has type `[U; 2]` which does not implement the `Copy` trait + | move occurs because `a` has type `[U; 2]`, which does not implement the `Copy` trait | help: borrow this binding in the pattern to avoid moving the value | diff --git a/tests/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.stderr b/tests/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.stderr index 3446148d2b1..76085f897ff 100644 --- a/tests/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.stderr +++ b/tests/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.stderr @@ -78,7 +78,7 @@ LL | let a @ (ref mut b, ref mut c) = (U, U); | | | | | value borrowed here after move | value moved into `a` here - | move occurs because `a` has type `(U, U)` which does not implement the `Copy` trait + | move occurs because `a` has type `(U, U)`, which does not implement the `Copy` trait | help: borrow this binding in the pattern to avoid moving the value | @@ -94,7 +94,7 @@ LL | let a @ (b, [c, d]) = &mut val; // Same as ^-- | | | value borrowed here after move | | value borrowed here after move | value moved into `a` here - | move occurs because `a` has type `&mut (U, [U; 2])` which does not implement the `Copy` trait + | move occurs because `a` has type `&mut (U, [U; 2])`, which does not implement the `Copy` trait | help: borrow this binding in the pattern to avoid moving the value | @@ -108,7 +108,7 @@ LL | let a @ &mut ref mut b = &mut U; | ^ --------- value borrowed here after move | | | value moved into `a` here - | move occurs because `a` has type `&mut U` which does not implement the `Copy` trait + | move occurs because `a` has type `&mut U`, which does not implement the `Copy` trait | help: borrow this binding in the pattern to avoid moving the value | @@ -123,7 +123,7 @@ LL | let a @ &mut (ref mut b, ref mut c) = &mut (U, U); | | | | | value borrowed here after move | value moved into `a` here - | move occurs because `a` has type `&mut (U, U)` which does not implement the `Copy` trait + | move occurs because `a` has type `&mut (U, U)`, which does not implement the `Copy` trait | help: borrow this binding in the pattern to avoid moving the value | diff --git a/tests/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.stderr b/tests/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.stderr index 36515c1a29b..a0a43e83a6a 100644 --- a/tests/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.stderr +++ b/tests/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.stderr @@ -29,7 +29,7 @@ LL | Ok(ref a @ b) | Err(b @ ref a) => { | ^ ----- value borrowed here after move | | | value moved into `b` here - | move occurs because `b` has type `NotCopy` which does not implement the `Copy` trait + | move occurs because `b` has type `NotCopy`, which does not implement the `Copy` trait | help: borrow this binding in the pattern to avoid moving the value | diff --git a/tests/ui/pattern/deref-patterns/typeck.rs b/tests/ui/pattern/deref-patterns/typeck.rs new file mode 100644 index 00000000000..ead6dcdbaf0 --- /dev/null +++ b/tests/ui/pattern/deref-patterns/typeck.rs @@ -0,0 +1,31 @@ +//@ check-pass +#![feature(deref_patterns)] +#![allow(incomplete_features)] + +use std::rc::Rc; + +fn main() { + let vec: Vec<u32> = Vec::new(); + match vec { + deref!([..]) => {} + _ => {} + } + match Box::new(true) { + deref!(true) => {} + _ => {} + } + match &Box::new(true) { + deref!(true) => {} + _ => {} + } + match &Rc::new(0) { + deref!(1..) => {} + _ => {} + } + // FIXME(deref_patterns): fails to typecheck because `"foo"` has type &str but deref creates a + // place of type `str`. + // match "foo".to_string() { + // box "foo" => {} + // _ => {} + // } +} diff --git a/tests/ui/pattern/patkind-ref-binding-issue-114896.fixed b/tests/ui/pattern/patkind-ref-binding-issue-114896.fixed new file mode 100644 index 00000000000..086a119eb77 --- /dev/null +++ b/tests/ui/pattern/patkind-ref-binding-issue-114896.fixed @@ -0,0 +1,10 @@ +//@ run-rustfix +#![allow(dead_code)] + +fn main() { + fn x(a: &char) { + let &(mut b) = a; + b.make_ascii_uppercase(); +//~^ cannot borrow `b` as mutable, as it is not declared as mutable + } +} diff --git a/tests/ui/pattern/issue-114896.rs b/tests/ui/pattern/patkind-ref-binding-issue-114896.rs index cde37f658d6..b4d6b72c01f 100644 --- a/tests/ui/pattern/issue-114896.rs +++ b/tests/ui/pattern/patkind-ref-binding-issue-114896.rs @@ -1,3 +1,6 @@ +//@ run-rustfix +#![allow(dead_code)] + fn main() { fn x(a: &char) { let &b = a; diff --git a/tests/ui/pattern/issue-114896.stderr b/tests/ui/pattern/patkind-ref-binding-issue-114896.stderr index 285c9109e1b..68538255edd 100644 --- a/tests/ui/pattern/issue-114896.stderr +++ b/tests/ui/pattern/patkind-ref-binding-issue-114896.stderr @@ -1,5 +1,5 @@ error[E0596]: cannot borrow `b` as mutable, as it is not declared as mutable - --> $DIR/issue-114896.rs:4:9 + --> $DIR/patkind-ref-binding-issue-114896.rs:7:9 | LL | let &b = a; | -- help: consider changing this to be mutable: `&(mut b)` diff --git a/tests/ui/pattern/patkind-ref-binding-issue-122415.fixed b/tests/ui/pattern/patkind-ref-binding-issue-122415.fixed new file mode 100644 index 00000000000..6144f062169 --- /dev/null +++ b/tests/ui/pattern/patkind-ref-binding-issue-122415.fixed @@ -0,0 +1,11 @@ +//@ run-rustfix +#![allow(dead_code)] + +fn mutate(_y: &mut i32) {} + +fn foo(&(mut x): &i32) { + mutate(&mut x); + //~^ ERROR cannot borrow `x` as mutable +} + +fn main() {} diff --git a/tests/ui/pattern/patkind-ref-binding-issue-122415.rs b/tests/ui/pattern/patkind-ref-binding-issue-122415.rs new file mode 100644 index 00000000000..b9f6416027a --- /dev/null +++ b/tests/ui/pattern/patkind-ref-binding-issue-122415.rs @@ -0,0 +1,11 @@ +//@ run-rustfix +#![allow(dead_code)] + +fn mutate(_y: &mut i32) {} + +fn foo(&x: &i32) { + mutate(&mut x); + //~^ ERROR cannot borrow `x` as mutable +} + +fn main() {} diff --git a/tests/ui/pattern/patkind-ref-binding-issue-122415.stderr b/tests/ui/pattern/patkind-ref-binding-issue-122415.stderr new file mode 100644 index 00000000000..39283133ac7 --- /dev/null +++ b/tests/ui/pattern/patkind-ref-binding-issue-122415.stderr @@ -0,0 +1,11 @@ +error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable + --> $DIR/patkind-ref-binding-issue-122415.rs:7:12 + | +LL | fn foo(&x: &i32) { + | -- help: consider changing this to be mutable: `&(mut x)` +LL | mutate(&mut x); + | ^^^^^^ cannot borrow as mutable + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0596`. diff --git a/tests/ui/pattern/usefulness/empty-types.exhaustive_patterns.stderr b/tests/ui/pattern/usefulness/empty-types.exhaustive_patterns.stderr index 98c66c9dd07..45bdba94d78 100644 --- a/tests/ui/pattern/usefulness/empty-types.exhaustive_patterns.stderr +++ b/tests/ui/pattern/usefulness/empty-types.exhaustive_patterns.stderr @@ -1,23 +1,23 @@ error: unreachable pattern - --> $DIR/empty-types.rs:49:9 + --> $DIR/empty-types.rs:51:9 | LL | _ => {} | ^ | note: the lint level is defined here - --> $DIR/empty-types.rs:15:9 + --> $DIR/empty-types.rs:17:9 | LL | #![deny(unreachable_patterns)] | ^^^^^^^^^^^^^^^^^^^^ error: unreachable pattern - --> $DIR/empty-types.rs:52:9 + --> $DIR/empty-types.rs:54:9 | LL | _x => {} | ^^ error[E0004]: non-exhaustive patterns: type `&!` is non-empty - --> $DIR/empty-types.rs:56:11 + --> $DIR/empty-types.rs:58:11 | LL | match ref_never {} | ^^^^^^^^^ @@ -32,31 +32,31 @@ LL + } | error: unreachable pattern - --> $DIR/empty-types.rs:71:9 + --> $DIR/empty-types.rs:73:9 | LL | (_, _) => {} | ^^^^^^ error: unreachable pattern - --> $DIR/empty-types.rs:78:9 + --> $DIR/empty-types.rs:80:9 | LL | _ => {} | ^ error: unreachable pattern - --> $DIR/empty-types.rs:81:9 + --> $DIR/empty-types.rs:83:9 | LL | (_, _) => {} | ^^^^^^ error: unreachable pattern - --> $DIR/empty-types.rs:85:9 + --> $DIR/empty-types.rs:87:9 | LL | _ => {} | ^ error[E0004]: non-exhaustive patterns: `Ok(_)` not covered - --> $DIR/empty-types.rs:89:11 + --> $DIR/empty-types.rs:91:11 | LL | match res_u32_never {} | ^^^^^^^^^^^^^ pattern `Ok(_)` not covered @@ -75,19 +75,19 @@ LL + } | error: unreachable pattern - --> $DIR/empty-types.rs:97:9 + --> $DIR/empty-types.rs:99:9 | LL | Err(_) => {} | ^^^^^^ error: unreachable pattern - --> $DIR/empty-types.rs:102:9 + --> $DIR/empty-types.rs:104:9 | LL | Err(_) => {} | ^^^^^^ error[E0004]: non-exhaustive patterns: `Ok(1_u32..=u32::MAX)` not covered - --> $DIR/empty-types.rs:99:11 + --> $DIR/empty-types.rs:101:11 | LL | match res_u32_never { | ^^^^^^^^^^^^^ pattern `Ok(1_u32..=u32::MAX)` not covered @@ -105,7 +105,7 @@ LL ~ Ok(1_u32..=u32::MAX) => todo!() | error[E0005]: refutable pattern in local binding - --> $DIR/empty-types.rs:106:9 + --> $DIR/empty-types.rs:108:9 | LL | let Ok(_x) = res_u32_never.as_ref(); | ^^^^^^ pattern `Err(_)` not covered @@ -119,121 +119,121 @@ LL | let Ok(_x) = res_u32_never.as_ref() else { todo!() }; | ++++++++++++++++ error: unreachable pattern - --> $DIR/empty-types.rs:117:9 + --> $DIR/empty-types.rs:119:9 | LL | _ => {} | ^ error: unreachable pattern - --> $DIR/empty-types.rs:121:9 + --> $DIR/empty-types.rs:123:9 | LL | Ok(_) => {} | ^^^^^ error: unreachable pattern - --> $DIR/empty-types.rs:124:9 + --> $DIR/empty-types.rs:126:9 | LL | Ok(_) => {} | ^^^^^ error: unreachable pattern - --> $DIR/empty-types.rs:125:9 + --> $DIR/empty-types.rs:127:9 | LL | _ => {} | ^ error: unreachable pattern - --> $DIR/empty-types.rs:128:9 + --> $DIR/empty-types.rs:130:9 | LL | Ok(_) => {} | ^^^^^ error: unreachable pattern - --> $DIR/empty-types.rs:129:9 + --> $DIR/empty-types.rs:131:9 | LL | Err(_) => {} | ^^^^^^ error: unreachable pattern - --> $DIR/empty-types.rs:138:13 + --> $DIR/empty-types.rs:140:13 | LL | _ => {} | ^ error: unreachable pattern - --> $DIR/empty-types.rs:141:13 + --> $DIR/empty-types.rs:143:13 | LL | _ if false => {} | ^ error: unreachable pattern - --> $DIR/empty-types.rs:150:13 + --> $DIR/empty-types.rs:152:13 | LL | Some(_) => {} | ^^^^^^^ error: unreachable pattern - --> $DIR/empty-types.rs:154:13 + --> $DIR/empty-types.rs:156:13 | LL | _ => {} | ^ error: unreachable pattern - --> $DIR/empty-types.rs:206:13 + --> $DIR/empty-types.rs:208:13 | LL | _ => {} | ^ error: unreachable pattern - --> $DIR/empty-types.rs:211:13 + --> $DIR/empty-types.rs:213:13 | LL | _ => {} | ^ error: unreachable pattern - --> $DIR/empty-types.rs:216:13 + --> $DIR/empty-types.rs:218:13 | LL | _ => {} | ^ error: unreachable pattern - --> $DIR/empty-types.rs:221:13 + --> $DIR/empty-types.rs:223:13 | LL | _ => {} | ^ error: unreachable pattern - --> $DIR/empty-types.rs:227:13 + --> $DIR/empty-types.rs:229:13 | LL | _ => {} | ^ error: unreachable pattern - --> $DIR/empty-types.rs:286:9 + --> $DIR/empty-types.rs:288:9 | LL | _ => {} | ^ error: unreachable pattern - --> $DIR/empty-types.rs:289:9 + --> $DIR/empty-types.rs:291:9 | LL | (_, _) => {} | ^^^^^^ error: unreachable pattern - --> $DIR/empty-types.rs:292:9 + --> $DIR/empty-types.rs:294:9 | LL | Ok(_) => {} | ^^^^^ error: unreachable pattern - --> $DIR/empty-types.rs:293:9 + --> $DIR/empty-types.rs:295:9 | LL | Err(_) => {} | ^^^^^^ error[E0004]: non-exhaustive patterns: type `&[!]` is non-empty - --> $DIR/empty-types.rs:325:11 + --> $DIR/empty-types.rs:327:11 | LL | match slice_never {} | ^^^^^^^^^^^ @@ -247,7 +247,7 @@ LL + } | error[E0004]: non-exhaustive patterns: `&[]` not covered - --> $DIR/empty-types.rs:336:11 + --> $DIR/empty-types.rs:338:11 | LL | match slice_never { | ^^^^^^^^^^^ pattern `&[]` not covered @@ -260,7 +260,7 @@ LL + &[] => todo!() | error[E0004]: non-exhaustive patterns: `&[]` not covered - --> $DIR/empty-types.rs:349:11 + --> $DIR/empty-types.rs:352:11 | LL | match slice_never { | ^^^^^^^^^^^ pattern `&[]` not covered @@ -274,7 +274,7 @@ LL + &[] => todo!() | error[E0004]: non-exhaustive patterns: type `[!]` is non-empty - --> $DIR/empty-types.rs:355:11 + --> $DIR/empty-types.rs:359:11 | LL | match *slice_never {} | ^^^^^^^^^^^^ @@ -288,25 +288,25 @@ LL + } | error: unreachable pattern - --> $DIR/empty-types.rs:365:9 + --> $DIR/empty-types.rs:369:9 | LL | _ => {} | ^ error: unreachable pattern - --> $DIR/empty-types.rs:368:9 + --> $DIR/empty-types.rs:372:9 | LL | [_, _, _] => {} | ^^^^^^^^^ error: unreachable pattern - --> $DIR/empty-types.rs:371:9 + --> $DIR/empty-types.rs:375:9 | LL | [_, ..] => {} | ^^^^^^^ error[E0004]: non-exhaustive patterns: type `[!; 0]` is non-empty - --> $DIR/empty-types.rs:385:11 + --> $DIR/empty-types.rs:389:11 | LL | match array_0_never {} | ^^^^^^^^^^^^^ @@ -320,13 +320,13 @@ LL + } | error: unreachable pattern - --> $DIR/empty-types.rs:392:9 + --> $DIR/empty-types.rs:396:9 | LL | _ => {} | ^ error[E0004]: non-exhaustive patterns: `[]` not covered - --> $DIR/empty-types.rs:394:11 + --> $DIR/empty-types.rs:398:11 | LL | match array_0_never { | ^^^^^^^^^^^^^ pattern `[]` not covered @@ -340,49 +340,49 @@ LL + [] => todo!() | error: unreachable pattern - --> $DIR/empty-types.rs:413:9 + --> $DIR/empty-types.rs:417:9 | LL | Some(_) => {} | ^^^^^^^ error: unreachable pattern - --> $DIR/empty-types.rs:418:9 + --> $DIR/empty-types.rs:422:9 | LL | Some(_a) => {} | ^^^^^^^^ error: unreachable pattern - --> $DIR/empty-types.rs:423:9 + --> $DIR/empty-types.rs:427:9 | LL | _ => {} | ^ error: unreachable pattern - --> $DIR/empty-types.rs:428:9 + --> $DIR/empty-types.rs:432:9 | LL | _a => {} | ^^ error: unreachable pattern - --> $DIR/empty-types.rs:600:9 + --> $DIR/empty-types.rs:604:9 | LL | _ => {} | ^ error: unreachable pattern - --> $DIR/empty-types.rs:603:9 + --> $DIR/empty-types.rs:607:9 | LL | _x => {} | ^^ error: unreachable pattern - --> $DIR/empty-types.rs:606:9 + --> $DIR/empty-types.rs:610:9 | LL | _ if false => {} | ^ error: unreachable pattern - --> $DIR/empty-types.rs:609:9 + --> $DIR/empty-types.rs:613:9 | LL | _x if false => {} | ^^ diff --git a/tests/ui/pattern/usefulness/empty-types.min_exh_pats.stderr b/tests/ui/pattern/usefulness/empty-types.min_exh_pats.stderr index d5121e7043c..6e50dfe6a26 100644 --- a/tests/ui/pattern/usefulness/empty-types.min_exh_pats.stderr +++ b/tests/ui/pattern/usefulness/empty-types.min_exh_pats.stderr @@ -1,23 +1,23 @@ error: unreachable pattern - --> $DIR/empty-types.rs:49:9 + --> $DIR/empty-types.rs:51:9 | LL | _ => {} | ^ | note: the lint level is defined here - --> $DIR/empty-types.rs:15:9 + --> $DIR/empty-types.rs:17:9 | LL | #![deny(unreachable_patterns)] | ^^^^^^^^^^^^^^^^^^^^ error: unreachable pattern - --> $DIR/empty-types.rs:52:9 + --> $DIR/empty-types.rs:54:9 | LL | _x => {} | ^^ error[E0004]: non-exhaustive patterns: type `&!` is non-empty - --> $DIR/empty-types.rs:56:11 + --> $DIR/empty-types.rs:58:11 | LL | match ref_never {} | ^^^^^^^^^ @@ -32,31 +32,31 @@ LL + } | error: unreachable pattern - --> $DIR/empty-types.rs:71:9 + --> $DIR/empty-types.rs:73:9 | LL | (_, _) => {} | ^^^^^^ error: unreachable pattern - --> $DIR/empty-types.rs:78:9 + --> $DIR/empty-types.rs:80:9 | LL | _ => {} | ^ error: unreachable pattern - --> $DIR/empty-types.rs:81:9 + --> $DIR/empty-types.rs:83:9 | LL | (_, _) => {} | ^^^^^^ error: unreachable pattern - --> $DIR/empty-types.rs:85:9 + --> $DIR/empty-types.rs:87:9 | LL | _ => {} | ^ error[E0004]: non-exhaustive patterns: `Ok(_)` not covered - --> $DIR/empty-types.rs:89:11 + --> $DIR/empty-types.rs:91:11 | LL | match res_u32_never {} | ^^^^^^^^^^^^^ pattern `Ok(_)` not covered @@ -75,19 +75,19 @@ LL + } | error: unreachable pattern - --> $DIR/empty-types.rs:97:9 + --> $DIR/empty-types.rs:99:9 | LL | Err(_) => {} | ^^^^^^ error: unreachable pattern - --> $DIR/empty-types.rs:102:9 + --> $DIR/empty-types.rs:104:9 | LL | Err(_) => {} | ^^^^^^ error[E0004]: non-exhaustive patterns: `Ok(1_u32..=u32::MAX)` not covered - --> $DIR/empty-types.rs:99:11 + --> $DIR/empty-types.rs:101:11 | LL | match res_u32_never { | ^^^^^^^^^^^^^ pattern `Ok(1_u32..=u32::MAX)` not covered @@ -105,7 +105,7 @@ LL ~ Ok(1_u32..=u32::MAX) => todo!() | error[E0005]: refutable pattern in local binding - --> $DIR/empty-types.rs:106:9 + --> $DIR/empty-types.rs:108:9 | LL | let Ok(_x) = res_u32_never.as_ref(); | ^^^^^^ pattern `Err(_)` not covered @@ -119,7 +119,7 @@ LL | let Ok(_x) = res_u32_never.as_ref() else { todo!() }; | ++++++++++++++++ error[E0005]: refutable pattern in local binding - --> $DIR/empty-types.rs:110:9 + --> $DIR/empty-types.rs:112:9 | LL | let Ok(_x) = &res_u32_never; | ^^^^^^ pattern `&Err(_)` not covered @@ -133,67 +133,67 @@ LL | let Ok(_x) = &res_u32_never else { todo!() }; | ++++++++++++++++ error: unreachable pattern - --> $DIR/empty-types.rs:117:9 + --> $DIR/empty-types.rs:119:9 | LL | _ => {} | ^ error: unreachable pattern - --> $DIR/empty-types.rs:121:9 + --> $DIR/empty-types.rs:123:9 | LL | Ok(_) => {} | ^^^^^ error: unreachable pattern - --> $DIR/empty-types.rs:124:9 + --> $DIR/empty-types.rs:126:9 | LL | Ok(_) => {} | ^^^^^ error: unreachable pattern - --> $DIR/empty-types.rs:125:9 + --> $DIR/empty-types.rs:127:9 | LL | _ => {} | ^ error: unreachable pattern - --> $DIR/empty-types.rs:128:9 + --> $DIR/empty-types.rs:130:9 | LL | Ok(_) => {} | ^^^^^ error: unreachable pattern - --> $DIR/empty-types.rs:129:9 + --> $DIR/empty-types.rs:131:9 | LL | Err(_) => {} | ^^^^^^ error: unreachable pattern - --> $DIR/empty-types.rs:138:13 + --> $DIR/empty-types.rs:140:13 | LL | _ => {} | ^ error: unreachable pattern - --> $DIR/empty-types.rs:141:13 + --> $DIR/empty-types.rs:143:13 | LL | _ if false => {} | ^ error: unreachable pattern - --> $DIR/empty-types.rs:150:13 + --> $DIR/empty-types.rs:152:13 | LL | Some(_) => {} | ^^^^^^^ error: unreachable pattern - --> $DIR/empty-types.rs:154:13 + --> $DIR/empty-types.rs:156:13 | LL | _ => {} | ^ error[E0004]: non-exhaustive patterns: `Some(_)` not covered - --> $DIR/empty-types.rs:163:15 + --> $DIR/empty-types.rs:165:15 | LL | match *ref_opt_void { | ^^^^^^^^^^^^^ pattern `Some(_)` not covered @@ -211,61 +211,61 @@ LL + Some(_) => todo!() | error: unreachable pattern - --> $DIR/empty-types.rs:206:13 + --> $DIR/empty-types.rs:208:13 | LL | _ => {} | ^ error: unreachable pattern - --> $DIR/empty-types.rs:211:13 + --> $DIR/empty-types.rs:213:13 | LL | _ => {} | ^ error: unreachable pattern - --> $DIR/empty-types.rs:216:13 + --> $DIR/empty-types.rs:218:13 | LL | _ => {} | ^ error: unreachable pattern - --> $DIR/empty-types.rs:221:13 + --> $DIR/empty-types.rs:223:13 | LL | _ => {} | ^ error: unreachable pattern - --> $DIR/empty-types.rs:227:13 + --> $DIR/empty-types.rs:229:13 | LL | _ => {} | ^ error: unreachable pattern - --> $DIR/empty-types.rs:286:9 + --> $DIR/empty-types.rs:288:9 | LL | _ => {} | ^ error: unreachable pattern - --> $DIR/empty-types.rs:289:9 + --> $DIR/empty-types.rs:291:9 | LL | (_, _) => {} | ^^^^^^ error: unreachable pattern - --> $DIR/empty-types.rs:292:9 + --> $DIR/empty-types.rs:294:9 | LL | Ok(_) => {} | ^^^^^ error: unreachable pattern - --> $DIR/empty-types.rs:293:9 + --> $DIR/empty-types.rs:295:9 | LL | Err(_) => {} | ^^^^^^ error[E0004]: non-exhaustive patterns: type `(u32, !)` is non-empty - --> $DIR/empty-types.rs:314:11 + --> $DIR/empty-types.rs:316:11 | LL | match *x {} | ^^ @@ -279,7 +279,7 @@ LL ~ } | error[E0004]: non-exhaustive patterns: type `(!, !)` is non-empty - --> $DIR/empty-types.rs:316:11 + --> $DIR/empty-types.rs:318:11 | LL | match *x {} | ^^ @@ -293,7 +293,7 @@ LL ~ } | error[E0004]: non-exhaustive patterns: `Ok(_)` and `Err(_)` not covered - --> $DIR/empty-types.rs:318:11 + --> $DIR/empty-types.rs:320:11 | LL | match *x {} | ^^ patterns `Ok(_)` and `Err(_)` not covered @@ -315,7 +315,7 @@ LL ~ } | error[E0004]: non-exhaustive patterns: type `[!; 3]` is non-empty - --> $DIR/empty-types.rs:320:11 + --> $DIR/empty-types.rs:322:11 | LL | match *x {} | ^^ @@ -329,7 +329,7 @@ LL ~ } | error[E0004]: non-exhaustive patterns: type `&[!]` is non-empty - --> $DIR/empty-types.rs:325:11 + --> $DIR/empty-types.rs:327:11 | LL | match slice_never {} | ^^^^^^^^^^^ @@ -343,7 +343,7 @@ LL + } | error[E0004]: non-exhaustive patterns: `&[_, ..]` not covered - --> $DIR/empty-types.rs:327:11 + --> $DIR/empty-types.rs:329:11 | LL | match slice_never { | ^^^^^^^^^^^ pattern `&[_, ..]` not covered @@ -356,7 +356,7 @@ LL + &[_, ..] => todo!() | error[E0004]: non-exhaustive patterns: `&[]`, `&[_]` and `&[_, _]` not covered - --> $DIR/empty-types.rs:336:11 + --> $DIR/empty-types.rs:338:11 | LL | match slice_never { | ^^^^^^^^^^^ patterns `&[]`, `&[_]` and `&[_, _]` not covered @@ -369,7 +369,7 @@ LL + &[] | &[_] | &[_, _] => todo!() | error[E0004]: non-exhaustive patterns: `&[]` and `&[_, ..]` not covered - --> $DIR/empty-types.rs:349:11 + --> $DIR/empty-types.rs:352:11 | LL | match slice_never { | ^^^^^^^^^^^ patterns `&[]` and `&[_, ..]` not covered @@ -383,7 +383,7 @@ LL + &[] | &[_, ..] => todo!() | error[E0004]: non-exhaustive patterns: type `[!]` is non-empty - --> $DIR/empty-types.rs:355:11 + --> $DIR/empty-types.rs:359:11 | LL | match *slice_never {} | ^^^^^^^^^^^^ @@ -397,25 +397,25 @@ LL + } | error: unreachable pattern - --> $DIR/empty-types.rs:365:9 + --> $DIR/empty-types.rs:369:9 | LL | _ => {} | ^ error: unreachable pattern - --> $DIR/empty-types.rs:368:9 + --> $DIR/empty-types.rs:372:9 | LL | [_, _, _] => {} | ^^^^^^^^^ error: unreachable pattern - --> $DIR/empty-types.rs:371:9 + --> $DIR/empty-types.rs:375:9 | LL | [_, ..] => {} | ^^^^^^^ error[E0004]: non-exhaustive patterns: type `[!; 0]` is non-empty - --> $DIR/empty-types.rs:385:11 + --> $DIR/empty-types.rs:389:11 | LL | match array_0_never {} | ^^^^^^^^^^^^^ @@ -429,13 +429,13 @@ LL + } | error: unreachable pattern - --> $DIR/empty-types.rs:392:9 + --> $DIR/empty-types.rs:396:9 | LL | _ => {} | ^ error[E0004]: non-exhaustive patterns: `[]` not covered - --> $DIR/empty-types.rs:394:11 + --> $DIR/empty-types.rs:398:11 | LL | match array_0_never { | ^^^^^^^^^^^^^ pattern `[]` not covered @@ -449,31 +449,31 @@ LL + [] => todo!() | error: unreachable pattern - --> $DIR/empty-types.rs:413:9 + --> $DIR/empty-types.rs:417:9 | LL | Some(_) => {} | ^^^^^^^ error: unreachable pattern - --> $DIR/empty-types.rs:418:9 + --> $DIR/empty-types.rs:422:9 | LL | Some(_a) => {} | ^^^^^^^^ error: unreachable pattern - --> $DIR/empty-types.rs:423:9 + --> $DIR/empty-types.rs:427:9 | LL | _ => {} | ^ error: unreachable pattern - --> $DIR/empty-types.rs:428:9 + --> $DIR/empty-types.rs:432:9 | LL | _a => {} | ^^ error[E0004]: non-exhaustive patterns: `&Some(_)` not covered - --> $DIR/empty-types.rs:448:11 + --> $DIR/empty-types.rs:452:11 | LL | match ref_opt_never { | ^^^^^^^^^^^^^ pattern `&Some(_)` not covered @@ -491,7 +491,7 @@ LL + &Some(_) => todo!() | error[E0004]: non-exhaustive patterns: `Some(_)` not covered - --> $DIR/empty-types.rs:489:11 + --> $DIR/empty-types.rs:493:11 | LL | match *ref_opt_never { | ^^^^^^^^^^^^^^ pattern `Some(_)` not covered @@ -509,7 +509,7 @@ LL + Some(_) => todo!() | error[E0004]: non-exhaustive patterns: `Err(_)` not covered - --> $DIR/empty-types.rs:537:11 + --> $DIR/empty-types.rs:541:11 | LL | match *ref_res_never { | ^^^^^^^^^^^^^^ pattern `Err(_)` not covered @@ -527,7 +527,7 @@ LL + Err(_) => todo!() | error[E0004]: non-exhaustive patterns: `Err(_)` not covered - --> $DIR/empty-types.rs:548:11 + --> $DIR/empty-types.rs:552:11 | LL | match *ref_res_never { | ^^^^^^^^^^^^^^ pattern `Err(_)` not covered @@ -545,7 +545,7 @@ LL + Err(_) => todo!() | error[E0004]: non-exhaustive patterns: type `(u32, !)` is non-empty - --> $DIR/empty-types.rs:567:11 + --> $DIR/empty-types.rs:571:11 | LL | match *ref_tuple_half_never {} | ^^^^^^^^^^^^^^^^^^^^^ @@ -559,31 +559,31 @@ LL + } | error: unreachable pattern - --> $DIR/empty-types.rs:600:9 + --> $DIR/empty-types.rs:604:9 | LL | _ => {} | ^ error: unreachable pattern - --> $DIR/empty-types.rs:603:9 + --> $DIR/empty-types.rs:607:9 | LL | _x => {} | ^^ error: unreachable pattern - --> $DIR/empty-types.rs:606:9 + --> $DIR/empty-types.rs:610:9 | LL | _ if false => {} | ^ error: unreachable pattern - --> $DIR/empty-types.rs:609:9 + --> $DIR/empty-types.rs:613:9 | LL | _x if false => {} | ^^ error[E0004]: non-exhaustive patterns: `&_` not covered - --> $DIR/empty-types.rs:634:11 + --> $DIR/empty-types.rs:638:11 | LL | match ref_never { | ^^^^^^^^^ pattern `&_` not covered @@ -597,8 +597,26 @@ LL ~ &_a if false => {}, LL + &_ => todo!() | +error[E0004]: non-exhaustive patterns: `Ok(_)` not covered + --> $DIR/empty-types.rs:654:11 + | +LL | match *ref_result_never { + | ^^^^^^^^^^^^^^^^^ pattern `Ok(_)` not covered + | +note: `Result<!, !>` defined here + --> $SRC_DIR/core/src/result.rs:LL:COL + ::: $SRC_DIR/core/src/result.rs:LL:COL + | + = note: not covered + = note: the matched value is of type `Result<!, !>` +help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown + | +LL ~ Err(_) => {}, +LL + Ok(_) => todo!() + | + error[E0004]: non-exhaustive patterns: `Some(_)` not covered - --> $DIR/empty-types.rs:662:11 + --> $DIR/empty-types.rs:674:11 | LL | match *x { | ^^ pattern `Some(_)` not covered @@ -615,7 +633,7 @@ LL ~ None => {}, LL + Some(_) => todo!() | -error: aborting due to 63 previous errors +error: aborting due to 64 previous errors Some errors have detailed explanations: E0004, E0005. For more information about an error, try `rustc --explain E0004`. diff --git a/tests/ui/pattern/usefulness/empty-types.never_pats.stderr b/tests/ui/pattern/usefulness/empty-types.never_pats.stderr new file mode 100644 index 00000000000..0ff2472922e --- /dev/null +++ b/tests/ui/pattern/usefulness/empty-types.never_pats.stderr @@ -0,0 +1,644 @@ +warning: the feature `never_patterns` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/empty-types.rs:14:33 + | +LL | #![cfg_attr(never_pats, feature(never_patterns))] + | ^^^^^^^^^^^^^^ + | + = note: see issue #118155 <https://github.com/rust-lang/rust/issues/118155> for more information + = note: `#[warn(incomplete_features)]` on by default + +error: unreachable pattern + --> $DIR/empty-types.rs:51:9 + | +LL | _ => {} + | ^ + | +note: the lint level is defined here + --> $DIR/empty-types.rs:17:9 + | +LL | #![deny(unreachable_patterns)] + | ^^^^^^^^^^^^^^^^^^^^ + +error: unreachable pattern + --> $DIR/empty-types.rs:54:9 + | +LL | _x => {} + | ^^ + +error[E0004]: non-exhaustive patterns: type `&!` is non-empty + --> $DIR/empty-types.rs:58:11 + | +LL | match ref_never {} + | ^^^^^^^^^ + | + = note: the matched value is of type `&!` + = note: references are always considered inhabited +help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown + | +LL ~ match ref_never { +LL + _ => todo!(), +LL + } + | + +error[E0004]: non-exhaustive patterns: type `(u32, !)` is non-empty + --> $DIR/empty-types.rs:70:11 + | +LL | match tuple_half_never {} + | ^^^^^^^^^^^^^^^^ + | + = note: the matched value is of type `(u32, !)` +help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown + | +LL ~ match tuple_half_never { +LL + _ => todo!(), +LL + } + | + +error[E0004]: non-exhaustive patterns: type `(!, !)` is non-empty + --> $DIR/empty-types.rs:77:11 + | +LL | match tuple_never {} + | ^^^^^^^^^^^ + | + = note: the matched value is of type `(!, !)` +help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown + | +LL ~ match tuple_never { +LL + _ => todo!(), +LL + } + | + +error: unreachable pattern + --> $DIR/empty-types.rs:87:9 + | +LL | _ => {} + | ^ + +error[E0004]: non-exhaustive patterns: `Ok(_)` and `Err(!)` not covered + --> $DIR/empty-types.rs:91:11 + | +LL | match res_u32_never {} + | ^^^^^^^^^^^^^ patterns `Ok(_)` and `Err(!)` not covered + | +note: `Result<u32, !>` defined here + --> $SRC_DIR/core/src/result.rs:LL:COL + ::: $SRC_DIR/core/src/result.rs:LL:COL + | + = note: not covered + ::: $SRC_DIR/core/src/result.rs:LL:COL + | + = note: not covered + = note: the matched value is of type `Result<u32, !>` +help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms + | +LL ~ match res_u32_never { +LL + Ok(_) | Err(!) => todo!(), +LL + } + | + +error[E0004]: non-exhaustive patterns: `Err(!)` not covered + --> $DIR/empty-types.rs:93:11 + | +LL | match res_u32_never { + | ^^^^^^^^^^^^^ pattern `Err(!)` not covered + | +note: `Result<u32, !>` defined here + --> $SRC_DIR/core/src/result.rs:LL:COL + ::: $SRC_DIR/core/src/result.rs:LL:COL + | + = note: not covered + = note: the matched value is of type `Result<u32, !>` +help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown + | +LL ~ Ok(_) => {}, +LL + Err(!) + | + +error[E0004]: non-exhaustive patterns: `Ok(1_u32..=u32::MAX)` not covered + --> $DIR/empty-types.rs:101:11 + | +LL | match res_u32_never { + | ^^^^^^^^^^^^^ pattern `Ok(1_u32..=u32::MAX)` not covered + | +note: `Result<u32, !>` defined here + --> $SRC_DIR/core/src/result.rs:LL:COL + ::: $SRC_DIR/core/src/result.rs:LL:COL + | + = note: not covered + = note: the matched value is of type `Result<u32, !>` +help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown + | +LL ~ Err(_) => {}, +LL ~ Ok(1_u32..=u32::MAX) => todo!() + | + +error[E0005]: refutable pattern in local binding + --> $DIR/empty-types.rs:106:9 + | +LL | let Ok(_x) = res_u32_never; + | ^^^^^^ pattern `Err(!)` not covered + | + = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant + = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: the matched value is of type `Result<u32, !>` +help: you might want to use `let else` to handle the variant that isn't matched + | +LL | let Ok(_x) = res_u32_never else { todo!() }; + | ++++++++++++++++ + +error[E0005]: refutable pattern in local binding + --> $DIR/empty-types.rs:108:9 + | +LL | let Ok(_x) = res_u32_never.as_ref(); + | ^^^^^^ pattern `Err(_)` not covered + | + = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant + = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: the matched value is of type `Result<&u32, &!>` +help: you might want to use `let else` to handle the variant that isn't matched + | +LL | let Ok(_x) = res_u32_never.as_ref() else { todo!() }; + | ++++++++++++++++ + +error[E0005]: refutable pattern in local binding + --> $DIR/empty-types.rs:112:9 + | +LL | let Ok(_x) = &res_u32_never; + | ^^^^^^ pattern `&Err(!)` not covered + | + = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant + = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: the matched value is of type `&Result<u32, !>` +help: you might want to use `let else` to handle the variant that isn't matched + | +LL | let Ok(_x) = &res_u32_never else { todo!() }; + | ++++++++++++++++ + +error[E0004]: non-exhaustive patterns: `Ok(!)` and `Err(!)` not covered + --> $DIR/empty-types.rs:116:11 + | +LL | match result_never {} + | ^^^^^^^^^^^^ patterns `Ok(!)` and `Err(!)` not covered + | +note: `Result<!, !>` defined here + --> $SRC_DIR/core/src/result.rs:LL:COL + ::: $SRC_DIR/core/src/result.rs:LL:COL + | + = note: not covered + ::: $SRC_DIR/core/src/result.rs:LL:COL + | + = note: not covered + = note: the matched value is of type `Result<!, !>` +help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms + | +LL ~ match result_never { +LL + Ok(!) | Err(!), +LL + } + | + +error[E0004]: non-exhaustive patterns: `Err(!)` not covered + --> $DIR/empty-types.rs:121:11 + | +LL | match result_never { + | ^^^^^^^^^^^^ pattern `Err(!)` not covered + | +note: `Result<!, !>` defined here + --> $SRC_DIR/core/src/result.rs:LL:COL + ::: $SRC_DIR/core/src/result.rs:LL:COL + | + = note: not covered + = note: the matched value is of type `Result<!, !>` +help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown + | +LL | Ok(_) => {}, Err(!) + | ++++++++ + +error: unreachable pattern + --> $DIR/empty-types.rs:140:13 + | +LL | _ => {} + | ^ + +error: unreachable pattern + --> $DIR/empty-types.rs:143:13 + | +LL | _ if false => {} + | ^ + +error[E0004]: non-exhaustive patterns: `Some(!)` not covered + --> $DIR/empty-types.rs:146:15 + | +LL | match opt_void { + | ^^^^^^^^ pattern `Some(!)` not covered + | +note: `Option<Void>` defined here + --> $SRC_DIR/core/src/option.rs:LL:COL + ::: $SRC_DIR/core/src/option.rs:LL:COL + | + = note: not covered + = note: the matched value is of type `Option<Void>` +help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown + | +LL ~ None => {}, +LL + Some(!) + | + +error[E0004]: non-exhaustive patterns: `Some(!)` not covered + --> $DIR/empty-types.rs:165:15 + | +LL | match *ref_opt_void { + | ^^^^^^^^^^^^^ pattern `Some(!)` not covered + | +note: `Option<Void>` defined here + --> $SRC_DIR/core/src/option.rs:LL:COL + ::: $SRC_DIR/core/src/option.rs:LL:COL + | + = note: not covered + = note: the matched value is of type `Option<Void>` +help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown + | +LL ~ None => {}, +LL + Some(!) + | + +error: unreachable pattern + --> $DIR/empty-types.rs:208:13 + | +LL | _ => {} + | ^ + +error: unreachable pattern + --> $DIR/empty-types.rs:213:13 + | +LL | _ => {} + | ^ + +error: unreachable pattern + --> $DIR/empty-types.rs:218:13 + | +LL | _ => {} + | ^ + +error: unreachable pattern + --> $DIR/empty-types.rs:223:13 + | +LL | _ => {} + | ^ + +error: unreachable pattern + --> $DIR/empty-types.rs:229:13 + | +LL | _ => {} + | ^ + +error: unreachable pattern + --> $DIR/empty-types.rs:288:9 + | +LL | _ => {} + | ^ + +error[E0004]: non-exhaustive patterns: type `(u32, !)` is non-empty + --> $DIR/empty-types.rs:316:11 + | +LL | match *x {} + | ^^ + | + = note: the matched value is of type `(u32, !)` +help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown + | +LL ~ match *x { +LL + _ => todo!(), +LL ~ } + | + +error[E0004]: non-exhaustive patterns: type `(!, !)` is non-empty + --> $DIR/empty-types.rs:318:11 + | +LL | match *x {} + | ^^ + | + = note: the matched value is of type `(!, !)` +help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown + | +LL ~ match *x { +LL + _ => todo!(), +LL ~ } + | + +error[E0004]: non-exhaustive patterns: `Ok(!)` and `Err(!)` not covered + --> $DIR/empty-types.rs:320:11 + | +LL | match *x {} + | ^^ patterns `Ok(!)` and `Err(!)` not covered + | +note: `Result<!, !>` defined here + --> $SRC_DIR/core/src/result.rs:LL:COL + ::: $SRC_DIR/core/src/result.rs:LL:COL + | + = note: not covered + ::: $SRC_DIR/core/src/result.rs:LL:COL + | + = note: not covered + = note: the matched value is of type `Result<!, !>` +help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms + | +LL ~ match *x { +LL + Ok(!) | Err(!), +LL ~ } + | + +error[E0004]: non-exhaustive patterns: type `[!; 3]` is non-empty + --> $DIR/empty-types.rs:322:11 + | +LL | match *x {} + | ^^ + | + = note: the matched value is of type `[!; 3]` +help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown + | +LL ~ match *x { +LL + _ => todo!(), +LL ~ } + | + +error[E0004]: non-exhaustive patterns: type `&[!]` is non-empty + --> $DIR/empty-types.rs:327:11 + | +LL | match slice_never {} + | ^^^^^^^^^^^ + | + = note: the matched value is of type `&[!]` +help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown + | +LL ~ match slice_never { +LL + _ => todo!(), +LL + } + | + +error[E0004]: non-exhaustive patterns: `&[!, ..]` not covered + --> $DIR/empty-types.rs:329:11 + | +LL | match slice_never { + | ^^^^^^^^^^^ pattern `&[!, ..]` not covered + | + = note: the matched value is of type `&[!]` +help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown + | +LL ~ [] => {}, +LL + &[!, ..] + | + +error[E0004]: non-exhaustive patterns: `&[]`, `&[!]` and `&[!, !]` not covered + --> $DIR/empty-types.rs:338:11 + | +LL | match slice_never { + | ^^^^^^^^^^^ patterns `&[]`, `&[!]` and `&[!, !]` not covered + | + = note: the matched value is of type `&[!]` +help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms + | +LL ~ [_, _, _, ..] => {}, +LL + &[] | &[!] | &[!, !] => todo!() + | + +error[E0004]: non-exhaustive patterns: `&[]` and `&[!, ..]` not covered + --> $DIR/empty-types.rs:352:11 + | +LL | match slice_never { + | ^^^^^^^^^^^ patterns `&[]` and `&[!, ..]` not covered + | + = note: the matched value is of type `&[!]` + = note: match arms with guards don't count towards exhaustivity +help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms + | +LL ~ &[..] if false => {}, +LL + &[] | &[!, ..] => todo!() + | + +error[E0004]: non-exhaustive patterns: type `[!]` is non-empty + --> $DIR/empty-types.rs:359:11 + | +LL | match *slice_never {} + | ^^^^^^^^^^^^ + | + = note: the matched value is of type `[!]` +help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown + | +LL ~ match *slice_never { +LL + _ => todo!(), +LL + } + | + +error[E0004]: non-exhaustive patterns: type `[!; 3]` is non-empty + --> $DIR/empty-types.rs:366:11 + | +LL | match array_3_never {} + | ^^^^^^^^^^^^^ + | + = note: the matched value is of type `[!; 3]` +help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown + | +LL ~ match array_3_never { +LL + _ => todo!(), +LL + } + | + +error[E0004]: non-exhaustive patterns: type `[!; 0]` is non-empty + --> $DIR/empty-types.rs:389:11 + | +LL | match array_0_never {} + | ^^^^^^^^^^^^^ + | + = note: the matched value is of type `[!; 0]` +help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown + | +LL ~ match array_0_never { +LL + _ => todo!(), +LL + } + | + +error: unreachable pattern + --> $DIR/empty-types.rs:396:9 + | +LL | _ => {} + | ^ + +error[E0004]: non-exhaustive patterns: `[]` not covered + --> $DIR/empty-types.rs:398:11 + | +LL | match array_0_never { + | ^^^^^^^^^^^^^ pattern `[]` not covered + | + = note: the matched value is of type `[!; 0]` + = note: match arms with guards don't count towards exhaustivity +help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown + | +LL ~ [..] if false => {}, +LL + [] => todo!() + | + +error[E0004]: non-exhaustive patterns: `&Some(!)` not covered + --> $DIR/empty-types.rs:452:11 + | +LL | match ref_opt_never { + | ^^^^^^^^^^^^^ pattern `&Some(!)` not covered + | +note: `Option<!>` defined here + --> $SRC_DIR/core/src/option.rs:LL:COL + ::: $SRC_DIR/core/src/option.rs:LL:COL + | + = note: not covered + = note: the matched value is of type `&Option<!>` +help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown + | +LL ~ &None => {}, +LL + &Some(!) + | + +error[E0004]: non-exhaustive patterns: `Some(!)` not covered + --> $DIR/empty-types.rs:493:11 + | +LL | match *ref_opt_never { + | ^^^^^^^^^^^^^^ pattern `Some(!)` not covered + | +note: `Option<!>` defined here + --> $SRC_DIR/core/src/option.rs:LL:COL + ::: $SRC_DIR/core/src/option.rs:LL:COL + | + = note: not covered + = note: the matched value is of type `Option<!>` +help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown + | +LL ~ None => {}, +LL + Some(!) + | + +error[E0004]: non-exhaustive patterns: `Err(!)` not covered + --> $DIR/empty-types.rs:541:11 + | +LL | match *ref_res_never { + | ^^^^^^^^^^^^^^ pattern `Err(!)` not covered + | +note: `Result<!, !>` defined here + --> $SRC_DIR/core/src/result.rs:LL:COL + ::: $SRC_DIR/core/src/result.rs:LL:COL + | + = note: not covered + = note: the matched value is of type `Result<!, !>` +help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown + | +LL ~ Ok(_) => {}, +LL + Err(!) + | + +error[E0004]: non-exhaustive patterns: `Err(!)` not covered + --> $DIR/empty-types.rs:552:11 + | +LL | match *ref_res_never { + | ^^^^^^^^^^^^^^ pattern `Err(!)` not covered + | +note: `Result<!, !>` defined here + --> $SRC_DIR/core/src/result.rs:LL:COL + ::: $SRC_DIR/core/src/result.rs:LL:COL + | + = note: not covered + = note: the matched value is of type `Result<!, !>` +help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown + | +LL ~ Ok(_a) => {}, +LL + Err(!) + | + +error[E0004]: non-exhaustive patterns: type `(u32, !)` is non-empty + --> $DIR/empty-types.rs:571:11 + | +LL | match *ref_tuple_half_never {} + | ^^^^^^^^^^^^^^^^^^^^^ + | + = note: the matched value is of type `(u32, !)` +help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown + | +LL ~ match *ref_tuple_half_never { +LL + _ => todo!(), +LL + } + | + +error: unreachable pattern + --> $DIR/empty-types.rs:604:9 + | +LL | _ => {} + | ^ + +error: unreachable pattern + --> $DIR/empty-types.rs:607:9 + | +LL | _x => {} + | ^^ + +error: unreachable pattern + --> $DIR/empty-types.rs:610:9 + | +LL | _ if false => {} + | ^ + +error: unreachable pattern + --> $DIR/empty-types.rs:613:9 + | +LL | _x if false => {} + | ^^ + +error[E0004]: non-exhaustive patterns: `&!` not covered + --> $DIR/empty-types.rs:638:11 + | +LL | match ref_never { + | ^^^^^^^^^ pattern `&!` not covered + | + = note: the matched value is of type `&!` + = note: references are always considered inhabited + = note: match arms with guards don't count towards exhaustivity +help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown + | +LL ~ &_a if false => {}, +LL + &! + | + +error[E0004]: non-exhaustive patterns: `Ok(!)` not covered + --> $DIR/empty-types.rs:654:11 + | +LL | match *ref_result_never { + | ^^^^^^^^^^^^^^^^^ pattern `Ok(!)` not covered + | +note: `Result<!, !>` defined here + --> $SRC_DIR/core/src/result.rs:LL:COL + ::: $SRC_DIR/core/src/result.rs:LL:COL + | + = note: not covered + = note: the matched value is of type `Result<!, !>` +help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown + | +LL ~ Err(_) => {}, +LL + Ok(!) + | + +error[E0004]: non-exhaustive patterns: `Some(!)` not covered + --> $DIR/empty-types.rs:674:11 + | +LL | match *x { + | ^^ pattern `Some(!)` not covered + | +note: `Option<Result<!, !>>` defined here + --> $SRC_DIR/core/src/option.rs:LL:COL + ::: $SRC_DIR/core/src/option.rs:LL:COL + | + = note: not covered + = note: the matched value is of type `Option<Result<!, !>>` +help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown + | +LL ~ None => {}, +LL + Some(!) + | + +error: aborting due to 49 previous errors; 1 warning emitted + +Some errors have detailed explanations: E0004, E0005. +For more information about an error, try `rustc --explain E0004`. diff --git a/tests/ui/pattern/usefulness/empty-types.normal.stderr b/tests/ui/pattern/usefulness/empty-types.normal.stderr index dc01ac4ddce..1d13802a2bd 100644 --- a/tests/ui/pattern/usefulness/empty-types.normal.stderr +++ b/tests/ui/pattern/usefulness/empty-types.normal.stderr @@ -1,23 +1,23 @@ error: unreachable pattern - --> $DIR/empty-types.rs:49:9 + --> $DIR/empty-types.rs:51:9 | LL | _ => {} | ^ | note: the lint level is defined here - --> $DIR/empty-types.rs:15:9 + --> $DIR/empty-types.rs:17:9 | LL | #![deny(unreachable_patterns)] | ^^^^^^^^^^^^^^^^^^^^ error: unreachable pattern - --> $DIR/empty-types.rs:52:9 + --> $DIR/empty-types.rs:54:9 | LL | _x => {} | ^^ error[E0004]: non-exhaustive patterns: type `&!` is non-empty - --> $DIR/empty-types.rs:56:11 + --> $DIR/empty-types.rs:58:11 | LL | match ref_never {} | ^^^^^^^^^ @@ -32,7 +32,7 @@ LL + } | error[E0004]: non-exhaustive patterns: type `(u32, !)` is non-empty - --> $DIR/empty-types.rs:68:11 + --> $DIR/empty-types.rs:70:11 | LL | match tuple_half_never {} | ^^^^^^^^^^^^^^^^ @@ -46,7 +46,7 @@ LL + } | error[E0004]: non-exhaustive patterns: type `(!, !)` is non-empty - --> $DIR/empty-types.rs:75:11 + --> $DIR/empty-types.rs:77:11 | LL | match tuple_never {} | ^^^^^^^^^^^ @@ -60,13 +60,13 @@ LL + } | error: unreachable pattern - --> $DIR/empty-types.rs:85:9 + --> $DIR/empty-types.rs:87:9 | LL | _ => {} | ^ error[E0004]: non-exhaustive patterns: `Ok(_)` and `Err(_)` not covered - --> $DIR/empty-types.rs:89:11 + --> $DIR/empty-types.rs:91:11 | LL | match res_u32_never {} | ^^^^^^^^^^^^^ patterns `Ok(_)` and `Err(_)` not covered @@ -88,7 +88,7 @@ LL + } | error[E0004]: non-exhaustive patterns: `Err(_)` not covered - --> $DIR/empty-types.rs:91:11 + --> $DIR/empty-types.rs:93:11 | LL | match res_u32_never { | ^^^^^^^^^^^^^ pattern `Err(_)` not covered @@ -106,7 +106,7 @@ LL + Err(_) => todo!() | error[E0004]: non-exhaustive patterns: `Ok(1_u32..=u32::MAX)` not covered - --> $DIR/empty-types.rs:99:11 + --> $DIR/empty-types.rs:101:11 | LL | match res_u32_never { | ^^^^^^^^^^^^^ pattern `Ok(1_u32..=u32::MAX)` not covered @@ -124,7 +124,7 @@ LL ~ Ok(1_u32..=u32::MAX) => todo!() | error[E0005]: refutable pattern in local binding - --> $DIR/empty-types.rs:104:9 + --> $DIR/empty-types.rs:106:9 | LL | let Ok(_x) = res_u32_never; | ^^^^^^ pattern `Err(_)` not covered @@ -138,7 +138,7 @@ LL | let Ok(_x) = res_u32_never else { todo!() }; | ++++++++++++++++ error[E0005]: refutable pattern in local binding - --> $DIR/empty-types.rs:106:9 + --> $DIR/empty-types.rs:108:9 | LL | let Ok(_x) = res_u32_never.as_ref(); | ^^^^^^ pattern `Err(_)` not covered @@ -152,7 +152,7 @@ LL | let Ok(_x) = res_u32_never.as_ref() else { todo!() }; | ++++++++++++++++ error[E0005]: refutable pattern in local binding - --> $DIR/empty-types.rs:110:9 + --> $DIR/empty-types.rs:112:9 | LL | let Ok(_x) = &res_u32_never; | ^^^^^^ pattern `&Err(_)` not covered @@ -166,7 +166,7 @@ LL | let Ok(_x) = &res_u32_never else { todo!() }; | ++++++++++++++++ error[E0004]: non-exhaustive patterns: `Ok(_)` and `Err(_)` not covered - --> $DIR/empty-types.rs:114:11 + --> $DIR/empty-types.rs:116:11 | LL | match result_never {} | ^^^^^^^^^^^^ patterns `Ok(_)` and `Err(_)` not covered @@ -188,7 +188,7 @@ LL + } | error[E0004]: non-exhaustive patterns: `Err(_)` not covered - --> $DIR/empty-types.rs:119:11 + --> $DIR/empty-types.rs:121:11 | LL | match result_never { | ^^^^^^^^^^^^ pattern `Err(_)` not covered @@ -205,19 +205,19 @@ LL | Ok(_) => {}, Err(_) => todo!() | +++++++++++++++++++ error: unreachable pattern - --> $DIR/empty-types.rs:138:13 + --> $DIR/empty-types.rs:140:13 | LL | _ => {} | ^ error: unreachable pattern - --> $DIR/empty-types.rs:141:13 + --> $DIR/empty-types.rs:143:13 | LL | _ if false => {} | ^ error[E0004]: non-exhaustive patterns: `Some(_)` not covered - --> $DIR/empty-types.rs:144:15 + --> $DIR/empty-types.rs:146:15 | LL | match opt_void { | ^^^^^^^^ pattern `Some(_)` not covered @@ -235,7 +235,7 @@ LL + Some(_) => todo!() | error[E0004]: non-exhaustive patterns: `Some(_)` not covered - --> $DIR/empty-types.rs:163:15 + --> $DIR/empty-types.rs:165:15 | LL | match *ref_opt_void { | ^^^^^^^^^^^^^ pattern `Some(_)` not covered @@ -253,43 +253,43 @@ LL + Some(_) => todo!() | error: unreachable pattern - --> $DIR/empty-types.rs:206:13 + --> $DIR/empty-types.rs:208:13 | LL | _ => {} | ^ error: unreachable pattern - --> $DIR/empty-types.rs:211:13 + --> $DIR/empty-types.rs:213:13 | LL | _ => {} | ^ error: unreachable pattern - --> $DIR/empty-types.rs:216:13 + --> $DIR/empty-types.rs:218:13 | LL | _ => {} | ^ error: unreachable pattern - --> $DIR/empty-types.rs:221:13 + --> $DIR/empty-types.rs:223:13 | LL | _ => {} | ^ error: unreachable pattern - --> $DIR/empty-types.rs:227:13 + --> $DIR/empty-types.rs:229:13 | LL | _ => {} | ^ error: unreachable pattern - --> $DIR/empty-types.rs:286:9 + --> $DIR/empty-types.rs:288:9 | LL | _ => {} | ^ error[E0004]: non-exhaustive patterns: type `(u32, !)` is non-empty - --> $DIR/empty-types.rs:314:11 + --> $DIR/empty-types.rs:316:11 | LL | match *x {} | ^^ @@ -303,7 +303,7 @@ LL ~ } | error[E0004]: non-exhaustive patterns: type `(!, !)` is non-empty - --> $DIR/empty-types.rs:316:11 + --> $DIR/empty-types.rs:318:11 | LL | match *x {} | ^^ @@ -317,7 +317,7 @@ LL ~ } | error[E0004]: non-exhaustive patterns: `Ok(_)` and `Err(_)` not covered - --> $DIR/empty-types.rs:318:11 + --> $DIR/empty-types.rs:320:11 | LL | match *x {} | ^^ patterns `Ok(_)` and `Err(_)` not covered @@ -339,7 +339,7 @@ LL ~ } | error[E0004]: non-exhaustive patterns: type `[!; 3]` is non-empty - --> $DIR/empty-types.rs:320:11 + --> $DIR/empty-types.rs:322:11 | LL | match *x {} | ^^ @@ -353,7 +353,7 @@ LL ~ } | error[E0004]: non-exhaustive patterns: type `&[!]` is non-empty - --> $DIR/empty-types.rs:325:11 + --> $DIR/empty-types.rs:327:11 | LL | match slice_never {} | ^^^^^^^^^^^ @@ -367,7 +367,7 @@ LL + } | error[E0004]: non-exhaustive patterns: `&[_, ..]` not covered - --> $DIR/empty-types.rs:327:11 + --> $DIR/empty-types.rs:329:11 | LL | match slice_never { | ^^^^^^^^^^^ pattern `&[_, ..]` not covered @@ -380,7 +380,7 @@ LL + &[_, ..] => todo!() | error[E0004]: non-exhaustive patterns: `&[]`, `&[_]` and `&[_, _]` not covered - --> $DIR/empty-types.rs:336:11 + --> $DIR/empty-types.rs:338:11 | LL | match slice_never { | ^^^^^^^^^^^ patterns `&[]`, `&[_]` and `&[_, _]` not covered @@ -393,7 +393,7 @@ LL + &[] | &[_] | &[_, _] => todo!() | error[E0004]: non-exhaustive patterns: `&[]` and `&[_, ..]` not covered - --> $DIR/empty-types.rs:349:11 + --> $DIR/empty-types.rs:352:11 | LL | match slice_never { | ^^^^^^^^^^^ patterns `&[]` and `&[_, ..]` not covered @@ -407,7 +407,7 @@ LL + &[] | &[_, ..] => todo!() | error[E0004]: non-exhaustive patterns: type `[!]` is non-empty - --> $DIR/empty-types.rs:355:11 + --> $DIR/empty-types.rs:359:11 | LL | match *slice_never {} | ^^^^^^^^^^^^ @@ -421,7 +421,7 @@ LL + } | error[E0004]: non-exhaustive patterns: type `[!; 3]` is non-empty - --> $DIR/empty-types.rs:362:11 + --> $DIR/empty-types.rs:366:11 | LL | match array_3_never {} | ^^^^^^^^^^^^^ @@ -435,7 +435,7 @@ LL + } | error[E0004]: non-exhaustive patterns: type `[!; 0]` is non-empty - --> $DIR/empty-types.rs:385:11 + --> $DIR/empty-types.rs:389:11 | LL | match array_0_never {} | ^^^^^^^^^^^^^ @@ -449,13 +449,13 @@ LL + } | error: unreachable pattern - --> $DIR/empty-types.rs:392:9 + --> $DIR/empty-types.rs:396:9 | LL | _ => {} | ^ error[E0004]: non-exhaustive patterns: `[]` not covered - --> $DIR/empty-types.rs:394:11 + --> $DIR/empty-types.rs:398:11 | LL | match array_0_never { | ^^^^^^^^^^^^^ pattern `[]` not covered @@ -469,7 +469,7 @@ LL + [] => todo!() | error[E0004]: non-exhaustive patterns: `&Some(_)` not covered - --> $DIR/empty-types.rs:448:11 + --> $DIR/empty-types.rs:452:11 | LL | match ref_opt_never { | ^^^^^^^^^^^^^ pattern `&Some(_)` not covered @@ -487,7 +487,7 @@ LL + &Some(_) => todo!() | error[E0004]: non-exhaustive patterns: `Some(_)` not covered - --> $DIR/empty-types.rs:489:11 + --> $DIR/empty-types.rs:493:11 | LL | match *ref_opt_never { | ^^^^^^^^^^^^^^ pattern `Some(_)` not covered @@ -505,7 +505,7 @@ LL + Some(_) => todo!() | error[E0004]: non-exhaustive patterns: `Err(_)` not covered - --> $DIR/empty-types.rs:537:11 + --> $DIR/empty-types.rs:541:11 | LL | match *ref_res_never { | ^^^^^^^^^^^^^^ pattern `Err(_)` not covered @@ -523,7 +523,7 @@ LL + Err(_) => todo!() | error[E0004]: non-exhaustive patterns: `Err(_)` not covered - --> $DIR/empty-types.rs:548:11 + --> $DIR/empty-types.rs:552:11 | LL | match *ref_res_never { | ^^^^^^^^^^^^^^ pattern `Err(_)` not covered @@ -541,7 +541,7 @@ LL + Err(_) => todo!() | error[E0004]: non-exhaustive patterns: type `(u32, !)` is non-empty - --> $DIR/empty-types.rs:567:11 + --> $DIR/empty-types.rs:571:11 | LL | match *ref_tuple_half_never {} | ^^^^^^^^^^^^^^^^^^^^^ @@ -555,31 +555,31 @@ LL + } | error: unreachable pattern - --> $DIR/empty-types.rs:600:9 + --> $DIR/empty-types.rs:604:9 | LL | _ => {} | ^ error: unreachable pattern - --> $DIR/empty-types.rs:603:9 + --> $DIR/empty-types.rs:607:9 | LL | _x => {} | ^^ error: unreachable pattern - --> $DIR/empty-types.rs:606:9 + --> $DIR/empty-types.rs:610:9 | LL | _ if false => {} | ^ error: unreachable pattern - --> $DIR/empty-types.rs:609:9 + --> $DIR/empty-types.rs:613:9 | LL | _x if false => {} | ^^ error[E0004]: non-exhaustive patterns: `&_` not covered - --> $DIR/empty-types.rs:634:11 + --> $DIR/empty-types.rs:638:11 | LL | match ref_never { | ^^^^^^^^^ pattern `&_` not covered @@ -593,8 +593,26 @@ LL ~ &_a if false => {}, LL + &_ => todo!() | +error[E0004]: non-exhaustive patterns: `Ok(_)` not covered + --> $DIR/empty-types.rs:654:11 + | +LL | match *ref_result_never { + | ^^^^^^^^^^^^^^^^^ pattern `Ok(_)` not covered + | +note: `Result<!, !>` defined here + --> $SRC_DIR/core/src/result.rs:LL:COL + ::: $SRC_DIR/core/src/result.rs:LL:COL + | + = note: not covered + = note: the matched value is of type `Result<!, !>` +help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown + | +LL ~ Err(_) => {}, +LL + Ok(_) => todo!() + | + error[E0004]: non-exhaustive patterns: `Some(_)` not covered - --> $DIR/empty-types.rs:662:11 + --> $DIR/empty-types.rs:674:11 | LL | match *x { | ^^ pattern `Some(_)` not covered @@ -611,7 +629,7 @@ LL ~ None => {}, LL + Some(_) => todo!() | -error: aborting due to 48 previous errors +error: aborting due to 49 previous errors Some errors have detailed explanations: E0004, E0005. For more information about an error, try `rustc --explain E0004`. diff --git a/tests/ui/pattern/usefulness/empty-types.rs b/tests/ui/pattern/usefulness/empty-types.rs index 06651613010..cc71f67831d 100644 --- a/tests/ui/pattern/usefulness/empty-types.rs +++ b/tests/ui/pattern/usefulness/empty-types.rs @@ -1,4 +1,4 @@ -//@ revisions: normal min_exh_pats exhaustive_patterns +//@ revisions: normal min_exh_pats exhaustive_patterns never_pats // gate-test-min_exhaustive_patterns // // This tests correct handling of empty types in exhaustiveness checking. @@ -11,6 +11,8 @@ #![feature(never_type_fallback)] #![cfg_attr(exhaustive_patterns, feature(exhaustive_patterns))] #![cfg_attr(min_exh_pats, feature(min_exhaustive_patterns))] +#![cfg_attr(never_pats, feature(never_patterns))] +//[never_pats]~^ WARN the feature `never_patterns` is incomplete #![allow(dead_code, unreachable_code)] #![deny(unreachable_patterns)] @@ -66,14 +68,14 @@ fn basic(x: NeverBundle) { let tuple_half_never: (u32, !) = x.tuple_half_never; match tuple_half_never {} - //[normal]~^ ERROR non-empty + //[normal,never_pats]~^ ERROR non-empty match tuple_half_never { (_, _) => {} //[exhaustive_patterns,min_exh_pats]~ ERROR unreachable pattern } let tuple_never: (!, !) = x.tuple_never; match tuple_never {} - //[normal]~^ ERROR non-empty + //[normal,never_pats]~^ ERROR non-empty match tuple_never { _ => {} //[exhaustive_patterns,min_exh_pats]~ ERROR unreachable pattern } @@ -89,7 +91,7 @@ fn basic(x: NeverBundle) { match res_u32_never {} //~^ ERROR non-exhaustive match res_u32_never { - //[normal]~^ ERROR non-exhaustive + //[normal,never_pats]~^ ERROR non-exhaustive Ok(_) => {} } match res_u32_never { @@ -102,22 +104,22 @@ fn basic(x: NeverBundle) { Err(_) => {} //[exhaustive_patterns,min_exh_pats]~ ERROR unreachable pattern } let Ok(_x) = res_u32_never; - //[normal]~^ ERROR refutable + //[normal,never_pats]~^ ERROR refutable let Ok(_x) = res_u32_never.as_ref(); //~^ ERROR refutable // Non-obvious difference: here there's an implicit dereference in the patterns, which makes the // inner place !known_valid. `exhaustive_patterns` ignores this. let Ok(_x) = &res_u32_never; - //[normal,min_exh_pats]~^ ERROR refutable + //[normal,min_exh_pats,never_pats]~^ ERROR refutable let result_never: Result<!, !> = x.result_never; match result_never {} - //[normal]~^ ERROR non-exhaustive + //[normal,never_pats]~^ ERROR non-exhaustive match result_never { _ => {} //[exhaustive_patterns,min_exh_pats]~ ERROR unreachable pattern } match result_never { - //[normal]~^ ERROR non-exhaustive + //[normal,never_pats]~^ ERROR non-exhaustive Ok(_) => {} //[exhaustive_patterns,min_exh_pats]~ ERROR unreachable pattern } match result_never { @@ -142,7 +144,7 @@ fn void_same_as_never(x: NeverBundle) { } let opt_void: Option<Void> = None; match opt_void { - //[normal]~^ ERROR non-exhaustive + //[normal,never_pats]~^ ERROR non-exhaustive None => {} } match opt_void { @@ -161,7 +163,7 @@ fn void_same_as_never(x: NeverBundle) { } let ref_opt_void: &Option<Void> = &None; match *ref_opt_void { - //[normal,min_exh_pats]~^ ERROR non-exhaustive + //[normal,min_exh_pats,never_pats]~^ ERROR non-exhaustive None => {} } match *ref_opt_void { @@ -311,13 +313,13 @@ fn invalid_empty_match(bundle: NeverBundle) { match *x {} let x: &(u32, !) = &bundle.tuple_half_never; - match *x {} //[normal,min_exh_pats]~ ERROR non-exhaustive + match *x {} //[normal,min_exh_pats,never_pats]~ ERROR non-exhaustive let x: &(!, !) = &bundle.tuple_never; - match *x {} //[normal,min_exh_pats]~ ERROR non-exhaustive + match *x {} //[normal,min_exh_pats,never_pats]~ ERROR non-exhaustive let x: &Result<!, !> = &bundle.result_never; - match *x {} //[normal,min_exh_pats]~ ERROR non-exhaustive + match *x {} //[normal,min_exh_pats,never_pats]~ ERROR non-exhaustive let x: &[!; 3] = &bundle.array_3_never; - match *x {} //[normal,min_exh_pats]~ ERROR non-exhaustive + match *x {} //[normal,min_exh_pats,never_pats]~ ERROR non-exhaustive } fn arrays_and_slices(x: NeverBundle) { @@ -325,7 +327,7 @@ fn arrays_and_slices(x: NeverBundle) { match slice_never {} //~^ ERROR non-empty match slice_never { - //[normal,min_exh_pats]~^ ERROR not covered + //[normal,min_exh_pats,never_pats]~^ ERROR not covered [] => {} } match slice_never { @@ -336,6 +338,7 @@ fn arrays_and_slices(x: NeverBundle) { match slice_never { //[normal,min_exh_pats]~^ ERROR `&[]`, `&[_]` and `&[_, _]` not covered //[exhaustive_patterns]~^^ ERROR `&[]` not covered + //[never_pats]~^^^ ERROR `&[]`, `&[!]` and `&[!, !]` not covered [_, _, _, ..] => {} } match slice_never { @@ -349,6 +352,7 @@ fn arrays_and_slices(x: NeverBundle) { match slice_never { //[normal,min_exh_pats]~^ ERROR `&[]` and `&[_, ..]` not covered //[exhaustive_patterns]~^^ ERROR `&[]` not covered + //[never_pats]~^^^ ERROR `&[]` and `&[!, ..]` not covered &[..] if false => {} } @@ -360,7 +364,7 @@ fn arrays_and_slices(x: NeverBundle) { let array_3_never: [!; 3] = x.array_3_never; match array_3_never {} - //[normal]~^ ERROR non-empty + //[normal,never_pats]~^ ERROR non-empty match array_3_never { _ => {} //[exhaustive_patterns,min_exh_pats]~ ERROR unreachable pattern } @@ -446,7 +450,7 @@ fn bindings(x: NeverBundle) { &_a => {} } match ref_opt_never { - //[normal,min_exh_pats]~^ ERROR non-exhaustive + //[normal,min_exh_pats,never_pats]~^ ERROR non-exhaustive &None => {} } match ref_opt_never { @@ -487,7 +491,7 @@ fn bindings(x: NeverBundle) { ref _a => {} } match *ref_opt_never { - //[normal,min_exh_pats]~^ ERROR non-exhaustive + //[normal,min_exh_pats,never_pats]~^ ERROR non-exhaustive None => {} } match *ref_opt_never { @@ -535,7 +539,7 @@ fn bindings(x: NeverBundle) { let ref_res_never: &Result<!, !> = &x.result_never; match *ref_res_never { - //[normal,min_exh_pats]~^ ERROR non-exhaustive + //[normal,min_exh_pats,never_pats]~^ ERROR non-exhaustive // useful, reachable Ok(_) => {} } @@ -546,7 +550,7 @@ fn bindings(x: NeverBundle) { _ => {} } match *ref_res_never { - //[normal,min_exh_pats]~^ ERROR non-exhaustive + //[normal,min_exh_pats,never_pats]~^ ERROR non-exhaustive // useful, !reachable Ok(_a) => {} } @@ -565,7 +569,7 @@ fn bindings(x: NeverBundle) { let ref_tuple_half_never: &(u32, !) = &x.tuple_half_never; match *ref_tuple_half_never {} - //[normal,min_exh_pats]~^ ERROR non-empty + //[normal,min_exh_pats,never_pats]~^ ERROR non-empty match *ref_tuple_half_never { // useful, reachable (_, _) => {} @@ -632,7 +636,7 @@ fn guards_and_validity(x: NeverBundle) { _a if false => {} } match ref_never { - //[normal,min_exh_pats]~^ ERROR non-exhaustive + //[normal,min_exh_pats,never_pats]~^ ERROR non-exhaustive // useful, !reachable &_a if false => {} } @@ -647,6 +651,14 @@ fn guards_and_validity(x: NeverBundle) { // useful, !reachable Err(_) => {} } + match *ref_result_never { + //[normal,min_exh_pats]~^ ERROR `Ok(_)` not covered + //[never_pats]~^^ ERROR `Ok(!)` not covered + // useful, reachable + Ok(_) if false => {} + // useful, reachable + Err(_) => {} + } let ref_tuple_never: &(!, !) = &x.tuple_never; match *ref_tuple_never { // useful, !reachable @@ -661,6 +673,7 @@ fn diagnostics_subtlety(x: NeverBundle) { let x: &Option<Result<!, !>> = &None; match *x { //[normal,min_exh_pats]~^ ERROR `Some(_)` not covered + //[never_pats]~^^ ERROR `Some(!)` not covered None => {} } } diff --git a/tests/ui/print_type_sizes/niche-filling.stdout b/tests/ui/print_type_sizes/niche-filling.stdout index 53a58ccc4ee..eeb5de53241 100644 --- a/tests/ui/print_type_sizes/niche-filling.stdout +++ b/tests/ui/print_type_sizes/niche-filling.stdout @@ -68,6 +68,8 @@ print-type-size type: `Union2<std::num::NonZero<u32>, u32>`: 4 bytes, alignment: print-type-size variant `Union2`: 4 bytes print-type-size field `.a`: 4 bytes print-type-size field `.b`: 4 bytes, offset: 0 bytes, alignment: 4 bytes +print-type-size type: `core::num::nonzero::private::NonZeroU32Inner`: 4 bytes, alignment: 4 bytes +print-type-size field `.0`: 4 bytes print-type-size type: `std::num::NonZero<u32>`: 4 bytes, alignment: 4 bytes print-type-size field `.0`: 4 bytes print-type-size type: `std::option::Option<std::num::NonZero<u32>>`: 4 bytes, alignment: 4 bytes diff --git a/tests/ui/privacy/effective_visibilities_invariants.stderr b/tests/ui/privacy/effective_visibilities_invariants.stderr index fd205f4058a..1c19afdcdba 100644 --- a/tests/ui/privacy/effective_visibilities_invariants.stderr +++ b/tests/ui/privacy/effective_visibilities_invariants.stderr @@ -15,7 +15,6 @@ error: module has missing stability attribute LL | / #![feature(staged_api)] LL | | LL | | pub mod m {} -LL | | ... | LL | | LL | | fn main() {} diff --git a/tests/ui/raw-ref-op/raw-ref-temp.stderr b/tests/ui/raw-ref-op/raw-ref-temp.stderr index b9666162517..1f6d85e4a7e 100644 --- a/tests/ui/raw-ref-op/raw-ref-temp.stderr +++ b/tests/ui/raw-ref-op/raw-ref-temp.stderr @@ -75,24 +75,32 @@ error[E0745]: cannot take address of a temporary | LL | let ref_ascribe = &raw const type_ascribe!(2, i32); | ^^^^^^^^^^^^^^^^^^^^^ temporary value + | + = note: this error originates in the macro `type_ascribe` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0745]: cannot take address of a temporary --> $DIR/raw-ref-temp.rs:27:36 | LL | let mut_ref_ascribe = &raw mut type_ascribe!(3, i32); | ^^^^^^^^^^^^^^^^^^^^^ temporary value + | + = note: this error originates in the macro `type_ascribe` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0745]: cannot take address of a temporary --> $DIR/raw-ref-temp.rs:29:40 | LL | let ascribe_field_ref = &raw const type_ascribe!(PAIR.0, i32); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ temporary value + | + = note: this error originates in the macro `type_ascribe` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0745]: cannot take address of a temporary --> $DIR/raw-ref-temp.rs:30:38 | LL | let ascribe_index_ref = &raw mut type_ascribe!(ARRAY[0], i32); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ temporary value + | + = note: this error originates in the macro `type_ascribe` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 16 previous errors diff --git a/tests/ui/reachable/expr_type.stderr b/tests/ui/reachable/expr_type.stderr index 70536326fd8..008b867e230 100644 --- a/tests/ui/reachable/expr_type.stderr +++ b/tests/ui/reachable/expr_type.stderr @@ -12,6 +12,7 @@ note: the lint level is defined here | LL | #![deny(unreachable_code)] | ^^^^^^^^^^^^^^^^ + = note: this error originates in the macro `type_ascribe` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 1 previous error diff --git a/tests/ui/resolve/conflicting-primitive-names.rs b/tests/ui/resolve/conflicting-primitive-names.rs new file mode 100644 index 00000000000..79b6990681d --- /dev/null +++ b/tests/ui/resolve/conflicting-primitive-names.rs @@ -0,0 +1,30 @@ +//@ check-pass +#![allow(non_camel_case_types)] +#![allow(unused)] + +// Ensure that primitives do not interfere with user types of similar names + +macro_rules! make_ty_mod { + ($modname:ident, $ty:tt) => { + mod $modname { + struct $ty { + a: i32, + } + + fn assignment() { + let $ty = (); + } + + fn access(a: $ty) -> i32 { + a.a + } + } + }; +} + +make_ty_mod!(check_f16, f16); +make_ty_mod!(check_f32, f32); +make_ty_mod!(check_f64, f64); +make_ty_mod!(check_f128, f128); + +fn main() {} diff --git a/tests/ui/resolve/issue-39559-2.stderr b/tests/ui/resolve/issue-39559-2.stderr index e9d8eb0835b..7f51357a56f 100644 --- a/tests/ui/resolve/issue-39559-2.stderr +++ b/tests/ui/resolve/issue-39559-2.stderr @@ -5,7 +5,10 @@ LL | let array: [usize; Dim3::dim()] | ^^^^^^^^^^^ | = note: calls in constants are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable +help: add `#![feature(const_trait_impl)]` to the crate attributes to enable + | +LL + #![feature(const_trait_impl)] + | error[E0015]: cannot call non-const fn `<Dim3 as Dim>::dim` in constants --> $DIR/issue-39559-2.rs:16:15 @@ -14,7 +17,10 @@ LL | = [0; Dim3::dim()]; | ^^^^^^^^^^^ | = note: calls in constants are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable +help: add `#![feature(const_trait_impl)]` to the crate attributes to enable + | +LL + #![feature(const_trait_impl)] + | error: aborting due to 2 previous errors diff --git a/tests/ui/resolve/primitive-f16-f128-shadowed.rs b/tests/ui/resolve/primitive-f16-f128-shadowed.rs new file mode 100644 index 00000000000..ed3fb44b256 --- /dev/null +++ b/tests/ui/resolve/primitive-f16-f128-shadowed.rs @@ -0,0 +1,31 @@ +//@ compile-flags: --crate-type=lib +//@ check-pass + +// Verify that gates for the `f16` and `f128` features do not apply to user types + +mod binary16 { + #[allow(non_camel_case_types)] + pub struct f16(u16); +} + +mod binary128 { + #[allow(non_camel_case_types)] + pub struct f128(u128); +} + +pub use binary128::f128; +pub use binary16::f16; + +mod private16 { + use crate::f16; + + pub trait SealedHalf {} + impl SealedHalf for f16 {} +} + +mod private128 { + use crate::f128; + + pub trait SealedQuad {} + impl SealedQuad for f128 {} +} diff --git a/tests/ui/resolve/primitive-usage.rs b/tests/ui/resolve/primitive-usage.rs new file mode 100644 index 00000000000..b00d18a4e1e --- /dev/null +++ b/tests/ui/resolve/primitive-usage.rs @@ -0,0 +1,42 @@ +//@ run-pass +#![allow(unused)] +#![feature(f128)] +#![feature(f16)] + +// Same as the feature gate tests but ensure we can use the types +mod check_f128 { + const A: f128 = 10.0; + + pub fn foo() { + let a: f128 = 100.0; + let b = 0.0f128; + bar(1.23); + } + + fn bar(a: f128) {} + + struct Bar { + a: f128, + } +} + +mod check_f16 { + const A: f16 = 10.0; + + pub fn foo() { + let a: f16 = 100.0; + let b = 0.0f16; + bar(1.23); + } + + fn bar(a: f16) {} + + struct Bar { + a: f16, + } +} + +fn main() { + check_f128::foo(); + check_f16::foo(); +} diff --git a/tests/ui/rfcs/rfc-0000-never_patterns/check.rs b/tests/ui/rfcs/rfc-0000-never_patterns/check.rs index b6da0c20e07..0831477e749 100644 --- a/tests/ui/rfcs/rfc-0000-never_patterns/check.rs +++ b/tests/ui/rfcs/rfc-0000-never_patterns/check.rs @@ -15,12 +15,12 @@ fn no_arms_or_guards(x: Void) { //~^ ERROR a never pattern is always unreachable None => {} } - match None::<Void> { //~ ERROR: `Some(_)` not covered + match None::<Void> { //~ ERROR: `Some(!)` not covered Some(!) if true, //~^ ERROR guard on a never pattern None => {} } - match None::<Void> { //~ ERROR: `Some(_)` not covered + match None::<Void> { //~ ERROR: `Some(!)` not covered Some(!) if true => {} //~^ ERROR a never pattern is always unreachable None => {} diff --git a/tests/ui/rfcs/rfc-0000-never_patterns/check.stderr b/tests/ui/rfcs/rfc-0000-never_patterns/check.stderr index 5497252890f..25f7343a8a8 100644 --- a/tests/ui/rfcs/rfc-0000-never_patterns/check.stderr +++ b/tests/ui/rfcs/rfc-0000-never_patterns/check.stderr @@ -31,11 +31,11 @@ LL | Some(never!()) => {} | this will never be executed | help: remove this expression -error[E0004]: non-exhaustive patterns: `Some(_)` not covered +error[E0004]: non-exhaustive patterns: `Some(!)` not covered --> $DIR/check.rs:18:11 | LL | match None::<Void> { - | ^^^^^^^^^^^^ pattern `Some(_)` not covered + | ^^^^^^^^^^^^ pattern `Some(!)` not covered | note: `Option<Void>` defined here --> $SRC_DIR/core/src/option.rs:LL:COL @@ -46,14 +46,14 @@ note: `Option<Void>` defined here help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | LL ~ None => {}, -LL + Some(_) => todo!() +LL + Some(!) | -error[E0004]: non-exhaustive patterns: `Some(_)` not covered +error[E0004]: non-exhaustive patterns: `Some(!)` not covered --> $DIR/check.rs:23:11 | LL | match None::<Void> { - | ^^^^^^^^^^^^ pattern `Some(_)` not covered + | ^^^^^^^^^^^^ pattern `Some(!)` not covered | note: `Option<Void>` defined here --> $SRC_DIR/core/src/option.rs:LL:COL @@ -64,7 +64,7 @@ note: `Option<Void>` defined here help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | LL ~ None => {}, -LL + Some(_) => todo!() +LL + Some(!) | error: aborting due to 6 previous errors diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-pass.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-pass.stderr index f802841d2e4..22e8e692752 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-pass.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-pass.stderr @@ -10,7 +10,10 @@ note: impl defined here, but it is not `const` LL | impl const std::ops::Add for Int { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: calls in constants are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(effects)]` to the crate attributes to enable +help: add `#![feature(effects)]` to the crate attributes to enable + | +LL + #![feature(effects)] + | error[E0015]: cannot call non-const fn `<i32 as Plus>::plus` in constant functions --> $DIR/call-const-trait-method-pass.rs:36:7 @@ -19,7 +22,10 @@ LL | a.plus(b) | ^^^^^^^ | = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(effects)]` to the crate attributes to enable +help: add `#![feature(effects)]` to the crate attributes to enable + | +LL + #![feature(effects)] + | error: aborting due to 2 previous errors diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-closure-parse-not-item.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-closure-parse-not-item.stderr index ace2e7e46c4..12cc79f5961 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-closure-parse-not-item.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-closure-parse-not-item.stderr @@ -4,5 +4,13 @@ error: `~const` can only be applied to `#[const_trait]` traits LL | const fn test() -> impl ~const Fn() { | ^^^^ -error: aborting due to 1 previous error +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/const-closure-parse-not-item.rs:7:32 + | +LL | const fn test() -> impl ~const Fn() { + | ^^^^ + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error: aborting due to 2 previous errors diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-closure-trait-method-fail.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-closure-trait-method-fail.stderr index 14c41f3e01d..151bd6facf7 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-closure-trait-method-fail.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-closure-trait-method-fail.stderr @@ -11,11 +11,14 @@ LL | x(()) | ^^^^^ | = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(effects)]` to the crate attributes to enable help: consider further restricting this bound | LL | const fn need_const_closure<T: ~const FnOnce(()) -> i32 + ~const std::ops::FnOnce<((),)>>(x: T) -> i32 { | ++++++++++++++++++++++++++++++++ +help: add `#![feature(effects)]` to the crate attributes to enable + | +LL + #![feature(effects)] + | error: aborting due to 2 previous errors diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-closure-trait-method.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-closure-trait-method.stderr index 8fe11fffbf9..e2b3e352701 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-closure-trait-method.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-closure-trait-method.stderr @@ -11,11 +11,14 @@ LL | x(()) | ^^^^^ | = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(effects)]` to the crate attributes to enable help: consider further restricting this bound | LL | const fn need_const_closure<T: ~const FnOnce(()) -> i32 + ~const std::ops::FnOnce<((),)>>(x: T) -> i32 { | ++++++++++++++++++++++++++++++++ +help: add `#![feature(effects)]` to the crate attributes to enable + | +LL + #![feature(effects)] + | error: aborting due to 2 previous errors diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-closures.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-closures.stderr index a225125ef53..e5a773123e9 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-closures.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-closures.stderr @@ -29,11 +29,14 @@ LL | f() + f() | ^^^ | = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(effects)]` to the crate attributes to enable help: consider further restricting this bound | LL | const fn answer<F: ~const Fn() -> u8 + ~const std::ops::Fn<()>>(f: &F) -> u8 { | +++++++++++++++++++++++++ +help: add `#![feature(effects)]` to the crate attributes to enable + | +LL + #![feature(effects)] + | error[E0015]: cannot call non-const closure in constant functions --> $DIR/const-closures.rs:24:11 @@ -42,11 +45,14 @@ LL | f() + f() | ^^^ | = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(effects)]` to the crate attributes to enable help: consider further restricting this bound | LL | const fn answer<F: ~const Fn() -> u8 + ~const std::ops::Fn<()>>(f: &F) -> u8 { | +++++++++++++++++++++++++ +help: add `#![feature(effects)]` to the crate attributes to enable + | +LL + #![feature(effects)] + | error[E0015]: cannot call non-const closure in constant functions --> $DIR/const-closures.rs:12:5 @@ -55,11 +61,14 @@ LL | f() * 7 | ^^^ | = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(effects)]` to the crate attributes to enable help: consider further restricting this bound | LL | F: ~const FnOnce() -> u8 + ~const std::ops::Fn<()>, | +++++++++++++++++++++++++ +help: add `#![feature(effects)]` to the crate attributes to enable + | +LL + #![feature(effects)] + | error: aborting due to 7 previous errors diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-trait.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-trait.rs index 91f1b90bdc0..51dfe29b829 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-trait.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-trait.rs @@ -3,7 +3,6 @@ #![allow(incomplete_features)] #![feature( - associated_type_bounds, const_trait_impl, effects, const_cmp, diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-trait.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-trait.stderr index d4be71f2f46..03038eb5c84 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-trait.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-trait.stderr @@ -1,5 +1,5 @@ error[E0277]: can't compare `()` with `()` - --> $DIR/const-impl-trait.rs:37:17 + --> $DIR/const-impl-trait.rs:36:17 | LL | assert!(cmp(&())); | --- ^^^ no implementation for `() == ()` @@ -9,13 +9,13 @@ LL | assert!(cmp(&())); = help: the trait `const PartialEq` is not implemented for `()` = help: the trait `PartialEq` is implemented for `()` note: required by a bound in `cmp` - --> $DIR/const-impl-trait.rs:14:23 + --> $DIR/const-impl-trait.rs:13:23 | LL | const fn cmp(a: &impl ~const PartialEq) -> bool { | ^^^^^^^^^^^^^^^^ required by this bound in `cmp` error[E0369]: binary operation `==` cannot be applied to type `&impl ~const PartialEq` - --> $DIR/const-impl-trait.rs:15:7 + --> $DIR/const-impl-trait.rs:14:7 | LL | a == a | - ^^ - &impl ~const PartialEq diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.stock.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.stock.stderr index ab039397edc..a0c50ac7e61 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.stock.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.stock.stderr @@ -5,7 +5,10 @@ LL | Const.func(); | ^^^^^^ | = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable +help: add `#![feature(const_trait_impl)]` to the crate attributes to enable + | +LL + #![feature(const_trait_impl)] + | error: aborting due to 1 previous error diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.stocknc.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.stocknc.stderr index ebbe9aa2202..312818ae631 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.stocknc.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.stocknc.stderr @@ -5,7 +5,10 @@ LL | NonConst.func(); | ^^^^^^ | = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable +help: add `#![feature(const_trait_impl)]` to the crate attributes to enable + | +LL + #![feature(const_trait_impl)] + | error[E0015]: cannot call non-const fn `<cross_crate::Const as cross_crate::MyTrait>::func` in constant functions --> $DIR/cross-crate.rs:20:11 @@ -14,7 +17,10 @@ LL | Const.func(); | ^^^^^^ | = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable +help: add `#![feature(const_trait_impl)]` to the crate attributes to enable + | +LL + #![feature(const_trait_impl)] + | error: aborting due to 2 previous errors diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/ice-112822-expected-type-for-param.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/ice-112822-expected-type-for-param.rs index 7d817d09c7f..21197fcaa27 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/ice-112822-expected-type-for-param.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/ice-112822-expected-type-for-param.rs @@ -1,7 +1,9 @@ #![feature(const_trait_impl, effects)] -const fn test() -> impl ~const Fn() { //~ ERROR `~const` can only be applied to `#[const_trait]` traits - //~^ ERROR cycle detected +const fn test() -> impl ~const Fn() { + //~^ ERROR `~const` can only be applied to `#[const_trait]` traits + //~| ERROR `~const` can only be applied to `#[const_trait]` traits + //~| ERROR cycle detected const move || { //~ ERROR const closures are experimental let sl: &[u8] = b"foo"; diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/ice-112822-expected-type-for-param.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/ice-112822-expected-type-for-param.stderr index 0f6240cc03b..2f805110917 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/ice-112822-expected-type-for-param.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/ice-112822-expected-type-for-param.stderr @@ -1,5 +1,5 @@ error[E0658]: const closures are experimental - --> $DIR/ice-112822-expected-type-for-param.rs:5:5 + --> $DIR/ice-112822-expected-type-for-param.rs:7:5 | LL | const move || { | ^^^^^ @@ -14,8 +14,16 @@ error: `~const` can only be applied to `#[const_trait]` traits LL | const fn test() -> impl ~const Fn() { | ^^^^ +error: `~const` can only be applied to `#[const_trait]` traits + --> $DIR/ice-112822-expected-type-for-param.rs:3:32 + | +LL | const fn test() -> impl ~const Fn() { + | ^^^^ + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + error[E0277]: can't compare `&u8` with `&u8` - --> $DIR/ice-112822-expected-type-for-param.rs:10:17 + --> $DIR/ice-112822-expected-type-for-param.rs:12:17 | LL | assert_eq!(first, &b'f'); | ^^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `&u8 == &u8` @@ -54,7 +62,7 @@ LL | const fn test() -> impl ~const Fn() { | ^^^^^^^^^^^^^^^^ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information -error: aborting due to 4 previous errors +error: aborting due to 5 previous errors Some errors have detailed explanations: E0277, E0391, E0658. For more information about an error, try `rustc --explain E0277`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/minicore.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/minicore.rs index 1b380c989fa..281cfdaef28 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/minicore.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/minicore.rs @@ -509,17 +509,19 @@ trait StructuralPartialEq {} const fn drop<T: ~const Destruct>(_: T) {} -extern "rust-intrinsic" { - #[rustc_const_stable(feature = "const_eval_select", since = "1.0.0")] - #[rustc_safe_intrinsic] - fn const_eval_select<ARG: Tuple, F, G, RET>( - arg: ARG, - called_in_const: F, - called_at_rt: G, - ) -> RET - where - F: const FnOnce<ARG, Output = RET>, - G: FnOnce<ARG, Output = RET>; +#[rustc_const_stable(feature = "const_eval_select", since = "1.0.0")] +#[rustc_intrinsic_must_be_overridden] +#[rustc_intrinsic] +const fn const_eval_select<ARG: Tuple, F, G, RET>( + arg: ARG, + called_in_const: F, + called_at_rt: G, +) -> RET +where + F: const FnOnce<ARG, Output = RET>, + G: FnOnce<ARG, Output = RET>, +{ + loop {} } fn test_const_eval_select() { diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/generic-bound.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/generic-bound.stderr index f42fee59bf0..7905abfa40e 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/generic-bound.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/generic-bound.stderr @@ -10,7 +10,10 @@ note: impl defined here, but it is not `const` LL | impl<T> const std::ops::Add for S<T> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(effects)]` to the crate attributes to enable +help: add `#![feature(effects)]` to the crate attributes to enable + | +LL + #![feature(effects)] + | error: aborting due to 1 previous error diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-102985.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-102985.stderr index 0fa4c8fe04c..8401d1bd4f6 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-102985.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-102985.stderr @@ -6,7 +6,10 @@ LL | n => n(), | = note: closures need an RFC before allowed to be called in constants = note: calls in constants are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(effects)]` to the crate attributes to enable +help: add `#![feature(effects)]` to the crate attributes to enable + | +LL + #![feature(effects)] + | error: aborting due to 1 previous error diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-88155.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-88155.stderr index e5347a09598..afe1ea3b1b7 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-88155.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-88155.stderr @@ -5,7 +5,10 @@ LL | T::assoc() | ^^^^^^^^^^ | = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(effects)]` to the crate attributes to enable +help: add `#![feature(effects)]` to the crate attributes to enable + | +LL + #![feature(effects)] + | error: aborting due to 1 previous error diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/match-non-const-eq.gated.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/match-non-const-eq.gated.stderr index 28254ac15a8..c7d21151661 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/match-non-const-eq.gated.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/match-non-const-eq.gated.stderr @@ -6,7 +6,10 @@ LL | "a" => (), //FIXME [gated]~ ERROR can't compare `str` with `str` in | = note: `str` cannot be compared in compile-time, and therefore cannot be used in `match`es = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(effects)]` to the crate attributes to enable +help: add `#![feature(effects)]` to the crate attributes to enable + | +LL + #![feature(effects)] + | error: aborting due to 1 previous error diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/match-non-const-eq.stock.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/match-non-const-eq.stock.stderr index 5431116a1a7..0f5ecac3891 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/match-non-const-eq.stock.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/match-non-const-eq.stock.stderr @@ -6,7 +6,10 @@ LL | "a" => (), //FIXME [gated]~ ERROR can't compare `str` with `str` in | = note: `str` cannot be compared in compile-time, and therefore cannot be used in `match`es = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable +help: add `#![feature(const_trait_impl)]` to the crate attributes to enable + | +LL + #![feature(const_trait_impl)] + | error: aborting due to 1 previous error diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/non-const-op-const-closure-non-const-outer.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/non-const-op-const-closure-non-const-outer.stderr index d82a49be75e..c362a1077e3 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/non-const-op-const-closure-non-const-outer.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/non-const-op-const-closure-non-const-outer.stderr @@ -5,7 +5,10 @@ LL | (const || { (()).foo() })(); | ^^^^^ | = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(effects)]` to the crate attributes to enable +help: add `#![feature(effects)]` to the crate attributes to enable + | +LL + #![feature(effects)] + | error: aborting due to 1 previous error diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/staged-api-user-crate.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/staged-api-user-crate.stderr index 1346c4c4ae2..781191ec97c 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/staged-api-user-crate.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/staged-api-user-crate.stderr @@ -5,7 +5,10 @@ LL | Unstable::func(); | ^^^^^^^^^^^^^^^^ | = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable +help: add `#![feature(const_trait_impl)]` to the crate attributes to enable + | +LL + #![feature(const_trait_impl)] + | error: aborting due to 1 previous error diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/std-impl-gate.gated.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/std-impl-gate.gated.stderr index e51ff148339..d761fdce4bf 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/std-impl-gate.gated.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/std-impl-gate.gated.stderr @@ -11,7 +11,10 @@ LL | Default::default() | ^^^^^^^^^^^^^^^^^^ | = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(effects)]` to the crate attributes to enable +help: add `#![feature(effects)]` to the crate attributes to enable + | +LL + #![feature(effects)] + | error: aborting due to 2 previous errors diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/std-impl-gate.stock.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/std-impl-gate.stock.stderr index 6d624def276..b63ea695fc2 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/std-impl-gate.stock.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/std-impl-gate.stock.stderr @@ -5,7 +5,10 @@ LL | Default::default() | ^^^^^^^^^^^^^^^^^^ | = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable +help: add `#![feature(const_trait_impl)]` to the crate attributes to enable + | +LL + #![feature(const_trait_impl)] + | error: aborting due to 1 previous error diff --git a/tests/ui/sanitizer/cfi-closure-fn-ptr-cast.rs b/tests/ui/sanitizer/cfi-closure-fn-ptr-cast.rs new file mode 100644 index 00000000000..a46a3afd734 --- /dev/null +++ b/tests/ui/sanitizer/cfi-closure-fn-ptr-cast.rs @@ -0,0 +1,18 @@ +// Tests that converting a closure to a function pointer works +// The notable thing being tested here is that when the closure does not capture anything, +// the call method from its Fn trait takes a ZST representing its environment. The compiler then +// uses the assumption that the ZST is non-passed to reify this into a function pointer. +// +// This checks that the reified function pointer will have the expected alias set at its call-site. + +//@ needs-sanitizer-cfi +// FIXME(#122848) Remove only-linux once OSX CFI binaries work +//@ only-linux +//@ compile-flags: --crate-type=bin -Cprefer-dynamic=off -Clto -Zsanitizer=cfi +//@ compile-flags: -C target-feature=-crt-static -C codegen-units=1 -C opt-level=0 +//@ run-pass + +pub fn main() { + let f: &fn() = &((|| ()) as _); + f(); +} diff --git a/tests/ui/sized/expr-type-error-plus-sized-obligation.rs b/tests/ui/sized/expr-type-error-plus-sized-obligation.rs new file mode 100644 index 00000000000..a96beeecab9 --- /dev/null +++ b/tests/ui/sized/expr-type-error-plus-sized-obligation.rs @@ -0,0 +1,22 @@ +#![allow(warnings)] + +fn issue_117846_repro() { + let (a, _) = if true { + produce() + } else { + (Vec::new(), &[]) //~ ERROR E0308 + }; + + accept(&a); +} + +struct Foo; +struct Bar; + +fn produce() -> (Vec<Foo>, &'static [Bar]) { + todo!() +} + +fn accept(c: &[Foo]) {} + +fn main() {} diff --git a/tests/ui/sized/expr-type-error-plus-sized-obligation.stderr b/tests/ui/sized/expr-type-error-plus-sized-obligation.stderr new file mode 100644 index 00000000000..9cf477fbd41 --- /dev/null +++ b/tests/ui/sized/expr-type-error-plus-sized-obligation.stderr @@ -0,0 +1,19 @@ +error[E0308]: `if` and `else` have incompatible types + --> $DIR/expr-type-error-plus-sized-obligation.rs:7:9 + | +LL | let (a, _) = if true { + | __________________- +LL | | produce() + | | --------- expected because of this +LL | | } else { +LL | | (Vec::new(), &[]) + | | ^^^^^^^^^^^^^^^^^ expected `(Vec<Foo>, &[Bar])`, found `(Vec<_>, &[_; 0])` +LL | | }; + | |_____- `if` and `else` have incompatible types + | + = note: expected tuple `(Vec<Foo>, &[Bar])` + found tuple `(Vec<_>, &[_; 0])` + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/specialization/const_trait_impl.stderr b/tests/ui/specialization/const_trait_impl.stderr index 187049e623c..fc02f6f8f74 100644 --- a/tests/ui/specialization/const_trait_impl.stderr +++ b/tests/ui/specialization/const_trait_impl.stderr @@ -23,7 +23,10 @@ LL | const _: () = assert!(<()>::a() == 42); | ^^^^^^^^^ | = note: calls in constants are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(effects)]` to the crate attributes to enable +help: add `#![feature(effects)]` to the crate attributes to enable + | +LL + #![feature(effects)] + | error[E0015]: cannot call non-const fn `<u8 as A>::a` in constants --> $DIR/const_trait_impl.rs:53:23 @@ -32,7 +35,10 @@ LL | const _: () = assert!(<u8>::a() == 3); | ^^^^^^^^^ | = note: calls in constants are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(effects)]` to the crate attributes to enable +help: add `#![feature(effects)]` to the crate attributes to enable + | +LL + #![feature(effects)] + | error[E0015]: cannot call non-const fn `<u16 as A>::a` in constants --> $DIR/const_trait_impl.rs:54:23 @@ -41,7 +47,10 @@ LL | const _: () = assert!(<u16>::a() == 2); | ^^^^^^^^^^ | = note: calls in constants are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(effects)]` to the crate attributes to enable +help: add `#![feature(effects)]` to the crate attributes to enable + | +LL + #![feature(effects)] + | error: aborting due to 6 previous errors diff --git a/tests/ui/specialization/defaultimpl/validation.stderr b/tests/ui/specialization/defaultimpl/validation.stderr index 5f62e8dce17..f56f16162a2 100644 --- a/tests/ui/specialization/defaultimpl/validation.stderr +++ b/tests/ui/specialization/defaultimpl/validation.stderr @@ -35,7 +35,10 @@ LL | default unsafe impl Send for S {} = help: the trait `Send` is not implemented for `S` = help: the trait `Send` is implemented for `S` = help: see issue #48214 - = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable +help: add `#![feature(trivial_bounds)]` to the crate attributes to enable + | +LL + #![feature(trivial_bounds)] + | error: impls of auto traits cannot be default --> $DIR/validation.rs:11:15 diff --git a/tests/ui/stable-mir-print/basic_function.rs b/tests/ui/stable-mir-print/basic_function.rs index 9b27a56dab1..deefef63bdb 100644 --- a/tests/ui/stable-mir-print/basic_function.rs +++ b/tests/ui/stable-mir-print/basic_function.rs @@ -2,7 +2,7 @@ //@ check-pass //@ only-x86_64 -fn foo(i:i32) -> i32 { +fn foo(i: i32) -> i32 { i + 1 } @@ -12,4 +12,13 @@ fn bar(vec: &mut Vec<i32>) -> Vec<i32> { new_vec } -fn main(){} +pub fn demux(input: u8) -> u8 { + match input { + 0 => 10, + 1 => 6, + 2 => 8, + _ => 0, + } +} + +fn main() {} diff --git a/tests/ui/stable-mir-print/basic_function.stdout b/tests/ui/stable-mir-print/basic_function.stdout index d9b33a4257c..3926c1048f5 100644 --- a/tests/ui/stable-mir-print/basic_function.stdout +++ b/tests/ui/stable-mir-print/basic_function.stdout @@ -1,234 +1,74 @@ // WARNING: This is highly experimental output it's intended for stable-mir developers only. // If you find a bug or want to improve the output open a issue at https://github.com/rust-lang/project-stable-mir. -fn foo(_0: i32) -> i32 { - let mut _0: (i32, bool); +fn foo(_1: i32) -> i32 { + let mut _0: i32; + let mut _2: (i32, bool); + debug i => _1; + bb0: { + _2 = CheckedAdd(_1, 1_i32); + assert(!move (_2.1: bool), "attempt to compute `{} + {}`, which would overflow", _1, 1_i32) -> [success: bb1, unwind continue]; + } + bb1: { + _0 = move (_2.0: i32); + return; + } } +fn bar(_1: &mut Vec<i32>) -> Vec<i32> { + let mut _0: Vec<i32>; + let mut _2: Vec<i32>; + let mut _3: &Vec<i32>; + let _4: (); + let mut _5: &mut Vec<i32>; + debug vec => _1; + debug new_vec => _2; bb0: { - _2 = 1 Add const 1_i32 - assert(!move _2 bool),"attempt to compute `{} + {}`, which would overflow", 1, const 1_i32) -> [success: bb1, unwind continue] + _3 = &(*_1); + _2 = <Vec<i32> as Clone>::clone(move _3) -> [return: bb1, unwind continue]; } bb1: { - _0 = move _2 - return + _5 = &mut _2; + _4 = Vec::<i32>::push(move _5, 1_i32) -> [return: bb2, unwind: bb3]; + } + bb2: { + _0 = move _2; + return; + } + bb3: { + drop(_2) -> [return: bb4, unwind terminate]; + } + bb4: { + resume; } -fn bar(_0: &mut Ty { - id: 10, - kind: RigidTy( - Adt( - AdtDef( - DefId { - id: 3, - name: "std::vec::Vec", - }, - ), - GenericArgs( - [ - Type( - Ty { - id: 11, - kind: Param( - ParamTy { - index: 0, - name: "T", - }, - ), - }, - ), - Type( - Ty { - id: 12, - kind: Param( - ParamTy { - index: 1, - name: "A", - }, - ), - }, - ), - ], - ), - ), - ), -}) -> Ty { - id: 10, - kind: RigidTy( - Adt( - AdtDef( - DefId { - id: 3, - name: "std::vec::Vec", - }, - ), - GenericArgs( - [ - Type( - Ty { - id: 11, - kind: Param( - ParamTy { - index: 0, - name: "T", - }, - ), - }, - ), - Type( - Ty { - id: 12, - kind: Param( - ParamTy { - index: 1, - name: "A", - }, - ), - }, - ), - ], - ), - ), - ), -} { - let mut _0: Ty { - id: 10, - kind: RigidTy( - Adt( - AdtDef( - DefId { - id: 3, - name: "std::vec::Vec", - }, - ), - GenericArgs( - [ - Type( - Ty { - id: 11, - kind: Param( - ParamTy { - index: 0, - name: "T", - }, - ), - }, - ), - Type( - Ty { - id: 12, - kind: Param( - ParamTy { - index: 1, - name: "A", - }, - ), - }, - ), - ], - ), - ), - ), -}; - let mut _1: &Ty { - id: 10, - kind: RigidTy( - Adt( - AdtDef( - DefId { - id: 3, - name: "std::vec::Vec", - }, - ), - GenericArgs( - [ - Type( - Ty { - id: 11, - kind: Param( - ParamTy { - index: 0, - name: "T", - }, - ), - }, - ), - Type( - Ty { - id: 12, - kind: Param( - ParamTy { - index: 1, - name: "A", - }, - ), - }, - ), - ], - ), - ), - ), -}; - let _2: (); - let mut _3: &mut Ty { - id: 10, - kind: RigidTy( - Adt( - AdtDef( - DefId { - id: 3, - name: "std::vec::Vec", - }, - ), - GenericArgs( - [ - Type( - Ty { - id: 11, - kind: Param( - ParamTy { - index: 0, - name: "T", - }, - ), - }, - ), - Type( - Ty { - id: 12, - kind: Param( - ParamTy { - index: 1, - name: "A", - }, - ), - }, - ), - ], - ), - ), - ), -}; } +fn demux(_1: u8) -> u8 { + let mut _0: u8; + debug input => _1; bb0: { - _3 = refShared1 - _2 = const <Vec<i32> as Clone>::clone(move _3) -> [return: bb1, unwind continue] + switchInt(_1) -> [0: bb2, 1: bb3, 2: bb4, otherwise: bb1]; } bb1: { - _5 = refMut { - kind: TwoPhaseBorrow, -}2 - _4 = const Vec::<i32>::push(move _5, const 1_i32) -> [return: bb2, unwind: bb3] + _0 = 0_u8; + goto -> bb5; } bb2: { - _0 = move _2 - return + _0 = 10_u8; + goto -> bb5; } bb3: { - drop(_2) -> [return: bb4, unwind terminate] + _0 = 6_u8; + goto -> bb5; } bb4: { - resume + _0 = 8_u8; + goto -> bb5; + } + bb5: { + return; } -fn main() -> () { } +fn main() -> () { + let mut _0: (); bb0: { - return + return; } +} diff --git a/tests/ui/suggestions/issue-85347.rs b/tests/ui/suggestions/issue-85347.rs index 04d4c47d8e5..d14cf07d915 100644 --- a/tests/ui/suggestions/issue-85347.rs +++ b/tests/ui/suggestions/issue-85347.rs @@ -4,6 +4,9 @@ trait Foo { //~^ ERROR associated type takes 1 lifetime argument but 0 lifetime arguments were supplied //~| ERROR associated type bindings are not allowed here //~| HELP add missing + //~| ERROR associated type takes 1 lifetime argument but 0 lifetime arguments were supplied + //~| ERROR associated type bindings are not allowed here + //~| HELP add missing } fn main() {} diff --git a/tests/ui/suggestions/issue-85347.stderr b/tests/ui/suggestions/issue-85347.stderr index f330b3c1fad..45f87e539b4 100644 --- a/tests/ui/suggestions/issue-85347.stderr +++ b/tests/ui/suggestions/issue-85347.stderr @@ -20,7 +20,32 @@ error[E0229]: associated type bindings are not allowed here LL | type Bar<'a>: Deref<Target = <Self>::Bar<Target = Self>>; | ^^^^^^^^^^^^^ associated type not allowed here -error: aborting due to 2 previous errors +error[E0107]: associated type takes 1 lifetime argument but 0 lifetime arguments were supplied + --> $DIR/issue-85347.rs:3:42 + | +LL | type Bar<'a>: Deref<Target = <Self>::Bar<Target = Self>>; + | ^^^ expected 1 lifetime argument + | +note: associated type defined here, with 1 lifetime parameter: `'a` + --> $DIR/issue-85347.rs:3:10 + | +LL | type Bar<'a>: Deref<Target = <Self>::Bar<Target = Self>>; + | ^^^ -- + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` +help: add missing lifetime argument + | +LL | type Bar<'a>: Deref<Target = <Self>::Bar<'a, Target = Self>>; + | +++ + +error[E0229]: associated type bindings are not allowed here + --> $DIR/issue-85347.rs:3:46 + | +LL | type Bar<'a>: Deref<Target = <Self>::Bar<Target = Self>>; + | ^^^^^^^^^^^^^ associated type not allowed here + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error: aborting due to 4 previous errors Some errors have detailed explanations: E0107, E0229. For more information about an error, try `rustc --explain E0107`. diff --git a/tests/ui/suggestions/issue-86667.rs b/tests/ui/suggestions/issue-86667.rs index 8c18a879238..1f37e9a5f6d 100644 --- a/tests/ui/suggestions/issue-86667.rs +++ b/tests/ui/suggestions/issue-86667.rs @@ -6,13 +6,11 @@ async fn a(s1: &str, s2: &str) -> &str { //~^ ERROR: missing lifetime specifier [E0106] s1 - //~^ ERROR: lifetime may not live long enough } fn b(s1: &str, s2: &str) -> &str { //~^ ERROR: missing lifetime specifier [E0106] s1 - //~^ ERROR lifetime may not live long enough } fn main() {} diff --git a/tests/ui/suggestions/issue-86667.stderr b/tests/ui/suggestions/issue-86667.stderr index e3d673ff233..14dbbfffb0e 100644 --- a/tests/ui/suggestions/issue-86667.stderr +++ b/tests/ui/suggestions/issue-86667.stderr @@ -11,7 +11,7 @@ LL | async fn a<'a>(s1: &'a str, s2: &'a str) -> &'a str { | ++++ ++ ++ ++ error[E0106]: missing lifetime specifier - --> $DIR/issue-86667.rs:12:29 + --> $DIR/issue-86667.rs:11:29 | LL | fn b(s1: &str, s2: &str) -> &str { | ---- ---- ^ expected named lifetime parameter @@ -22,24 +22,6 @@ help: consider introducing a named lifetime parameter LL | fn b<'a>(s1: &'a str, s2: &'a str) -> &'a str { | ++++ ++ ++ ++ -error: lifetime may not live long enough - --> $DIR/issue-86667.rs:8:5 - | -LL | async fn a(s1: &str, s2: &str) -> &str { - | - let's call the lifetime of this reference `'1` -LL | -LL | s1 - | ^^ returning this value requires that `'1` must outlive `'static` - -error: lifetime may not live long enough - --> $DIR/issue-86667.rs:14:5 - | -LL | fn b(s1: &str, s2: &str) -> &str { - | - let's call the lifetime of this reference `'1` -LL | -LL | s1 - | ^^ returning this value requires that `'1` must outlive `'static` - -error: aborting due to 4 previous errors +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0106`. diff --git a/tests/ui/suggestions/lifetimes/explicit-lifetime-suggestion-in-proper-span-issue-121267.rs b/tests/ui/suggestions/lifetimes/explicit-lifetime-suggestion-in-proper-span-issue-121267.rs new file mode 100644 index 00000000000..34afd363129 --- /dev/null +++ b/tests/ui/suggestions/lifetimes/explicit-lifetime-suggestion-in-proper-span-issue-121267.rs @@ -0,0 +1,12 @@ +fn main() {} + +fn foo(_src: &crate::Foo) -> Option<i32> { + todo!() +} +fn bar(src: &crate::Foo) -> impl Iterator<Item = i32> { + [0].into_iter() + //~^ ERROR hidden type for `impl Iterator<Item = i32>` captures lifetime that does not appear in bounds + .filter_map(|_| foo(src)) +} + +struct Foo<'a>(&'a str); diff --git a/tests/ui/suggestions/lifetimes/explicit-lifetime-suggestion-in-proper-span-issue-121267.stderr b/tests/ui/suggestions/lifetimes/explicit-lifetime-suggestion-in-proper-span-issue-121267.stderr new file mode 100644 index 00000000000..aeeec3aca34 --- /dev/null +++ b/tests/ui/suggestions/lifetimes/explicit-lifetime-suggestion-in-proper-span-issue-121267.stderr @@ -0,0 +1,20 @@ +error[E0700]: hidden type for `impl Iterator<Item = i32>` captures lifetime that does not appear in bounds + --> $DIR/explicit-lifetime-suggestion-in-proper-span-issue-121267.rs:7:5 + | +LL | fn bar(src: &crate::Foo) -> impl Iterator<Item = i32> { + | ---------- ------------------------- opaque type defined here + | | + | hidden type `FilterMap<std::slice::Iter<'static, i32>, {closure@$DIR/explicit-lifetime-suggestion-in-proper-span-issue-121267.rs:9:21: 9:24}>` captures the anonymous lifetime defined here +LL | / [0].into_iter() +LL | | +LL | | .filter_map(|_| foo(src)) + | |_________________________________^ + | +help: to declare that `impl Iterator<Item = i32>` captures `'_`, you can introduce a named lifetime parameter `'a` + | +LL | fn bar<'a>(src: &'a crate::Foo<'a>) -> impl Iterator<Item = i32> + 'a { + | ++++ ++ ++++ ++++ + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0700`. diff --git a/tests/ui/suggestions/missing-assoc-fn.rs b/tests/ui/suggestions/missing-assoc-fn.rs index 9af8e5a939d..260d3b33e28 100644 --- a/tests/ui/suggestions/missing-assoc-fn.rs +++ b/tests/ui/suggestions/missing-assoc-fn.rs @@ -6,7 +6,7 @@ trait TraitA<A> { fn foo<T: TraitB<Item = A>>(_: T) -> Self; fn bar<T>(_: T) -> Self; fn baz<T>(_: T) -> Self where T: TraitB, <T as TraitB>::Item: Copy; - fn bat<T: TraitB<Item: Copy>>(_: T) -> Self; //~ ERROR associated type bounds are unstable + fn bat<T: TraitB<Item: Copy>>(_: T) -> Self; } struct S; diff --git a/tests/ui/suggestions/missing-assoc-fn.stderr b/tests/ui/suggestions/missing-assoc-fn.stderr index 61a5492d583..d819f7e8bd2 100644 --- a/tests/ui/suggestions/missing-assoc-fn.stderr +++ b/tests/ui/suggestions/missing-assoc-fn.stderr @@ -1,13 +1,3 @@ -error[E0658]: associated type bounds are unstable - --> $DIR/missing-assoc-fn.rs:9:22 - | -LL | fn bat<T: TraitB<Item: Copy>>(_: T) -> Self; - | ^^^^^^^^^^ - | - = note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information - = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - error[E0046]: not all trait items implemented, missing: `foo`, `bar`, `baz`, `bat` --> $DIR/missing-assoc-fn.rs:14:1 | @@ -31,7 +21,6 @@ LL | impl FromIterator<()> for X { | = help: implement the missing item: `fn from_iter<T: IntoIterator<Item = ()>>(_: T) -> Self { todo!() }` -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors -Some errors have detailed explanations: E0046, E0658. -For more information about an error, try `rustc --explain E0046`. +For more information about this error, try `rustc --explain E0046`. diff --git a/tests/ui/suggestions/missing-lifetime-specifier.rs b/tests/ui/suggestions/missing-lifetime-specifier.rs index 3fa7f75f862..cd7fa0c1d85 100644 --- a/tests/ui/suggestions/missing-lifetime-specifier.rs +++ b/tests/ui/suggestions/missing-lifetime-specifier.rs @@ -20,31 +20,21 @@ pub union Qux<'t, 'k, I> { trait Tar<'t, 'k, I> {} thread_local! { - //~^ ERROR lifetime may not live long enough - //~| ERROR lifetime may not live long enough static a: RefCell<HashMap<i32, Vec<Vec<Foo>>>> = RefCell::new(HashMap::new()); //~^ ERROR missing lifetime specifiers //~| ERROR missing lifetime specifiers } thread_local! { - //~^ ERROR lifetime may not live long enough - //~| ERROR lifetime may not live long enough - //~| ERROR lifetime may not live long enough static b: RefCell<HashMap<i32, Vec<Vec<&Bar>>>> = RefCell::new(HashMap::new()); //~^ ERROR missing lifetime specifiers //~| ERROR missing lifetime specifiers } thread_local! { - //~^ ERROR lifetime may not live long enough - //~| ERROR lifetime may not live long enough static c: RefCell<HashMap<i32, Vec<Vec<Qux<i32>>>>> = RefCell::new(HashMap::new()); //~^ ERROR missing lifetime specifiers //~| ERROR missing lifetime specifiers } thread_local! { - //~^ ERROR lifetime may not live long enough - //~| ERROR lifetime may not live long enough - //~| ERROR lifetime may not live long enough static d: RefCell<HashMap<i32, Vec<Vec<&Tar<i32>>>>> = RefCell::new(HashMap::new()); //~^ ERROR missing lifetime specifiers //~| ERROR missing lifetime specifiers diff --git a/tests/ui/suggestions/missing-lifetime-specifier.stderr b/tests/ui/suggestions/missing-lifetime-specifier.stderr index 62eca162148..2b85cfde7b6 100644 --- a/tests/ui/suggestions/missing-lifetime-specifier.stderr +++ b/tests/ui/suggestions/missing-lifetime-specifier.stderr @@ -1,5 +1,5 @@ error[E0106]: missing lifetime specifiers - --> $DIR/missing-lifetime-specifier.rs:25:44 + --> $DIR/missing-lifetime-specifier.rs:23:44 | LL | static a: RefCell<HashMap<i32, Vec<Vec<Foo>>>> = RefCell::new(HashMap::new()); | ^^^ expected 2 lifetime parameters @@ -11,11 +11,9 @@ LL | static a: RefCell<HashMap<i32, Vec<Vec<Foo<'static, 'static>>>>> = RefC | ++++++++++++++++++ error[E0106]: missing lifetime specifiers - --> $DIR/missing-lifetime-specifier.rs:25:44 + --> $DIR/missing-lifetime-specifier.rs:23:44 | LL | / thread_local! { -LL | | -LL | | LL | | static a: RefCell<HashMap<i32, Vec<Vec<Foo>>>> = RefCell::new(HashMap::new()); | | ^^^ expected 2 lifetime parameters LL | | @@ -26,7 +24,7 @@ LL | | } = help: this function's return type contains a borrowed value, but the signature does not say which one of `init`'s 3 lifetimes it is borrowed from error[E0106]: missing lifetime specifiers - --> $DIR/missing-lifetime-specifier.rs:33:44 + --> $DIR/missing-lifetime-specifier.rs:28:44 | LL | static b: RefCell<HashMap<i32, Vec<Vec<&Bar>>>> = RefCell::new(HashMap::new()); | ^^^^ expected 2 lifetime parameters @@ -40,12 +38,9 @@ LL | static b: RefCell<HashMap<i32, Vec<Vec<&'static Bar<'static, 'static>>> | +++++++ ++++++++++++++++++ error[E0106]: missing lifetime specifiers - --> $DIR/missing-lifetime-specifier.rs:33:44 + --> $DIR/missing-lifetime-specifier.rs:28:44 | LL | / thread_local! { -LL | | -LL | | -LL | | LL | | static b: RefCell<HashMap<i32, Vec<Vec<&Bar>>>> = RefCell::new(HashMap::new()); | | ^^^^ expected 2 lifetime parameters | | | @@ -58,7 +53,7 @@ LL | | } = help: this function's return type contains a borrowed value, but the signature does not say which one of `init`'s 4 lifetimes it is borrowed from error[E0106]: missing lifetime specifiers - --> $DIR/missing-lifetime-specifier.rs:40:47 + --> $DIR/missing-lifetime-specifier.rs:33:47 | LL | static c: RefCell<HashMap<i32, Vec<Vec<Qux<i32>>>>> = RefCell::new(HashMap::new()); | ^ expected 2 lifetime parameters @@ -70,11 +65,9 @@ LL | static c: RefCell<HashMap<i32, Vec<Vec<Qux<'static, 'static, i32>>>>> = | +++++++++++++++++ error[E0106]: missing lifetime specifiers - --> $DIR/missing-lifetime-specifier.rs:40:47 + --> $DIR/missing-lifetime-specifier.rs:33:47 | LL | / thread_local! { -LL | | -LL | | LL | | static c: RefCell<HashMap<i32, Vec<Vec<Qux<i32>>>>> = RefCell::new(HashMap::new()); | | ^ expected 2 lifetime parameters LL | | @@ -85,7 +78,7 @@ LL | | } = help: this function's return type contains a borrowed value, but the signature does not say which one of `init`'s 3 lifetimes it is borrowed from error[E0106]: missing lifetime specifiers - --> $DIR/missing-lifetime-specifier.rs:48:44 + --> $DIR/missing-lifetime-specifier.rs:38:44 | LL | static d: RefCell<HashMap<i32, Vec<Vec<&Tar<i32>>>>> = RefCell::new(HashMap::new()); | ^ ^ expected 2 lifetime parameters @@ -99,12 +92,9 @@ LL | static d: RefCell<HashMap<i32, Vec<Vec<&'static Tar<'static, 'static, i | +++++++ +++++++++++++++++ error[E0106]: missing lifetime specifiers - --> $DIR/missing-lifetime-specifier.rs:48:44 + --> $DIR/missing-lifetime-specifier.rs:38:44 | LL | / thread_local! { -LL | | -LL | | -LL | | LL | | static d: RefCell<HashMap<i32, Vec<Vec<&Tar<i32>>>>> = RefCell::new(HashMap::new()); | | ^ ^ expected 2 lifetime parameters | | | @@ -117,7 +107,7 @@ LL | | } = help: this function's return type contains a borrowed value, but the signature does not say which one of `init`'s 4 lifetimes it is borrowed from error[E0106]: missing lifetime specifier - --> $DIR/missing-lifetime-specifier.rs:58:44 + --> $DIR/missing-lifetime-specifier.rs:48:44 | LL | static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, i32>>>>> = RefCell::new(HashMap::new()); | ^ expected named lifetime parameter @@ -129,7 +119,7 @@ LL | static f: RefCell<HashMap<i32, Vec<Vec<&'static Tar<'static, i32>>>>> = | +++++++ error[E0106]: missing lifetime specifier - --> $DIR/missing-lifetime-specifier.rs:58:44 + --> $DIR/missing-lifetime-specifier.rs:48:44 | LL | / thread_local! { LL | | static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, i32>>>>> = RefCell::new(HashMap::new()); @@ -143,7 +133,7 @@ LL | | } = help: this function's return type contains a borrowed value, but the signature does not say which one of `init`'s 3 lifetimes it is borrowed from error[E0107]: union takes 2 lifetime arguments but 1 lifetime argument was supplied - --> $DIR/missing-lifetime-specifier.rs:54:44 + --> $DIR/missing-lifetime-specifier.rs:44:44 | LL | static e: RefCell<HashMap<i32, Vec<Vec<Qux<'static, i32>>>>> = RefCell::new(HashMap::new()); | ^^^ ------- supplied 1 lifetime argument @@ -161,7 +151,7 @@ LL | static e: RefCell<HashMap<i32, Vec<Vec<Qux<'static, 'static, i32>>>>> = | +++++++++ error[E0107]: trait takes 2 lifetime arguments but 1 lifetime argument was supplied - --> $DIR/missing-lifetime-specifier.rs:58:45 + --> $DIR/missing-lifetime-specifier.rs:48:45 | LL | static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, i32>>>>> = RefCell::new(HashMap::new()); | ^^^ ------- supplied 1 lifetime argument @@ -178,199 +168,7 @@ help: add missing lifetime argument LL | static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, 'static, i32>>>>> = RefCell::new(HashMap::new()); | +++++++++ -error: lifetime may not live long enough - --> $DIR/missing-lifetime-specifier.rs:22:1 - | -LL | / thread_local! { -LL | | -LL | | -LL | | static a: RefCell<HashMap<i32, Vec<Vec<Foo>>>> = RefCell::new(HashMap::new()); -LL | | -LL | | -LL | | } - | | ^ - | | | - | |_has type `Option<&mut Option<RefCell<HashMap<i32, Vec<Vec<Foo<'1, '_>>>>>>>` - | returning this value requires that `'1` must outlive `'static` - | - = note: this error originates in the macro `$crate::thread::local_impl::thread_local_inner` which comes from the expansion of the macro `thread_local` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: lifetime may not live long enough - --> $DIR/missing-lifetime-specifier.rs:22:1 - | -LL | / thread_local! { -LL | | -LL | | -LL | | static a: RefCell<HashMap<i32, Vec<Vec<Foo>>>> = RefCell::new(HashMap::new()); -LL | | -LL | | -LL | | } - | | ^ - | | | - | |_has type `Option<&mut Option<RefCell<HashMap<i32, Vec<Vec<Foo<'_, '2>>>>>>>` - | returning this value requires that `'2` must outlive `'static` - | - = note: this error originates in the macro `$crate::thread::local_impl::thread_local_inner` which comes from the expansion of the macro `thread_local` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: lifetime may not live long enough - --> $DIR/missing-lifetime-specifier.rs:29:1 - | -LL | / thread_local! { -LL | | -LL | | -LL | | -LL | | static b: RefCell<HashMap<i32, Vec<Vec<&Bar>>>> = RefCell::new(HashMap::new()); - | | - let's call the lifetime of this reference `'1` -LL | | -LL | | -LL | | } - | |_^ returning this value requires that `'1` must outlive `'static` - | - = note: this error originates in the macro `$crate::thread::local_impl::thread_local_inner` which comes from the expansion of the macro `thread_local` (in Nightly builds, run with -Z macro-backtrace for more info) -help: to declare that the trait object captures data from argument `init`, you can add an explicit `'_` lifetime bound - | -LL | static b: RefCell<HashMap<i32, Vec<Vec<&Bar + '_>>>> = RefCell::new(HashMap::new()); - | ++++ - -error: lifetime may not live long enough - --> $DIR/missing-lifetime-specifier.rs:29:1 - | -LL | / thread_local! { -LL | | -LL | | -LL | | -... | -LL | | -LL | | } - | | ^ - | | | - | |_has type `Option<&mut Option<RefCell<HashMap<i32, Vec<Vec<&dyn Bar<'2, '_>>>>>>>` - | returning this value requires that `'2` must outlive `'static` - | - = note: this error originates in the macro `$crate::thread::local_impl::thread_local_inner` which comes from the expansion of the macro `thread_local` (in Nightly builds, run with -Z macro-backtrace for more info) -help: to declare that the trait object captures data from argument `init`, you can add an explicit `'_` lifetime bound - | -LL | static b: RefCell<HashMap<i32, Vec<Vec<&Bar + '_>>>> = RefCell::new(HashMap::new()); - | ++++ - -error: lifetime may not live long enough - --> $DIR/missing-lifetime-specifier.rs:29:1 - | -LL | / thread_local! { -LL | | -LL | | -LL | | -... | -LL | | -LL | | } - | | ^ - | | | - | |_has type `Option<&mut Option<RefCell<HashMap<i32, Vec<Vec<&dyn Bar<'_, '3>>>>>>>` - | returning this value requires that `'3` must outlive `'static` - | - = note: this error originates in the macro `$crate::thread::local_impl::thread_local_inner` which comes from the expansion of the macro `thread_local` (in Nightly builds, run with -Z macro-backtrace for more info) -help: to declare that the trait object captures data from argument `init`, you can add an explicit `'_` lifetime bound - | -LL | static b: RefCell<HashMap<i32, Vec<Vec<&Bar + '_>>>> = RefCell::new(HashMap::new()); - | ++++ - -error: lifetime may not live long enough - --> $DIR/missing-lifetime-specifier.rs:37:1 - | -LL | / thread_local! { -LL | | -LL | | -LL | | static c: RefCell<HashMap<i32, Vec<Vec<Qux<i32>>>>> = RefCell::new(HashMap::new()); -LL | | -LL | | -LL | | } - | | ^ - | | | - | |_has type `Option<&mut Option<RefCell<HashMap<i32, Vec<Vec<Qux<'1, '_, i32>>>>>>>` - | returning this value requires that `'1` must outlive `'static` - | - = note: this error originates in the macro `$crate::thread::local_impl::thread_local_inner` which comes from the expansion of the macro `thread_local` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: lifetime may not live long enough - --> $DIR/missing-lifetime-specifier.rs:37:1 - | -LL | / thread_local! { -LL | | -LL | | -LL | | static c: RefCell<HashMap<i32, Vec<Vec<Qux<i32>>>>> = RefCell::new(HashMap::new()); -LL | | -LL | | -LL | | } - | | ^ - | | | - | |_has type `Option<&mut Option<RefCell<HashMap<i32, Vec<Vec<Qux<'_, '2, i32>>>>>>>` - | returning this value requires that `'2` must outlive `'static` - | - = note: this error originates in the macro `$crate::thread::local_impl::thread_local_inner` which comes from the expansion of the macro `thread_local` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: lifetime may not live long enough - --> $DIR/missing-lifetime-specifier.rs:44:1 - | -LL | / thread_local! { -LL | | -LL | | -LL | | -LL | | static d: RefCell<HashMap<i32, Vec<Vec<&Tar<i32>>>>> = RefCell::new(HashMap::new()); - | | - let's call the lifetime of this reference `'1` -LL | | -LL | | -LL | | } - | |_^ returning this value requires that `'1` must outlive `'static` - | - = note: this error originates in the macro `$crate::thread::local_impl::thread_local_inner` which comes from the expansion of the macro `thread_local` (in Nightly builds, run with -Z macro-backtrace for more info) -help: to declare that the trait object captures data from argument `init`, you can add an explicit `'_` lifetime bound - | -LL | static d: RefCell<HashMap<i32, Vec<Vec<&Tar<i32> + '_>>>> = RefCell::new(HashMap::new()); - | ++++ - -error: lifetime may not live long enough - --> $DIR/missing-lifetime-specifier.rs:44:1 - | -LL | / thread_local! { -LL | | -LL | | -LL | | -... | -LL | | -LL | | } - | | ^ - | | | - | |_has type `Option<&mut Option<RefCell<HashMap<i32, Vec<Vec<&dyn Tar<'2, '_, i32>>>>>>>` - | returning this value requires that `'2` must outlive `'static` - | - = note: this error originates in the macro `$crate::thread::local_impl::thread_local_inner` which comes from the expansion of the macro `thread_local` (in Nightly builds, run with -Z macro-backtrace for more info) -help: to declare that the trait object captures data from argument `init`, you can add an explicit `'_` lifetime bound - | -LL | static d: RefCell<HashMap<i32, Vec<Vec<&Tar<i32> + '_>>>> = RefCell::new(HashMap::new()); - | ++++ - -error: lifetime may not live long enough - --> $DIR/missing-lifetime-specifier.rs:44:1 - | -LL | / thread_local! { -LL | | -LL | | -LL | | -... | -LL | | -LL | | } - | | ^ - | | | - | |_has type `Option<&mut Option<RefCell<HashMap<i32, Vec<Vec<&dyn Tar<'_, '3, i32>>>>>>>` - | returning this value requires that `'3` must outlive `'static` - | - = note: this error originates in the macro `$crate::thread::local_impl::thread_local_inner` which comes from the expansion of the macro `thread_local` (in Nightly builds, run with -Z macro-backtrace for more info) -help: to declare that the trait object captures data from argument `init`, you can add an explicit `'_` lifetime bound - | -LL | static d: RefCell<HashMap<i32, Vec<Vec<&Tar<i32> + '_>>>> = RefCell::new(HashMap::new()); - | ++++ - -error: aborting due to 22 previous errors +error: aborting due to 12 previous errors Some errors have detailed explanations: E0106, E0107. For more information about an error, try `rustc --explain E0106`. diff --git a/tests/ui/suggestions/ref-pattern-binding.stderr b/tests/ui/suggestions/ref-pattern-binding.stderr index 69ce5d440af..af21c6aef70 100644 --- a/tests/ui/suggestions/ref-pattern-binding.stderr +++ b/tests/ui/suggestions/ref-pattern-binding.stderr @@ -5,7 +5,7 @@ LL | let _moved @ ref _from = String::from("foo"); | ^^^^^^ --------- value borrowed here after move | | | value moved into `_moved` here - | move occurs because `_moved` has type `String` which does not implement the `Copy` trait + | move occurs because `_moved` has type `String`, which does not implement the `Copy` trait | help: borrow this binding in the pattern to avoid moving the value | @@ -35,7 +35,7 @@ LL | let _moved @ S { ref f } = S { f: String::from("foo") }; | ^^^^^^ ----- value borrowed here after move | | | value moved into `_moved` here - | move occurs because `_moved` has type `S` which does not implement the `Copy` trait + | move occurs because `_moved` has type `S`, which does not implement the `Copy` trait | help: borrow this binding in the pattern to avoid moving the value | diff --git a/tests/ui/suggestions/suppress-consider-slicing-issue-120605.rs b/tests/ui/suggestions/suppress-consider-slicing-issue-120605.rs new file mode 100644 index 00000000000..135535cd00a --- /dev/null +++ b/tests/ui/suggestions/suppress-consider-slicing-issue-120605.rs @@ -0,0 +1,20 @@ +pub struct Struct { + a: Vec<Struct>, +} + +impl Struct { + pub fn test(&self) { + if let [Struct { a: [] }] = &self.a { + //~^ ERROR expected an array or slice + //~| ERROR expected an array or slice + println!("matches!") + } + + if let [Struct { a: [] }] = &self.a[..] { + //~^ ERROR expected an array or slice + println!("matches!") + } + } +} + +fn main() {} diff --git a/tests/ui/suggestions/suppress-consider-slicing-issue-120605.stderr b/tests/ui/suggestions/suppress-consider-slicing-issue-120605.stderr new file mode 100644 index 00000000000..c28d67604da --- /dev/null +++ b/tests/ui/suggestions/suppress-consider-slicing-issue-120605.stderr @@ -0,0 +1,23 @@ +error[E0529]: expected an array or slice, found `Vec<Struct>` + --> $DIR/suppress-consider-slicing-issue-120605.rs:7:16 + | +LL | if let [Struct { a: [] }] = &self.a { + | ^^^^^^^^^^^^^^^^^^ ------- help: consider slicing here: `&self.a[..]` + | | + | pattern cannot match with input type `Vec<Struct>` + +error[E0529]: expected an array or slice, found `Vec<Struct>` + --> $DIR/suppress-consider-slicing-issue-120605.rs:7:29 + | +LL | if let [Struct { a: [] }] = &self.a { + | ^^ pattern cannot match with input type `Vec<Struct>` + +error[E0529]: expected an array or slice, found `Vec<Struct>` + --> $DIR/suppress-consider-slicing-issue-120605.rs:13:29 + | +LL | if let [Struct { a: [] }] = &self.a[..] { + | ^^ pattern cannot match with input type `Vec<Struct>` + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0529`. diff --git a/tests/ui/suggestions/type-ascription-instead-of-path-in-type.rs b/tests/ui/suggestions/type-ascription-instead-of-path-in-type.rs index 48d19f6dd4e..c98eec4af01 100644 --- a/tests/ui/suggestions/type-ascription-instead-of-path-in-type.rs +++ b/tests/ui/suggestions/type-ascription-instead-of-path-in-type.rs @@ -6,8 +6,6 @@ fn main() { let _: Vec<A:B> = A::B; //~^ ERROR cannot find trait `B` in this scope //~| HELP you might have meant to write a path instead of an associated type bound - //~| ERROR associated type bounds are unstable - //~| HELP add `#![feature(associated_type_bounds)]` to the crate attributes to enable //~| ERROR struct takes at least 1 generic argument but 0 generic arguments were supplied //~| HELP add missing generic argument //~| ERROR associated type bindings are not allowed here diff --git a/tests/ui/suggestions/type-ascription-instead-of-path-in-type.stderr b/tests/ui/suggestions/type-ascription-instead-of-path-in-type.stderr index 9c22873e79c..834c141ec3e 100644 --- a/tests/ui/suggestions/type-ascription-instead-of-path-in-type.stderr +++ b/tests/ui/suggestions/type-ascription-instead-of-path-in-type.stderr @@ -9,16 +9,6 @@ help: you might have meant to write a path instead of an associated type bound LL | let _: Vec<A::B> = A::B; | ~~ -error[E0658]: associated type bounds are unstable - --> $DIR/type-ascription-instead-of-path-in-type.rs:6:16 - | -LL | let _: Vec<A:B> = A::B; - | ^^^ - | - = note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information - = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - error[E0107]: struct takes at least 1 generic argument but 0 generic arguments were supplied --> $DIR/type-ascription-instead-of-path-in-type.rs:6:12 | @@ -36,7 +26,7 @@ error[E0229]: associated type bindings are not allowed here LL | let _: Vec<A:B> = A::B; | ^^^ associated type not allowed here -error: aborting due to 4 previous errors +error: aborting due to 3 previous errors -Some errors have detailed explanations: E0107, E0229, E0405, E0658. +Some errors have detailed explanations: E0107, E0229, E0405. For more information about an error, try `rustc --explain E0107`. diff --git a/tests/ui/suggestions/types/into-inference-needs-type.rs b/tests/ui/suggestions/types/into-inference-needs-type.rs new file mode 100644 index 00000000000..4c8b6ec2113 --- /dev/null +++ b/tests/ui/suggestions/types/into-inference-needs-type.rs @@ -0,0 +1,15 @@ +#[derive(Debug)] +enum MyError { + MainError +} + +fn main() -> Result<(), MyError> { + let vec = vec!["one", "two", "three"]; + let list = vec + .iter() + .map(|s| s.strip_prefix("t")) + .filter_map(Option::Some) + .into()?; //~ ERROR type annotations needed + + return Ok(()); +} diff --git a/tests/ui/suggestions/types/into-inference-needs-type.stderr b/tests/ui/suggestions/types/into-inference-needs-type.stderr new file mode 100644 index 00000000000..dd688f90289 --- /dev/null +++ b/tests/ui/suggestions/types/into-inference-needs-type.stderr @@ -0,0 +1,19 @@ +error[E0283]: type annotations needed + --> $DIR/into-inference-needs-type.rs:12:10 + | +LL | .into()?; + | ^^^^ + | + = note: cannot satisfy `_: From<FilterMap<Map<std::slice::Iter<'_, &str>, {closure@$DIR/into-inference-needs-type.rs:10:14: 10:17}>, fn(Option<&str>) -> Option<Option<&str>> {Option::<Option<&str>>::Some}>>` + = note: required for `FilterMap<Map<std::slice::Iter<'_, &str>, {closure@$DIR/into-inference-needs-type.rs:10:14: 10:17}>, fn(Option<&str>) -> Option<Option<&str>> {Option::<Option<&str>>::Some}>` to implement `Into<_>` +help: try using a fully qualified path to specify the expected types + | +LL ~ let list = <FilterMap<Map<std::slice::Iter<'_, &str>, _>, _> as Into<T>>::into(vec +LL | .iter() +LL | .map(|s| s.strip_prefix("t")) +LL ~ .filter_map(Option::Some))?; + | + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0283`. diff --git a/tests/ui/trait-bounds/super-assoc-mismatch.stderr b/tests/ui/trait-bounds/super-assoc-mismatch.stderr index 47535776348..f2c5eb47e59 100644 --- a/tests/ui/trait-bounds/super-assoc-mismatch.stderr +++ b/tests/ui/trait-bounds/super-assoc-mismatch.stderr @@ -78,7 +78,10 @@ help: this trait has no implementations, consider adding one LL | trait Sub: Super<Assoc = u16> {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: see issue #48214 - = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable +help: add `#![feature(trivial_bounds)]` to the crate attributes to enable + | +LL + #![feature(trivial_bounds)] + | error[E0277]: the trait bound `(): SubGeneric<u16>` is not satisfied --> $DIR/super-assoc-mismatch.rs:55:22 diff --git a/tests/ui/traits/alias/self-in-generics.rs b/tests/ui/traits/alias/self-in-generics.rs index dcb33b7a90a..433b741532d 100644 --- a/tests/ui/traits/alias/self-in-generics.rs +++ b/tests/ui/traits/alias/self-in-generics.rs @@ -1,4 +1,4 @@ -// astconv uses `FreshTy(0)` as a dummy `Self` type when instanciating trait objects. +// HIR ty lowering uses `FreshTy(0)` as a dummy `Self` type when instanciating trait objects. // This `FreshTy(0)` can leak into substs, causing ICEs in several places. #![feature(trait_alias)] diff --git a/tests/ui/traits/associated_type_bound/116464-invalid-assoc-type-suggestion-in-trait-impl.rs b/tests/ui/traits/associated_type_bound/116464-invalid-assoc-type-suggestion-in-trait-impl.rs index 7d71fcdd158..cab484a120c 100644 --- a/tests/ui/traits/associated_type_bound/116464-invalid-assoc-type-suggestion-in-trait-impl.rs +++ b/tests/ui/traits/associated_type_bound/116464-invalid-assoc-type-suggestion-in-trait-impl.rs @@ -20,6 +20,7 @@ impl<T, S> Trait<T, S> for () {} fn func<T: Trait<u32, String>>(t: T) -> impl Trait<(), i32> { //~^ ERROR trait takes 1 generic argument but 2 generic arguments were supplied //~| ERROR trait takes 1 generic argument but 2 generic arguments were supplied +//~| ERROR trait takes 1 generic argument but 2 generic arguments were supplied //~| ERROR type annotations needed 3 } diff --git a/tests/ui/traits/associated_type_bound/116464-invalid-assoc-type-suggestion-in-trait-impl.stderr b/tests/ui/traits/associated_type_bound/116464-invalid-assoc-type-suggestion-in-trait-impl.stderr index f4ede4190fc..99e81a9039e 100644 --- a/tests/ui/traits/associated_type_bound/116464-invalid-assoc-type-suggestion-in-trait-impl.stderr +++ b/tests/ui/traits/associated_type_bound/116464-invalid-assoc-type-suggestion-in-trait-impl.stderr @@ -54,6 +54,23 @@ help: replace the generic bound with the associated type LL | fn func<T: Trait<u32, String>>(t: T) -> impl Trait<(), Assoc = i32> { | +++++++ +error[E0107]: trait takes 1 generic argument but 2 generic arguments were supplied + --> $DIR/116464-invalid-assoc-type-suggestion-in-trait-impl.rs:20:46 + | +LL | fn func<T: Trait<u32, String>>(t: T) -> impl Trait<(), i32> { + | ^^^^^ expected 1 generic argument + | +note: trait defined here, with 1 generic parameter: `T` + --> $DIR/116464-invalid-assoc-type-suggestion-in-trait-impl.rs:5:11 + | +LL | pub trait Trait<T> { + | ^^^^^ - + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` +help: replace the generic bound with the associated type + | +LL | fn func<T: Trait<u32, String>>(t: T) -> impl Trait<(), Assoc = i32> { + | +++++++ + error[E0282]: type annotations needed --> $DIR/116464-invalid-assoc-type-suggestion-in-trait-impl.rs:20:41 | @@ -61,7 +78,7 @@ LL | fn func<T: Trait<u32, String>>(t: T) -> impl Trait<(), i32> { | ^^^^^^^^^^^^^^^^^^^ cannot infer type error[E0107]: trait takes 1 generic argument but 2 generic arguments were supplied - --> $DIR/116464-invalid-assoc-type-suggestion-in-trait-impl.rs:27:18 + --> $DIR/116464-invalid-assoc-type-suggestion-in-trait-impl.rs:28:18 | LL | struct Struct<T: Trait<u32, String>> { | ^^^^^ expected 1 generic argument @@ -77,7 +94,7 @@ LL | struct Struct<T: Trait<u32, Assoc = String>> { | +++++++ error[E0107]: trait takes 1 generic argument but 2 generic arguments were supplied - --> $DIR/116464-invalid-assoc-type-suggestion-in-trait-impl.rs:32:23 + --> $DIR/116464-invalid-assoc-type-suggestion-in-trait-impl.rs:33:23 | LL | trait AnotherTrait<T: Trait<T, i32>> {} | ^^^^^ expected 1 generic argument @@ -93,7 +110,7 @@ LL | trait AnotherTrait<T: Trait<T, Assoc = i32>> {} | +++++++ error[E0107]: trait takes 1 generic argument but 2 generic arguments were supplied - --> $DIR/116464-invalid-assoc-type-suggestion-in-trait-impl.rs:35:9 + --> $DIR/116464-invalid-assoc-type-suggestion-in-trait-impl.rs:36:9 | LL | impl<T: Trait<u32, String>> Struct<T> {} | ^^^^^ expected 1 generic argument @@ -109,7 +126,7 @@ LL | impl<T: Trait<u32, Assoc = String>> Struct<T> {} | +++++++ error[E0107]: struct takes 1 generic argument but 2 generic arguments were supplied - --> $DIR/116464-invalid-assoc-type-suggestion-in-trait-impl.rs:41:58 + --> $DIR/116464-invalid-assoc-type-suggestion-in-trait-impl.rs:42:58 | LL | impl<T: Trait<u32, Assoc=String>, U> YetAnotherTrait for Struct<T, U> {} | ^^^^^^ - help: remove this generic argument @@ -117,12 +134,12 @@ LL | impl<T: Trait<u32, Assoc=String>, U> YetAnotherTrait for Struct<T, U> {} | expected 1 generic argument | note: struct defined here, with 1 generic parameter: `T` - --> $DIR/116464-invalid-assoc-type-suggestion-in-trait-impl.rs:27:8 + --> $DIR/116464-invalid-assoc-type-suggestion-in-trait-impl.rs:28:8 | LL | struct Struct<T: Trait<u32, String>> { | ^^^^^^ - -error: aborting due to 10 previous errors +error: aborting due to 11 previous errors Some errors have detailed explanations: E0107, E0207, E0282. For more information about an error, try `rustc --explain E0107`. diff --git a/tests/ui/traits/impl-of-supertrait-has-wrong-lifetime-parameters.stderr b/tests/ui/traits/impl-of-supertrait-has-wrong-lifetime-parameters.stderr index 092776edea7..8bf8536c74e 100644 --- a/tests/ui/traits/impl-of-supertrait-has-wrong-lifetime-parameters.stderr +++ b/tests/ui/traits/impl-of-supertrait-has-wrong-lifetime-parameters.stderr @@ -4,16 +4,16 @@ error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'b` d LL | impl<'a,'b> T2<'a, 'b> for S<'a, 'b> { | ^^^^^^^^^ | -note: first, the lifetime cannot outlive the lifetime `'a` as defined here... - --> $DIR/impl-of-supertrait-has-wrong-lifetime-parameters.rs:24:6 - | -LL | impl<'a,'b> T2<'a, 'b> for S<'a, 'b> { - | ^^ -note: ...but the lifetime must also be valid for the lifetime `'b` as defined here... +note: first, the lifetime cannot outlive the lifetime `'b` as defined here... --> $DIR/impl-of-supertrait-has-wrong-lifetime-parameters.rs:24:9 | LL | impl<'a,'b> T2<'a, 'b> for S<'a, 'b> { | ^^ +note: ...but the lifetime must also be valid for the lifetime `'a` as defined here... + --> $DIR/impl-of-supertrait-has-wrong-lifetime-parameters.rs:24:6 + | +LL | impl<'a,'b> T2<'a, 'b> for S<'a, 'b> { + | ^^ note: ...so that the types are compatible --> $DIR/impl-of-supertrait-has-wrong-lifetime-parameters.rs:24:28 | diff --git a/tests/ui/traits/matching-lifetimes.stderr b/tests/ui/traits/matching-lifetimes.stderr index f8119ed415d..8a802d57f5c 100644 --- a/tests/ui/traits/matching-lifetimes.stderr +++ b/tests/ui/traits/matching-lifetimes.stderr @@ -6,16 +6,16 @@ LL | fn foo(x: Foo<'b,'a>) { | = note: expected signature `fn(Foo<'a, 'b>)` found signature `fn(Foo<'b, 'a>)` -note: the lifetime `'b` as defined here... - --> $DIR/matching-lifetimes.rs:13:9 - | -LL | impl<'a,'b> Tr for Foo<'a,'b> { - | ^^ -note: ...does not necessarily outlive the lifetime `'a` as defined here +note: the lifetime `'a` as defined here... --> $DIR/matching-lifetimes.rs:13:6 | LL | impl<'a,'b> Tr for Foo<'a,'b> { | ^^ +note: ...does not necessarily outlive the lifetime `'b` as defined here + --> $DIR/matching-lifetimes.rs:13:9 + | +LL | impl<'a,'b> Tr for Foo<'a,'b> { + | ^^ error[E0308]: method not compatible with trait --> $DIR/matching-lifetimes.rs:14:5 @@ -25,16 +25,16 @@ LL | fn foo(x: Foo<'b,'a>) { | = note: expected signature `fn(Foo<'a, 'b>)` found signature `fn(Foo<'b, 'a>)` -note: the lifetime `'a` as defined here... - --> $DIR/matching-lifetimes.rs:13:6 - | -LL | impl<'a,'b> Tr for Foo<'a,'b> { - | ^^ -note: ...does not necessarily outlive the lifetime `'b` as defined here +note: the lifetime `'b` as defined here... --> $DIR/matching-lifetimes.rs:13:9 | LL | impl<'a,'b> Tr for Foo<'a,'b> { | ^^ +note: ...does not necessarily outlive the lifetime `'a` as defined here + --> $DIR/matching-lifetimes.rs:13:6 + | +LL | impl<'a,'b> Tr for Foo<'a,'b> { + | ^^ error: aborting due to 2 previous errors diff --git a/tests/ui/traits/negative-bounds/associated-constraints.rs b/tests/ui/traits/negative-bounds/associated-constraints.rs index 4a7132ccde9..795e68bb469 100644 --- a/tests/ui/traits/negative-bounds/associated-constraints.rs +++ b/tests/ui/traits/negative-bounds/associated-constraints.rs @@ -1,4 +1,4 @@ -#![feature(negative_bounds, associated_type_bounds)] +#![feature(negative_bounds)] trait Trait { type Assoc; diff --git a/tests/ui/traits/next-solver/coherence-fulfill-overflow.rs b/tests/ui/traits/next-solver/coherence/coherence-fulfill-overflow.rs index ff577da32c2..ff577da32c2 100644 --- a/tests/ui/traits/next-solver/coherence-fulfill-overflow.rs +++ b/tests/ui/traits/next-solver/coherence/coherence-fulfill-overflow.rs diff --git a/tests/ui/traits/next-solver/coherence-fulfill-overflow.stderr b/tests/ui/traits/next-solver/coherence/coherence-fulfill-overflow.stderr index 57cba790b55..57cba790b55 100644 --- a/tests/ui/traits/next-solver/coherence-fulfill-overflow.stderr +++ b/tests/ui/traits/next-solver/coherence/coherence-fulfill-overflow.stderr diff --git a/tests/ui/traits/next-solver/negative-coherence-bounds.rs b/tests/ui/traits/next-solver/coherence/negative-coherence-bounds.rs index d98cd1147ef..d98cd1147ef 100644 --- a/tests/ui/traits/next-solver/negative-coherence-bounds.rs +++ b/tests/ui/traits/next-solver/coherence/negative-coherence-bounds.rs diff --git a/tests/ui/traits/next-solver/negative-coherence-bounds.stderr b/tests/ui/traits/next-solver/coherence/negative-coherence-bounds.stderr index 4127f51f56d..4127f51f56d 100644 --- a/tests/ui/traits/next-solver/negative-coherence-bounds.stderr +++ b/tests/ui/traits/next-solver/coherence/negative-coherence-bounds.stderr diff --git a/tests/ui/traits/next-solver/coherence/trait_ref_is_knowable-norm-overflow.stderr b/tests/ui/traits/next-solver/coherence/trait_ref_is_knowable-norm-overflow.stderr index 39d453e8035..1d42dbdfe00 100644 --- a/tests/ui/traits/next-solver/coherence/trait_ref_is_knowable-norm-overflow.stderr +++ b/tests/ui/traits/next-solver/coherence/trait_ref_is_knowable-norm-overflow.stderr @@ -4,7 +4,6 @@ error[E0275]: overflow evaluating the requirement `<T as Overflow>::Assoc: Sized LL | type Assoc = <T as Overflow>::Assoc; | ^^^^^^^^^^^^^^^^^^^^^^ | - = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`trait_ref_is_knowable_norm_overflow`) note: required by a bound in `Overflow::Assoc` --> $DIR/trait_ref_is_knowable-norm-overflow.rs:7:5 | @@ -23,9 +22,6 @@ LL | impl<T: Copy> Trait for T {} LL | struct LocalTy; LL | impl Trait for <LocalTy as Overflow>::Assoc {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation - | - = note: overflow evaluating the requirement `_ == <LocalTy as Overflow>::Assoc` - = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`trait_ref_is_knowable_norm_overflow`) error: aborting due to 2 previous errors diff --git a/tests/ui/traits/next-solver/equating-projection-cyclically.rs b/tests/ui/traits/next-solver/generalize/equating-projection-cyclically.rs index 317eb65745a..317eb65745a 100644 --- a/tests/ui/traits/next-solver/equating-projection-cyclically.rs +++ b/tests/ui/traits/next-solver/generalize/equating-projection-cyclically.rs diff --git a/tests/ui/traits/next-solver/issue-118950-root-region.stderr b/tests/ui/traits/next-solver/issue-118950-root-region.stderr index 45ff9f763cd..5cb24fa19aa 100644 --- a/tests/ui/traits/next-solver/issue-118950-root-region.stderr +++ b/tests/ui/traits/next-solver/issue-118950-root-region.stderr @@ -19,10 +19,10 @@ error: the type `<*const T as ToUnit<'a>>::Unit` is not well-formed LL | type Assoc<'a, T> = <*const T as ToUnit<'a>>::Unit; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:15 ~ issue_118950_root_region[d54f]::{impl#1}::'a), 'a) }), ?1t], def_id: DefId(0:8 ~ issue_118950_root_region[d54f]::Assoc) } -WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:15 ~ issue_118950_root_region[d54f]::{impl#1}::'a), 'a) }), ?1t], def_id: DefId(0:8 ~ issue_118950_root_region[d54f]::Assoc) } -WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:15 ~ issue_118950_root_region[d54f]::{impl#1}::'a), 'a) }), ?1t], def_id: DefId(0:8 ~ issue_118950_root_region[d54f]::Assoc) } -WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:15 ~ issue_118950_root_region[d54f]::{impl#1}::'a), 'a) }), ?1t], def_id: DefId(0:8 ~ issue_118950_root_region[d54f]::Assoc) } +WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: ['^0.Named(DefId(0:15 ~ issue_118950_root_region[d54f]::{impl#1}::'a), "'a"), ?1t], def_id: DefId(0:8 ~ issue_118950_root_region[d54f]::Assoc) } +WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: ['^0.Named(DefId(0:15 ~ issue_118950_root_region[d54f]::{impl#1}::'a), "'a"), ?1t], def_id: DefId(0:8 ~ issue_118950_root_region[d54f]::Assoc) } +WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: ['^0.Named(DefId(0:15 ~ issue_118950_root_region[d54f]::{impl#1}::'a), "'a"), ?1t], def_id: DefId(0:8 ~ issue_118950_root_region[d54f]::Assoc) } +WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: ['^0.Named(DefId(0:15 ~ issue_118950_root_region[d54f]::{impl#1}::'a), "'a"), ?1t], def_id: DefId(0:8 ~ issue_118950_root_region[d54f]::Assoc) } error[E0119]: conflicting implementations of trait `Overlap<fn(_)>` for type `fn(_)` --> $DIR/issue-118950-root-region.rs:19:1 | diff --git a/tests/ui/traits/next-solver/normalize/indirectly-constrained-term.rs b/tests/ui/traits/next-solver/normalize/indirectly-constrained-term.rs new file mode 100644 index 00000000000..380477c2c3c --- /dev/null +++ b/tests/ui/traits/next-solver/normalize/indirectly-constrained-term.rs @@ -0,0 +1,45 @@ +//@ revisions: current next +//@[next] compile-flags: -Znext-solver=coherence +//@ ignore-compare-mode-next-solver (explicit revisions) +//@ check-pass + +// A regression test for `paperclip-core`. This previously failed to compile +// in the new solver. +// +// Behavior in old solver: +// We prove `Projection(<W<?0> as Unconstrained>::Assoc, ())`. This +// normalizes `<W<?0> as Unconstrained>::Assoc` to `?1` with nested goals +// `[Projection(<?0 as Unconstrained>::Assoc, ?1), Trait(?1: NoImpl)]`. +// We then unify `?1` with `()`. At this point `?1: NoImpl` does not hold, +// and we get an error. +// +// Previous behavior of the new solver: +// We prove `Projection(<W<?0> as Unconstrained>::Assoc, ())`. This normalizes +// `<W<?0> as Unconstrained>::Assoc` to `?1` and eagerly computes the nested +// goals `[Projection(<?0 as Unconstrained>::Assoc, ?1), Trait(?1: NoImpl)]`. +// These goals are both ambiguous. `NormalizesTo`` then returns `?1` as the +// normalized-to type. It discards the nested goals, forcing the certainty of +// the normalization to `Maybe`. Unifying `?1` with `()` succeeds¹. However, +// this is never propagated to the `?1: NoImpl` goal, as it only exists inside +// of the `NormalizesTo` goal. The normalized-to term always starts out as +// unconstrained. +// +// We fix this regression by returning the nested goals of `NormalizesTo` goals +// to the `AliasRelate`. This results in us checking `(): NoImpl`, same as the +// old solver. + +struct W<T: ?Sized>(T); +trait NoImpl {} +trait Unconstrained { + type Assoc; +} +impl<T: Unconstrained<Assoc = U>, U: NoImpl> Unconstrained for W<T> { + type Assoc = U; +} + + +trait Overlap {} +impl<T: Unconstrained<Assoc = ()>> Overlap for T {} +impl<U> Overlap for W<U> {} + +fn main() {} diff --git a/tests/ui/traits/next-solver/two-projection-param-candidates-are-ambiguous.rs b/tests/ui/traits/next-solver/normalize/two-projection-param-candidates-are-ambiguous.rs index 40d68dbaffd..40d68dbaffd 100644 --- a/tests/ui/traits/next-solver/two-projection-param-candidates-are-ambiguous.rs +++ b/tests/ui/traits/next-solver/normalize/two-projection-param-candidates-are-ambiguous.rs diff --git a/tests/ui/traits/next-solver/two-projection-param-candidates-are-ambiguous.stderr b/tests/ui/traits/next-solver/normalize/two-projection-param-candidates-are-ambiguous.stderr index dfff9f11b87..dfff9f11b87 100644 --- a/tests/ui/traits/next-solver/two-projection-param-candidates-are-ambiguous.stderr +++ b/tests/ui/traits/next-solver/normalize/two-projection-param-candidates-are-ambiguous.stderr diff --git a/tests/ui/traits/next-solver/overflow/recursive-self-normalization-2.stderr b/tests/ui/traits/next-solver/overflow/recursive-self-normalization-2.stderr index 09622bb9b6c..2b0e57966fe 100644 --- a/tests/ui/traits/next-solver/overflow/recursive-self-normalization-2.stderr +++ b/tests/ui/traits/next-solver/overflow/recursive-self-normalization-2.stderr @@ -3,8 +3,6 @@ error[E0275]: overflow evaluating the requirement `<T as Foo1>::Assoc1 == _` | LL | needs_bar::<T::Assoc1>(); | ^^^^^^^^^ - | - = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`recursive_self_normalization_2`) error[E0275]: overflow evaluating the requirement `<T as Foo1>::Assoc1: Bar` --> $DIR/recursive-self-normalization-2.rs:15:17 @@ -12,7 +10,6 @@ error[E0275]: overflow evaluating the requirement `<T as Foo1>::Assoc1: Bar` LL | needs_bar::<T::Assoc1>(); | ^^^^^^^^^ | - = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`recursive_self_normalization_2`) note: required by a bound in `needs_bar` --> $DIR/recursive-self-normalization-2.rs:12:17 | @@ -25,7 +22,6 @@ error[E0275]: overflow evaluating the requirement `<T as Foo1>::Assoc1: Sized` LL | needs_bar::<T::Assoc1>(); | ^^^^^^^^^ | - = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`recursive_self_normalization_2`) note: required by an implicit `Sized` bound in `needs_bar` --> $DIR/recursive-self-normalization-2.rs:12:14 | @@ -41,8 +37,6 @@ error[E0275]: overflow evaluating the requirement `<T as Foo1>::Assoc1 == _` | LL | needs_bar::<T::Assoc1>(); | ^^^^^^^^^^^^^^^^^^^^^^ - | - = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`recursive_self_normalization_2`) error[E0275]: overflow evaluating the requirement `<T as Foo1>::Assoc1 == _` --> $DIR/recursive-self-normalization-2.rs:15:5 @@ -50,7 +44,6 @@ error[E0275]: overflow evaluating the requirement `<T as Foo1>::Assoc1 == _` LL | needs_bar::<T::Assoc1>(); | ^^^^^^^^^^^^^^^^^^^^^^ | - = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`recursive_self_normalization_2`) = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0275]: overflow evaluating the requirement `<T as Foo1>::Assoc1 == _` @@ -59,7 +52,6 @@ error[E0275]: overflow evaluating the requirement `<T as Foo1>::Assoc1 == _` LL | needs_bar::<T::Assoc1>(); | ^^^^^^^^^ | - = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`recursive_self_normalization_2`) = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: aborting due to 6 previous errors diff --git a/tests/ui/traits/next-solver/overflow/recursive-self-normalization.stderr b/tests/ui/traits/next-solver/overflow/recursive-self-normalization.stderr index 7c058909df7..af8504dcaee 100644 --- a/tests/ui/traits/next-solver/overflow/recursive-self-normalization.stderr +++ b/tests/ui/traits/next-solver/overflow/recursive-self-normalization.stderr @@ -3,8 +3,6 @@ error[E0275]: overflow evaluating the requirement `<T as Foo>::Assoc == _` | LL | needs_bar::<T::Assoc>(); | ^^^^^^^^ - | - = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`recursive_self_normalization`) error[E0275]: overflow evaluating the requirement `<T as Foo>::Assoc: Bar` --> $DIR/recursive-self-normalization.rs:11:17 @@ -12,7 +10,6 @@ error[E0275]: overflow evaluating the requirement `<T as Foo>::Assoc: Bar` LL | needs_bar::<T::Assoc>(); | ^^^^^^^^ | - = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`recursive_self_normalization`) note: required by a bound in `needs_bar` --> $DIR/recursive-self-normalization.rs:8:17 | @@ -25,7 +22,6 @@ error[E0275]: overflow evaluating the requirement `<T as Foo>::Assoc: Sized` LL | needs_bar::<T::Assoc>(); | ^^^^^^^^ | - = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`recursive_self_normalization`) note: required by an implicit `Sized` bound in `needs_bar` --> $DIR/recursive-self-normalization.rs:8:14 | @@ -41,8 +37,6 @@ error[E0275]: overflow evaluating the requirement `<T as Foo>::Assoc == _` | LL | needs_bar::<T::Assoc>(); | ^^^^^^^^^^^^^^^^^^^^^ - | - = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`recursive_self_normalization`) error[E0275]: overflow evaluating the requirement `<T as Foo>::Assoc == _` --> $DIR/recursive-self-normalization.rs:11:5 @@ -50,7 +44,6 @@ error[E0275]: overflow evaluating the requirement `<T as Foo>::Assoc == _` LL | needs_bar::<T::Assoc>(); | ^^^^^^^^^^^^^^^^^^^^^ | - = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`recursive_self_normalization`) = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0275]: overflow evaluating the requirement `<T as Foo>::Assoc == _` @@ -59,7 +52,6 @@ error[E0275]: overflow evaluating the requirement `<T as Foo>::Assoc == _` LL | needs_bar::<T::Assoc>(); | ^^^^^^^^ | - = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`recursive_self_normalization`) = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: aborting due to 6 previous errors diff --git a/tests/ui/traits/span-bug-issue-121414.rs b/tests/ui/traits/span-bug-issue-121414.rs index 6fbe2c179c6..ec38d8c2de6 100644 --- a/tests/ui/traits/span-bug-issue-121414.rs +++ b/tests/ui/traits/span-bug-issue-121414.rs @@ -6,7 +6,8 @@ impl<'a> Bar for Foo<'f> { //~ ERROR undeclared lifetime type Type = u32; } -fn test() //~ ERROR implementation of `Bar` is not general enough +fn test() //~ ERROR the trait bound `for<'a> Foo<'a>: Bar` is not satisfied + //~| ERROR the trait bound `for<'a> Foo<'a>: Bar` is not satisfied where for<'a> <Foo<'a> as Bar>::Type: Sized, { diff --git a/tests/ui/traits/span-bug-issue-121414.stderr b/tests/ui/traits/span-bug-issue-121414.stderr index 3c97f64e781..e2ef6672cd5 100644 --- a/tests/ui/traits/span-bug-issue-121414.stderr +++ b/tests/ui/traits/span-bug-issue-121414.stderr @@ -6,15 +6,22 @@ LL | impl<'a> Bar for Foo<'f> { | | | help: consider introducing lifetime `'f` here: `'f,` -error: implementation of `Bar` is not general enough +error[E0277]: the trait bound `for<'a> Foo<'a>: Bar` is not satisfied + --> $DIR/span-bug-issue-121414.rs:9:1 + | +LL | / fn test() +LL | | +LL | | where +LL | | for<'a> <Foo<'a> as Bar>::Type: Sized, + | |__________________________________________^ the trait `for<'a> Bar` is not implemented for `Foo<'a>` + +error[E0277]: the trait bound `for<'a> Foo<'a>: Bar` is not satisfied --> $DIR/span-bug-issue-121414.rs:9:4 | LL | fn test() - | ^^^^ implementation of `Bar` is not general enough - | - = note: `Bar` would have to be implemented for the type `Foo<'0>`, for any lifetime `'0`... - = note: ...but `Bar` is actually implemented for the type `Foo<'1>`, for some specific lifetime `'1` + | ^^^^ the trait `for<'a> Bar` is not implemented for `Foo<'a>` -error: aborting due to 2 previous errors +error: aborting due to 3 previous errors -For more information about this error, try `rustc --explain E0261`. +Some errors have detailed explanations: E0261, E0277. +For more information about an error, try `rustc --explain E0261`. diff --git a/tests/ui/traits/suggest-fully-qualified-closure.rs b/tests/ui/traits/suggest-fully-qualified-closure.rs index f401a3012da..3d28a4e6bf5 100644 --- a/tests/ui/traits/suggest-fully-qualified-closure.rs +++ b/tests/ui/traits/suggest-fully-qualified-closure.rs @@ -1,7 +1,5 @@ //@ check-fail //@ known-bug: #103705 -//@ normalize-stderr-test "\{closure@.*\}" -> "{closure@}" -//@ normalize-stderr-test "\+* ~" -> "+++ ~" // The output of this currently suggests writing a closure in the qualified path. diff --git a/tests/ui/traits/suggest-fully-qualified-closure.stderr b/tests/ui/traits/suggest-fully-qualified-closure.stderr index e077bd7ac2a..a2c1115e673 100644 --- a/tests/ui/traits/suggest-fully-qualified-closure.stderr +++ b/tests/ui/traits/suggest-fully-qualified-closure.stderr @@ -1,11 +1,11 @@ error[E0283]: type annotations needed - --> $DIR/suggest-fully-qualified-closure.rs:23:7 + --> $DIR/suggest-fully-qualified-closure.rs:21:7 | LL | q.lol(||()); | ^^^ | note: multiple `impl`s satisfying `Qqq: MyTrait<_>` found - --> $DIR/suggest-fully-qualified-closure.rs:14:1 + --> $DIR/suggest-fully-qualified-closure.rs:12:1 | LL | impl MyTrait<u32> for Qqq{ | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -14,8 +14,8 @@ LL | impl MyTrait<u64> for Qqq{ | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using a fully qualified path to specify the expected types | -LL | <Qqq as MyTrait<T>>::lol::<{closure@}>(&q, ||()); - | +++ ~ +LL | <Qqq as MyTrait<T>>::lol::<_>(&q, ||()); + | +++++++++++++++++++++++++++++++ ~ error: aborting due to 1 previous error diff --git a/tests/ui/transmutability/alignment/align-fail.stderr b/tests/ui/transmutability/alignment/align-fail.stderr index c92c3d841f2..f05e55fb024 100644 --- a/tests/ui/transmutability/alignment/align-fail.stderr +++ b/tests/ui/transmutability/alignment/align-fail.stderr @@ -2,7 +2,7 @@ error[E0277]: `&[u8; 0]` cannot be safely transmuted into `&[u16; 0]` --> $DIR/align-fail.rs:21:55 | LL | ...tatic [u8; 0], &'static [u16; 0]>(); - | ^^^^^^^^^^^^^^^^^ The minimum alignment of `&[u8; 0]` (1) should be greater than that of `&[u16; 0]` (2) + | ^^^^^^^^^^^^^^^^^ the minimum alignment of `&[u8; 0]` (1) should be greater than that of `&[u16; 0]` (2) | note: required by a bound in `is_maybe_transmutable` --> $DIR/align-fail.rs:9:14 diff --git a/tests/ui/transmutability/arrays/should_require_well_defined_layout.stderr b/tests/ui/transmutability/arrays/should_require_well_defined_layout.stderr index fd21ac34183..e486928a445 100644 --- a/tests/ui/transmutability/arrays/should_require_well_defined_layout.stderr +++ b/tests/ui/transmutability/arrays/should_require_well_defined_layout.stderr @@ -2,7 +2,7 @@ error[E0277]: `[String; 0]` cannot be safely transmuted into `()` --> $DIR/should_require_well_defined_layout.rs:25:52 | LL | assert::is_maybe_transmutable::<repr_rust, ()>(); - | ^^ `[String; 0]` does not have a well-specified layout + | ^^ analyzing the transmutability of `[String; 0]` is not yet supported. | note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:12:14 @@ -23,7 +23,7 @@ error[E0277]: `u128` cannot be safely transmuted into `[String; 0]` --> $DIR/should_require_well_defined_layout.rs:26:47 | LL | assert::is_maybe_transmutable::<u128, repr_rust>(); - | ^^^^^^^^^ `[String; 0]` does not have a well-specified layout + | ^^^^^^^^^ analyzing the transmutability of `[String; 0]` is not yet supported. | note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:12:14 @@ -44,7 +44,7 @@ error[E0277]: `[String; 1]` cannot be safely transmuted into `()` --> $DIR/should_require_well_defined_layout.rs:31:52 | LL | assert::is_maybe_transmutable::<repr_rust, ()>(); - | ^^ `[String; 1]` does not have a well-specified layout + | ^^ analyzing the transmutability of `[String; 1]` is not yet supported. | note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:12:14 @@ -65,7 +65,7 @@ error[E0277]: `u128` cannot be safely transmuted into `[String; 1]` --> $DIR/should_require_well_defined_layout.rs:32:47 | LL | assert::is_maybe_transmutable::<u128, repr_rust>(); - | ^^^^^^^^^ `[String; 1]` does not have a well-specified layout + | ^^^^^^^^^ analyzing the transmutability of `[String; 1]` is not yet supported. | note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:12:14 @@ -86,7 +86,7 @@ error[E0277]: `[String; 2]` cannot be safely transmuted into `()` --> $DIR/should_require_well_defined_layout.rs:37:52 | LL | assert::is_maybe_transmutable::<repr_rust, ()>(); - | ^^ `[String; 2]` does not have a well-specified layout + | ^^ analyzing the transmutability of `[String; 2]` is not yet supported. | note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:12:14 @@ -107,7 +107,7 @@ error[E0277]: `u128` cannot be safely transmuted into `[String; 2]` --> $DIR/should_require_well_defined_layout.rs:38:47 | LL | assert::is_maybe_transmutable::<u128, repr_rust>(); - | ^^^^^^^^^ `[String; 2]` does not have a well-specified layout + | ^^^^^^^^^ analyzing the transmutability of `[String; 2]` is not yet supported. | note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:12:14 diff --git a/tests/ui/transmutability/enums/repr/primitive_reprs_should_have_correct_length.stderr b/tests/ui/transmutability/enums/repr/primitive_reprs_should_have_correct_length.stderr index b2ff04eeed9..6c88bf4ff96 100644 --- a/tests/ui/transmutability/enums/repr/primitive_reprs_should_have_correct_length.stderr +++ b/tests/ui/transmutability/enums/repr/primitive_reprs_should_have_correct_length.stderr @@ -2,7 +2,7 @@ error[E0277]: `Zst` cannot be safely transmuted into `V0i8` --> $DIR/primitive_reprs_should_have_correct_length.rs:46:44 | LL | assert::is_transmutable::<Smaller, Current>(); - | ^^^^^^^ The size of `Zst` is smaller than the size of `V0i8` + | ^^^^^^^ the size of `Zst` is smaller than the size of `V0i8` | note: required by a bound in `is_transmutable` --> $DIR/primitive_reprs_should_have_correct_length.rs:12:14 @@ -24,7 +24,7 @@ error[E0277]: `V0i8` cannot be safely transmuted into `u16` --> $DIR/primitive_reprs_should_have_correct_length.rs:48:44 | LL | assert::is_transmutable::<Current, Larger>(); - | ^^^^^^ The size of `V0i8` is smaller than the size of `u16` + | ^^^^^^ the size of `V0i8` is smaller than the size of `u16` | note: required by a bound in `is_transmutable` --> $DIR/primitive_reprs_should_have_correct_length.rs:12:14 @@ -46,7 +46,7 @@ error[E0277]: `Zst` cannot be safely transmuted into `V0u8` --> $DIR/primitive_reprs_should_have_correct_length.rs:54:44 | LL | assert::is_transmutable::<Smaller, Current>(); - | ^^^^^^^ The size of `Zst` is smaller than the size of `V0u8` + | ^^^^^^^ the size of `Zst` is smaller than the size of `V0u8` | note: required by a bound in `is_transmutable` --> $DIR/primitive_reprs_should_have_correct_length.rs:12:14 @@ -68,7 +68,7 @@ error[E0277]: `V0u8` cannot be safely transmuted into `u16` --> $DIR/primitive_reprs_should_have_correct_length.rs:56:44 | LL | assert::is_transmutable::<Current, Larger>(); - | ^^^^^^ The size of `V0u8` is smaller than the size of `u16` + | ^^^^^^ the size of `V0u8` is smaller than the size of `u16` | note: required by a bound in `is_transmutable` --> $DIR/primitive_reprs_should_have_correct_length.rs:12:14 @@ -90,7 +90,7 @@ error[E0277]: `u8` cannot be safely transmuted into `V0i16` --> $DIR/primitive_reprs_should_have_correct_length.rs:68:44 | LL | assert::is_transmutable::<Smaller, Current>(); - | ^^^^^^^ The size of `u8` is smaller than the size of `V0i16` + | ^^^^^^^ the size of `u8` is smaller than the size of `V0i16` | note: required by a bound in `is_transmutable` --> $DIR/primitive_reprs_should_have_correct_length.rs:12:14 @@ -112,7 +112,7 @@ error[E0277]: `V0i16` cannot be safely transmuted into `u32` --> $DIR/primitive_reprs_should_have_correct_length.rs:70:44 | LL | assert::is_transmutable::<Current, Larger>(); - | ^^^^^^ The size of `V0i16` is smaller than the size of `u32` + | ^^^^^^ the size of `V0i16` is smaller than the size of `u32` | note: required by a bound in `is_transmutable` --> $DIR/primitive_reprs_should_have_correct_length.rs:12:14 @@ -134,7 +134,7 @@ error[E0277]: `u8` cannot be safely transmuted into `V0u16` --> $DIR/primitive_reprs_should_have_correct_length.rs:76:44 | LL | assert::is_transmutable::<Smaller, Current>(); - | ^^^^^^^ The size of `u8` is smaller than the size of `V0u16` + | ^^^^^^^ the size of `u8` is smaller than the size of `V0u16` | note: required by a bound in `is_transmutable` --> $DIR/primitive_reprs_should_have_correct_length.rs:12:14 @@ -156,7 +156,7 @@ error[E0277]: `V0u16` cannot be safely transmuted into `u32` --> $DIR/primitive_reprs_should_have_correct_length.rs:78:44 | LL | assert::is_transmutable::<Current, Larger>(); - | ^^^^^^ The size of `V0u16` is smaller than the size of `u32` + | ^^^^^^ the size of `V0u16` is smaller than the size of `u32` | note: required by a bound in `is_transmutable` --> $DIR/primitive_reprs_should_have_correct_length.rs:12:14 @@ -178,7 +178,7 @@ error[E0277]: `u16` cannot be safely transmuted into `V0i32` --> $DIR/primitive_reprs_should_have_correct_length.rs:90:44 | LL | assert::is_transmutable::<Smaller, Current>(); - | ^^^^^^^ The size of `u16` is smaller than the size of `V0i32` + | ^^^^^^^ the size of `u16` is smaller than the size of `V0i32` | note: required by a bound in `is_transmutable` --> $DIR/primitive_reprs_should_have_correct_length.rs:12:14 @@ -200,7 +200,7 @@ error[E0277]: `V0i32` cannot be safely transmuted into `u64` --> $DIR/primitive_reprs_should_have_correct_length.rs:92:44 | LL | assert::is_transmutable::<Current, Larger>(); - | ^^^^^^ The size of `V0i32` is smaller than the size of `u64` + | ^^^^^^ the size of `V0i32` is smaller than the size of `u64` | note: required by a bound in `is_transmutable` --> $DIR/primitive_reprs_should_have_correct_length.rs:12:14 @@ -222,7 +222,7 @@ error[E0277]: `u16` cannot be safely transmuted into `V0u32` --> $DIR/primitive_reprs_should_have_correct_length.rs:98:44 | LL | assert::is_transmutable::<Smaller, Current>(); - | ^^^^^^^ The size of `u16` is smaller than the size of `V0u32` + | ^^^^^^^ the size of `u16` is smaller than the size of `V0u32` | note: required by a bound in `is_transmutable` --> $DIR/primitive_reprs_should_have_correct_length.rs:12:14 @@ -244,7 +244,7 @@ error[E0277]: `V0u32` cannot be safely transmuted into `u64` --> $DIR/primitive_reprs_should_have_correct_length.rs:100:44 | LL | assert::is_transmutable::<Current, Larger>(); - | ^^^^^^ The size of `V0u32` is smaller than the size of `u64` + | ^^^^^^ the size of `V0u32` is smaller than the size of `u64` | note: required by a bound in `is_transmutable` --> $DIR/primitive_reprs_should_have_correct_length.rs:12:14 @@ -266,7 +266,7 @@ error[E0277]: `u32` cannot be safely transmuted into `V0i64` --> $DIR/primitive_reprs_should_have_correct_length.rs:112:44 | LL | assert::is_transmutable::<Smaller, Current>(); - | ^^^^^^^ The size of `u32` is smaller than the size of `V0i64` + | ^^^^^^^ the size of `u32` is smaller than the size of `V0i64` | note: required by a bound in `is_transmutable` --> $DIR/primitive_reprs_should_have_correct_length.rs:12:14 @@ -288,7 +288,7 @@ error[E0277]: `V0i64` cannot be safely transmuted into `u128` --> $DIR/primitive_reprs_should_have_correct_length.rs:114:44 | LL | assert::is_transmutable::<Current, Larger>(); - | ^^^^^^ The size of `V0i64` is smaller than the size of `u128` + | ^^^^^^ the size of `V0i64` is smaller than the size of `u128` | note: required by a bound in `is_transmutable` --> $DIR/primitive_reprs_should_have_correct_length.rs:12:14 @@ -310,7 +310,7 @@ error[E0277]: `u32` cannot be safely transmuted into `V0u64` --> $DIR/primitive_reprs_should_have_correct_length.rs:120:44 | LL | assert::is_transmutable::<Smaller, Current>(); - | ^^^^^^^ The size of `u32` is smaller than the size of `V0u64` + | ^^^^^^^ the size of `u32` is smaller than the size of `V0u64` | note: required by a bound in `is_transmutable` --> $DIR/primitive_reprs_should_have_correct_length.rs:12:14 @@ -332,7 +332,7 @@ error[E0277]: `V0u64` cannot be safely transmuted into `u128` --> $DIR/primitive_reprs_should_have_correct_length.rs:122:44 | LL | assert::is_transmutable::<Current, Larger>(); - | ^^^^^^ The size of `V0u64` is smaller than the size of `u128` + | ^^^^^^ the size of `V0u64` is smaller than the size of `u128` | note: required by a bound in `is_transmutable` --> $DIR/primitive_reprs_should_have_correct_length.rs:12:14 @@ -354,7 +354,7 @@ error[E0277]: `u8` cannot be safely transmuted into `V0isize` --> $DIR/primitive_reprs_should_have_correct_length.rs:134:44 | LL | assert::is_transmutable::<Smaller, Current>(); - | ^^^^^^^ The size of `u8` is smaller than the size of `V0isize` + | ^^^^^^^ the size of `u8` is smaller than the size of `V0isize` | note: required by a bound in `is_transmutable` --> $DIR/primitive_reprs_should_have_correct_length.rs:12:14 @@ -376,7 +376,7 @@ error[E0277]: `V0isize` cannot be safely transmuted into `[usize; 2]` --> $DIR/primitive_reprs_should_have_correct_length.rs:136:44 | LL | assert::is_transmutable::<Current, Larger>(); - | ^^^^^^ The size of `V0isize` is smaller than the size of `[usize; 2]` + | ^^^^^^ the size of `V0isize` is smaller than the size of `[usize; 2]` | note: required by a bound in `is_transmutable` --> $DIR/primitive_reprs_should_have_correct_length.rs:12:14 @@ -398,7 +398,7 @@ error[E0277]: `u8` cannot be safely transmuted into `V0usize` --> $DIR/primitive_reprs_should_have_correct_length.rs:142:44 | LL | assert::is_transmutable::<Smaller, Current>(); - | ^^^^^^^ The size of `u8` is smaller than the size of `V0usize` + | ^^^^^^^ the size of `u8` is smaller than the size of `V0usize` | note: required by a bound in `is_transmutable` --> $DIR/primitive_reprs_should_have_correct_length.rs:12:14 @@ -420,7 +420,7 @@ error[E0277]: `V0usize` cannot be safely transmuted into `[usize; 2]` --> $DIR/primitive_reprs_should_have_correct_length.rs:144:44 | LL | assert::is_transmutable::<Current, Larger>(); - | ^^^^^^ The size of `V0usize` is smaller than the size of `[usize; 2]` + | ^^^^^^ the size of `V0usize` is smaller than the size of `[usize; 2]` | note: required by a bound in `is_transmutable` --> $DIR/primitive_reprs_should_have_correct_length.rs:12:14 diff --git a/tests/ui/transmutability/enums/repr/should_require_well_defined_layout.stderr b/tests/ui/transmutability/enums/repr/should_require_well_defined_layout.stderr index 24730935047..2a683de6a65 100644 --- a/tests/ui/transmutability/enums/repr/should_require_well_defined_layout.stderr +++ b/tests/ui/transmutability/enums/repr/should_require_well_defined_layout.stderr @@ -2,7 +2,7 @@ error[E0277]: `void::repr_rust` cannot be safely transmuted into `()` --> $DIR/should_require_well_defined_layout.rs:27:52 | LL | assert::is_maybe_transmutable::<repr_rust, ()>(); - | ^^ `void::repr_rust` does not have a well-specified layout + | ^^ analyzing the transmutability of `void::repr_rust` is not yet supported. | note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:13:14 @@ -24,7 +24,7 @@ error[E0277]: `u128` cannot be safely transmuted into `void::repr_rust` --> $DIR/should_require_well_defined_layout.rs:28:47 | LL | assert::is_maybe_transmutable::<u128, repr_rust>(); - | ^^^^^^^^^ `void::repr_rust` does not have a well-specified layout + | ^^^^^^^^^ analyzing the transmutability of `void::repr_rust` is not yet supported. | note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:13:14 @@ -46,7 +46,7 @@ error[E0277]: `singleton::repr_rust` cannot be safely transmuted into `()` --> $DIR/should_require_well_defined_layout.rs:33:52 | LL | assert::is_maybe_transmutable::<repr_rust, ()>(); - | ^^ `singleton::repr_rust` does not have a well-specified layout + | ^^ analyzing the transmutability of `singleton::repr_rust` is not yet supported. | note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:13:14 @@ -68,7 +68,7 @@ error[E0277]: `u128` cannot be safely transmuted into `singleton::repr_rust` --> $DIR/should_require_well_defined_layout.rs:34:47 | LL | assert::is_maybe_transmutable::<u128, repr_rust>(); - | ^^^^^^^^^ `singleton::repr_rust` does not have a well-specified layout + | ^^^^^^^^^ analyzing the transmutability of `singleton::repr_rust` is not yet supported. | note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:13:14 @@ -90,7 +90,7 @@ error[E0277]: `duplex::repr_rust` cannot be safely transmuted into `()` --> $DIR/should_require_well_defined_layout.rs:39:52 | LL | assert::is_maybe_transmutable::<repr_rust, ()>(); - | ^^ `duplex::repr_rust` does not have a well-specified layout + | ^^ analyzing the transmutability of `duplex::repr_rust` is not yet supported. | note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:13:14 @@ -112,7 +112,7 @@ error[E0277]: `u128` cannot be safely transmuted into `duplex::repr_rust` --> $DIR/should_require_well_defined_layout.rs:40:47 | LL | assert::is_maybe_transmutable::<u128, repr_rust>(); - | ^^^^^^^^^ `duplex::repr_rust` does not have a well-specified layout + | ^^^^^^^^^ analyzing the transmutability of `duplex::repr_rust` is not yet supported. | note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:13:14 diff --git a/tests/ui/transmutability/enums/should_pad_variants.stderr b/tests/ui/transmutability/enums/should_pad_variants.stderr index 13b4c8053ad..da4294bdbce 100644 --- a/tests/ui/transmutability/enums/should_pad_variants.stderr +++ b/tests/ui/transmutability/enums/should_pad_variants.stderr @@ -2,7 +2,7 @@ error[E0277]: `Src` cannot be safely transmuted into `Dst` --> $DIR/should_pad_variants.rs:43:36 | LL | assert::is_transmutable::<Src, Dst>(); - | ^^^ The size of `Src` is smaller than the size of `Dst` + | ^^^ the size of `Src` is smaller than the size of `Dst` | note: required by a bound in `is_transmutable` --> $DIR/should_pad_variants.rs:13:14 diff --git a/tests/ui/transmutability/enums/should_respect_endianness.stderr b/tests/ui/transmutability/enums/should_respect_endianness.stderr index c2a2eb53458..9f88bb06813 100644 --- a/tests/ui/transmutability/enums/should_respect_endianness.stderr +++ b/tests/ui/transmutability/enums/should_respect_endianness.stderr @@ -2,7 +2,7 @@ error[E0277]: `Src` cannot be safely transmuted into `Unexpected` --> $DIR/should_respect_endianness.rs:35:36 | LL | assert::is_transmutable::<Src, Unexpected>(); - | ^^^^^^^^^^ At least one value of `Src` isn't a bit-valid value of `Unexpected` + | ^^^^^^^^^^ at least one value of `Src` isn't a bit-valid value of `Unexpected` | note: required by a bound in `is_transmutable` --> $DIR/should_respect_endianness.rs:13:14 diff --git a/tests/ui/transmutability/primitives/bool-mut.stderr b/tests/ui/transmutability/primitives/bool-mut.stderr index c4f295fc70a..464c2755e11 100644 --- a/tests/ui/transmutability/primitives/bool-mut.stderr +++ b/tests/ui/transmutability/primitives/bool-mut.stderr @@ -2,7 +2,7 @@ error[E0277]: `u8` cannot be safely transmuted into `bool` --> $DIR/bool-mut.rs:15:50 | LL | assert::is_transmutable::<&'static mut bool, &'static mut u8>() - | ^^^^^^^^^^^^^^^ At least one value of `u8` isn't a bit-valid value of `bool` + | ^^^^^^^^^^^^^^^ at least one value of `u8` isn't a bit-valid value of `bool` | note: required by a bound in `is_transmutable` --> $DIR/bool-mut.rs:10:14 diff --git a/tests/ui/transmutability/primitives/bool.current.stderr b/tests/ui/transmutability/primitives/bool.current.stderr index 98e4a1029c9..da6a4a44e95 100644 --- a/tests/ui/transmutability/primitives/bool.current.stderr +++ b/tests/ui/transmutability/primitives/bool.current.stderr @@ -2,7 +2,7 @@ error[E0277]: `u8` cannot be safely transmuted into `bool` --> $DIR/bool.rs:21:35 | LL | assert::is_transmutable::<u8, bool>(); - | ^^^^ At least one value of `u8` isn't a bit-valid value of `bool` + | ^^^^ at least one value of `u8` isn't a bit-valid value of `bool` | note: required by a bound in `is_transmutable` --> $DIR/bool.rs:11:14 diff --git a/tests/ui/transmutability/primitives/bool.next.stderr b/tests/ui/transmutability/primitives/bool.next.stderr index 98e4a1029c9..da6a4a44e95 100644 --- a/tests/ui/transmutability/primitives/bool.next.stderr +++ b/tests/ui/transmutability/primitives/bool.next.stderr @@ -2,7 +2,7 @@ error[E0277]: `u8` cannot be safely transmuted into `bool` --> $DIR/bool.rs:21:35 | LL | assert::is_transmutable::<u8, bool>(); - | ^^^^ At least one value of `u8` isn't a bit-valid value of `bool` + | ^^^^ at least one value of `u8` isn't a bit-valid value of `bool` | note: required by a bound in `is_transmutable` --> $DIR/bool.rs:11:14 diff --git a/tests/ui/transmutability/primitives/numbers.current.stderr b/tests/ui/transmutability/primitives/numbers.current.stderr index 7a80e444149..0a9b9d182f8 100644 --- a/tests/ui/transmutability/primitives/numbers.current.stderr +++ b/tests/ui/transmutability/primitives/numbers.current.stderr @@ -2,7 +2,7 @@ error[E0277]: `i8` cannot be safely transmuted into `i16` --> $DIR/numbers.rs:64:40 | LL | assert::is_transmutable::< i8, i16>(); - | ^^^ The size of `i8` is smaller than the size of `i16` + | ^^^ the size of `i8` is smaller than the size of `i16` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -17,7 +17,7 @@ error[E0277]: `i8` cannot be safely transmuted into `u16` --> $DIR/numbers.rs:65:40 | LL | assert::is_transmutable::< i8, u16>(); - | ^^^ The size of `i8` is smaller than the size of `u16` + | ^^^ the size of `i8` is smaller than the size of `u16` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -32,7 +32,7 @@ error[E0277]: `i8` cannot be safely transmuted into `i32` --> $DIR/numbers.rs:66:40 | LL | assert::is_transmutable::< i8, i32>(); - | ^^^ The size of `i8` is smaller than the size of `i32` + | ^^^ the size of `i8` is smaller than the size of `i32` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -47,7 +47,7 @@ error[E0277]: `i8` cannot be safely transmuted into `f32` --> $DIR/numbers.rs:67:40 | LL | assert::is_transmutable::< i8, f32>(); - | ^^^ The size of `i8` is smaller than the size of `f32` + | ^^^ the size of `i8` is smaller than the size of `f32` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -62,7 +62,7 @@ error[E0277]: `i8` cannot be safely transmuted into `u32` --> $DIR/numbers.rs:68:40 | LL | assert::is_transmutable::< i8, u32>(); - | ^^^ The size of `i8` is smaller than the size of `u32` + | ^^^ the size of `i8` is smaller than the size of `u32` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -77,7 +77,7 @@ error[E0277]: `i8` cannot be safely transmuted into `u64` --> $DIR/numbers.rs:69:40 | LL | assert::is_transmutable::< i8, u64>(); - | ^^^ The size of `i8` is smaller than the size of `u64` + | ^^^ the size of `i8` is smaller than the size of `u64` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -92,7 +92,7 @@ error[E0277]: `i8` cannot be safely transmuted into `i64` --> $DIR/numbers.rs:70:40 | LL | assert::is_transmutable::< i8, i64>(); - | ^^^ The size of `i8` is smaller than the size of `i64` + | ^^^ the size of `i8` is smaller than the size of `i64` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -107,7 +107,7 @@ error[E0277]: `i8` cannot be safely transmuted into `f64` --> $DIR/numbers.rs:71:40 | LL | assert::is_transmutable::< i8, f64>(); - | ^^^ The size of `i8` is smaller than the size of `f64` + | ^^^ the size of `i8` is smaller than the size of `f64` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -122,7 +122,7 @@ error[E0277]: `i8` cannot be safely transmuted into `u128` --> $DIR/numbers.rs:72:39 | LL | assert::is_transmutable::< i8, u128>(); - | ^^^^ The size of `i8` is smaller than the size of `u128` + | ^^^^ the size of `i8` is smaller than the size of `u128` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -137,7 +137,7 @@ error[E0277]: `i8` cannot be safely transmuted into `i128` --> $DIR/numbers.rs:73:39 | LL | assert::is_transmutable::< i8, i128>(); - | ^^^^ The size of `i8` is smaller than the size of `i128` + | ^^^^ the size of `i8` is smaller than the size of `i128` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -152,7 +152,7 @@ error[E0277]: `u8` cannot be safely transmuted into `i16` --> $DIR/numbers.rs:75:40 | LL | assert::is_transmutable::< u8, i16>(); - | ^^^ The size of `u8` is smaller than the size of `i16` + | ^^^ the size of `u8` is smaller than the size of `i16` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -167,7 +167,7 @@ error[E0277]: `u8` cannot be safely transmuted into `u16` --> $DIR/numbers.rs:76:40 | LL | assert::is_transmutable::< u8, u16>(); - | ^^^ The size of `u8` is smaller than the size of `u16` + | ^^^ the size of `u8` is smaller than the size of `u16` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -182,7 +182,7 @@ error[E0277]: `u8` cannot be safely transmuted into `i32` --> $DIR/numbers.rs:77:40 | LL | assert::is_transmutable::< u8, i32>(); - | ^^^ The size of `u8` is smaller than the size of `i32` + | ^^^ the size of `u8` is smaller than the size of `i32` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -197,7 +197,7 @@ error[E0277]: `u8` cannot be safely transmuted into `f32` --> $DIR/numbers.rs:78:40 | LL | assert::is_transmutable::< u8, f32>(); - | ^^^ The size of `u8` is smaller than the size of `f32` + | ^^^ the size of `u8` is smaller than the size of `f32` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -212,7 +212,7 @@ error[E0277]: `u8` cannot be safely transmuted into `u32` --> $DIR/numbers.rs:79:40 | LL | assert::is_transmutable::< u8, u32>(); - | ^^^ The size of `u8` is smaller than the size of `u32` + | ^^^ the size of `u8` is smaller than the size of `u32` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -227,7 +227,7 @@ error[E0277]: `u8` cannot be safely transmuted into `u64` --> $DIR/numbers.rs:80:40 | LL | assert::is_transmutable::< u8, u64>(); - | ^^^ The size of `u8` is smaller than the size of `u64` + | ^^^ the size of `u8` is smaller than the size of `u64` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -242,7 +242,7 @@ error[E0277]: `u8` cannot be safely transmuted into `i64` --> $DIR/numbers.rs:81:40 | LL | assert::is_transmutable::< u8, i64>(); - | ^^^ The size of `u8` is smaller than the size of `i64` + | ^^^ the size of `u8` is smaller than the size of `i64` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -257,7 +257,7 @@ error[E0277]: `u8` cannot be safely transmuted into `f64` --> $DIR/numbers.rs:82:40 | LL | assert::is_transmutable::< u8, f64>(); - | ^^^ The size of `u8` is smaller than the size of `f64` + | ^^^ the size of `u8` is smaller than the size of `f64` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -272,7 +272,7 @@ error[E0277]: `u8` cannot be safely transmuted into `u128` --> $DIR/numbers.rs:83:39 | LL | assert::is_transmutable::< u8, u128>(); - | ^^^^ The size of `u8` is smaller than the size of `u128` + | ^^^^ the size of `u8` is smaller than the size of `u128` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -287,7 +287,7 @@ error[E0277]: `u8` cannot be safely transmuted into `i128` --> $DIR/numbers.rs:84:39 | LL | assert::is_transmutable::< u8, i128>(); - | ^^^^ The size of `u8` is smaller than the size of `i128` + | ^^^^ the size of `u8` is smaller than the size of `i128` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -302,7 +302,7 @@ error[E0277]: `i16` cannot be safely transmuted into `i32` --> $DIR/numbers.rs:86:40 | LL | assert::is_transmutable::< i16, i32>(); - | ^^^ The size of `i16` is smaller than the size of `i32` + | ^^^ the size of `i16` is smaller than the size of `i32` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -317,7 +317,7 @@ error[E0277]: `i16` cannot be safely transmuted into `f32` --> $DIR/numbers.rs:87:40 | LL | assert::is_transmutable::< i16, f32>(); - | ^^^ The size of `i16` is smaller than the size of `f32` + | ^^^ the size of `i16` is smaller than the size of `f32` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -332,7 +332,7 @@ error[E0277]: `i16` cannot be safely transmuted into `u32` --> $DIR/numbers.rs:88:40 | LL | assert::is_transmutable::< i16, u32>(); - | ^^^ The size of `i16` is smaller than the size of `u32` + | ^^^ the size of `i16` is smaller than the size of `u32` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -347,7 +347,7 @@ error[E0277]: `i16` cannot be safely transmuted into `u64` --> $DIR/numbers.rs:89:40 | LL | assert::is_transmutable::< i16, u64>(); - | ^^^ The size of `i16` is smaller than the size of `u64` + | ^^^ the size of `i16` is smaller than the size of `u64` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -362,7 +362,7 @@ error[E0277]: `i16` cannot be safely transmuted into `i64` --> $DIR/numbers.rs:90:40 | LL | assert::is_transmutable::< i16, i64>(); - | ^^^ The size of `i16` is smaller than the size of `i64` + | ^^^ the size of `i16` is smaller than the size of `i64` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -377,7 +377,7 @@ error[E0277]: `i16` cannot be safely transmuted into `f64` --> $DIR/numbers.rs:91:40 | LL | assert::is_transmutable::< i16, f64>(); - | ^^^ The size of `i16` is smaller than the size of `f64` + | ^^^ the size of `i16` is smaller than the size of `f64` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -392,7 +392,7 @@ error[E0277]: `i16` cannot be safely transmuted into `u128` --> $DIR/numbers.rs:92:39 | LL | assert::is_transmutable::< i16, u128>(); - | ^^^^ The size of `i16` is smaller than the size of `u128` + | ^^^^ the size of `i16` is smaller than the size of `u128` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -407,7 +407,7 @@ error[E0277]: `i16` cannot be safely transmuted into `i128` --> $DIR/numbers.rs:93:39 | LL | assert::is_transmutable::< i16, i128>(); - | ^^^^ The size of `i16` is smaller than the size of `i128` + | ^^^^ the size of `i16` is smaller than the size of `i128` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -422,7 +422,7 @@ error[E0277]: `u16` cannot be safely transmuted into `i32` --> $DIR/numbers.rs:95:40 | LL | assert::is_transmutable::< u16, i32>(); - | ^^^ The size of `u16` is smaller than the size of `i32` + | ^^^ the size of `u16` is smaller than the size of `i32` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -437,7 +437,7 @@ error[E0277]: `u16` cannot be safely transmuted into `f32` --> $DIR/numbers.rs:96:40 | LL | assert::is_transmutable::< u16, f32>(); - | ^^^ The size of `u16` is smaller than the size of `f32` + | ^^^ the size of `u16` is smaller than the size of `f32` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -452,7 +452,7 @@ error[E0277]: `u16` cannot be safely transmuted into `u32` --> $DIR/numbers.rs:97:40 | LL | assert::is_transmutable::< u16, u32>(); - | ^^^ The size of `u16` is smaller than the size of `u32` + | ^^^ the size of `u16` is smaller than the size of `u32` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -467,7 +467,7 @@ error[E0277]: `u16` cannot be safely transmuted into `u64` --> $DIR/numbers.rs:98:40 | LL | assert::is_transmutable::< u16, u64>(); - | ^^^ The size of `u16` is smaller than the size of `u64` + | ^^^ the size of `u16` is smaller than the size of `u64` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -482,7 +482,7 @@ error[E0277]: `u16` cannot be safely transmuted into `i64` --> $DIR/numbers.rs:99:40 | LL | assert::is_transmutable::< u16, i64>(); - | ^^^ The size of `u16` is smaller than the size of `i64` + | ^^^ the size of `u16` is smaller than the size of `i64` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -497,7 +497,7 @@ error[E0277]: `u16` cannot be safely transmuted into `f64` --> $DIR/numbers.rs:100:40 | LL | assert::is_transmutable::< u16, f64>(); - | ^^^ The size of `u16` is smaller than the size of `f64` + | ^^^ the size of `u16` is smaller than the size of `f64` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -512,7 +512,7 @@ error[E0277]: `u16` cannot be safely transmuted into `u128` --> $DIR/numbers.rs:101:39 | LL | assert::is_transmutable::< u16, u128>(); - | ^^^^ The size of `u16` is smaller than the size of `u128` + | ^^^^ the size of `u16` is smaller than the size of `u128` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -527,7 +527,7 @@ error[E0277]: `u16` cannot be safely transmuted into `i128` --> $DIR/numbers.rs:102:39 | LL | assert::is_transmutable::< u16, i128>(); - | ^^^^ The size of `u16` is smaller than the size of `i128` + | ^^^^ the size of `u16` is smaller than the size of `i128` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -542,7 +542,7 @@ error[E0277]: `i32` cannot be safely transmuted into `u64` --> $DIR/numbers.rs:104:40 | LL | assert::is_transmutable::< i32, u64>(); - | ^^^ The size of `i32` is smaller than the size of `u64` + | ^^^ the size of `i32` is smaller than the size of `u64` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -557,7 +557,7 @@ error[E0277]: `i32` cannot be safely transmuted into `i64` --> $DIR/numbers.rs:105:40 | LL | assert::is_transmutable::< i32, i64>(); - | ^^^ The size of `i32` is smaller than the size of `i64` + | ^^^ the size of `i32` is smaller than the size of `i64` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -572,7 +572,7 @@ error[E0277]: `i32` cannot be safely transmuted into `f64` --> $DIR/numbers.rs:106:40 | LL | assert::is_transmutable::< i32, f64>(); - | ^^^ The size of `i32` is smaller than the size of `f64` + | ^^^ the size of `i32` is smaller than the size of `f64` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -587,7 +587,7 @@ error[E0277]: `i32` cannot be safely transmuted into `u128` --> $DIR/numbers.rs:107:39 | LL | assert::is_transmutable::< i32, u128>(); - | ^^^^ The size of `i32` is smaller than the size of `u128` + | ^^^^ the size of `i32` is smaller than the size of `u128` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -602,7 +602,7 @@ error[E0277]: `i32` cannot be safely transmuted into `i128` --> $DIR/numbers.rs:108:39 | LL | assert::is_transmutable::< i32, i128>(); - | ^^^^ The size of `i32` is smaller than the size of `i128` + | ^^^^ the size of `i32` is smaller than the size of `i128` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -617,7 +617,7 @@ error[E0277]: `f32` cannot be safely transmuted into `u64` --> $DIR/numbers.rs:110:40 | LL | assert::is_transmutable::< f32, u64>(); - | ^^^ The size of `f32` is smaller than the size of `u64` + | ^^^ the size of `f32` is smaller than the size of `u64` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -632,7 +632,7 @@ error[E0277]: `f32` cannot be safely transmuted into `i64` --> $DIR/numbers.rs:111:40 | LL | assert::is_transmutable::< f32, i64>(); - | ^^^ The size of `f32` is smaller than the size of `i64` + | ^^^ the size of `f32` is smaller than the size of `i64` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -647,7 +647,7 @@ error[E0277]: `f32` cannot be safely transmuted into `f64` --> $DIR/numbers.rs:112:40 | LL | assert::is_transmutable::< f32, f64>(); - | ^^^ The size of `f32` is smaller than the size of `f64` + | ^^^ the size of `f32` is smaller than the size of `f64` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -662,7 +662,7 @@ error[E0277]: `f32` cannot be safely transmuted into `u128` --> $DIR/numbers.rs:113:39 | LL | assert::is_transmutable::< f32, u128>(); - | ^^^^ The size of `f32` is smaller than the size of `u128` + | ^^^^ the size of `f32` is smaller than the size of `u128` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -677,7 +677,7 @@ error[E0277]: `f32` cannot be safely transmuted into `i128` --> $DIR/numbers.rs:114:39 | LL | assert::is_transmutable::< f32, i128>(); - | ^^^^ The size of `f32` is smaller than the size of `i128` + | ^^^^ the size of `f32` is smaller than the size of `i128` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -692,7 +692,7 @@ error[E0277]: `u32` cannot be safely transmuted into `u64` --> $DIR/numbers.rs:116:40 | LL | assert::is_transmutable::< u32, u64>(); - | ^^^ The size of `u32` is smaller than the size of `u64` + | ^^^ the size of `u32` is smaller than the size of `u64` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -707,7 +707,7 @@ error[E0277]: `u32` cannot be safely transmuted into `i64` --> $DIR/numbers.rs:117:40 | LL | assert::is_transmutable::< u32, i64>(); - | ^^^ The size of `u32` is smaller than the size of `i64` + | ^^^ the size of `u32` is smaller than the size of `i64` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -722,7 +722,7 @@ error[E0277]: `u32` cannot be safely transmuted into `f64` --> $DIR/numbers.rs:118:40 | LL | assert::is_transmutable::< u32, f64>(); - | ^^^ The size of `u32` is smaller than the size of `f64` + | ^^^ the size of `u32` is smaller than the size of `f64` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -737,7 +737,7 @@ error[E0277]: `u32` cannot be safely transmuted into `u128` --> $DIR/numbers.rs:119:39 | LL | assert::is_transmutable::< u32, u128>(); - | ^^^^ The size of `u32` is smaller than the size of `u128` + | ^^^^ the size of `u32` is smaller than the size of `u128` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -752,7 +752,7 @@ error[E0277]: `u32` cannot be safely transmuted into `i128` --> $DIR/numbers.rs:120:39 | LL | assert::is_transmutable::< u32, i128>(); - | ^^^^ The size of `u32` is smaller than the size of `i128` + | ^^^^ the size of `u32` is smaller than the size of `i128` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -767,7 +767,7 @@ error[E0277]: `u64` cannot be safely transmuted into `u128` --> $DIR/numbers.rs:122:39 | LL | assert::is_transmutable::< u64, u128>(); - | ^^^^ The size of `u64` is smaller than the size of `u128` + | ^^^^ the size of `u64` is smaller than the size of `u128` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -782,7 +782,7 @@ error[E0277]: `u64` cannot be safely transmuted into `i128` --> $DIR/numbers.rs:123:39 | LL | assert::is_transmutable::< u64, i128>(); - | ^^^^ The size of `u64` is smaller than the size of `i128` + | ^^^^ the size of `u64` is smaller than the size of `i128` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -797,7 +797,7 @@ error[E0277]: `i64` cannot be safely transmuted into `u128` --> $DIR/numbers.rs:125:39 | LL | assert::is_transmutable::< i64, u128>(); - | ^^^^ The size of `i64` is smaller than the size of `u128` + | ^^^^ the size of `i64` is smaller than the size of `u128` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -812,7 +812,7 @@ error[E0277]: `i64` cannot be safely transmuted into `i128` --> $DIR/numbers.rs:126:39 | LL | assert::is_transmutable::< i64, i128>(); - | ^^^^ The size of `i64` is smaller than the size of `i128` + | ^^^^ the size of `i64` is smaller than the size of `i128` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -827,7 +827,7 @@ error[E0277]: `f64` cannot be safely transmuted into `u128` --> $DIR/numbers.rs:128:39 | LL | assert::is_transmutable::< f64, u128>(); - | ^^^^ The size of `f64` is smaller than the size of `u128` + | ^^^^ the size of `f64` is smaller than the size of `u128` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -842,7 +842,7 @@ error[E0277]: `f64` cannot be safely transmuted into `i128` --> $DIR/numbers.rs:129:39 | LL | assert::is_transmutable::< f64, i128>(); - | ^^^^ The size of `f64` is smaller than the size of `i128` + | ^^^^ the size of `f64` is smaller than the size of `i128` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 diff --git a/tests/ui/transmutability/primitives/numbers.next.stderr b/tests/ui/transmutability/primitives/numbers.next.stderr index 7a80e444149..0a9b9d182f8 100644 --- a/tests/ui/transmutability/primitives/numbers.next.stderr +++ b/tests/ui/transmutability/primitives/numbers.next.stderr @@ -2,7 +2,7 @@ error[E0277]: `i8` cannot be safely transmuted into `i16` --> $DIR/numbers.rs:64:40 | LL | assert::is_transmutable::< i8, i16>(); - | ^^^ The size of `i8` is smaller than the size of `i16` + | ^^^ the size of `i8` is smaller than the size of `i16` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -17,7 +17,7 @@ error[E0277]: `i8` cannot be safely transmuted into `u16` --> $DIR/numbers.rs:65:40 | LL | assert::is_transmutable::< i8, u16>(); - | ^^^ The size of `i8` is smaller than the size of `u16` + | ^^^ the size of `i8` is smaller than the size of `u16` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -32,7 +32,7 @@ error[E0277]: `i8` cannot be safely transmuted into `i32` --> $DIR/numbers.rs:66:40 | LL | assert::is_transmutable::< i8, i32>(); - | ^^^ The size of `i8` is smaller than the size of `i32` + | ^^^ the size of `i8` is smaller than the size of `i32` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -47,7 +47,7 @@ error[E0277]: `i8` cannot be safely transmuted into `f32` --> $DIR/numbers.rs:67:40 | LL | assert::is_transmutable::< i8, f32>(); - | ^^^ The size of `i8` is smaller than the size of `f32` + | ^^^ the size of `i8` is smaller than the size of `f32` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -62,7 +62,7 @@ error[E0277]: `i8` cannot be safely transmuted into `u32` --> $DIR/numbers.rs:68:40 | LL | assert::is_transmutable::< i8, u32>(); - | ^^^ The size of `i8` is smaller than the size of `u32` + | ^^^ the size of `i8` is smaller than the size of `u32` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -77,7 +77,7 @@ error[E0277]: `i8` cannot be safely transmuted into `u64` --> $DIR/numbers.rs:69:40 | LL | assert::is_transmutable::< i8, u64>(); - | ^^^ The size of `i8` is smaller than the size of `u64` + | ^^^ the size of `i8` is smaller than the size of `u64` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -92,7 +92,7 @@ error[E0277]: `i8` cannot be safely transmuted into `i64` --> $DIR/numbers.rs:70:40 | LL | assert::is_transmutable::< i8, i64>(); - | ^^^ The size of `i8` is smaller than the size of `i64` + | ^^^ the size of `i8` is smaller than the size of `i64` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -107,7 +107,7 @@ error[E0277]: `i8` cannot be safely transmuted into `f64` --> $DIR/numbers.rs:71:40 | LL | assert::is_transmutable::< i8, f64>(); - | ^^^ The size of `i8` is smaller than the size of `f64` + | ^^^ the size of `i8` is smaller than the size of `f64` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -122,7 +122,7 @@ error[E0277]: `i8` cannot be safely transmuted into `u128` --> $DIR/numbers.rs:72:39 | LL | assert::is_transmutable::< i8, u128>(); - | ^^^^ The size of `i8` is smaller than the size of `u128` + | ^^^^ the size of `i8` is smaller than the size of `u128` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -137,7 +137,7 @@ error[E0277]: `i8` cannot be safely transmuted into `i128` --> $DIR/numbers.rs:73:39 | LL | assert::is_transmutable::< i8, i128>(); - | ^^^^ The size of `i8` is smaller than the size of `i128` + | ^^^^ the size of `i8` is smaller than the size of `i128` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -152,7 +152,7 @@ error[E0277]: `u8` cannot be safely transmuted into `i16` --> $DIR/numbers.rs:75:40 | LL | assert::is_transmutable::< u8, i16>(); - | ^^^ The size of `u8` is smaller than the size of `i16` + | ^^^ the size of `u8` is smaller than the size of `i16` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -167,7 +167,7 @@ error[E0277]: `u8` cannot be safely transmuted into `u16` --> $DIR/numbers.rs:76:40 | LL | assert::is_transmutable::< u8, u16>(); - | ^^^ The size of `u8` is smaller than the size of `u16` + | ^^^ the size of `u8` is smaller than the size of `u16` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -182,7 +182,7 @@ error[E0277]: `u8` cannot be safely transmuted into `i32` --> $DIR/numbers.rs:77:40 | LL | assert::is_transmutable::< u8, i32>(); - | ^^^ The size of `u8` is smaller than the size of `i32` + | ^^^ the size of `u8` is smaller than the size of `i32` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -197,7 +197,7 @@ error[E0277]: `u8` cannot be safely transmuted into `f32` --> $DIR/numbers.rs:78:40 | LL | assert::is_transmutable::< u8, f32>(); - | ^^^ The size of `u8` is smaller than the size of `f32` + | ^^^ the size of `u8` is smaller than the size of `f32` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -212,7 +212,7 @@ error[E0277]: `u8` cannot be safely transmuted into `u32` --> $DIR/numbers.rs:79:40 | LL | assert::is_transmutable::< u8, u32>(); - | ^^^ The size of `u8` is smaller than the size of `u32` + | ^^^ the size of `u8` is smaller than the size of `u32` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -227,7 +227,7 @@ error[E0277]: `u8` cannot be safely transmuted into `u64` --> $DIR/numbers.rs:80:40 | LL | assert::is_transmutable::< u8, u64>(); - | ^^^ The size of `u8` is smaller than the size of `u64` + | ^^^ the size of `u8` is smaller than the size of `u64` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -242,7 +242,7 @@ error[E0277]: `u8` cannot be safely transmuted into `i64` --> $DIR/numbers.rs:81:40 | LL | assert::is_transmutable::< u8, i64>(); - | ^^^ The size of `u8` is smaller than the size of `i64` + | ^^^ the size of `u8` is smaller than the size of `i64` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -257,7 +257,7 @@ error[E0277]: `u8` cannot be safely transmuted into `f64` --> $DIR/numbers.rs:82:40 | LL | assert::is_transmutable::< u8, f64>(); - | ^^^ The size of `u8` is smaller than the size of `f64` + | ^^^ the size of `u8` is smaller than the size of `f64` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -272,7 +272,7 @@ error[E0277]: `u8` cannot be safely transmuted into `u128` --> $DIR/numbers.rs:83:39 | LL | assert::is_transmutable::< u8, u128>(); - | ^^^^ The size of `u8` is smaller than the size of `u128` + | ^^^^ the size of `u8` is smaller than the size of `u128` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -287,7 +287,7 @@ error[E0277]: `u8` cannot be safely transmuted into `i128` --> $DIR/numbers.rs:84:39 | LL | assert::is_transmutable::< u8, i128>(); - | ^^^^ The size of `u8` is smaller than the size of `i128` + | ^^^^ the size of `u8` is smaller than the size of `i128` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -302,7 +302,7 @@ error[E0277]: `i16` cannot be safely transmuted into `i32` --> $DIR/numbers.rs:86:40 | LL | assert::is_transmutable::< i16, i32>(); - | ^^^ The size of `i16` is smaller than the size of `i32` + | ^^^ the size of `i16` is smaller than the size of `i32` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -317,7 +317,7 @@ error[E0277]: `i16` cannot be safely transmuted into `f32` --> $DIR/numbers.rs:87:40 | LL | assert::is_transmutable::< i16, f32>(); - | ^^^ The size of `i16` is smaller than the size of `f32` + | ^^^ the size of `i16` is smaller than the size of `f32` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -332,7 +332,7 @@ error[E0277]: `i16` cannot be safely transmuted into `u32` --> $DIR/numbers.rs:88:40 | LL | assert::is_transmutable::< i16, u32>(); - | ^^^ The size of `i16` is smaller than the size of `u32` + | ^^^ the size of `i16` is smaller than the size of `u32` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -347,7 +347,7 @@ error[E0277]: `i16` cannot be safely transmuted into `u64` --> $DIR/numbers.rs:89:40 | LL | assert::is_transmutable::< i16, u64>(); - | ^^^ The size of `i16` is smaller than the size of `u64` + | ^^^ the size of `i16` is smaller than the size of `u64` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -362,7 +362,7 @@ error[E0277]: `i16` cannot be safely transmuted into `i64` --> $DIR/numbers.rs:90:40 | LL | assert::is_transmutable::< i16, i64>(); - | ^^^ The size of `i16` is smaller than the size of `i64` + | ^^^ the size of `i16` is smaller than the size of `i64` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -377,7 +377,7 @@ error[E0277]: `i16` cannot be safely transmuted into `f64` --> $DIR/numbers.rs:91:40 | LL | assert::is_transmutable::< i16, f64>(); - | ^^^ The size of `i16` is smaller than the size of `f64` + | ^^^ the size of `i16` is smaller than the size of `f64` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -392,7 +392,7 @@ error[E0277]: `i16` cannot be safely transmuted into `u128` --> $DIR/numbers.rs:92:39 | LL | assert::is_transmutable::< i16, u128>(); - | ^^^^ The size of `i16` is smaller than the size of `u128` + | ^^^^ the size of `i16` is smaller than the size of `u128` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -407,7 +407,7 @@ error[E0277]: `i16` cannot be safely transmuted into `i128` --> $DIR/numbers.rs:93:39 | LL | assert::is_transmutable::< i16, i128>(); - | ^^^^ The size of `i16` is smaller than the size of `i128` + | ^^^^ the size of `i16` is smaller than the size of `i128` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -422,7 +422,7 @@ error[E0277]: `u16` cannot be safely transmuted into `i32` --> $DIR/numbers.rs:95:40 | LL | assert::is_transmutable::< u16, i32>(); - | ^^^ The size of `u16` is smaller than the size of `i32` + | ^^^ the size of `u16` is smaller than the size of `i32` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -437,7 +437,7 @@ error[E0277]: `u16` cannot be safely transmuted into `f32` --> $DIR/numbers.rs:96:40 | LL | assert::is_transmutable::< u16, f32>(); - | ^^^ The size of `u16` is smaller than the size of `f32` + | ^^^ the size of `u16` is smaller than the size of `f32` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -452,7 +452,7 @@ error[E0277]: `u16` cannot be safely transmuted into `u32` --> $DIR/numbers.rs:97:40 | LL | assert::is_transmutable::< u16, u32>(); - | ^^^ The size of `u16` is smaller than the size of `u32` + | ^^^ the size of `u16` is smaller than the size of `u32` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -467,7 +467,7 @@ error[E0277]: `u16` cannot be safely transmuted into `u64` --> $DIR/numbers.rs:98:40 | LL | assert::is_transmutable::< u16, u64>(); - | ^^^ The size of `u16` is smaller than the size of `u64` + | ^^^ the size of `u16` is smaller than the size of `u64` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -482,7 +482,7 @@ error[E0277]: `u16` cannot be safely transmuted into `i64` --> $DIR/numbers.rs:99:40 | LL | assert::is_transmutable::< u16, i64>(); - | ^^^ The size of `u16` is smaller than the size of `i64` + | ^^^ the size of `u16` is smaller than the size of `i64` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -497,7 +497,7 @@ error[E0277]: `u16` cannot be safely transmuted into `f64` --> $DIR/numbers.rs:100:40 | LL | assert::is_transmutable::< u16, f64>(); - | ^^^ The size of `u16` is smaller than the size of `f64` + | ^^^ the size of `u16` is smaller than the size of `f64` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -512,7 +512,7 @@ error[E0277]: `u16` cannot be safely transmuted into `u128` --> $DIR/numbers.rs:101:39 | LL | assert::is_transmutable::< u16, u128>(); - | ^^^^ The size of `u16` is smaller than the size of `u128` + | ^^^^ the size of `u16` is smaller than the size of `u128` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -527,7 +527,7 @@ error[E0277]: `u16` cannot be safely transmuted into `i128` --> $DIR/numbers.rs:102:39 | LL | assert::is_transmutable::< u16, i128>(); - | ^^^^ The size of `u16` is smaller than the size of `i128` + | ^^^^ the size of `u16` is smaller than the size of `i128` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -542,7 +542,7 @@ error[E0277]: `i32` cannot be safely transmuted into `u64` --> $DIR/numbers.rs:104:40 | LL | assert::is_transmutable::< i32, u64>(); - | ^^^ The size of `i32` is smaller than the size of `u64` + | ^^^ the size of `i32` is smaller than the size of `u64` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -557,7 +557,7 @@ error[E0277]: `i32` cannot be safely transmuted into `i64` --> $DIR/numbers.rs:105:40 | LL | assert::is_transmutable::< i32, i64>(); - | ^^^ The size of `i32` is smaller than the size of `i64` + | ^^^ the size of `i32` is smaller than the size of `i64` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -572,7 +572,7 @@ error[E0277]: `i32` cannot be safely transmuted into `f64` --> $DIR/numbers.rs:106:40 | LL | assert::is_transmutable::< i32, f64>(); - | ^^^ The size of `i32` is smaller than the size of `f64` + | ^^^ the size of `i32` is smaller than the size of `f64` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -587,7 +587,7 @@ error[E0277]: `i32` cannot be safely transmuted into `u128` --> $DIR/numbers.rs:107:39 | LL | assert::is_transmutable::< i32, u128>(); - | ^^^^ The size of `i32` is smaller than the size of `u128` + | ^^^^ the size of `i32` is smaller than the size of `u128` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -602,7 +602,7 @@ error[E0277]: `i32` cannot be safely transmuted into `i128` --> $DIR/numbers.rs:108:39 | LL | assert::is_transmutable::< i32, i128>(); - | ^^^^ The size of `i32` is smaller than the size of `i128` + | ^^^^ the size of `i32` is smaller than the size of `i128` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -617,7 +617,7 @@ error[E0277]: `f32` cannot be safely transmuted into `u64` --> $DIR/numbers.rs:110:40 | LL | assert::is_transmutable::< f32, u64>(); - | ^^^ The size of `f32` is smaller than the size of `u64` + | ^^^ the size of `f32` is smaller than the size of `u64` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -632,7 +632,7 @@ error[E0277]: `f32` cannot be safely transmuted into `i64` --> $DIR/numbers.rs:111:40 | LL | assert::is_transmutable::< f32, i64>(); - | ^^^ The size of `f32` is smaller than the size of `i64` + | ^^^ the size of `f32` is smaller than the size of `i64` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -647,7 +647,7 @@ error[E0277]: `f32` cannot be safely transmuted into `f64` --> $DIR/numbers.rs:112:40 | LL | assert::is_transmutable::< f32, f64>(); - | ^^^ The size of `f32` is smaller than the size of `f64` + | ^^^ the size of `f32` is smaller than the size of `f64` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -662,7 +662,7 @@ error[E0277]: `f32` cannot be safely transmuted into `u128` --> $DIR/numbers.rs:113:39 | LL | assert::is_transmutable::< f32, u128>(); - | ^^^^ The size of `f32` is smaller than the size of `u128` + | ^^^^ the size of `f32` is smaller than the size of `u128` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -677,7 +677,7 @@ error[E0277]: `f32` cannot be safely transmuted into `i128` --> $DIR/numbers.rs:114:39 | LL | assert::is_transmutable::< f32, i128>(); - | ^^^^ The size of `f32` is smaller than the size of `i128` + | ^^^^ the size of `f32` is smaller than the size of `i128` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -692,7 +692,7 @@ error[E0277]: `u32` cannot be safely transmuted into `u64` --> $DIR/numbers.rs:116:40 | LL | assert::is_transmutable::< u32, u64>(); - | ^^^ The size of `u32` is smaller than the size of `u64` + | ^^^ the size of `u32` is smaller than the size of `u64` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -707,7 +707,7 @@ error[E0277]: `u32` cannot be safely transmuted into `i64` --> $DIR/numbers.rs:117:40 | LL | assert::is_transmutable::< u32, i64>(); - | ^^^ The size of `u32` is smaller than the size of `i64` + | ^^^ the size of `u32` is smaller than the size of `i64` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -722,7 +722,7 @@ error[E0277]: `u32` cannot be safely transmuted into `f64` --> $DIR/numbers.rs:118:40 | LL | assert::is_transmutable::< u32, f64>(); - | ^^^ The size of `u32` is smaller than the size of `f64` + | ^^^ the size of `u32` is smaller than the size of `f64` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -737,7 +737,7 @@ error[E0277]: `u32` cannot be safely transmuted into `u128` --> $DIR/numbers.rs:119:39 | LL | assert::is_transmutable::< u32, u128>(); - | ^^^^ The size of `u32` is smaller than the size of `u128` + | ^^^^ the size of `u32` is smaller than the size of `u128` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -752,7 +752,7 @@ error[E0277]: `u32` cannot be safely transmuted into `i128` --> $DIR/numbers.rs:120:39 | LL | assert::is_transmutable::< u32, i128>(); - | ^^^^ The size of `u32` is smaller than the size of `i128` + | ^^^^ the size of `u32` is smaller than the size of `i128` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -767,7 +767,7 @@ error[E0277]: `u64` cannot be safely transmuted into `u128` --> $DIR/numbers.rs:122:39 | LL | assert::is_transmutable::< u64, u128>(); - | ^^^^ The size of `u64` is smaller than the size of `u128` + | ^^^^ the size of `u64` is smaller than the size of `u128` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -782,7 +782,7 @@ error[E0277]: `u64` cannot be safely transmuted into `i128` --> $DIR/numbers.rs:123:39 | LL | assert::is_transmutable::< u64, i128>(); - | ^^^^ The size of `u64` is smaller than the size of `i128` + | ^^^^ the size of `u64` is smaller than the size of `i128` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -797,7 +797,7 @@ error[E0277]: `i64` cannot be safely transmuted into `u128` --> $DIR/numbers.rs:125:39 | LL | assert::is_transmutable::< i64, u128>(); - | ^^^^ The size of `i64` is smaller than the size of `u128` + | ^^^^ the size of `i64` is smaller than the size of `u128` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -812,7 +812,7 @@ error[E0277]: `i64` cannot be safely transmuted into `i128` --> $DIR/numbers.rs:126:39 | LL | assert::is_transmutable::< i64, i128>(); - | ^^^^ The size of `i64` is smaller than the size of `i128` + | ^^^^ the size of `i64` is smaller than the size of `i128` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -827,7 +827,7 @@ error[E0277]: `f64` cannot be safely transmuted into `u128` --> $DIR/numbers.rs:128:39 | LL | assert::is_transmutable::< f64, u128>(); - | ^^^^ The size of `f64` is smaller than the size of `u128` + | ^^^^ the size of `f64` is smaller than the size of `u128` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 @@ -842,7 +842,7 @@ error[E0277]: `f64` cannot be safely transmuted into `i128` --> $DIR/numbers.rs:129:39 | LL | assert::is_transmutable::< f64, i128>(); - | ^^^^ The size of `f64` is smaller than the size of `i128` + | ^^^^ the size of `f64` is smaller than the size of `i128` | note: required by a bound in `is_transmutable` --> $DIR/numbers.rs:14:14 diff --git a/tests/ui/transmutability/primitives/unit.current.stderr b/tests/ui/transmutability/primitives/unit.current.stderr index b2831dbf842..52b708d680e 100644 --- a/tests/ui/transmutability/primitives/unit.current.stderr +++ b/tests/ui/transmutability/primitives/unit.current.stderr @@ -2,7 +2,7 @@ error[E0277]: `()` cannot be safely transmuted into `u8` --> $DIR/unit.rs:31:35 | LL | assert::is_transmutable::<(), u8>(); - | ^^ The size of `()` is smaller than the size of `u8` + | ^^ the size of `()` is smaller than the size of `u8` | note: required by a bound in `is_transmutable` --> $DIR/unit.rs:16:14 diff --git a/tests/ui/transmutability/primitives/unit.next.stderr b/tests/ui/transmutability/primitives/unit.next.stderr index b2831dbf842..52b708d680e 100644 --- a/tests/ui/transmutability/primitives/unit.next.stderr +++ b/tests/ui/transmutability/primitives/unit.next.stderr @@ -2,7 +2,7 @@ error[E0277]: `()` cannot be safely transmuted into `u8` --> $DIR/unit.rs:31:35 | LL | assert::is_transmutable::<(), u8>(); - | ^^ The size of `()` is smaller than the size of `u8` + | ^^ the size of `()` is smaller than the size of `u8` | note: required by a bound in `is_transmutable` --> $DIR/unit.rs:16:14 diff --git a/tests/ui/transmutability/references/recursive-wrapper-types-bit-incompatible.stderr b/tests/ui/transmutability/references/recursive-wrapper-types-bit-incompatible.stderr index 305fca30939..2b7cab1660d 100644 --- a/tests/ui/transmutability/references/recursive-wrapper-types-bit-incompatible.stderr +++ b/tests/ui/transmutability/references/recursive-wrapper-types-bit-incompatible.stderr @@ -2,7 +2,7 @@ error[E0277]: `B` cannot be safely transmuted into `A` --> $DIR/recursive-wrapper-types-bit-incompatible.rs:23:49 | LL | assert::is_maybe_transmutable::<&'static B, &'static A>(); - | ^^^^^^^^^^ At least one value of `B` isn't a bit-valid value of `A` + | ^^^^^^^^^^ at least one value of `B` isn't a bit-valid value of `A` | note: required by a bound in `is_maybe_transmutable` --> $DIR/recursive-wrapper-types-bit-incompatible.rs:9:14 diff --git a/tests/ui/transmutability/references/reject_extension.stderr b/tests/ui/transmutability/references/reject_extension.stderr index e02ef89c4a0..88dd0313e3c 100644 --- a/tests/ui/transmutability/references/reject_extension.stderr +++ b/tests/ui/transmutability/references/reject_extension.stderr @@ -2,7 +2,7 @@ error[E0277]: `&Packed<Two>` cannot be safely transmuted into `&Packed<Four>` --> $DIR/reject_extension.rs:48:37 | LL | assert::is_transmutable::<&Src, &Dst>(); - | ^^^^ The referent size of `&Packed<Two>` (2 bytes) is smaller than that of `&Packed<Four>` (4 bytes) + | ^^^^ the referent size of `&Packed<Two>` (2 bytes) is smaller than that of `&Packed<Four>` (4 bytes) | note: required by a bound in `is_transmutable` --> $DIR/reject_extension.rs:13:14 diff --git a/tests/ui/transmutability/references/unit-to-u8.stderr b/tests/ui/transmutability/references/unit-to-u8.stderr index 7cb45e24e0a..5d73dfdc8eb 100644 --- a/tests/ui/transmutability/references/unit-to-u8.stderr +++ b/tests/ui/transmutability/references/unit-to-u8.stderr @@ -2,7 +2,7 @@ error[E0277]: `&Unit` cannot be safely transmuted into `&u8` --> $DIR/unit-to-u8.rs:22:52 | LL | assert::is_maybe_transmutable::<&'static Unit, &'static u8>(); - | ^^^^^^^^^^^ The referent size of `&Unit` (0 bytes) is smaller than that of `&u8` (1 bytes) + | ^^^^^^^^^^^ the referent size of `&Unit` (0 bytes) is smaller than that of `&u8` (1 bytes) | note: required by a bound in `is_maybe_transmutable` --> $DIR/unit-to-u8.rs:9:14 diff --git a/tests/ui/transmutability/region-infer.stderr b/tests/ui/transmutability/region-infer.stderr index 5497af2429e..03c46823838 100644 --- a/tests/ui/transmutability/region-infer.stderr +++ b/tests/ui/transmutability/region-infer.stderr @@ -2,7 +2,7 @@ error[E0277]: `()` cannot be safely transmuted into `W<'_>` --> $DIR/region-infer.rs:18:5 | LL | test(); - | ^^^^^^ The size of `()` is smaller than the size of `W<'_>` + | ^^^^^^ the size of `()` is smaller than the size of `W<'_>` | note: required by a bound in `test` --> $DIR/region-infer.rs:10:12 diff --git a/tests/ui/transmutability/structs/repr/should_require_well_defined_layout.stderr b/tests/ui/transmutability/structs/repr/should_require_well_defined_layout.stderr index 924422de538..77788f72c21 100644 --- a/tests/ui/transmutability/structs/repr/should_require_well_defined_layout.stderr +++ b/tests/ui/transmutability/structs/repr/should_require_well_defined_layout.stderr @@ -2,7 +2,7 @@ error[E0277]: `should_reject_repr_rust::unit::repr_rust` cannot be safely transm --> $DIR/should_require_well_defined_layout.rs:27:52 | LL | assert::is_maybe_transmutable::<repr_rust, ()>(); - | ^^ `should_reject_repr_rust::unit::repr_rust` does not have a well-specified layout + | ^^ analyzing the transmutability of `should_reject_repr_rust::unit::repr_rust` is not yet supported. | note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:12:14 @@ -24,7 +24,7 @@ error[E0277]: `u128` cannot be safely transmuted into `should_reject_repr_rust:: --> $DIR/should_require_well_defined_layout.rs:28:47 | LL | assert::is_maybe_transmutable::<u128, repr_rust>(); - | ^^^^^^^^^ `should_reject_repr_rust::unit::repr_rust` does not have a well-specified layout + | ^^^^^^^^^ analyzing the transmutability of `should_reject_repr_rust::unit::repr_rust` is not yet supported. | note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:12:14 @@ -46,7 +46,7 @@ error[E0277]: `should_reject_repr_rust::tuple::repr_rust` cannot be safely trans --> $DIR/should_require_well_defined_layout.rs:33:52 | LL | assert::is_maybe_transmutable::<repr_rust, ()>(); - | ^^ `should_reject_repr_rust::tuple::repr_rust` does not have a well-specified layout + | ^^ analyzing the transmutability of `should_reject_repr_rust::tuple::repr_rust` is not yet supported. | note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:12:14 @@ -68,7 +68,7 @@ error[E0277]: `u128` cannot be safely transmuted into `should_reject_repr_rust:: --> $DIR/should_require_well_defined_layout.rs:34:47 | LL | assert::is_maybe_transmutable::<u128, repr_rust>(); - | ^^^^^^^^^ `should_reject_repr_rust::tuple::repr_rust` does not have a well-specified layout + | ^^^^^^^^^ analyzing the transmutability of `should_reject_repr_rust::tuple::repr_rust` is not yet supported. | note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:12:14 @@ -90,7 +90,7 @@ error[E0277]: `should_reject_repr_rust::braces::repr_rust` cannot be safely tran --> $DIR/should_require_well_defined_layout.rs:39:52 | LL | assert::is_maybe_transmutable::<repr_rust, ()>(); - | ^^ `should_reject_repr_rust::braces::repr_rust` does not have a well-specified layout + | ^^ analyzing the transmutability of `should_reject_repr_rust::braces::repr_rust` is not yet supported. | note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:12:14 @@ -112,7 +112,7 @@ error[E0277]: `u128` cannot be safely transmuted into `should_reject_repr_rust:: --> $DIR/should_require_well_defined_layout.rs:40:47 | LL | assert::is_maybe_transmutable::<u128, repr_rust>(); - | ^^^^^^^^^ `should_reject_repr_rust::braces::repr_rust` does not have a well-specified layout + | ^^^^^^^^^ analyzing the transmutability of `should_reject_repr_rust::braces::repr_rust` is not yet supported. | note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:12:14 @@ -134,7 +134,7 @@ error[E0277]: `aligned::repr_rust` cannot be safely transmuted into `()` --> $DIR/should_require_well_defined_layout.rs:45:52 | LL | assert::is_maybe_transmutable::<repr_rust, ()>(); - | ^^ `aligned::repr_rust` does not have a well-specified layout + | ^^ analyzing the transmutability of `aligned::repr_rust` is not yet supported. | note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:12:14 @@ -156,7 +156,7 @@ error[E0277]: `u128` cannot be safely transmuted into `aligned::repr_rust` --> $DIR/should_require_well_defined_layout.rs:46:47 | LL | assert::is_maybe_transmutable::<u128, repr_rust>(); - | ^^^^^^^^^ `aligned::repr_rust` does not have a well-specified layout + | ^^^^^^^^^ analyzing the transmutability of `aligned::repr_rust` is not yet supported. | note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:12:14 @@ -178,7 +178,7 @@ error[E0277]: `packed::repr_rust` cannot be safely transmuted into `()` --> $DIR/should_require_well_defined_layout.rs:51:52 | LL | assert::is_maybe_transmutable::<repr_rust, ()>(); - | ^^ `packed::repr_rust` does not have a well-specified layout + | ^^ analyzing the transmutability of `packed::repr_rust` is not yet supported. | note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:12:14 @@ -200,7 +200,7 @@ error[E0277]: `u128` cannot be safely transmuted into `packed::repr_rust` --> $DIR/should_require_well_defined_layout.rs:52:47 | LL | assert::is_maybe_transmutable::<u128, repr_rust>(); - | ^^^^^^^^^ `packed::repr_rust` does not have a well-specified layout + | ^^^^^^^^^ analyzing the transmutability of `packed::repr_rust` is not yet supported. | note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:12:14 @@ -222,7 +222,7 @@ error[E0277]: `nested::repr_c` cannot be safely transmuted into `()` --> $DIR/should_require_well_defined_layout.rs:58:49 | LL | assert::is_maybe_transmutable::<repr_c, ()>(); - | ^^ `nested::repr_c` does not have a well-specified layout + | ^^ analyzing the transmutability of `nested::repr_c` is not yet supported. | note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:12:14 @@ -244,7 +244,7 @@ error[E0277]: `u128` cannot be safely transmuted into `nested::repr_c` --> $DIR/should_require_well_defined_layout.rs:59:47 | LL | assert::is_maybe_transmutable::<u128, repr_c>(); - | ^^^^^^ `nested::repr_c` does not have a well-specified layout + | ^^^^^^ analyzing the transmutability of `nested::repr_c` is not yet supported. | note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:12:14 diff --git a/tests/ui/transmutability/transmute-padding-ice.stderr b/tests/ui/transmutability/transmute-padding-ice.stderr index c48a5cd80ce..4c121d463c6 100644 --- a/tests/ui/transmutability/transmute-padding-ice.stderr +++ b/tests/ui/transmutability/transmute-padding-ice.stderr @@ -2,7 +2,7 @@ error[E0277]: `B` cannot be safely transmuted into `A` --> $DIR/transmute-padding-ice.rs:25:40 | LL | assert::is_maybe_transmutable::<B, A>(); - | ^ The size of `B` is smaller than the size of `A` + | ^ the size of `B` is smaller than the size of `A` | note: required by a bound in `is_maybe_transmutable` --> $DIR/transmute-padding-ice.rs:10:14 diff --git a/tests/ui/transmutability/unions/repr/should_require_well_defined_layout.stderr b/tests/ui/transmutability/unions/repr/should_require_well_defined_layout.stderr index ee0e8a66434..bec07f13103 100644 --- a/tests/ui/transmutability/unions/repr/should_require_well_defined_layout.stderr +++ b/tests/ui/transmutability/unions/repr/should_require_well_defined_layout.stderr @@ -2,7 +2,7 @@ error[E0277]: `should_reject_repr_rust::repr_rust` cannot be safely transmuted i --> $DIR/should_require_well_defined_layout.rs:29:48 | LL | assert::is_maybe_transmutable::<repr_rust, ()>(); - | ^^ `should_reject_repr_rust::repr_rust` does not have a well-specified layout + | ^^ analyzing the transmutability of `should_reject_repr_rust::repr_rust` is not yet supported. | note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:12:14 @@ -24,7 +24,7 @@ error[E0277]: `u128` cannot be safely transmuted into `should_reject_repr_rust:: --> $DIR/should_require_well_defined_layout.rs:30:43 | LL | assert::is_maybe_transmutable::<u128, repr_rust>(); - | ^^^^^^^^^ `should_reject_repr_rust::repr_rust` does not have a well-specified layout + | ^^^^^^^^^ analyzing the transmutability of `should_reject_repr_rust::repr_rust` is not yet supported. | note: required by a bound in `is_maybe_transmutable` --> $DIR/should_require_well_defined_layout.rs:12:14 diff --git a/tests/ui/transmutability/unions/should_pad_variants.stderr b/tests/ui/transmutability/unions/should_pad_variants.stderr index 13b4c8053ad..da4294bdbce 100644 --- a/tests/ui/transmutability/unions/should_pad_variants.stderr +++ b/tests/ui/transmutability/unions/should_pad_variants.stderr @@ -2,7 +2,7 @@ error[E0277]: `Src` cannot be safely transmuted into `Dst` --> $DIR/should_pad_variants.rs:43:36 | LL | assert::is_transmutable::<Src, Dst>(); - | ^^^ The size of `Src` is smaller than the size of `Dst` + | ^^^ the size of `Src` is smaller than the size of `Dst` | note: required by a bound in `is_transmutable` --> $DIR/should_pad_variants.rs:13:14 diff --git a/tests/ui/transmutability/unions/should_reject_contraction.stderr b/tests/ui/transmutability/unions/should_reject_contraction.stderr index a3e387a0f84..20eaa3a6b09 100644 --- a/tests/ui/transmutability/unions/should_reject_contraction.stderr +++ b/tests/ui/transmutability/unions/should_reject_contraction.stderr @@ -2,7 +2,7 @@ error[E0277]: `Superset` cannot be safely transmuted into `Subset` --> $DIR/should_reject_contraction.rs:34:41 | LL | assert::is_transmutable::<Superset, Subset>(); - | ^^^^^^ At least one value of `Superset` isn't a bit-valid value of `Subset` + | ^^^^^^ at least one value of `Superset` isn't a bit-valid value of `Subset` | note: required by a bound in `is_transmutable` --> $DIR/should_reject_contraction.rs:12:14 diff --git a/tests/ui/transmutability/unions/should_reject_disjoint.stderr b/tests/ui/transmutability/unions/should_reject_disjoint.stderr index 447ab6d9de7..ea47797c970 100644 --- a/tests/ui/transmutability/unions/should_reject_disjoint.stderr +++ b/tests/ui/transmutability/unions/should_reject_disjoint.stderr @@ -2,7 +2,7 @@ error[E0277]: `A` cannot be safely transmuted into `B` --> $DIR/should_reject_disjoint.rs:32:40 | LL | assert::is_maybe_transmutable::<A, B>(); - | ^ At least one value of `A` isn't a bit-valid value of `B` + | ^ at least one value of `A` isn't a bit-valid value of `B` | note: required by a bound in `is_maybe_transmutable` --> $DIR/should_reject_disjoint.rs:12:14 @@ -17,7 +17,7 @@ error[E0277]: `B` cannot be safely transmuted into `A` --> $DIR/should_reject_disjoint.rs:33:40 | LL | assert::is_maybe_transmutable::<B, A>(); - | ^ At least one value of `B` isn't a bit-valid value of `A` + | ^ at least one value of `B` isn't a bit-valid value of `A` | note: required by a bound in `is_maybe_transmutable` --> $DIR/should_reject_disjoint.rs:12:14 diff --git a/tests/ui/transmutability/unions/should_reject_intersecting.stderr b/tests/ui/transmutability/unions/should_reject_intersecting.stderr index f0763bc8be7..79dec659d9d 100644 --- a/tests/ui/transmutability/unions/should_reject_intersecting.stderr +++ b/tests/ui/transmutability/unions/should_reject_intersecting.stderr @@ -2,7 +2,7 @@ error[E0277]: `A` cannot be safely transmuted into `B` --> $DIR/should_reject_intersecting.rs:35:34 | LL | assert::is_transmutable::<A, B>(); - | ^ At least one value of `A` isn't a bit-valid value of `B` + | ^ at least one value of `A` isn't a bit-valid value of `B` | note: required by a bound in `is_transmutable` --> $DIR/should_reject_intersecting.rs:13:14 @@ -17,7 +17,7 @@ error[E0277]: `B` cannot be safely transmuted into `A` --> $DIR/should_reject_intersecting.rs:36:34 | LL | assert::is_transmutable::<B, A>(); - | ^ At least one value of `B` isn't a bit-valid value of `A` + | ^ at least one value of `B` isn't a bit-valid value of `A` | note: required by a bound in `is_transmutable` --> $DIR/should_reject_intersecting.rs:13:14 diff --git a/tests/ui/type-alias-impl-trait/hkl_forbidden4.rs b/tests/ui/type-alias-impl-trait/hkl_forbidden4.rs new file mode 100644 index 00000000000..ef9fe604ea7 --- /dev/null +++ b/tests/ui/type-alias-impl-trait/hkl_forbidden4.rs @@ -0,0 +1,25 @@ +//! This test used to ICE because, while an error was emitted, +//! we still tried to remap generic params used in the hidden type +//! to the ones of the opaque type definition. + +//@ edition: 2021 + +#![feature(type_alias_impl_trait)] +use std::future::Future; + +type FutNothing<'a> = impl 'a + Future<Output = ()>; +//~^ ERROR: unconstrained opaque type + +async fn operation(_: &mut ()) -> () { + //~^ ERROR: concrete type differs from previous + call(operation).await +} + +async fn call<F>(_f: F) +where + for<'any> F: FnMut(&'any mut ()) -> FutNothing<'any>, +{ + //~^ ERROR: expected generic lifetime parameter, found `'any` +} + +fn main() {} diff --git a/tests/ui/type-alias-impl-trait/hkl_forbidden4.stderr b/tests/ui/type-alias-impl-trait/hkl_forbidden4.stderr new file mode 100644 index 00000000000..d7a0452727e --- /dev/null +++ b/tests/ui/type-alias-impl-trait/hkl_forbidden4.stderr @@ -0,0 +1,34 @@ +error: unconstrained opaque type + --> $DIR/hkl_forbidden4.rs:10:23 + | +LL | type FutNothing<'a> = impl 'a + Future<Output = ()>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `FutNothing` must be used in combination with a concrete type within the same module + +error: concrete type differs from previous defining opaque type use + --> $DIR/hkl_forbidden4.rs:13:1 + | +LL | async fn operation(_: &mut ()) -> () { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `FutNothing<'_>`, got `{async fn body@$DIR/hkl_forbidden4.rs:13:38: 16:2}` + | +note: previous use here + --> $DIR/hkl_forbidden4.rs:15:5 + | +LL | call(operation).await + | ^^^^^^^^^^^^^^^ + +error[E0792]: expected generic lifetime parameter, found `'any` + --> $DIR/hkl_forbidden4.rs:21:1 + | +LL | type FutNothing<'a> = impl 'a + Future<Output = ()>; + | -- this generic parameter must be used with a generic lifetime parameter +... +LL | / { +LL | | +LL | | } + | |_^ + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0792`. diff --git a/tests/ui/type-alias-impl-trait/ice-failed-to-resolve-instance-for-110696.rs b/tests/ui/type-alias-impl-trait/ice-failed-to-resolve-instance-for-110696.rs new file mode 100644 index 00000000000..fc71d0d61ff --- /dev/null +++ b/tests/ui/type-alias-impl-trait/ice-failed-to-resolve-instance-for-110696.rs @@ -0,0 +1,52 @@ +// test for #110696 +// failed to resolve instance for <Scope<()> as MyIndex<()>>::my_index +// ignore-tidy-linelength + +#![feature(type_alias_impl_trait)] + +use std::marker::PhantomData; + + +trait MyIndex<T> { + type O; + fn my_index(self) -> Self::O; +} +trait MyFrom<T>: Sized { + type Error; + fn my_from(value: T) -> Result<Self, Self::Error>; +} + + +trait F {} +impl F for () {} +type DummyT<T> = impl F; +fn _dummy_t<T>() -> DummyT<T> {} + +struct Phantom1<T>(PhantomData<T>); +struct Phantom2<T>(PhantomData<T>); +struct Scope<T>(Phantom2<DummyT<T>>); + +impl<T> Scope<T> { + fn new() -> Self { + unimplemented!() + } +} + +impl<T> MyFrom<Phantom2<T>> for Phantom1<T> { + type Error = (); + fn my_from(_: Phantom2<T>) -> Result<Self, Self::Error> { + unimplemented!() + } +} + +impl<T: MyFrom<Phantom2<DummyT<U>>>, U> MyIndex<DummyT<T>> for Scope<U> { + //~^ ERROR the type parameter `T` is not constrained by the impl + type O = T; + fn my_index(self) -> Self::O { + MyFrom::my_from(self.0).ok().unwrap() + } +} + +fn main() { + let _pos: Phantom1<DummyT<()>> = Scope::new().my_index(); +} diff --git a/tests/ui/type-alias-impl-trait/ice-failed-to-resolve-instance-for-110696.stderr b/tests/ui/type-alias-impl-trait/ice-failed-to-resolve-instance-for-110696.stderr new file mode 100644 index 00000000000..a39f77ce17f --- /dev/null +++ b/tests/ui/type-alias-impl-trait/ice-failed-to-resolve-instance-for-110696.stderr @@ -0,0 +1,9 @@ +error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates + --> $DIR/ice-failed-to-resolve-instance-for-110696.rs:42:6 + | +LL | impl<T: MyFrom<Phantom2<DummyT<U>>>, U> MyIndex<DummyT<T>> for Scope<U> { + | ^ unconstrained type parameter + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0207`. diff --git a/tests/ui/type-alias-impl-trait/lifetime_mismatch.rs b/tests/ui/type-alias-impl-trait/lifetime_mismatch.rs new file mode 100644 index 00000000000..9ec585d93f5 --- /dev/null +++ b/tests/ui/type-alias-impl-trait/lifetime_mismatch.rs @@ -0,0 +1,25 @@ +#![feature(type_alias_impl_trait)] + +type Foo<'a> = impl Sized; + +fn foo<'a, 'b>(x: &'a u32, y: &'b u32) -> (Foo<'a>, Foo<'b>) { + (x, y) + //~^ ERROR opaque type used twice with different lifetimes + //~| ERROR opaque type used twice with different lifetimes +} + +type Bar<'a, 'b> = impl std::fmt::Debug; + +fn bar<'x, 'y>(i: &'x i32, j: &'y i32) -> (Bar<'x, 'y>, Bar<'y, 'x>) { + (i, j) + //~^ ERROR opaque type used twice with different lifetimes + //~| ERROR opaque type used twice with different lifetimes + //~| ERROR opaque type used twice with different lifetimes + //~| ERROR opaque type used twice with different lifetimes +} + +fn main() { + let meh = 42; + let muh = 69; + println!("{:?}", bar(&meh, &muh)); +} diff --git a/tests/ui/type-alias-impl-trait/lifetime_mismatch.stderr b/tests/ui/type-alias-impl-trait/lifetime_mismatch.stderr new file mode 100644 index 00000000000..7f54f47d27d --- /dev/null +++ b/tests/ui/type-alias-impl-trait/lifetime_mismatch.stderr @@ -0,0 +1,95 @@ +error: opaque type used twice with different lifetimes + --> $DIR/lifetime_mismatch.rs:6:5 + | +LL | (x, y) + | ^^^^^^ + | | + | lifetime `'a` used here + | lifetime `'b` previously used here + | +note: if all non-lifetime generic parameters are the same, but the lifetime parameters differ, it is not possible to differentiate the opaque types + --> $DIR/lifetime_mismatch.rs:6:5 + | +LL | (x, y) + | ^^^^^^ + +error: opaque type used twice with different lifetimes + --> $DIR/lifetime_mismatch.rs:6:5 + | +LL | (x, y) + | ^^^^^^ + | | + | lifetime `'a` used here + | lifetime `'b` previously used here + | +note: if all non-lifetime generic parameters are the same, but the lifetime parameters differ, it is not possible to differentiate the opaque types + --> $DIR/lifetime_mismatch.rs:6:5 + | +LL | (x, y) + | ^^^^^^ + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error: opaque type used twice with different lifetimes + --> $DIR/lifetime_mismatch.rs:14:5 + | +LL | (i, j) + | ^^^^^^ + | | + | lifetime `'x` used here + | lifetime `'y` previously used here + | +note: if all non-lifetime generic parameters are the same, but the lifetime parameters differ, it is not possible to differentiate the opaque types + --> $DIR/lifetime_mismatch.rs:14:5 + | +LL | (i, j) + | ^^^^^^ + +error: opaque type used twice with different lifetimes + --> $DIR/lifetime_mismatch.rs:14:5 + | +LL | (i, j) + | ^^^^^^ + | | + | lifetime `'y` used here + | lifetime `'x` previously used here + | +note: if all non-lifetime generic parameters are the same, but the lifetime parameters differ, it is not possible to differentiate the opaque types + --> $DIR/lifetime_mismatch.rs:14:5 + | +LL | (i, j) + | ^^^^^^ + +error: opaque type used twice with different lifetimes + --> $DIR/lifetime_mismatch.rs:14:5 + | +LL | (i, j) + | ^^^^^^ + | | + | lifetime `'x` used here + | lifetime `'y` previously used here + | +note: if all non-lifetime generic parameters are the same, but the lifetime parameters differ, it is not possible to differentiate the opaque types + --> $DIR/lifetime_mismatch.rs:14:5 + | +LL | (i, j) + | ^^^^^^ + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error: opaque type used twice with different lifetimes + --> $DIR/lifetime_mismatch.rs:14:5 + | +LL | (i, j) + | ^^^^^^ + | | + | lifetime `'y` used here + | lifetime `'x` previously used here + | +note: if all non-lifetime generic parameters are the same, but the lifetime parameters differ, it is not possible to differentiate the opaque types + --> $DIR/lifetime_mismatch.rs:14:5 + | +LL | (i, j) + | ^^^^^^ + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error: aborting due to 6 previous errors + diff --git a/tests/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn-lifetimes.rs b/tests/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn-lifetimes.rs index 3f122f10609..5bec38c5e5b 100644 --- a/tests/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn-lifetimes.rs +++ b/tests/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn-lifetimes.rs @@ -3,7 +3,11 @@ type Foo<'a, 'b> = impl std::fmt::Debug; fn foo<'x, 'y>(i: &'x i32, j: &'y i32) -> (Foo<'x, 'y>, Foo<'y, 'x>) { - (i, i) //~ ERROR concrete type differs from previous + (i, i) + //~^ ERROR opaque type used twice with different lifetimes + //~| ERROR opaque type used twice with different lifetimes + //~| ERROR opaque type used twice with different lifetimes + //~| ERROR opaque type used twice with different lifetimes } fn main() {} diff --git a/tests/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn-lifetimes.stderr b/tests/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn-lifetimes.stderr index 552cf3fda30..0ccb3e2221d 100644 --- a/tests/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn-lifetimes.stderr +++ b/tests/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn-lifetimes.stderr @@ -1,11 +1,64 @@ -error: concrete type differs from previous defining opaque type use +error: opaque type used twice with different lifetimes --> $DIR/multiple-def-uses-in-one-fn-lifetimes.rs:6:5 | LL | (i, i) | ^^^^^^ | | - | expected `&'a i32`, got `&'b i32` - | this expression supplies two conflicting concrete types for the same opaque type + | lifetime `'x` used here + | lifetime `'y` previously used here + | +note: if all non-lifetime generic parameters are the same, but the lifetime parameters differ, it is not possible to differentiate the opaque types + --> $DIR/multiple-def-uses-in-one-fn-lifetimes.rs:6:5 + | +LL | (i, i) + | ^^^^^^ + +error: opaque type used twice with different lifetimes + --> $DIR/multiple-def-uses-in-one-fn-lifetimes.rs:6:5 + | +LL | (i, i) + | ^^^^^^ + | | + | lifetime `'y` used here + | lifetime `'x` previously used here + | +note: if all non-lifetime generic parameters are the same, but the lifetime parameters differ, it is not possible to differentiate the opaque types + --> $DIR/multiple-def-uses-in-one-fn-lifetimes.rs:6:5 + | +LL | (i, i) + | ^^^^^^ + +error: opaque type used twice with different lifetimes + --> $DIR/multiple-def-uses-in-one-fn-lifetimes.rs:6:5 + | +LL | (i, i) + | ^^^^^^ + | | + | lifetime `'x` used here + | lifetime `'y` previously used here + | +note: if all non-lifetime generic parameters are the same, but the lifetime parameters differ, it is not possible to differentiate the opaque types + --> $DIR/multiple-def-uses-in-one-fn-lifetimes.rs:6:5 + | +LL | (i, i) + | ^^^^^^ + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error: opaque type used twice with different lifetimes + --> $DIR/multiple-def-uses-in-one-fn-lifetimes.rs:6:5 + | +LL | (i, i) + | ^^^^^^ + | | + | lifetime `'y` used here + | lifetime `'x` previously used here + | +note: if all non-lifetime generic parameters are the same, but the lifetime parameters differ, it is not possible to differentiate the opaque types + --> $DIR/multiple-def-uses-in-one-fn-lifetimes.rs:6:5 + | +LL | (i, i) + | ^^^^^^ + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -error: aborting due to 1 previous error +error: aborting due to 4 previous errors diff --git a/tests/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn-pass.rs b/tests/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn-pass.rs index 40c00e553a6..aba41a9d852 100644 --- a/tests/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn-pass.rs +++ b/tests/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn-pass.rs @@ -7,15 +7,11 @@ fn f<A: ToString + Clone, B: ToString + Clone>(a: A, b: B) -> (X<A, B>, X<A, B>) (a.clone(), a) } -type Foo<'a, 'b> = impl std::fmt::Debug; - -fn foo<'x, 'y>(i: &'x i32, j: &'y i32) -> (Foo<'x, 'y>, Foo<'y, 'x>) { - (i, j) +type Tait<'x> = impl Sized; +fn define<'a: 'b, 'b: 'a>(x: &'a u8, y: &'b u8) -> (Tait<'a>, Tait<'b>) { + ((), ()) } fn main() { println!("{}", <X<_, _> as ToString>::to_string(&f(42_i32, String::new()).1)); - let meh = 42; - let muh = 69; - println!("{:?}", foo(&meh, &muh)); } diff --git a/tests/ui/type-alias-impl-trait/not_well_formed.fixed b/tests/ui/type-alias-impl-trait/not_well_formed.fixed deleted file mode 100644 index bd45d8cddae..00000000000 --- a/tests/ui/type-alias-impl-trait/not_well_formed.fixed +++ /dev/null @@ -1,19 +0,0 @@ -//@ run-rustfix -#![feature(type_alias_impl_trait)] -#![allow(dead_code)] - -fn main() {} - -trait TraitWithAssoc { - type Assoc; -} - -type Foo<V: TraitWithAssoc> = impl Trait<V::Assoc>; //~ associated type `Assoc` not found for `V` - -trait Trait<U> {} - -impl<W> Trait<W> for () {} - -fn foo_desugared<T: TraitWithAssoc>(_: T) -> Foo<T> { - () -} diff --git a/tests/ui/type-alias-impl-trait/not_well_formed.rs b/tests/ui/type-alias-impl-trait/not_well_formed.rs index 7b5444ae0d3..0cf8d41c7fd 100644 --- a/tests/ui/type-alias-impl-trait/not_well_formed.rs +++ b/tests/ui/type-alias-impl-trait/not_well_formed.rs @@ -1,4 +1,4 @@ -//@ run-rustfix +// Can't rustfix because we apply the suggestion twice :^( #![feature(type_alias_impl_trait)] #![allow(dead_code)] @@ -8,7 +8,9 @@ trait TraitWithAssoc { type Assoc; } -type Foo<V> = impl Trait<V::Assoc>; //~ associated type `Assoc` not found for `V` +type Foo<V> = impl Trait<V::Assoc>; +//~^ associated type `Assoc` not found for `V` +//~| associated type `Assoc` not found for `V` trait Trait<U> {} diff --git a/tests/ui/type-alias-impl-trait/not_well_formed.stderr b/tests/ui/type-alias-impl-trait/not_well_formed.stderr index dbd80ffa4f6..a2944a1acb9 100644 --- a/tests/ui/type-alias-impl-trait/not_well_formed.stderr +++ b/tests/ui/type-alias-impl-trait/not_well_formed.stderr @@ -9,6 +9,18 @@ help: consider restricting type parameter `V` LL | type Foo<V: TraitWithAssoc> = impl Trait<V::Assoc>; | ++++++++++++++++ -error: aborting due to 1 previous error +error[E0220]: associated type `Assoc` not found for `V` + --> $DIR/not_well_formed.rs:11:29 + | +LL | type Foo<V> = impl Trait<V::Assoc>; + | ^^^^^ there is an associated type `Assoc` in the trait `TraitWithAssoc` + | + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` +help: consider restricting type parameter `V` + | +LL | type Foo<V: TraitWithAssoc> = impl Trait<V::Assoc>; + | ++++++++++++++++ + +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0220`. diff --git a/tests/ui/type-alias-impl-trait/param_mismatch.rs b/tests/ui/type-alias-impl-trait/param_mismatch.rs new file mode 100644 index 00000000000..c7465030713 --- /dev/null +++ b/tests/ui/type-alias-impl-trait/param_mismatch.rs @@ -0,0 +1,16 @@ +//! This test checks that when checking for opaque types that +//! only differ in lifetimes, we handle the case of non-generic +//! regions correctly. +#![feature(type_alias_impl_trait)] + +fn id(s: &str) -> &str { + s +} +type Opaque<'a> = impl Sized + 'a; +// The second `Opaque<'_>` has a higher kinded lifetime, not a generic parameter +fn test(s: &str) -> (Opaque<'_>, impl Fn(&str) -> Opaque<'_>) { + (s, id) + //~^ ERROR: expected generic lifetime parameter, found `'_` +} + +fn main() {} diff --git a/tests/ui/type-alias-impl-trait/param_mismatch.stderr b/tests/ui/type-alias-impl-trait/param_mismatch.stderr new file mode 100644 index 00000000000..09ec550d718 --- /dev/null +++ b/tests/ui/type-alias-impl-trait/param_mismatch.stderr @@ -0,0 +1,12 @@ +error[E0792]: expected generic lifetime parameter, found `'_` + --> $DIR/param_mismatch.rs:12:5 + | +LL | type Opaque<'a> = impl Sized + 'a; + | -- this generic parameter must be used with a generic lifetime parameter +... +LL | (s, id) + | ^^^^^^^ + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0792`. diff --git a/tests/ui/type-alias-impl-trait/param_mismatch2.rs b/tests/ui/type-alias-impl-trait/param_mismatch2.rs new file mode 100644 index 00000000000..c7d5eaa16aa --- /dev/null +++ b/tests/ui/type-alias-impl-trait/param_mismatch2.rs @@ -0,0 +1,16 @@ +//! This test checks that when checking for opaque types that +//! only differ in lifetimes, we handle the case of non-generic +//! regions correctly. +#![feature(type_alias_impl_trait)] + +fn id(s: &str) -> &str { + s +} + +type Opaque<'a> = impl Sized + 'a; + +fn test(s: &str) -> (impl Fn(&str) -> Opaque<'_>, impl Fn(&str) -> Opaque<'_>) { + (id, id) //~ ERROR: expected generic lifetime parameter, found `'_` +} + +fn main() {} diff --git a/tests/ui/type-alias-impl-trait/param_mismatch2.stderr b/tests/ui/type-alias-impl-trait/param_mismatch2.stderr new file mode 100644 index 00000000000..1ecdd7c2b54 --- /dev/null +++ b/tests/ui/type-alias-impl-trait/param_mismatch2.stderr @@ -0,0 +1,12 @@ +error[E0792]: expected generic lifetime parameter, found `'_` + --> $DIR/param_mismatch2.rs:13:5 + | +LL | type Opaque<'a> = impl Sized + 'a; + | -- this generic parameter must be used with a generic lifetime parameter +... +LL | (id, id) + | ^^^^^^^^ + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0792`. diff --git a/tests/ui/type-alias-impl-trait/param_mismatch3.rs b/tests/ui/type-alias-impl-trait/param_mismatch3.rs new file mode 100644 index 00000000000..03c133d5d3c --- /dev/null +++ b/tests/ui/type-alias-impl-trait/param_mismatch3.rs @@ -0,0 +1,26 @@ +//! This test checks that when checking for opaque types that +//! only differ in lifetimes, we handle the case of non-generic +//! regions correctly. +#![feature(type_alias_impl_trait)] + +fn id2<'a, 'b>(s: (&'a str, &'b str)) -> (&'a str, &'b str) { + s +} + +type Opaque<'a> = impl Sized + 'a; + +fn test() -> impl for<'a, 'b> Fn((&'a str, &'b str)) -> (Opaque<'a>, Opaque<'b>) { + id2 //~ ERROR expected generic lifetime parameter, found `'a` +} + +fn id(s: &str) -> &str { + s +} + +type Opaque2<'a> = impl Sized + 'a; + +fn test2(s: &str) -> (impl Fn(&str) -> Opaque2<'_>, Opaque2<'_>) { + (id, s) //~ ERROR: expected generic lifetime parameter, found `'_` +} + +fn main() {} diff --git a/tests/ui/type-alias-impl-trait/param_mismatch3.stderr b/tests/ui/type-alias-impl-trait/param_mismatch3.stderr new file mode 100644 index 00000000000..b8805f9b7f6 --- /dev/null +++ b/tests/ui/type-alias-impl-trait/param_mismatch3.stderr @@ -0,0 +1,21 @@ +error[E0792]: expected generic lifetime parameter, found `'a` + --> $DIR/param_mismatch3.rs:13:5 + | +LL | type Opaque<'a> = impl Sized + 'a; + | -- this generic parameter must be used with a generic lifetime parameter +... +LL | id2 + | ^^^ + +error[E0792]: expected generic lifetime parameter, found `'_` + --> $DIR/param_mismatch3.rs:23:5 + | +LL | type Opaque2<'a> = impl Sized + 'a; + | -- this generic parameter must be used with a generic lifetime parameter +... +LL | (id, s) + | ^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0792`. diff --git a/tests/ui/type-alias-impl-trait/underef-index-out-of-bounds-121472.rs b/tests/ui/type-alias-impl-trait/underef-index-out-of-bounds-121472.rs new file mode 100644 index 00000000000..37e0d89efc7 --- /dev/null +++ b/tests/ui/type-alias-impl-trait/underef-index-out-of-bounds-121472.rs @@ -0,0 +1,16 @@ +// test for ICE #121472 index out of bounds un_derefer.rs +#![feature(type_alias_impl_trait)] + +trait T {} + +type Alias<'a> = impl T; + +struct S; +impl<'a> T for &'a S {} + +fn with_positive(fun: impl Fn(Alias<'_>)) {} + +fn main() { + with_positive(|&n| ()); + //~^ ERROR mismatched types +} diff --git a/tests/ui/type-alias-impl-trait/underef-index-out-of-bounds-121472.stderr b/tests/ui/type-alias-impl-trait/underef-index-out-of-bounds-121472.stderr new file mode 100644 index 00000000000..a224bab0705 --- /dev/null +++ b/tests/ui/type-alias-impl-trait/underef-index-out-of-bounds-121472.stderr @@ -0,0 +1,23 @@ +error[E0308]: mismatched types + --> $DIR/underef-index-out-of-bounds-121472.rs:14:20 + | +LL | type Alias<'a> = impl T; + | ------ the expected opaque type +... +LL | with_positive(|&n| ()); + | ^^ + | | + | expected opaque type, found `&_` + | expected due to this + | + = note: expected opaque type `Alias<'_>` + found reference `&_` +help: consider removing `&` from the pattern + | +LL - with_positive(|&n| ()); +LL + with_positive(|n| ()); + | + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/type/type-check/issue-67273-assignment-match-prior-arm-bool-expected-unit.stderr b/tests/ui/type/type-check/issue-67273-assignment-match-prior-arm-bool-expected-unit.stderr index 229729a9ba6..8c23eaea62e 100644 --- a/tests/ui/type/type-check/issue-67273-assignment-match-prior-arm-bool-expected-unit.stderr +++ b/tests/ui/type/type-check/issue-67273-assignment-match-prior-arm-bool-expected-unit.stderr @@ -5,8 +5,7 @@ LL | / match i { LL | | // Add `bool` to the overall `coercion`. LL | | 0 => true, | | ---- this is found to be of type `bool` -LL | | -LL | | // Necessary to cause the ICE: +... | LL | | 1 => true, | | ---- this is found to be of type `bool` ... | diff --git a/tests/ui/typeck/escaping_bound_vars.rs b/tests/ui/typeck/escaping_bound_vars.rs index f886388bfbd..985a3fdbccf 100644 --- a/tests/ui/typeck/escaping_bound_vars.rs +++ b/tests/ui/typeck/escaping_bound_vars.rs @@ -11,9 +11,6 @@ where (): Test<{ 1 + (<() as Elide(&())>::call) }>, //~^ ERROR cannot capture late-bound lifetime in constant //~| ERROR associated type bindings are not allowed here - //~| ERROR the trait bound `(): Elide<(&(),)>` is not satisfied - //~| ERROR the trait bound `(): Elide<(&(),)>` is not satisfied - //~| ERROR cannot add { } diff --git a/tests/ui/typeck/escaping_bound_vars.stderr b/tests/ui/typeck/escaping_bound_vars.stderr index 8c7dcdb7f16..bd9c95fab97 100644 --- a/tests/ui/typeck/escaping_bound_vars.stderr +++ b/tests/ui/typeck/escaping_bound_vars.stderr @@ -12,49 +12,6 @@ error[E0229]: associated type bindings are not allowed here LL | (): Test<{ 1 + (<() as Elide(&())>::call) }>, | ^^^^^^^^^^ associated type not allowed here -error[E0277]: the trait bound `(): Elide<(&(),)>` is not satisfied - --> $DIR/escaping_bound_vars.rs:11:22 - | -LL | (): Test<{ 1 + (<() as Elide(&())>::call) }>, - | ^^ the trait `Elide<(&(),)>` is not implemented for `()` - | -help: this trait has no implementations, consider adding one - --> $DIR/escaping_bound_vars.rs:5:1 - | -LL | trait Elide<T> { - | ^^^^^^^^^^^^^^ - -error[E0277]: cannot add `fn() {<() as Elide<(&(),)>>::call}` to `{integer}` - --> $DIR/escaping_bound_vars.rs:11:18 - | -LL | (): Test<{ 1 + (<() as Elide(&())>::call) }>, - | ^ no implementation for `{integer} + fn() {<() as Elide<(&(),)>>::call}` - | - = help: the trait `Add<fn() {<() as Elide<(&(),)>>::call}>` is not implemented for `{integer}` - = help: the following other types implement trait `Add<Rhs>`: - <isize as Add> - <isize as Add<&isize>> - <i8 as Add> - <i8 as Add<&i8>> - <i16 as Add> - <i16 as Add<&i16>> - <i32 as Add> - <i32 as Add<&i32>> - and 48 others - -error[E0277]: the trait bound `(): Elide<(&(),)>` is not satisfied - --> $DIR/escaping_bound_vars.rs:11:18 - | -LL | (): Test<{ 1 + (<() as Elide(&())>::call) }>, - | ^ the trait `Elide<(&(),)>` is not implemented for `()` - | -help: this trait has no implementations, consider adding one - --> $DIR/escaping_bound_vars.rs:5:1 - | -LL | trait Elide<T> { - | ^^^^^^^^^^^^^^ - -error: aborting due to 5 previous errors +error: aborting due to 2 previous errors -Some errors have detailed explanations: E0229, E0277. -For more information about an error, try `rustc --explain E0229`. +For more information about this error, try `rustc --explain E0229`. diff --git a/tests/ui/typeck/issue-91267.stderr b/tests/ui/typeck/issue-91267.stderr index 7e48b251980..399309d0ec4 100644 --- a/tests/ui/typeck/issue-91267.stderr +++ b/tests/ui/typeck/issue-91267.stderr @@ -17,6 +17,8 @@ LL | fn main() { | - expected `()` because of default return type LL | type_ascribe!(0, u8<e<5>=e>) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `u8` + | + = note: this error originates in the macro `type_ascribe` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 3 previous errors diff --git a/tests/ui/typeck/typeck_type_placeholder_item.stderr b/tests/ui/typeck/typeck_type_placeholder_item.stderr index e8f1de1ad04..8bcad56916a 100644 --- a/tests/ui/typeck/typeck_type_placeholder_item.stderr +++ b/tests/ui/typeck/typeck_type_placeholder_item.stderr @@ -673,7 +673,10 @@ LL | const _: _ = (1..10).filter(|x| x % 2 == 0).map(|x| x * x); | ^^^^^^^^^^^^^^^^^^^^^^ | = note: calls in constants are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable +help: add `#![feature(const_trait_impl)]` to the crate attributes to enable + | +LL + #![feature(const_trait_impl)] + | error[E0015]: cannot call non-const fn `<Filter<std::ops::Range<i32>, {closure@$DIR/typeck_type_placeholder_item.rs:230:29: 230:32}> as Iterator>::map::<i32, {closure@$DIR/typeck_type_placeholder_item.rs:230:49: 230:52}>` in constants --> $DIR/typeck_type_placeholder_item.rs:230:45 @@ -682,7 +685,10 @@ LL | const _: _ = (1..10).filter(|x| x % 2 == 0).map(|x| x * x); | ^^^^^^^^^^^^^^ | = note: calls in constants are limited to constant functions, tuple structs and tuple variants - = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable +help: add `#![feature(const_trait_impl)]` to the crate attributes to enable + | +LL + #![feature(const_trait_impl)] + | error[E0515]: cannot return reference to function parameter `x` --> $DIR/typeck_type_placeholder_item.rs:50:5 diff --git a/tests/ui/unboxed-closures/unboxed-closure-sugar-region.rs b/tests/ui/unboxed-closures/unboxed-closure-sugar-region.rs index 8537eb71774..ea73b8b3c4a 100644 --- a/tests/ui/unboxed-closures/unboxed-closure-sugar-region.rs +++ b/tests/ui/unboxed-closures/unboxed-closure-sugar-region.rs @@ -33,7 +33,6 @@ fn test2(x: &dyn Foo<(isize,),Output=()>, y: &dyn Foo(isize)) { //~^ ERROR trait takes 1 lifetime argument but 0 lifetime arguments were supplied // Here, the omitted lifetimes are expanded to distinct things. same_type(x, y) - //~^ ERROR borrowed data escapes outside of function } fn main() { } diff --git a/tests/ui/unboxed-closures/unboxed-closure-sugar-region.stderr b/tests/ui/unboxed-closures/unboxed-closure-sugar-region.stderr index 6e6c649ca3d..d73aef851fd 100644 --- a/tests/ui/unboxed-closures/unboxed-closure-sugar-region.stderr +++ b/tests/ui/unboxed-closures/unboxed-closure-sugar-region.stderr @@ -34,22 +34,6 @@ note: trait defined here, with 1 lifetime parameter: `'a` LL | trait Foo<'a,T> { | ^^^ -- -error[E0521]: borrowed data escapes outside of function - --> $DIR/unboxed-closure-sugar-region.rs:35:5 - | -LL | fn test2(x: &dyn Foo<(isize,),Output=()>, y: &dyn Foo(isize)) { - | - - `y` declared here, outside of the function body - | | - | `x` is a reference that is only valid in the function body - | has type `&dyn Foo<'1, (isize,), Output = ()>` -... -LL | same_type(x, y) - | ^^^^^^^^^^^^^^^ - | | - | `x` escapes the function body here - | argument requires that `'1` must outlive `'static` - -error: aborting due to 4 previous errors +error: aborting due to 3 previous errors -Some errors have detailed explanations: E0107, E0521. -For more information about an error, try `rustc --explain E0107`. +For more information about this error, try `rustc --explain E0107`. diff --git a/tests/ui/unboxed-closures/unboxed-closures-type-mismatch-closure-from-another-scope.stderr b/tests/ui/unboxed-closures/unboxed-closures-type-mismatch-closure-from-another-scope.stderr index 1470c32d7de..5f22c781345 100644 --- a/tests/ui/unboxed-closures/unboxed-closures-type-mismatch-closure-from-another-scope.stderr +++ b/tests/ui/unboxed-closures/unboxed-closures-type-mismatch-closure-from-another-scope.stderr @@ -26,11 +26,11 @@ note: closure parameter defined here LL | let mut closure = expect_sig(|p, y| *p = y); | ^ -error[E0425]: cannot find function `deref` in this scope +error[E0423]: expected function, found macro `deref` --> $DIR/unboxed-closures-type-mismatch-closure-from-another-scope.rs:13:5 | LL | deref(p); - | ^^^^^ not found in this scope + | ^^^^^ not a function | help: use the `.` operator to call the method `Deref::deref` on `&&()` | @@ -40,5 +40,5 @@ LL + p.deref(); error: aborting due to 4 previous errors -Some errors have detailed explanations: E0308, E0425. +Some errors have detailed explanations: E0308, E0423, E0425. For more information about an error, try `rustc --explain E0308`. diff --git a/tests/ui/underscore-lifetime/underscore-lifetime-binders.rs b/tests/ui/underscore-lifetime/underscore-lifetime-binders.rs index ebc38798544..3d049cc5639 100644 --- a/tests/ui/underscore-lifetime/underscore-lifetime-binders.rs +++ b/tests/ui/underscore-lifetime/underscore-lifetime-binders.rs @@ -14,7 +14,6 @@ fn meh() -> Box<dyn for<'_> Meh<'_>> //~ ERROR cannot be used here } fn foo2(_: &'_ u8, y: &'_ u8) -> &'_ u8 { y } //~ ERROR missing lifetime specifier -//~^ ERROR lifetime may not live long enough fn main() { let x = 5; diff --git a/tests/ui/underscore-lifetime/underscore-lifetime-binders.stderr b/tests/ui/underscore-lifetime/underscore-lifetime-binders.stderr index 5d2954d1d71..cd74d27dcb5 100644 --- a/tests/ui/underscore-lifetime/underscore-lifetime-binders.stderr +++ b/tests/ui/underscore-lifetime/underscore-lifetime-binders.stderr @@ -45,15 +45,7 @@ help: consider introducing a named lifetime parameter LL | fn foo2<'a>(_: &'a u8, y: &'a u8) -> &'a u8 { y } | ++++ ~~ ~~ ~~ -error: lifetime may not live long enough - --> $DIR/underscore-lifetime-binders.rs:16:43 - | -LL | fn foo2(_: &'_ u8, y: &'_ u8) -> &'_ u8 { y } - | - ^ returning this value requires that `'1` must outlive `'static` - | | - | let's call the lifetime of this reference `'1` - -error: aborting due to 6 previous errors +error: aborting due to 5 previous errors Some errors have detailed explanations: E0106, E0637. For more information about an error, try `rustc --explain E0106`. diff --git a/tests/ui/unop-move-semantics.stderr b/tests/ui/unop-move-semantics.stderr index b6de7976ac9..187dd66b2fe 100644 --- a/tests/ui/unop-move-semantics.stderr +++ b/tests/ui/unop-move-semantics.stderr @@ -9,7 +9,7 @@ LL | LL | x.clone(); | ^ value borrowed here after move | -note: calling this operator moves the left-hand side +note: calling this operator moves the value --> $SRC_DIR/core/src/ops/bit.rs:LL:COL help: consider cloning the value if the performance cost is acceptable | @@ -57,7 +57,7 @@ LL | !*m; | |move occurs because `*m` has type `T`, which does not implement the `Copy` trait | `*m` moved due to usage in operator | -note: calling this operator moves the left-hand side +note: calling this operator moves the value --> $SRC_DIR/core/src/ops/bit.rs:LL:COL error[E0507]: cannot move out of `*n` which is behind a shared reference diff --git a/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122199.rs b/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122199.rs new file mode 100644 index 00000000000..107cfbb9ff6 --- /dev/null +++ b/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122199.rs @@ -0,0 +1,12 @@ +trait Trait<const N: Trait = bar> { +//~^ ERROR cannot find value `bar` in this scope +//~| ERROR cycle detected when computing type of `Trait::N` +//~| ERROR cycle detected when computing type of `Trait::N` +//~| ERROR `(dyn Trait<{const error}> + 'static)` is forbidden as the type of a const generic parameter +//~| WARN trait objects without an explicit `dyn` are deprecated +//~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! + fn fnc(&self) { + } +} + +fn main() {} diff --git a/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122199.stderr b/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122199.stderr new file mode 100644 index 00000000000..2d5a0ede962 --- /dev/null +++ b/tests/ui/wf/ice-hir-wf-check-anon-const-issue-122199.stderr @@ -0,0 +1,60 @@ +error[E0425]: cannot find value `bar` in this scope + --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:1:30 + | +LL | trait Trait<const N: Trait = bar> { + | ^^^ not found in this scope + +warning: trait objects without an explicit `dyn` are deprecated + --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:1:22 + | +LL | trait Trait<const N: Trait = bar> { + | ^^^^^ + | + = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! + = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> + = note: `#[warn(bare_trait_objects)]` on by default +help: if this is an object-safe trait, use `dyn` + | +LL | trait Trait<const N: dyn Trait = bar> { + | +++ + +error[E0391]: cycle detected when computing type of `Trait::N` + --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:1:22 + | +LL | trait Trait<const N: Trait = bar> { + | ^^^^^ + | + = note: ...which immediately requires computing type of `Trait::N` again +note: cycle used when computing explicit predicates of trait `Trait` + --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:1:1 + | +LL | trait Trait<const N: Trait = bar> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information + +error[E0391]: cycle detected when computing type of `Trait::N` + --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:1:13 + | +LL | trait Trait<const N: Trait = bar> { + | ^^^^^^^^^^^^^^^^^^^^ + | + = note: ...which immediately requires computing type of `Trait::N` again +note: cycle used when computing explicit predicates of trait `Trait` + --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:1:1 + | +LL | trait Trait<const N: Trait = bar> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information + +error: `(dyn Trait<{const error}> + 'static)` is forbidden as the type of a const generic parameter + --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:1:22 + | +LL | trait Trait<const N: Trait = bar> { + | ^^^^^ + | + = note: the only supported types are integers, `bool` and `char` + +error: aborting due to 4 previous errors; 1 warning emitted + +Some errors have detailed explanations: E0391, E0425. +For more information about an error, try `rustc --explain E0391`. diff --git a/tests/ui/wf/wf-in-foreign-fn-decls-issue-80468.rs b/tests/ui/wf/wf-in-foreign-fn-decls-issue-80468.rs index 0be5127dcc4..e6d4e2ee01a 100644 --- a/tests/ui/wf/wf-in-foreign-fn-decls-issue-80468.rs +++ b/tests/ui/wf/wf-in-foreign-fn-decls-issue-80468.rs @@ -14,4 +14,5 @@ impl Trait for Ref {} //~ ERROR: implicit elided lifetime not allowed here extern "C" { pub fn repro(_: Wrapper<Ref>); + //~^ ERROR the trait bound `Ref<'_>: Trait` is not satisfied } diff --git a/tests/ui/wf/wf-in-foreign-fn-decls-issue-80468.stderr b/tests/ui/wf/wf-in-foreign-fn-decls-issue-80468.stderr index 0af4ab022e1..59b55b2732d 100644 --- a/tests/ui/wf/wf-in-foreign-fn-decls-issue-80468.stderr +++ b/tests/ui/wf/wf-in-foreign-fn-decls-issue-80468.stderr @@ -9,6 +9,19 @@ help: indicate the anonymous lifetime LL | impl Trait for Ref<'_> {} | ++++ -error: aborting due to 1 previous error +error[E0277]: the trait bound `Ref<'_>: Trait` is not satisfied + --> $DIR/wf-in-foreign-fn-decls-issue-80468.rs:16:21 + | +LL | pub fn repro(_: Wrapper<Ref>); + | ^^^^^^^^^^^^ the trait `Trait` is not implemented for `Ref<'_>` + | +note: required by a bound in `Wrapper` + --> $DIR/wf-in-foreign-fn-decls-issue-80468.rs:8:23 + | +LL | pub struct Wrapper<T: Trait>(T); + | ^^^^^ required by this bound in `Wrapper` + +error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0726`. +Some errors have detailed explanations: E0277, E0726. +For more information about an error, try `rustc --explain E0277`. diff --git a/tests/ui/where-clauses/higher-ranked-fn-type.verbose.stderr b/tests/ui/where-clauses/higher-ranked-fn-type.verbose.stderr index 4cb3cdd69ad..bb99f4ad277 100644 --- a/tests/ui/where-clauses/higher-ranked-fn-type.verbose.stderr +++ b/tests/ui/where-clauses/higher-ranked-fn-type.verbose.stderr @@ -1,8 +1,8 @@ -error[E0277]: the trait bound `for<Region(BrNamed(DefId(0:6 ~ higher_ranked_fn_type[9e51]::called::'b), 'b))> fn(&ReBound(DebruijnIndex(1), BoundRegion { var: 0, kind: BrNamed(DefId(0:6 ~ higher_ranked_fn_type[9e51]::called::'b), 'b) }) ()): Foo` is not satisfied +error[E0277]: the trait bound `for<Region(BrNamed(DefId(0:6 ~ higher_ranked_fn_type[9e51]::called::'b), 'b))> fn(&'^1_0.Named(DefId(0:6 ~ higher_ranked_fn_type[9e51]::called::'b), "'b") ()): Foo` is not satisfied --> $DIR/higher-ranked-fn-type.rs:20:5 | LL | called() - | ^^^^^^^^ the trait `for<Region(BrNamed(DefId(0:6 ~ higher_ranked_fn_type[9e51]::called::'b), 'b))> Foo` is not implemented for `fn(&ReBound(DebruijnIndex(1), BoundRegion { var: 0, kind: BrNamed(DefId(0:6 ~ higher_ranked_fn_type[9e51]::called::'b), 'b) }) ())` + | ^^^^^^^^ the trait `for<Region(BrNamed(DefId(0:6 ~ higher_ranked_fn_type[9e51]::called::'b), 'b))> Foo` is not implemented for `fn(&'^1_0.Named(DefId(0:6 ~ higher_ranked_fn_type[9e51]::called::'b), "'b") ())` | help: this trait has no implementations, consider adding one --> $DIR/higher-ranked-fn-type.rs:6:1 |
