Skip to content

Commit 731a597

Browse files
---
yaml --- r: 274831 b: refs/heads/stable c: 8ac5f87 h: refs/heads/master i: 274829: faa9f09 274827: 855af13 274823: 25539f7 274815: 22448c4
1 parent 770e106 commit 731a597

File tree

3 files changed

+41
-41
lines changed

3 files changed

+41
-41
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: c0221c8897db309a79990367476177b1230bb264
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 93e58cc28fdc978cbc967b131a7ec04bc2a90bb1
32+
refs/heads/stable: 8ac5f87db8c485e2d659f331f2bfa5d53a498d76
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/src/librustc_resolve/lib.rs

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -438,25 +438,25 @@ fn resolve_struct_error<'b, 'a: 'b, 'tcx: 'a>(resolver: &'b Resolver<'a, 'tcx>,
438438
help_msg = format!("To reference an item from the \
439439
`{module}` module, use \
440440
`{module}::{ident}`",
441-
module = &*path,
441+
module = path,
442442
ident = ident.node);
443443
}
444444
ExprMethodCall(ident, _, _) => {
445445
help_msg = format!("To call a function from the \
446446
`{module}` module, use \
447447
`{module}::{ident}(..)`",
448-
module = &*path,
448+
module = path,
449449
ident = ident.node);
450450
}
451451
ExprCall(_, _) => {
452452
help_msg = format!("No function corresponds to `{module}(..)`",
453-
module = &*path);
453+
module = path);
454454
}
455455
_ => { } // no help available
456456
}
457457
} else {
458458
help_msg = format!("Module `{module}` cannot be the value of an expression",
459-
module = &*path);
459+
module = path);
460460
}
461461

462462
if !help_msg.is_empty() {
@@ -577,7 +577,7 @@ impl<'a, 'v, 'tcx> Visitor<'v> for Resolver<'a, 'tcx> {
577577
self.resolve_expr(expr);
578578
}
579579
fn visit_local(&mut self, local: &Local) {
580-
execute_callback!(hir_map::Node::NodeLocal(&*local.pat), self);
580+
execute_callback!(hir_map::Node::NodeLocal(&local.pat), self);
581581
self.resolve_local(local);
582582
}
583583
fn visit_ty(&mut self, ty: &Ty) {
@@ -1331,8 +1331,8 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
13311331
match search_parent_externals(name, &self.current_module) {
13321332
Some(module) => {
13331333
let path_str = names_to_string(module_path);
1334-
let target_mod_str = module_to_string(&*module);
1335-
let current_mod_str = module_to_string(&*self.current_module);
1334+
let target_mod_str = module_to_string(&module);
1335+
let current_mod_str = module_to_string(&self.current_module);
13361336

13371337
let prefix = if target_mod_str == current_mod_str {
13381338
"self::".to_string()
@@ -1400,7 +1400,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
14001400

14011401
debug!("(resolving module path for import) processing `{}` rooted at `{}`",
14021402
names_to_string(module_path),
1403-
module_to_string(&*module_));
1403+
module_to_string(&module_));
14041404

14051405
// Resolve the module prefix, if any.
14061406
let module_prefix_result = self.resolve_module_prefix(module_, module_path);
@@ -1494,15 +1494,15 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
14941494
debug!("(resolving item in lexical scope) resolving `{}` in namespace {:?} in `{}`",
14951495
name,
14961496
namespace,
1497-
module_to_string(&*module_));
1497+
module_to_string(&module_));
14981498

14991499
// Proceed up the scope chain looking for parent modules.
15001500
let mut search_module = module_;
15011501
loop {
15021502
// Resolve the name in the parent module.
15031503
match self.resolve_name_in_module(search_module, name, namespace, true, record_used) {
15041504
Failed(Some((span, msg))) => {
1505-
resolve_error(self, span, ResolutionError::FailedToResolve(&*msg));
1505+
resolve_error(self, span, ResolutionError::FailedToResolve(&msg));
15061506
}
15071507
Failed(None) => (), // Continue up the search chain.
15081508
Indeterminate => {
@@ -1592,7 +1592,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
15921592
// Now loop through all the `super`s we find.
15931593
while i < module_path.len() && "super" == module_path[i].as_str() {
15941594
debug!("(resolving module prefix) resolving `super` at {}",
1595-
module_to_string(&*containing_module));
1595+
module_to_string(&containing_module));
15961596
match self.get_nearest_normal_module_parent(containing_module) {
15971597
None => return Failed(None),
15981598
Some(new_module) => {
@@ -1603,7 +1603,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
16031603
}
16041604

16051605
debug!("(resolving module prefix) finished resolving prefix at {}",
1606-
module_to_string(&*containing_module));
1606+
module_to_string(&containing_module));
16071607

16081608
return Success(PrefixFound(containing_module, i));
16091609
}
@@ -1770,7 +1770,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
17701770
ItemImpl(_, _, ref generics, ref opt_trait_ref, ref self_type, ref impl_items) => {
17711771
self.resolve_implementation(generics,
17721772
opt_trait_ref,
1773-
&**self_type,
1773+
&self_type,
17741774
item.id,
17751775
impl_items);
17761776
}
@@ -1965,9 +1965,9 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
19651965
// Add each argument to the rib.
19661966
let mut bindings_list = HashMap::new();
19671967
for argument in &declaration.inputs {
1968-
self.resolve_pattern(&*argument.pat, ArgumentIrrefutableMode, &mut bindings_list);
1968+
self.resolve_pattern(&argument.pat, ArgumentIrrefutableMode, &mut bindings_list);
19691969

1970-
self.visit_ty(&*argument.ty);
1970+
self.visit_ty(&argument.ty);
19711971

19721972
debug!("(resolving function) recorded argument");
19731973
}
@@ -1997,7 +1997,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
19971997
let mut err =
19981998
resolve_struct_error(self,
19991999
trait_path.span,
2000-
ResolutionError::IsNotATrait(&*path_names_to_string(trait_path,
2000+
ResolutionError::IsNotATrait(&path_names_to_string(trait_path,
20012001
path_depth)));
20022002

20032003
// If it's a typedef, give a note
@@ -2011,7 +2011,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
20112011
} else {
20122012
resolve_error(self,
20132013
trait_path.span,
2014-
ResolutionError::UndeclaredTraitName(&*path_names_to_string(trait_path,
2014+
ResolutionError::UndeclaredTraitName(&path_names_to_string(trait_path,
20152015
path_depth)));
20162016
Err(())
20172017
}
@@ -2165,7 +2165,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
21652165
if let Some((did, ref trait_ref)) = self.current_trait_ref {
21662166
if !self.trait_item_map.contains_key(&(name, did)) {
21672167
let path_str = path_names_to_string(&trait_ref.path, 0);
2168-
resolve_error(self, span, err(name, &*path_str));
2168+
resolve_error(self, span, err(name, &path_str));
21692169
}
21702170
}
21712171
}
@@ -2178,7 +2178,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
21782178
walk_list!(self, visit_expr, &local.init);
21792179

21802180
// Resolve the pattern.
2181-
self.resolve_pattern(&*local.pat, LocalIrrefutableMode, &mut HashMap::new());
2181+
self.resolve_pattern(&local.pat, LocalIrrefutableMode, &mut HashMap::new());
21822182
}
21832183

21842184
// build a map from pattern identifiers to binding-info's.
@@ -2204,9 +2204,9 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
22042204
if arm.pats.is_empty() {
22052205
return;
22062206
}
2207-
let map_0 = self.binding_mode_map(&*arm.pats[0]);
2207+
let map_0 = self.binding_mode_map(&arm.pats[0]);
22082208
for (i, p) in arm.pats.iter().enumerate() {
2209-
let map_i = self.binding_mode_map(&**p);
2209+
let map_i = self.binding_mode_map(&p);
22102210

22112211
for (&key, &binding_0) in &map_0 {
22122212
match map_i.get(&key) {
@@ -2241,15 +2241,15 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
22412241

22422242
let mut bindings_list = HashMap::new();
22432243
for pattern in &arm.pats {
2244-
self.resolve_pattern(&**pattern, RefutableMode, &mut bindings_list);
2244+
self.resolve_pattern(&pattern, RefutableMode, &mut bindings_list);
22452245
}
22462246

22472247
// This has to happen *after* we determine which
22482248
// pat_idents are variants
22492249
self.check_consistent_bindings(arm);
22502250

22512251
walk_list!(self, visit_expr, &arm.guard);
2252-
self.visit_expr(&*arm.body);
2252+
self.visit_expr(&arm.body);
22532253

22542254
if !self.resolved {
22552255
self.value_ribs.pop();
@@ -2340,7 +2340,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
23402340
ty.span,
23412341
ResolutionError::UseOfUndeclared(
23422342
kind,
2343-
&*path_names_to_string(path,
2343+
&path_names_to_string(path,
23442344
0))
23452345
);
23462346
}
@@ -2616,7 +2616,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
26162616
self,
26172617
path.span,
26182618
ResolutionError::DoesNotNameAStruct(
2619-
&*path_names_to_string(path, 0))
2619+
&path_names_to_string(path, 0))
26202620
);
26212621
self.record_def(pattern.id, err_path_resolution());
26222622
}
@@ -2672,7 +2672,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
26722672
Failed(err) => {
26732673
match err {
26742674
Some((span, msg)) => {
2675-
resolve_error(self, span, ResolutionError::FailedToResolve(&*msg));
2675+
resolve_error(self, span, ResolutionError::FailedToResolve(&msg));
26762676
}
26772677
None => (),
26782678
}
@@ -2804,7 +2804,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
28042804
match self.resolve_item_in_lexical_scope(module, name, namespace, record_used) {
28052805
Success(binding) => binding.def().map(LocalDef::from_def),
28062806
Failed(Some((span, msg))) => {
2807-
resolve_error(self, span, ResolutionError::FailedToResolve(&*msg));
2807+
resolve_error(self, span, ResolutionError::FailedToResolve(&msg));
28082808
None
28092809
}
28102810
_ => None,
@@ -2927,7 +2927,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
29272927
}
29282928
};
29292929

2930-
resolve_error(self, span, ResolutionError::FailedToResolve(&*msg));
2930+
resolve_error(self, span, ResolutionError::FailedToResolve(&msg));
29312931
return None;
29322932
}
29332933
Indeterminate => return None,
@@ -2982,7 +2982,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
29822982
}
29832983
};
29842984

2985-
resolve_error(self, span, ResolutionError::FailedToResolve(&*msg));
2985+
resolve_error(self, span, ResolutionError::FailedToResolve(&msg));
29862986
return None;
29872987
}
29882988

@@ -3064,8 +3064,8 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
30643064
-> Option<(Path, NodeId, FallbackChecks)> {
30653065
match t.node {
30663066
TyPath(None, ref path) => Some((path.clone(), t.id, allow)),
3067-
TyPtr(ref mut_ty) => extract_path_and_node_id(&*mut_ty.ty, OnlyTraitAndStatics),
3068-
TyRptr(_, ref mut_ty) => extract_path_and_node_id(&*mut_ty.ty, allow),
3067+
TyPtr(ref mut_ty) => extract_path_and_node_id(&mut_ty.ty, OnlyTraitAndStatics),
3068+
TyRptr(_, ref mut_ty) => extract_path_and_node_id(&mut_ty.ty, allow),
30693069
// This doesn't handle the remaining `Ty` variants as they are not
30703070
// that commonly the self_type, it might be interesting to provide
30713071
// support for those in future.
@@ -3183,7 +3183,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
31833183
.flat_map(|rib| rib.bindings.keys());
31843184

31853185
if let Some(found) = find_best_match_for_name(names, name, None) {
3186-
if name != &*found {
3186+
if name != found {
31873187
return SuggestionType::Function(found);
31883188
}
31893189
} SuggestionType::NotFound
@@ -3229,7 +3229,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
32293229

32303230
let mut err = resolve_struct_error(self,
32313231
expr.span,
3232-
ResolutionError::StructVariantUsedAsFunction(&*path_name));
3232+
ResolutionError::StructVariantUsedAsFunction(&path_name));
32333233

32343234
let msg = format!("did you mean to write: `{} {{ /* fields */ }}`?",
32353235
path_name);
@@ -3270,7 +3270,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
32703270
Some(Def::Struct(..)) => {
32713271
let mut err = resolve_struct_error(self,
32723272
expr.span,
3273-
ResolutionError::StructVariantUsedAsFunction(&*path_name));
3273+
ResolutionError::StructVariantUsedAsFunction(&path_name));
32743274

32753275
let msg = format!("did you mean to write: `{} {{ /* fields */ }}`?",
32763276
path_name);
@@ -3346,7 +3346,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
33463346
resolve_error(self,
33473347
expr.span,
33483348
ResolutionError::UnresolvedName(
3349-
&*path_name, &*msg, context));
3349+
&path_name, &msg, context));
33503350
}
33513351
}
33523352
}
@@ -3367,7 +3367,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
33673367
resolve_error(self,
33683368
path.span,
33693369
ResolutionError::DoesNotNameAStruct(
3370-
&*path_names_to_string(path, 0))
3370+
&path_names_to_string(path, 0))
33713371
);
33723372
self.record_def(expr.id, err_path_resolution());
33733373
}

branches/stable/src/librustc_resolve/resolve_imports.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ impl<'a, 'b:'a, 'tcx:'b> ImportResolver<'a, 'b, 'tcx> {
238238
-> Vec<ImportResolvingError<'b>> {
239239
let mut errors = Vec::new();
240240
debug!("(resolving imports for module subtree) resolving {}",
241-
module_to_string(&*module_));
241+
module_to_string(&module_));
242242
let orig_module = replace(&mut self.resolver.current_module, module_);
243243
errors.extend(self.resolve_imports_for_module(module_));
244244
self.resolver.current_module = orig_module;
@@ -268,7 +268,7 @@ impl<'a, 'b:'a, 'tcx:'b> ImportResolver<'a, 'b, 'tcx> {
268268

269269
if module.all_imports_resolved() {
270270
debug!("(resolving imports for module) all imports resolved for {}",
271-
module_to_string(&*module));
271+
module_to_string(&module));
272272
return errors;
273273
}
274274

@@ -320,7 +320,7 @@ impl<'a, 'b:'a, 'tcx:'b> ImportResolver<'a, 'b, 'tcx> {
320320
-> ResolveResult<()> {
321321
debug!("(resolving import for module) resolving import `{}::...` in `{}`",
322322
names_to_string(&import_directive.module_path),
323-
module_to_string(&*module_));
323+
module_to_string(&module_));
324324

325325
self.resolver
326326
.resolve_module_path(module_,
@@ -370,7 +370,7 @@ impl<'a, 'b:'a, 'tcx:'b> ImportResolver<'a, 'b, 'tcx> {
370370
debug!("(resolving single import) resolving `{}` = `{}::{}` from `{}` id {}, last \
371371
private {:?}",
372372
target,
373-
module_to_string(&*target_module),
373+
module_to_string(&target_module),
374374
source,
375375
module_to_string(module_),
376376
directive.id,

0 commit comments

Comments
 (0)