Skip to content

Commit

Permalink
Auto merge of rust-lang#114143 - Enselic:rename-issue-100605, r=eholk
Browse files Browse the repository at this point in the history
Rename tests/ui/issues/issue-100605.rs to ../type/option-ref-advice.rs

The test is a regression test for a [bug ](rust-lang#100605) where the compiler gave bad advice for an `Option<&String>`. Rename the file appropriately.

Part of rust-lang#73494
  • Loading branch information
bors committed Aug 5, 2023
2 parents fbc11e9 + 6ba393c commit 9565b68
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
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, PathBuf};

const ENTRY_LIMIT: usize = 900;
// FIXME: The following limits should be reduced eventually.
const ISSUES_ENTRY_LIMIT: usize = 1893;
const ISSUES_ENTRY_LIMIT: usize = 1891;
const ROOT_ENTRY_LIMIT: usize = 866;

const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[
Expand Down
9 changes: 0 additions & 9 deletions tests/ui/issues/issue-100605.rs

This file was deleted.

11 changes: 11 additions & 0 deletions tests/ui/type/option-ref-advice.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Regression test for https://github.com/rust-lang/rust/issues/100605

fn takes_option(_arg: Option<&String>) {}

fn main() {
takes_option(&None); //~ ERROR 6:18: 6:23: mismatched types [E0308]

let x = String::from("x");
let res = Some(x);
takes_option(&res); //~ ERROR 10:18: 10:22: mismatched types [E0308]
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
--> $DIR/issue-100605.rs:4:18
--> $DIR/option-ref-advice.rs:6:18
|
LL | takes_option(&None);
| ------------ ^^^^^ expected `Option<&String>`, found `&Option<_>`
Expand All @@ -9,7 +9,7 @@ LL | takes_option(&None);
= note: expected enum `Option<&String>`
found reference `&Option<_>`
note: function defined here
--> $DIR/issue-100605.rs:1:4
--> $DIR/option-ref-advice.rs:3:4
|
LL | fn takes_option(_arg: Option<&String>) {}
| ^^^^^^^^^^^^ ---------------------
Expand All @@ -20,7 +20,7 @@ LL + takes_option(None);
|

error[E0308]: mismatched types
--> $DIR/issue-100605.rs:8:18
--> $DIR/option-ref-advice.rs:10:18
|
LL | takes_option(&res);
| ------------ ^^^^ expected `Option<&String>`, found `&Option<String>`
Expand All @@ -30,7 +30,7 @@ LL | takes_option(&res);
= note: expected enum `Option<&String>`
found reference `&Option<String>`
note: function defined here
--> $DIR/issue-100605.rs:1:4
--> $DIR/option-ref-advice.rs:3:4
|
LL | fn takes_option(_arg: Option<&String>) {}
| ^^^^^^^^^^^^ ---------------------
Expand Down

0 comments on commit 9565b68

Please sign in to comment.