Revert accidental stabilization
This commit is contained in:
parent
282778aee2
commit
5f7ca55df6
4 changed files with 17 additions and 3 deletions
|
@ -1170,8 +1170,7 @@ impl<T: ?Sized, A: Allocator> Box<T, A> {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[rustc_const_unstable(feature = "const_box", issue = "92521")]
|
unsafe impl<#[may_dangle] T: ?Sized, A: Allocator> Drop for Box<T, A> {
|
||||||
unsafe impl<#[may_dangle] T: ?Sized, A: Allocator> const Drop for Box<T, A> {
|
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
// FIXME: Do nothing, drop is currently performed by compiler.
|
// FIXME: Do nothing, drop is currently performed by compiler.
|
||||||
}
|
}
|
||||||
|
|
|
@ -160,7 +160,7 @@ fn const_box() {
|
||||||
*boxed = 42;
|
*boxed = 42;
|
||||||
assert!(*boxed == 42);
|
assert!(*boxed == 42);
|
||||||
|
|
||||||
*boxed
|
*Box::leak(boxed)
|
||||||
};
|
};
|
||||||
|
|
||||||
assert!(VALUE == 42);
|
assert!(VALUE == 42);
|
||||||
|
|
4
src/test/ui/consts/drop_box.rs
Normal file
4
src/test/ui/consts/drop_box.rs
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
const fn f<T>(_: Box<T>) {}
|
||||||
|
//~^ ERROR destructors cannot be evaluated at compile-time
|
||||||
|
|
||||||
|
fn main() {}
|
11
src/test/ui/consts/drop_box.stderr
Normal file
11
src/test/ui/consts/drop_box.stderr
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
error[E0493]: destructors cannot be evaluated at compile-time
|
||||||
|
--> $DIR/drop_box.rs:1:15
|
||||||
|
|
|
||||||
|
LL | const fn f<T>(_: Box<T>) {}
|
||||||
|
| ^ - value is dropped here
|
||||||
|
| |
|
||||||
|
| constant functions cannot evaluate destructors
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
For more information about this error, try `rustc --explain E0493`.
|
Loading…
Add table
Add a link
Reference in a new issue