Skip to content

Commit 9565b68

Browse files
committed
Auto merge of rust-lang#114143 - Enselic:rename-issue-100605, r=eholk
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
2 parents fbc11e9 + 6ba393c commit 9565b68

File tree

4 files changed

+16
-14
lines changed

4 files changed

+16
-14
lines changed

Diff for: src/tools/tidy/src/ui_tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use std::path::{Path, PathBuf};
1010

1111
const ENTRY_LIMIT: usize = 900;
1212
// FIXME: The following limits should be reduced eventually.
13-
const ISSUES_ENTRY_LIMIT: usize = 1893;
13+
const ISSUES_ENTRY_LIMIT: usize = 1891;
1414
const ROOT_ENTRY_LIMIT: usize = 866;
1515

1616
const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[

Diff for: tests/ui/issues/issue-100605.rs

-9
This file was deleted.

Diff for: tests/ui/type/option-ref-advice.rs

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Regression test for https://github.com/rust-lang/rust/issues/100605
2+
3+
fn takes_option(_arg: Option<&String>) {}
4+
5+
fn main() {
6+
takes_option(&None); //~ ERROR 6:18: 6:23: mismatched types [E0308]
7+
8+
let x = String::from("x");
9+
let res = Some(x);
10+
takes_option(&res); //~ ERROR 10:18: 10:22: mismatched types [E0308]
11+
}

Diff for: tests/ui/issues/issue-100605.stderr renamed to tests/ui/type/option-ref-advice.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0308]: mismatched types
2-
--> $DIR/issue-100605.rs:4:18
2+
--> $DIR/option-ref-advice.rs:6:18
33
|
44
LL | takes_option(&None);
55
| ------------ ^^^^^ expected `Option<&String>`, found `&Option<_>`
@@ -9,7 +9,7 @@ LL | takes_option(&None);
99
= note: expected enum `Option<&String>`
1010
found reference `&Option<_>`
1111
note: function defined here
12-
--> $DIR/issue-100605.rs:1:4
12+
--> $DIR/option-ref-advice.rs:3:4
1313
|
1414
LL | fn takes_option(_arg: Option<&String>) {}
1515
| ^^^^^^^^^^^^ ---------------------
@@ -20,7 +20,7 @@ LL + takes_option(None);
2020
|
2121

2222
error[E0308]: mismatched types
23-
--> $DIR/issue-100605.rs:8:18
23+
--> $DIR/option-ref-advice.rs:10:18
2424
|
2525
LL | takes_option(&res);
2626
| ------------ ^^^^ expected `Option<&String>`, found `&Option<String>`
@@ -30,7 +30,7 @@ LL | takes_option(&res);
3030
= note: expected enum `Option<&String>`
3131
found reference `&Option<String>`
3232
note: function defined here
33-
--> $DIR/issue-100605.rs:1:4
33+
--> $DIR/option-ref-advice.rs:3:4
3434
|
3535
LL | fn takes_option(_arg: Option<&String>) {}
3636
| ^^^^^^^^^^^^ ---------------------

0 commit comments

Comments
 (0)