Skip to content

Commit

Permalink
Use == to compare OpaqueTyOrigin values
Browse files Browse the repository at this point in the history
  • Loading branch information
spastorino committed Jul 18, 2021
1 parent 000b945 commit 5cefdbd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_hir/src/hir.rs
Expand Up @@ -2264,7 +2264,7 @@ pub struct OpaqueTy<'hir> {
}

/// From whence the opaque type came.
#[derive(Copy, Clone, Encodable, Decodable, Debug, HashStable_Generic)]
#[derive(Copy, Clone, PartialEq, Eq, Encodable, Decodable, Debug, HashStable_Generic)]
pub enum OpaqueTyOrigin {
/// `-> impl Trait`
FnReturn,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_typeck/src/check/writeback.rs
Expand Up @@ -521,7 +521,7 @@ impl<'cx, 'tcx> WritebackCx<'cx, 'tcx> {
let mut skip_add = false;

if let ty::Opaque(definition_ty_def_id, _substs) = *definition_ty.kind() {
if let hir::OpaqueTyOrigin::TyAlias = opaque_defn.origin {
if opaque_defn.origin == hir::OpaqueTyOrigin::TyAlias {
if opaque_type_key.def_id == definition_ty_def_id {
debug!(
"skipping adding concrete definition for opaque type {:?} {:?}",
Expand Down

0 comments on commit 5cefdbd

Please sign in to comment.