Skip to content

Commit 734441c

Browse files
committed
tests: add test for rust-lang#61019's current behaviour
This commit adds a test for rust-lang#61019 where a extern crate is imported as `std` which results in name resolution to fail due to the uses of `std` types introduced from lowering. Signed-off-by: David Wood <david@davidtw.co>
1 parent 764dc3d commit 734441c

File tree

2 files changed

+90
-0
lines changed

2 files changed

+90
-0
lines changed
+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
//~ ERROR failed to resolve: could not find `future` in `std` [E0433]
2+
//~^ ERROR failed to resolve: could not find `pin` in `std` [E0433]
3+
//~^^ ERROR failed to resolve: could not find `future` in `std` [E0433]
4+
//~^^^ ERROR failed to resolve: could not find `future` in `std` [E0433]
5+
//~^^^^ ERROR failed to resolve: could not find `task` in `std` [E0433]
6+
//~^^^^^ ERROR failed to resolve: could not find `task` in `std` [E0433]
7+
//~^^^^^^ ERROR failed to resolve: could not find `future` in `std` [E0433]
8+
//~^^^^^^^ ERROR failed to resolve: could not find `future` in `std` [E0433]
9+
//~^^^^^^^^ ERROR failed to resolve: could not find `ops` in `std` [E0433]
10+
//~^^^^^^^^^ ERROR failed to resolve: could not find `option` in `std` [E0433]
11+
//~^^^^^^^^^^ ERROR failed to resolve: could not find `option` in `std` [E0433]
12+
//~^^^^^^^^^^^ ERROR failed to resolve: could not find `iter` in `std` [E0433]
13+
//~^^^^^^^^^^^^ ERROR failed to resolve: could not find `iter` in `std` [E0433]
14+
//~^^^^^^^^^^^^^ ERROR failed to resolve: could not find `ops` in `std` [E0433]
15+
//~^^^^^^^^^^^^^^ ERROR failed to resolve: could not find `option` in `std` [E0433]
16+
//~^^^^^^^^^^^^^^^ ERROR failed to resolve: could not find `option` in `std` [E0433]
17+
//~^^^^^^^^^^^^^^^^ ERROR failed to resolve: could not find `iter` in `std` [E0433]
18+
//~^^^^^^^^^^^^^^^^^ ERROR failed to resolve: could not find `iter` in `std` [E0433]
19+
//~^^^^^^^^^^^^^^^^^^ ERROR failed to resolve: could not find `ops` in `std` [E0433]
20+
//~^^^^^^^^^^^^^^^^^^^ ERROR failed to resolve: could not find `result` in `std` [E0433]
21+
//~^^^^^^^^^^^^^^^^^^^^ ERROR failed to resolve: could not find `convert` in `std` [E0433]
22+
//~^^^^^^^^^^^^^^^^^^^^^ ERROR failed to resolve: could not find `ops` in `std` [E0433]
23+
//~^^^^^^^^^^^^^^^^^^^^^^ ERROR failed to resolve: could not find `result` in `std` [E0433]
24+
25+
// edition:2018
26+
// aux-build:not-libstd.rs
27+
28+
// Check that paths created in HIR are not affected by in scope names.
29+
30+
extern crate not_libstd as std;
31+
32+
async fn the_future() {
33+
async {}.await;
34+
}
35+
36+
fn main() -> Result<(), ()> {
37+
for i in 0..10 {}
38+
for j in 0..=10 {}
39+
Ok(())?;
40+
Ok(())
41+
}
+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
error[E0433]: failed to resolve: could not find `future` in `std`
2+
3+
error[E0433]: failed to resolve: could not find `pin` in `std`
4+
5+
error[E0433]: failed to resolve: could not find `future` in `std`
6+
7+
error[E0433]: failed to resolve: could not find `future` in `std`
8+
9+
error[E0433]: failed to resolve: could not find `task` in `std`
10+
11+
error[E0433]: failed to resolve: could not find `task` in `std`
12+
13+
error[E0433]: failed to resolve: could not find `future` in `std`
14+
15+
error[E0433]: failed to resolve: could not find `future` in `std`
16+
17+
error[E0433]: failed to resolve: could not find `ops` in `std`
18+
19+
error[E0433]: failed to resolve: could not find `option` in `std`
20+
21+
error[E0433]: failed to resolve: could not find `option` in `std`
22+
23+
error[E0433]: failed to resolve: could not find `iter` in `std`
24+
25+
error[E0433]: failed to resolve: could not find `iter` in `std`
26+
27+
error[E0433]: failed to resolve: could not find `ops` in `std`
28+
29+
error[E0433]: failed to resolve: could not find `option` in `std`
30+
31+
error[E0433]: failed to resolve: could not find `option` in `std`
32+
33+
error[E0433]: failed to resolve: could not find `iter` in `std`
34+
35+
error[E0433]: failed to resolve: could not find `iter` in `std`
36+
37+
error[E0433]: failed to resolve: could not find `ops` in `std`
38+
39+
error[E0433]: failed to resolve: could not find `result` in `std`
40+
41+
error[E0433]: failed to resolve: could not find `convert` in `std`
42+
43+
error[E0433]: failed to resolve: could not find `ops` in `std`
44+
45+
error[E0433]: failed to resolve: could not find `result` in `std`
46+
47+
error: aborting due to 23 previous errors
48+
49+
For more information about this error, try `rustc --explain E0433`.

0 commit comments

Comments
 (0)