Skip to content

Commit e17a125

Browse files
committed
fixed all reviews
1 parent 7333e7e commit e17a125

File tree

55 files changed

+53
-313
lines changed

Some content is hidden

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

55 files changed

+53
-313
lines changed

library/core/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@
9595
//
9696
// Library features:
9797
// tidy-alphabetical-start
98-
#![cfg_attr(bootstrap, feature(if_let_guard))]
9998
#![feature(array_ptr_get)]
10099
#![feature(asm_experimental_arch)]
101100
#![feature(bigint_helper_methods)]

library/std/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,6 @@
268268
all(target_vendor = "fortanix", target_env = "sgx"),
269269
feature(slice_index_methods, coerce_unsized, sgx_platform)
270270
)]
271-
#![cfg_attr(bootstrap, feature(if_let_guard))]
272271
#![cfg_attr(any(windows, target_os = "uefi"), feature(round_char_boundary))]
273272
#![cfg_attr(target_family = "wasm", feature(stdarch_wasm_atomic_wait))]
274273
#![cfg_attr(target_arch = "wasm64", feature(simd_wasm64))]

src/tools/clippy/clippy_utils/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![cfg_attr(bootstrap, feature(if_let_guard))]
21
#![feature(box_patterns)]
32
#![feature(macro_metavar_expr)]
43
#![feature(never_type)]

src/tools/tidy/src/issues.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3659,7 +3659,6 @@ ui/rfcs/rfc-2396-target_feature-11/issue-99876.rs
36593659
ui/rfcs/rfc-2497-if-let-chains/issue-88498.rs
36603660
ui/rfcs/rfc-2497-if-let-chains/issue-90722.rs
36613661
ui/rfcs/rfc-2497-if-let-chains/issue-92145.rs
3662-
ui/rfcs/rfc-2497-if-let-chains/issue-93150.rs
36633662
ui/rfcs/rfc-2497-if-let-chains/issue-99938.rs
36643663
ui/rfcs/rfc-2528-type-changing-struct-update/issue-92010-trait-bound-not-satisfied.rs
36653664
ui/rfcs/rfc-2528-type-changing-struct-update/issue-96878.rs

tests/ui/binding/match-beginning-vert.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//@ run-pass
22

3-
43
enum Foo {
54
A,
65
B,

tests/ui/issues/issue-29723.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// test for https://github.com/rust-lang/rust/issues/29723
22

3-
43
fn main() {
54
let s = String::new();
65
let _s = match 0 {

tests/ui/issues/issue-29723.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0382]: use of moved value: `s`
2-
--> $DIR/issue-29723.rs:11:13
2+
--> $DIR/issue-29723.rs:10:13
33
|
44
LL | let s = String::new();
55
| - move occurs because `s` has type `String`, which does not implement the `Copy` trait
@@ -16,7 +16,7 @@ LL | 0 if { drop(s.clone()); false } => String::from("oops"),
1616
| ++++++++
1717

1818
error[E0382]: use of moved value: `s`
19-
--> $DIR/issue-29723.rs:19:14
19+
--> $DIR/issue-29723.rs:18:14
2020
|
2121
LL | let s = String::new();
2222
| - move occurs because `s` has type `String`, which does not implement the `Copy` trait

tests/ui/nll/issue-24535-allow-mutable-borrow-in-match-guard.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// See further discussion on rust-lang/rust#24535,
66
// rust-lang/rfcs#1006, and rust-lang/rfcs#107
77

8-
98
fn main() {
109
rust_issue_24535();
1110
rfcs_issue_1006_1();

tests/ui/nll/issue-27282-move-match-input-into-guard.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
// reaches the panic code when executed, despite the compiler warning
88
// about that match arm being unreachable.
99

10-
1110
fn main() {
1211
let b = &mut true;
1312
match b {

tests/ui/nll/issue-27282-move-match-input-into-guard.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0382]: use of moved value: `b`
2-
--> $DIR/issue-27282-move-match-input-into-guard.rs:13:5
2+
--> $DIR/issue-27282-move-match-input-into-guard.rs:12:5
33
|
44
LL | let b = &mut true;
55
| - move occurs because `b` has type `&mut bool`, which does not implement the `Copy` trait
@@ -12,7 +12,7 @@ LL | _ if { (|| { let bar = b; *bar = false; })();
1212
| value moved into closure here
1313

1414
error[E0382]: use of moved value: `b`
15-
--> $DIR/issue-27282-move-match-input-into-guard.rs:23:5
15+
--> $DIR/issue-27282-move-match-input-into-guard.rs:22:5
1616
|
1717
LL | let b = &mut true;
1818
| - move occurs because `b` has type `&mut bool`, which does not implement the `Copy` trait

tests/ui/nll/issue-27282-move-ref-mut-into-guard.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// mutable borrows in match guards by hiding the mutable borrow in a
33
// guard behind a move (of the ref mut pattern id) within a closure.
44

5-
65
fn main() {
76
match Some(&4) {
87
None => {},

tests/ui/nll/issue-27282-move-ref-mut-into-guard.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0507]: cannot move out of `foo` in pattern guard
2-
--> $DIR/issue-27282-move-ref-mut-into-guard.rs:10:19
2+
--> $DIR/issue-27282-move-ref-mut-into-guard.rs:9:19
33
|
44
LL | if { (|| { let mut bar = foo; bar.take() })(); false } => {},
55
| ^^ --- move occurs because `foo` has type `&mut Option<&i32>`, which does not implement the `Copy` trait
@@ -9,7 +9,7 @@ LL | if { (|| { let mut bar = foo; bar.take() })(); false } => {},
99
= note: variables bound in patterns cannot be moved from until after the end of the pattern guard
1010

1111
error[E0507]: cannot move out of `foo` in pattern guard
12-
--> $DIR/issue-27282-move-ref-mut-into-guard.rs:18:34
12+
--> $DIR/issue-27282-move-ref-mut-into-guard.rs:17:34
1313
|
1414
LL | if let Some(()) = { (|| { let mut bar = foo; bar.take() })(); None } => {},
1515
| ^^ --- move occurs because `foo` has type `&mut Option<&i32>`, which does not implement the `Copy` trait

tests/ui/nll/issue-27282-reborrow-ref-mut-in-guard.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// reject it. But I want to make sure that we continue to reject it
66
// (under NLL) even when that conservative check goes away.
77

8-
98
fn main() {
109
let mut b = &mut true;
1110
match b {

tests/ui/nll/issue-27282-reborrow-ref-mut-in-guard.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0596]: cannot borrow `r` as mutable, as it is immutable for the pattern guard
2-
--> $DIR/issue-27282-reborrow-ref-mut-in-guard.rs:13:25
2+
--> $DIR/issue-27282-reborrow-ref-mut-in-guard.rs:12:25
33
|
44
LL | ref mut r if { (|| { let bar = &mut *r; **bar = false; })();
55
| ^^ -- mutable borrow occurs due to use of `r` in closure
@@ -9,7 +9,7 @@ LL | ref mut r if { (|| { let bar = &mut *r; **bar = false; })();
99
= note: variables bound in patterns are immutable until the end of the pattern guard
1010

1111
error[E0596]: cannot borrow `r` as mutable, as it is immutable for the pattern guard
12-
--> $DIR/issue-27282-reborrow-ref-mut-in-guard.rs:23:40
12+
--> $DIR/issue-27282-reborrow-ref-mut-in-guard.rs:22:40
1313
|
1414
LL | ref mut r if let Some(()) = { (|| { let bar = &mut *r; **bar = false; })();
1515
| ^^ -- mutable borrow occurs due to use of `r` in closure

tests/ui/nll/match-cfg-fake-edges.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Test that we have enough false edges to avoid exposing the exact matching
22
// algorithm in borrow checking.
33

4-
54
#[rustfmt::skip]
65
fn all_patterns_are_tested() {
76
// Even though `x` is never actually moved out of, we don't want borrowck results to be based on

tests/ui/nll/match-cfg-fake-edges.stderr

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
warning: irrefutable `if let` pattern
2-
--> $DIR/match-cfg-fake-edges.rs:18:8
2+
--> $DIR/match-cfg-fake-edges.rs:17:8
33
|
44
LL | if let _ = true {
55
| ^^^^^^^^^^^^
@@ -9,7 +9,7 @@ LL | if let _ = true {
99
= note: `#[warn(irrefutable_let_patterns)]` on by default
1010

1111
error[E0382]: use of moved value: `x`
12-
--> $DIR/match-cfg-fake-edges.rs:15:10
12+
--> $DIR/match-cfg-fake-edges.rs:14:10
1313
|
1414
LL | let x = String::new();
1515
| - move occurs because `x` has type `String`, which does not implement the `Copy` trait
@@ -26,7 +26,7 @@ LL | _ => drop(x.clone()),
2626
| ++++++++
2727

2828
error[E0382]: use of moved value: `x`
29-
--> $DIR/match-cfg-fake-edges.rs:23:10
29+
--> $DIR/match-cfg-fake-edges.rs:22:10
3030
|
3131
LL | let x = String::new();
3232
| - move occurs because `x` has type `String`, which does not implement the `Copy` trait
@@ -43,7 +43,7 @@ LL | drop(x.clone())
4343
| ++++++++
4444

4545
error[E0382]: borrow of moved value: `x.0`
46-
--> $DIR/match-cfg-fake-edges.rs:29:5
46+
--> $DIR/match-cfg-fake-edges.rs:28:5
4747
|
4848
LL | (y, _) | (_, y) => (),
4949
| - value moved here
@@ -58,7 +58,7 @@ LL | (ref y, _) | (_, y) => (),
5858
| +++
5959

6060
error[E0382]: borrow of moved value: `x.1`
61-
--> $DIR/match-cfg-fake-edges.rs:31:5
61+
--> $DIR/match-cfg-fake-edges.rs:30:5
6262
|
6363
LL | (y, _) | (_, y) => (),
6464
| - value moved here
@@ -73,7 +73,7 @@ LL | (y, _) | (_, ref y) => (),
7373
| +++
7474

7575
error[E0382]: borrow of moved value: `x.0`
76-
--> $DIR/match-cfg-fake-edges.rs:35:5
76+
--> $DIR/match-cfg-fake-edges.rs:34:5
7777
|
7878
LL | let ((y, _) | (_, y)) = x;
7979
| - value moved here
@@ -87,7 +87,7 @@ LL | let ((ref y, _) | (_, y)) = x;
8787
| +++
8888

8989
error[E0382]: borrow of moved value: `x.1`
90-
--> $DIR/match-cfg-fake-edges.rs:37:5
90+
--> $DIR/match-cfg-fake-edges.rs:36:5
9191
|
9292
LL | let ((y, _) | (_, y)) = x;
9393
| - value moved here
@@ -102,7 +102,7 @@ LL | let ((y, _) | (_, ref y)) = x;
102102
| +++
103103

104104
error[E0381]: used binding `x` is possibly-uninitialized
105-
--> $DIR/match-cfg-fake-edges.rs:71:19
105+
--> $DIR/match-cfg-fake-edges.rs:70:19
106106
|
107107
LL | let x;
108108
| - binding declared here but left uninitialized
@@ -113,7 +113,7 @@ LL | _ => drop(x),
113113
| if this pattern is matched, `x` is not initialized
114114

115115
error[E0381]: used binding `x` isn't initialized
116-
--> $DIR/match-cfg-fake-edges.rs:78:16
116+
--> $DIR/match-cfg-fake-edges.rs:77:16
117117
|
118118
LL | let x;
119119
| - binding declared here but left uninitialized
@@ -130,7 +130,7 @@ LL | let x = 42;
130130
| ++++
131131

132132
error[E0381]: used binding `x` isn't initialized
133-
--> $DIR/match-cfg-fake-edges.rs:85:31
133+
--> $DIR/match-cfg-fake-edges.rs:84:31
134134
|
135135
LL | let x;
136136
| - binding declared here but left uninitialized
@@ -146,7 +146,7 @@ LL | let x = 42;
146146
| ++++
147147

148148
error[E0382]: use of moved value: `x`
149-
--> $DIR/match-cfg-fake-edges.rs:98:22
149+
--> $DIR/match-cfg-fake-edges.rs:97:22
150150
|
151151
LL | let x = String::new();
152152
| - move occurs because `x` has type `String`, which does not implement the `Copy` trait
@@ -163,7 +163,7 @@ LL | false if { drop(x.clone()); true } => {},
163163
| ++++++++
164164

165165
error[E0382]: use of moved value: `x`
166-
--> $DIR/match-cfg-fake-edges.rs:113:22
166+
--> $DIR/match-cfg-fake-edges.rs:112:22
167167
|
168168
LL | let x = String::new();
169169
| - move occurs because `x` has type `String`, which does not implement the `Copy` trait

tests/ui/parser/struct-literal-in-match-guard.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// Unlike `if` condition, `match` guards accept struct literals.
44
// This is detected in <https://github.com/rust-lang/rust/pull/74566#issuecomment-663613705>.
55

6-
76
#[derive(PartialEq)]
87
struct Foo {
98
x: isize,

tests/ui/rfcs/rfc-2294-if-let-guard/drop-order.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,11 @@ fn main() {
5151
if_guard(2);
5252
if_let_guard(1);
5353
if_let_guard(2);
54-
let expected =
55-
[1, 2, !2, 3, !3, !1, 1, 2, !2, 3, !3, !1, 1, 2, 3, !3, !2, !1, 1, 2, 3, !3, !2, !1];
54+
let expected = [
55+
1, 2, !2, 3, !3, !1,
56+
1, 2, !2, 3, !3, !1,
57+
1, 2, 3, !3, !2, !1,
58+
1, 2, 3, !3, !2, !1,
59+
];
5660
assert_eq!(*A.lock().unwrap(), expected);
5761
}

tests/ui/rfcs/rfc-2294-if-let-guard/exhaustive.edition2024.stderr

Lines changed: 0 additions & 35 deletions
This file was deleted.

tests/ui/rfcs/rfc-2294-if-let-guard/exhaustive.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
#![allow(irrefutable_let_patterns)]
22

3-
//@revisions: edition2021 edition2024
4-
//@[edition2021] edition:2021
5-
//@[edition2024] edition:2024
6-
73
fn match_option(x: Option<u32>) {
84
match x {
95
//~^ ERROR non-exhaustive patterns: `None` not covered

tests/ui/rfcs/rfc-2294-if-let-guard/exhaustive.edition2021.stderr renamed to tests/ui/rfcs/rfc-2294-if-let-guard/exhaustive.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0004]: non-exhaustive patterns: `None` not covered
2-
--> $DIR/exhaustive.rs:8:11
2+
--> $DIR/exhaustive.rs:4:11
33
|
44
LL | match x {
55
| ^ pattern `None` not covered
@@ -17,7 +17,7 @@ LL + None => todo!()
1717
|
1818

1919
error[E0004]: non-exhaustive patterns: `()` not covered
20-
--> $DIR/exhaustive.rs:17:11
20+
--> $DIR/exhaustive.rs:13:11
2121
|
2222
LL | match x {
2323
| ^ pattern `()` not covered

tests/ui/rfcs/rfc-2294-if-let-guard/guard-lifetime-1.edition2024.stderr

Lines changed: 0 additions & 15 deletions
This file was deleted.

tests/ui/rfcs/rfc-2294-if-let-guard/guard-lifetime-1.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
// References to by-move bindings in an if-let guard *cannot* be used after the guard.
22

3-
//@revisions: edition2021 edition2024
4-
//@[edition2021] edition:2021
5-
//@[edition2024] edition:2024
6-
73
fn main() {
84
let x: Option<Option<String>> = Some(Some(String::new()));
95
match x {

tests/ui/rfcs/rfc-2294-if-let-guard/guard-lifetime-1.edition2021.stderr renamed to tests/ui/rfcs/rfc-2294-if-let-guard/guard-lifetime-1.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0505]: cannot move out of `x.0` because it is borrowed
2-
--> $DIR/guard-lifetime-1.rs:10:14
2+
--> $DIR/guard-lifetime-1.rs:6:14
33
|
44
LL | Some(mut y) if let Some(ref z) = y => {
55
| ^^^^^

tests/ui/rfcs/rfc-2294-if-let-guard/guard-lifetime-2.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
// References to by-mutable-ref bindings in an if-let guard *can* be used after the guard.
22

33
//@ check-pass
4-
//@revisions: edition2021 edition2024
5-
//@[edition2021] edition:2021
6-
//@[edition2024] edition:2024
74

85
fn main() {
96
let mut x: Option<Option<String>> = Some(Some(String::new()));

tests/ui/rfcs/rfc-2294-if-let-guard/guard-mutability-1.edition2024.stderr

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)