diff options
| author | Ryan Levick <ryan.levick@gmail.com> | 2021-01-18 14:01:09 +0100 |
|---|---|---|
| committer | Ryan Levick <ryan.levick@gmail.com> | 2021-01-18 14:01:09 +0100 |
| commit | 38b77420e9e2b08edf739a36027139688d2c9283 (patch) | |
| tree | c2715dcc176b83c7f7eb6a215ddbad388f51aa24 /src/test/ui/resolve | |
| parent | d829e40c7b11d6ba41819b59b3fd0b0bd64e06ba (diff) | |
Add tests for resolution changes
Diffstat (limited to 'src/test/ui/resolve')
| -rw-r--r-- | src/test/ui/resolve/crate-called-as-function.rs | 3 | ||||
| -rw-r--r-- | src/test/ui/resolve/crate-called-as-function.stderr | 9 | ||||
| -rw-r--r-- | src/test/ui/resolve/missing-in-namespace.rs | 4 | ||||
| -rw-r--r-- | src/test/ui/resolve/missing-in-namespace.stderr | 14 |
4 files changed, 30 insertions, 0 deletions
diff --git a/src/test/ui/resolve/crate-called-as-function.rs b/src/test/ui/resolve/crate-called-as-function.rs new file mode 100644 index 00000000000..e8f52c0c029 --- /dev/null +++ b/src/test/ui/resolve/crate-called-as-function.rs @@ -0,0 +1,3 @@ +fn main() { + ::foo() //~ cannot find external crate `foo` in the crate root +} diff --git a/src/test/ui/resolve/crate-called-as-function.stderr b/src/test/ui/resolve/crate-called-as-function.stderr new file mode 100644 index 00000000000..eb42349aff1 --- /dev/null +++ b/src/test/ui/resolve/crate-called-as-function.stderr @@ -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`. diff --git a/src/test/ui/resolve/missing-in-namespace.rs b/src/test/ui/resolve/missing-in-namespace.rs new file mode 100644 index 00000000000..e1dedb072b7 --- /dev/null +++ b/src/test/ui/resolve/missing-in-namespace.rs @@ -0,0 +1,4 @@ +fn main() { + let _map = std::hahmap::HashMap::new(); + //~^ ERROR failed to resolve: could not find `hahmap` in `std +} diff --git a/src/test/ui/resolve/missing-in-namespace.stderr b/src/test/ui/resolve/missing-in-namespace.stderr new file mode 100644 index 00000000000..8b292aeda50 --- /dev/null +++ b/src/test/ui/resolve/missing-in-namespace.stderr @@ -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`. |
