diff options
| author | Deadbeef <ent3rm4n@gmail.com> | 2023-07-25 05:58:53 +0000 |
|---|---|---|
| committer | Deadbeef <ent3rm4n@gmail.com> | 2023-08-06 13:34:53 +0000 |
| commit | 92f4c59e4847005752a358ccacb5ae264700fbc4 (patch) | |
| tree | 970aac1a96c706880388f8f10ba72f5421ccec74 /compiler/rustc_hir_analysis/src/astconv | |
| parent | 4f7bb9890c0402cd145556ac1929d13d7524959e (diff) | |
| download | rust-92f4c59e4847005752a358ccacb5ae264700fbc4.tar.gz rust-92f4c59e4847005752a358ccacb5ae264700fbc4.zip | |
lower impl const to bind to host effect param
Diffstat (limited to 'compiler/rustc_hir_analysis/src/astconv')
| -rw-r--r-- | compiler/rustc_hir_analysis/src/astconv/mod.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/compiler/rustc_hir_analysis/src/astconv/mod.rs b/compiler/rustc_hir_analysis/src/astconv/mod.rs index b40e3123522..7c03c1794f0 100644 --- a/compiler/rustc_hir_analysis/src/astconv/mod.rs +++ b/compiler/rustc_hir_analysis/src/astconv/mod.rs @@ -532,6 +532,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o { if let Err(guar) = ty.error_reported() { return ty::Const::new_error(tcx, guar, ty).into(); } + // FIXME(effects) see if we should special case effect params here if !infer_args && has_default { tcx.const_param_default(param.def_id) .instantiate(tcx, args.unwrap()) @@ -659,7 +660,6 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o { &self, trait_ref: &hir::TraitRef<'_>, self_ty: Ty<'tcx>, - constness: ty::BoundConstness, ) -> ty::TraitRef<'tcx> { self.prohibit_generics(trait_ref.path.segments.split_last().unwrap().1.iter(), |_| {}); @@ -669,7 +669,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o { self_ty, trait_ref.path.segments.last().unwrap(), true, - constness, + ty::BoundConstness::NotConst, ) } @@ -849,6 +849,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o { self_ty: Ty<'tcx>, trait_segment: &hir::PathSegment<'_>, is_impl: bool, + // FIXME(effects) move all host param things in astconv to hir lowering constness: ty::BoundConstness, ) -> ty::TraitRef<'tcx> { let (generic_args, _) = self.create_args_for_ast_trait_ref( @@ -2712,11 +2713,8 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o { }; let i = hir.get_parent(fn_hir_id).expect_item().expect_impl(); - let trait_ref = self.instantiate_mono_trait_ref( - i.of_trait.as_ref()?, - self.ast_ty_to_ty(i.self_ty), - ty::BoundConstness::NotConst, - ); + let trait_ref = + self.instantiate_mono_trait_ref(i.of_trait.as_ref()?, self.ast_ty_to_ty(i.self_ty)); let assoc = tcx.associated_items(trait_ref.def_id).find_by_name_and_kind( tcx, |
