We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 50327d2 + c983c0a commit c0e3ddeCopy full SHA for c0e3dde
src/test/ui/issues/issue-87490.rs
@@ -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
src/test/ui/issues/issue-87490.stderr
@@ -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}`
11
+
12
+error: aborting due to previous error
13
14
+For more information about this error, try `rustc --explain E0308`.
0 commit comments