]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_middle/src/ty/consts.rs
Rollup merge of #106583 - estebank:suggest-result-coercion, r=compiler-errors
[rust.git] / compiler / rustc_middle / src / ty / consts.rs
index 152a7e9d43fa4e32e7c6754efb5397cdc782beeb..65cbac3e8f1cd5f341e7a0054a03be00c6c1bc81 100644 (file)
@@ -239,7 +239,7 @@ pub fn is_ct_infer(self) -> bool {
     }
 }
 
-pub fn const_param_default(tcx: TyCtxt<'_>, def_id: DefId) -> Const<'_> {
+pub fn const_param_default(tcx: TyCtxt<'_>, def_id: DefId) -> ty::EarlyBinder<Const<'_>> {
     let default_def_id = match tcx.hir().get_by_def_id(def_id.expect_local()) {
         hir::Node::GenericParam(hir::GenericParam {
             kind: hir::GenericParamKind::Const { default: Some(ac), .. },
@@ -250,5 +250,5 @@ pub fn const_param_default(tcx: TyCtxt<'_>, def_id: DefId) -> Const<'_> {
             "`const_param_default` expected a generic parameter with a constant"
         ),
     };
-    Const::from_anon_const(tcx, default_def_id)
+    ty::EarlyBinder(Const::from_anon_const(tcx, default_def_id))
 }