@@ -408,7 +408,7 @@ impl<'hir> PathSegment<'hir> {
408
408
/// versus const args that are literals or have arbitrary computations (e.g., `{ 1 + 3 }`).
409
409
///
410
410
/// For an explanation of the `Unambig` generic parameter see the dev-guide:
411
- /// https://rustc-dev-guide.rust-lang.org/hir/ambig-unambig-ty-and-consts.html
411
+ /// < https://rustc-dev-guide.rust-lang.org/hir/ambig-unambig-ty-and-consts.html>
412
412
#[ derive( Clone , Copy , Debug , HashStable_Generic ) ]
413
413
#[ repr( C ) ]
414
414
pub struct ConstArg < ' hir , Unambig = ( ) > {
@@ -420,16 +420,13 @@ pub struct ConstArg<'hir, Unambig = ()> {
420
420
impl < ' hir > ConstArg < ' hir , AmbigArg > {
421
421
/// Converts a `ConstArg` in an ambiguous position to one in an unambiguous position.
422
422
///
423
- /// Functions accepting an unambiguous consts may expect the [`ConstArgKind::Infer`] variant
423
+ /// Functions accepting unambiguous consts may expect the [`ConstArgKind::Infer`] variant
424
424
/// to be used. Care should be taken to separately handle infer consts when calling this
425
425
/// function as it cannot be handled by downstream code making use of the returned const.
426
426
///
427
427
/// In practice this may mean overriding the [`Visitor::visit_infer`][visit_infer] method on hir visitors, or
428
428
/// specifically matching on [`GenericArg::Infer`] when handling generic arguments.
429
429
///
430
- /// For an explanation of what it means for a const arg to be ambig or unambig, see the dev-guide:
431
- /// https://rustc-dev-guide.rust-lang.org/hir/ambig-unambig-ty-and-consts.html
432
- ///
433
430
/// [visit_infer]: [rustc_hir::intravisit::Visitor::visit_infer]
434
431
pub fn as_unambig_ct ( & self ) -> & ConstArg < ' hir > {
435
432
// SAFETY: `ConstArg` is `repr(C)` and `ConstArgKind` is marked `repr(u8)` so that the
@@ -445,9 +442,6 @@ impl<'hir> ConstArg<'hir> {
445
442
///
446
443
/// Functions accepting ambiguous consts will not handle the [`ConstArgKind::Infer`] variant, if
447
444
/// infer consts are relevant to you then care should be taken to handle them separately.
448
- ///
449
- /// For an explanation of what it means for a const arg to be ambig or unambig, see the dev-guide:
450
- /// https://rustc-dev-guide.rust-lang.org/hir/ambig-unambig-ty-and-consts.html
451
445
pub fn try_as_ambig_ct ( & self ) -> Option < & ConstArg < ' hir , AmbigArg > > {
452
446
if let ConstArgKind :: Infer ( _, ( ) ) = self . kind {
453
447
return None ;
@@ -479,9 +473,6 @@ impl<'hir, Unambig> ConstArg<'hir, Unambig> {
479
473
}
480
474
481
475
/// See [`ConstArg`].
482
- ///
483
- /// For an explanation of the `Unambig` generic parameter see the dev-guide:
484
- /// https://rustc-dev-guide.rust-lang.org/hir/ambig-unambig-ty-and-consts.html
485
476
#[ derive( Clone , Copy , Debug , HashStable_Generic ) ]
486
477
#[ repr( u8 , C ) ]
487
478
pub enum ConstArgKind < ' hir , Unambig = ( ) > {
@@ -3305,12 +3296,12 @@ impl<'hir> AssocItemConstraintKind<'hir> {
3305
3296
#[ derive( Debug , Clone , Copy , HashStable_Generic ) ]
3306
3297
pub enum AmbigArg { }
3307
3298
3308
- #[ derive( Debug , Clone , Copy , HashStable_Generic ) ]
3309
- #[ repr( C ) ]
3310
3299
/// Represents a type in the `HIR`.
3311
3300
///
3312
3301
/// For an explanation of the `Unambig` generic parameter see the dev-guide:
3313
- /// https://rustc-dev-guide.rust-lang.org/hir/ambig-unambig-ty-and-consts.html
3302
+ /// <https://rustc-dev-guide.rust-lang.org/hir/ambig-unambig-ty-and-consts.html>
3303
+ #[ derive( Debug , Clone , Copy , HashStable_Generic ) ]
3304
+ #[ repr( C ) ]
3314
3305
pub struct Ty < ' hir , Unambig = ( ) > {
3315
3306
#[ stable_hasher( ignore) ]
3316
3307
pub hir_id : HirId ,
@@ -3328,9 +3319,6 @@ impl<'hir> Ty<'hir, AmbigArg> {
3328
3319
/// In practice this may mean overriding the [`Visitor::visit_infer`][visit_infer] method on hir visitors, or
3329
3320
/// specifically matching on [`GenericArg::Infer`] when handling generic arguments.
3330
3321
///
3331
- /// For an explanation of what it means for a type to be ambig or unambig, see the dev-guide:
3332
- /// https://rustc-dev-guide.rust-lang.org/hir/ambig-unambig-ty-and-consts.html
3333
- ///
3334
3322
/// [visit_infer]: [rustc_hir::intravisit::Visitor::visit_infer]
3335
3323
pub fn as_unambig_ty ( & self ) -> & Ty < ' hir > {
3336
3324
// SAFETY: `Ty` is `repr(C)` and `TyKind` is marked `repr(u8)` so that the layout is
@@ -3346,9 +3334,6 @@ impl<'hir> Ty<'hir> {
3346
3334
///
3347
3335
/// Functions accepting ambiguous types will not handle the [`TyKind::Infer`] variant, if
3348
3336
/// infer types are relevant to you then care should be taken to handle them separately.
3349
- ///
3350
- /// For an explanation of what it means for a type to be ambig or unambig, see the dev-guide:
3351
- /// https://rustc-dev-guide.rust-lang.org/hir/ambig-unambig-ty-and-consts.html
3352
3337
pub fn try_as_ambig_ty ( & self ) -> Option < & Ty < ' hir , AmbigArg > > {
3353
3338
if let TyKind :: Infer ( ( ) ) = self . kind {
3354
3339
return None ;
@@ -3653,7 +3638,7 @@ pub enum InferDelegationKind {
3653
3638
/// The various kinds of types recognized by the compiler.
3654
3639
///
3655
3640
/// For an explanation of the `Unambig` generic parameter see the dev-guide:
3656
- /// https://rustc-dev-guide.rust-lang.org/hir/ambig-unambig-ty-and-consts.html
3641
+ /// < https://rustc-dev-guide.rust-lang.org/hir/ambig-unambig-ty-and-consts.html>
3657
3642
// SAFETY: `repr(u8)` is required so that `TyKind<()>` and `TyKind<!>` are layout compatible
3658
3643
#[ repr( u8 , C ) ]
3659
3644
#[ derive( Debug , Clone , Copy , HashStable_Generic ) ]
0 commit comments