Add test cases
This commit is contained in:
parent
523490e94a
commit
ee02c8e20a
4 changed files with 107 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
|||
error[E0277]: the trait bound `T: Bar` is not satisfied
|
||||
--> $DIR/trait-where-clause.rs:13:5
|
||||
--> $DIR/trait-where-clause.rs:14:5
|
||||
|
|
||||
LL | T::b();
|
||||
| ^^^^ the trait `Bar` is not implemented for `T`
|
||||
|
@ -15,7 +15,23 @@ LL | const fn test1<T: ~const Foo + Bar + Bar>() {
|
|||
| +++++
|
||||
|
||||
error[E0277]: the trait bound `T: Bar` is not satisfied
|
||||
--> $DIR/trait-where-clause.rs:24:5
|
||||
--> $DIR/trait-where-clause.rs:16:5
|
||||
|
|
||||
LL | T::c::<T>();
|
||||
| ^^^^^^^^^ the trait `Bar` is not implemented for `T`
|
||||
|
|
||||
note: required by `Foo::c`
|
||||
--> $DIR/trait-where-clause.rs:9:5
|
||||
|
|
||||
LL | fn c<T: ~const Bar>();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
help: consider further restricting this bound
|
||||
|
|
||||
LL | const fn test1<T: ~const Foo + Bar + Bar>() {
|
||||
| +++++
|
||||
|
||||
error[E0277]: the trait bound `T: Bar` is not satisfied
|
||||
--> $DIR/trait-where-clause.rs:28:5
|
||||
|
|
||||
LL | T::b();
|
||||
| ^^^^ the trait `Bar` is not implemented for `T`
|
||||
|
@ -30,6 +46,22 @@ help: consider further restricting this bound
|
|||
LL | fn test3<T: Foo + Bar>() {
|
||||
| +++++
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
error[E0277]: the trait bound `T: Bar` is not satisfied
|
||||
--> $DIR/trait-where-clause.rs:30:5
|
||||
|
|
||||
LL | T::c::<T>();
|
||||
| ^^^^^^^^^ the trait `Bar` is not implemented for `T`
|
||||
|
|
||||
note: required by `Foo::c`
|
||||
--> $DIR/trait-where-clause.rs:9:5
|
||||
|
|
||||
LL | fn c<T: ~const Bar>();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
help: consider further restricting this bound
|
||||
|
|
||||
LL | fn test3<T: Foo + Bar>() {
|
||||
| +++++
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0277`.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue