Skip to content

Commit d0e63b2

Browse files
authored
Merge pull request rust-lang#4311 from est31/edition_2024
Update to edition 2024
2 parents 514d546 + 070fee2 commit d0e63b2

File tree

8 files changed

+11
-12
lines changed

8 files changed

+11
-12
lines changed

src/tools/miri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ name = "miri"
66
repository = "https://github.com/rust-lang/miri"
77
version = "0.1.0"
88
default-run = "miri"
9-
edition = "2021"
9+
edition = "2024"
1010

1111
[lib]
1212
test = true # we have unit tests

src/tools/miri/cargo-miri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ license = "MIT OR Apache-2.0"
55
name = "cargo-miri"
66
repository = "https://github.com/rust-lang/miri"
77
version = "0.1.0"
8-
edition = "2021"
8+
edition = "2024"
99

1010
[[bin]]
1111
name = "cargo-miri"

src/tools/miri/miri-script/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ name = "miri-script"
66
repository = "https://github.com/rust-lang/miri"
77
version = "0.1.0"
88
default-run = "miri-script"
9-
edition = "2021"
9+
edition = "2024"
1010

1111
[workspace]
1212
# We make this a workspace root so that cargo does not go looking in ../Cargo.toml for the workspace root.

src/tools/miri/miri-script/src/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ impl MiriEnv {
213213
let toolchain = &self.toolchain;
214214
let mut cmd = cmd!(
215215
self.sh,
216-
"rustfmt +{toolchain} --edition=2021 --config-path {config_path} --unstable-features --skip-children {flags...}"
216+
"rustfmt +{toolchain} --edition=2024 --config-path {config_path} --unstable-features --skip-children {flags...}"
217217
);
218218
if first {
219219
// Log an abbreviating command, and only once.

src/tools/miri/src/bin/miri.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ fn jemalloc_magic() {
459459
// linking, so we need to explicitly depend on the function.
460460
#[cfg(target_os = "macos")]
461461
{
462-
extern "C" {
462+
unsafe extern "C" {
463463
fn _rjem_je_zone_register();
464464
}
465465

src/tools/miri/src/borrow_tracker/tree_borrows/diagnostics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ impl NodeDebugInfo {
179179
/// Add a name to the tag. If a same tag is associated to several pointers,
180180
/// it can have several names which will be separated by commas.
181181
pub fn add_name(&mut self, name: &str) {
182-
if let Some(ref mut prev_name) = &mut self.name {
182+
if let Some(prev_name) = &mut self.name {
183183
prev_name.push_str(", ");
184184
prev_name.push_str(name);
185185
} else {

src/tools/miri/src/diagnostics.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -648,8 +648,7 @@ impl<'tcx> MiriMachine<'tcx> {
648648
AccessedAlloc(AllocId(id), access_kind) =>
649649
format!("{access_kind} to allocation with id {id}"),
650650
FreedAlloc(AllocId(id)) => format!("freed allocation with id {id}"),
651-
RejectedIsolatedOp(ref op) =>
652-
format!("{op} was made to return an error due to isolation"),
651+
RejectedIsolatedOp(op) => format!("{op} was made to return an error due to isolation"),
653652
ProgressReport { .. } =>
654653
format!("progress report: current operation being executed is here"),
655654
Int2Ptr { .. } => format!("integer-to-pointer cast"),

src/tools/miri/tests/pass/coroutine.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,18 +183,18 @@ fn basic() {
183183

184184
fn smoke_resume_arg() {
185185
fn drain<G: Coroutine<R, Yield = Y> + Unpin, R, Y>(
186-
gen: &mut G,
186+
gen_: &mut G,
187187
inout: Vec<(R, CoroutineState<Y, G::Return>)>,
188188
) where
189189
Y: Debug + PartialEq,
190190
G::Return: Debug + PartialEq,
191191
{
192-
let mut gen = Pin::new(gen);
192+
let mut gen_ = Pin::new(gen_);
193193

194194
for (input, out) in inout {
195-
assert_eq!(gen.as_mut().resume(input), out);
195+
assert_eq!(gen_.as_mut().resume(input), out);
196196
// Test if the coroutine is valid (according to type invariants).
197-
let _ = unsafe { ManuallyDrop::new(ptr::read(gen.as_mut().get_unchecked_mut())) };
197+
let _ = unsafe { ManuallyDrop::new(ptr::read(gen_.as_mut().get_unchecked_mut())) };
198198
}
199199
}
200200

0 commit comments

Comments
 (0)