Skip to content

Commit d4275e0

Browse files
committed
Update tests for new TRPL chapter order
1 parent 559a2d2 commit d4275e0

File tree

57 files changed

+139
-139
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+139
-139
lines changed

compiler/rustc_hir_typeck/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ fn report_unexpected_variant_res(
364364
.with_code(err_code);
365365
match res {
366366
Res::Def(DefKind::Fn | DefKind::AssocFn, _) if err_code == E0164 => {
367-
let patterns_url = "https://doc.rust-lang.org/book/ch18-00-patterns.html";
367+
let patterns_url = "https://doc.rust-lang.org/book/ch19-00-patterns.html";
368368
err.with_span_label(span, "`fn` calls are not allowed in patterns")
369369
.with_help(format!("for more information, visit {patterns_url}"))
370370
}

compiler/rustc_resolve/src/late/diagnostics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1206,7 +1206,7 @@ impl<'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> {
12061206
let PathSource::TupleStruct(_, _) = source else { return };
12071207
let Some(Res::Def(DefKind::Fn, _)) = res else { return };
12081208
err.primary_message("expected a pattern, found a function call");
1209-
err.note("function calls are not allowed in patterns: <https://doc.rust-lang.org/book/ch18-00-patterns.html>");
1209+
err.note("function calls are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html>");
12101210
}
12111211

12121212
fn suggest_changing_type_to_const_param(

tests/ui/closures/2229_closure_analysis/bad-pattern.stderr

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | let 0 = v1;
55
| ^ pattern `1_u32..=u32::MAX` not covered
66
|
77
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
8-
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
8+
= note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html
99
= note: the matched value is of type `u32`
1010
help: you might want to use `if let` to ignore the variant that isn't matched
1111
|
@@ -23,7 +23,7 @@ LL | let (0 | 1) = v1;
2323
| ^^^^^ pattern `2_u32..=u32::MAX` not covered
2424
|
2525
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
26-
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
26+
= note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html
2727
= note: the matched value is of type `u32`
2828
help: you might want to use `if let` to ignore the variant that isn't matched
2929
|
@@ -37,7 +37,7 @@ LL | let 1.. = v1;
3737
| ^^^ pattern `0_u32` not covered
3838
|
3939
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
40-
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
40+
= note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html
4141
= note: the matched value is of type `u32`
4242
help: you might want to use `if let` to ignore the variant that isn't matched
4343
|
@@ -51,7 +51,7 @@ LL | let [0, 0, 0, 0] = v2;
5151
| ^^^^^^^^^^^^ pattern `[1_u32..=u32::MAX, _, _, _]` not covered
5252
|
5353
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
54-
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
54+
= note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html
5555
= note: the matched value is of type `[u32; 4]`
5656
help: you might want to use `if let` to ignore the variant that isn't matched
5757
|
@@ -65,7 +65,7 @@ LL | let [0] = v4;
6565
| ^^^ patterns `&[]` and `&[_, _, ..]` not covered
6666
|
6767
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
68-
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
68+
= note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html
6969
= note: the matched value is of type `&[u32]`
7070
help: you might want to use `if let` to ignore the variants that aren't matched
7171
|
@@ -79,7 +79,7 @@ LL | let Refutable::A = v3;
7979
| ^^^^^^^^^^^^ pattern `Refutable::B` not covered
8080
|
8181
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
82-
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
82+
= note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html
8383
note: `Refutable` defined here
8484
--> $DIR/bad-pattern.rs:4:6
8585
|
@@ -104,7 +104,7 @@ LL | let PAT = v1;
104104
| ^^^ pattern `1_u32..=u32::MAX` not covered
105105
|
106106
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
107-
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
107+
= note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html
108108
= note: the matched value is of type `u32`
109109
help: introduce a variable instead
110110
|

tests/ui/consts/const-match-check.eval1.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | A = { let 0 = 0; 0 },
55
| ^ patterns `i32::MIN..=-1_i32` and `1_i32..=i32::MAX` not covered
66
|
77
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
8-
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
8+
= note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html
99
= note: the matched value is of type `i32`
1010
help: you might want to use `if let` to ignore the variants that aren't matched
1111
|

tests/ui/consts/const-match-check.eval2.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | let x: [i32; { let 0 = 0; 0 }] = [];
55
| ^ patterns `i32::MIN..=-1_i32` and `1_i32..=i32::MAX` not covered
66
|
77
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
8-
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
8+
= note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html
99
= note: the matched value is of type `i32`
1010
help: you might want to use `if let` to ignore the variants that aren't matched
1111
|

tests/ui/consts/const-match-check.matchck.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | const X: i32 = { let 0 = 0; 0 };
55
| ^ patterns `i32::MIN..=-1_i32` and `1_i32..=i32::MAX` not covered
66
|
77
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
8-
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
8+
= note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html
99
= note: the matched value is of type `i32`
1010
help: you might want to use `if let` to ignore the variants that aren't matched
1111
|
@@ -23,7 +23,7 @@ LL | static Y: i32 = { let 0 = 0; 0 };
2323
| ^ patterns `i32::MIN..=-1_i32` and `1_i32..=i32::MAX` not covered
2424
|
2525
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
26-
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
26+
= note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html
2727
= note: the matched value is of type `i32`
2828
help: you might want to use `if let` to ignore the variants that aren't matched
2929
|
@@ -41,7 +41,7 @@ LL | const X: i32 = { let 0 = 0; 0 };
4141
| ^ patterns `i32::MIN..=-1_i32` and `1_i32..=i32::MAX` not covered
4242
|
4343
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
44-
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
44+
= note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html
4545
= note: the matched value is of type `i32`
4646
help: you might want to use `if let` to ignore the variants that aren't matched
4747
|
@@ -59,7 +59,7 @@ LL | const X: i32 = { let 0 = 0; 0 };
5959
| ^ patterns `i32::MIN..=-1_i32` and `1_i32..=i32::MAX` not covered
6060
|
6161
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
62-
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
62+
= note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html
6363
= note: the matched value is of type `i32`
6464
help: you might want to use `if let` to ignore the variants that aren't matched
6565
|

tests/ui/consts/const-pattern-irrefutable.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | let a = 4;
88
| ^ patterns `0_u8..=1_u8` and `3_u8..=u8::MAX` not covered
99
|
1010
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
11-
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
11+
= note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html
1212
= note: the matched value is of type `u8`
1313
help: introduce a variable instead
1414
|
@@ -25,7 +25,7 @@ LL | let c = 4;
2525
| ^ patterns `0_u8..=1_u8` and `3_u8..=u8::MAX` not covered
2626
|
2727
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
28-
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
28+
= note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html
2929
= note: the matched value is of type `u8`
3030
help: introduce a variable instead
3131
|
@@ -42,7 +42,7 @@ LL | let d = (4, 4);
4242
| ^ patterns `(0_u8..=1_u8, _)` and `(3_u8..=u8::MAX, _)` not covered
4343
|
4444
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
45-
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
45+
= note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html
4646
= note: the matched value is of type `(u8, u8)`
4747
help: introduce a variable instead
4848
|
@@ -59,7 +59,7 @@ LL | let e = S {
5959
| ^ pattern `S { foo: 1_u8..=u8::MAX }` not covered
6060
|
6161
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
62-
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
62+
= note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html
6363
note: `S` defined here
6464
--> $DIR/const-pattern-irrefutable.rs:15:8
6565
|

tests/ui/destructuring-assignment/non-exhaustive-destructure.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | None = Some(3);
55
| ^^^^ pattern `Some(_)` not covered
66
|
77
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
8-
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
8+
= note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html
99
= note: the matched value is of type `Option<i32>`
1010
help: you might want to use `if let` to ignore the variant that isn't matched
1111
|

tests/ui/empty/empty-never-array.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | let Helper::U(u) = Helper::T(t, []);
55
| ^^^^^^^^^^^^ pattern `Helper::T(_, _)` not covered
66
|
77
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
8-
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
8+
= note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html
99
note: `Helper<T, U>` defined here
1010
--> $DIR/empty-never-array.rs:3:6
1111
|

tests/ui/error-codes/E0005.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | let Some(y) = x;
55
| ^^^^^^^ pattern `None` not covered
66
|
77
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
8-
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
8+
= note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html
99
= note: the matched value is of type `Option<i32>`
1010
help: you might want to use `let else` to handle the variant that isn't matched
1111
|

0 commit comments

Comments
 (0)