Skip to content

Commit e13911e

Browse files
Rename feature gate
1 parent 1b2e471 commit e13911e

11 files changed

+16
-16
lines changed

compiler/rustc_feature/src/unstable.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ declare_features! (
534534
/// Allows the `#[must_not_suspend]` attribute.
535535
(unstable, must_not_suspend, "1.57.0", Some(83310)),
536536
/// Make `mut` not reset the binding mode on edition >= 2024.
537-
(unstable, mut_dont_reset_binding_mode_2024, "CURRENT_RUSTC_VERSION", Some(123076)),
537+
(unstable, mut_preserve_binding_mode_2024, "CURRENT_RUSTC_VERSION", Some(123076)),
538538
/// Allows `mut ref` and `mut ref mut` identifier patterns.
539539
(incomplete, mut_ref, "CURRENT_RUSTC_VERSION", Some(123076)),
540540
/// Allows using `#[naked]` on functions.

compiler/rustc_hir_typeck/src/pat.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
636636
let bm = match ba {
637637
BindingAnnotation(ByRef::No, Mutability::Mut)
638638
if !(pat.span.at_least_rust_2024()
639-
&& self.tcx.features().mut_dont_reset_binding_mode_2024)
639+
&& self.tcx.features().mut_preserve_binding_mode_2024)
640640
&& matches!(def_br, ByRef::Yes(_)) =>
641641
{
642642
// `mut x` resets the binding mode in edition <= 2021.

compiler/rustc_lint_defs/src/builtin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1656,7 +1656,7 @@ declare_lint! {
16561656
pub DEREFERENCING_MUT_BINDING,
16571657
Allow,
16581658
"detects `mut x` bindings that change the type of `x`",
1659-
@feature_gate = sym::mut_dont_reset_binding_mode_2024;
1659+
@feature_gate = sym::mut_preserve_binding_mode_2024;
16601660
// FIXME uncomment below upon stabilization
16611661
/*@future_incompatible = FutureIncompatibleInfo {
16621662
reason: FutureIncompatibilityReason::EditionSemanticsChange(Edition::Edition2024),

compiler/rustc_span/src/symbol.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1194,7 +1194,7 @@ symbols! {
11941194
multiple_supertrait_upcastable,
11951195
must_not_suspend,
11961196
must_use,
1197-
mut_dont_reset_binding_mode_2024,
1197+
mut_preserve_binding_mode_2024,
11981198
mut_ref,
11991199
naked,
12001200
naked_functions,

tests/ui/pattern/feature-gate-mut_dont_reset_binding_mode_2024.stderr renamed to tests/ui/pattern/feature-gate-mut_preserve_binding_mode_2024.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0308]: mismatched types
2-
--> $DIR/feature-gate-mut_dont_reset_binding_mode_2024.rs:8:9
2+
--> $DIR/feature-gate-mut_preserve_binding_mode_2024.rs:8:9
33
|
44
LL | let Foo(mut a) = &Foo(0);
55
| ----- expected due to the type of this binding
@@ -13,7 +13,7 @@ LL + a = 42;
1313
|
1414

1515
error[E0308]: mismatched types
16-
--> $DIR/feature-gate-mut_dont_reset_binding_mode_2024.rs:12:9
16+
--> $DIR/feature-gate-mut_preserve_binding_mode_2024.rs:12:9
1717
|
1818
LL | let Foo(mut a) = &mut Foo(0);
1919
| ----- expected due to the type of this binding

tests/ui/pattern/mut_dont_reset_binding_mode_2021.rs renamed to tests/ui/pattern/mut_preserve_binding_mode_2021.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ edition: 2021
22
//@ compile-flags: -Zunstable-options
3-
#![feature(mut_dont_reset_binding_mode_2024)]
3+
#![feature(mut_preserve_binding_mode_2024)]
44

55
struct Foo(u8);
66

tests/ui/pattern/mut_dont_reset_binding_mode_2021.stderr renamed to tests/ui/pattern/mut_preserve_binding_mode_2021.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0308]: mismatched types
2-
--> $DIR/mut_dont_reset_binding_mode_2021.rs:9:9
2+
--> $DIR/mut_preserve_binding_mode_2021.rs:9:9
33
|
44
LL | let Foo(mut a) = &Foo(0);
55
| ----- expected due to the type of this binding
@@ -13,7 +13,7 @@ LL + a = 42;
1313
|
1414

1515
error[E0308]: mismatched types
16-
--> $DIR/mut_dont_reset_binding_mode_2021.rs:13:9
16+
--> $DIR/mut_preserve_binding_mode_2021.rs:13:9
1717
|
1818
LL | let Foo(mut a) = &mut Foo(0);
1919
| ----- expected due to the type of this binding

tests/ui/pattern/mut_dont_reset_binding_mode_2024.rs renamed to tests/ui/pattern/mut_preserve_binding_mode_2024.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@ run-pass
22
//@ edition: 2024
33
//@ compile-flags: -Zunstable-options
4-
#![feature(mut_dont_reset_binding_mode_2024)]
4+
#![feature(mut_preserve_binding_mode_2024)]
55
#![allow(unused)]
66

77
struct Foo(u8);

tests/ui/pattern/mut_dont_reset_binding_mode_2024_lint.rs renamed to tests/ui/pattern/mut_preserve_binding_mode_2024_lint.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ edition: 2021
2-
#![feature(mut_dont_reset_binding_mode_2024)]
2+
#![feature(mut_preserve_binding_mode_2024)]
33
#![allow(unused)]
44
#![forbid(dereferencing_mut_binding)]
55

tests/ui/pattern/mut_dont_reset_binding_mode_2024_lint.stderr renamed to tests/ui/pattern/mut_preserve_binding_mode_2024_lint.stderr

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
error: dereferencing `mut` binding
2-
--> $DIR/mut_dont_reset_binding_mode_2024_lint.rs:9:13
2+
--> $DIR/mut_preserve_binding_mode_2024_lint.rs:9:13
33
|
44
LL | let Foo(mut a) = &Foo(0);
55
| ^^^^^ `mut` dereferences the type of this binding
66
|
77
help: this will change in edition 2024
8-
--> $DIR/mut_dont_reset_binding_mode_2024_lint.rs:9:13
8+
--> $DIR/mut_preserve_binding_mode_2024_lint.rs:9:13
99
|
1010
LL | let Foo(mut a) = &Foo(0);
1111
| ^^^^^
1212
note: the lint level is defined here
13-
--> $DIR/mut_dont_reset_binding_mode_2024_lint.rs:4:11
13+
--> $DIR/mut_preserve_binding_mode_2024_lint.rs:4:11
1414
|
1515
LL | #![forbid(dereferencing_mut_binding)]
1616
| ^^^^^^^^^^^^^^^^^^^^^^^^^
1717

1818
error: dereferencing `mut` binding
19-
--> $DIR/mut_dont_reset_binding_mode_2024_lint.rs:13:13
19+
--> $DIR/mut_preserve_binding_mode_2024_lint.rs:13:13
2020
|
2121
LL | let Foo(mut a) = &mut Foo(0);
2222
| ^^^^^ `mut` dereferences the type of this binding
2323
|
2424
help: this will change in edition 2024
25-
--> $DIR/mut_dont_reset_binding_mode_2024_lint.rs:13:13
25+
--> $DIR/mut_preserve_binding_mode_2024_lint.rs:13:13
2626
|
2727
LL | let Foo(mut a) = &mut Foo(0);
2828
| ^^^^^

0 commit comments

Comments
 (0)