Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit add9056

Browse files
authored
Merge branch 'rust-lang:master' into master
2 parents 1dd54eb + dcda13a commit add9056

File tree

3 files changed

+27
-16
lines changed

3 files changed

+27
-16
lines changed

crates/hir-ty/src/consteval/tests/intrinsics.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,24 @@ fn transmute() {
163163
);
164164
}
165165

166+
#[test]
167+
fn read_via_copy() {
168+
check_number(
169+
r#"
170+
extern "rust-intrinsic" {
171+
pub fn read_via_copy<T>(e: *const T) -> T;
172+
pub fn volatile_load<T>(e: *const T) -> T;
173+
}
174+
175+
const GOAL: i32 = {
176+
let x = 2;
177+
read_via_copy(&x) + volatile_load(&x)
178+
};
179+
"#,
180+
4,
181+
);
182+
}
183+
166184
#[test]
167185
fn const_eval_select() {
168186
check_number(

crates/hir-ty/src/mir/eval/shim.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -888,6 +888,13 @@ impl Evaluator<'_> {
888888
}
889889
not_supported!("FnOnce was not available for executing const_eval_select");
890890
}
891+
"read_via_copy" | "volatile_load" => {
892+
let [arg] = args else {
893+
return Err(MirEvalError::TypeError("read_via_copy args are not provided"));
894+
};
895+
let addr = Address::from_bytes(arg.interval.get(self)?)?;
896+
destination.write_from_interval(self, Interval { addr, size: destination.size })
897+
}
891898
_ => not_supported!("unknown intrinsic {name}"),
892899
}
893900
}

docs/user/manual.adoc

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -64,22 +64,8 @@ You can install the latest release of the plugin from
6464
https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer[the marketplace].
6565

6666
Note that the plugin may cause conflicts with the
67-
https://marketplace.visualstudio.com/items?itemName=rust-lang.rust[official Rust plugin].
68-
It is recommended to disable the Rust plugin when using the rust-analyzer extension.
69-
70-
By default, the plugin will prompt you to download the matching version of the server as well:
71-
72-
image::https://user-images.githubusercontent.com/9021944/75067008-17502500-54ba-11ea-835a-f92aac50e866.png[]
73-
74-
[NOTE]
75-
====
76-
To disable this notification put the following to `settings.json`
77-
78-
[source,json]
79-
----
80-
{ "rust-analyzer.updates.askBeforeDownload": false }
81-
----
82-
====
67+
https://marketplace.visualstudio.com/items?itemName=rust-lang.rust[previous official Rust plugin].
68+
The latter is no longer maintained and should be uninstalled.
8369

8470
The server binary is stored in the extension install directory, which starts with `rust-lang.rust-analyzer-` and is located under:
8571

0 commit comments

Comments
 (0)