Skip to content

Commit

Permalink
Add tests for resolution changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rylev committed Jan 18, 2021
1 parent d829e40 commit 38b7742
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/test/ui/resolve/crate-called-as-function.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
::foo() //~ cannot find external crate `foo` in the crate root
}
9 changes: 9 additions & 0 deletions src/test/ui/resolve/crate-called-as-function.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
error[E0425]: cannot find external crate `foo` in the crate root
--> $DIR/crate-called-as-function.rs:2:7
|
LL | ::foo()
| ^^^ not found in the crate root

error: aborting due to previous error

For more information about this error, try `rustc --explain E0425`.
4 changes: 4 additions & 0 deletions src/test/ui/resolve/missing-in-namespace.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
fn main() {
let _map = std::hahmap::HashMap::new();
//~^ ERROR failed to resolve: could not find `hahmap` in `std
}
14 changes: 14 additions & 0 deletions src/test/ui/resolve/missing-in-namespace.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
error[E0433]: failed to resolve: could not find `hahmap` in `std`
--> $DIR/missing-in-namespace.rs:2:29
|
LL | let _map = std::hahmap::HashMap::new();
| ^^^^^^^ not found in `std::hahmap`
|
help: consider importing this struct
|
LL | use std::collections::HashMap;
|

error: aborting due to previous error

For more information about this error, try `rustc --explain E0433`.

0 comments on commit 38b7742

Please sign in to comment.