Skip to content

Commit bc51f87

Browse files
committed
rename to string_deref_patterns
1 parent 64a17a0 commit bc51f87

File tree

9 files changed

+11
-11
lines changed

9 files changed

+11
-11
lines changed

compiler/rustc_feature/src/active.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,6 @@ declare_features! (
376376
(active, deprecated_safe, "1.61.0", Some(94978), None),
377377
/// Allows having using `suggestion` in the `#[deprecated]` attribute.
378378
(active, deprecated_suggestion, "1.61.0", Some(94785), None),
379-
/// Allows patterns to dereference values to match them.
380-
(active, deref_patterns, "1.64.0", Some(87121), None),
381379
/// Tells rustdoc to automatically generate `#[doc(cfg(...))]`.
382380
(active, doc_auto_cfg, "1.58.0", Some(43781), None),
383381
/// Allows `#[doc(cfg(...))]`.
@@ -508,6 +506,8 @@ declare_features! (
508506
(active, stmt_expr_attributes, "1.6.0", Some(15701), None),
509507
/// Allows lints part of the strict provenance effort.
510508
(active, strict_provenance, "1.61.0", Some(95228), None),
509+
/// Allows string patterns to dereference values to match them.
510+
(active, string_deref_patterns, "CURRENT_RUSTC_VERSION", Some(87121), None),
511511
/// Allows the use of `#[target_feature]` on safe functions.
512512
(active, target_feature_11, "1.45.0", Some(69098), None),
513513
/// Allows using `#[thread_local]` on `static` items.

compiler/rustc_hir_typeck/src/pat.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
401401
}
402402
}
403403

404-
if self.tcx.features().deref_patterns && let hir::ExprKind::Lit(Spanned { node: ast::LitKind::Str(..), .. }) = lt.kind {
404+
if self.tcx.features().string_deref_patterns && let hir::ExprKind::Lit(Spanned { node: ast::LitKind::Str(..), .. }) = lt.kind {
405405
let tcx = self.tcx;
406406
let expected = self.resolve_vars_if_possible(expected);
407407
pat_ty = match expected.kind() {

compiler/rustc_mir_build/src/build/matches/test.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,8 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
242242
TestKind::Eq { value, ty } => {
243243
let tcx = self.tcx;
244244
if let ty::Adt(def, _) = ty.kind() && Some(def.did()) == tcx.lang_items().string() {
245-
if !tcx.features().deref_patterns {
246-
bug!("matching on `String` went through without enabling deref_patterns");
245+
if !tcx.features().string_deref_patterns {
246+
bug!("matching on `String` went through without enabling string_deref_patterns");
247247
}
248248
let re_erased = tcx.lifetimes.re_erased;
249249
let ref_string = self.temp(tcx.mk_imm_ref(re_erased, ty), test.span);

compiler/rustc_span/src/symbol.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,6 @@ symbols! {
597597
deref,
598598
deref_method,
599599
deref_mut,
600-
deref_patterns,
601600
deref_target,
602601
derive,
603602
derive_const,
@@ -1406,6 +1405,7 @@ symbols! {
14061405
str_trim_end,
14071406
str_trim_start,
14081407
strict_provenance,
1408+
string_deref_patterns,
14091409
stringify,
14101410
struct_field_attributes,
14111411
struct_inherit,

src/test/mir-opt/deref-patterns/string.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// compile-flags: -Z mir-opt-level=0 -C panic=abort
22

3-
#![feature(deref_patterns)]
3+
#![feature(string_deref_patterns)]
44
#![crate_type = "lib"]
55

66
// EMIT_MIR string.foo.PreCodegen.after.mir

src/test/ui/deref-patterns/basic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// run-pass
22
// check-run-results
3-
#![feature(deref_patterns)]
3+
#![feature(string_deref_patterns)]
44

55
fn main() {
66
test(Some(String::from("42")));

src/test/ui/deref-patterns/default-infer.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// check-pass
2-
#![feature(deref_patterns)]
2+
#![feature(string_deref_patterns)]
33

44
fn main() {
55
match <_ as Default>::default() {

src/test/ui/deref-patterns/gate.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// gate-test-deref_patterns
1+
// gate-test-string_deref_patterns
22
fn main() {
33
match String::new() {
44
"" | _ => {}

src/test/ui/deref-patterns/refs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// check-pass
2-
#![feature(deref_patterns)]
2+
#![feature(string_deref_patterns)]
33

44
fn foo(s: &String) -> i32 {
55
match *s {

0 commit comments

Comments
 (0)