File tree Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -1599,6 +1599,12 @@ impl<'a> Resolver<'a> {
15991599 if is_exported {
16001600 self . external_exports . insert ( def. def_id ( ) ) ;
16011601 }
1602+
1603+ let kind = match def {
1604+ DefStruct ( ..) | DefTy ( ..) => ImplModuleKind ,
1605+ _ => NormalModuleKind
1606+ } ;
1607+
16021608 match def {
16031609 DefMod ( def_id) | DefForeignMod ( def_id) | DefStruct ( def_id) |
16041610 DefTy ( def_id) => {
@@ -1617,7 +1623,7 @@ impl<'a> Resolver<'a> {
16171623
16181624 child_name_bindings. define_module ( parent_link,
16191625 Some ( def_id) ,
1620- NormalModuleKind ,
1626+ kind ,
16211627 true ,
16221628 is_public,
16231629 DUMMY_SP ) ;
Original file line number Diff line number Diff line change 88// option. This file may not be copied, modified, or distributed
99// except according to those terms.
1010
11+ pub use self :: sub:: Bar ;
12+
1113pub trait Trait {
1214 fn foo ( ) ;
1315}
@@ -17,3 +19,11 @@ struct Foo;
1719impl Foo {
1820 pub fn new ( ) { }
1921}
22+
23+ mod sub {
24+ pub struct Bar ;
25+
26+ impl Bar {
27+ pub fn new ( ) { }
28+ }
29+ }
Original file line number Diff line number Diff line change @@ -18,4 +18,7 @@ use use_from_trait_xc::Trait::foo;
1818use use_from_trait_xc:: Foo :: new;
1919//~^ ERROR unresolved import `use_from_trait_xc::Foo::new`. Cannot import from a trait or type imple
2020
21+ use use_from_trait_xc:: Bar :: new;
22+ //~^ ERROR unresolved import `use_from_trait_xc::Bar::new`. Cannot import from a trait or type
23+
2124fn main ( ) { }
You can’t perform that action at this time.
0 commit comments