diff options
| author | Michael Goulet <michael@errs.io> | 2022-12-05 04:38:58 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2022-12-14 18:44:26 +0000 |
| commit | d10f6b44e1243bf4d68ed4f0f5038049330a047e (patch) | |
| tree | 1cab20c0062f37a8787324629ae3e0ef8bca86e8 | |
| parent | 34d194d41c8ffea79b8816a811b2fe626b1a6c39 (diff) | |
| download | rust-d10f6b44e1243bf4d68ed4f0f5038049330a047e.tar.gz rust-d10f6b44e1243bf4d68ed4f0f5038049330a047e.zip | |
Add test
| -rw-r--r-- | src/test/ui/lifetimes/conflicting-bounds.rs | 11 | ||||
| -rw-r--r-- | src/test/ui/lifetimes/conflicting-bounds.stderr | 14 |
2 files changed, 25 insertions, 0 deletions
diff --git a/src/test/ui/lifetimes/conflicting-bounds.rs b/src/test/ui/lifetimes/conflicting-bounds.rs new file mode 100644 index 00000000000..f37f163dbb6 --- /dev/null +++ b/src/test/ui/lifetimes/conflicting-bounds.rs @@ -0,0 +1,11 @@ +//~ type annotations needed: cannot satisfy `Self: Gen<'source>` + +pub trait Gen<'source> { + type Output; + + fn gen<T>(&self) -> T + where + Self: for<'s> Gen<'s, Output = T>; +} + +fn main() {} diff --git a/src/test/ui/lifetimes/conflicting-bounds.stderr b/src/test/ui/lifetimes/conflicting-bounds.stderr new file mode 100644 index 00000000000..42aa393667d --- /dev/null +++ b/src/test/ui/lifetimes/conflicting-bounds.stderr @@ -0,0 +1,14 @@ +error[E0283]: type annotations needed: cannot satisfy `Self: Gen<'source>` + | +note: multiple `impl`s or `where` clauses satisfying `Self: Gen<'source>` found + --> $DIR/conflicting-bounds.rs:3:1 + | +LL | pub trait Gen<'source> { + | ^^^^^^^^^^^^^^^^^^^^^^ +... +LL | Self: for<'s> Gen<'s, Output = T>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0283`. |
