Skip to content

Update to edition 2024 #4311

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 8, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ name = "miri"
repository = "https://github.com/rust-lang/miri"
version = "0.1.0"
default-run = "miri"
edition = "2021"
edition = "2024"

[lib]
test = true # we have unit tests
2 changes: 1 addition & 1 deletion cargo-miri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ license = "MIT OR Apache-2.0"
name = "cargo-miri"
repository = "https://github.com/rust-lang/miri"
version = "0.1.0"
edition = "2021"
edition = "2024"

[[bin]]
name = "cargo-miri"
2 changes: 1 addition & 1 deletion miri-script/Cargo.toml
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ name = "miri-script"
repository = "https://github.com/rust-lang/miri"
version = "0.1.0"
default-run = "miri-script"
edition = "2021"
edition = "2024"

[workspace]
# We make this a workspace root so that cargo does not go looking in ../Cargo.toml for the workspace root.
2 changes: 1 addition & 1 deletion miri-script/src/util.rs
Original file line number Diff line number Diff line change
@@ -213,7 +213,7 @@ impl MiriEnv {
let toolchain = &self.toolchain;
let mut cmd = cmd!(
self.sh,
"rustfmt +{toolchain} --edition=2021 --config-path {config_path} --unstable-features --skip-children {flags...}"
"rustfmt +{toolchain} --edition=2024 --config-path {config_path} --unstable-features --skip-children {flags...}"
);
if first {
// Log an abbreviating command, and only once.
2 changes: 1 addition & 1 deletion src/bin/miri.rs
Original file line number Diff line number Diff line change
@@ -459,7 +459,7 @@ fn jemalloc_magic() {
// linking, so we need to explicitly depend on the function.
#[cfg(target_os = "macos")]
{
extern "C" {
unsafe extern "C" {
fn _rjem_je_zone_register();
}

2 changes: 1 addition & 1 deletion src/borrow_tracker/tree_borrows/diagnostics.rs
Original file line number Diff line number Diff line change
@@ -179,7 +179,7 @@ impl NodeDebugInfo {
/// Add a name to the tag. If a same tag is associated to several pointers,
/// it can have several names which will be separated by commas.
pub fn add_name(&mut self, name: &str) {
if let Some(ref mut prev_name) = &mut self.name {
if let Some(prev_name) = &mut self.name {
prev_name.push_str(", ");
prev_name.push_str(name);
} else {
3 changes: 1 addition & 2 deletions src/diagnostics.rs
Original file line number Diff line number Diff line change
@@ -648,8 +648,7 @@ impl<'tcx> MiriMachine<'tcx> {
AccessedAlloc(AllocId(id), access_kind) =>
format!("{access_kind} to allocation with id {id}"),
FreedAlloc(AllocId(id)) => format!("freed allocation with id {id}"),
RejectedIsolatedOp(ref op) =>
format!("{op} was made to return an error due to isolation"),
RejectedIsolatedOp(op) => format!("{op} was made to return an error due to isolation"),
ProgressReport { .. } =>
format!("progress report: current operation being executed is here"),
Int2Ptr { .. } => format!("integer-to-pointer cast"),
8 changes: 4 additions & 4 deletions tests/pass/coroutine.rs
Original file line number Diff line number Diff line change
@@ -183,18 +183,18 @@ fn basic() {

fn smoke_resume_arg() {
fn drain<G: Coroutine<R, Yield = Y> + Unpin, R, Y>(
gen: &mut G,
gen_: &mut G,
inout: Vec<(R, CoroutineState<Y, G::Return>)>,
) where
Y: Debug + PartialEq,
G::Return: Debug + PartialEq,
{
let mut gen = Pin::new(gen);
let mut gen_ = Pin::new(gen_);

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