mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-01 03:03:40 +00:00
16 lines
318 B
Rust
16 lines
318 B
Rust
|
#![feature(const_trait_impl)]
|
||
|
#![feature(const_mut_refs)]
|
||
|
|
||
|
struct A();
|
||
|
|
||
|
impl const Drop for A {
|
||
|
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
|
||
|
}
|