Files
rust/tests/ui/traits/const-traits/tilde-const-invalid-places.stderr

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

311 lines
10 KiB
Plaintext
Raw Normal View History

2023-11-11 15:01:58 +01:00
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:7:26
2021-08-25 15:21:55 +00:00
|
2023-11-11 15:01:58 +01:00
LL | fn non_const_function<T: ~const Trait>() {}
2023-11-24 14:32:05 +00:00
| ^^^^^^
2023-11-11 15:01:58 +01:00
|
note: this function is not `const`, so it cannot have `~const` trait bounds
--> $DIR/tilde-const-invalid-places.rs:7:4
|
LL | fn non_const_function<T: ~const Trait>() {}
| ^^^^^^^^^^^^^^^^^^
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:9:18
|
LL | struct Struct<T: ~const Trait> { field: T }
2023-11-24 14:32:05 +00:00
| ^^^^^^
2023-11-11 15:01:58 +01:00
|
= note: this item cannot have `~const` trait bounds
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:10:23
|
LL | struct TupleStruct<T: ~const Trait>(T);
2023-11-24 14:32:05 +00:00
| ^^^^^^
2023-11-11 15:01:58 +01:00
|
= note: this item cannot have `~const` trait bounds
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:11:22
|
LL | struct UnitStruct<T: ~const Trait>;
2023-11-24 14:32:05 +00:00
| ^^^^^^
2023-11-11 15:01:58 +01:00
|
= note: this item cannot have `~const` trait bounds
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:14:14
2023-11-11 15:01:58 +01:00
|
LL | enum Enum<T: ~const Trait> { Variant(T) }
2023-11-24 14:32:05 +00:00
| ^^^^^^
2023-11-11 15:01:58 +01:00
|
= note: this item cannot have `~const` trait bounds
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:16:16
2023-11-11 15:01:58 +01:00
|
LL | union Union<T: ~const Trait> { field: T }
2023-11-24 14:32:05 +00:00
| ^^^^^^
2023-11-11 15:01:58 +01:00
|
= note: this item cannot have `~const` trait bounds
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:19:14
2023-11-11 15:01:58 +01:00
|
LL | type Type<T: ~const Trait> = T;
2023-11-24 14:32:05 +00:00
| ^^^^^^
2023-11-11 15:01:58 +01:00
|
= note: this item cannot have `~const` trait bounds
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:21:19
2023-11-11 15:01:58 +01:00
|
LL | const CONSTANT<T: ~const Trait>: () = ();
2023-11-24 14:32:05 +00:00
| ^^^^^^
2023-11-11 15:01:58 +01:00
|
= note: this item cannot have `~const` trait bounds
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:25:18
2023-11-11 15:01:58 +01:00
|
LL | type Type<T: ~const Trait>: ~const Trait;
2023-11-24 14:32:05 +00:00
| ^^^^^^
2023-11-11 15:01:58 +01:00
|
note: associated types in non-`#[const_trait]` traits cannot have `~const` trait bounds
--> $DIR/tilde-const-invalid-places.rs:25:5
|
LL | type Type<T: ~const Trait>: ~const Trait;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-11-11 15:01:58 +01:00
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:25:33
2023-11-11 15:01:58 +01:00
|
LL | type Type<T: ~const Trait>: ~const Trait;
2023-11-24 14:32:05 +00:00
| ^^^^^^
2023-11-11 15:01:58 +01:00
|
note: associated types in non-`#[const_trait]` traits cannot have `~const` trait bounds
--> $DIR/tilde-const-invalid-places.rs:25:5
|
LL | type Type<T: ~const Trait>: ~const Trait;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-11-11 15:01:58 +01:00
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:28:30
2023-11-11 15:01:58 +01:00
|
LL | fn non_const_function<T: ~const Trait>();
2023-11-24 14:32:05 +00:00
| ^^^^^^
2023-11-11 15:01:58 +01:00
|
note: this function is not `const`, so it cannot have `~const` trait bounds
--> $DIR/tilde-const-invalid-places.rs:28:8
2023-11-11 15:01:58 +01:00
|
LL | fn non_const_function<T: ~const Trait>();
| ^^^^^^^^^^^^^^^^^^
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:29:23
2023-11-11 15:01:58 +01:00
|
LL | const CONSTANT<T: ~const Trait>: ();
2023-11-24 14:32:05 +00:00
| ^^^^^^
2023-11-11 15:01:58 +01:00
|
= note: this item cannot have `~const` trait bounds
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:34:18
2023-11-11 15:01:58 +01:00
|
LL | type Type<T: ~const Trait> = ();
2023-11-24 14:32:05 +00:00
| ^^^^^^
2023-11-11 15:01:58 +01:00
|
note: associated types in non-const impls cannot have `~const` trait bounds
--> $DIR/tilde-const-invalid-places.rs:34:5
|
LL | type Type<T: ~const Trait> = ();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-11-11 15:01:58 +01:00
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:36:30
2023-11-11 15:01:58 +01:00
|
LL | fn non_const_function<T: ~const Trait>() {}
2023-11-24 14:32:05 +00:00
| ^^^^^^
2023-11-11 15:01:58 +01:00
|
note: this function is not `const`, so it cannot have `~const` trait bounds
--> $DIR/tilde-const-invalid-places.rs:36:8
2023-11-11 15:01:58 +01:00
|
LL | fn non_const_function<T: ~const Trait>() {}
| ^^^^^^^^^^^^^^^^^^
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:37:23
2023-11-11 15:01:58 +01:00
|
LL | const CONSTANT<T: ~const Trait>: () = ();
2023-11-24 14:32:05 +00:00
| ^^^^^^
2023-11-11 15:01:58 +01:00
|
= note: this item cannot have `~const` trait bounds
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:44:18
2023-11-11 15:01:58 +01:00
|
LL | type Type<T: ~const Trait> = ();
2023-11-24 14:32:05 +00:00
| ^^^^^^
2023-11-11 15:01:58 +01:00
|
note: inherent associated types cannot have `~const` trait bounds
--> $DIR/tilde-const-invalid-places.rs:44:5
|
LL | type Type<T: ~const Trait> = ();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-11-11 15:01:58 +01:00
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:46:30
2023-11-11 15:01:58 +01:00
|
LL | fn non_const_function<T: ~const Trait>() {}
2023-11-24 14:32:05 +00:00
| ^^^^^^
2023-11-11 15:01:58 +01:00
|
note: this function is not `const`, so it cannot have `~const` trait bounds
--> $DIR/tilde-const-invalid-places.rs:46:8
2023-11-11 15:01:58 +01:00
|
LL | fn non_const_function<T: ~const Trait>() {}
| ^^^^^^^^^^^^^^^^^^
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:47:23
2023-11-11 15:01:58 +01:00
|
LL | const CONSTANT<T: ~const Trait>: () = ();
2023-11-24 14:32:05 +00:00
| ^^^^^^
2023-11-11 15:01:58 +01:00
|
= note: this item cannot have `~const` trait bounds
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:52:15
2023-11-11 15:01:58 +01:00
|
LL | trait Child0: ~const Trait {}
2023-11-24 14:32:05 +00:00
| ^^^^^^
2023-11-11 15:01:58 +01:00
|
note: this trait is not a `#[const_trait]`, so it cannot have `~const` trait bounds
--> $DIR/tilde-const-invalid-places.rs:52:1
2023-11-11 15:01:58 +01:00
|
LL | trait Child0: ~const Trait {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:53:26
2023-11-11 15:01:58 +01:00
|
LL | trait Child1 where Self: ~const Trait {}
2023-11-24 14:32:05 +00:00
| ^^^^^^
2023-11-11 15:01:58 +01:00
|
note: this trait is not a `#[const_trait]`, so it cannot have `~const` trait bounds
--> $DIR/tilde-const-invalid-places.rs:53:1
2023-11-11 15:01:58 +01:00
|
LL | trait Child1 where Self: ~const Trait {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:56:9
2023-11-11 15:01:58 +01:00
|
LL | impl<T: ~const Trait> Trait for T {}
2023-11-24 14:32:05 +00:00
| ^^^^^^
2023-11-11 15:01:58 +01:00
|
note: this impl is not `const`, so it cannot have `~const` trait bounds
--> $DIR/tilde-const-invalid-places.rs:56:1
2023-11-11 15:01:58 +01:00
|
LL | impl<T: ~const Trait> Trait for T {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `~const` is not allowed here
--> $DIR/tilde-const-invalid-places.rs:59:9
|
LL | impl<T: ~const Trait> Struct<T> {}
| ^^^^^^
|
note: inherent impls cannot have `~const` trait bounds
--> $DIR/tilde-const-invalid-places.rs:59:1
|
LL | impl<T: ~const Trait> Struct<T> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-11-11 15:01:58 +01:00
error[E0658]: generic const items are experimental
--> $DIR/tilde-const-invalid-places.rs:21:15
2023-11-11 15:01:58 +01:00
|
LL | const CONSTANT<T: ~const Trait>: () = ();
| ^^^^^^^^^^^^^^^^^
|
= note: see issue #113521 <https://github.com/rust-lang/rust/issues/113521> for more information
= help: add `#![feature(generic_const_items)]` to the crate attributes to enable
2024-01-10 01:39:02 -05:00
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
2023-11-11 15:01:58 +01:00
error[E0658]: generic const items are experimental
--> $DIR/tilde-const-invalid-places.rs:29:19
2023-11-11 15:01:58 +01:00
|
LL | const CONSTANT<T: ~const Trait>: ();
| ^^^^^^^^^^^^^^^^^
|
= note: see issue #113521 <https://github.com/rust-lang/rust/issues/113521> for more information
= help: add `#![feature(generic_const_items)]` to the crate attributes to enable
2024-01-10 01:39:02 -05:00
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
2023-11-11 15:01:58 +01:00
error[E0658]: generic const items are experimental
--> $DIR/tilde-const-invalid-places.rs:37:19
2023-11-11 15:01:58 +01:00
|
LL | const CONSTANT<T: ~const Trait>: () = ();
| ^^^^^^^^^^^^^^^^^
|
= note: see issue #113521 <https://github.com/rust-lang/rust/issues/113521> for more information
= help: add `#![feature(generic_const_items)]` to the crate attributes to enable
2024-01-10 01:39:02 -05:00
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
2023-11-11 15:01:58 +01:00
error[E0658]: generic const items are experimental
--> $DIR/tilde-const-invalid-places.rs:47:19
2023-11-11 15:01:58 +01:00
|
LL | const CONSTANT<T: ~const Trait>: () = ();
| ^^^^^^^^^^^^^^^^^
|
= note: see issue #113521 <https://github.com/rust-lang/rust/issues/113521> for more information
= help: add `#![feature(generic_const_items)]` to the crate attributes to enable
2024-01-10 01:39:02 -05:00
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
2023-11-11 15:01:58 +01:00
error[E0392]: type parameter `T` is never used
--> $DIR/tilde-const-invalid-places.rs:11:19
|
LL | struct UnitStruct<T: ~const Trait>;
| ^ unused type parameter
|
= help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData`
error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
--> $DIR/tilde-const-invalid-places.rs:16:32
|
LL | union Union<T: ~const Trait> { field: T }
| ^^^^^^^^
|
= note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>`
help: wrap the field type in `ManuallyDrop<...>`
|
LL | union Union<T: ~const Trait> { field: std::mem::ManuallyDrop<T> }
| +++++++++++++++++++++++ +
error[E0275]: overflow evaluating the requirement `(): Trait`
--> $DIR/tilde-const-invalid-places.rs:34:34
|
LL | type Type<T: ~const Trait> = ();
| ^^
|
note: required by a bound in `NonConstTrait::Type`
--> $DIR/tilde-const-invalid-places.rs:25:33
|
LL | type Type<T: ~const Trait>: ~const Trait;
| ^^^^^^^^^^^^ required by this bound in `NonConstTrait::Type`
error[E0658]: inherent associated types are unstable
--> $DIR/tilde-const-invalid-places.rs:44:5
|
LL | type Type<T: ~const Trait> = ();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #8995 <https://github.com/rust-lang/rust/issues/8995> for more information
= help: add `#![feature(inherent_associated_types)]` 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: aborting due to 30 previous errors
2021-08-25 15:21:55 +00:00
Some errors have detailed explanations: E0275, E0392, E0658, E0740.
For more information about an error, try `rustc --explain E0275`.