Skip to content

Commit d756067

Browse files
committed
---
yaml --- r: 275228 b: refs/heads/stable c: 2942cf7 h: refs/heads/master
1 parent e0090c9 commit d756067

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
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: 197326d17b8ecce3eb129af4795ef9d523854015
32+
refs/heads/stable: 2942cf7b0ace5a23fc26713f49de7b1e696bfb16
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: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2788,8 +2788,9 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
27882788
}
27892789

27902790
if check_ribs {
2791-
if let Some(def) = self.resolve_identifier_in_local_ribs(identifier, namespace) {
2792-
return Some(def);
2791+
match self.resolve_identifier_in_local_ribs(identifier, namespace, record_used) {
2792+
Some(def) => return Some(def),
2793+
None => {}
27932794
}
27942795
}
27952796

@@ -3001,7 +3002,8 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
30013002

30023003
fn resolve_identifier_in_local_ribs(&mut self,
30033004
ident: hir::Ident,
3004-
namespace: Namespace)
3005+
namespace: Namespace,
3006+
record_used: bool)
30053007
-> Option<LocalDef> {
30063008
// Check the local set of ribs.
30073009
let name = match namespace { ValueNS => ident.name, TypeNS => ident.unhygienic_name };
@@ -3033,7 +3035,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
30333035
ident.unhygienic_name,
30343036
namespace,
30353037
true,
3036-
true) {
3038+
record_used) {
30373039
if let Some(def) = binding.def() {
30383040
return Some(LocalDef::from_def(def));
30393041
}

branches/stable/src/test/compile-fail/lint-unused-imports.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,13 @@ mod bar {
6969
}
7070
}
7171

72+
fn g() {
73+
use self::g; //~ ERROR unused import
74+
fn f() {
75+
self::g();
76+
}
77+
}
78+
7279
fn main() {
7380
cal(foo::Point{x:3, y:9});
7481
let mut a = 3;

0 commit comments

Comments
 (0)