diff options
| author | bors <bors@rust-lang.org> | 2023-08-05 15:53:07 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-08-05 15:53:07 +0000 |
| commit | 9565b68b741fd0466b3af075139e819e7d73ee38 (patch) | |
| tree | 2e6a114239819d9a5568761e7e830c438f8c8144 | |
| parent | fbc11e96901a1f1a0cc865867f38684af250249f (diff) | |
| parent | 6ba393c28f1bdb388ec1ca1117e81d726afbfa51 (diff) | |
| download | rust-9565b68b741fd0466b3af075139e819e7d73ee38.tar.gz rust-9565b68b741fd0466b3af075139e819e7d73ee38.zip | |
Auto merge of #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 ](https://github.com/rust-lang/rust/issues/100605) where the compiler gave bad advice for an `Option<&String>`. Rename the file appropriately. Part of #73494
| -rw-r--r-- | src/tools/tidy/src/ui_tests.rs | 2 | ||||
| -rw-r--r-- | tests/ui/issues/issue-100605.rs | 9 | ||||
| -rw-r--r-- | tests/ui/type/option-ref-advice.rs | 11 | ||||
| -rw-r--r-- | tests/ui/type/option-ref-advice.stderr (renamed from tests/ui/issues/issue-100605.stderr) | 8 |
4 files changed, 16 insertions, 14 deletions
diff --git a/src/tools/tidy/src/ui_tests.rs b/src/tools/tidy/src/ui_tests.rs index 930b7408390..3414924007b 100644 --- a/src/tools/tidy/src/ui_tests.rs +++ b/src/tools/tidy/src/ui_tests.rs @@ -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] = &[ diff --git a/tests/ui/issues/issue-100605.rs b/tests/ui/issues/issue-100605.rs deleted file mode 100644 index 917a45c15bb..00000000000 --- a/tests/ui/issues/issue-100605.rs +++ /dev/null @@ -1,9 +0,0 @@ -fn takes_option(_arg: Option<&String>) {} - -fn main() { - takes_option(&None); //~ ERROR 4:18: 4:23: mismatched types [E0308] - - let x = String::from("x"); - let res = Some(x); - takes_option(&res); //~ ERROR 8:18: 8:22: mismatched types [E0308] -} diff --git a/tests/ui/type/option-ref-advice.rs b/tests/ui/type/option-ref-advice.rs new file mode 100644 index 00000000000..2dcee5a2eb9 --- /dev/null +++ b/tests/ui/type/option-ref-advice.rs @@ -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] +} diff --git a/tests/ui/issues/issue-100605.stderr b/tests/ui/type/option-ref-advice.stderr index 6f11f44755a..d4dbef3013f 100644 --- a/tests/ui/issues/issue-100605.stderr +++ b/tests/ui/type/option-ref-advice.stderr @@ -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<_>` @@ -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>) {} | ^^^^^^^^^^^^ --------------------- @@ -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>` @@ -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>) {} | ^^^^^^^^^^^^ --------------------- |
