diff --git a/Cargo.toml b/Cargo.toml index 540eeabebb..4956a8dffd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ name = "miri" repository = "https://github.com/rust-lang/miri" version = "0.1.0" default-run = "miri" -edition = "2018" +edition = "2021" [lib] test = true # we have unit tests diff --git a/cargo-miri/Cargo.toml b/cargo-miri/Cargo.toml index 7789a8a895..eb92652530 100644 --- a/cargo-miri/Cargo.toml +++ b/cargo-miri/Cargo.toml @@ -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 = "2018" +edition = "2021" [[bin]] name = "cargo-miri" diff --git a/src/bin/miri.rs b/src/bin/miri.rs index be4776f459..727e0b717b 100644 --- a/src/bin/miri.rs +++ b/src/bin/miri.rs @@ -9,7 +9,6 @@ extern crate rustc_metadata; extern crate rustc_middle; extern crate rustc_session; -use std::convert::TryFrom; use std::env; use std::num::NonZeroU64; use std::path::PathBuf; diff --git a/src/diagnostics.rs b/src/diagnostics.rs index e1a2e3184e..ce66dea5e7 100644 --- a/src/diagnostics.rs +++ b/src/diagnostics.rs @@ -414,11 +414,11 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx ) } }, - CreatedCallId(id) => format!("function call with id {}", id), - CreatedAlloc(AllocId(id)) => format!("created allocation with id {}", id), - FreedAlloc(AllocId(id)) => format!("freed allocation with id {}", id), + CreatedCallId(id) => format!("function call with id {id}"), + CreatedAlloc(AllocId(id)) => format!("created allocation with id {id}"), + FreedAlloc(AllocId(id)) => format!("freed allocation with id {id}"), RejectedIsolatedOp(ref op) => - format!("{} was made to return an error due to isolation", op), + format!("{op} was made to return an error due to isolation"), }; let (title, diag_level) = match e { diff --git a/src/eval.rs b/src/eval.rs index 4c006867e1..5f829525cc 100644 --- a/src/eval.rs +++ b/src/eval.rs @@ -1,6 +1,5 @@ //! Main evaluator loop and setting up the initial stack frame. -use std::convert::TryFrom; use std::ffi::OsStr; use std::iter; diff --git a/src/helpers.rs b/src/helpers.rs index 9e4527d592..5b6e616400 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -1,4 +1,3 @@ -use std::convert::{TryFrom, TryInto}; use std::mem; use std::num::NonZeroUsize; use std::time::Duration; diff --git a/src/shims/backtrace.rs b/src/shims/backtrace.rs index 32fbbffc63..2ec4bbb32e 100644 --- a/src/shims/backtrace.rs +++ b/src/shims/backtrace.rs @@ -4,7 +4,6 @@ use rustc_middle::ty::layout::LayoutOf as _; use rustc_middle::ty::{self, Instance}; use rustc_span::{BytePos, Loc, Symbol}; use rustc_target::{abi::Size, spec::abi::Abi}; -use std::convert::TryInto as _; impl<'mir, 'tcx: 'mir> EvalContextExt<'mir, 'tcx> for crate::MiriEvalContext<'mir, 'tcx> {} pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx> { diff --git a/src/shims/env.rs b/src/shims/env.rs index 7be26de459..3b1b1f011e 100644 --- a/src/shims/env.rs +++ b/src/shims/env.rs @@ -1,4 +1,3 @@ -use std::convert::TryFrom; use std::env; use std::ffi::{OsStr, OsString}; use std::io::ErrorKind; diff --git a/src/shims/foreign_items.rs b/src/shims/foreign_items.rs index 77567e9bca..7b457e9ed7 100644 --- a/src/shims/foreign_items.rs +++ b/src/shims/foreign_items.rs @@ -1,8 +1,4 @@ -use std::{ - collections::hash_map::Entry, - convert::{TryFrom, TryInto}, - iter, -}; +use std::{collections::hash_map::Entry, iter}; use log::trace; diff --git a/src/shims/intrinsics.rs b/src/shims/intrinsics.rs index 9101cbcf05..58e546d6b0 100644 --- a/src/shims/intrinsics.rs +++ b/src/shims/intrinsics.rs @@ -1,4 +1,3 @@ -use std::convert::TryInto; use std::iter; use log::trace; diff --git a/src/shims/os_str.rs b/src/shims/os_str.rs index c03f7ad79b..8db75fed4a 100644 --- a/src/shims/os_str.rs +++ b/src/shims/os_str.rs @@ -1,5 +1,4 @@ use std::borrow::Cow; -use std::convert::TryFrom; use std::ffi::{OsStr, OsString}; use std::iter; use std::path::{Path, PathBuf}; diff --git a/src/shims/posix/fs.rs b/src/shims/posix/fs.rs index 5395d0f0bf..73e21dd57d 100644 --- a/src/shims/posix/fs.rs +++ b/src/shims/posix/fs.rs @@ -1,6 +1,5 @@ use std::borrow::Cow; use std::collections::BTreeMap; -use std::convert::{TryFrom, TryInto}; use std::fs::{ read_dir, remove_dir, remove_file, rename, DirBuilder, File, FileType, OpenOptions, ReadDir, }; diff --git a/src/shims/posix/thread.rs b/src/shims/posix/thread.rs index 69875a9ffc..7840a1e1e9 100644 --- a/src/shims/posix/thread.rs +++ b/src/shims/posix/thread.rs @@ -1,5 +1,3 @@ -use std::convert::TryInto; - use crate::*; use rustc_middle::ty::layout::LayoutOf; use rustc_target::spec::abi::Abi; diff --git a/src/shims/time.rs b/src/shims/time.rs index 0acd697fa4..78bf6f59b3 100644 --- a/src/shims/time.rs +++ b/src/shims/time.rs @@ -1,4 +1,3 @@ -use std::convert::TryFrom; use std::time::{Duration, Instant, SystemTime}; use crate::*; diff --git a/src/sync.rs b/src/sync.rs index 9007f25ce5..bbcd39333c 100644 --- a/src/sync.rs +++ b/src/sync.rs @@ -1,5 +1,4 @@ use std::collections::{hash_map::Entry, HashMap, VecDeque}; -use std::convert::TryFrom; use std::num::NonZeroU32; use std::ops::Not; diff --git a/src/thread.rs b/src/thread.rs index 2c5f6c2391..96131dba3c 100644 --- a/src/thread.rs +++ b/src/thread.rs @@ -2,7 +2,6 @@ use std::cell::RefCell; use std::collections::hash_map::Entry; -use std::convert::TryFrom; use std::num::TryFromIntError; use std::time::{Duration, Instant, SystemTime}; diff --git a/src/vector_clock.rs b/src/vector_clock.rs index 74180f25b3..e13e9c39fc 100644 --- a/src/vector_clock.rs +++ b/src/vector_clock.rs @@ -1,6 +1,6 @@ use rustc_index::vec::Idx; use smallvec::SmallVec; -use std::{cmp::Ordering, convert::TryFrom, fmt::Debug, ops::Index}; +use std::{cmp::Ordering, fmt::Debug, ops::Index}; /// A vector clock index, this is associated with a thread id /// but in some cases one vector index may be shared with