2021-10-17 00:00:00 +00:00
|
|
|
#![feature(const_trait_impl)]
|
|
|
|
|
|
|
|
|
|
struct A();
|
|
|
|
|
|
|
|
|
|
impl const Drop for A {
|
2024-06-25 08:36:40 +00:00
|
|
|
//~^ ERROR const `impl` for trait `Drop` which is not marked with `#[const_trait]`
|
2021-10-17 00:00:00 +00:00
|
|
|
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
|
|
|
|
|
}
|