Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a4bf23b

Browse files
committedSep 26, 2023
Auto merge of rust-lang#116163 - compiler-errors:lazyness, r=<try>
Don't store lazyness in `DefKind::TyAlias` 1. Don't store lazyness of a type alias in its `DefKind`, but instead via a query. 2. This allows us to treat type aliases as lazy if `#[feature(lazy_type_alias)]` *OR* if the alias contains a TAIT, rather than having checks for both in separate parts of the codebase. r? `@oli-obk` cc `@fmease`
2 parents c614c17 + 88ef3a2 commit a4bf23b

File tree

50 files changed

+127
-182
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+127
-182
lines changed
 

‎compiler/rustc_borrowck/src/diagnostics/region_name.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
516516
// be the same as those of the ADT.
517517
// FIXME: We should be able to do something similar to
518518
// match_adt_and_segment in this case.
519-
Res::Def(DefKind::TyAlias { .. }, _) => (),
519+
Res::Def(DefKind::TyAlias, _) => (),
520520
_ => {
521521
if let Some(last_segment) = path.segments.last() {
522522
if let Some(highlight) = self.match_adt_and_segment(

‎compiler/rustc_hir/src/def.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,7 @@ pub enum DefKind {
6161
Variant,
6262
Trait,
6363
/// Type alias: `type Foo = Bar;`
64-
TyAlias {
65-
lazy: bool,
66-
},
64+
TyAlias,
6765
/// Type from an `extern` block.
6866
ForeignTy,
6967
/// Trait alias: `trait IntIterator = Iterator<Item = i32>;`
@@ -143,7 +141,7 @@ impl DefKind {
143141
DefKind::Ctor(CtorOf::Struct, CtorKind::Fn) => "tuple struct",
144142
DefKind::Ctor(CtorOf::Struct, CtorKind::Const) => "unit struct",
145143
DefKind::OpaqueTy => "opaque type",
146-
DefKind::TyAlias { .. } => "type alias",
144+
DefKind::TyAlias => "type alias",
147145
DefKind::TraitAlias => "trait alias",
148146
DefKind::AssocTy => "associated type",
149147
DefKind::Union => "union",
@@ -199,7 +197,7 @@ impl DefKind {
199197
| DefKind::Variant
200198
| DefKind::Trait
201199
| DefKind::OpaqueTy
202-
| DefKind::TyAlias { .. }
200+
| DefKind::TyAlias
203201
| DefKind::ForeignTy
204202
| DefKind::TraitAlias
205203
| DefKind::AssocTy
@@ -250,7 +248,7 @@ impl DefKind {
250248
| DefKind::Enum
251249
| DefKind::Variant
252250
| DefKind::Trait
253-
| DefKind::TyAlias { .. }
251+
| DefKind::TyAlias
254252
| DefKind::ForeignTy
255253
| DefKind::TraitAlias
256254
| DefKind::AssocTy

0 commit comments

Comments
 (0)
Please sign in to comment.