Use named fields for OpaqueTyOrigin
This commit is contained in:
parent
f95bdf453e
commit
cb7e3695e8
19 changed files with 53 additions and 40 deletions
|
@ -1271,7 +1271,7 @@ fn suggest_precise_capturing<'tcx>(
|
|||
let hir::OpaqueTy { bounds, origin, .. } =
|
||||
tcx.hir_node_by_def_id(opaque_def_id).expect_item().expect_opaque_ty();
|
||||
|
||||
let hir::OpaqueTyOrigin::FnReturn(fn_def_id) = *origin else {
|
||||
let hir::OpaqueTyOrigin::FnReturn { parent: fn_def_id } = *origin else {
|
||||
return;
|
||||
};
|
||||
|
||||
|
|
|
@ -2580,7 +2580,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
|
|||
def_id: DefId,
|
||||
) -> ErrorGuaranteed {
|
||||
let name = match self.tcx.opaque_type_origin(def_id.expect_local()) {
|
||||
hir::OpaqueTyOrigin::FnReturn(_) | hir::OpaqueTyOrigin::AsyncFn(_) => {
|
||||
hir::OpaqueTyOrigin::FnReturn { .. } | hir::OpaqueTyOrigin::AsyncFn { .. } => {
|
||||
"opaque type".to_string()
|
||||
}
|
||||
hir::OpaqueTyOrigin::TyAlias { .. } => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue