Skip to content

Commit 729d1da

Browse files
committed
---
yaml --- r: 138599 b: refs/heads/try2 c: 94a07b6 h: refs/heads/master i: 138597: 79a9cd7 138595: ae3f85c 138591: 9772731 v: v3
1 parent af7216d commit 729d1da

File tree

6 files changed

+44
-284
lines changed

6 files changed

+44
-284
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 0d30af1ebe4a803d86f47106c90ec0dc20a9d024
8+
refs/heads/try2: 94a07b6e4adbe0c2cd49673d58641852390f5639
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/etc/gedit/readme.txt

Lines changed: 0 additions & 11 deletions
This file was deleted.

branches/try2/src/etc/gedit/share/gtksourceview-3.0/language-specs/rust.lang

Lines changed: 0 additions & 264 deletions
This file was deleted.

branches/try2/src/etc/gedit/share/mime/packages/rust.xml

Lines changed: 0 additions & 7 deletions
This file was deleted.

branches/try2/src/librustc/middle/resolve.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2480,7 +2480,7 @@ pub impl Resolver {
24802480

24812481
// Here we merge two import resolutions.
24822482
match module_.import_resolutions.find(&ident) {
2483-
None => {
2483+
None if target_import_resolution.privacy == Public => {
24842484
// Simple: just copy the old import resolution.
24852485
let new_import_resolution =
24862486
@mut ImportResolution(privacy,
@@ -2494,6 +2494,7 @@ pub impl Resolver {
24942494
module_.import_resolutions.insert
24952495
(ident, new_import_resolution);
24962496
}
2497+
None => { /* continue ... */ }
24972498
Some(dest_import_resolution) => {
24982499
// Merge the two import resolutions at a finer-grained
24992500
// level.
@@ -2756,6 +2757,8 @@ pub impl Resolver {
27562757
namespace);
27572758
}
27582759
Some(target) => {
2760+
debug!("(resolving item in lexical scope) using \
2761+
import resolution");
27592762
import_resolution.state.used = true;
27602763
return Success(copy target);
27612764
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// regression test for issue 4366
12+
13+
// ensures that 'use foo:*' doesn't import non-public 'use' statements in the
14+
// module 'foo'
15+
16+
mod foo {
17+
pub fn foo() {}
18+
}
19+
mod a {
20+
pub mod b {
21+
use foo::foo;
22+
type bar = int;
23+
}
24+
pub mod sub {
25+
use a::b::*;
26+
fn sub() -> bar { foo(); 1 } //~ ERROR: unresolved name: foo
27+
//~^ ERROR: unresolved name: bar
28+
}
29+
}
30+
31+
mod m1 {
32+
fn foo() {}
33+
}
34+
use m1::*;
35+
36+
fn main() {
37+
foo(); //~ ERROR: unresolved name: foo
38+
}
39+

0 commit comments

Comments
 (0)