regression test for issue 87490
This commit is contained in:
parent
37a49713cb
commit
c983c0a46a
2 changed files with 24 additions and 0 deletions
10
src/test/ui/issues/issue-87490.rs
Normal file
10
src/test/ui/issues/issue-87490.rs
Normal file
|
@ -0,0 +1,10 @@
|
|||
fn main() {}
|
||||
trait StreamOnce {
|
||||
type Position;
|
||||
}
|
||||
impl StreamOnce for &str {
|
||||
type Position = usize;
|
||||
}
|
||||
fn follow(_: &str) -> <&str as StreamOnce>::Position {
|
||||
String::new //~ ERROR mismatched types
|
||||
}
|
14
src/test/ui/issues/issue-87490.stderr
Normal file
14
src/test/ui/issues/issue-87490.stderr
Normal file
|
@ -0,0 +1,14 @@
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-87490.rs:9:5
|
||||
|
|
||||
LL | fn follow(_: &str) -> <&str as StreamOnce>::Position {
|
||||
| ------------------------------ expected `usize` because of return type
|
||||
LL | String::new
|
||||
| ^^^^^^^^^^^ expected `usize`, found fn item
|
||||
|
|
||||
= note: expected type `usize`
|
||||
found fn item `fn() -> String {String::new}`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
Loading…
Add table
Reference in a new issue