diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/ui/associated-type-bounds/issue-71443-1.rs | 9 | ||||
| -rw-r--r-- | src/test/ui/associated-type-bounds/issue-71443-1.stderr | 11 | ||||
| -rw-r--r-- | src/test/ui/associated-type-bounds/issue-71443-2.rs | 11 |
3 files changed, 31 insertions, 0 deletions
diff --git a/src/test/ui/associated-type-bounds/issue-71443-1.rs b/src/test/ui/associated-type-bounds/issue-71443-1.rs new file mode 100644 index 00000000000..5d2a3e6cbad --- /dev/null +++ b/src/test/ui/associated-type-bounds/issue-71443-1.rs @@ -0,0 +1,9 @@ +#![feature(associated_type_bounds)] + +struct Incorrect; + +fn hello<F: for<'a> Iterator<Item: 'a>>() { + Incorrect //~ERROR: mismatched types +} + +fn main() {} diff --git a/src/test/ui/associated-type-bounds/issue-71443-1.stderr b/src/test/ui/associated-type-bounds/issue-71443-1.stderr new file mode 100644 index 00000000000..a9459ee7432 --- /dev/null +++ b/src/test/ui/associated-type-bounds/issue-71443-1.stderr @@ -0,0 +1,11 @@ +error[E0308]: mismatched types + --> $DIR/issue-71443-1.rs:6:5 + | +LL | fn hello<F: for<'a> Iterator<Item: 'a>>() { + | - help: try adding a return type: `-> Incorrect` +LL | Incorrect + | ^^^^^^^^^ expected `()`, found struct `Incorrect` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/associated-type-bounds/issue-71443-2.rs b/src/test/ui/associated-type-bounds/issue-71443-2.rs new file mode 100644 index 00000000000..813dcd60ad1 --- /dev/null +++ b/src/test/ui/associated-type-bounds/issue-71443-2.rs @@ -0,0 +1,11 @@ +// check-pass + +#![feature(associated_type_bounds)] + +fn hello<'b, F>() +where + for<'a> F: Iterator<Item: 'a> + 'b, +{ +} + +fn main() {} |
