File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -838,6 +838,32 @@ trait Foo {
838838
839839fn foo<T>(x: T) {} // ok!
840840```
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+ use std::fs::File;
857+
858+ mod foo {
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+ ```
841867"## ,
842868
843869E0415 : r##"
You can’t perform that action at this time.
0 commit comments