We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents cfed918 + aebea52 commit 72d2a7cCopy full SHA for 72d2a7c
compiler/rustc_typeck/src/astconv/mod.rs
@@ -337,6 +337,14 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
337
infer_args,
338
);
339
340
+ // Skip processing if type has no generic parameters.
341
+ // Traits always have `Self` as a generic parameter, which means they will not return early
342
+ // here and so associated type bindings will be handled regardless of whether there are any
343
+ // non-`Self` generic parameters.
344
+ if generic_params.params.len() == 0 {
345
+ return (tcx.intern_substs(&[]), vec![], arg_count);
346
+ }
347
+
348
let is_object = self_ty.map_or(false, |ty| ty == self.tcx().types.trait_object_dummy_self);
349
350
struct SubstsForAstPathCtxt<'a, 'tcx> {
0 commit comments