Skip to content

Commit 5d39414

Browse files
committed
Privacy: enqueue type alias
1 parent 3bf5c6d commit 5d39414

2 files changed

Lines changed: 21 additions & 2 deletions

File tree

compiler/rustc_privacy/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,7 @@ impl ReachEverythingInTheInterfaceVisitor<'_, '_> {
783783
}
784784
}
785785

786-
DefKind::TraitAlias | DefKind::Fn => {
786+
DefKind::TraitAlias | DefKind::Fn | DefKind::TyAlias => {
787787
self.ev.queue.insert(def_id);
788788
}
789789

@@ -808,7 +808,6 @@ impl ReachEverythingInTheInterfaceVisitor<'_, '_> {
808808

809809
// Can't be reached
810810
DefKind::Impl { .. }
811-
| DefKind::TyAlias
812811
| DefKind::Field
813812
| DefKind::Variant
814813
| DefKind::Static { .. }
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//@ check-pass
2+
#![feature(lazy_type_alias)]
3+
4+
use src::hidden_core;
5+
mod src {
6+
mod aliases {
7+
use hidden_core::InternalStruct;
8+
pub type ExposedType = InternalStruct<f32>;
9+
}
10+
pub mod hidden_core {
11+
use super::aliases::ExposedType;
12+
pub struct InternalStruct<T> {
13+
_x: T,
14+
}
15+
pub fn new() -> ExposedType {
16+
InternalStruct { _x: 1.0 }
17+
}
18+
}
19+
}
20+
fn main() {}

0 commit comments

Comments
 (0)