Skip to content

Commit 1944af6

Browse files
Rollup merge of #152554 - JonathanBrouwer:remove_deprecated_safe, r=jdonszelmann
Remove `deprecated_safe` and its corresponding feature gate This unimplements the feature gate for tracking issue #94978 The author of that tracking issue and the MCP seem to no longer exist Afaik we can just do this, but let me know if I'm wrong Because this feature has been idle for 3+ years, and it is in the way to finish the attribute refactoring (#131229 (comment)) When someone wants to do work on it the feature gate can be re-added r? @jdonszelmann
2 parents 9ca0ebb + 42a3c86 commit 1944af6

6 files changed

Lines changed: 2 additions & 41 deletions

File tree

compiler/rustc_feature/src/builtin_attrs.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -862,13 +862,6 @@ pub static BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
862862
register_tool, CrateLevel, template!(List: &["tool1, tool2, ..."]), DuplicatesOk,
863863
EncodeCrossCrate::No, experimental!(register_tool),
864864
),
865-
866-
// lang-team MCP 147
867-
gated!(
868-
deprecated_safe, Normal, template!(List: &[r#"since = "version", note = "...""#]), ErrorFollowing,
869-
EncodeCrossCrate::Yes, experimental!(deprecated_safe),
870-
),
871-
872865
// `#[cfi_encoding = ""]`
873866
gated!(
874867
cfi_encoding, Normal, template!(NameValueStr: "encoding"), ErrorPreceding,

compiler/rustc_feature/src/removed.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ declare_features! (
102102
/// Allows default type parameters to influence type inference.
103103
(removed, default_type_parameter_fallback, "1.82.0", Some(27336),
104104
Some("never properly implemented; requires significant design work"), 127655),
105+
/// Allows using `#[deprecated_safe]` to deprecate the safeness of a function or trait
106+
(removed, deprecated_safe, "CURRENT_RUSTC_VERSION", Some(94978), Some("never properly implemented, in the way of attribute refactor"), 152554),
105107
/// Allows deriving traits as per `SmartPointer` specification
106108
(removed, derive_smart_pointer, "1.84.0", Some(123430), Some("replaced by `CoercePointee`"), 131284),
107109
/// Tells rustdoc to automatically generate `#[doc(cfg(...))]`.

compiler/rustc_feature/src/unstable.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,8 +454,6 @@ declare_features! (
454454
/// Allows the use of default values on struct definitions and the construction of struct
455455
/// literals with the functional update syntax without a base.
456456
(unstable, default_field_values, "1.85.0", Some(132162)),
457-
/// Allows using `#[deprecated_safe]` to deprecate the safeness of a function or trait
458-
(unstable, deprecated_safe, "1.61.0", Some(94978)),
459457
/// Allows having using `suggestion` in the `#[deprecated]` attribute.
460458
(unstable, deprecated_suggestion, "1.61.0", Some(94785)),
461459
/// Allows deref patterns.

compiler/rustc_passes/src/check_attr.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
393393
| sym::warn
394394
| sym::deny
395395
| sym::forbid
396-
// need to be fixed
397-
| sym::deprecated_safe // FIXME(deprecated_safe)
398396
// internal
399397
| sym::panic_handler
400398
| sym::lang

tests/ui/feature-gates/feature-gate-deprecated_safe.rs

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

tests/ui/feature-gates/feature-gate-deprecated_safe.stderr

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

0 commit comments

Comments
 (0)