2025-01-12 20:52:30 +00:00
|
|
|
#![feature(const_trait_impl, const_destruct)]
|
2021-10-17 00:00:00 +00:00
|
|
|
|
|
|
|
|
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
|
|
|
|
|
}
|