Skip to content

Commit 054bd9d

Browse files
dingxiangfei2009Xiangfei Ding
authored andcommitted
stabilize derive(CoercePointee)
1 parent e5e79f8 commit 054bd9d

16 files changed

+20
-69
lines changed

library/core/src/marker.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,7 +1168,6 @@ pub trait FnPtr: Copy + Clone {
11681168
///
11691169
/// By using the macro, the following example will compile:
11701170
/// ```
1171-
/// #![feature(derive_coerce_pointee)]
11721171
/// use std::marker::CoercePointee;
11731172
/// use std::ops::Deref;
11741173
///
@@ -1215,7 +1214,7 @@ pub trait FnPtr: Copy + Clone {
12151214
/// type as a receiver are dyn-compatible. For example, this compiles:
12161215
///
12171216
/// ```
1218-
/// #![feature(arbitrary_self_types, derive_coerce_pointee)]
1217+
/// #![feature(arbitrary_self_types)]
12191218
/// use std::marker::CoercePointee;
12201219
/// use std::ops::Deref;
12211220
///
@@ -1277,7 +1276,6 @@ pub trait FnPtr: Copy + Clone {
12771276
/// If the type has multiple type parameters, then you must explicitly specify which one should be
12781277
/// used for dynamic dispatch. For example:
12791278
/// ```
1280-
/// # #![feature(derive_coerce_pointee)]
12811279
/// # use std::marker::{CoercePointee, PhantomData};
12821280
/// #[derive(CoercePointee)]
12831281
/// #[repr(transparent)]
@@ -1292,7 +1290,6 @@ pub trait FnPtr: Copy + Clone {
12921290
///
12931291
/// A custom implementation of the `Rc` type:
12941292
/// ```
1295-
/// #![feature(derive_coerce_pointee)]
12961293
/// use std::marker::CoercePointee;
12971294
/// use std::ops::Deref;
12981295
/// use std::ptr::NonNull;
@@ -1349,7 +1346,7 @@ pub trait FnPtr: Copy + Clone {
13491346
#[rustc_builtin_macro(CoercePointee, attributes(pointee))]
13501347
#[allow_internal_unstable(dispatch_from_dyn, coerce_unsized, unsize, coerce_pointee_validated)]
13511348
#[rustc_diagnostic_item = "CoercePointee"]
1352-
#[unstable(feature = "derive_coerce_pointee", issue = "123430")]
1349+
#[stable(feature = "derive_coerce_pointee", since = "CURRENT_RUSTC_VERSION")]
13531350
pub macro CoercePointee($item:item) {
13541351
/* compiler built-in */
13551352
}

src/tools/miri/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#![feature(pointer_is_aligned_to)]
1616
#![feature(ptr_metadata)]
1717
#![feature(unqualified_local_imports)]
18-
#![feature(derive_coerce_pointee)]
18+
#![cfg_attr(bootstrap, feature(derive_coerce_pointee))]
1919
#![feature(arbitrary_self_types)]
2020
#![feature(iter_advance_by)]
2121
// Configure clippy and other lints

tests/ui/deriving/built-in-proc-macro-scope.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
//@ compile-flags: -Zunpretty=expanded
44
//@ edition:2015
55

6-
#![feature(derive_coerce_pointee)]
7-
86
#[macro_use]
97
extern crate another_proc_macro;
108

tests/ui/deriving/built-in-proc-macro-scope.stdout

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
#![feature(prelude_import)]
22
#![no_std]
3-
//@ check-pass
4-
//@ proc-macro: another-proc-macro.rs
5-
//@ compile-flags: -Zunpretty=expanded
6-
//@ edition:2015
7-
8-
#![feature(derive_coerce_pointee)]
93
#[macro_use]
104
extern crate std;
115
#[prelude_import]
126
use ::std::prelude::rust_2015::*;
7+
//@ check-pass
8+
//@ proc-macro: another-proc-macro.rs
9+
//@ compile-flags: -Zunpretty=expanded
10+
//@ edition:2015
1311

1412
#[macro_use]
1513
extern crate another_proc_macro;

tests/ui/deriving/coerce-pointee-bounds-issue-127647.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
//@ check-pass
22

3-
#![feature(derive_coerce_pointee)]
4-
53
#[derive(core::marker::CoercePointee)]
64
#[repr(transparent)]
75
pub struct Ptr<'a, #[pointee] T: OnDrop + ?Sized, X> {

tests/ui/deriving/deriving-coerce-pointee-expanded.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//@ check-pass
22
//@ compile-flags: -Zunpretty=expanded
33
//@ edition: 2015
4-
#![feature(derive_coerce_pointee)]
54
use std::marker::CoercePointee;
65

76
pub trait MyTrait<T: ?Sized> {}

tests/ui/deriving/deriving-coerce-pointee-expanded.stdout

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
#![feature(prelude_import)]
22
#![no_std]
3-
//@ check-pass
4-
//@ compile-flags: -Zunpretty=expanded
5-
//@ edition: 2015
6-
#![feature(derive_coerce_pointee)]
73
#[macro_use]
84
extern crate std;
95
#[prelude_import]
106
use ::std::prelude::rust_2015::*;
7+
//@ check-pass
8+
//@ compile-flags: -Zunpretty=expanded
9+
//@ edition: 2015
1110
use std::marker::CoercePointee;
1211

1312
pub trait MyTrait<T: ?Sized> {}

tests/ui/deriving/deriving-coerce-pointee-neg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ proc-macro: malicious-macro.rs
2-
#![feature(derive_coerce_pointee, arbitrary_self_types)]
2+
#![feature(arbitrary_self_types)]
33

44
extern crate core;
55
extern crate malicious_macro;

tests/ui/deriving/deriving-coerce-pointee.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//@ run-pass
2-
#![feature(derive_coerce_pointee, arbitrary_self_types)]
2+
3+
#![feature(arbitrary_self_types)]
34

45
use std::marker::CoercePointee;
56

tests/ui/deriving/proc-macro-attribute-mixing.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
//@ compile-flags: -Zunpretty=expanded
1010
//@ edition: 2015
1111

12-
#![feature(derive_coerce_pointee)]
13-
1412
#[macro_use]
1513
extern crate another_proc_macro;
1614

0 commit comments

Comments
 (0)