]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_ast/src/ast.rs
Rollup merge of #92559 - durin42:llvm-14-attributemask, r=nikic
[rust.git] / compiler / rustc_ast / src / ast.rs
index 03b957adeda9d36a748908846eac282a5d3b2f59..a2d32cdc00fb001b2c03077f9d99ccdf78bd4935 100644 (file)
@@ -332,10 +332,7 @@ pub fn span(&self) -> Span {
 pub enum ParamKindOrd {
     Lifetime,
     Type,
-    // `unordered` is only `true` if `sess.unordered_const_ty_params()`
-    // returns true. Specifically, if it's only `min_const_generics`, it will still require
-    // ordering consts after types.
-    Const { unordered: bool },
+    Const,
     // `Infer` is not actually constructed directly from the AST, but is implicitly constructed
     // during HIR lowering, and `ParamKindOrd` will implicitly order inferred variables last.
     Infer,
@@ -346,11 +343,7 @@ fn cmp(&self, other: &Self) -> Ordering {
         use ParamKindOrd::*;
         let to_int = |v| match v {
             Lifetime => 0,
-            Infer | Type | Const { unordered: true } => 1,
-            // technically both consts should be ordered equally,
-            // but only one is ever encountered at a time, so this is
-            // fine.
-            Const { unordered: false } => 2,
+            Infer | Type | Const => 1,
         };
 
         to_int(*self).cmp(&to_int(*other))
@@ -517,8 +510,10 @@ pub struct Crate {
     pub attrs: Vec<Attribute>,
     pub items: Vec<P<Item>>,
     pub span: Span,
-    // Placeholder ID if the crate node is a macro placeholder.
-    pub is_placeholder: Option<NodeId>,
+    /// Must be equal to `CRATE_NODE_ID` after the crate root is expanded, but may hold
+    /// expansion placeholders or an unassigned value (`DUMMY_NODE_ID`) before that.
+    pub id: NodeId,
+    pub is_placeholder: bool,
 }
 
 /// Possible values inside of compile-time attribute lists.