Use named fields for OpaqueTyOrigin
This commit is contained in:
@@ -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 { .. } => {
|
||||
|
||||
Reference in New Issue
Block a user