@@ -408,7 +408,7 @@ impl<'hir> PathSegment<'hir> {
408408/// versus const args that are literals or have arbitrary computations (e.g., `{ 1 + 3 }`).
409409///
410410/// 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>
412412#[ derive( Clone , Copy , Debug , HashStable_Generic ) ]
413413#[ repr( C ) ]
414414pub struct ConstArg < ' hir , Unambig = ( ) > {
@@ -420,16 +420,13 @@ pub struct ConstArg<'hir, Unambig = ()> {
420420impl < ' hir > ConstArg < ' hir , AmbigArg > {
421421 /// Converts a `ConstArg` in an ambiguous position to one in an unambiguous position.
422422 ///
423- /// Functions accepting an unambiguous consts may expect the [`ConstArgKind::Infer`] variant
423+ /// Functions accepting unambiguous consts may expect the [`ConstArgKind::Infer`] variant
424424 /// to be used. Care should be taken to separately handle infer consts when calling this
425425 /// function as it cannot be handled by downstream code making use of the returned const.
426426 ///
427427 /// In practice this may mean overriding the [`Visitor::visit_infer`][visit_infer] method on hir visitors, or
428428 /// specifically matching on [`GenericArg::Infer`] when handling generic arguments.
429429 ///
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- ///
433430 /// [visit_infer]: [rustc_hir::intravisit::Visitor::visit_infer]
434431 pub fn as_unambig_ct ( & self ) -> & ConstArg < ' hir > {
435432 // SAFETY: `ConstArg` is `repr(C)` and `ConstArgKind` is marked `repr(u8)` so that the
@@ -445,9 +442,6 @@ impl<'hir> ConstArg<'hir> {
445442 ///
446443 /// Functions accepting ambiguous consts will not handle the [`ConstArgKind::Infer`] variant, if
447444 /// 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
451445 pub fn try_as_ambig_ct ( & self ) -> Option < & ConstArg < ' hir , AmbigArg > > {
452446 if let ConstArgKind :: Infer ( _, ( ) ) = self . kind {
453447 return None ;
@@ -479,9 +473,6 @@ impl<'hir, Unambig> ConstArg<'hir, Unambig> {
479473}
480474
481475/// 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
485476#[ derive( Clone , Copy , Debug , HashStable_Generic ) ]
486477#[ repr( u8 , C ) ]
487478pub enum ConstArgKind < ' hir , Unambig = ( ) > {
@@ -3305,12 +3296,12 @@ impl<'hir> AssocItemConstraintKind<'hir> {
33053296#[ derive( Debug , Clone , Copy , HashStable_Generic ) ]
33063297pub enum AmbigArg { }
33073298
3308- #[ derive( Debug , Clone , Copy , HashStable_Generic ) ]
3309- #[ repr( C ) ]
33103299/// Represents a type in the `HIR`.
33113300///
33123301/// 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 ) ]
33143305pub struct Ty < ' hir , Unambig = ( ) > {
33153306 #[ stable_hasher( ignore) ]
33163307 pub hir_id : HirId ,
@@ -3328,9 +3319,6 @@ impl<'hir> Ty<'hir, AmbigArg> {
33283319 /// In practice this may mean overriding the [`Visitor::visit_infer`][visit_infer] method on hir visitors, or
33293320 /// specifically matching on [`GenericArg::Infer`] when handling generic arguments.
33303321 ///
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- ///
33343322 /// [visit_infer]: [rustc_hir::intravisit::Visitor::visit_infer]
33353323 pub fn as_unambig_ty ( & self ) -> & Ty < ' hir > {
33363324 // SAFETY: `Ty` is `repr(C)` and `TyKind` is marked `repr(u8)` so that the layout is
@@ -3346,9 +3334,6 @@ impl<'hir> Ty<'hir> {
33463334 ///
33473335 /// Functions accepting ambiguous types will not handle the [`TyKind::Infer`] variant, if
33483336 /// 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
33523337 pub fn try_as_ambig_ty ( & self ) -> Option < & Ty < ' hir , AmbigArg > > {
33533338 if let TyKind :: Infer ( ( ) ) = self . kind {
33543339 return None ;
@@ -3653,7 +3638,7 @@ pub enum InferDelegationKind {
36533638/// The various kinds of types recognized by the compiler.
36543639///
36553640/// 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>
36573642// SAFETY: `repr(u8)` is required so that `TyKind<()>` and `TyKind<!>` are layout compatible
36583643#[ repr( u8 , C ) ]
36593644#[ derive( Debug , Clone , Copy , HashStable_Generic ) ]
0 commit comments