Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rustc_resolve: don't allow
::crate_name
to bypass extern_prelude
.
- Loading branch information
Showing
35 changed files
with
115 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
src/test/ui/rfc-2126-extern-absolute-paths/non-existent-1.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
error[E0463]: can't find crate for `xcrate` | ||
error[E0432]: unresolved import `xcrate` | ||
--> $DIR/non-existent-1.rs:13:5 | ||
| | ||
LL | use xcrate::S; //~ ERROR can't find crate for `xcrate` | ||
| ^^^^^^ can't find crate | ||
LL | use xcrate::S; //~ ERROR unresolved import `xcrate` | ||
| ^^^^^^ Could not find `xcrate` in `{{root}}` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0463`. | ||
For more information about this error, try `rustc --explain E0432`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
src/test/ui/rfc-2126-extern-absolute-paths/non-existent-2.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
error[E0463]: can't find crate for `xcrate` | ||
error[E0433]: failed to resolve. Could not find `xcrate` in `{{root}}` | ||
--> $DIR/non-existent-2.rs:14:15 | ||
| | ||
LL | let s = ::xcrate::S; //~ ERROR can't find crate for `xcrate` | ||
| ^^^^^^ can't find crate | ||
LL | let s = ::xcrate::S; | ||
| ^^^^^^ Could not find `xcrate` in `{{root}}` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0463`. | ||
For more information about this error, try `rustc --explain E0433`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
src/test/ui/rfc-2126-extern-absolute-paths/non-existent-3.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
error[E0463]: can't find crate for `ycrate` | ||
error[E0432]: unresolved import `ycrate` | ||
--> $DIR/non-existent-3.rs:13:5 | ||
| | ||
LL | use ycrate; //~ ERROR can't find crate for `ycrate` | ||
| ^^^^^^ can't find crate | ||
LL | use ycrate; //~ ERROR unresolved import `ycrate` | ||
| ^^^^^^ no `ycrate` external crate | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0463`. | ||
For more information about this error, try `rustc --explain E0432`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
src/test/ui/rfc-2126-extern-absolute-paths/single-segment.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
error[E0463]: can't find crate for `xcrate` | ||
error[E0432]: unresolved import `extern::xcrate` | ||
--> $DIR/non-existent-1.rs:13:13 | ||
| | ||
LL | use extern::xcrate::S; //~ ERROR can't find crate for `xcrate` | ||
| ^^^^^^ can't find crate | ||
LL | use extern::xcrate::S; //~ ERROR unresolved import `extern::xcrate` | ||
| ^^^^^^ Could not find `xcrate` in `extern` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0463`. | ||
For more information about this error, try `rustc --explain E0432`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
error[E0463]: can't find crate for `xcrate` | ||
error[E0433]: failed to resolve. Could not find `xcrate` in `extern` | ||
--> $DIR/non-existent-2.rs:14:21 | ||
| | ||
LL | let s = extern::xcrate::S; //~ ERROR can't find crate for `xcrate` | ||
| ^^^^^^ can't find crate | ||
LL | let s = extern::xcrate::S; | ||
| ^^^^^^ Could not find `xcrate` in `extern` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0463`. | ||
For more information about this error, try `rustc --explain E0433`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
error[E0463]: can't find crate for `ycrate` | ||
--> $DIR/non-existent-3.rs:13:13 | ||
error[E0432]: unresolved import `extern::ycrate` | ||
--> $DIR/non-existent-3.rs:13:5 | ||
| | ||
LL | use extern::ycrate; //~ ERROR can't find crate for `ycrate` | ||
| ^^^^^^ can't find crate | ||
LL | use extern::ycrate; //~ ERROR unresolved import `extern::ycrate` | ||
| ^^^^^^^^^^^^^^ no `ycrate` external crate | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0463`. | ||
For more information about this error, try `rustc --explain E0432`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ | |
|
||
// run-pass | ||
// aux-build:png2.rs | ||
// compile-flags:--extern png2 | ||
// edition:2018 | ||
|
||
mod png { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ | |
|
||
// run-pass | ||
// aux-build:xcrate.rs | ||
// compile-flags:--extern xcrate | ||
// edition:2018 | ||
|
||
use xcrate::Z; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ | |
|
||
// run-pass | ||
// aux-build:xcrate.rs | ||
// compile-flags:--extern xcrate | ||
|
||
#![feature(extern_in_paths)] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
// edition:2018 | ||
|
||
#![no_std] | ||
#![crate_type = "lib"] | ||
|
||
use alloc::vec; | ||
//~^ ERROR unresolved import `alloc` | ||
|
||
pub fn foo() { | ||
let mut xs = vec![]; | ||
//~^ ERROR cannot determine resolution for the macro `vec` | ||
xs.push(0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
error[E0432]: unresolved import `alloc` | ||
--> $DIR/issue-54006.rs:16:5 | ||
| | ||
LL | use alloc::vec; | ||
| ^^^^^ Could not find `alloc` in `{{root}}` | ||
|
||
error: cannot determine resolution for the macro `vec` | ||
--> $DIR/issue-54006.rs:20:18 | ||
| | ||
LL | let mut xs = vec![]; | ||
| ^^^ | ||
| | ||
= note: import resolution is stuck, try simplifying macro imports | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0432`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.