Skip to content

Commit 7bffede

Browse files
committed
2 parents 78c892d + db74f11 commit 7bffede

File tree

30 files changed

+346
-49
lines changed

30 files changed

+346
-49
lines changed

src/bootstrap/step.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,6 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
316316
"codegen-units");
317317
suite("check-incremental", "src/test/incremental", "incremental",
318318
"incremental");
319-
suite("check-ui", "src/test/ui", "ui", "ui");
320319
}
321320

322321
if build.config.build.contains("msvc") {
@@ -363,6 +362,7 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
363362
});
364363
};
365364

365+
suite("check-ui", "src/test/ui", "ui", "ui");
366366
suite("check-rpass-full", "src/test/run-pass-fulldeps",
367367
"run-pass", "run-pass-fulldeps");
368368
suite("check-rfail-full", "src/test/run-fail-fulldeps",
@@ -1374,7 +1374,6 @@ mod tests {
13741374

13751375
assert!(plan.iter().any(|s| s.name.contains("-ui")));
13761376
assert!(plan.iter().any(|s| s.name.contains("cfail")));
1377-
assert!(plan.iter().any(|s| s.name.contains("cfail")));
13781377
assert!(plan.iter().any(|s| s.name.contains("cfail-full")));
13791378
assert!(plan.iter().any(|s| s.name.contains("codegen-units")));
13801379
assert!(plan.iter().any(|s| s.name.contains("debuginfo")));
@@ -1407,8 +1406,7 @@ mod tests {
14071406
assert!(plan.iter().all(|s| s.host == "A"));
14081407
assert!(plan.iter().all(|s| s.target == "C"));
14091408

1410-
assert!(plan.iter().any(|s| s.name.contains("-ui")));
1411-
assert!(plan.iter().any(|s| s.name.contains("cfail")));
1409+
assert!(!plan.iter().any(|s| s.name.contains("-ui")));
14121410
assert!(plan.iter().any(|s| s.name.contains("cfail")));
14131411
assert!(!plan.iter().any(|s| s.name.contains("cfail-full")));
14141412
assert!(plan.iter().any(|s| s.name.contains("codegen-units")));

src/doc/nomicon/coercions.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Coercion is allowed between the following types:
1717
* `&T` to `*const T`
1818
* `&mut T` to `*mut T`
1919
* Unsizing: `T` to `U` if `T` implements `CoerceUnsized<U>`
20+
* Deref coercion: Expression `&x` of type `&T` to `&*x` of type `&U` if `T` derefs to `U` (i.e. `T: Deref<Target=U>`)
2021

2122
`CoerceUnsized<Pointer<U>> for Pointer<T> where T: Unsize<U>` is implemented
2223
for all pointer types (including smart pointers like Box and Rc). Unsize is
@@ -27,8 +28,9 @@ only implemented automatically, and enables the following transformations:
2728
* `Foo<..., T, ...>` => `Foo<..., U, ...>` where:
2829
* `T: Unsize<U>`
2930
* `Foo` is a struct
30-
* Only the last field of `Foo` has type `T`
31+
* Only the last field of `Foo` has type involving `T`
3132
* `T` is not part of the type of any other fields
33+
* `Bar<T>: Unsize<Bar<U>>`, if the last field of `Foo` has type `Bar<T>`
3234

3335
Coercions occur at a *coercion site*. Any location that is explicitly typed
3436
will cause a coercion to its type. If inference is necessary, the coercion will

src/liballoc/arc.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ impl<T: ?Sized> Arc<T> {
708708
}
709709

710710
#[stable(feature = "rust1", since = "1.0.0")]
711-
impl<T: ?Sized> Drop for Arc<T> {
711+
unsafe impl<#[may_dangle] T: ?Sized> Drop for Arc<T> {
712712
/// Drops the `Arc`.
713713
///
714714
/// This will decrement the strong reference count. If the strong reference
@@ -736,7 +736,6 @@ impl<T: ?Sized> Drop for Arc<T> {
736736
/// drop(foo); // Doesn't print anything
737737
/// drop(foo2); // Prints "dropped!"
738738
/// ```
739-
#[unsafe_destructor_blind_to_params]
740739
#[inline]
741740
fn drop(&mut self) {
742741
// Because `fetch_sub` is already atomic, we do not need to synchronize

src/liballoc/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,10 @@
7979
#![feature(const_fn)]
8080
#![feature(core_intrinsics)]
8181
#![feature(custom_attribute)]
82-
#![feature(dropck_parametricity)]
82+
#![feature(dropck_eyepatch)]
8383
#![cfg_attr(not(test), feature(exact_size_is_empty))]
8484
#![feature(fundamental)]
85+
#![feature(generic_param_attrs)]
8586
#![feature(lang_items)]
8687
#![feature(needs_allocator)]
8788
#![feature(optin_builtin_traits)]

src/liballoc/raw_vec.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,8 +539,7 @@ impl<T> RawVec<T> {
539539
}
540540
}
541541

542-
impl<T> Drop for RawVec<T> {
543-
#[unsafe_destructor_blind_to_params]
542+
unsafe impl<#[may_dangle] T> Drop for RawVec<T> {
544543
/// Frees the memory owned by the RawVec *without* trying to Drop its contents.
545544
fn drop(&mut self) {
546545
let elem_size = mem::size_of::<T>();

src/liballoc/rc.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ impl<T: ?Sized> Deref for Rc<T> {
644644
}
645645

646646
#[stable(feature = "rust1", since = "1.0.0")]
647-
impl<T: ?Sized> Drop for Rc<T> {
647+
unsafe impl<#[may_dangle] T: ?Sized> Drop for Rc<T> {
648648
/// Drops the `Rc`.
649649
///
650650
/// This will decrement the strong reference count. If the strong reference
@@ -672,7 +672,6 @@ impl<T: ?Sized> Drop for Rc<T> {
672672
/// drop(foo); // Doesn't print anything
673673
/// drop(foo2); // Prints "dropped!"
674674
/// ```
675-
#[unsafe_destructor_blind_to_params]
676675
fn drop(&mut self) {
677676
unsafe {
678677
let ptr = *self.ptr;

src/libarena/lib.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@
3030

3131
#![feature(alloc)]
3232
#![feature(core_intrinsics)]
33+
#![feature(dropck_eyepatch)]
3334
#![feature(heap_api)]
34-
#![feature(heap_api)]
35+
#![feature(generic_param_attrs)]
3536
#![feature(staged_api)]
36-
#![feature(dropck_parametricity)]
3737
#![cfg_attr(test, feature(test))]
3838

3939
#![allow(deprecated)]
@@ -258,8 +258,7 @@ impl<T> TypedArena<T> {
258258
}
259259
}
260260

261-
impl<T> Drop for TypedArena<T> {
262-
#[unsafe_destructor_blind_to_params]
261+
unsafe impl<#[may_dangle] T> Drop for TypedArena<T> {
263262
fn drop(&mut self) {
264263
unsafe {
265264
// Determine how much was filled.

src/libcollections/btree/map.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,7 @@ pub struct BTreeMap<K, V> {
137137
}
138138

139139
#[stable(feature = "btree_drop", since = "1.7.0")]
140-
impl<K, V> Drop for BTreeMap<K, V> {
141-
#[unsafe_destructor_blind_to_params]
140+
unsafe impl<#[may_dangle] K, #[may_dangle] V> Drop for BTreeMap<K, V> {
142141
fn drop(&mut self) {
143142
unsafe {
144143
for _ in ptr::read(self).into_iter() {

src/libcollections/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,11 @@
3535
#![feature(box_syntax)]
3636
#![cfg_attr(not(test), feature(char_escape_debug))]
3737
#![feature(core_intrinsics)]
38-
#![feature(dropck_parametricity)]
38+
#![feature(dropck_eyepatch)]
3939
#![feature(exact_size_is_empty)]
4040
#![feature(fmt_internals)]
4141
#![feature(fused)]
42+
#![feature(generic_param_attrs)]
4243
#![feature(heap_api)]
4344
#![feature(inclusive_range)]
4445
#![feature(lang_items)]

src/libcollections/linked_list.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -726,8 +726,7 @@ impl<T> LinkedList<T> {
726726
}
727727

728728
#[stable(feature = "rust1", since = "1.0.0")]
729-
impl<T> Drop for LinkedList<T> {
730-
#[unsafe_destructor_blind_to_params]
729+
unsafe impl<#[may_dangle] T> Drop for LinkedList<T> {
731730
fn drop(&mut self) {
732731
while let Some(_) = self.pop_front_node() {}
733732
}

0 commit comments

Comments
 (0)