Use {Decodable,Encodable}_NoContext in type_ir

This commit is contained in:
Michael Goulet
2025-03-13 17:36:33 +00:00
parent e5a2220327
commit 6438b9eca8
24 changed files with 281 additions and 105 deletions

View File

@@ -12,14 +12,17 @@
// tidy-alphabetical-end
#[cfg(feature = "nightly")]
use rustc_macros::{Decodable, Encodable, HashStable_NoContext};
use rustc_macros::{Decodable_NoContext, Encodable_NoContext, HashStable_NoContext};
pub mod visit;
/// The movability of a coroutine / closure literal:
/// whether a coroutine contains self-references, causing it to be `!Unpin`.
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Copy)]
#[cfg_attr(feature = "nightly", derive(Encodable, Decodable, HashStable_NoContext))]
#[cfg_attr(
feature = "nightly",
derive(Encodable_NoContext, Decodable_NoContext, HashStable_NoContext)
)]
pub enum Movability {
/// May contain self-references, `!Unpin`.
Static,
@@ -28,7 +31,10 @@ pub enum Movability {
}
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Copy)]
#[cfg_attr(feature = "nightly", derive(Encodable, Decodable, HashStable_NoContext))]
#[cfg_attr(
feature = "nightly",
derive(Encodable_NoContext, Decodable_NoContext, HashStable_NoContext)
)]
pub enum Mutability {
// N.B. Order is deliberate, so that Not < Mut
Not,
@@ -87,7 +93,10 @@ impl Mutability {
}
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Copy)]
#[cfg_attr(feature = "nightly", derive(Encodable, Decodable, HashStable_NoContext))]
#[cfg_attr(
feature = "nightly",
derive(Encodable_NoContext, Decodable_NoContext, HashStable_NoContext)
)]
pub enum Pinnedness {
Not,
Pinned,