We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 77d096a + c85a8fb commit e1fe1a8Copy full SHA for e1fe1a8
src/librustc_resolve/diagnostics.rs
@@ -838,6 +838,32 @@ trait Foo {
838
839
fn foo<T>(x: T) {} // ok!
840
```
841
+
842
+Another case that causes this error is when a type is imported into a parent
843
+module. To fix this, you can follow the suggestion and use File directly or
844
+`use super::File;` which will import the types from the parent namespace. An
845
+example that causes this error is below:
846
847
+```compile_fail,E0412
848
+use std::fs::File;
849
850
+mod foo {
851
+ fn some_function(f: File) {}
852
+}
853
+```
854
855
856
857
858
859
+ // either
860
+ use super::File;
861
+ // or
862
+ // use std::fs::File;
863
+ fn foo(f: File) {}
864
865
+# fn main() {} // don't insert it for us; that'll break imports
866
867
"##,
868
869
E0415: r##"
0 commit comments