@@ -290,7 +290,7 @@ pub enum ConstArgKind<'hir> {
290
290
/// However, in the future, we'll be using it for all of those.
291
291
Path ( QPath < ' hir > ) ,
292
292
Anon ( & ' hir AnonConst ) ,
293
- /// **Note:** Not all const inference variables are represented as
293
+ /// **Note:** Not all inferred consts are represented as
294
294
/// `ConstArgKind::Infer`. In cases where it is ambiguous whether
295
295
/// a generic arg is a type or a const, inference variables are
296
296
/// represented as `GenericArg::Infer` instead.
@@ -314,6 +314,10 @@ pub enum GenericArg<'hir> {
314
314
Lifetime ( & ' hir Lifetime ) ,
315
315
Type ( & ' hir Ty < ' hir > ) ,
316
316
Const ( & ' hir ConstArg < ' hir > ) ,
317
+ /// **Note:** Inference variables are only represented as
318
+ /// `GenericArg::Infer` in cases where it is ambiguous whether
319
+ /// a generic arg is a type or a const. Otherwise, inference variables
320
+ /// are represented as `TyKind::Infer` or `ConstArgKind::Infer`.
317
321
Infer ( InferArg ) ,
318
322
}
319
323
@@ -2844,6 +2848,11 @@ pub enum TyKind<'hir> {
2844
2848
Typeof ( & ' hir AnonConst ) ,
2845
2849
/// `TyKind::Infer` means the type should be inferred instead of it having been
2846
2850
/// specified. This can appear anywhere in a type.
2851
+ ///
2852
+ /// **Note:** Not all inferred types are represented as
2853
+ /// `TyKind::Infer`. In cases where it is ambiguous whether
2854
+ /// a generic arg is a type or a const, inference variables are
2855
+ /// represented as `GenericArg::Infer` instead.
2847
2856
Infer ,
2848
2857
/// Placeholder for a type that has failed to be defined.
2849
2858
Err ( rustc_span:: ErrorGuaranteed ) ,
0 commit comments