2025-03-11 12:08:45 +00:00
|
|
|
error: `[const]` is not allowed here
|
2025-06-29 01:31:53 +02:00
|
|
|
--> $DIR/trait-where-clause.rs:8:24
|
2023-09-27 17:25:31 -04:00
|
|
|
|
|
2025-03-11 12:08:45 +00:00
|
|
|
LL | fn b() where Self: [const] Bar;
|
2025-06-29 01:31:53 +02:00
|
|
|
| ^^^^^^^
|
2023-09-27 17:25:31 -04:00
|
|
|
|
|
2025-03-11 12:08:45 +00:00
|
|
|
note: this function is not `const`, so it cannot have `[const]` trait bounds
|
2023-09-27 17:25:31 -04:00
|
|
|
--> $DIR/trait-where-clause.rs:8:8
|
|
|
|
|
|
|
2025-03-11 12:08:45 +00:00
|
|
|
LL | fn b() where Self: [const] Bar;
|
2023-09-27 17:25:31 -04:00
|
|
|
| ^
|
|
|
|
|
|
2025-03-11 12:08:45 +00:00
|
|
|
error: `[const]` is not allowed here
|
2025-06-29 01:31:53 +02:00
|
|
|
--> $DIR/trait-where-clause.rs:10:13
|
2023-09-27 17:25:31 -04:00
|
|
|
|
|
2025-03-11 12:08:45 +00:00
|
|
|
LL | fn c<T: [const] Bar>();
|
2025-06-29 01:31:53 +02:00
|
|
|
| ^^^^^^^
|
2023-09-27 17:25:31 -04:00
|
|
|
|
|
2025-03-11 12:08:45 +00:00
|
|
|
note: this function is not `const`, so it cannot have `[const]` trait bounds
|
2023-09-27 17:25:31 -04:00
|
|
|
--> $DIR/trait-where-clause.rs:10:8
|
|
|
|
|
|
|
2025-03-11 12:08:45 +00:00
|
|
|
LL | fn c<T: [const] Bar>();
|
2023-09-27 17:25:31 -04:00
|
|
|
| ^
|
|
|
|
|
|
2021-08-28 15:53:26 +00:00
|
|
|
error[E0277]: the trait bound `T: Bar` is not satisfied
|
2023-09-27 17:25:31 -04:00
|
|
|
--> $DIR/trait-where-clause.rs:16:5
|
2021-08-28 07:37:30 +00:00
|
|
|
|
|
|
|
|
|
LL | T::b();
|
2023-08-25 18:28:34 +00:00
|
|
|
| ^ the trait `Bar` is not implemented for `T`
|
2021-08-28 07:37:30 +00:00
|
|
|
|
|
2021-10-05 23:04:09 +00:00
|
|
|
note: required by a bound in `Foo::b`
|
2022-10-03 17:08:42 +00:00
|
|
|
--> $DIR/trait-where-clause.rs:8:24
|
2021-08-28 07:37:30 +00:00
|
|
|
|
|
2025-03-11 12:08:45 +00:00
|
|
|
LL | fn b() where Self: [const] Bar;
|
|
|
|
|
| ^^^^^^^^^^^ required by this bound in `Foo::b`
|
2024-11-28 21:57:48 +00:00
|
|
|
help: consider further restricting type parameter `T` with trait `Bar`
|
2021-08-28 07:37:30 +00:00
|
|
|
|
|
2022-09-10 06:37:26 +00:00
|
|
|
LL | fn test1<T: Foo + Bar>() {
|
2021-08-28 07:37:30 +00:00
|
|
|
| +++++
|
|
|
|
|
|
2021-08-28 15:53:26 +00:00
|
|
|
error[E0277]: the trait bound `T: Bar` is not satisfied
|
2023-09-27 17:25:31 -04:00
|
|
|
--> $DIR/trait-where-clause.rs:18:12
|
2021-08-28 15:53:26 +00:00
|
|
|
|
|
|
|
|
|
LL | T::c::<T>();
|
2022-08-16 23:13:23 +00:00
|
|
|
| ^ the trait `Bar` is not implemented for `T`
|
2021-08-28 15:53:26 +00:00
|
|
|
|
|
2021-10-05 23:04:09 +00:00
|
|
|
note: required by a bound in `Foo::c`
|
2023-09-27 17:25:31 -04:00
|
|
|
--> $DIR/trait-where-clause.rs:10:13
|
2021-08-28 15:53:26 +00:00
|
|
|
|
|
2025-03-11 12:08:45 +00:00
|
|
|
LL | fn c<T: [const] Bar>();
|
|
|
|
|
| ^^^^^^^^^^^ required by this bound in `Foo::c`
|
2024-11-28 21:57:48 +00:00
|
|
|
help: consider further restricting type parameter `T` with trait `Bar`
|
2021-08-28 15:53:26 +00:00
|
|
|
|
|
2022-09-10 06:37:26 +00:00
|
|
|
LL | fn test1<T: Foo + Bar>() {
|
2021-08-28 15:53:26 +00:00
|
|
|
| +++++
|
|
|
|
|
|
2023-09-27 17:25:31 -04:00
|
|
|
error: aborting due to 4 previous errors
|
2021-08-28 07:37:30 +00:00
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0277`.
|