Skip to content

Commit e6033b6

Browse files
committed
for stable tests, librustc_resolve::Module.resolutions to be ordered map
1 parent e32419d commit e6033b6

File tree

3 files changed

+23
-23
lines changed

3 files changed

+23
-23
lines changed

src/librustc_resolve/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ use errors::{DiagnosticBuilder, DiagnosticId};
6464

6565
use std::cell::{Cell, RefCell};
6666
use std::cmp;
67-
use std::collections::BTreeSet;
67+
use std::collections::{BTreeSet, BTreeMap};
6868
use std::fmt;
6969
use std::mem::replace;
7070
use std::rc::Rc;
@@ -906,7 +906,7 @@ pub struct ModuleData<'a> {
906906
// The def id of the closest normal module (`mod`) ancestor (including this module).
907907
normal_ancestor_id: DefId,
908908

909-
resolutions: RefCell<FxHashMap<(Ident, Namespace), &'a RefCell<NameResolution<'a>>>>,
909+
resolutions: RefCell<BTreeMap<(Ident, Namespace), &'a RefCell<NameResolution<'a>>>>,
910910
legacy_macro_resolutions: RefCell<Vec<(Mark, Ident, Span, MacroKind)>>,
911911
macro_resolutions: RefCell<Vec<(Box<[Ident]>, Span)>>,
912912

@@ -944,7 +944,7 @@ impl<'a> ModuleData<'a> {
944944
parent,
945945
kind,
946946
normal_ancestor_id,
947-
resolutions: RefCell::new(FxHashMap()),
947+
resolutions: RefCell::new(BTreeMap::new()),
948948
legacy_macro_resolutions: RefCell::new(Vec::new()),
949949
macro_resolutions: RefCell::new(Vec::new()),
950950
unresolved_invocations: RefCell::new(FxHashSet()),

src/libsyntax_pos/symbol.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use std::cell::RefCell;
1919
use std::collections::HashMap;
2020
use std::fmt;
2121

22-
#[derive(Copy, Clone, PartialEq, Eq, Hash)]
22+
#[derive(Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
2323
pub struct Ident {
2424
pub name: Symbol,
2525
pub ctxt: SyntaxContext,
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
error: enum is private and its variants cannot be reexported
2-
--> $DIR/issue-46209-private-enum-variant-reexport.rs:21:13
1+
error: variant is private and cannot be reexported
2+
--> $DIR/issue-46209-private-enum-variant-reexport.rs:16:32
33
|
4-
21 | pub use self::Crewman::*;
5-
| ^^^^^^^^^^^^^^^^^
4+
16 | pub use self::Lieutenant::{JuniorGrade, Full};
5+
| ^^^^^^^^^^^
66
...
7-
43 | crate enum Crewman {
8-
| ------------------ help: consider making the enum public: `pub enum Crewman`
7+
31 | enum Lieutenant {
8+
| --------------- help: consider making the enum public: `pub enum Lieutenant`
9+
10+
error: variant is private and cannot be reexported
11+
--> $DIR/issue-46209-private-enum-variant-reexport.rs:16:45
12+
|
13+
16 | pub use self::Lieutenant::{JuniorGrade, Full};
14+
| ^^^^
915

1016
error: enum is private and its variants cannot be reexported
1117
--> $DIR/issue-46209-private-enum-variant-reexport.rs:14:13
@@ -16,15 +22,6 @@ error: enum is private and its variants cannot be reexported
1622
24 | enum Professor {
1723
| -------------- help: consider making the enum public: `pub enum Professor`
1824

19-
error: variant is private and cannot be reexported
20-
--> $DIR/issue-46209-private-enum-variant-reexport.rs:16:45
21-
|
22-
16 | pub use self::Lieutenant::{JuniorGrade, Full};
23-
| ^^^^
24-
...
25-
31 | enum Lieutenant {
26-
| --------------- help: consider making the enum public: `pub enum Lieutenant`
27-
2825
error: enum is private and its variants cannot be reexported
2926
--> $DIR/issue-46209-private-enum-variant-reexport.rs:19:13
3027
|
@@ -34,11 +31,14 @@ error: enum is private and its variants cannot be reexported
3431
36 | pub(in rank) enum PettyOfficer {
3532
| ------------------------------ help: consider making the enum public: `pub enum PettyOfficer`
3633

37-
error: variant is private and cannot be reexported
38-
--> $DIR/issue-46209-private-enum-variant-reexport.rs:16:32
34+
error: enum is private and its variants cannot be reexported
35+
--> $DIR/issue-46209-private-enum-variant-reexport.rs:21:13
3936
|
40-
16 | pub use self::Lieutenant::{JuniorGrade, Full};
41-
| ^^^^^^^^^^^
37+
21 | pub use self::Crewman::*;
38+
| ^^^^^^^^^^^^^^^^^
39+
...
40+
43 | crate enum Crewman {
41+
| ------------------ help: consider making the enum public: `pub enum Crewman`
4242

4343
error: aborting due to 5 previous errors
4444

0 commit comments

Comments
 (0)