Skip to content

Commit 5c6923d

Browse files
committed
Arbitrary self types v2: stabilize test changes
All the test changes necessary for stabilization here.
1 parent a41a9de commit 5c6923d

File tree

100 files changed

+413
-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.

100 files changed

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

library/core/src/marker.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1168,7 +1168,8 @@ pub trait FnPtr: Copy + Clone {
11681168
/// type as a receiver are dyn-compatible. For example, this compiles:
11691169
///
11701170
/// ```
1171-
/// #![feature(arbitrary_self_types, derive_coerce_pointee)]
1171+
/// #![feature(derive_coerce_pointee)]
1172+
/// # #![cfg_attr(bootstrap, feature(legacy_receiver_trait))]
11721173
/// use std::marker::CoercePointee;
11731174
/// use std::ops::Deref;
11741175
///
@@ -1182,6 +1183,9 @@ pub trait FnPtr: Copy + Clone {
11821183
/// &self.0
11831184
/// }
11841185
/// }
1186+
/// #
1187+
/// # #[cfg(bootstrap)]
1188+
/// # impl<T: ?Sized> core::ops::LegacyReceiver for MySmartPointer<T> {}
11851189
///
11861190
/// // You can always define this trait. (as long as you have #![feature(arbitrary_self_types)])
11871191
/// trait MyTrait {

library/core/src/ops/deref.rs

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

304304
/// Indicates that a struct can be used as a method receiver.
305305
/// That is, a type can use this type as a type of `self`, like this:
306-
/// ```compile_fail
306+
/// ```
307307
/// # // This is currently compile_fail because the compiler-side parts
308308
/// # // of arbitrary_self_types are not implemented
309309
/// 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
@@ -43,11 +43,6 @@ macro_rules! impl_marker_trait {
4343
#[lang = "sized"]
4444
pub trait Sized {}
4545

46-
#[lang = "legacy_receiver"]
47-
pub trait LegacyReceiver {}
48-
impl<T: ?Sized> LegacyReceiver for &T {}
49-
impl<T: ?Sized> LegacyReceiver for &mut T {}
50-
5146
#[lang = "copy"]
5247
pub trait Copy: Sized {}
5348

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

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

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

tests/codegen/sanitizer/kcfi/emit-type-metadata-trait-objects.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//@ compile-flags: -Cno-prepopulate-passes -Zsanitizer=kcfi -Copt-level=0
1010

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

1515
extern crate minicore;

0 commit comments

Comments
 (0)