Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change message infered type for closure #84476

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/rustc_typeck/src/check/demand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1082,7 +1082,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
err.span_note(
sp,
&format!(
"return type inferred to be `{}` here",
"type inferred to be `{}` here",
self.resolve_vars_if_possible(expected)
),
);
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/closures/closure-return-type-mismatch.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error[E0308]: mismatched types
LL | a
| ^ expected `&str`, found `bool`
|
note: return type inferred to be `&str` here
note: type inferred to be `&str` here
--> $DIR/closure-return-type-mismatch.rs:4:20
|
LL | return "test";
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/closures/issue-84128.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error[E0308]: mismatched types
LL | Foo(())
| ^^ expected integer, found `()`
|
note: return type inferred to be `{integer}` here
note: type inferred to be `{integer}` here
--> $DIR/issue-84128.rs:10:20
|
LL | return Foo(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LL | 5
|
= note: expected type `Result<{integer}, _>`
found type `{integer}`
note: return type inferred to be `Result<{integer}, _>` here
note: type inferred to be `Result<{integer}, _>` here
--> $DIR/type-mismatch-signature-deduction.rs:8:20
|
LL | return Ok(6);
Expand Down