mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 21:13:37 +00:00
Merge branch 'rust-lang:master' into master
This commit is contained in:
commit
add9056c32
3 changed files with 27 additions and 16 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]
|
#[test]
|
||||||
fn const_eval_select() {
|
fn const_eval_select() {
|
||||||
check_number(
|
check_number(
|
||||||
|
|
|
@ -888,6 +888,13 @@ impl Evaluator<'_> {
|
||||||
}
|
}
|
||||||
not_supported!("FnOnce was not available for executing const_eval_select");
|
not_supported!("FnOnce was not available for executing const_eval_select");
|
||||||
}
|
}
|
||||||
|
"read_via_copy" | "volatile_load" => {
|
||||||
|
let [arg] = args else {
|
||||||
|
return Err(MirEvalError::TypeError("read_via_copy args are not provided"));
|
||||||
|
};
|
||||||
|
let addr = Address::from_bytes(arg.interval.get(self)?)?;
|
||||||
|
destination.write_from_interval(self, Interval { addr, size: destination.size })
|
||||||
|
}
|
||||||
_ => not_supported!("unknown intrinsic {name}"),
|
_ => not_supported!("unknown intrinsic {name}"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,22 +64,8 @@ You can install the latest release of the plugin from
|
||||||
https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer[the marketplace].
|
https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer[the marketplace].
|
||||||
|
|
||||||
Note that the plugin may cause conflicts with the
|
Note that the plugin may cause conflicts with the
|
||||||
https://marketplace.visualstudio.com/items?itemName=rust-lang.rust[official Rust plugin].
|
https://marketplace.visualstudio.com/items?itemName=rust-lang.rust[previous official Rust plugin].
|
||||||
It is recommended to disable the Rust plugin when using the rust-analyzer extension.
|
The latter is no longer maintained and should be uninstalled.
|
||||||
|
|
||||||
By default, the plugin will prompt you to download the matching version of the server as well:
|
|
||||||
|
|
||||||
image::https://user-images.githubusercontent.com/9021944/75067008-17502500-54ba-11ea-835a-f92aac50e866.png[]
|
|
||||||
|
|
||||||
[NOTE]
|
|
||||||
====
|
|
||||||
To disable this notification put the following to `settings.json`
|
|
||||||
|
|
||||||
[source,json]
|
|
||||||
----
|
|
||||||
{ "rust-analyzer.updates.askBeforeDownload": false }
|
|
||||||
----
|
|
||||||
====
|
|
||||||
|
|
||||||
The server binary is stored in the extension install directory, which starts with `rust-lang.rust-analyzer-` and is located under:
|
The server binary is stored in the extension install directory, which starts with `rust-lang.rust-analyzer-` and is located under:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue