Skip to content

Commit 63a3a7d

Browse files
Pick methods from the right receivers
Previously we have been picking methods for receiver types even though we are inspecting other receiver types that are several levels of dereferences, which is wasted effort because there will never be matches with these methods. Signed-off-by: Xiangfei Ding <[email protected]>
1 parent 13ac7fc commit 63a3a7d

File tree

3 files changed

+331
-140
lines changed

3 files changed

+331
-140
lines changed

compiler/rustc_data_structures/src/intern.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ use std::cmp::Ordering;
22
use std::fmt::{self, Debug};
33
use std::hash::{Hash, Hasher};
44
use std::ops::Deref;
5+
#[cfg(not(bootstrap))]
6+
use std::ops::Receiver;
57
use std::ptr;
68

79
use crate::stable_hasher::{HashStable, StableHasher};
@@ -54,6 +56,11 @@ impl<'a, T> Deref for Interned<'a, T> {
5456
}
5557
}
5658

59+
#[cfg(not(bootstrap))]
60+
impl<'a, T> Receiver for Interned<'a, T> {
61+
type Target = T;
62+
}
63+
5764
impl<'a, T> PartialEq for Interned<'a, T> {
5865
#[inline]
5966
fn eq(&self, other: &Self) -> bool {

compiler/rustc_data_structures/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#![cfg_attr(bootstrap, feature(array_windows))]
1414
#![deny(unsafe_op_in_unsafe_fn)]
1515
#![feature(allocator_api)]
16+
#![feature(arbitrary_self_types)]
1617
#![feature(ascii_char)]
1718
#![feature(ascii_char_variants)]
1819
#![feature(assert_matches)]

0 commit comments

Comments
 (0)