mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
Support read_via_copy intrinsic
This commit is contained in:
parent
c26259bdd1
commit
aa52cbf784
2 changed files with 25 additions and 0 deletions
|
@ -163,6 +163,24 @@ fn transmute() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn read_via_copy() {
|
||||
check_number(
|
||||
r#"
|
||||
extern "rust-intrinsic" {
|
||||
pub fn read_via_copy<T>(e: *const T) -> T;
|
||||
pub fn volatile_load<T>(e: *const T) -> T;
|
||||
}
|
||||
|
||||
const GOAL: i32 = {
|
||||
let x = 2;
|
||||
read_via_copy(&x) + volatile_load(&x)
|
||||
};
|
||||
"#,
|
||||
4,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn const_eval_select() {
|
||||
check_number(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue