-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #89480 - hameerabbasi:issue-89118-test, r=jackh726
Add test for issue 89118. This PR adds a test for issue 89118. Closes #89118.
- Loading branch information
Showing
2 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-89118.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
trait BufferMut {} | ||
struct Ctx<D>(D); | ||
|
||
trait BufferUdpStateContext<B> {} | ||
impl<B: BufferMut, C> BufferUdpStateContext<B> for C {} | ||
|
||
trait StackContext | ||
where | ||
Ctx<()>: for<'a> BufferUdpStateContext<&'a ()>, | ||
{ | ||
type Dispatcher; | ||
} | ||
|
||
trait TimerContext { | ||
type Handler; | ||
} | ||
impl<C> TimerContext for C | ||
where | ||
C: StackContext, | ||
//~^ ERROR: is not satisfied [E0277] | ||
{ | ||
type Handler = Ctx<C::Dispatcher>; | ||
//~^ ERROR: is not satisfied [E0277] | ||
} | ||
|
||
struct EthernetWorker<C>(C) | ||
where | ||
Ctx<()>: for<'a> BufferUdpStateContext<&'a ()>; | ||
impl<C> EthernetWorker<C> {} | ||
//~^ ERROR: is not satisfied [E0277] | ||
|
||
fn main() {} |
63 changes: 63 additions & 0 deletions
63
src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-89118.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
error[E0277]: the trait bound `for<'a> &'a (): BufferMut` is not satisfied | ||
--> $DIR/issue-89118.rs:19:8 | ||
| | ||
LL | C: StackContext, | ||
| ^^^^^^^^^^^^ the trait `for<'a> BufferMut` is not implemented for `&'a ()` | ||
| | ||
note: required because of the requirements on the impl of `for<'a> BufferUdpStateContext<&'a ()>` for `Ctx<()>` | ||
--> $DIR/issue-89118.rs:5:23 | ||
| | ||
LL | impl<B: BufferMut, C> BufferUdpStateContext<B> for C {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ ^ | ||
note: required by a bound in `StackContext` | ||
--> $DIR/issue-89118.rs:9:14 | ||
| | ||
LL | trait StackContext | ||
| ------------ required by a bound in this | ||
LL | where | ||
LL | Ctx<()>: for<'a> BufferUdpStateContext<&'a ()>, | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `StackContext` | ||
|
||
error[E0277]: the trait bound `for<'a> &'a (): BufferMut` is not satisfied | ||
--> $DIR/issue-89118.rs:22:20 | ||
| | ||
LL | type Handler = Ctx<C::Dispatcher>; | ||
| ^^^^^^^^^^^^^^^^^^ the trait `for<'a> BufferMut` is not implemented for `&'a ()` | ||
| | ||
note: required because of the requirements on the impl of `for<'a> BufferUdpStateContext<&'a ()>` for `Ctx<()>` | ||
--> $DIR/issue-89118.rs:5:23 | ||
| | ||
LL | impl<B: BufferMut, C> BufferUdpStateContext<B> for C {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ ^ | ||
note: required by a bound in `StackContext` | ||
--> $DIR/issue-89118.rs:9:14 | ||
| | ||
LL | trait StackContext | ||
| ------------ required by a bound in this | ||
LL | where | ||
LL | Ctx<()>: for<'a> BufferUdpStateContext<&'a ()>, | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `StackContext` | ||
|
||
error[E0277]: the trait bound `for<'a> &'a (): BufferMut` is not satisfied | ||
--> $DIR/issue-89118.rs:29:9 | ||
| | ||
LL | impl<C> EthernetWorker<C> {} | ||
| ^^^^^^^^^^^^^^^^^ the trait `for<'a> BufferMut` is not implemented for `&'a ()` | ||
| | ||
note: required because of the requirements on the impl of `for<'a> BufferUdpStateContext<&'a ()>` for `Ctx<()>` | ||
--> $DIR/issue-89118.rs:5:23 | ||
| | ||
LL | impl<B: BufferMut, C> BufferUdpStateContext<B> for C {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ ^ | ||
note: required by a bound in `EthernetWorker` | ||
--> $DIR/issue-89118.rs:28:14 | ||
| | ||
LL | struct EthernetWorker<C>(C) | ||
| -------------- required by a bound in this | ||
LL | where | ||
LL | Ctx<()>: for<'a> BufferUdpStateContext<&'a ()>; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `EthernetWorker` | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0277`. |