diff --git a/src/test/ui/const-generics/argument_order.full.stderr b/src/test/ui/const-generics/argument_order.full.stderr index 5068fd6d7343..b52e50507033 100644 --- a/src/test/ui/const-generics/argument_order.full.stderr +++ b/src/test/ui/const-generics/argument_order.full.stderr @@ -5,7 +5,7 @@ LL | struct AlsoBad { | -----------------^^-----^^-------------------- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b, const N: usize, T, const M: usize, U>` error[E0747]: lifetime provided when a type was expected - --> $DIR/argument_order.rs:21:23 + --> $DIR/argument_order.rs:20:23 | LL | let _: AlsoBad<7, 'static, u32, 'static, 17, u16>; | ^^^^^^^ diff --git a/src/test/ui/const-generics/argument_order.min.stderr b/src/test/ui/const-generics/argument_order.min.stderr index c3068e0a2313..728ae69b41f1 100644 --- a/src/test/ui/const-generics/argument_order.min.stderr +++ b/src/test/ui/const-generics/argument_order.min.stderr @@ -17,7 +17,7 @@ LL | struct AlsoBad { | ---------------------^----------------------^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, 'b, T, U, const N: usize, const M: usize>` error[E0747]: lifetime provided when a type was expected - --> $DIR/argument_order.rs:21:23 + --> $DIR/argument_order.rs:20:23 | LL | let _: AlsoBad<7, 'static, u32, 'static, 17, u16>; | ^^^^^^^ diff --git a/src/test/ui/const-generics/argument_order.rs b/src/test/ui/const-generics/argument_order.rs index aebf6cc846a6..507baf5fd755 100644 --- a/src/test/ui/const-generics/argument_order.rs +++ b/src/test/ui/const-generics/argument_order.rs @@ -10,15 +10,13 @@ struct Bad { } struct AlsoBad { - //[full]~^ ERROR lifetime parameters must be declared prior - //[min]~^^ ERROR lifetime parameters must be declared prior to const parameters - //[min]~^^^ ERROR type parameters must be declared prior to const parameters + //~^ ERROR lifetime parameters must be declared prior + //[min]~^^ ERROR type parameters must be declared prior to const parameters a: &'a T, b: &'b U, } fn main() { let _: AlsoBad<7, 'static, u32, 'static, 17, u16>; - //[full]~^ ERROR lifetime provided when a type was expected - //[min]~^^ ERROR lifetime provided when a type was expected + //~^ ERROR lifetime provided when a type was expected } diff --git a/src/test/ui/const-generics/const-arg-type-arg-misordered.rs b/src/test/ui/const-generics/const-arg-type-arg-misordered.rs index ce45720ffb0d..6680f772fa3f 100644 --- a/src/test/ui/const-generics/const-arg-type-arg-misordered.rs +++ b/src/test/ui/const-generics/const-arg-type-arg-misordered.rs @@ -6,8 +6,7 @@ type Array = [T; N]; fn foo() -> Array { - //[full]~^ ERROR constant provided when a type was expected - //[min]~^^ ERROR constant provided when a type was expected + //~^ ERROR constant provided when a type was expected unimplemented!() } diff --git a/src/test/ui/const-generics/const-param-before-other-params.min.stderr b/src/test/ui/const-generics/const-param-before-other-params.min.stderr index fc197181deeb..c7e6d1be4216 100644 --- a/src/test/ui/const-generics/const-param-before-other-params.min.stderr +++ b/src/test/ui/const-generics/const-param-before-other-params.min.stderr @@ -5,7 +5,7 @@ LL | fn bar(_: &'a ()) { | --------------^^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, const X: ()>` error: type parameters must be declared prior to const parameters - --> $DIR/const-param-before-other-params.rs:12:21 + --> $DIR/const-param-before-other-params.rs:11:21 | LL | fn foo(_: &T) {} | --------------^- help: reorder the parameters: lifetimes, then types, then consts: `` @@ -20,7 +20,7 @@ LL | fn bar(_: &'a ()) { = note: more complex types are supported with `#[feature(const_generics)]` error: `()` is forbidden as the type of a const generic parameter - --> $DIR/const-param-before-other-params.rs:12:17 + --> $DIR/const-param-before-other-params.rs:11:17 | LL | fn foo(_: &T) {} | ^^ diff --git a/src/test/ui/const-generics/const-param-before-other-params.rs b/src/test/ui/const-generics/const-param-before-other-params.rs index 5b98b6c518db..f1be90cf2e41 100644 --- a/src/test/ui/const-generics/const-param-before-other-params.rs +++ b/src/test/ui/const-generics/const-param-before-other-params.rs @@ -4,9 +4,8 @@ #![cfg_attr(min, feature(min_const_generics))] fn bar(_: &'a ()) { - //[full]~^ ERROR lifetime parameters must be declared prior to const parameters - //[min]~^^ ERROR lifetime parameters must be declared prior to const parameters - //[min]~^^^ ERROR `()` is forbidden as the type of a const generic parameter + //~^ ERROR lifetime parameters must be declared prior to const parameters + //[min]~^^ ERROR `()` is forbidden as the type of a const generic parameter } fn foo(_: &T) {} diff --git a/src/test/ui/const-generics/issues/issue-63322-forbid-dyn.rs b/src/test/ui/const-generics/issues/issue-63322-forbid-dyn.rs index 356652d67aae..2194eb97a410 100644 --- a/src/test/ui/const-generics/issues/issue-63322-forbid-dyn.rs +++ b/src/test/ui/const-generics/issues/issue-63322-forbid-dyn.rs @@ -8,10 +8,8 @@ struct B; impl A for B {} fn test() { - //[full]~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]` to be used - //[min]~^^ ERROR `&'static (dyn A + 'static)` is forbidden as the type of - // a const generic parameter - //[min]~| ERROR must be annotated with `#[derive(PartialEq, Eq)]` to be used + //~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]` to be used + //[min]~^^ ERROR `&'static (dyn A + 'static)` is forbidden unimplemented!() } diff --git a/src/test/ui/const-generics/issues/issue-71169.full.stderr b/src/test/ui/const-generics/issues/issue-71169.full.stderr index e9f312d934ab..b87825d20ce3 100644 --- a/src/test/ui/const-generics/issues/issue-71169.full.stderr +++ b/src/test/ui/const-generics/issues/issue-71169.full.stderr @@ -5,7 +5,7 @@ LL | fn foo() {} | ^^^ the type must not depend on the parameter `LEN` error: constant expression depends on a generic parameter - --> $DIR/issue-71169.rs:12:14 + --> $DIR/issue-71169.rs:11:14 | LL | foo::<4, DATA>(); | ^^^^ diff --git a/src/test/ui/const-generics/issues/issue-71169.rs b/src/test/ui/const-generics/issues/issue-71169.rs index 26cd9f0e31c5..7007ec222caa 100644 --- a/src/test/ui/const-generics/issues/issue-71169.rs +++ b/src/test/ui/const-generics/issues/issue-71169.rs @@ -4,9 +4,8 @@ #![cfg_attr(min, feature(min_const_generics))] fn foo() {} -//[full]~^ ERROR the type of const parameters must not -//[min]~^^ ERROR the type of const parameters must not -//[min]~| ERROR `[u8; _]` is forbidden as the type of a const generic parameter +//~^ ERROR the type of const parameters must not +//[min]~^^ ERROR `[u8; _]` is forbidden as the type of a const generic parameter fn main() { const DATA: [u8; 4] = *b"ABCD"; foo::<4, DATA>(); diff --git a/src/test/ui/const-generics/issues/issue-71381.full.stderr b/src/test/ui/const-generics/issues/issue-71381.full.stderr index 4586a80687a7..453ef00e6dc1 100644 --- a/src/test/ui/const-generics/issues/issue-71381.full.stderr +++ b/src/test/ui/const-generics/issues/issue-71381.full.stderr @@ -5,7 +5,7 @@ LL | pub fn call_me $DIR/issue-71381.rs:26:40 + --> $DIR/issue-71381.rs:24:40 | LL | const FN: unsafe extern "C" fn(Args), | ^^^^ the type must not depend on the parameter `Args` @@ -17,7 +17,7 @@ LL | pub fn call_me $DIR/issue-71381.rs:26:19 + --> $DIR/issue-71381.rs:24:19 | LL | const FN: unsafe extern "C" fn(Args), | ^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/const-generics/issues/issue-71381.min.stderr b/src/test/ui/const-generics/issues/issue-71381.min.stderr index 4586a80687a7..453ef00e6dc1 100644 --- a/src/test/ui/const-generics/issues/issue-71381.min.stderr +++ b/src/test/ui/const-generics/issues/issue-71381.min.stderr @@ -5,7 +5,7 @@ LL | pub fn call_me $DIR/issue-71381.rs:26:40 + --> $DIR/issue-71381.rs:24:40 | LL | const FN: unsafe extern "C" fn(Args), | ^^^^ the type must not depend on the parameter `Args` @@ -17,7 +17,7 @@ LL | pub fn call_me $DIR/issue-71381.rs:26:19 + --> $DIR/issue-71381.rs:24:19 | LL | const FN: unsafe extern "C" fn(Args), | ^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/const-generics/issues/issue-71381.rs b/src/test/ui/const-generics/issues/issue-71381.rs index 3203cf8fe765..65d88e553b9e 100644 --- a/src/test/ui/const-generics/issues/issue-71381.rs +++ b/src/test/ui/const-generics/issues/issue-71381.rs @@ -13,10 +13,8 @@ unsafe extern "C" fn pass(args: PassArg) { impl Test { pub fn call_me(&self) { - //[full]~^ ERROR: using function pointers as const generic parameters is forbidden - //[full]~| ERROR: the type of const parameters must not depend on other generic parameters - //[min]~^^^ ERROR: using function pointers as const generic parameters is forbidden - //[min]~| ERROR: the type of const parameters must not depend on other generic parameters + //~^ ERROR: using function pointers as const generic parameters is forbidden + //~| ERROR: the type of const parameters must not depend on other generic parameters self.0 = Self::trampiline:: as _ } @@ -24,10 +22,8 @@ impl Test { Args: Sized, const IDX: usize, const FN: unsafe extern "C" fn(Args), - //[full]~^ ERROR: using function pointers as const generic parameters is forbidden - //[full]~| ERROR: the type of const parameters must not depend on other generic parameters - //[min]~^^^ ERROR: using function pointers as const generic parameters is forbidden - //[min]~| ERROR: the type of const parameters must not depend on other generic parameters + //~^ ERROR: using function pointers as const generic parameters is forbidden + //~| ERROR: the type of const parameters must not depend on other generic parameters >( args: Args, ) { diff --git a/src/test/ui/const-generics/issues/issue-71382.rs b/src/test/ui/const-generics/issues/issue-71382.rs index e403b0f11991..12a7d08382a3 100644 --- a/src/test/ui/const-generics/issues/issue-71382.rs +++ b/src/test/ui/const-generics/issues/issue-71382.rs @@ -15,8 +15,7 @@ impl Test { } fn test(&self) { - //[full]~^ ERROR: using function pointers as const generic parameters is forbidden - //[min]~^^ ERROR: using function pointers as const generic parameters is forbidden + //~^ ERROR: using function pointers as const generic parameters is forbidden FN(); } } diff --git a/src/test/ui/const-generics/issues/issue-71611.rs b/src/test/ui/const-generics/issues/issue-71611.rs index c9c95902f957..9b8e8be6bc6f 100644 --- a/src/test/ui/const-generics/issues/issue-71611.rs +++ b/src/test/ui/const-generics/issues/issue-71611.rs @@ -4,10 +4,8 @@ #![cfg_attr(min, feature(min_const_generics))] fn func(outer: A) { - //[full]~^ ERROR: using function pointers as const generic parameters is forbidden - //[full]~| ERROR: the type of const parameters must not depend on other generic parameters - //[min]~^^^ ERROR: using function pointers as const generic parameters is forbidden - //[min]~| ERROR: the type of const parameters must not depend on other generic parameters + //~^ ERROR: using function pointers as const generic parameters is forbidden + //~| ERROR: the type of const parameters must not depend on other generic parameters F(outer); } diff --git a/src/test/ui/const-generics/issues/issue-72352.rs b/src/test/ui/const-generics/issues/issue-72352.rs index b723b9dd7157..1517f3dae4ff 100644 --- a/src/test/ui/const-generics/issues/issue-72352.rs +++ b/src/test/ui/const-generics/issues/issue-72352.rs @@ -6,8 +6,7 @@ use std::ffi::{CStr, CString}; unsafe fn unsafely_do_the_thing usize>(ptr: *const i8) -> usize { - //[full]~^ ERROR: using function pointers as const generic parameters is forbidden - //[min]~^^ ERROR: using function pointers as const generic parameters is forbidden + //~^ ERROR: using function pointers as const generic parameters is forbidden F(CStr::from_ptr(ptr)) } diff --git a/src/test/ui/const-generics/issues/issue-73508.rs b/src/test/ui/const-generics/issues/issue-73508.rs index 1032f9389bc0..21b87f7f9014 100644 --- a/src/test/ui/const-generics/issues/issue-73508.rs +++ b/src/test/ui/const-generics/issues/issue-73508.rs @@ -4,7 +4,6 @@ #![cfg_attr(min, feature(min_const_generics))] pub const fn func_name() {} -//[full]~^ ERROR using raw pointers -//[min]~^^ ERROR using raw pointers as const generic parameters is forbidden +//~^ ERROR using raw pointers fn main() {} diff --git a/src/test/ui/const-generics/std/const-generics-range.min.stderr b/src/test/ui/const-generics/std/const-generics-range.min.stderr index 00edcbc53ce4..a71e74420215 100644 --- a/src/test/ui/const-generics/std/const-generics-range.min.stderr +++ b/src/test/ui/const-generics/std/const-generics-range.min.stderr @@ -35,7 +35,7 @@ LL | struct _RangeInclusive>; = note: more complex types are supported with `#[feature(const_generics)]` error: `std::ops::RangeTo` is forbidden as the type of a const generic parameter - --> $DIR/const-generics-range.rs:30:26 + --> $DIR/const-generics-range.rs:29:26 | LL | struct _RangeTo>; | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -44,7 +44,7 @@ LL | struct _RangeTo>; = note: more complex types are supported with `#[feature(const_generics)]` error: `std::ops::RangeToInclusive` is forbidden as the type of a const generic parameter - --> $DIR/const-generics-range.rs:35:35 + --> $DIR/const-generics-range.rs:34:35 | LL | struct _RangeToInclusive>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/const-generics/std/const-generics-range.rs b/src/test/ui/const-generics/std/const-generics-range.rs index 209aa39775d7..c04f4a3acfbb 100644 --- a/src/test/ui/const-generics/std/const-generics-range.rs +++ b/src/test/ui/const-generics/std/const-generics-range.rs @@ -6,35 +6,33 @@ // `Range` should be usable within const generics: struct _Range>; -//[min]~^ ERROR `std::ops::Range` is forbidden as the type of a const generic parameter +//[min]~^ ERROR `std::ops::Range` is forbidden const RANGE : _Range<{ 0 .. 1000 }> = _Range; // `RangeFrom` should be usable within const generics: struct _RangeFrom>; -//[min]~^ ERROR `std::ops::RangeFrom` is forbidden as the type of a const generic parameter +//[min]~^ ERROR `std::ops::RangeFrom` is forbidden const RANGE_FROM : _RangeFrom<{ 0 .. }> = _RangeFrom; // `RangeFull` should be usable within const generics: struct _RangeFull; -//[min]~^ ERROR `std::ops::RangeFull` is forbidden as the type of a const generic parameter +//[min]~^ ERROR `std::ops::RangeFull` is forbidden const RANGE_FULL : _RangeFull<{ .. }> = _RangeFull; // Regression test for #70155 // `RangeInclusive` should be usable within const generics: struct _RangeInclusive>; -//[min]~^ ERROR `std::ops::RangeInclusive` is forbidden as the type of a const generic -// parameter +//[min]~^ ERROR `std::ops::RangeInclusive` is forbidden const RANGE_INCLUSIVE : _RangeInclusive<{ 0 ..= 999 }> = _RangeInclusive; // `RangeTo` should be usable within const generics: struct _RangeTo>; -//[min]~^ ERROR `std::ops::RangeTo` is forbidden as the type of a const generic parameter +//[min]~^ ERROR `std::ops::RangeTo` is forbidden const RANGE_TO : _RangeTo<{ .. 1000 }> = _RangeTo; // `RangeToInclusive` should be usable within const generics: struct _RangeToInclusive>; -//[min]~^ ERROR `std::ops::RangeToInclusive` is forbidden as the type of a const generic -// parameter +//[min]~^ ERROR `std::ops::RangeToInclusive` is forbidden const RANGE_TO_INCLUSIVE : _RangeToInclusive<{ ..= 999 }> = _RangeToInclusive; pub fn main() {} diff --git a/src/test/ui/const-generics/type-dependent/issue-71382.rs b/src/test/ui/const-generics/type-dependent/issue-71382.rs index eb453cd12aaa..497fd1381de7 100644 --- a/src/test/ui/const-generics/type-dependent/issue-71382.rs +++ b/src/test/ui/const-generics/type-dependent/issue-71382.rs @@ -15,8 +15,7 @@ impl Test { } fn test u8>(&self) -> u8 { - //[full]~^ ERROR using function pointers as const generic parameters is forbidden - //[min]~^^ ERROR using function pointers as const generic parameters is forbidden + //~^ ERROR using function pointers as const generic parameters is forbidden FN() } } diff --git a/src/test/ui/const-generics/type-dependent/type-mismatch.rs b/src/test/ui/const-generics/type-dependent/type-mismatch.rs index 4118cbf13d31..67d80973f039 100644 --- a/src/test/ui/const-generics/type-dependent/type-mismatch.rs +++ b/src/test/ui/const-generics/type-dependent/type-mismatch.rs @@ -10,6 +10,5 @@ impl R { } fn main() { assert_eq!(R.method::<1u16>(), 1); - //[full]~^ ERROR mismatched types - //[min]~^^ ERROR mismatched types + //~^ ERROR mismatched types } diff --git a/src/test/ui/const-generics/types-mismatch-const-args.full.stderr b/src/test/ui/const-generics/types-mismatch-const-args.full.stderr index 175fa3004936..265e9ee618be 100644 --- a/src/test/ui/const-generics/types-mismatch-const-args.full.stderr +++ b/src/test/ui/const-generics/types-mismatch-const-args.full.stderr @@ -8,7 +8,7 @@ LL | let _: A<'a, u32, {2u32}, {3u32}> = A::<'a, u32, {4u32}, {3u32}> { data found type `4_u32` error[E0308]: mismatched types - --> $DIR/types-mismatch-const-args.rs:18:41 + --> $DIR/types-mismatch-const-args.rs:17:41 | LL | let _: A<'a, u16, {2u32}, {3u32}> = A::<'b, u32, {2u32}, {3u32}> { data: PhantomData }; | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u16`, found `u32` diff --git a/src/test/ui/const-generics/types-mismatch-const-args.min.stderr b/src/test/ui/const-generics/types-mismatch-const-args.min.stderr index fa2d1a2597fb..27277f0c0bef 100644 --- a/src/test/ui/const-generics/types-mismatch-const-args.min.stderr +++ b/src/test/ui/const-generics/types-mismatch-const-args.min.stderr @@ -10,7 +10,7 @@ LL | let _: A<'a, u32, {2u32}, {3u32}> = A::<'a, u32, {4u32}, {3u32}> { data found struct `A<'_, _, 4_u32, _>` error[E0308]: mismatched types - --> $DIR/types-mismatch-const-args.rs:18:41 + --> $DIR/types-mismatch-const-args.rs:17:41 | LL | let _: A<'a, u16, {2u32}, {3u32}> = A::<'b, u32, {2u32}, {3u32}> { data: PhantomData }; | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u16`, found `u32` diff --git a/src/test/ui/const-generics/types-mismatch-const-args.rs b/src/test/ui/const-generics/types-mismatch-const-args.rs index de2cf73392a1..34b85304cc4d 100644 --- a/src/test/ui/const-generics/types-mismatch-const-args.rs +++ b/src/test/ui/const-generics/types-mismatch-const-args.rs @@ -13,11 +13,9 @@ struct A<'a, T, const X: u32, const Y: u32> { fn a<'a, 'b>() { let _: A<'a, u32, {2u32}, {3u32}> = A::<'a, u32, {4u32}, {3u32}> { data: PhantomData }; - //[full]~^ ERROR mismatched types - //[min]~^^ ERROR mismatched types + //~^ ERROR mismatched types let _: A<'a, u16, {2u32}, {3u32}> = A::<'b, u32, {2u32}, {3u32}> { data: PhantomData }; - //[full]~^ ERROR mismatched types - //[min]~^^ ERROR mismatched types + //~^ ERROR mismatched types } pub fn main() {}