From 6e83da1a2d2332c6a68f83200067d3a7897b73e8 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Mon, 22 Aug 2022 04:15:05 +0000 Subject: [PATCH] Don't drop parent substs when we have no generic parameters --- compiler/rustc_typeck/src/astconv/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_typeck/src/astconv/mod.rs b/compiler/rustc_typeck/src/astconv/mod.rs index 5bb02bc246ca..6bd38c36c2c1 100644 --- a/compiler/rustc_typeck/src/astconv/mod.rs +++ b/compiler/rustc_typeck/src/astconv/mod.rs @@ -365,7 +365,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o { // here and so associated type bindings will be handled regardless of whether there are any // non-`Self` generic parameters. if generics.params.is_empty() { - return (tcx.intern_substs(&[]), arg_count); + return (tcx.intern_substs(parent_substs), arg_count); } struct SubstsForAstPathCtxt<'a, 'tcx> {