forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add UI test for issue rust-lang#92741
- Loading branch information
1 parent
3dd0044
commit 9cdc075
Showing
3 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
fn main() {} | ||
fn foo() -> bool { | ||
& //~ ERROR 3:5: 5:36: mismatched types [E0308] | ||
mut | ||
if true { true } else { false } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
error[E0308]: mismatched types | ||
--> $DIR/issue-92741.rs:3:5 | ||
| | ||
LL | fn foo() -> bool { | ||
| ---- expected `bool` because of return type | ||
LL | / & | ||
LL | | mut | ||
LL | | if true { true } else { false } | ||
| |___________________________________^ expected `bool`, found `&mut bool` | ||
| | ||
help: consider removing the borrow | ||
| | ||
LL - & | ||
LL - mut | ||
| | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0308`. |