Skip to content

Commit cda3490

Browse files
committed
Auto merge of #21269 - alexcrichton:issue-6936, r=pnkfelix
This commit modifies resolve to prevent conflicts with typedef names in the same method that conflits are prevented with enum names. This is a breaking change due to the differing semantics in resolve, and any errors generated on behalf of this change require that a conflicting typedef, module, or structure to be renamed so they do not conflict. [breaking-change] Closes #6936
2 parents 43f2c19 + 3121c04 commit cda3490

File tree

41 files changed

+341
-308
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+341
-308
lines changed

src/librustc/lint/builtin.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ pub struct RawPointerDerive {
575575
impl RawPointerDerive {
576576
pub fn new() -> RawPointerDerive {
577577
RawPointerDerive {
578-
checked_raw_pointers: NodeSet::new(),
578+
checked_raw_pointers: NodeSet(),
579579
}
580580
}
581581
}
@@ -1323,7 +1323,7 @@ impl UnusedMut {
13231323
// collect all mutable pattern and group their NodeIDs by their Identifier to
13241324
// avoid false warnings in match arms with multiple patterns
13251325

1326-
let mut mutables = FnvHashMap::new();
1326+
let mut mutables = FnvHashMap();
13271327
for p in pats.iter() {
13281328
pat_util::pat_bindings(&cx.tcx.def_map, &**p, |mode, id, _, path1| {
13291329
let ident = path1.node;

src/librustc/lint/context.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ impl LintStore {
9898
LintStore {
9999
lints: vec!(),
100100
passes: Some(vec!()),
101-
by_name: FnvHashMap::new(),
102-
levels: FnvHashMap::new(),
103-
lint_groups: FnvHashMap::new(),
101+
by_name: FnvHashMap(),
102+
levels: FnvHashMap(),
103+
lint_groups: FnvHashMap(),
104104
}
105105
}
106106

@@ -468,7 +468,7 @@ impl<'a, 'tcx> Context<'a, 'tcx> {
468468
exported_items: exported_items,
469469
lints: lint_store,
470470
level_stack: vec![],
471-
node_levels: RefCell::new(FnvHashMap::new()),
471+
node_levels: RefCell::new(FnvHashMap()),
472472
}
473473
}
474474

src/librustc/metadata/cstore.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ pub struct CStore {
8484
impl CStore {
8585
pub fn new(intr: Rc<IdentInterner>) -> CStore {
8686
CStore {
87-
metas: RefCell::new(FnvHashMap::new()),
88-
extern_mod_crate_map: RefCell::new(FnvHashMap::new()),
87+
metas: RefCell::new(FnvHashMap()),
88+
extern_mod_crate_map: RefCell::new(FnvHashMap()),
8989
used_crate_sources: RefCell::new(Vec::new()),
9090
used_libraries: RefCell::new(Vec::new()),
9191
used_link_args: RefCell::new(Vec::new()),

src/librustc/metadata/encoder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2111,7 +2111,7 @@ fn encode_metadata_inner(wr: &mut SeekableMemWriter,
21112111
link_meta: link_meta,
21122112
cstore: cstore,
21132113
encode_inlined_item: RefCell::new(encode_inlined_item),
2114-
type_abbrevs: RefCell::new(FnvHashMap::new()),
2114+
type_abbrevs: RefCell::new(FnvHashMap()),
21152115
reachable: reachable,
21162116
};
21172117

@@ -2216,7 +2216,7 @@ pub fn encoded_ty<'tcx>(tcx: &ty::ctxt<'tcx>, t: Ty<'tcx>) -> String {
22162216
diag: tcx.sess.diagnostic(),
22172217
ds: def_to_string,
22182218
tcx: tcx,
2219-
abbrevs: &RefCell::new(FnvHashMap::new())
2219+
abbrevs: &RefCell::new(FnvHashMap())
22202220
}, t);
22212221
String::from_utf8(wr.unwrap()).unwrap()
22222222
}

src/librustc/middle/cfg/construct.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub fn construct(tcx: &ty::ctxt,
4646
let block_exit;
4747

4848
let mut cfg_builder = CFGBuilder {
49-
exit_map: NodeMap::new(),
49+
exit_map: NodeMap(),
5050
graph: graph,
5151
fn_exit: fn_exit,
5252
tcx: tcx,

src/librustc/middle/check_static.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ struct GlobalChecker {
6464

6565
pub fn check_crate(tcx: &ty::ctxt) {
6666
let mut checker = GlobalChecker {
67-
static_consumptions: NodeSet::new(),
68-
const_borrows: NodeSet::new(),
69-
static_interior_borrows: NodeSet::new(),
70-
static_local_borrows: NodeSet::new(),
67+
static_consumptions: NodeSet(),
68+
const_borrows: NodeSet(),
69+
static_interior_borrows: NodeSet(),
70+
static_local_borrows: NodeSet(),
7171
};
7272
{
7373
let param_env = ty::empty_parameter_environment(tcx);

src/librustc/middle/const_eval.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for ConstEvalVisitor<'a, 'tcx> {
286286
pub fn process_crate(tcx: &ty::ctxt) {
287287
visit::walk_crate(&mut ConstEvalVisitor {
288288
tcx: tcx,
289-
ccache: DefIdMap::new(),
289+
ccache: DefIdMap(),
290290
}, tcx.map.krate());
291291
tcx.sess.abort_if_errors();
292292
}

src/librustc/middle/dataflow.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ impl<'a, 'tcx, O:DataFlowOperator> pprust::PpAnn for DataFlowContext<'a, 'tcx, O
145145

146146
fn build_nodeid_to_index(decl: Option<&ast::FnDecl>,
147147
cfg: &cfg::CFG) -> NodeMap<CFGIndex> {
148-
let mut index = NodeMap::new();
148+
let mut index = NodeMap();
149149

150150
// FIXME (#6298): Would it be better to fold formals from decl
151151
// into cfg itself? i.e. introduce a fn-based flow-graph in

src/librustc/middle/dependency_format.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ fn calculate_type(sess: &session::Session,
137137
config::CrateTypeExecutable | config::CrateTypeDylib => {},
138138
}
139139

140-
let mut formats = FnvHashMap::new();
140+
let mut formats = FnvHashMap();
141141

142142
// Sweep all crates for found dylibs. Add all dylibs, as well as their
143143
// dependencies, ensuring there are no conflicts. The only valid case for a

src/librustc/middle/infer/region_inference/graphviz.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ impl<'a, 'tcx> ConstraintGraph<'a, 'tcx> {
133133
name: String,
134134
map: &'a ConstraintMap<'tcx>) -> ConstraintGraph<'a, 'tcx> {
135135
let mut i = 0;
136-
let mut node_ids = FnvHashMap::new();
136+
let mut node_ids = FnvHashMap();
137137
{
138138
let mut add_node = |&mut : node| {
139139
if let Vacant(e) = node_ids.entry(node) {
@@ -188,7 +188,7 @@ fn constraint_to_nodes(c: &Constraint) -> (Node, Node) {
188188

189189
impl<'a, 'tcx> dot::GraphWalk<'a, Node, Edge> for ConstraintGraph<'a, 'tcx> {
190190
fn nodes(&self) -> dot::Nodes<Node> {
191-
let mut set = FnvHashSet::new();
191+
let mut set = FnvHashSet();
192192
for constraint in self.map.keys() {
193193
let (n1, n2) = constraint_to_nodes(constraint);
194194
set.insert(n1);

0 commit comments

Comments
 (0)