Skip to content

Commit 5cefdbd

Browse files
committed
Use == to compare OpaqueTyOrigin values
1 parent 000b945 commit 5cefdbd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/rustc_hir/src/hir.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2264,7 +2264,7 @@ pub struct OpaqueTy<'hir> {
22642264
}
22652265

22662266
/// From whence the opaque type came.
2267-
#[derive(Copy, Clone, Encodable, Decodable, Debug, HashStable_Generic)]
2267+
#[derive(Copy, Clone, PartialEq, Eq, Encodable, Decodable, Debug, HashStable_Generic)]
22682268
pub enum OpaqueTyOrigin {
22692269
/// `-> impl Trait`
22702270
FnReturn,

compiler/rustc_typeck/src/check/writeback.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ impl<'cx, 'tcx> WritebackCx<'cx, 'tcx> {
521521
let mut skip_add = false;
522522

523523
if let ty::Opaque(definition_ty_def_id, _substs) = *definition_ty.kind() {
524-
if let hir::OpaqueTyOrigin::TyAlias = opaque_defn.origin {
524+
if opaque_defn.origin == hir::OpaqueTyOrigin::TyAlias {
525525
if opaque_type_key.def_id == definition_ty_def_id {
526526
debug!(
527527
"skipping adding concrete definition for opaque type {:?} {:?}",

0 commit comments

Comments
 (0)