Skip to content

Commit 08f28be

Browse files
authored
Merge pull request rust-lang#111 from bjorn3/rustup
Rustup to rustc 1.40.0-nightly (87cbf0a 2019-11-01)
2 parents bd2c747 + 6c7227d commit 08f28be

File tree

4 files changed

+37
-1
lines changed

4 files changed

+37
-1
lines changed

Diff for: README.md

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ If you are already using Rust nightly and have successfully installed tools like
3232

3333
```sh
3434
$ rustup update nightly
35+
$ rustup component add rustc-dev --toolchain nightly
3536
$ cargo +nightly install semverver
3637
```
3738

@@ -43,6 +44,7 @@ You can also install the newest version of the tool from git:
4344

4445
```sh
4546
$ rustup update nightly
47+
$ rustup component add rustc-dev --toolchain nightly
4648
$ cargo +nightly install --git https://github.com/rust-dev-tools/rust-semverver
4749
```
4850

Diff for: ci/run.sh

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ set -ex
55
export RUST_BACKTRACE=full
66
#export RUST_TEST_NOCAPTURE=1
77

8+
rustup component add rustc-dev
9+
810
cargo build
911
cargo test --verbose -- --nocapture
1012

Diff for: rust-toolchain

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nightly

Diff for: src/mapping.rs

+32-1
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ use rustc::{
1212
ty::{AssocKind, GenericParamDef, GenericParamDefKind},
1313
};
1414
use std::collections::{BTreeSet, HashMap, HashSet, VecDeque};
15+
use std::hash::{Hash, Hasher};
1516
use syntax::ast::Name;
1617

1718
/// A description of an item found in an inherent impl.
18-
#[derive(Debug, PartialEq, Eq, Hash)]
19+
#[derive(Debug, PartialEq)]
1920
pub struct InherentEntry {
2021
/// The parent item's `DefId`.
2122
pub parent_def_id: DefId,
@@ -25,6 +26,36 @@ pub struct InherentEntry {
2526
pub name: Name,
2627
}
2728

29+
impl Eq for InherentEntry {}
30+
31+
fn assert_impl_eq<T: Eq>() {}
32+
33+
#[allow(dead_code)]
34+
fn assert_inherent_entry_members_impl_eq() {
35+
assert_impl_eq::<DefId>();
36+
37+
// FIXME derive Eq again once AssocKind impls Eq again.
38+
// assert_impl_eq::<AssocKind>();
39+
40+
assert_impl_eq::<Name>();
41+
}
42+
43+
impl Hash for InherentEntry {
44+
fn hash<H: Hasher>(&self, hasher: &mut H) {
45+
self.parent_def_id.hash(hasher);
46+
47+
// FIXME derive Hash again once AssocKind derives Hash again.
48+
match self.kind {
49+
AssocKind::Const => 0u8.hash(hasher),
50+
AssocKind::Method => 1u8.hash(hasher),
51+
AssocKind::OpaqueTy => 2u8.hash(hasher),
52+
AssocKind::Type => 3u8.hash(hasher),
53+
}
54+
55+
self.name.hash(hasher);
56+
}
57+
}
58+
2859
/// A set of pairs of impl- and item `DefId`s for inherent associated items.
2960
pub type InherentImplSet = BTreeSet<(DefId, DefId)>;
3061

0 commit comments

Comments
 (0)