Skip to content

Commit 3dec614

Browse files
stabilize derive(CoercePointee)
1 parent 25face9 commit 3dec614

15 files changed

+19
-68
lines changed

library/core/src/marker.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,7 +1190,6 @@ pub trait FnPtr: Copy + Clone {
11901190
///
11911191
/// By using the macro, the following example will compile:
11921192
/// ```
1193-
/// #![feature(derive_coerce_pointee)]
11941193
/// use std::marker::CoercePointee;
11951194
/// use std::ops::Deref;
11961195
///
@@ -1237,7 +1236,7 @@ pub trait FnPtr: Copy + Clone {
12371236
/// type as a receiver are dyn-compatible. For example, this compiles:
12381237
///
12391238
/// ```
1240-
/// #![feature(arbitrary_self_types, derive_coerce_pointee)]
1239+
/// #![feature(arbitrary_self_types)]
12411240
/// use std::marker::CoercePointee;
12421241
/// use std::ops::Deref;
12431242
///
@@ -1299,7 +1298,6 @@ pub trait FnPtr: Copy + Clone {
12991298
/// If the type has multiple type parameters, then you must explicitly specify which one should be
13001299
/// used for dynamic dispatch. For example:
13011300
/// ```
1302-
/// # #![feature(derive_coerce_pointee)]
13031301
/// # use std::marker::{CoercePointee, PhantomData};
13041302
/// #[derive(CoercePointee)]
13051303
/// #[repr(transparent)]
@@ -1314,7 +1312,6 @@ pub trait FnPtr: Copy + Clone {
13141312
///
13151313
/// A custom implementation of the `Rc` type:
13161314
/// ```
1317-
/// #![feature(derive_coerce_pointee)]
13181315
/// use std::marker::CoercePointee;
13191316
/// use std::ops::Deref;
13201317
/// use std::ptr::NonNull;
@@ -1371,7 +1368,7 @@ pub trait FnPtr: Copy + Clone {
13711368
#[rustc_builtin_macro(CoercePointee, attributes(pointee))]
13721369
#[allow_internal_unstable(dispatch_from_dyn, coerce_unsized, unsize, coerce_pointee_validated)]
13731370
#[rustc_diagnostic_item = "CoercePointee"]
1374-
#[unstable(feature = "derive_coerce_pointee", issue = "123430")]
1371+
#[stable(feature = "derive_coerce_pointee", since = "CURRENT_RUSTC_VERSION")]
13751372
pub macro CoercePointee($item:item) {
13761373
/* compiler built-in */
13771374
}

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
#[prelude_import]
104
use ::std::prelude::rust_2015::*;
115
#[macro_use]
126
extern crate std;
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
#[prelude_import]
84
use ::std::prelude::rust_2015::*;
95
#[macro_use]
106
extern crate std;
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

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#![feature(prelude_import)]
22
#![no_std]
3+
#[prelude_import]
4+
use ::std::prelude::rust_2015::*;
5+
#[macro_use]
6+
extern crate std;
37
// This test certify that we can mix attribute macros from Rust and external proc-macros.
48
// For instance, `#[derive(Default)]` uses `#[default]` and `#[derive(CoercePointee)]` uses
59
// `#[pointee]`.
@@ -11,12 +15,6 @@
1115
//@ compile-flags: -Zunpretty=expanded
1216
//@ edition: 2015
1317

14-
#![feature(derive_coerce_pointee)]
15-
#[prelude_import]
16-
use ::std::prelude::rust_2015::*;
17-
#[macro_use]
18-
extern crate std;
19-
2018
#[macro_use]
2119
extern crate another_proc_macro;
2220

tests/ui/feature-gates/feature-gate-derive-coerce-pointee.rs

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

tests/ui/feature-gates/feature-gate-derive-coerce-pointee.stderr

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

tests/ui/self/arbitrary_self_types_dispatch_to_vtable.rs

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

3-
#![feature(derive_coerce_pointee)]
43
#![feature(arbitrary_self_types)]
54

65
use std::marker::CoercePointee;

tests/ui/self/dyn-dispatch-requires-supertrait-norm.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
//@ check-pass
22

3-
#![feature(derive_coerce_pointee)]
43
#![feature(arbitrary_self_types)]
54

6-
use std::ops::Deref;
75
use std::marker::CoercePointee;
6+
use std::ops::Deref;
87
use std::sync::Arc;
98

109
trait MyTrait<T> {}

tests/ui/self/dyn-dispatch-requires-supertrait.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
//@ check-pass
22

3-
#![feature(derive_coerce_pointee)]
43
#![feature(arbitrary_self_types)]
54

6-
use std::ops::Deref;
75
use std::marker::CoercePointee;
6+
use std::ops::Deref;
87
use std::sync::Arc;
98

109
trait MyTrait {}
@@ -15,7 +14,7 @@ struct MyArc<T>
1514
where
1615
T: MyTrait + ?Sized,
1716
{
18-
inner: Arc<T>
17+
inner: Arc<T>,
1918
}
2019

2120
impl<T: MyTrait + ?Sized> Deref for MyArc<T> {

0 commit comments

Comments
 (0)