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> {
1599
1599
if is_exported {
1600
1600
self . external_exports . insert ( def. def_id ( ) ) ;
1601
1601
}
1602
+
1603
+ let kind = match def {
1604
+ DefStruct ( ..) | DefTy ( ..) => ImplModuleKind ,
1605
+ _ => NormalModuleKind
1606
+ } ;
1607
+
1602
1608
match def {
1603
1609
DefMod ( def_id) | DefForeignMod ( def_id) | DefStruct ( def_id) |
1604
1610
DefTy ( def_id) => {
@@ -1617,7 +1623,7 @@ impl<'a> Resolver<'a> {
1617
1623
1618
1624
child_name_bindings. define_module ( parent_link,
1619
1625
Some ( def_id) ,
1620
- NormalModuleKind ,
1626
+ kind ,
1621
1627
true ,
1622
1628
is_public,
1623
1629
DUMMY_SP ) ;
Original file line number Diff line number Diff line change 8
8
// option. This file may not be copied, modified, or distributed
9
9
// except according to those terms.
10
10
11
+ pub use self :: sub:: Bar ;
12
+
11
13
pub trait Trait {
12
14
fn foo ( ) ;
13
15
}
@@ -17,3 +19,11 @@ struct Foo;
17
19
impl Foo {
18
20
pub fn new ( ) { }
19
21
}
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;
18
18
use use_from_trait_xc:: Foo :: new;
19
19
//~^ ERROR unresolved import `use_from_trait_xc::Foo::new`. Cannot import from a trait or type imple
20
20
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
+
21
24
fn main ( ) { }
You can’t perform that action at this time.
0 commit comments