Skip to content

Commit

Permalink
Add UI test for issue rust-lang#92741
Browse files Browse the repository at this point in the history
  • Loading branch information
CastilloDel committed Feb 5, 2023
1 parent 3dd0044 commit 9cdc075
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/tools/tidy/src/ui_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use std::path::Path;
const ENTRY_LIMIT: usize = 1000;
// FIXME: The following limits should be reduced eventually.
const ROOT_ENTRY_LIMIT: usize = 939;
const ISSUES_ENTRY_LIMIT: usize = 1998;
const ISSUES_ENTRY_LIMIT: usize = 2000;

fn check_entries(path: &Path, bad: &mut bool) {
for dir in Walk::new(&path.join("ui")) {
Expand Down
6 changes: 6 additions & 0 deletions tests/ui/issues/issue-92741.rs
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 }
}
19 changes: 19 additions & 0 deletions tests/ui/issues/issue-92741.stderr
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`.

0 comments on commit 9cdc075

Please sign in to comment.