Inline Span
methods.
Because they are simple and hot. This change speeds up some incremental runs of a few rustc-perf benchmarks, the best by 3%.
This commit is contained in:
parent
f9bfe840f4
commit
77c40f8c6f
@ -31,11 +31,13 @@ pub struct Span(u32);
|
||||
|
||||
impl Copy for Span {}
|
||||
impl Clone for Span {
|
||||
#[inline]
|
||||
fn clone(&self) -> Span {
|
||||
*self
|
||||
}
|
||||
}
|
||||
impl PartialEq for Span {
|
||||
#[inline]
|
||||
fn eq(&self, other: &Span) -> bool {
|
||||
let a = self.0;
|
||||
let b = other.0;
|
||||
@ -44,6 +46,7 @@ impl PartialEq for Span {
|
||||
}
|
||||
impl Eq for Span {}
|
||||
impl Hash for Span {
|
||||
#[inline]
|
||||
fn hash<H: Hasher>(&self, state: &mut H) {
|
||||
let a = self.0;
|
||||
a.hash(state)
|
||||
|
Loading…
x
Reference in New Issue
Block a user