Skip to content

Commit 48ce2f6

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 <dingxiangfei2009@protonmail.ch>
1 parent 82a3220 commit 48ce2f6

3 files changed

Lines changed: 331 additions & 143 deletions

File tree

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
@@ -16,6 +16,7 @@
1616
#![cfg_attr(test, feature(test))]
1717
#![deny(unsafe_op_in_unsafe_fn)]
1818
#![feature(allocator_api)]
19+
#![feature(arbitrary_self_types)]
1920
#![feature(ascii_char)]
2021
#![feature(ascii_char_variants)]
2122
#![feature(auto_traits)]

0 commit comments

Comments
 (0)