diff --git a/compiler/rustc_parse/src/parser/ty.rs b/compiler/rustc_parse/src/parser/ty.rs index f181097813dba..d874a071ceef1 100644 --- a/compiler/rustc_parse/src/parser/ty.rs +++ b/compiler/rustc_parse/src/parser/ty.rs @@ -1071,7 +1071,7 @@ impl<'a> Parser<'a> { && self.look_ahead(1, |t| t.is_keyword(kw::Const)) && self.look_ahead(2, |t| *t == token::CloseBracket) { - let start = self.prev_token.span; + let start = self.token.span; self.bump(); self.expect_keyword(exp!(Const)).unwrap(); self.bump(); diff --git a/tests/ui/consts/fn_trait_refs.stderr b/tests/ui/consts/fn_trait_refs.stderr index ee716c932e832..445dd75f8249b 100644 --- a/tests/ui/consts/fn_trait_refs.stderr +++ b/tests/ui/consts/fn_trait_refs.stderr @@ -5,145 +5,145 @@ LL | #![feature(const_fn_trait_ref_impls)] | ^^^^^^^^^^^^^^^^^^^^^^^^ error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:14:6 + --> $DIR/fn_trait_refs.rs:14:8 | LL | T: [const] Fn<()> + [const] Destruct, - | ^^^^^^^^^ can't be applied to `Fn` + | ^^^^^^^ can't be applied to `Fn` | note: `Fn` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/ops/function.rs:LL:COL error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:14:6 + --> $DIR/fn_trait_refs.rs:14:8 | LL | T: [const] Fn<()> + [const] Destruct, - | ^^^^^^^^^ can't be applied to `Fn` + | ^^^^^^^ can't be applied to `Fn` | note: `Fn` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/ops/function.rs:LL:COL = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:14:6 + --> $DIR/fn_trait_refs.rs:14:8 | LL | T: [const] Fn<()> + [const] Destruct, - | ^^^^^^^^^ can't be applied to `Fn` + | ^^^^^^^ can't be applied to `Fn` | note: `Fn` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/ops/function.rs:LL:COL = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:21:6 + --> $DIR/fn_trait_refs.rs:21:8 | LL | T: [const] FnMut<()> + [const] Destruct, - | ^^^^^^^^^ can't be applied to `FnMut` + | ^^^^^^^ can't be applied to `FnMut` | note: `FnMut` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/ops/function.rs:LL:COL error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:21:6 + --> $DIR/fn_trait_refs.rs:21:8 | LL | T: [const] FnMut<()> + [const] Destruct, - | ^^^^^^^^^ can't be applied to `FnMut` + | ^^^^^^^ can't be applied to `FnMut` | note: `FnMut` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/ops/function.rs:LL:COL = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:21:6 + --> $DIR/fn_trait_refs.rs:21:8 | LL | T: [const] FnMut<()> + [const] Destruct, - | ^^^^^^^^^ can't be applied to `FnMut` + | ^^^^^^^ can't be applied to `FnMut` | note: `FnMut` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/ops/function.rs:LL:COL = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:28:6 + --> $DIR/fn_trait_refs.rs:28:8 | LL | T: [const] FnOnce<()>, - | ^^^^^^^^^ can't be applied to `FnOnce` + | ^^^^^^^ can't be applied to `FnOnce` | note: `FnOnce` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/ops/function.rs:LL:COL error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:28:6 + --> $DIR/fn_trait_refs.rs:28:8 | LL | T: [const] FnOnce<()>, - | ^^^^^^^^^ can't be applied to `FnOnce` + | ^^^^^^^ can't be applied to `FnOnce` | note: `FnOnce` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/ops/function.rs:LL:COL = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:28:6 + --> $DIR/fn_trait_refs.rs:28:8 | LL | T: [const] FnOnce<()>, - | ^^^^^^^^^ can't be applied to `FnOnce` + | ^^^^^^^ can't be applied to `FnOnce` | note: `FnOnce` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/ops/function.rs:LL:COL = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:35:6 + --> $DIR/fn_trait_refs.rs:35:8 | LL | T: [const] Fn<()> + [const] Destruct, - | ^^^^^^^^^ can't be applied to `Fn` + | ^^^^^^^ can't be applied to `Fn` | note: `Fn` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/ops/function.rs:LL:COL error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:35:6 + --> $DIR/fn_trait_refs.rs:35:8 | LL | T: [const] Fn<()> + [const] Destruct, - | ^^^^^^^^^ can't be applied to `Fn` + | ^^^^^^^ can't be applied to `Fn` | note: `Fn` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/ops/function.rs:LL:COL = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:35:6 + --> $DIR/fn_trait_refs.rs:35:8 | LL | T: [const] Fn<()> + [const] Destruct, - | ^^^^^^^^^ can't be applied to `Fn` + | ^^^^^^^ can't be applied to `Fn` | note: `Fn` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/ops/function.rs:LL:COL = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:49:6 + --> $DIR/fn_trait_refs.rs:49:8 | LL | T: [const] FnMut<()> + [const] Destruct, - | ^^^^^^^^^ can't be applied to `FnMut` + | ^^^^^^^ can't be applied to `FnMut` | note: `FnMut` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/ops/function.rs:LL:COL error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:49:6 + --> $DIR/fn_trait_refs.rs:49:8 | LL | T: [const] FnMut<()> + [const] Destruct, - | ^^^^^^^^^ can't be applied to `FnMut` + | ^^^^^^^ can't be applied to `FnMut` | note: `FnMut` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/ops/function.rs:LL:COL = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/fn_trait_refs.rs:49:6 + --> $DIR/fn_trait_refs.rs:49:8 | LL | T: [const] FnMut<()> + [const] Destruct, - | ^^^^^^^^^ can't be applied to `FnMut` + | ^^^^^^^ can't be applied to `FnMut` | note: `FnMut` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/ops/function.rs:LL:COL diff --git a/tests/ui/consts/unstable-const-fn-in-libcore.stderr b/tests/ui/consts/unstable-const-fn-in-libcore.stderr index b43fa1f7e6c35..95e48b7b7c803 100644 --- a/tests/ui/consts/unstable-const-fn-in-libcore.stderr +++ b/tests/ui/consts/unstable-const-fn-in-libcore.stderr @@ -1,17 +1,17 @@ error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/unstable-const-fn-in-libcore.rs:19:30 + --> $DIR/unstable-const-fn-in-libcore.rs:19:32 | LL | const fn unwrap_or_else T>(self, f: F) -> T { - | ^^^^^^^^^ can't be applied to `FnOnce` + | ^^^^^^^ can't be applied to `FnOnce` | note: `FnOnce` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/ops/function.rs:LL:COL error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/unstable-const-fn-in-libcore.rs:19:30 + --> $DIR/unstable-const-fn-in-libcore.rs:19:32 | LL | const fn unwrap_or_else T>(self, f: F) -> T { - | ^^^^^^^^^ can't be applied to `FnOnce` + | ^^^^^^^ can't be applied to `FnOnce` | note: `FnOnce` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/ops/function.rs:LL:COL diff --git a/tests/ui/impl-trait/normalize-tait-in-const.stderr b/tests/ui/impl-trait/normalize-tait-in-const.stderr index 01427c78dd982..e17737d1860a1 100644 --- a/tests/ui/impl-trait/normalize-tait-in-const.stderr +++ b/tests/ui/impl-trait/normalize-tait-in-const.stderr @@ -1,17 +1,17 @@ error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/normalize-tait-in-const.rs:27:33 + --> $DIR/normalize-tait-in-const.rs:27:35 | LL | const fn with_positive [const] Fn(&'a Alias<'a>) + [const] Destruct>(fun: F) { - | ^^^^^^^^^ can't be applied to `Fn` + | ^^^^^^^ can't be applied to `Fn` | note: `Fn` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/ops/function.rs:LL:COL error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/normalize-tait-in-const.rs:27:33 + --> $DIR/normalize-tait-in-const.rs:27:35 | LL | const fn with_positive [const] Fn(&'a Alias<'a>) + [const] Destruct>(fun: F) { - | ^^^^^^^^^ can't be applied to `Fn` + | ^^^^^^^ can't be applied to `Fn` | note: `Fn` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/ops/function.rs:LL:COL diff --git a/tests/ui/parser/bounds-type.stderr b/tests/ui/parser/bounds-type.stderr index 0d929c76f0276..7c3e92a50dadc 100644 --- a/tests/ui/parser/bounds-type.stderr +++ b/tests/ui/parser/bounds-type.stderr @@ -21,10 +21,10 @@ LL | T: [const] ?Tr, | there is not a well-defined meaning for a `[const] ?` trait error: `[const]` may only modify trait bounds, not lifetime bounds - --> $DIR/bounds-type.rs:16:6 + --> $DIR/bounds-type.rs:16:8 | LL | T: [const] 'a, - | ^^^^^^^^^ + | ^^^^^^^ error: `const` may only modify trait bounds, not lifetime bounds --> $DIR/bounds-type.rs:17:8 diff --git a/tests/ui/specialization/const_trait_impl.stderr b/tests/ui/specialization/const_trait_impl.stderr index d36a0a1c2dc8f..ea3ec16ac1eb0 100644 --- a/tests/ui/specialization/const_trait_impl.stderr +++ b/tests/ui/specialization/const_trait_impl.stderr @@ -1,55 +1,55 @@ error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/const_trait_impl.rs:34:7 + --> $DIR/const_trait_impl.rs:34:9 | LL | impl const A for T { - | ^^^^^^^^^ can't be applied to `Default` + | ^^^^^^^ can't be applied to `Default` | note: `Default` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/default.rs:LL:COL error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/const_trait_impl.rs:40:7 + --> $DIR/const_trait_impl.rs:40:9 | LL | impl const A for T { - | ^^^^^^^^^ can't be applied to `Default` + | ^^^^^^^ can't be applied to `Default` | note: `Default` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/default.rs:LL:COL error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/const_trait_impl.rs:46:7 + --> $DIR/const_trait_impl.rs:46:9 | LL | impl const A for T { - | ^^^^^^^^^ can't be applied to `Default` + | ^^^^^^^ can't be applied to `Default` | note: `Default` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/default.rs:LL:COL error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/const_trait_impl.rs:40:7 + --> $DIR/const_trait_impl.rs:40:9 | LL | impl const A for T { - | ^^^^^^^^^ can't be applied to `Default` + | ^^^^^^^ can't be applied to `Default` | note: `Default` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/default.rs:LL:COL = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/const_trait_impl.rs:34:7 + --> $DIR/const_trait_impl.rs:34:9 | LL | impl const A for T { - | ^^^^^^^^^ can't be applied to `Default` + | ^^^^^^^ can't be applied to `Default` | note: `Default` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/default.rs:LL:COL = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/const_trait_impl.rs:46:7 + --> $DIR/const_trait_impl.rs:46:9 | LL | impl const A for T { - | ^^^^^^^^^ can't be applied to `Default` + | ^^^^^^^ can't be applied to `Default` | note: `Default` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/default.rs:LL:COL diff --git a/tests/ui/traits/const-traits/conditionally-const-and-const-params.stderr b/tests/ui/traits/const-traits/conditionally-const-and-const-params.stderr index f450bc6c9ab6f..ebd816ac9a54f 100644 --- a/tests/ui/traits/const-traits/conditionally-const-and-const-params.stderr +++ b/tests/ui/traits/const-traits/conditionally-const-and-const-params.stderr @@ -1,8 +1,8 @@ error: `[const]` is not allowed here - --> $DIR/conditionally-const-and-const-params.rs:8:13 + --> $DIR/conditionally-const-and-const-params.rs:8:15 | LL | fn add(self) -> Foo<{ A::add(N) }> { - | ^^^^^^^^^ + | ^^^^^^^ | note: this function is not `const`, so it cannot have `[const]` trait bounds --> $DIR/conditionally-const-and-const-params.rs:8:8 @@ -11,10 +11,10 @@ LL | fn add(self) -> Foo<{ A::add(N) }> { | ^^^ error: `[const]` is not allowed here - --> $DIR/conditionally-const-and-const-params.rs:26:9 + --> $DIR/conditionally-const-and-const-params.rs:26:11 | LL | fn bar(_: Foo) -> Foo<{ A::add(N) }> { - | ^^^^^^^^^ + | ^^^^^^^ | note: this function is not `const`, so it cannot have `[const]` trait bounds --> $DIR/conditionally-const-and-const-params.rs:26:4 diff --git a/tests/ui/traits/const-traits/conditionally-const-invalid-places.stderr b/tests/ui/traits/const-traits/conditionally-const-invalid-places.stderr index 62319689861b9..d0dd95029159b 100644 --- a/tests/ui/traits/const-traits/conditionally-const-invalid-places.stderr +++ b/tests/ui/traits/const-traits/conditionally-const-invalid-places.stderr @@ -1,8 +1,8 @@ error: `[const]` is not allowed here - --> $DIR/conditionally-const-invalid-places.rs:7:24 + --> $DIR/conditionally-const-invalid-places.rs:7:26 | LL | fn non_const_function() {} - | ^^^^^^^^^ + | ^^^^^^^ | note: this function is not `const`, so it cannot have `[const]` trait bounds --> $DIR/conditionally-const-invalid-places.rs:7:4 @@ -11,66 +11,66 @@ LL | fn non_const_function() {} | ^^^^^^^^^^^^^^^^^^ error: `[const]` is not allowed here - --> $DIR/conditionally-const-invalid-places.rs:9:16 + --> $DIR/conditionally-const-invalid-places.rs:9:18 | LL | struct Struct { field: T } - | ^^^^^^^^^ + | ^^^^^^^ | = note: this item cannot have `[const]` trait bounds error: `[const]` is not allowed here - --> $DIR/conditionally-const-invalid-places.rs:10:21 + --> $DIR/conditionally-const-invalid-places.rs:10:23 | LL | struct TupleStruct(T); - | ^^^^^^^^^ + | ^^^^^^^ | = note: this item cannot have `[const]` trait bounds error: `[const]` is not allowed here - --> $DIR/conditionally-const-invalid-places.rs:11:20 + --> $DIR/conditionally-const-invalid-places.rs:11:22 | LL | struct UnitStruct; - | ^^^^^^^^^ + | ^^^^^^^ | = note: this item cannot have `[const]` trait bounds error: `[const]` is not allowed here - --> $DIR/conditionally-const-invalid-places.rs:14:12 + --> $DIR/conditionally-const-invalid-places.rs:14:14 | LL | enum Enum { Variant(T) } - | ^^^^^^^^^ + | ^^^^^^^ | = note: this item cannot have `[const]` trait bounds error: `[const]` is not allowed here - --> $DIR/conditionally-const-invalid-places.rs:16:14 + --> $DIR/conditionally-const-invalid-places.rs:16:16 | LL | union Union { field: T } - | ^^^^^^^^^ + | ^^^^^^^ | = note: this item cannot have `[const]` trait bounds error: `[const]` is not allowed here - --> $DIR/conditionally-const-invalid-places.rs:19:12 + --> $DIR/conditionally-const-invalid-places.rs:19:14 | LL | type Type = T; - | ^^^^^^^^^ + | ^^^^^^^ | = note: this item cannot have `[const]` trait bounds error: `[const]` is not allowed here - --> $DIR/conditionally-const-invalid-places.rs:21:17 + --> $DIR/conditionally-const-invalid-places.rs:21:19 | LL | const CONSTANT: () = (); - | ^^^^^^^^^ + | ^^^^^^^ | = note: this item cannot have `[const]` trait bounds error: `[const]` is not allowed here - --> $DIR/conditionally-const-invalid-places.rs:25:16 + --> $DIR/conditionally-const-invalid-places.rs:25:18 | LL | type Type: [const] Trait; - | ^^^^^^^^^ + | ^^^^^^^ | note: associated types in non-`#[const_trait]` traits cannot have `[const]` trait bounds --> $DIR/conditionally-const-invalid-places.rs:25:5 @@ -79,10 +79,10 @@ LL | type Type: [const] Trait; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `[const]` is not allowed here - --> $DIR/conditionally-const-invalid-places.rs:25:32 + --> $DIR/conditionally-const-invalid-places.rs:25:34 | LL | type Type: [const] Trait; - | ^^^^^^^^^ + | ^^^^^^^ | note: associated types in non-`#[const_trait]` traits cannot have `[const]` trait bounds --> $DIR/conditionally-const-invalid-places.rs:25:5 @@ -91,10 +91,10 @@ LL | type Type: [const] Trait; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `[const]` is not allowed here - --> $DIR/conditionally-const-invalid-places.rs:28:28 + --> $DIR/conditionally-const-invalid-places.rs:28:30 | LL | fn non_const_function(); - | ^^^^^^^^^ + | ^^^^^^^ | note: this function is not `const`, so it cannot have `[const]` trait bounds --> $DIR/conditionally-const-invalid-places.rs:28:8 @@ -103,18 +103,18 @@ LL | fn non_const_function(); | ^^^^^^^^^^^^^^^^^^ error: `[const]` is not allowed here - --> $DIR/conditionally-const-invalid-places.rs:29:21 + --> $DIR/conditionally-const-invalid-places.rs:29:23 | LL | const CONSTANT: (); - | ^^^^^^^^^ + | ^^^^^^^ | = note: this item cannot have `[const]` trait bounds error: `[const]` is not allowed here - --> $DIR/conditionally-const-invalid-places.rs:34:16 + --> $DIR/conditionally-const-invalid-places.rs:34:18 | LL | type Type = (); - | ^^^^^^^^^ + | ^^^^^^^ | note: associated types in non-const impls cannot have `[const]` trait bounds --> $DIR/conditionally-const-invalid-places.rs:34:5 @@ -123,10 +123,10 @@ LL | type Type = (); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `[const]` is not allowed here - --> $DIR/conditionally-const-invalid-places.rs:36:28 + --> $DIR/conditionally-const-invalid-places.rs:36:30 | LL | fn non_const_function() {} - | ^^^^^^^^^ + | ^^^^^^^ | note: this function is not `const`, so it cannot have `[const]` trait bounds --> $DIR/conditionally-const-invalid-places.rs:36:8 @@ -135,18 +135,18 @@ LL | fn non_const_function() {} | ^^^^^^^^^^^^^^^^^^ error: `[const]` is not allowed here - --> $DIR/conditionally-const-invalid-places.rs:37:21 + --> $DIR/conditionally-const-invalid-places.rs:37:23 | LL | const CONSTANT: () = (); - | ^^^^^^^^^ + | ^^^^^^^ | = note: this item cannot have `[const]` trait bounds error: `[const]` is not allowed here - --> $DIR/conditionally-const-invalid-places.rs:44:16 + --> $DIR/conditionally-const-invalid-places.rs:44:18 | LL | type Type = (); - | ^^^^^^^^^ + | ^^^^^^^ | note: inherent associated types cannot have `[const]` trait bounds --> $DIR/conditionally-const-invalid-places.rs:44:5 @@ -155,10 +155,10 @@ LL | type Type = (); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `[const]` is not allowed here - --> $DIR/conditionally-const-invalid-places.rs:46:28 + --> $DIR/conditionally-const-invalid-places.rs:46:30 | LL | fn non_const_function() {} - | ^^^^^^^^^ + | ^^^^^^^ | note: this function is not `const`, so it cannot have `[const]` trait bounds --> $DIR/conditionally-const-invalid-places.rs:46:8 @@ -167,18 +167,18 @@ LL | fn non_const_function() {} | ^^^^^^^^^^^^^^^^^^ error: `[const]` is not allowed here - --> $DIR/conditionally-const-invalid-places.rs:47:21 + --> $DIR/conditionally-const-invalid-places.rs:47:23 | LL | const CONSTANT: () = (); - | ^^^^^^^^^ + | ^^^^^^^ | = note: this item cannot have `[const]` trait bounds error: `[const]` is not allowed here - --> $DIR/conditionally-const-invalid-places.rs:52:13 + --> $DIR/conditionally-const-invalid-places.rs:52:15 | LL | trait Child0: [const] Trait {} - | ^^^^^^^^^ + | ^^^^^^^ | note: this trait is not a `#[const_trait]`, so it cannot have `[const]` trait bounds --> $DIR/conditionally-const-invalid-places.rs:52:1 @@ -187,10 +187,10 @@ LL | trait Child0: [const] Trait {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `[const]` is not allowed here - --> $DIR/conditionally-const-invalid-places.rs:53:24 + --> $DIR/conditionally-const-invalid-places.rs:53:26 | LL | trait Child1 where Self: [const] Trait {} - | ^^^^^^^^^ + | ^^^^^^^ | note: this trait is not a `#[const_trait]`, so it cannot have `[const]` trait bounds --> $DIR/conditionally-const-invalid-places.rs:53:1 @@ -199,10 +199,10 @@ LL | trait Child1 where Self: [const] Trait {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `[const]` is not allowed here - --> $DIR/conditionally-const-invalid-places.rs:56:7 + --> $DIR/conditionally-const-invalid-places.rs:56:9 | LL | impl Trait for T {} - | ^^^^^^^^^ + | ^^^^^^^ | note: this impl is not `const`, so it cannot have `[const]` trait bounds --> $DIR/conditionally-const-invalid-places.rs:56:1 @@ -211,10 +211,10 @@ LL | impl Trait for T {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `[const]` is not allowed here - --> $DIR/conditionally-const-invalid-places.rs:59:7 + --> $DIR/conditionally-const-invalid-places.rs:59:9 | LL | impl Struct {} - | ^^^^^^^^^ + | ^^^^^^^ | note: inherent impls cannot have `[const]` trait bounds --> $DIR/conditionally-const-invalid-places.rs:59:1 diff --git a/tests/ui/traits/const-traits/const-bound-on-not-const-associated-fn.stderr b/tests/ui/traits/const-traits/const-bound-on-not-const-associated-fn.stderr index c0af644d3deb0..901c2cbd8a712 100644 --- a/tests/ui/traits/const-traits/const-bound-on-not-const-associated-fn.stderr +++ b/tests/ui/traits/const-traits/const-bound-on-not-const-associated-fn.stderr @@ -1,8 +1,8 @@ error: `[const]` is not allowed here - --> $DIR/const-bound-on-not-const-associated-fn.rs:11:38 + --> $DIR/const-bound-on-not-const-associated-fn.rs:11:40 | LL | fn do_something_else() where Self: [const] MyTrait; - | ^^^^^^^^^ + | ^^^^^^^ | note: this function is not `const`, so it cannot have `[const]` trait bounds --> $DIR/const-bound-on-not-const-associated-fn.rs:11:8 @@ -11,10 +11,10 @@ LL | fn do_something_else() where Self: [const] MyTrait; | ^^^^^^^^^^^^^^^^^ error: `[const]` is not allowed here - --> $DIR/const-bound-on-not-const-associated-fn.rs:22:30 + --> $DIR/const-bound-on-not-const-associated-fn.rs:22:32 | LL | pub fn foo(&self) where T: [const] MyTrait { - | ^^^^^^^^^ + | ^^^^^^^ | note: this function is not `const`, so it cannot have `[const]` trait bounds --> $DIR/const-bound-on-not-const-associated-fn.rs:22:12 diff --git a/tests/ui/traits/const-traits/const-bounds-non-const-trait.stderr b/tests/ui/traits/const-traits/const-bounds-non-const-trait.stderr index 2ff5fb74031b1..6c68e4ec3acc8 100644 --- a/tests/ui/traits/const-traits/const-bounds-non-const-trait.stderr +++ b/tests/ui/traits/const-traits/const-bounds-non-const-trait.stderr @@ -1,8 +1,8 @@ error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/const-bounds-non-const-trait.rs:6:19 + --> $DIR/const-bounds-non-const-trait.rs:6:21 | LL | const fn perform() {} - | ^^^^^^^^^ can't be applied to `NonConst` + | ^^^^^^^ can't be applied to `NonConst` | help: mark `NonConst` as `#[const_trait]` to allow it to have `const` implementations | @@ -10,10 +10,10 @@ LL | #[const_trait] trait NonConst {} | ++++++++++++++ error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/const-bounds-non-const-trait.rs:6:19 + --> $DIR/const-bounds-non-const-trait.rs:6:21 | LL | const fn perform() {} - | ^^^^^^^^^ can't be applied to `NonConst` + | ^^^^^^^ can't be applied to `NonConst` | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` help: mark `NonConst` as `#[const_trait]` to allow it to have `const` implementations diff --git a/tests/ui/traits/const-traits/const-closure-parse-not-item.stderr b/tests/ui/traits/const-traits/const-closure-parse-not-item.stderr index cc9d9bd602294..fdfe3b95d555a 100644 --- a/tests/ui/traits/const-traits/const-closure-parse-not-item.stderr +++ b/tests/ui/traits/const-traits/const-closure-parse-not-item.stderr @@ -1,27 +1,27 @@ error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/const-closure-parse-not-item.rs:7:20 + --> $DIR/const-closure-parse-not-item.rs:7:25 | LL | const fn test() -> impl [const] Fn() { - | ^^^^^^^^^^^^ can't be applied to `Fn` + | ^^^^^^^ can't be applied to `Fn` | note: `Fn` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/ops/function.rs:LL:COL error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/const-closure-parse-not-item.rs:7:20 + --> $DIR/const-closure-parse-not-item.rs:7:25 | LL | const fn test() -> impl [const] Fn() { - | ^^^^^^^^^^^^ can't be applied to `Fn` + | ^^^^^^^ can't be applied to `Fn` | note: `Fn` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/ops/function.rs:LL:COL = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/const-closure-parse-not-item.rs:7:20 + --> $DIR/const-closure-parse-not-item.rs:7:25 | LL | const fn test() -> impl [const] Fn() { - | ^^^^^^^^^^^^ can't be applied to `Fn` + | ^^^^^^^ can't be applied to `Fn` | note: `Fn` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/ops/function.rs:LL:COL diff --git a/tests/ui/traits/const-traits/const-closure-trait-method-fail.stderr b/tests/ui/traits/const-traits/const-closure-trait-method-fail.stderr index 7a146b9d8a112..89b202b34381b 100644 --- a/tests/ui/traits/const-traits/const-closure-trait-method-fail.stderr +++ b/tests/ui/traits/const-traits/const-closure-trait-method-fail.stderr @@ -1,17 +1,17 @@ error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/const-closure-trait-method-fail.rs:14:30 + --> $DIR/const-closure-trait-method-fail.rs:14:32 | LL | const fn need_const_closure i32>(x: T) -> i32 { - | ^^^^^^^^^ can't be applied to `FnOnce` + | ^^^^^^^ can't be applied to `FnOnce` | note: `FnOnce` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/ops/function.rs:LL:COL error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/const-closure-trait-method-fail.rs:14:30 + --> $DIR/const-closure-trait-method-fail.rs:14:32 | LL | const fn need_const_closure i32>(x: T) -> i32 { - | ^^^^^^^^^ can't be applied to `FnOnce` + | ^^^^^^^ can't be applied to `FnOnce` | note: `FnOnce` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/ops/function.rs:LL:COL diff --git a/tests/ui/traits/const-traits/const-closure-trait-method.stderr b/tests/ui/traits/const-traits/const-closure-trait-method.stderr index 6c003f87ada6a..6de25dc11ef51 100644 --- a/tests/ui/traits/const-traits/const-closure-trait-method.stderr +++ b/tests/ui/traits/const-traits/const-closure-trait-method.stderr @@ -1,17 +1,17 @@ error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/const-closure-trait-method.rs:14:30 + --> $DIR/const-closure-trait-method.rs:14:32 | LL | const fn need_const_closure i32>(x: T) -> i32 { - | ^^^^^^^^^ can't be applied to `FnOnce` + | ^^^^^^^ can't be applied to `FnOnce` | note: `FnOnce` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/ops/function.rs:LL:COL error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/const-closure-trait-method.rs:14:30 + --> $DIR/const-closure-trait-method.rs:14:32 | LL | const fn need_const_closure i32>(x: T) -> i32 { - | ^^^^^^^^^ can't be applied to `FnOnce` + | ^^^^^^^ can't be applied to `FnOnce` | note: `FnOnce` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/ops/function.rs:LL:COL diff --git a/tests/ui/traits/const-traits/const-closures.stderr b/tests/ui/traits/const-traits/const-closures.stderr index c76a73418a533..19869b470852d 100644 --- a/tests/ui/traits/const-traits/const-closures.stderr +++ b/tests/ui/traits/const-traits/const-closures.stderr @@ -1,74 +1,74 @@ error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/const-closures.rs:8:10 + --> $DIR/const-closures.rs:8:12 | LL | F: [const] FnOnce() -> u8, - | ^^^^^^^^^ can't be applied to `FnOnce` + | ^^^^^^^ can't be applied to `FnOnce` | note: `FnOnce` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/ops/function.rs:LL:COL error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/const-closures.rs:9:10 + --> $DIR/const-closures.rs:9:12 | LL | F: [const] FnMut() -> u8, - | ^^^^^^^^^ can't be applied to `FnMut` + | ^^^^^^^ can't be applied to `FnMut` | note: `FnMut` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/ops/function.rs:LL:COL error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/const-closures.rs:10:10 + --> $DIR/const-closures.rs:10:12 | LL | F: [const] Fn() -> u8, - | ^^^^^^^^^ can't be applied to `Fn` + | ^^^^^^^ can't be applied to `Fn` | note: `Fn` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/ops/function.rs:LL:COL error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/const-closures.rs:8:10 + --> $DIR/const-closures.rs:8:12 | LL | F: [const] FnOnce() -> u8, - | ^^^^^^^^^ can't be applied to `FnOnce` + | ^^^^^^^ can't be applied to `FnOnce` | note: `FnOnce` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/ops/function.rs:LL:COL = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/const-closures.rs:9:10 + --> $DIR/const-closures.rs:9:12 | LL | F: [const] FnMut() -> u8, - | ^^^^^^^^^ can't be applied to `FnMut` + | ^^^^^^^ can't be applied to `FnMut` | note: `FnMut` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/ops/function.rs:LL:COL = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/const-closures.rs:10:10 + --> $DIR/const-closures.rs:10:12 | LL | F: [const] Fn() -> u8, - | ^^^^^^^^^ can't be applied to `Fn` + | ^^^^^^^ can't be applied to `Fn` | note: `Fn` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/ops/function.rs:LL:COL = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/const-closures.rs:23:18 + --> $DIR/const-closures.rs:23:20 | LL | const fn answer u8>(f: &F) -> u8 { - | ^^^^^^^^^ can't be applied to `Fn` + | ^^^^^^^ can't be applied to `Fn` | note: `Fn` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/ops/function.rs:LL:COL error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/const-closures.rs:23:18 + --> $DIR/const-closures.rs:23:20 | LL | const fn answer u8>(f: &F) -> u8 { - | ^^^^^^^^^ can't be applied to `Fn` + | ^^^^^^^ can't be applied to `Fn` | note: `Fn` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/ops/function.rs:LL:COL diff --git a/tests/ui/traits/const-traits/const-trait-bounds-trait-objects.stderr b/tests/ui/traits/const-traits/const-trait-bounds-trait-objects.stderr index c58e2765168b5..090555c637791 100644 --- a/tests/ui/traits/const-traits/const-trait-bounds-trait-objects.stderr +++ b/tests/ui/traits/const-traits/const-trait-bounds-trait-objects.stderr @@ -5,10 +5,10 @@ LL | let _: &dyn const Trait; | ^^^^^^^^^^^ error: `[const]` is not allowed here - --> $DIR/const-trait-bounds-trait-objects.rs:10:13 + --> $DIR/const-trait-bounds-trait-objects.rs:10:17 | LL | let _: &dyn [const] Trait; - | ^^^^^^^^^^^ + | ^^^^^^^ | = note: trait objects cannot have `[const]` trait bounds @@ -19,10 +19,10 @@ LL | const fn handle(_: &dyn const NonConst) {} | ^^^^^^^^^^^^^^ error: `[const]` is not allowed here - --> $DIR/const-trait-bounds-trait-objects.rs:17:19 + --> $DIR/const-trait-bounds-trait-objects.rs:17:23 | LL | const fn take(_: &dyn [const] NonConst) {} - | ^^^^^^^^^^^ + | ^^^^^^^ | = note: trait objects cannot have `[const]` trait bounds diff --git a/tests/ui/traits/const-traits/feature-gate.stock.stderr b/tests/ui/traits/const-traits/feature-gate.stock.stderr index 37d76e7f3879c..f9d966f036239 100644 --- a/tests/ui/traits/const-traits/feature-gate.stock.stderr +++ b/tests/ui/traits/const-traits/feature-gate.stock.stderr @@ -9,10 +9,10 @@ LL | impl const T for S {} = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: const trait impls are experimental - --> $DIR/feature-gate.rs:13:13 + --> $DIR/feature-gate.rs:13:15 | LL | const fn f() {} - | ^^^^^^^^^ + | ^^^^^^^ | = note: see issue #67792 for more information = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable @@ -29,10 +29,10 @@ LL | fn g() {} = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: const trait impls are experimental - --> $DIR/feature-gate.rs:18:12 + --> $DIR/feature-gate.rs:18:17 | LL | discard! { impl [const] T } - | ^^^^^^^^^^^^ + | ^^^^^^^ | = note: see issue #67792 for more information = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable diff --git a/tests/ui/traits/const-traits/ice-112822-expected-type-for-param.stderr b/tests/ui/traits/const-traits/ice-112822-expected-type-for-param.stderr index f340eaab0e330..78d7b962cc42f 100644 --- a/tests/ui/traits/const-traits/ice-112822-expected-type-for-param.stderr +++ b/tests/ui/traits/const-traits/ice-112822-expected-type-for-param.stderr @@ -9,29 +9,29 @@ LL | const move || { = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/ice-112822-expected-type-for-param.rs:3:20 + --> $DIR/ice-112822-expected-type-for-param.rs:3:25 | LL | const fn test() -> impl [const] Fn() { - | ^^^^^^^^^^^^ can't be applied to `Fn` + | ^^^^^^^ can't be applied to `Fn` | note: `Fn` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/ops/function.rs:LL:COL error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/ice-112822-expected-type-for-param.rs:3:20 + --> $DIR/ice-112822-expected-type-for-param.rs:3:25 | LL | const fn test() -> impl [const] Fn() { - | ^^^^^^^^^^^^ can't be applied to `Fn` + | ^^^^^^^ can't be applied to `Fn` | note: `Fn` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/ops/function.rs:LL:COL = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/ice-112822-expected-type-for-param.rs:3:20 + --> $DIR/ice-112822-expected-type-for-param.rs:3:25 | LL | const fn test() -> impl [const] Fn() { - | ^^^^^^^^^^^^ can't be applied to `Fn` + | ^^^^^^^ can't be applied to `Fn` | note: `Fn` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/ops/function.rs:LL:COL diff --git a/tests/ui/traits/const-traits/ice-123664-unexpected-bound-var.stderr b/tests/ui/traits/const-traits/ice-123664-unexpected-bound-var.stderr index d8d73173ec4c9..1eccb16b46e7d 100644 --- a/tests/ui/traits/const-traits/ice-123664-unexpected-bound-var.stderr +++ b/tests/ui/traits/const-traits/ice-123664-unexpected-bound-var.stderr @@ -1,17 +1,17 @@ error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/ice-123664-unexpected-bound-var.rs:4:25 + --> $DIR/ice-123664-unexpected-bound-var.rs:4:27 | LL | const fn with_positive() {} - | ^^^^^^^^^ can't be applied to `Fn` + | ^^^^^^^ can't be applied to `Fn` | note: `Fn` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/ops/function.rs:LL:COL error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/ice-123664-unexpected-bound-var.rs:4:25 + --> $DIR/ice-123664-unexpected-bound-var.rs:4:27 | LL | const fn with_positive() {} - | ^^^^^^^^^ can't be applied to `Fn` + | ^^^^^^^ can't be applied to `Fn` | note: `Fn` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/ops/function.rs:LL:COL diff --git a/tests/ui/traits/const-traits/non-const-op-in-closure-in-const.stderr b/tests/ui/traits/const-traits/non-const-op-in-closure-in-const.stderr index 8211b2b49bfd0..e7f10e73c6924 100644 --- a/tests/ui/traits/const-traits/non-const-op-in-closure-in-const.stderr +++ b/tests/ui/traits/const-traits/non-const-op-in-closure-in-const.stderr @@ -1,17 +1,17 @@ error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/non-const-op-in-closure-in-const.rs:10:42 + --> $DIR/non-const-op-in-closure-in-const.rs:10:44 | LL | impl const Convert for A where B: [const] From { - | ^^^^^^^^^ can't be applied to `From` + | ^^^^^^^ can't be applied to `From` | note: `From` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/convert/mod.rs:LL:COL error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/non-const-op-in-closure-in-const.rs:10:42 + --> $DIR/non-const-op-in-closure-in-const.rs:10:44 | LL | impl const Convert for A where B: [const] From { - | ^^^^^^^^^ can't be applied to `From` + | ^^^^^^^ can't be applied to `From` | note: `From` can't be used with `[const]` because it isn't annotated with `#[const_trait]` --> $SRC_DIR/core/src/convert/mod.rs:LL:COL diff --git a/tests/ui/traits/const-traits/super-traits-fail-2.nn.stderr b/tests/ui/traits/const-traits/super-traits-fail-2.nn.stderr index 11f73cbf0c9ce..19f072b289e2b 100644 --- a/tests/ui/traits/const-traits/super-traits-fail-2.nn.stderr +++ b/tests/ui/traits/const-traits/super-traits-fail-2.nn.stderr @@ -1,8 +1,8 @@ error: `[const]` is not allowed here - --> $DIR/super-traits-fail-2.rs:11:10 + --> $DIR/super-traits-fail-2.rs:11:12 | LL | trait Bar: [const] Foo {} - | ^^^^^^^^^ + | ^^^^^^^ | note: this trait is not a `#[const_trait]`, so it cannot have `[const]` trait bounds --> $DIR/super-traits-fail-2.rs:11:1 @@ -11,10 +11,10 @@ LL | trait Bar: [const] Foo {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-2.rs:11:10 + --> $DIR/super-traits-fail-2.rs:11:12 | LL | trait Bar: [const] Foo {} - | ^^^^^^^^^ can't be applied to `Foo` + | ^^^^^^^ can't be applied to `Foo` | help: mark `Foo` as `#[const_trait]` to allow it to have `const` implementations | @@ -22,10 +22,10 @@ LL | #[const_trait] trait Foo { | ++++++++++++++ error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-2.rs:11:10 + --> $DIR/super-traits-fail-2.rs:11:12 | LL | trait Bar: [const] Foo {} - | ^^^^^^^^^ can't be applied to `Foo` + | ^^^^^^^ can't be applied to `Foo` | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` help: mark `Foo` as `#[const_trait]` to allow it to have `const` implementations @@ -34,10 +34,10 @@ LL | #[const_trait] trait Foo { | ++++++++++++++ error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-2.rs:11:10 + --> $DIR/super-traits-fail-2.rs:11:12 | LL | trait Bar: [const] Foo {} - | ^^^^^^^^^ can't be applied to `Foo` + | ^^^^^^^ can't be applied to `Foo` | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` help: mark `Foo` as `#[const_trait]` to allow it to have `const` implementations diff --git a/tests/ui/traits/const-traits/super-traits-fail-2.ny.stderr b/tests/ui/traits/const-traits/super-traits-fail-2.ny.stderr index 1767672e18049..4921f78d3acda 100644 --- a/tests/ui/traits/const-traits/super-traits-fail-2.ny.stderr +++ b/tests/ui/traits/const-traits/super-traits-fail-2.ny.stderr @@ -1,8 +1,8 @@ error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-2.rs:11:10 + --> $DIR/super-traits-fail-2.rs:11:12 | LL | trait Bar: [const] Foo {} - | ^^^^^^^^^ can't be applied to `Foo` + | ^^^^^^^ can't be applied to `Foo` | help: mark `Foo` as `#[const_trait]` to allow it to have `const` implementations | @@ -10,10 +10,10 @@ LL | #[const_trait] trait Foo { | ++++++++++++++ error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-2.rs:11:10 + --> $DIR/super-traits-fail-2.rs:11:12 | LL | trait Bar: [const] Foo {} - | ^^^^^^^^^ can't be applied to `Foo` + | ^^^^^^^ can't be applied to `Foo` | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` help: mark `Foo` as `#[const_trait]` to allow it to have `const` implementations @@ -22,10 +22,10 @@ LL | #[const_trait] trait Foo { | ++++++++++++++ error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-2.rs:11:10 + --> $DIR/super-traits-fail-2.rs:11:12 | LL | trait Bar: [const] Foo {} - | ^^^^^^^^^ can't be applied to `Foo` + | ^^^^^^^ can't be applied to `Foo` | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` help: mark `Foo` as `#[const_trait]` to allow it to have `const` implementations @@ -34,10 +34,10 @@ LL | #[const_trait] trait Foo { | ++++++++++++++ error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-2.rs:11:10 + --> $DIR/super-traits-fail-2.rs:11:12 | LL | trait Bar: [const] Foo {} - | ^^^^^^^^^ can't be applied to `Foo` + | ^^^^^^^ can't be applied to `Foo` | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` help: mark `Foo` as `#[const_trait]` to allow it to have `const` implementations @@ -46,10 +46,10 @@ LL | #[const_trait] trait Foo { | ++++++++++++++ error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-2.rs:11:10 + --> $DIR/super-traits-fail-2.rs:11:12 | LL | trait Bar: [const] Foo {} - | ^^^^^^^^^ can't be applied to `Foo` + | ^^^^^^^ can't be applied to `Foo` | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` help: mark `Foo` as `#[const_trait]` to allow it to have `const` implementations diff --git a/tests/ui/traits/const-traits/super-traits-fail-2.yn.stderr b/tests/ui/traits/const-traits/super-traits-fail-2.yn.stderr index 63c33a00234a6..a151349822ecd 100644 --- a/tests/ui/traits/const-traits/super-traits-fail-2.yn.stderr +++ b/tests/ui/traits/const-traits/super-traits-fail-2.yn.stderr @@ -1,8 +1,8 @@ error: `[const]` is not allowed here - --> $DIR/super-traits-fail-2.rs:11:10 + --> $DIR/super-traits-fail-2.rs:11:12 | LL | trait Bar: [const] Foo {} - | ^^^^^^^^^ + | ^^^^^^^ | note: this trait is not a `#[const_trait]`, so it cannot have `[const]` trait bounds --> $DIR/super-traits-fail-2.rs:11:1 diff --git a/tests/ui/traits/const-traits/super-traits-fail-3.nnn.stderr b/tests/ui/traits/const-traits/super-traits-fail-3.nnn.stderr index c6a06d074c93c..eb1beb41e37e2 100644 --- a/tests/ui/traits/const-traits/super-traits-fail-3.nnn.stderr +++ b/tests/ui/traits/const-traits/super-traits-fail-3.nnn.stderr @@ -1,8 +1,8 @@ error: `[const]` is not allowed here - --> $DIR/super-traits-fail-3.rs:23:10 + --> $DIR/super-traits-fail-3.rs:23:12 | LL | trait Bar: [const] Foo {} - | ^^^^^^^^^ + | ^^^^^^^ | note: this trait is not a `#[const_trait]`, so it cannot have `[const]` trait bounds --> $DIR/super-traits-fail-3.rs:23:1 @@ -11,30 +11,30 @@ LL | trait Bar: [const] Foo {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0658]: const trait impls are experimental - --> $DIR/super-traits-fail-3.rs:23:10 + --> $DIR/super-traits-fail-3.rs:23:12 | LL | trait Bar: [const] Foo {} - | ^^^^^^^^^ + | ^^^^^^^ | = note: see issue #67792 for more information = help: add `#![feature(const_trait_impl)]` 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]: const trait impls are experimental - --> $DIR/super-traits-fail-3.rs:32:15 + --> $DIR/super-traits-fail-3.rs:32:17 | LL | const fn foo(x: &T) { - | ^^^^^^^^^ + | ^^^^^^^ | = note: see issue #67792 for more information = help: add `#![feature(const_trait_impl)]` 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: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-3.rs:23:10 + --> $DIR/super-traits-fail-3.rs:23:12 | LL | trait Bar: [const] Foo {} - | ^^^^^^^^^ can't be applied to `Foo` + | ^^^^^^^ can't be applied to `Foo` | help: enable `#![feature(const_trait_impl)]` in your crate and mark `Foo` as `#[const_trait]` to allow it to have `const` implementations | @@ -42,10 +42,10 @@ LL | #[const_trait] trait Foo { | ++++++++++++++ error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-3.rs:23:10 + --> $DIR/super-traits-fail-3.rs:23:12 | LL | trait Bar: [const] Foo {} - | ^^^^^^^^^ can't be applied to `Foo` + | ^^^^^^^ can't be applied to `Foo` | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` help: enable `#![feature(const_trait_impl)]` in your crate and mark `Foo` as `#[const_trait]` to allow it to have `const` implementations @@ -54,10 +54,10 @@ LL | #[const_trait] trait Foo { | ++++++++++++++ error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-3.rs:23:10 + --> $DIR/super-traits-fail-3.rs:23:12 | LL | trait Bar: [const] Foo {} - | ^^^^^^^^^ can't be applied to `Foo` + | ^^^^^^^ can't be applied to `Foo` | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` help: enable `#![feature(const_trait_impl)]` in your crate and mark `Foo` as `#[const_trait]` to allow it to have `const` implementations @@ -66,10 +66,10 @@ LL | #[const_trait] trait Foo { | ++++++++++++++ error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-3.rs:32:15 + --> $DIR/super-traits-fail-3.rs:32:17 | LL | const fn foo(x: &T) { - | ^^^^^^^^^ can't be applied to `Bar` + | ^^^^^^^ can't be applied to `Bar` | help: enable `#![feature(const_trait_impl)]` in your crate and mark `Bar` as `#[const_trait]` to allow it to have `const` implementations | @@ -77,10 +77,10 @@ LL | #[const_trait] trait Bar: [const] Foo {} | ++++++++++++++ error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-3.rs:32:15 + --> $DIR/super-traits-fail-3.rs:32:17 | LL | const fn foo(x: &T) { - | ^^^^^^^^^ can't be applied to `Bar` + | ^^^^^^^ can't be applied to `Bar` | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` help: enable `#![feature(const_trait_impl)]` in your crate and mark `Bar` as `#[const_trait]` to allow it to have `const` implementations diff --git a/tests/ui/traits/const-traits/super-traits-fail-3.nny.stderr b/tests/ui/traits/const-traits/super-traits-fail-3.nny.stderr index c6a06d074c93c..eb1beb41e37e2 100644 --- a/tests/ui/traits/const-traits/super-traits-fail-3.nny.stderr +++ b/tests/ui/traits/const-traits/super-traits-fail-3.nny.stderr @@ -1,8 +1,8 @@ error: `[const]` is not allowed here - --> $DIR/super-traits-fail-3.rs:23:10 + --> $DIR/super-traits-fail-3.rs:23:12 | LL | trait Bar: [const] Foo {} - | ^^^^^^^^^ + | ^^^^^^^ | note: this trait is not a `#[const_trait]`, so it cannot have `[const]` trait bounds --> $DIR/super-traits-fail-3.rs:23:1 @@ -11,30 +11,30 @@ LL | trait Bar: [const] Foo {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0658]: const trait impls are experimental - --> $DIR/super-traits-fail-3.rs:23:10 + --> $DIR/super-traits-fail-3.rs:23:12 | LL | trait Bar: [const] Foo {} - | ^^^^^^^^^ + | ^^^^^^^ | = note: see issue #67792 for more information = help: add `#![feature(const_trait_impl)]` 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]: const trait impls are experimental - --> $DIR/super-traits-fail-3.rs:32:15 + --> $DIR/super-traits-fail-3.rs:32:17 | LL | const fn foo(x: &T) { - | ^^^^^^^^^ + | ^^^^^^^ | = note: see issue #67792 for more information = help: add `#![feature(const_trait_impl)]` 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: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-3.rs:23:10 + --> $DIR/super-traits-fail-3.rs:23:12 | LL | trait Bar: [const] Foo {} - | ^^^^^^^^^ can't be applied to `Foo` + | ^^^^^^^ can't be applied to `Foo` | help: enable `#![feature(const_trait_impl)]` in your crate and mark `Foo` as `#[const_trait]` to allow it to have `const` implementations | @@ -42,10 +42,10 @@ LL | #[const_trait] trait Foo { | ++++++++++++++ error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-3.rs:23:10 + --> $DIR/super-traits-fail-3.rs:23:12 | LL | trait Bar: [const] Foo {} - | ^^^^^^^^^ can't be applied to `Foo` + | ^^^^^^^ can't be applied to `Foo` | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` help: enable `#![feature(const_trait_impl)]` in your crate and mark `Foo` as `#[const_trait]` to allow it to have `const` implementations @@ -54,10 +54,10 @@ LL | #[const_trait] trait Foo { | ++++++++++++++ error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-3.rs:23:10 + --> $DIR/super-traits-fail-3.rs:23:12 | LL | trait Bar: [const] Foo {} - | ^^^^^^^^^ can't be applied to `Foo` + | ^^^^^^^ can't be applied to `Foo` | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` help: enable `#![feature(const_trait_impl)]` in your crate and mark `Foo` as `#[const_trait]` to allow it to have `const` implementations @@ -66,10 +66,10 @@ LL | #[const_trait] trait Foo { | ++++++++++++++ error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-3.rs:32:15 + --> $DIR/super-traits-fail-3.rs:32:17 | LL | const fn foo(x: &T) { - | ^^^^^^^^^ can't be applied to `Bar` + | ^^^^^^^ can't be applied to `Bar` | help: enable `#![feature(const_trait_impl)]` in your crate and mark `Bar` as `#[const_trait]` to allow it to have `const` implementations | @@ -77,10 +77,10 @@ LL | #[const_trait] trait Bar: [const] Foo {} | ++++++++++++++ error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-3.rs:32:15 + --> $DIR/super-traits-fail-3.rs:32:17 | LL | const fn foo(x: &T) { - | ^^^^^^^^^ can't be applied to `Bar` + | ^^^^^^^ can't be applied to `Bar` | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` help: enable `#![feature(const_trait_impl)]` in your crate and mark `Bar` as `#[const_trait]` to allow it to have `const` implementations diff --git a/tests/ui/traits/const-traits/super-traits-fail-3.nyn.stderr b/tests/ui/traits/const-traits/super-traits-fail-3.nyn.stderr index feca029aa6cba..7c465731a99f5 100644 --- a/tests/ui/traits/const-traits/super-traits-fail-3.nyn.stderr +++ b/tests/ui/traits/const-traits/super-traits-fail-3.nyn.stderr @@ -1,18 +1,18 @@ error[E0658]: const trait impls are experimental - --> $DIR/super-traits-fail-3.rs:23:10 + --> $DIR/super-traits-fail-3.rs:23:12 | LL | trait Bar: [const] Foo {} - | ^^^^^^^^^ + | ^^^^^^^ | = note: see issue #67792 for more information = help: add `#![feature(const_trait_impl)]` 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]: const trait impls are experimental - --> $DIR/super-traits-fail-3.rs:32:15 + --> $DIR/super-traits-fail-3.rs:32:17 | LL | const fn foo(x: &T) { - | ^^^^^^^^^ + | ^^^^^^^ | = note: see issue #67792 for more information = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable diff --git a/tests/ui/traits/const-traits/super-traits-fail-3.nyy.stderr b/tests/ui/traits/const-traits/super-traits-fail-3.nyy.stderr index feca029aa6cba..7c465731a99f5 100644 --- a/tests/ui/traits/const-traits/super-traits-fail-3.nyy.stderr +++ b/tests/ui/traits/const-traits/super-traits-fail-3.nyy.stderr @@ -1,18 +1,18 @@ error[E0658]: const trait impls are experimental - --> $DIR/super-traits-fail-3.rs:23:10 + --> $DIR/super-traits-fail-3.rs:23:12 | LL | trait Bar: [const] Foo {} - | ^^^^^^^^^ + | ^^^^^^^ | = note: see issue #67792 for more information = help: add `#![feature(const_trait_impl)]` 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]: const trait impls are experimental - --> $DIR/super-traits-fail-3.rs:32:15 + --> $DIR/super-traits-fail-3.rs:32:17 | LL | const fn foo(x: &T) { - | ^^^^^^^^^ + | ^^^^^^^ | = note: see issue #67792 for more information = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable diff --git a/tests/ui/traits/const-traits/super-traits-fail-3.ynn.stderr b/tests/ui/traits/const-traits/super-traits-fail-3.ynn.stderr index d9112c91776db..89e090b7d1cf4 100644 --- a/tests/ui/traits/const-traits/super-traits-fail-3.ynn.stderr +++ b/tests/ui/traits/const-traits/super-traits-fail-3.ynn.stderr @@ -1,8 +1,8 @@ error: `[const]` is not allowed here - --> $DIR/super-traits-fail-3.rs:23:10 + --> $DIR/super-traits-fail-3.rs:23:12 | LL | trait Bar: [const] Foo {} - | ^^^^^^^^^ + | ^^^^^^^ | note: this trait is not a `#[const_trait]`, so it cannot have `[const]` trait bounds --> $DIR/super-traits-fail-3.rs:23:1 @@ -11,10 +11,10 @@ LL | trait Bar: [const] Foo {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-3.rs:23:10 + --> $DIR/super-traits-fail-3.rs:23:12 | LL | trait Bar: [const] Foo {} - | ^^^^^^^^^ can't be applied to `Foo` + | ^^^^^^^ can't be applied to `Foo` | help: mark `Foo` as `#[const_trait]` to allow it to have `const` implementations | @@ -22,10 +22,10 @@ LL | #[const_trait] trait Foo { | ++++++++++++++ error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-3.rs:23:10 + --> $DIR/super-traits-fail-3.rs:23:12 | LL | trait Bar: [const] Foo {} - | ^^^^^^^^^ can't be applied to `Foo` + | ^^^^^^^ can't be applied to `Foo` | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` help: mark `Foo` as `#[const_trait]` to allow it to have `const` implementations @@ -34,10 +34,10 @@ LL | #[const_trait] trait Foo { | ++++++++++++++ error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-3.rs:23:10 + --> $DIR/super-traits-fail-3.rs:23:12 | LL | trait Bar: [const] Foo {} - | ^^^^^^^^^ can't be applied to `Foo` + | ^^^^^^^ can't be applied to `Foo` | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` help: mark `Foo` as `#[const_trait]` to allow it to have `const` implementations @@ -46,10 +46,10 @@ LL | #[const_trait] trait Foo { | ++++++++++++++ error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-3.rs:32:15 + --> $DIR/super-traits-fail-3.rs:32:17 | LL | const fn foo(x: &T) { - | ^^^^^^^^^ can't be applied to `Bar` + | ^^^^^^^ can't be applied to `Bar` | help: mark `Bar` as `#[const_trait]` to allow it to have `const` implementations | @@ -57,10 +57,10 @@ LL | #[const_trait] trait Bar: [const] Foo {} | ++++++++++++++ error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-3.rs:32:15 + --> $DIR/super-traits-fail-3.rs:32:17 | LL | const fn foo(x: &T) { - | ^^^^^^^^^ can't be applied to `Bar` + | ^^^^^^^ can't be applied to `Bar` | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` help: mark `Bar` as `#[const_trait]` to allow it to have `const` implementations diff --git a/tests/ui/traits/const-traits/super-traits-fail-3.yny.stderr b/tests/ui/traits/const-traits/super-traits-fail-3.yny.stderr index 3520b61a81c94..683eeb7385003 100644 --- a/tests/ui/traits/const-traits/super-traits-fail-3.yny.stderr +++ b/tests/ui/traits/const-traits/super-traits-fail-3.yny.stderr @@ -1,8 +1,8 @@ error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-3.rs:23:10 + --> $DIR/super-traits-fail-3.rs:23:12 | LL | trait Bar: [const] Foo {} - | ^^^^^^^^^ can't be applied to `Foo` + | ^^^^^^^ can't be applied to `Foo` | help: mark `Foo` as `#[const_trait]` to allow it to have `const` implementations | @@ -10,10 +10,10 @@ LL | #[const_trait] trait Foo { | ++++++++++++++ error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-3.rs:23:10 + --> $DIR/super-traits-fail-3.rs:23:12 | LL | trait Bar: [const] Foo {} - | ^^^^^^^^^ can't be applied to `Foo` + | ^^^^^^^ can't be applied to `Foo` | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` help: mark `Foo` as `#[const_trait]` to allow it to have `const` implementations @@ -22,10 +22,10 @@ LL | #[const_trait] trait Foo { | ++++++++++++++ error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-3.rs:23:10 + --> $DIR/super-traits-fail-3.rs:23:12 | LL | trait Bar: [const] Foo {} - | ^^^^^^^^^ can't be applied to `Foo` + | ^^^^^^^ can't be applied to `Foo` | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` help: mark `Foo` as `#[const_trait]` to allow it to have `const` implementations @@ -34,10 +34,10 @@ LL | #[const_trait] trait Foo { | ++++++++++++++ error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-3.rs:23:10 + --> $DIR/super-traits-fail-3.rs:23:12 | LL | trait Bar: [const] Foo {} - | ^^^^^^^^^ can't be applied to `Foo` + | ^^^^^^^ can't be applied to `Foo` | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` help: mark `Foo` as `#[const_trait]` to allow it to have `const` implementations @@ -46,10 +46,10 @@ LL | #[const_trait] trait Foo { | ++++++++++++++ error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-3.rs:23:10 + --> $DIR/super-traits-fail-3.rs:23:12 | LL | trait Bar: [const] Foo {} - | ^^^^^^^^^ can't be applied to `Foo` + | ^^^^^^^ can't be applied to `Foo` | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` help: mark `Foo` as `#[const_trait]` to allow it to have `const` implementations diff --git a/tests/ui/traits/const-traits/super-traits-fail-3.yyn.stderr b/tests/ui/traits/const-traits/super-traits-fail-3.yyn.stderr index d714118df6222..39cfdfe203016 100644 --- a/tests/ui/traits/const-traits/super-traits-fail-3.yyn.stderr +++ b/tests/ui/traits/const-traits/super-traits-fail-3.yyn.stderr @@ -1,8 +1,8 @@ error: `[const]` is not allowed here - --> $DIR/super-traits-fail-3.rs:23:10 + --> $DIR/super-traits-fail-3.rs:23:12 | LL | trait Bar: [const] Foo {} - | ^^^^^^^^^ + | ^^^^^^^ | note: this trait is not a `#[const_trait]`, so it cannot have `[const]` trait bounds --> $DIR/super-traits-fail-3.rs:23:1 @@ -11,10 +11,10 @@ LL | trait Bar: [const] Foo {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-3.rs:32:15 + --> $DIR/super-traits-fail-3.rs:32:17 | LL | const fn foo(x: &T) { - | ^^^^^^^^^ can't be applied to `Bar` + | ^^^^^^^ can't be applied to `Bar` | help: mark `Bar` as `#[const_trait]` to allow it to have `const` implementations | @@ -22,10 +22,10 @@ LL | #[const_trait] trait Bar: [const] Foo {} | ++++++++++++++ error: `[const]` can only be applied to `#[const_trait]` traits - --> $DIR/super-traits-fail-3.rs:32:15 + --> $DIR/super-traits-fail-3.rs:32:17 | LL | const fn foo(x: &T) { - | ^^^^^^^^^ can't be applied to `Bar` + | ^^^^^^^ can't be applied to `Bar` | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` help: mark `Bar` as `#[const_trait]` to allow it to have `const` implementations diff --git a/tests/ui/traits/const-traits/syntactical-unstable.stderr b/tests/ui/traits/const-traits/syntactical-unstable.stderr index 657773d91217e..b8cc8e69f75b3 100644 --- a/tests/ui/traits/const-traits/syntactical-unstable.stderr +++ b/tests/ui/traits/const-traits/syntactical-unstable.stderr @@ -2,9 +2,9 @@ error[E0658]: use of unstable const library feature `unstable` --> $DIR/syntactical-unstable.rs:13:20 | LL | trait Foo: [const] MyTrait { - | --------- ^^^^^^^ - | | - | trait is not stable as const yet + | ------- ^^^^^^^ + | | + | trait is not stable as const yet | = help: add `#![feature(unstable)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date @@ -13,9 +13,9 @@ error[E0658]: use of unstable const library feature `unstable` --> $DIR/syntactical-unstable.rs:19:45 | LL | const fn where_clause() where T: [const] MyTrait {} - | --------- ^^^^^^^ - | | - | trait is not stable as const yet + | ------- ^^^^^^^ + | | + | trait is not stable as const yet | = help: add `#![feature(unstable)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date @@ -24,9 +24,9 @@ error[E0658]: use of unstable const library feature `unstable` --> $DIR/syntactical-unstable.rs:22:53 | LL | const fn nested() where T: Deref {} - | --------- ^^^^^^^ - | | - | trait is not stable as const yet + | ------- ^^^^^^^ + | | + | trait is not stable as const yet | = help: add `#![feature(unstable)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date @@ -35,9 +35,9 @@ error[E0658]: use of unstable const library feature `unstable` --> $DIR/syntactical-unstable.rs:25:33 | LL | const fn rpit() -> impl [const] MyTrait { Local } - | ------------ ^^^^^^^ - | | - | trait is not stable as const yet + | ------- ^^^^^^^ + | | + | trait is not stable as const yet | = help: add `#![feature(unstable)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date @@ -55,9 +55,9 @@ error[E0658]: use of unstable const library feature `unstable` --> $DIR/syntactical-unstable.rs:15:24 | LL | type Item: [const] MyTrait; - | --------- ^^^^^^^ - | | - | trait is not stable as const yet + | ------- ^^^^^^^ + | | + | trait is not stable as const yet | = help: add `#![feature(unstable)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date diff --git a/tests/ui/traits/const-traits/trait-where-clause.stderr b/tests/ui/traits/const-traits/trait-where-clause.stderr index 04c67903ef50d..dda91e6bca1ed 100644 --- a/tests/ui/traits/const-traits/trait-where-clause.stderr +++ b/tests/ui/traits/const-traits/trait-where-clause.stderr @@ -1,8 +1,8 @@ error: `[const]` is not allowed here - --> $DIR/trait-where-clause.rs:8:22 + --> $DIR/trait-where-clause.rs:8:24 | LL | fn b() where Self: [const] Bar; - | ^^^^^^^^^ + | ^^^^^^^ | note: this function is not `const`, so it cannot have `[const]` trait bounds --> $DIR/trait-where-clause.rs:8:8 @@ -11,10 +11,10 @@ LL | fn b() where Self: [const] Bar; | ^ error: `[const]` is not allowed here - --> $DIR/trait-where-clause.rs:10:11 + --> $DIR/trait-where-clause.rs:10:13 | LL | fn c(); - | ^^^^^^^^^ + | ^^^^^^^ | note: this function is not `const`, so it cannot have `[const]` trait bounds --> $DIR/trait-where-clause.rs:10:8