Skip to content

Commit 223e084

Browse files
Rollup merge of rust-lang#38970 - apasel422:may-dangle, r=pnkfelix
Deprecate `#[unsafe_destructor_blind_to_params]` CC rust-lang#34761 r? @pnkfelix
2 parents cabfb07 + 9940db6 commit 223e084

File tree

3 files changed

+26
-4
lines changed

3 files changed

+26
-4
lines changed

src/libsyntax/feature_gate.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -689,10 +689,10 @@ pub const BUILTIN_ATTRIBUTES: &'static [(&'static str, AttributeType, AttributeG
689689
cfg_fn!(omit_gdb_pretty_printer_section))),
690690
("unsafe_destructor_blind_to_params",
691691
Normal,
692-
Gated(Stability::Unstable,
692+
Gated(Stability::Deprecated("https://github.com/rust-lang/rust/issues/34761"),
693693
"dropck_parametricity",
694-
"unsafe_destructor_blind_to_params has unstable semantics \
695-
and may be removed in the future",
694+
"unsafe_destructor_blind_to_params has been replaced by \
695+
may_dangle and will be removed in the future",
696696
cfg_fn!(dropck_parametricity))),
697697
("may_dangle",
698698
Normal,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#![deny(deprecated)]
12+
#![feature(dropck_parametricity)]
13+
14+
struct Foo;
15+
16+
impl Drop for Foo {
17+
#[unsafe_destructor_blind_to_params]
18+
//~^ ERROR use of deprecated attribute `dropck_parametricity`
19+
fn drop(&mut self) {}
20+
}
21+
22+
fn main() {}

src/test/compile-fail/feature-gate-dropck-ugeh.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct Foo<T> { data: Vec<T> }
2727

2828
impl<T> Drop for Foo<T> {
2929
#[unsafe_destructor_blind_to_params] // This is the UGEH attribute
30-
//~^ ERROR unsafe_destructor_blind_to_params has unstable semantics
30+
//~^ ERROR unsafe_destructor_blind_to_params has been replaced
3131
fn drop(&mut self) { }
3232
}
3333

0 commit comments

Comments
 (0)