diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs index 1bfe871e14a1e..e52ca4a3c66f6 100644 --- a/compiler/rustc_ast_lowering/src/lib.rs +++ b/compiler/rustc_ast_lowering/src/lib.rs @@ -2379,14 +2379,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { } else { &anon.value }; - let maybe_res = - self.resolver.get_partial_res(expr.id).and_then(|partial_res| partial_res.full_res()); - debug!("res={:?}", maybe_res); - // FIXME(min_generic_const_args): for now we only lower params to ConstArgKind::Path - if let Some(res) = maybe_res - && let Res::Def(DefKind::ConstParam, _) = res - && let ExprKind::Path(qself, path) = &expr.kind - { + if let ExprKind::Path(qself, path) = &expr.kind { let qpath = self.lower_qpath( expr.id, qself, diff --git a/tests/ui/const-generics/bad-generic-in-copy-impl.stderr b/tests/ui/const-generics/bad-generic-in-copy-impl.stderr index fbd546d42fb52..145658d99c2f4 100644 --- a/tests/ui/const-generics/bad-generic-in-copy-impl.stderr +++ b/tests/ui/const-generics/bad-generic-in-copy-impl.stderr @@ -1,17 +1,36 @@ -error[E0308]: mismatched types - --> $DIR/bad-generic-in-copy-impl.rs:3:13 +error: the constant `1` is not of type `usize` + --> $DIR/bad-generic-in-copy-impl.rs:3:8 | LL | x: [u8; SIZE], - | ^^^^ expected `usize`, found `u32` + | ^^^^^^^^^^ expected `usize`, found `u32` -error[E0308]: mismatched types - --> $DIR/bad-generic-in-copy-impl.rs:3:13 +error[E0204]: the trait `Copy` cannot be implemented for this type + --> $DIR/bad-generic-in-copy-impl.rs:1:10 | +LL | #[derive(Copy, Clone)] + | ^^^^ +LL | pub struct Foo { LL | x: [u8; SIZE], - | ^^^^ expected `usize`, found `u32` + | ------------- this field does not implement `Copy` | - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` +note: the `Copy` impl for `[u8; 1]` requires that `the constant `1` has type `usize`` + --> $DIR/bad-generic-in-copy-impl.rs:3:8 + | +LL | x: [u8; SIZE], + | ^^^^^^^^^^ + = note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: the constant `1` is not of type `usize` + --> $DIR/bad-generic-in-copy-impl.rs:3:5 + | +LL | #[derive(Copy, Clone)] + | ----- in this derive macro expansion +LL | pub struct Foo { +LL | x: [u8; SIZE], + | ^^^^^^^^^^^^^ expected `usize`, found `u32` + | + = note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info) -error: aborting due to 2 previous errors +error: aborting due to 3 previous errors -For more information about this error, try `rustc --explain E0308`. +For more information about this error, try `rustc --explain E0204`. 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 18b8996326782..539d840f0a803 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 @@ -14,30 +14,6 @@ LL | pub struct SelfDependent; | = note: const parameters may not be used in the type of const parameters -error: `[u8; N]` is forbidden as the type of a const generic parameter - --> $DIR/const-param-type-depends-on-const-param.rs:11:47 - | -LL | pub struct Dependent([(); 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 - | -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 - | -LL | pub struct SelfDependent; - | ^^^^^^^ - | - = 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 - | -LL + #![feature(adt_const_params)] - | - -error: aborting due to 4 previous errors +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0770`. diff --git a/tests/ui/const-generics/fn-const-param-infer.adt_const_params.stderr b/tests/ui/const-generics/fn-const-param-infer.adt_const_params.stderr index f5978d6ebc361..55f9ac1226930 100644 --- a/tests/ui/const-generics/fn-const-param-infer.adt_const_params.stderr +++ b/tests/ui/const-generics/fn-const-param-infer.adt_const_params.stderr @@ -4,16 +4,6 @@ error[E0741]: using function pointers as const generic parameters is forbidden LL | struct Checked bool>; | ^^^^^^^^^^^^^^^^^ -error[E0308]: mismatched types - --> $DIR/fn-const-param-infer.rs:33:25 - | -LL | let _ = Checked::<{ generic_arg:: }>; - | ^^^^^^^^^^^^^^^^^^ expected fn pointer, found fn item - | - = note: expected fn pointer `fn(usize) -> _` - found fn item `fn(u32) -> _ {generic_arg::}` - -error: aborting due to 2 previous errors +error: aborting due to 1 previous error -Some errors have detailed explanations: E0308, E0741. -For more information about an error, try `rustc --explain E0308`. +For more information about this error, try `rustc --explain E0741`. diff --git a/tests/ui/const-generics/fn-const-param-infer.full.stderr b/tests/ui/const-generics/fn-const-param-infer.full.stderr index f5978d6ebc361..55f9ac1226930 100644 --- a/tests/ui/const-generics/fn-const-param-infer.full.stderr +++ b/tests/ui/const-generics/fn-const-param-infer.full.stderr @@ -4,16 +4,6 @@ error[E0741]: using function pointers as const generic parameters is forbidden LL | struct Checked bool>; | ^^^^^^^^^^^^^^^^^ -error[E0308]: mismatched types - --> $DIR/fn-const-param-infer.rs:33:25 - | -LL | let _ = Checked::<{ generic_arg:: }>; - | ^^^^^^^^^^^^^^^^^^ expected fn pointer, found fn item - | - = note: expected fn pointer `fn(usize) -> _` - found fn item `fn(u32) -> _ {generic_arg::}` - -error: aborting due to 2 previous errors +error: aborting due to 1 previous error -Some errors have detailed explanations: E0308, E0741. -For more information about an error, try `rustc --explain E0308`. +For more information about this error, try `rustc --explain E0741`. diff --git a/tests/ui/const-generics/fn-const-param-infer.min.stderr b/tests/ui/const-generics/fn-const-param-infer.min.stderr index f5da6af9383e4..93a9fba42e8e6 100644 --- a/tests/ui/const-generics/fn-const-param-infer.min.stderr +++ b/tests/ui/const-generics/fn-const-param-infer.min.stderr @@ -6,15 +6,5 @@ LL | struct Checked bool>; | = note: the only supported types are integers, `bool`, and `char` -error[E0308]: mismatched types - --> $DIR/fn-const-param-infer.rs:33:25 - | -LL | let _ = Checked::<{ generic_arg:: }>; - | ^^^^^^^^^^^^^^^^^^ expected fn pointer, found fn item - | - = note: expected fn pointer `fn(usize) -> _` - found fn item `fn(u32) -> _ {generic_arg::}` - -error: aborting due to 2 previous errors +error: aborting due to 1 previous error -For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/const-generics/generic_const_exprs/error_in_ty.stderr b/tests/ui/const-generics/generic_const_exprs/error_in_ty.stderr index d822fa5894a5b..6de36a12665a6 100644 --- a/tests/ui/const-generics/generic_const_exprs/error_in_ty.stderr +++ b/tests/ui/const-generics/generic_const_exprs/error_in_ty.stderr @@ -6,30 +6,6 @@ LL | pub struct A {} | | | similarly named const parameter `z` defined here -error: `[usize; x]` is forbidden as the type of a const generic parameter - --> $DIR/error_in_ty.rs:6:23 - | -LL | pub struct 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 - | -LL + #![feature(adt_const_params)] - | - -error[E0308]: mismatched types - --> $DIR/error_in_ty.rs:10:8 - | -LL | impl A<2> { - | ^ expected `[usize; x]`, found integer - -error[E0308]: mismatched types - --> $DIR/error_in_ty.rs:16:8 - | -LL | impl A<2> { - | ^ expected `[usize; x]`, found integer - error[E0592]: duplicate definitions with name `B` --> $DIR/error_in_ty.rs:12:5 | @@ -39,7 +15,7 @@ LL | pub const fn B() {} LL | pub const fn B() {} | ---------------- other definition for `B` -error: aborting due to 5 previous errors +error: aborting due to 2 previous errors -Some errors have detailed explanations: E0308, E0425, E0592. -For more information about an error, try `rustc --explain E0308`. +Some errors have detailed explanations: E0425, E0592. +For more information about an error, try `rustc --explain E0425`. diff --git a/tests/ui/const-generics/generic_const_exprs/issue-62504.full.stderr b/tests/ui/const-generics/generic_const_exprs/issue-62504.full.stderr index 3739637c27951..351b5b06b7bcd 100644 --- a/tests/ui/const-generics/generic_const_exprs/issue-62504.full.stderr +++ b/tests/ui/const-generics/generic_const_exprs/issue-62504.full.stderr @@ -1,23 +1,3 @@ -error[E0308]: mismatched types - --> $DIR/issue-62504.rs:18:21 - | -LL | ArrayHolder([0; Self::SIZE]) - | ^^^^^^^^^^^^^^^ expected `X`, found `Self::SIZE` - | - = note: expected constant `X` - found constant `Self::SIZE` - -error: unconstrained generic constant - --> $DIR/issue-62504.rs:18:25 - | -LL | ArrayHolder([0; Self::SIZE]) - | ^^^^^^^^^^ - | -help: try adding a `where` bound - | -LL | pub const fn new() -> Self where [(); Self::SIZE]: { - | +++++++++++++++++++++++ - error[E0284]: type annotations needed for `ArrayHolder<_>` --> $DIR/issue-62504.rs:26:9 | @@ -52,7 +32,6 @@ help: consider giving `array` an explicit type, where the value of const paramet LL | let mut array: ArrayHolder = ArrayHolder::new(); | ++++++++++++++++ -error: aborting due to 4 previous errors +error: aborting due to 2 previous errors -Some errors have detailed explanations: E0284, E0308. -For more information about an error, try `rustc --explain E0284`. +For more information about this error, try `rustc --explain E0284`. diff --git a/tests/ui/const-generics/generic_const_exprs/issue-62504.min.stderr b/tests/ui/const-generics/generic_const_exprs/issue-62504.min.stderr index 14c67e2528a73..351b5b06b7bcd 100644 --- a/tests/ui/const-generics/generic_const_exprs/issue-62504.min.stderr +++ b/tests/ui/const-generics/generic_const_exprs/issue-62504.min.stderr @@ -1,27 +1,3 @@ -error: constant expression depends on a generic parameter - --> $DIR/issue-62504.rs:18:25 - | -LL | ArrayHolder([0; Self::SIZE]) - | ^^^^^^^^^^ - | - = note: this may fail depending on what value the parameter takes - -error[E0308]: mismatched types - --> $DIR/issue-62504.rs:18:21 - | -LL | ArrayHolder([0; Self::SIZE]) - | ----------- ^^^^^^^^^^^^^^^ expected `X`, found `Self::SIZE` - | | - | arguments to this struct are incorrect - | - = note: expected array `[u32; X]` - found array `[u32; Self::SIZE]` -note: tuple struct defined here - --> $DIR/issue-62504.rs:14:8 - | -LL | struct ArrayHolder([u32; X]); - | ^^^^^^^^^^^ - error[E0284]: type annotations needed for `ArrayHolder<_>` --> $DIR/issue-62504.rs:26:9 | @@ -56,7 +32,6 @@ help: consider giving `array` an explicit type, where the value of const paramet LL | let mut array: ArrayHolder = ArrayHolder::new(); | ++++++++++++++++ -error: aborting due to 4 previous errors +error: aborting due to 2 previous errors -Some errors have detailed explanations: E0284, E0308. -For more information about an error, try `rustc --explain E0284`. +For more information about this error, try `rustc --explain E0284`. diff --git a/tests/ui/const-generics/generic_const_exprs/unknown-alias-defkind-anonconst-ice-116710.stderr b/tests/ui/const-generics/generic_const_exprs/unknown-alias-defkind-anonconst-ice-116710.stderr index 80ac96d487000..e29c49ff0422c 100644 --- a/tests/ui/const-generics/generic_const_exprs/unknown-alias-defkind-anonconst-ice-116710.stderr +++ b/tests/ui/const-generics/generic_const_exprs/unknown-alias-defkind-anonconst-ice-116710.stderr @@ -4,16 +4,6 @@ error[E0423]: expected value, found builtin type `u8` LL | struct A; | ^^ not a value -error[E0119]: conflicting implementations of trait `Trait` for type `A<_>` - --> $DIR/unknown-alias-defkind-anonconst-ice-116710.rs:12:1 - | -LL | impl Trait for A {} - | --------------------------------- first implementation here -LL | -LL | impl Trait for A {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `A<_>` - -error: aborting due to 2 previous errors +error: aborting due to 1 previous error -Some errors have detailed explanations: E0119, E0423. -For more information about an error, try `rustc --explain E0119`. +For more information about this error, try `rustc --explain E0423`. diff --git a/tests/ui/const-generics/issues/issue-62878.min.stderr b/tests/ui/const-generics/issues/issue-62878.min.stderr index bd17d70a50ba5..b3039fe2fbfe7 100644 --- a/tests/ui/const-generics/issues/issue-62878.min.stderr +++ b/tests/ui/const-generics/issues/issue-62878.min.stderr @@ -6,18 +6,6 @@ LL | fn foo() {} | = note: const parameters may not be used in the type of const parameters -error: `[u8; N]` is forbidden as the type of a const generic parameter - --> $DIR/issue-62878.rs:5:33 - | -LL | fn foo() {} - | ^^^^^^^ - | - = 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 - | -LL + #![feature(adt_const_params)] - | - error[E0747]: type provided when a constant was expected --> $DIR/issue-62878.rs:10:11 | @@ -30,7 +18,7 @@ help: add `#![feature(generic_arg_infer)]` to the crate attributes to enable LL + #![feature(generic_arg_infer)] | -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors Some errors have detailed explanations: E0747, E0770. For more information about an error, try `rustc --explain E0747`. diff --git a/tests/ui/const-generics/issues/issue-71169.min.stderr b/tests/ui/const-generics/issues/issue-71169.min.stderr index 2ecbc3379516b..9553be6fc07c7 100644 --- a/tests/ui/const-generics/issues/issue-71169.min.stderr +++ b/tests/ui/const-generics/issues/issue-71169.min.stderr @@ -6,18 +6,6 @@ LL | fn foo() {} | = note: const parameters may not be used in the type of const parameters -error: `[u8; LEN]` is forbidden as the type of a const generic parameter - --> $DIR/issue-71169.rs:5:38 - | -LL | fn foo() {} - | ^^^^^^^^^ - | - = 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 - | -LL + #![feature(adt_const_params)] - | - -error: aborting due to 2 previous errors +error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0770`. diff --git a/tests/ui/const-generics/not_wf_param_in_rpitit.stderr b/tests/ui/const-generics/not_wf_param_in_rpitit.stderr index ade40550c7389..18aa49d3bb46e 100644 --- a/tests/ui/const-generics/not_wf_param_in_rpitit.stderr +++ b/tests/ui/const-generics/not_wf_param_in_rpitit.stderr @@ -18,29 +18,6 @@ LL | trait Trait { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = 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[E0038]: the trait `Trait` cannot be made into an object - --> $DIR/not_wf_param_in_rpitit.rs:3:22 - | -LL | trait Trait { - | ^^^^^ `Trait` cannot be made into an object - | -note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit - --> $DIR/not_wf_param_in_rpitit.rs:10:14 - | -LL | trait Trait { - | ----- this trait cannot be made into an object... -... -LL | async fn a() {} - | ^ ...because associated function `a` has no `self` parameter -help: consider turning `a` into a method by giving it a `&self` argument - | -LL | async fn a(&self) {} - | +++++ -help: alternatively, consider constraining `a` so it does not apply to trait objects - | -LL | async fn a() where Self: Sized {} - | +++++++++++++++++ - error[E0038]: the trait `Trait` cannot be made into an object --> $DIR/not_wf_param_in_rpitit.rs:3:13 | @@ -99,7 +76,7 @@ help: add `dyn` keyword before this trait LL | trait Trait { | +++ -error: aborting due to 6 previous errors +error: aborting due to 5 previous errors Some errors have detailed explanations: E0038, E0391, E0425, E0782. For more information about an error, try `rustc --explain E0038`. diff --git a/tests/ui/consts/const-len-underflow-separate-spans.old.stderr b/tests/ui/consts/const-len-underflow-separate-spans.old.stderr index bd2a81f514830..59fb30400dc0b 100644 --- a/tests/ui/consts/const-len-underflow-separate-spans.old.stderr +++ b/tests/ui/consts/const-len-underflow-separate-spans.old.stderr @@ -4,12 +4,6 @@ error[E0080]: evaluation of constant value failed LL | const LEN: usize = ONE - TWO; | ^^^^^^^^^ attempt to compute `1_usize - 2_usize`, which would overflow -note: erroneous constant encountered - --> $DIR/const-len-underflow-separate-spans.rs:14:17 - | -LL | let a: [i8; LEN] = unimplemented!(); - | ^^^ - error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0080`. diff --git a/tests/ui/consts/issue-39974.stderr b/tests/ui/consts/issue-39974.stderr index a371ea5709e1b..928c2e33ad4b1 100644 --- a/tests/ui/consts/issue-39974.stderr +++ b/tests/ui/consts/issue-39974.stderr @@ -9,12 +9,6 @@ help: use a float literal LL | const LENGTH: f64 = 2.0; | ++ -error[E0308]: mismatched types - --> $DIR/issue-39974.rs:5:19 - | -LL | f: [[f64; 2]; LENGTH], - | ^^^^^^ expected `usize`, found `f64` - -error: aborting due to 2 previous errors +error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/extern/extern-static-size-overflow.stderr b/tests/ui/extern/extern-static-size-overflow.stderr index c6490e96a8e6f..0be74e7fb78f0 100644 --- a/tests/ui/extern/extern-static-size-overflow.stderr +++ b/tests/ui/extern/extern-static-size-overflow.stderr @@ -4,17 +4,5 @@ error: extern static is too large for the target architecture LL | static BAZ: [u8; max_size()]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: extern static is too large for the target architecture - --> $DIR/extern-static-size-overflow.rs:21:5 - | -LL | static UWU: [usize; usize::MAX]; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: extern static is too large for the target architecture - --> $DIR/extern-static-size-overflow.rs:22:5 - | -LL | static A: ReallyBig; - | ^^^^^^^^^^^^^^^^^^^ - -error: aborting due to 3 previous errors +error: aborting due to 1 previous error diff --git a/tests/ui/lint/unused/must_use-array.stderr b/tests/ui/lint/unused/must_use-array.stderr index 61ef2088d30e5..3c17e717470a6 100644 --- a/tests/ui/lint/unused/must_use-array.stderr +++ b/tests/ui/lint/unused/must_use-array.stderr @@ -16,12 +16,6 @@ error: unused array of `S` that must be used LL | many(); | ^^^^^^ -error: unused array of `S` in tuple element 0 that must be used - --> $DIR/must_use-array.rs:46:6 - | -LL | ([S], 0, ()); - | ^^^ - error: unused array of implementers of `T` that must be used --> $DIR/must_use-array.rs:47:5 | @@ -40,11 +34,5 @@ error: unused array of arrays of arrays of `S` that must be used LL | array_of_arrays_of_arrays(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: unused array of `S` that must be used - --> $DIR/must_use-array.rs:52:5 - | -LL | usize_max(); - | ^^^^^^^^^^^ - -error: aborting due to 7 previous errors +error: aborting due to 5 previous errors diff --git a/tests/ui/simd/array-trait.stderr b/tests/ui/simd/array-trait.stderr index a63dbf37959f8..adacd12634c88 100644 --- a/tests/ui/simd/array-trait.stderr +++ b/tests/ui/simd/array-trait.stderr @@ -1,30 +1,9 @@ -error: unconstrained generic constant - --> $DIR/array-trait.rs:23:23 - | -LL | pub struct T([S::Lane; S::SIZE]); - | ^^^^^^^^^^^^^^^^^^ - | -help: try adding a `where` bound - | -LL | pub struct T([S::Lane; S::SIZE]) where [(); S::SIZE]:; - | ++++++++++++++++++++ - error[E0077]: SIMD vector element type should be a primitive scalar (integer/float/pointer) type --> $DIR/array-trait.rs:23:1 | LL | pub struct T([S::Lane; S::SIZE]); | ^^^^^^^^^^^^^^^^^^^^^ -error: unconstrained generic constant - --> $DIR/array-trait.rs:23:23 - | -LL | #[derive(Copy, Clone)] - | ----- in this derive macro expansion -LL | pub struct T([S::Lane; S::SIZE]); - | ^^^^^^^^^^^^^^^^^^ - | - = note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: aborting due to 3 previous errors +error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0077`. diff --git a/tests/ui/transmutability/arrays/huge-len.stderr b/tests/ui/transmutability/arrays/huge-len.stderr index 2f8a86df0a7e3..a5805b506db9c 100644 --- a/tests/ui/transmutability/arrays/huge-len.stderr +++ b/tests/ui/transmutability/arrays/huge-len.stderr @@ -2,7 +2,7 @@ error[E0277]: `()` cannot be safely transmuted into `ExplicitlyPadded` --> $DIR/huge-len.rs:21:41 | LL | assert::is_maybe_transmutable::<(), ExplicitlyPadded>(); - | ^^^^^^^^^^^^^^^^ values of the type `ExplicitlyPadded` are too big for the target architecture + | ^^^^^^^^^^^^^^^^ `ExplicitlyPadded` has an unknown layout | note: required by a bound in `is_maybe_transmutable` --> $DIR/huge-len.rs:8:14 @@ -17,7 +17,7 @@ error[E0277]: `ExplicitlyPadded` cannot be safely transmuted into `()` --> $DIR/huge-len.rs:24:55 | LL | assert::is_maybe_transmutable::(); - | ^^ values of the type `ExplicitlyPadded` are too big for the target architecture + | ^^ `ExplicitlyPadded` has an unknown layout | note: required by a bound in `is_maybe_transmutable` --> $DIR/huge-len.rs:8:14 diff --git a/tests/ui/transmutability/references/reject_lifetime_extension.stderr b/tests/ui/transmutability/references/reject_lifetime_extension.stderr index a597041c6cac2..174bbd8806148 100644 --- a/tests/ui/transmutability/references/reject_lifetime_extension.stderr +++ b/tests/ui/transmutability/references/reject_lifetime_extension.stderr @@ -1,59 +1,3 @@ -error: lifetime may not live long enough - --> $DIR/reject_lifetime_extension.rs:20:18 - | -LL | fn extend_bare<'a>(src: &'a u8) -> &'static u8 { - | -- lifetime `'a` defined here -LL | unsafe { transmute(src) } - | ^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static` - -error: lifetime may not live long enough - --> $DIR/reject_lifetime_extension.rs:28:18 - | -LL | fn extend_nested<'a>(src: &'a &'a u8) -> &'a &'static u8 { - | -- lifetime `'a` defined here -LL | unsafe { transmute(src) } - | ^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static` - -error: lifetime may not live long enough - --> $DIR/reject_lifetime_extension.rs:36:18 - | -LL | fn extend_unit<'a>(src: (&'a u8,)) -> (&'static u8,) { - | -- lifetime `'a` defined here -LL | unsafe { transmute(src) } - | ^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static` - -error: lifetime may not live long enough - --> $DIR/reject_lifetime_extension.rs:40:18 - | -LL | fn extend_pair<'a>(src: (&'a u8, u8)) -> (&'static u8, u8) { - | -- lifetime `'a` defined here -LL | unsafe { transmute(src) } - | ^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static` - -error: lifetime may not live long enough - --> $DIR/reject_lifetime_extension.rs:50:18 - | -LL | fn extend_struct<'a>(src: Struct<'a>) -> Struct<'static> { - | -- lifetime `'a` defined here -LL | unsafe { transmute(src) } - | ^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static` - -error: lifetime may not live long enough - --> $DIR/reject_lifetime_extension.rs:62:18 - | -LL | fn extend_single<'a>(src: Single<'a>) -> Single<'static> { - | -- lifetime `'a` defined here -LL | unsafe { transmute(src) } - | ^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static` - -error: lifetime may not live long enough - --> $DIR/reject_lifetime_extension.rs:72:18 - | -LL | fn extend_multi<'a>(src: Multi<'a>) -> Multi<'static> { - | -- lifetime `'a` defined here -LL | unsafe { transmute(src) } - | ^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static` - error[E0521]: borrowed data escapes outside of function --> $DIR/reject_lifetime_extension.rs:80:18 | @@ -73,6 +17,6 @@ note: due to current limitations in the borrow checker, this implies a `'static` LL | for<'b> &'b u8: TransmuteFrom<&'a u8>, | ^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 8 previous errors +error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0521`. 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 index fefb788fac79c..0cec23d59f569 100644 --- 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 @@ -85,36 +85,6 @@ help: if this is a dyn-compatible trait, use `dyn` LL | fn fnc(&self) -> dyn Trait { | +++ -warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:1:22 - | -LL | trait Trait { - | ^^^^^ - | - = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -help: if this is a dyn-compatible trait, use `dyn` - | -LL | trait Trait { - | +++ - -error[E0038]: the trait `Trait` cannot be made into an object - --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:1:22 - | -LL | trait Trait { - | ^^^^^ `Trait` cannot be made into an object - | -note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit - --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:11:8 - | -LL | trait Trait { - | ----- this trait cannot be made into an object... -... -LL | fn fnc(&self) -> Trait { - | ^^^ ...because method `fnc` has generic type parameters - = help: consider moving `fnc` to another trait - error[E0038]: the trait `Trait` cannot be made into an object --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:1:13 | @@ -145,36 +115,6 @@ help: you might have meant to use `Self` to refer to the implementing type LL | fn fnc(&self) -> Self { | ~~~~ -warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:11:21 - | -LL | fn fnc(&self) -> Trait { - | ^^^^^ - | - = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -help: if this is a dyn-compatible trait, use `dyn` - | -LL | fn fnc(&self) -> Trait { - | +++ - -error[E0038]: the trait `Trait` cannot be made into an object - --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:11:21 - | -LL | fn fnc(&self) -> Trait { - | ^^^^^ `Trait` cannot be made into an object - | -note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit - --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:11:8 - | -LL | trait Trait { - | ----- this trait cannot be made into an object... -... -LL | fn fnc(&self) -> Trait { - | ^^^ ...because method `fnc` has generic type parameters - = help: consider moving `fnc` to another trait - error[E0038]: the trait `Trait` cannot be made into an object --> $DIR/ice-hir-wf-check-anon-const-issue-122199.rs:1:13 | @@ -192,7 +132,7 @@ LL | fn fnc(&self) -> Trait { = help: consider moving `fnc` to another trait = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -error: aborting due to 11 previous errors; 5 warnings emitted +error: aborting due to 9 previous errors; 3 warnings emitted Some errors have detailed explanations: E0038, E0391, E0403, E0423, E0425. For more information about an error, try `rustc --explain E0038`.