Files
rust/tests/run-make/const-trait-stable-toolchain/const-super-trait-stable-enabled.stderr

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

55 lines
1.6 KiB
Plaintext
Raw Normal View History

error: `[const]` is not allowed here
--> const-super-trait.rs:7:12
|
2025-08-06 13:51:50 +01:00
7 | trait Bar: [const] Foo {}
| ^^^^^^^
|
2025-07-13 16:49:19 +08:00
note: this trait is not `const`, so it cannot have `[const]` trait bounds
--> const-super-trait.rs:7:1
|
2025-08-06 13:51:50 +01:00
7 | trait Bar: [const] Foo {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0554]: `#![feature]` may not be used on the NIGHTLY release channel
--> const-super-trait.rs:1:30
|
1 | #![cfg_attr(feature_enabled, feature(const_trait_impl))]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
2025-07-13 16:49:19 +08:00
error: `[const]` can only be applied to `const` traits
--> const-super-trait.rs:7:12
|
2025-08-06 13:51:50 +01:00
7 | trait Bar: [const] Foo {}
| ^^^^^^^ can't be applied to `Foo`
|
2025-07-13 16:49:19 +08:00
note: `Foo` can't be used with `[const]` because it isn't `const`
--> const-super-trait.rs:3:1
|
3 | trait Foo {
| ^^^^^^^^^
2025-07-13 16:49:19 +08:00
error: `[const]` can only be applied to `const` traits
--> const-super-trait.rs:9:17
|
2025-08-06 13:51:50 +01:00
9 | const fn foo<T: [const] Bar>(x: &T) {
| ^^^^^^^ can't be applied to `Bar`
|
2025-07-13 16:49:19 +08:00
note: `Bar` can't be used with `[const]` because it isn't `const`
--> const-super-trait.rs:7:1
|
2025-08-06 13:51:50 +01:00
7 | trait Bar: [const] Foo {}
| ^^^^^^^^^^^^^^^^^^^^^^
2024-12-23 21:49:48 +00:00
error[E0015]: cannot call non-const method `<T as Foo>::a` in constant functions
--> const-super-trait.rs:10:7
|
10 | x.a();
| ^^^
|
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
error: aborting due to 5 previous errors
Some errors have detailed explanations: E0015, E0554.
For more information about an error, try `rustc --explain E0015`.