mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
16 lines
377 B
Rust
16 lines
377 B
Rust
#![feature(const_trait_impl)]
|
|
|
|
struct A();
|
|
|
|
impl const Drop for A {
|
|
//~^ ERROR const `impl` for trait `Drop` which is not marked with `#[const_trait]`
|
|
fn drop(&mut self) {}
|
|
}
|
|
|
|
const C: A = A();
|
|
|
|
fn main() {
|
|
let _: &'static A = &A(); //~ ERROR temporary value dropped while borrowed
|
|
let _: &'static [A] = &[C]; //~ ERROR temporary value dropped while borrowed
|
|
}
|