From 9940db63ef60518f6c9824787a979beb09e716ba Mon Sep 17 00:00:00 2001 From: Andrew Paseltiner Date: Tue, 10 Jan 2017 17:52:33 -0500 Subject: [PATCH] Deprecate `#[unsafe_destructor_blind_to_params]` CC #34761 --- src/libsyntax/feature_gate.rs | 6 ++--- .../feature-gate-dropck-ugeh-2.rs | 22 +++++++++++++++++++ .../compile-fail/feature-gate-dropck-ugeh.rs | 2 +- 3 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 src/test/compile-fail/feature-gate-dropck-ugeh-2.rs diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 5092412475872..3826db455beef 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -691,10 +691,10 @@ pub const BUILTIN_ATTRIBUTES: &'static [(&'static str, AttributeType, AttributeG cfg_fn!(omit_gdb_pretty_printer_section))), ("unsafe_destructor_blind_to_params", Normal, - Gated(Stability::Unstable, + Gated(Stability::Deprecated("https://github.com/rust-lang/rust/issues/34761"), "dropck_parametricity", - "unsafe_destructor_blind_to_params has unstable semantics \ - and may be removed in the future", + "unsafe_destructor_blind_to_params has been replaced by \ + may_dangle and will be removed in the future", cfg_fn!(dropck_parametricity))), ("may_dangle", Normal, diff --git a/src/test/compile-fail/feature-gate-dropck-ugeh-2.rs b/src/test/compile-fail/feature-gate-dropck-ugeh-2.rs new file mode 100644 index 0000000000000..70ec561439c61 --- /dev/null +++ b/src/test/compile-fail/feature-gate-dropck-ugeh-2.rs @@ -0,0 +1,22 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![deny(deprecated)] +#![feature(dropck_parametricity)] + +struct Foo; + +impl Drop for Foo { + #[unsafe_destructor_blind_to_params] + //~^ ERROR use of deprecated attribute `dropck_parametricity` + fn drop(&mut self) {} +} + +fn main() {} diff --git a/src/test/compile-fail/feature-gate-dropck-ugeh.rs b/src/test/compile-fail/feature-gate-dropck-ugeh.rs index aa479a987a35b..b9990b536e706 100644 --- a/src/test/compile-fail/feature-gate-dropck-ugeh.rs +++ b/src/test/compile-fail/feature-gate-dropck-ugeh.rs @@ -25,7 +25,7 @@ struct Foo { data: Vec } impl Drop for Foo { #[unsafe_destructor_blind_to_params] // This is the UGEH attribute - //~^ ERROR unsafe_destructor_blind_to_params has unstable semantics + //~^ ERROR unsafe_destructor_blind_to_params has been replaced fn drop(&mut self) { } }