diff options
| author | Michael Goulet <michael@errs.io> | 2022-10-26 16:05:58 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2022-10-26 16:06:54 +0000 |
| commit | db3b01d2bf67e647487320467bde6f7023a8f154 (patch) | |
| tree | 973858f08144ddca89629de5087cee3e5bca61fb /src/test/ui | |
| parent | 43dd3d514b6b11c5195de2fd8e665828801d0972 (diff) | |
Process registered region obligation in resolve_regions_with_wf_tys
Diffstat (limited to 'src/test/ui')
| -rw-r--r-- | src/test/ui/wf/issue-103573.rs | 22 | ||||
| -rw-r--r-- | src/test/ui/wf/issue-103573.stderr | 14 |
2 files changed, 36 insertions, 0 deletions
diff --git a/src/test/ui/wf/issue-103573.rs b/src/test/ui/wf/issue-103573.rs new file mode 100644 index 00000000000..bcbf4f941ec --- /dev/null +++ b/src/test/ui/wf/issue-103573.rs @@ -0,0 +1,22 @@ +trait TraitA { + type TypeA; +} + +trait TraitD { + type TypeD; +} + +pub trait TraitB { + type TypeB: TraitD; + + fn f(_: &<Self::TypeB as TraitD>::TypeD); +} + +pub trait TraitC<E> { + type TypeC<'a>: TraitB; + + fn g<'a>(_: &<<Self::TypeC<'a> as TraitB>::TypeB as TraitA>::TypeA); + //~^ ERROR the trait bound `<<Self as TraitC<E>>::TypeC<'a> as TraitB>::TypeB: TraitA` is not satisfied +} + +fn main() {} diff --git a/src/test/ui/wf/issue-103573.stderr b/src/test/ui/wf/issue-103573.stderr new file mode 100644 index 00000000000..fcf3f15e4d3 --- /dev/null +++ b/src/test/ui/wf/issue-103573.stderr @@ -0,0 +1,14 @@ +error[E0277]: the trait bound `<<Self as TraitC<E>>::TypeC<'a> as TraitB>::TypeB: TraitA` is not satisfied + --> $DIR/issue-103573.rs:18:5 + | +LL | fn g<'a>(_: &<<Self::TypeC<'a> as TraitB>::TypeB as TraitA>::TypeA); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `TraitA` is not implemented for `<<Self as TraitC<E>>::TypeC<'a> as TraitB>::TypeB` + | +help: consider further restricting the associated type + | +LL | fn g<'a>(_: &<<Self::TypeC<'a> as TraitB>::TypeB as TraitA>::TypeA) where <<Self as TraitC<E>>::TypeC<'a> as TraitB>::TypeB: TraitA; + | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. |
