Skip to content

Commit

Permalink
Add lazy_type_alias feature gate
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Jun 21, 2023
1 parent 6fc0273 commit 60ec840
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions compiler/rustc_feature/src/active.rs
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,8 @@ declare_features! (
(active, intra_doc_pointers, "1.51.0", Some(80896), None),
// Allows setting the threshold for the `large_assignments` lint.
(active, large_assignments, "1.52.0", Some(83518), None),
/// Allow to have type alias types for inter-crate use.
(active, lazy_type_alias, "CURRENT_RUSTC_VERSION", Some(112792), None),
/// Allows `if/while p && let q = r && ...` chains.

This comment has been minimized.

Copy link
@jcmarblegranite

jcmarblegranite Jun 22, 2023

JJJJ

(active, let_chains, "1.37.0", Some(53667), None),
/// Allows using `reason` in lint attributes and the `#[expect(lint)]` lint check.
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir_analysis/src/astconv/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
let ty = self.tcx().at(span).type_of(did);

if matches!(self.tcx().def_kind(did), DefKind::TyAlias)
&& ty.skip_binder().has_opaque_types()
&& (ty.skip_binder().has_opaque_types() || self.tcx().features().lazy_type_alias)
{
// Type aliases referring to types that contain opaque types (but aren't just directly
// referencing a single opaque type) get encoded as a type alias that normalization will
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_span/src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,7 @@ symbols! {
large_assignments,
lateout,
lazy_normalization_consts,
lazy_type_alias,
le,
len,
let_chains,
Expand Down

0 comments on commit 60ec840

Please sign in to comment.