File tree 3 files changed +44
-0
lines changed
compiler/rustc_resolve/src
3 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -829,6 +829,15 @@ impl<'a> Resolver<'a> {
829
829
return ;
830
830
}
831
831
832
+ // #90113: Do not count an inaccessible reexported item as a candidate.
833
+ if let NameBindingKind :: Import { binding, .. } = name_binding. kind {
834
+ if this. is_accessible_from ( binding. vis , parent_scope. module )
835
+ && !this. is_accessible_from ( name_binding. vis , parent_scope. module )
836
+ {
837
+ return ;
838
+ }
839
+ }
840
+
832
841
// collect results based on the filter function
833
842
// avoid suggesting anything from the same module in which we are resolving
834
843
if ident. name == lookup_ident. name
Original file line number Diff line number Diff line change
1
+ mod list {
2
+ pub use self :: List :: Cons ;
3
+
4
+ pub enum List < T > {
5
+ Cons ( T , Box < List < T > > ) ,
6
+ }
7
+ }
8
+
9
+ mod alias {
10
+ use crate :: list:: List ;
11
+
12
+ pub type Foo = List < String > ;
13
+ }
14
+
15
+ fn foo ( l : crate :: alias:: Foo ) {
16
+ match l {
17
+ Cons ( ..) => { } //~ ERROR: cannot find tuple struct or tuple variant `Cons` in this scope
18
+ }
19
+ }
20
+
21
+ fn main ( ) { }
Original file line number Diff line number Diff line change
1
+ error[E0531]: cannot find tuple struct or tuple variant `Cons` in this scope
2
+ --> $DIR/issue-90113.rs:17:9
3
+ |
4
+ LL | Cons(..) => {}
5
+ | ^^^^ not found in this scope
6
+ |
7
+ help: consider importing this tuple variant
8
+ |
9
+ LL | use list::List::Cons;
10
+ |
11
+
12
+ error: aborting due to previous error
13
+
14
+ For more information about this error, try `rustc --explain E0531`.
You can’t perform that action at this time.
0 commit comments