Files
rust/tests/ui/traits/const-traits/const-bounds-non-const-trait.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

37 lines
1.2 KiB
Plaintext
Raw Normal View History

2025-07-13 16:49:19 +08:00
error: `[const]` can only be applied to `const` traits
--> $DIR/const-bounds-non-const-trait.rs:6:21
|
LL | const fn perform<T: [const] NonConst>() {}
| ^^^^^^^ can't be applied to `NonConst`
|
2025-07-13 16:49:19 +08:00
help: mark `NonConst` as `const` to allow it to have `const` implementations
|
LL | #[const_trait] trait NonConst {}
| ++++++++++++++
2025-07-13 16:49:19 +08:00
error: `[const]` can only be applied to `const` traits
--> $DIR/const-bounds-non-const-trait.rs:6:21
|
LL | const fn perform<T: [const] NonConst>() {}
| ^^^^^^^ can't be applied to `NonConst`
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
2025-07-13 16:49:19 +08:00
help: mark `NonConst` as `const` to allow it to have `const` implementations
|
LL | #[const_trait] trait NonConst {}
| ++++++++++++++
2025-07-13 16:49:19 +08:00
error: `const` can only be applied to `const` traits
--> $DIR/const-bounds-non-const-trait.rs:10:15
|
LL | fn operate<T: const NonConst>() {}
| ^^^^^ can't be applied to `NonConst`
|
2025-07-13 16:49:19 +08:00
help: mark `NonConst` as `const` to allow it to have `const` implementations
|
LL | #[const_trait] trait NonConst {}
| ++++++++++++++
2024-10-30 18:03:44 +00:00
error: aborting due to 3 previous errors