diff options
| author | dianne <diannes.gm@gmail.com> | 2025-02-04 03:18:10 -0800 |
|---|---|---|
| committer | dianne <diannes.gm@gmail.com> | 2025-02-10 23:32:54 -0800 |
| commit | 6ff2d19d1ca79f94d1972a82d03f73184d95beff (patch) | |
| tree | 6dd351a3849f47c204d6dece85e98a5aef448a04 /tests | |
| parent | 2ee601ced63c639bf2d84a9495203821b2a48991 (diff) | |
| download | rust-6ff2d19d1ca79f94d1972a82d03f73184d95beff.tar.gz rust-6ff2d19d1ca79f94d1972a82d03f73184d95beff.zip | |
experimentally label the spans for default binding modes
(cherry picked from commit 203d3109d8e96a6a4075205e836216d7cd281d5b)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/pattern/rfc-3627-match-ergonomics-2024/migration_lint.stderr | 155 | ||||
| -rw-r--r-- | tests/ui/pattern/rfc-3627-match-ergonomics-2024/min_match_ergonomics_fail.stderr | 56 |
2 files changed, 105 insertions, 106 deletions
diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/migration_lint.stderr b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/migration_lint.stderr index cbb94a52878..febf10cd1f3 100644 --- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/migration_lint.stderr +++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/migration_lint.stderr @@ -2,10 +2,10 @@ error: binding modifiers may only be written when the default binding mode is `m --> $DIR/migration_lint.rs:25:13 | LL | let Foo(mut x) = &Foo(0); - | ^^^-- - | | - | this binding modifier - | default binding mode is `ref` + | ----^^^--- + | | | + | | this binding modifier + | default binding mode is `ref` | = warning: this changes meaning in Rust 2024 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html> @@ -23,10 +23,10 @@ error: binding modifiers may only be written when the default binding mode is `m --> $DIR/migration_lint.rs:30:13 | LL | let Foo(mut x) = &mut Foo(0); - | ^^^-- - | | - | this binding modifier - | default binding mode is `ref mut` + | ----^^^--- + | | | + | | this binding modifier + | default binding mode is `ref mut` | = warning: this changes meaning in Rust 2024 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html> @@ -39,10 +39,10 @@ error: binding modifiers may only be written when the default binding mode is `m --> $DIR/migration_lint.rs:35:13 | LL | let Foo(ref x) = &Foo(0); - | ^^^-- - | | - | this binding modifier - | default binding mode is `ref` + | ----^^^--- + | | | + | | this binding modifier + | default binding mode is `ref` | = warning: this changes meaning in Rust 2024 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html> @@ -55,10 +55,10 @@ error: binding modifiers may only be written when the default binding mode is `m --> $DIR/migration_lint.rs:40:13 | LL | let Foo(ref x) = &mut Foo(0); - | ^^^-- - | | - | this binding modifier - | default binding mode is `ref mut` + | ----^^^--- + | | | + | | this binding modifier + | default binding mode is `ref mut` | = warning: this changes meaning in Rust 2024 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html> @@ -71,10 +71,10 @@ error: reference patterns may only be written when the default binding mode is ` --> $DIR/migration_lint.rs:57:13 | LL | let Foo(&x) = &Foo(&0); - | ^- - | | - | this reference pattern - | default binding mode is `ref` + | ----^-- + | | | + | | this reference pattern + | default binding mode is `ref` | = warning: this changes meaning in Rust 2024 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html> @@ -87,10 +87,10 @@ error: reference patterns may only be written when the default binding mode is ` --> $DIR/migration_lint.rs:62:13 | LL | let Foo(&mut x) = &Foo(&mut 0); - | ^^^^-- - | | - | this reference pattern - | default binding mode is `ref` + | ----^^^^--- + | | | + | | this reference pattern + | default binding mode is `ref` | = warning: this changes meaning in Rust 2024 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html> @@ -103,10 +103,10 @@ error: reference patterns may only be written when the default binding mode is ` --> $DIR/migration_lint.rs:67:13 | LL | let Foo(&x) = &mut Foo(&0); - | ^- - | | - | this reference pattern - | default binding mode is `ref mut` + | ----^-- + | | | + | | this reference pattern + | default binding mode is `ref mut` | = warning: this changes meaning in Rust 2024 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html> @@ -119,10 +119,10 @@ error: reference patterns may only be written when the default binding mode is ` --> $DIR/migration_lint.rs:72:13 | LL | let Foo(&mut x) = &mut Foo(&mut 0); - | ^^^^-- - | | - | this reference pattern - | default binding mode is `ref mut` + | ----^^^^--- + | | | + | | this reference pattern + | default binding mode is `ref mut` | = warning: this changes meaning in Rust 2024 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html> @@ -135,10 +135,10 @@ error: reference patterns may only be written when the default binding mode is ` --> $DIR/migration_lint.rs:81:17 | LL | if let Some(&x) = &&&&&Some(&0u8) { - | ^- - | | - | this reference pattern - | default binding mode is `ref` + | -----^-- + | | | + | | this reference pattern + | default binding mode is `ref` | = warning: this changes meaning in Rust 2024 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html> @@ -151,10 +151,10 @@ error: reference patterns may only be written when the default binding mode is ` --> $DIR/migration_lint.rs:87:17 | LL | if let Some(&mut x) = &&&&&Some(&mut 0u8) { - | ^^^^-- - | | - | this reference pattern - | default binding mode is `ref` + | -----^^^^--- + | | | + | | this reference pattern + | default binding mode is `ref` | = warning: this changes meaning in Rust 2024 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html> @@ -167,10 +167,10 @@ error: reference patterns may only be written when the default binding mode is ` --> $DIR/migration_lint.rs:93:17 | LL | if let Some(&x) = &&&&&mut Some(&0u8) { - | ^- - | | - | this reference pattern - | default binding mode is `ref` + | -----^-- + | | | + | | this reference pattern + | default binding mode is `ref` | = warning: this changes meaning in Rust 2024 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html> @@ -183,10 +183,10 @@ error: reference patterns may only be written when the default binding mode is ` --> $DIR/migration_lint.rs:99:17 | LL | if let Some(&mut Some(Some(x))) = &mut Some(&mut Some(&mut Some(0u8))) { - | ^^^^-------------- - | | - | this reference pattern - | default binding mode is `ref mut` + | -----^^^^--------------- + | | | + | | this reference pattern + | default binding mode is `ref mut` | = warning: this changes meaning in Rust 2024 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html> @@ -199,10 +199,10 @@ error: binding modifiers may only be written when the default binding mode is `m --> $DIR/migration_lint.rs:111:21 | LL | let Struct { a, mut b, c } = &Struct { a: 0, b: 0, c: 0 }; - | ^^^-- - | | - | this binding modifier - | default binding mode is `ref` + | ------------^^^------- + | | | + | | this binding modifier + | default binding mode is `ref` | = warning: this changes meaning in Rust 2024 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html> @@ -215,12 +215,11 @@ error: binding modifiers and reference patterns may only be written when the def --> $DIR/migration_lint.rs:117:21 | LL | let Struct { a: &a, b, ref c } = &Struct { a: &0, b: &0, c: &0 }; - | ^- ^^^-- - | | | - | | this binding modifier - | | default binding mode is `ref` - | this reference pattern - | default binding mode is `ref` + | ------------^------^^^---- + | | | | + | | | this binding modifier + | | this reference pattern + | default binding mode is `ref` | = warning: this changes meaning in Rust 2024 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html> @@ -233,12 +232,11 @@ error: reference patterns may only be written when the default binding mode is ` --> $DIR/migration_lint.rs:124:24 | LL | if let Struct { a: &Some(a), b: Some(&b), c: Some(c) } = - | ^------- ^- - | | | - | | this reference pattern - | | default binding mode is `ref` - | this reference pattern - | default binding mode is `ref` + | ------------^-----------------^---------------- + | | | | + | | | this reference pattern + | | this reference pattern + | default binding mode is `ref` | = warning: this changes meaning in Rust 2024 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html> @@ -251,10 +249,11 @@ error: binding modifiers may only be written when the default binding mode is `m --> $DIR/migration_lint.rs:137:15 | LL | (Some(mut x), migration_lint_macros::mixed_edition_pat!(y)) => { - | ^^^-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ occurs within macro expansion - | | - | this binding modifier - | default binding mode is `ref` + | ------^^^-----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- + | | | | + | | | occurs within macro expansion + | | this binding modifier + | default binding mode is `ref` | = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html> = note: this error originates in the macro `migration_lint_macros::mixed_edition_pat` (in Nightly builds, run with -Z macro-backtrace for more info) @@ -267,12 +266,12 @@ error: binding modifiers and reference patterns may only be written when the def --> $DIR/migration_lint.rs:145:10 | LL | let [&mut [ref a]] = &mut [&mut &[0]]; - | ^^^^--^^^--- - | | | - | | this binding modifier - | | default binding mode is `ref` - | this reference pattern - | default binding mode is `ref mut` + | -^^^^--^^^---- + | || || + | || |this binding modifier + | || default binding mode is `ref` + | |this reference pattern + | default binding mode is `ref mut` | = warning: this changes meaning in Rust 2024 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html> @@ -285,10 +284,10 @@ error: reference patterns may only be written when the default binding mode is ` --> $DIR/migration_lint.rs:150:10 | LL | let [&(_)] = &[&0]; - | ^^-- - | | - | this reference pattern - | default binding mode is `ref` + | -^^--- + | || + | |this reference pattern + | default binding mode is `ref` | = warning: this changes meaning in Rust 2024 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html> diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/min_match_ergonomics_fail.stderr b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/min_match_ergonomics_fail.stderr index ce93199b186..ca1749074c1 100644 --- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/min_match_ergonomics_fail.stderr +++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/min_match_ergonomics_fail.stderr @@ -103,10 +103,10 @@ error: reference patterns may only be written when the default binding mode is ` --> $DIR/min_match_ergonomics_fail.rs:24:20 | LL | test_pat_on_type![(&x,): &(&T,)]; - | ^- - | | - | this reference pattern - | default binding mode is `ref` + | -^--- + | || + | |this reference pattern + | default binding mode is `ref` | = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html> help: make the implied reference pattern explicit @@ -118,10 +118,10 @@ error: reference patterns may only be written when the default binding mode is ` --> $DIR/min_match_ergonomics_fail.rs:27:20 | LL | test_pat_on_type![(&mut x,): &(&mut T,)]; - | ^^^^-- - | | - | this reference pattern - | default binding mode is `ref` + | -^^^^---- + | || + | |this reference pattern + | default binding mode is `ref` | = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html> help: make the implied reference pattern explicit @@ -133,10 +133,10 @@ error: reference patterns may only be written when the default binding mode is ` --> $DIR/min_match_ergonomics_fail.rs:31:28 | LL | test_pat_on_type![Foo { f: &(x,) }: &Foo]; - | ^---- - | | - | this reference pattern - | default binding mode is `ref` + | ---------^------ + | | | + | | this reference pattern + | default binding mode is `ref` | = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html> help: make the implied reference pattern explicit @@ -148,10 +148,10 @@ error: binding modifiers may only be written when the default binding mode is `m --> $DIR/min_match_ergonomics_fail.rs:32:20 | LL | test_pat_on_type![(mut x,): &(T,)]; - | ^^^-- - | | - | this binding modifier - | default binding mode is `ref` + | -^^^---- + | || + | |this binding modifier + | default binding mode is `ref` | = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html> help: make the implied reference pattern explicit @@ -163,10 +163,10 @@ error: binding modifiers may only be written when the default binding mode is `m --> $DIR/min_match_ergonomics_fail.rs:33:20 | LL | test_pat_on_type![(ref x,): &(T,)]; - | ^^^-- - | | - | this binding modifier - | default binding mode is `ref` + | -^^^---- + | || + | |this binding modifier + | default binding mode is `ref` | = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html> help: make the implied reference pattern explicit @@ -178,10 +178,10 @@ error: binding modifiers may only be written when the default binding mode is `m --> $DIR/min_match_ergonomics_fail.rs:34:20 | LL | test_pat_on_type![(ref mut x,): &mut (T,)]; - | ^^^^^^^-- - | | - | this binding modifier - | default binding mode is `ref mut` + | -^^^^^^^---- + | || + | |this binding modifier + | default binding mode is `ref mut` | = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html> help: make the implied reference pattern explicit @@ -193,10 +193,10 @@ error: reference patterns may only be written when the default binding mode is ` --> $DIR/min_match_ergonomics_fail.rs:43:10 | LL | (&x,) => x, - | ^- - | | - | this reference pattern - | default binding mode is `ref` + | -^--- + | || + | |this reference pattern + | default binding mode is `ref` | = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html> help: make the implied reference pattern explicit |
