Skip to content

Commit

Permalink
librustc_resolve has been updated
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Feb 6, 2015
1 parent 4b6632d commit 1ff6e53
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
6 changes: 3 additions & 3 deletions src/librustc_resolve/build_reduced_graph.rs
Expand Up @@ -307,8 +307,8 @@ impl<'a, 'b:'a, 'tcx:'b> GraphBuilder<'a, 'b, 'tcx> {
ViewPathSimple(binding, ref full_path) => {
let source_name =
full_path.segments.last().unwrap().identifier.name;
if token::get_name(source_name).get() == "mod" ||
token::get_name(source_name).get() == "self" {
if &token::get_name(source_name)[] == "mod" ||
&token::get_name(source_name)[] == "self" {
self.resolve_error(view_path.span,
"`self` imports are only allowed within a { } list");
}
Expand Down Expand Up @@ -1020,7 +1020,7 @@ impl<'a, 'b:'a, 'tcx:'b> GraphBuilder<'a, 'b, 'tcx> {
self.handle_external_def(def,
def_visibility,
&*child_name_bindings,
token::get_name(name).get(),
&token::get_name(name)[],
name,
root);
}
Expand Down
44 changes: 22 additions & 22 deletions src/librustc_resolve/lib.rs
Expand Up @@ -1093,7 +1093,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
} else {
result.push_str("::")
}
result.push_str(token::get_name(*name).get());
result.push_str(&token::get_name(*name)[]);
};
result
}
Expand All @@ -1111,7 +1111,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
-> String {
match subclass {
SingleImport(_, source) => {
token::get_name(source).get().to_string()
token::get_name(source).to_string()
}
GlobImport => "*".to_string()
}
Expand Down Expand Up @@ -1708,7 +1708,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {

debug!("(resolving glob import) writing resolution `{}` in `{}` \
to `{}`",
token::get_name(name).get(),
&token::get_name(name)[],
self.module_to_string(&*containing_module),
self.module_to_string(module_));

Expand All @@ -1725,7 +1725,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
let msg = format!("a {} named `{}` has already been imported \
in this module",
namespace_name,
token::get_name(name).get());
&token::get_name(name)[]);
span_err!(self.session, import_directive.span, E0251, "{}", msg);
} else {
let target = Target::new(containing_module.clone(),
Expand Down Expand Up @@ -1757,7 +1757,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
name: Name,
namespace: Namespace) {
debug!("check_for_conflicting_import: {}; target exists: {}",
token::get_name(name).get(),
&token::get_name(name)[],
target.is_some());

match *target {
Expand All @@ -1768,7 +1768,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
TypeNS => "type",
ValueNS => "value",
},
token::get_name(name).get());
&token::get_name(name)[]);
span_err!(self.session, import_span, E0252, "{}", &msg[]);
}
Some(_) | None => {}
Expand Down Expand Up @@ -1804,7 +1804,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
let msg = format!("import `{0}` conflicts with imported \
crate in this module \
(maybe you meant `use {0}::*`?)",
token::get_name(name).get());
&token::get_name(name)[]);
span_err!(self.session, import_span, E0254, "{}", &msg[]);
}
Some(_) | None => {}
Expand All @@ -1826,7 +1826,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
if let Some(ref value) = *name_bindings.value_def.borrow() {
let msg = format!("import `{}` conflicts with value \
in this module",
token::get_name(name).get());
&token::get_name(name)[]);
span_err!(self.session, import_span, E0255, "{}", &msg[]);
if let Some(span) = value.value_span {
self.session.span_note(span,
Expand All @@ -1844,7 +1844,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
None => {
let msg = format!("import `{}` conflicts with type in \
this module",
token::get_name(name).get());
&token::get_name(name)[]);
span_err!(self.session, import_span, E0256, "{}", &msg[]);
if let Some(span) = ty.type_span {
self.session.span_note(span,
Expand All @@ -1866,7 +1866,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
_ => {
let msg = format!("import `{}` conflicts with existing \
submodule",
token::get_name(name).get());
&token::get_name(name)[]);
span_err!(self.session, import_span, E0258, "{}", &msg[]);
if let Some(span) = ty.type_span {
self.session.span_note(span,
Expand All @@ -1892,7 +1892,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
span_err!(self.session, span, E0259,
"an external crate named `{}` has already \
been imported into this module",
token::get_name(name).get());
&token::get_name(name)[]);
}
}

Expand All @@ -1906,7 +1906,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
"the name `{}` conflicts with an external \
crate that has been imported into this \
module",
token::get_name(name).get());
&token::get_name(name)[]);
}
}

Expand Down Expand Up @@ -1955,7 +1955,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
let module_name = self.module_to_string(&*search_module);
let mut span = span;
let msg = if "???" == &module_name[] {
span.hi = span.lo + Pos::from_usize(segment_name.get().len());
span.hi = span.lo + Pos::from_usize(segment_name.len());

match search_parent_externals(name,
&self.current_module) {
Expand Down Expand Up @@ -2368,11 +2368,11 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
let mut containing_module;
let mut i;
let first_module_path_string = token::get_name(module_path[0]);
if "self" == first_module_path_string.get() {
if "self" == &first_module_path_string[] {
containing_module =
self.get_nearest_normal_module_parent_or_self(module_);
i = 1;
} else if "super" == first_module_path_string.get() {
} else if "super" == &first_module_path_string[] {
containing_module =
self.get_nearest_normal_module_parent_or_self(module_);
i = 0; // We'll handle `super` below.
Expand All @@ -2383,7 +2383,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
// Now loop through all the `super`s we find.
while i < module_path.len() {
let string = token::get_name(module_path[i]);
if "super" != string.get() {
if "super" != &string[] {
break
}
debug!("(resolving module prefix) resolving `super` at {}",
Expand Down Expand Up @@ -2417,7 +2417,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
allow_private_imports: bool)
-> ResolveResult<(Target, bool)> {
debug!("(resolving name in module) resolving `{}` in `{}`",
token::get_name(name).get(),
&token::get_name(name)[],
self.module_to_string(&*module_));

// First, check the direct children of the module.
Expand Down Expand Up @@ -2493,7 +2493,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {

// We're out of luck.
debug!("(resolving name in module) failed to resolve `{}`",
token::get_name(name).get());
&token::get_name(name)[]);
return Failed(None);
}

Expand Down Expand Up @@ -4372,7 +4372,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {

let mut smallest = 0;
for (i, other) in maybes.iter().enumerate() {
values[i] = lev_distance(name, other.get());
values[i] = lev_distance(name, &other[]);

if values[i] <= values[smallest] {
smallest = i;
Expand All @@ -4383,9 +4383,9 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
values[smallest] != uint::MAX &&
values[smallest] < name.len() + 2 &&
values[smallest] <= max_distance &&
name != maybes[smallest].get() {
name != &maybes[smallest][] {

Some(maybes[smallest].get().to_string())
Some(maybes[smallest].to_string())

} else {
None
Expand Down Expand Up @@ -4475,7 +4475,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
false // Stop advancing
});

if method_scope && token::get_name(self.self_name).get()
if method_scope && &token::get_name(self.self_name)[]
== path_name {
self.resolve_error(
expr.span,
Expand Down

0 comments on commit 1ff6e53

Please sign in to comment.