rust/tests/ui/unsafe-binders/expr.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
302 B
Rust
Raw Normal View History

//@ check-pass
2024-12-10 19:42:09 +00:00
#![feature(unsafe_binders)]
//~^ WARN the feature `unsafe_binders` is incomplete
use std::unsafe_binder::{wrap_binder, unwrap_binder};
fn main() {
unsafe {
2024-12-10 19:42:09 +00:00
let x = 1;
let binder: unsafe<'a> &'a i32 = wrap_binder!(&x);
let rx = *unwrap_binder!(binder);
}
2024-12-10 19:42:09 +00:00
}