提交 72d2a7cd 编写于 作者: B bors

Auto merge of #78194 - bugadani:generic, r=varkor

Skip most of `create_substs_for_ast_path` if type is not generic
......@@ -337,6 +337,14 @@ fn create_substs_for_ast_path<'a>(
infer_args,
);
// Skip processing if type has no generic parameters.
// Traits always have `Self` as a generic parameter, which means they will not return early
// here and so associated type bindings will be handled regardless of whether there are any
// non-`Self` generic parameters.
if generic_params.params.len() == 0 {
return (tcx.intern_substs(&[]), vec![], arg_count);
}
let is_object = self_ty.map_or(false, |ty| ty == self.tcx().types.trait_object_dummy_self);
struct SubstsForAstPathCtxt<'a, 'tcx> {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册