Skip to content

Commit 859004e

Browse files
stabilize derive(CoercePointee)
1 parent 8b87fef commit 859004e

16 files changed

+17
-67
lines changed

library/core/src/marker.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -1125,7 +1125,6 @@ pub trait FnPtr: Copy + Clone {
11251125
///
11261126
/// By using the macro, the following example will compile:
11271127
/// ```
1128-
/// #![feature(derive_coerce_pointee)]
11291128
/// use std::marker::CoercePointee;
11301129
/// use std::ops::Deref;
11311130
///
@@ -1172,7 +1171,7 @@ pub trait FnPtr: Copy + Clone {
11721171
/// type as a receiver are dyn-compatible. For example, this compiles:
11731172
///
11741173
/// ```
1175-
/// #![feature(arbitrary_self_types, derive_coerce_pointee)]
1174+
/// #![feature(arbitrary_self_types)]
11761175
/// use std::marker::CoercePointee;
11771176
/// use std::ops::Deref;
11781177
///
@@ -1234,7 +1233,6 @@ pub trait FnPtr: Copy + Clone {
12341233
/// If the type has multiple type parameters, then you must explicitly specify which one should be
12351234
/// used for dynamic dispatch. For example:
12361235
/// ```
1237-
/// # #![feature(derive_coerce_pointee)]
12381236
/// # use std::marker::{CoercePointee, PhantomData};
12391237
/// #[derive(CoercePointee)]
12401238
/// #[repr(transparent)]
@@ -1249,7 +1247,6 @@ pub trait FnPtr: Copy + Clone {
12491247
///
12501248
/// A custom implementation of the `Rc` type:
12511249
/// ```
1252-
/// #![feature(derive_coerce_pointee)]
12531250
/// use std::marker::CoercePointee;
12541251
/// use std::ops::Deref;
12551252
/// use std::ptr::NonNull;
@@ -1306,7 +1303,7 @@ pub trait FnPtr: Copy + Clone {
13061303
#[rustc_builtin_macro(CoercePointee, attributes(pointee))]
13071304
#[allow_internal_unstable(dispatch_from_dyn, coerce_unsized, unsize, coerce_pointee_validated)]
13081305
#[rustc_diagnostic_item = "CoercePointee"]
1309-
#[unstable(feature = "derive_coerce_pointee", issue = "123430")]
1306+
#[stable(feature = "derive_coerce_pointee", since = "CURRENT_RUSTC_VERSION")]
13101307
pub macro CoercePointee($item:item) {
13111308
/* compiler built-in */
13121309
}

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)