Skip to content

Commit 2f1dc89

Browse files
committed
Arbitrary self types v2: stabilize test changes
All the test changes necessary for stabilization here.
1 parent de35741 commit 2f1dc89

File tree

98 files changed

+410
-413
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+410
-413
lines changed

compiler/rustc_codegen_cranelift/example/arbitrary_self_types_pointers_and_wrappers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Adapted from rustc run-pass test suite
22

3-
#![feature(arbitrary_self_types, unsize, coerce_unsized, dispatch_from_dyn)]
3+
#![feature(unsize, coerce_unsized, dispatch_from_dyn)]
44

55
use std::marker::Unsize;
66
use std::ops::{CoerceUnsized, Deref, DispatchFromDyn};

compiler/rustc_codegen_cranelift/example/mini_core.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,6 @@ impl<T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<*const U> for *const T {}
4747
impl<T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<*mut U> for *mut T {}
4848
impl<T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<Box<U>> for Box<T> {}
4949

50-
#[lang = "legacy_receiver"]
51-
pub trait LegacyReceiver {}
52-
53-
impl<T: ?Sized> LegacyReceiver for &T {}
54-
impl<T: ?Sized> LegacyReceiver for &mut T {}
55-
impl<T: ?Sized> LegacyReceiver for Box<T> {}
56-
5750
#[lang = "copy"]
5851
pub trait Copy {}
5952

compiler/rustc_codegen_gcc/example/arbitrary_self_types_pointers_and_wrappers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Adapted from rustc run-pass test suite
22

3-
#![feature(arbitrary_self_types, unsize, coerce_unsized, dispatch_from_dyn)]
3+
#![feature(unsize, coerce_unsized, dispatch_from_dyn)]
44
#![feature(rustc_attrs)]
55
#![allow(internal_features)]
66

compiler/rustc_codegen_gcc/example/mini_core.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,6 @@ impl<T: ?Sized+Unsize<U>, U: ?Sized> DispatchFromDyn<*const U> for *const T {}
4444
impl<T: ?Sized+Unsize<U>, U: ?Sized> DispatchFromDyn<*mut U> for *mut T {}
4545
impl<T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<Box<U, ()>> for Box<T, ()> {}
4646

47-
#[lang = "legacy_receiver"]
48-
pub trait LegacyReceiver {}
49-
50-
impl<T: ?Sized> LegacyReceiver for &T {}
51-
impl<T: ?Sized> LegacyReceiver for &mut T {}
52-
impl<T: ?Sized, A: Allocator> LegacyReceiver for Box<T, A> {}
53-
5447
#[lang = "copy"]
5548
pub trait Copy {}
5649

compiler/rustc_lint_defs/src/builtin.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4844,8 +4844,6 @@ declare_lint! {
48444844
/// UB in safe code afterwards. For example:
48454845
///
48464846
/// ```ignore (causes a warning)
4847-
/// #![feature(arbitrary_self_types)]
4848-
///
48494847
/// trait Trait {
48504848
/// fn f(self: *const Self)
48514849
/// where

library/core/src/marker.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1152,7 +1152,8 @@ pub trait FnPtr: Copy + Clone {
11521152
/// type as a receiver are dyn-compatible. For example, this compiles:
11531153
///
11541154
/// ```
1155-
/// #![feature(arbitrary_self_types, derive_coerce_pointee)]
1155+
/// #![feature(derive_coerce_pointee)]
1156+
/// # #![cfg_attr(bootstrap, feature(legacy_receiver_trait))]
11561157
/// use std::marker::CoercePointee;
11571158
/// use std::ops::Deref;
11581159
///
@@ -1166,6 +1167,9 @@ pub trait FnPtr: Copy + Clone {
11661167
/// &self.0
11671168
/// }
11681169
/// }
1170+
/// #
1171+
/// # #[cfg(bootstrap)]
1172+
/// # impl<T: ?Sized> core::ops::LegacyReceiver for MySmartPointer<T> {}
11691173
///
11701174
/// // You can always define this trait. (as long as you have #![feature(arbitrary_self_types)])
11711175
/// trait MyTrait {

library/core/src/ops/deref.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ unsafe impl<T: ?Sized> DerefPure for &mut T {}
300300

301301
/// Indicates that a struct can be used as a method receiver.
302302
/// That is, a type can use this type as a type of `self`, like this:
303-
/// ```compile_fail
303+
/// ```
304304
/// # // This is currently compile_fail because the compiler-side parts
305305
/// # // of arbitrary_self_types are not implemented
306306
/// use std::ops::Receiver;

src/doc/unstable-book/src/language-features/coroutines.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Feedback on the design and usage is always appreciated!
8989
The `Coroutine` trait in `std::ops` currently looks like:
9090

9191
```rust
92-
# #![feature(arbitrary_self_types, coroutine_trait)]
92+
# #![feature(coroutine_trait)]
9393
# use std::ops::CoroutineState;
9494
# use std::pin::Pin;
9595

@@ -184,7 +184,7 @@ fn main() {
184184
This coroutine literal will compile down to something similar to:
185185

186186
```rust
187-
#![feature(arbitrary_self_types, coroutine_trait)]
187+
#![feature(coroutine_trait)]
188188

189189
use std::ops::{Coroutine, CoroutineState};
190190
use std::pin::Pin;

tests/auxiliary/minicore.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@ macro_rules! impl_marker_trait {
3131
#[lang = "sized"]
3232
pub trait Sized {}
3333

34-
#[lang = "legacy_receiver"]
35-
pub trait LegacyReceiver {}
36-
impl<T: ?Sized> LegacyReceiver for &T {}
37-
impl<T: ?Sized> LegacyReceiver for &mut T {}
38-
3934
#[lang = "copy"]
4035
pub trait Copy: Sized {}
4136

tests/codegen/avr/avr-func-addrspace.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// It also validates that functions can be called through function pointers
1010
// through traits.
1111

12-
#![feature(no_core, lang_items, intrinsics, unboxed_closures, arbitrary_self_types)]
12+
#![feature(no_core, lang_items, intrinsics, unboxed_closures)]
1313
#![crate_type = "lib"]
1414
#![no_core]
1515

@@ -18,8 +18,6 @@ pub trait Sized {}
1818
#[lang = "copy"]
1919
pub trait Copy {}
2020
impl<T: ?Sized> Copy for *const T {}
21-
#[lang = "legacy_receiver"]
22-
pub trait LegacyReceiver {}
2321
#[lang = "tuple_trait"]
2422
pub trait Tuple {}
2523

0 commit comments

Comments
 (0)