Skip to content

Commit c0e3dde

Browse files
authored
Rollup merge of #91239 - cameron1024:issue-87490-regression, r=jackh726
regression test for issue 87490 Closes #87490
2 parents 50327d2 + c983c0a commit c0e3dde

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

Diff for: src/test/ui/issues/issue-87490.rs

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
fn main() {}
2+
trait StreamOnce {
3+
type Position;
4+
}
5+
impl StreamOnce for &str {
6+
type Position = usize;
7+
}
8+
fn follow(_: &str) -> <&str as StreamOnce>::Position {
9+
String::new //~ ERROR mismatched types
10+
}

Diff for: src/test/ui/issues/issue-87490.stderr

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error[E0308]: mismatched types
2+
--> $DIR/issue-87490.rs:9:5
3+
|
4+
LL | fn follow(_: &str) -> <&str as StreamOnce>::Position {
5+
| ------------------------------ expected `usize` because of return type
6+
LL | String::new
7+
| ^^^^^^^^^^^ expected `usize`, found fn item
8+
|
9+
= note: expected type `usize`
10+
found fn item `fn() -> String {String::new}`
11+
12+
error: aborting due to previous error
13+
14+
For more information about this error, try `rustc --explain E0308`.

0 commit comments

Comments
 (0)