Skip to content

Commit

Permalink
for stable tests, librustc_resolve::Module.resolutions to be ordered map
Browse files Browse the repository at this point in the history
  • Loading branch information
zackmdavis committed Nov 26, 2017
1 parent e32419d commit e6033b6
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
6 changes: 3 additions & 3 deletions src/librustc_resolve/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ use errors::{DiagnosticBuilder, DiagnosticId};

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

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

Expand Down Expand Up @@ -944,7 +944,7 @@ impl<'a> ModuleData<'a> {
parent,
kind,
normal_ancestor_id,
resolutions: RefCell::new(FxHashMap()),
resolutions: RefCell::new(BTreeMap::new()),
legacy_macro_resolutions: RefCell::new(Vec::new()),
macro_resolutions: RefCell::new(Vec::new()),
unresolved_invocations: RefCell::new(FxHashSet()),
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax_pos/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use std::cell::RefCell;
use std::collections::HashMap;
use std::fmt;

#[derive(Copy, Clone, PartialEq, Eq, Hash)]
#[derive(Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct Ident {
pub name: Symbol,
pub ctxt: SyntaxContext,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
error: enum is private and its variants cannot be reexported
--> $DIR/issue-46209-private-enum-variant-reexport.rs:21:13
error: variant is private and cannot be reexported
--> $DIR/issue-46209-private-enum-variant-reexport.rs:16:32
|
21 | pub use self::Crewman::*;
| ^^^^^^^^^^^^^^^^^
16 | pub use self::Lieutenant::{JuniorGrade, Full};
| ^^^^^^^^^^^
...
43 | crate enum Crewman {
| ------------------ help: consider making the enum public: `pub enum Crewman`
31 | enum Lieutenant {
| --------------- help: consider making the enum public: `pub enum Lieutenant`

error: variant is private and cannot be reexported
--> $DIR/issue-46209-private-enum-variant-reexport.rs:16:45
|
16 | pub use self::Lieutenant::{JuniorGrade, Full};
| ^^^^

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

error: variant is private and cannot be reexported
--> $DIR/issue-46209-private-enum-variant-reexport.rs:16:45
|
16 | pub use self::Lieutenant::{JuniorGrade, Full};
| ^^^^
...
31 | enum Lieutenant {
| --------------- help: consider making the enum public: `pub enum Lieutenant`

error: enum is private and its variants cannot be reexported
--> $DIR/issue-46209-private-enum-variant-reexport.rs:19:13
|
Expand All @@ -34,11 +31,14 @@ error: enum is private and its variants cannot be reexported
36 | pub(in rank) enum PettyOfficer {
| ------------------------------ help: consider making the enum public: `pub enum PettyOfficer`

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

error: aborting due to 5 previous errors

0 comments on commit e6033b6

Please sign in to comment.