Skip to content

Commit 60ec840

Browse files
Add lazy_type_alias feature gate
1 parent 6fc0273 commit 60ec840

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

compiler/rustc_feature/src/active.rs

+2
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,8 @@ declare_features! (
440440
(active, intra_doc_pointers, "1.51.0", Some(80896), None),
441441
// Allows setting the threshold for the `large_assignments` lint.
442442
(active, large_assignments, "1.52.0", Some(83518), None),
443+
/// Allow to have type alias types for inter-crate use.
444+
(active, lazy_type_alias, "CURRENT_RUSTC_VERSION", Some(112792), None),
443445
/// Allows `if/while p && let q = r && ...` chains.
444446
(active, let_chains, "1.37.0", Some(53667), None),
445447
/// Allows using `reason` in lint attributes and the `#[expect(lint)]` lint check.

compiler/rustc_hir_analysis/src/astconv/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
896896
let ty = self.tcx().at(span).type_of(did);
897897

898898
if matches!(self.tcx().def_kind(did), DefKind::TyAlias)
899-
&& ty.skip_binder().has_opaque_types()
899+
&& (ty.skip_binder().has_opaque_types() || self.tcx().features().lazy_type_alias)
900900
{
901901
// Type aliases referring to types that contain opaque types (but aren't just directly
902902
// referencing a single opaque type) get encoded as a type alias that normalization will

compiler/rustc_span/src/symbol.rs

+1
Original file line numberDiff line numberDiff line change
@@ -870,6 +870,7 @@ symbols! {
870870
large_assignments,
871871
lateout,
872872
lazy_normalization_consts,
873+
lazy_type_alias,
873874
le,
874875
len,
875876
let_chains,

0 commit comments

Comments
 (0)