rollup merge of #22502: nikomatsakis/deprecate-bracket-bracket

Conflicts:
	src/libcollections/slice.rs
	src/libcollections/str.rs
	src/librustc/middle/lang_items.rs
	src/librustc_back/rpath.rs
	src/librustc_typeck/check/regionck.rs
	src/libstd/ffi/os_str.rs
	src/libsyntax/diagnostic.rs
	src/libsyntax/parse/parser.rs
	src/libsyntax/util/interner.rs
	src/test/run-pass/regions-refcell.rs
This commit is contained in:
Alex Crichton 2015-02-18 15:48:40 -08:00
commit 231eeaa35b
146 changed files with 895 additions and 882 deletions

View file

@ -1071,7 +1071,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
&import_directive.module_path[],
import_directive.subclass),
help);
self.resolve_error(span, &msg[]);
self.resolve_error(span, &msg[..]);
}
Indeterminate => break, // Bail out. We'll come around next time.
Success(()) => () // Good. Continue.
@ -1101,7 +1101,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
.iter()
.map(|seg| seg.identifier.name)
.collect();
self.names_to_string(&names[])
self.names_to_string(&names[..])
}
fn import_directive_subclass_to_string(&mut self,
@ -1165,7 +1165,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
let module_path = &import_directive.module_path;
debug!("(resolving import for module) resolving import `{}::...` in `{}`",
self.names_to_string(&module_path[]),
self.names_to_string(&module_path[..]),
self.module_to_string(&*module_));
// First, resolve the module path for the directive, if necessary.
@ -1174,7 +1174,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
Some((self.graph_root.get_module(), LastMod(AllPublic)))
} else {
match self.resolve_module_path(module_.clone(),
&module_path[],
&module_path[..],
DontUseLexicalScope,
import_directive.span,
ImportSearch) {
@ -1767,7 +1767,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
ValueNS => "value",
},
&token::get_name(name));
span_err!(self.session, import_span, E0252, "{}", &msg[]);
span_err!(self.session, import_span, E0252, "{}", &msg[..]);
}
Some(_) | None => {}
}
@ -1782,7 +1782,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
if !name_bindings.defined_in_namespace_with(namespace, IMPORTABLE) {
let msg = format!("`{}` is not directly importable",
token::get_name(name));
span_err!(self.session, import_span, E0253, "{}", &msg[]);
span_err!(self.session, import_span, E0253, "{}", &msg[..]);
}
}
@ -1803,7 +1803,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
crate in this module \
(maybe you meant `use {0}::*`?)",
&token::get_name(name));
span_err!(self.session, import_span, E0254, "{}", &msg[]);
span_err!(self.session, import_span, E0254, "{}", &msg[..]);
}
Some(_) | None => {}
}
@ -1825,7 +1825,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
let msg = format!("import `{}` conflicts with value \
in this module",
&token::get_name(name));
span_err!(self.session, import_span, E0255, "{}", &msg[]);
span_err!(self.session, import_span, E0255, "{}", &msg[..]);
if let Some(span) = value.value_span {
self.session.span_note(span,
"conflicting value here");
@ -1843,7 +1843,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
let msg = format!("import `{}` conflicts with type in \
this module",
&token::get_name(name));
span_err!(self.session, import_span, E0256, "{}", &msg[]);
span_err!(self.session, import_span, E0256, "{}", &msg[..]);
if let Some(span) = ty.type_span {
self.session.span_note(span,
"note conflicting type here")
@ -1856,7 +1856,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
let msg = format!("inherent implementations \
are only allowed on types \
defined in the current module");
span_err!(self.session, span, E0257, "{}", &msg[]);
span_err!(self.session, span, E0257, "{}", &msg[..]);
self.session.span_note(import_span,
"import from other module here")
}
@ -1865,7 +1865,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
let msg = format!("import `{}` conflicts with existing \
submodule",
&token::get_name(name));
span_err!(self.session, import_span, E0258, "{}", &msg[]);
span_err!(self.session, import_span, E0258, "{}", &msg[..]);
if let Some(span) = ty.type_span {
self.session.span_note(span,
"note conflicting module here")
@ -1949,7 +1949,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
let segment_name = token::get_name(name);
let module_name = self.module_to_string(&*search_module);
let mut span = span;
let msg = if "???" == &module_name[] {
let msg = if "???" == &module_name[..] {
span.hi = span.lo + Pos::from_usize(segment_name.len());
match search_parent_externals(name,
@ -2062,7 +2062,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
match module_prefix_result {
Failed(None) => {
let mpath = self.names_to_string(module_path);
let mpath = &mpath[];
let mpath = &mpath[..];
match mpath.rfind(':') {
Some(idx) => {
let msg = format!("Could not find `{}` in `{}`",
@ -2365,11 +2365,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[] {
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[] {
} 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.
@ -2380,7 +2380,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[] {
if "super" != &string[..] {
break
}
debug!("(resolving module prefix) resolving `super` at {}",
@ -2511,7 +2511,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
} else {
let err = format!("unresolved import (maybe you meant `{}::*`?)",
sn);
self.resolve_error((*imports)[index].span, &err[]);
self.resolve_error((*imports)[index].span, &err[..]);
}
}
@ -2849,7 +2849,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
generics,
implemented_traits,
&**self_type,
&impl_items[]);
&impl_items[..]);
}
ItemTrait(_, ref generics, ref bounds, ref trait_items) => {
@ -3192,7 +3192,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
};
let msg = format!("attempt to {} a nonexistent trait `{}`", usage_str, path_str);
self.resolve_error(trait_reference.path.span, &msg[]);
self.resolve_error(trait_reference.path.span, &msg[..]);
}
Some(def) => {
match def {
@ -3620,7 +3620,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
None => {
let msg = format!("use of undeclared type name `{}`",
self.path_names_to_string(path));
self.resolve_error(ty.span, &msg[]);
self.resolve_error(ty.span, &msg[..]);
}
}
}
@ -3821,7 +3821,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
def: {:?}", result);
let msg = format!("`{}` does not name a structure",
self.path_names_to_string(path));
self.resolve_error(path.span, &msg[]);
self.resolve_error(path.span, &msg[..]);
}
}
}
@ -4078,7 +4078,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
let last_private;
let module = self.current_module.clone();
match self.resolve_module_path(module,
&module_path[],
&module_path[..],
UseLexicalScope,
path.span,
PathSearch) {
@ -4136,7 +4136,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
let containing_module;
let last_private;
match self.resolve_module_path_from_root(root_module,
&module_path[],
&module_path[..],
0,
path.span,
PathSearch,
@ -4146,7 +4146,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
Some((span, msg)) => (span, msg),
None => {
let msg = format!("Use of undeclared module `::{}`",
self.names_to_string(&module_path[]));
self.names_to_string(&module_path[..]));
(path.span, msg)
}
};
@ -4305,7 +4305,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
}
} else {
match this.resolve_module_path(root,
&name_path[],
&name_path[..],
UseLexicalScope,
span,
PathSearch) {
@ -4343,7 +4343,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
let name_path = path.segments.iter().map(|seg| seg.identifier.name).collect::<Vec<_>>();
// Look for a method in the current self type's impl module.
match get_module(self, path.span, &name_path[]) {
match get_module(self, path.span, &name_path[..]) {
Some(module) => match module.children.borrow().get(&name) {
Some(binding) => {
let p_str = self.path_names_to_string(&path);
@ -4564,7 +4564,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
def: {:?}", result);
let msg = format!("`{}` does not name a structure",
self.path_names_to_string(path));
self.resolve_error(path.span, &msg[]);
self.resolve_error(path.span, &msg[..]);
}
}