Skip to content

Commit cd025d7

Browse files
stabilize derive(CoercePointee)
1 parent f7b4354 commit cd025d7

16 files changed

+17
-67
lines changed

library/core/src/marker.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -1121,7 +1121,6 @@ pub trait FnPtr: Copy + Clone {
11211121
///
11221122
/// By using the macro, the following example will compile:
11231123
/// ```
1124-
/// #![feature(derive_coerce_pointee)]
11251124
/// use std::marker::CoercePointee;
11261125
/// use std::ops::Deref;
11271126
///
@@ -1168,7 +1167,7 @@ pub trait FnPtr: Copy + Clone {
11681167
/// type as a receiver are dyn-compatible. For example, this compiles:
11691168
///
11701169
/// ```
1171-
/// #![feature(arbitrary_self_types, derive_coerce_pointee)]
1170+
/// #![feature(arbitrary_self_types)]
11721171
/// use std::marker::CoercePointee;
11731172
/// use std::ops::Deref;
11741173
///
@@ -1230,7 +1229,6 @@ pub trait FnPtr: Copy + Clone {
12301229
/// If the type has multiple type parameters, then you must explicitly specify which one should be
12311230
/// used for dynamic dispatch. For example:
12321231
/// ```
1233-
/// # #![feature(derive_coerce_pointee)]
12341232
/// # use std::marker::{CoercePointee, PhantomData};
12351233
/// #[derive(CoercePointee)]
12361234
/// #[repr(transparent)]
@@ -1245,7 +1243,6 @@ pub trait FnPtr: Copy + Clone {
12451243
///
12461244
/// A custom implementation of the `Rc` type:
12471245
/// ```
1248-
/// #![feature(derive_coerce_pointee)]
12491246
/// use std::marker::CoercePointee;
12501247
/// use std::ops::Deref;
12511248
/// use std::ptr::NonNull;
@@ -1302,7 +1299,7 @@ pub trait FnPtr: Copy + Clone {
13021299
#[rustc_builtin_macro(CoercePointee, attributes(pointee))]
13031300
#[allow_internal_unstable(dispatch_from_dyn, coerce_unsized, unsize, coerce_pointee_validated)]
13041301
#[cfg_attr(not(test), rustc_diagnostic_item = "CoercePointee")]
1305-
#[unstable(feature = "derive_coerce_pointee", issue = "123430")]
1302+
#[stable(feature = "derive_coerce_pointee", since = "CURRENT_RUSTC_VERSION")]
13061303
pub macro CoercePointee($item:item) {
13071304
/* compiler built-in */
13081305
}

src/tools/miri/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#![feature(strict_overflow_ops)]
1515
#![feature(pointer_is_aligned_to)]
1616
#![feature(unqualified_local_imports)]
17-
#![feature(derive_coerce_pointee)]
1817
#![feature(arbitrary_self_types)]
1918
// Configure clippy and other lints
2019
#![allow(

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

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
//@ proc-macro: another-proc-macro.rs
33
//@ compile-flags: -Zunpretty=expanded
44

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

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

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
#![feature(prelude_import)]
22
#![no_std]
3-
//@ check-pass
4-
//@ proc-macro: another-proc-macro.rs
5-
//@ compile-flags: -Zunpretty=expanded
6-
7-
#![feature(derive_coerce_pointee)]
83
#[prelude_import]
94
use ::std::prelude::rust_2015::*;
105
#[macro_use]
116
extern crate std;
7+
//@ check-pass
8+
//@ proc-macro: another-proc-macro.rs
9+
//@ compile-flags: -Zunpretty=expanded
1210

1311
#[macro_use]
1412
extern crate another_proc_macro;

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

-2
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

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//@ check-pass
22
//@ compile-flags: -Zunpretty=expanded
3-
#![feature(derive_coerce_pointee)]
43
use std::marker::CoercePointee;
54

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

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

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
#![feature(prelude_import)]
22
#![no_std]
3-
//@ check-pass
4-
//@ compile-flags: -Zunpretty=expanded
5-
#![feature(derive_coerce_pointee)]
63
#[prelude_import]
74
use ::std::prelude::rust_2015::*;
85
#[macro_use]
96
extern crate std;
7+
//@ check-pass
8+
//@ compile-flags: -Zunpretty=expanded
109
use std::marker::CoercePointee;
1110

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

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

+1-1
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

+2-1
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

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
//@ proc-macro: another-proc-macro.rs
99
//@ compile-flags: -Zunpretty=expanded
1010

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

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

+4-6
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]`.
@@ -10,12 +14,6 @@
1014
//@ proc-macro: another-proc-macro.rs
1115
//@ compile-flags: -Zunpretty=expanded
1216

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

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

-9
This file was deleted.

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

-23
This file was deleted.

tests/ui/self/arbitrary_self_types_dispatch_to_vtable.rs

-1
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

+1-2
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

+2-3
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)