X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_ast%2Fsrc%2Fast.rs;h=a2d32cdc00fb001b2c03077f9d99ccdf78bd4935;hb=1591dcb659917de87254297073b078b9ade56612;hp=03b957adeda9d36a748908846eac282a5d3b2f59;hpb=d317da48b1341eec28ed070002a7110b39b9ae15;p=rust.git diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs index 03b957adeda..a2d32cdc00f 100644 --- a/compiler/rustc_ast/src/ast.rs +++ b/compiler/rustc_ast/src/ast.rs @@ -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, pub items: Vec>, pub span: Span, - // Placeholder ID if the crate node is a macro placeholder. - pub is_placeholder: Option, + /// 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.