mirror of
https://git.proxmox.com/git/rustc
synced 2025-08-15 02:31:20 +00:00
15 lines
290 B
Rust
15 lines
290 B
Rust
#![feature(const_trait_impl)]
|
|
|
|
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
|
|
}
|