diff options
Diffstat (limited to 'compiler/stable_mir')
| -rw-r--r-- | compiler/stable_mir/Cargo.toml | 2 | ||||
| -rw-r--r-- | compiler/stable_mir/src/abi.rs | 6 | ||||
| -rw-r--r-- | compiler/stable_mir/src/mir/body.rs | 4 | ||||
| -rw-r--r-- | compiler/stable_mir/src/mir/pretty.rs | 2 | ||||
| -rw-r--r-- | compiler/stable_mir/src/ty.rs | 4 | ||||
| -rw-r--r-- | compiler/stable_mir/src/visitor.rs | 2 |
6 files changed, 8 insertions, 12 deletions
diff --git a/compiler/stable_mir/Cargo.toml b/compiler/stable_mir/Cargo.toml index 2edb3f140d7..d691a0e4f22 100644 --- a/compiler/stable_mir/Cargo.toml +++ b/compiler/stable_mir/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "stable_mir" version = "0.1.0-preview" -edition = "2021" +edition = "2024" [dependencies] scoped-tls = "1.0" diff --git a/compiler/stable_mir/src/abi.rs b/compiler/stable_mir/src/abi.rs index 861b6692b53..091f3e1a95e 100644 --- a/compiler/stable_mir/src/abi.rs +++ b/compiler/stable_mir/src/abi.rs @@ -227,7 +227,6 @@ pub enum TagEncoding { /// in terms of categories of C types there are ABI rules for. #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize)] pub enum ValueAbi { - Uninhabited, Scalar(Scalar), ScalarPair(Scalar, Scalar), Vector { @@ -244,10 +243,7 @@ impl ValueAbi { /// Returns `true` if the layout corresponds to an unsized type. pub fn is_unsized(&self) -> bool { match *self { - ValueAbi::Uninhabited - | ValueAbi::Scalar(_) - | ValueAbi::ScalarPair(..) - | ValueAbi::Vector { .. } => false, + ValueAbi::Scalar(_) | ValueAbi::ScalarPair(..) | ValueAbi::Vector { .. } => false, ValueAbi::Aggregate { sized } => !sized, } } diff --git a/compiler/stable_mir/src/mir/body.rs b/compiler/stable_mir/src/mir/body.rs index a6406e9db8e..f8b46f50a52 100644 --- a/compiler/stable_mir/src/mir/body.rs +++ b/compiler/stable_mir/src/mir/body.rs @@ -307,7 +307,7 @@ impl AssertMessage { AssertMessage::MisalignedPointerDereference { .. } => { Ok("misaligned pointer dereference") } - AssertMessage::NullPointerDereference => Ok("null pointer dereference occured"), + AssertMessage::NullPointerDereference => Ok("null pointer dereference occurred"), } } } @@ -864,7 +864,7 @@ impl SwitchTargets { } /// The conditional targets which are only taken if the pattern matches the given value. - pub fn branches(&self) -> impl Iterator<Item = (u128, BasicBlockIdx)> + '_ { + pub fn branches(&self) -> impl Iterator<Item = (u128, BasicBlockIdx)> { self.branches.iter().copied() } diff --git a/compiler/stable_mir/src/mir/pretty.rs b/compiler/stable_mir/src/mir/pretty.rs index 6638f93e555..8278afb7a2f 100644 --- a/compiler/stable_mir/src/mir/pretty.rs +++ b/compiler/stable_mir/src/mir/pretty.rs @@ -299,7 +299,7 @@ fn pretty_assert_message<W: Write>(writer: &mut W, msg: &AssertMessage) -> io::R ) } AssertMessage::NullPointerDereference => { - write!(writer, "\"null pointer dereference occured.\"") + write!(writer, "\"null pointer dereference occurred\"") } AssertMessage::ResumedAfterReturn(_) | AssertMessage::ResumedAfterPanic(_) => { write!(writer, "{}", msg.description().unwrap()) diff --git a/compiler/stable_mir/src/ty.rs b/compiler/stable_mir/src/ty.rs index 3434597e7b0..b857a735b72 100644 --- a/compiler/stable_mir/src/ty.rs +++ b/compiler/stable_mir/src/ty.rs @@ -489,7 +489,7 @@ impl TyKind { /// Returns the type and mutability of `*ty` for builtin types. /// /// The parameter `explicit` indicates if this is an *explicit* dereference. - /// Some types -- notably unsafe ptrs -- can only be dereferenced explicitly. + /// Some types -- notably raw ptrs -- can only be dereferenced explicitly. pub fn builtin_deref(&self, explicit: bool) -> Option<TypeAndMut> { match self.rigid()? { RigidTy::Adt(def, args) if def.is_box() => { @@ -809,7 +809,7 @@ impl AdtDef { } /// Iterate over the variants in this ADT. - pub fn variants_iter(&self) -> impl Iterator<Item = VariantDef> + '_ { + pub fn variants_iter(&self) -> impl Iterator<Item = VariantDef> { (0..self.num_variants()) .map(|idx| VariantDef { idx: VariantIdx::to_val(idx), adt_def: *self }) } diff --git a/compiler/stable_mir/src/visitor.rs b/compiler/stable_mir/src/visitor.rs index 3533ed2e851..8463174f9a4 100644 --- a/compiler/stable_mir/src/visitor.rs +++ b/compiler/stable_mir/src/visitor.rs @@ -161,7 +161,7 @@ impl Visitable for RigidTy { RigidTy::Slice(inner) => inner.visit(visitor), RigidTy::RawPtr(ty, _) => ty.visit(visitor), RigidTy::Ref(reg, ty, _) => { - reg.visit(visitor); + reg.visit(visitor)?; ty.visit(visitor) } RigidTy::Adt(_, args) |
