diff options
| author | bohan <bohan-zhang@foxmail.com> | 2024-07-29 22:29:12 +0800 |
|---|---|---|
| committer | bohan <bohan-zhang@foxmail.com> | 2024-07-29 22:29:34 +0800 |
| commit | 97469cc4bf5d682ded196c60ee30d6a392b645aa (patch) | |
| tree | 5acdfb7f9eb05d2a55651e743c3d72e1c37a33c9 /compiler/rustc_trait_selection/src | |
| parent | 56c698c71130de6fe55ba703a161405b6145b90e (diff) | |
| download | rust-97469cc4bf5d682ded196c60ee30d6a392b645aa.tar.gz rust-97469cc4bf5d682ded196c60ee30d6a392b645aa.zip | |
only accept adt type during infer source visitor
Diffstat (limited to 'compiler/rustc_trait_selection/src')
| -rw-r--r-- | compiler/rustc_trait_selection/src/error_reporting/infer/need_type_info.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_trait_selection/src/error_reporting/infer/need_type_info.rs b/compiler/rustc_trait_selection/src/error_reporting/infer/need_type_info.rs index f667e4c80fd..f6dd7898fb2 100644 --- a/compiler/rustc_trait_selection/src/error_reporting/infer/need_type_info.rs +++ b/compiler/rustc_trait_selection/src/error_reporting/infer/need_type_info.rs @@ -934,13 +934,13 @@ impl<'a, 'tcx> FindInferSourceVisitor<'a, 'tcx> { // which makes this somewhat difficult and prevents us from just // using `self.path_inferred_arg_iter` here. hir::ExprKind::Struct(&hir::QPath::Resolved(_self_ty, path), _, _) - // FIXME(TaKO8Ki): Ideally we should support this. For that - // we have to map back from the self type to the - // type alias though. That's difficult. + // FIXME(TaKO8Ki): Ideally we should support other kinds, + // such as `TyAlias` or `AssocTy`. For that we have to map + // back from the self type to the type alias though. That's difficult. // // See the `need_type_info/issue-103053.rs` test for // a example. - if !matches!(path.res, Res::Def(DefKind::TyAlias, _)) => { + if matches!(path.res, Res::Def(DefKind::Struct | DefKind::Enum | DefKind::Union, _)) => { if let Some(ty) = self.opt_node_type(expr.hir_id) && let ty::Adt(_, args) = ty.kind() { |
