summaryrefslogtreecommitdiffstats
path: root/src/test/ui/resolve/typo-suggestion-mistyped-in-path.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/resolve/typo-suggestion-mistyped-in-path.rs')
-rw-r--r--src/test/ui/resolve/typo-suggestion-mistyped-in-path.rs42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/test/ui/resolve/typo-suggestion-mistyped-in-path.rs b/src/test/ui/resolve/typo-suggestion-mistyped-in-path.rs
new file mode 100644
index 000000000..3ce17a14f
--- /dev/null
+++ b/src/test/ui/resolve/typo-suggestion-mistyped-in-path.rs
@@ -0,0 +1,42 @@
+struct Struct;
+//~^ NOTE function or associated item `fob` not found for this struct
+
+impl Struct {
+ fn foo() { }
+}
+
+mod module {
+ fn foo() { }
+
+ struct Struct;
+
+ impl Struct {
+ fn foo() { }
+ }
+}
+
+trait Trait {
+ fn foo();
+}
+
+fn main() {
+ Struct::fob();
+ //~^ ERROR no function or associated item named `fob` found for struct `Struct` in the current scope
+ //~| NOTE function or associated item not found in `Struct`
+
+ Struc::foo();
+ //~^ ERROR failed to resolve: use of undeclared type `Struc`
+ //~| NOTE use of undeclared type `Struc`
+
+ modul::foo();
+ //~^ ERROR failed to resolve: use of undeclared crate or module `modul`
+ //~| NOTE use of undeclared crate or module `modul`
+
+ module::Struc::foo();
+ //~^ ERROR failed to resolve: could not find `Struc` in `module`
+ //~| NOTE could not find `Struc` in `module`
+
+ Trai::foo();
+ //~^ ERROR failed to resolve: use of undeclared type `Trai`
+ //~| NOTE use of undeclared type `Trai`
+}