Rename lazy_type_alias feature gate to checked_type_aliases #158758
Rename lazy_type_alias feature gate to checked_type_aliases #158758josetorrs wants to merge 4 commits into
lazy_type_alias feature gate to checked_type_aliases #158758Conversation
| #![feature(checked_free_type_aliases)] | ||
|
|
There was a problem hiding this comment.
for these, the directory is tests/ui/lazy-type-alias/... but I wasn't sure if I should rename this TBH
There was a problem hiding this comment.
Ideally, yes, since I named this directory after the feature name. It currently exercises both the "checkedness" and the "laziness" ("retainedness") of LTA.
lazy_type_alias to checked_free_type_aliases lazy_type_alias feature gate to checked_free_type_aliases
|
HIR ty lowering was modified cc @fmease
cc @rust-lang/rust-analyzer This PR changes a file inside |
| let ty = tcx.type_of(def_id).instantiate_identity(); | ||
| let span = tcx.def_span(def_id); | ||
| if tcx.type_alias_is_lazy(def_id) { | ||
| if tcx.type_alias_is_free(def_id) { |
There was a problem hiding this comment.
All type aliases are free, that's their very nature. This function is returning (1) whether to check the type alias for well-formedness (2) whether to lower its use sites to an alias type instead of eagerly expanding them to the aliased type during HIR ty lowering.
This should probably say type_alias_is_checked.
If I split this feature into unchecked & checked in the future I guess I need to come up with a new way of expressing eager vs. lazy, maybe unretained vs. retained 🤔
| } | ||
| self.check_type_no_bounds(bounds, "this context"); | ||
|
|
||
| if self.features.lazy_type_alias() { |
There was a problem hiding this comment.
(Personally speaking, I'm voting for checked_type_aliases, cc #t-types/lazy-type-alias > name bikeshed @ 💬)
There was a problem hiding this comment.
There was a problem hiding this comment.
the poll is unanimous with renaming to checked_type_alias. I think I should be good with changing it along with renaming the test directory per #158758 (comment) to tests/ui/checked-type-alias/... (?) and this rename
I didn't vote in the poll as I didn't want to pretend I 100% fully understood everything haha
| #![feature(checked_free_type_aliases)] | ||
|
|
There was a problem hiding this comment.
Ideally, yes, since I named this directory after the feature name. It currently exercises both the "checkedness" and the "laziness" ("retainedness") of LTA.
| deny_since: None, | ||
| }, | ||
| Lint { | ||
| label: "lazy_type_alias", |
There was a problem hiding this comment.
Please do not change this file. It is auto-generated.
There was a problem hiding this comment.
Could you please remove the changes to this file completely, e.g., by interactive rebase-editing the commit 49c4377 or squashing commits rather than adding another commit undoing it?
We do sync this repository with rust-lang/rust-analyzer bidirectionally and the cleaner history helps it being done automatically without hassle 😄
|
Reminder, once the PR becomes ready for a review, use |
06051f4 to
e47a599
Compare
This comment has been minimized.
This comment has been minimized.
e47a599 to
d6a0757
Compare
This comment has been minimized.
This comment has been minimized.
d6a0757 to
c3cbfbe
Compare
This comment has been minimized.
This comment has been minimized.
c3cbfbe to
583deec
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
lazy_type_alias feature gate to checked_free_type_aliases lazy_type_alias feature gate to checked_type_aliases
6e62d29 to
a8d4284
Compare
|
@rustbot ready |
|
☔ The latest upstream changes (presumably #159293) made this pull request unmergeable. Please resolve the merge conflicts by rebasing. |
|
|
||
| ## `tests/ui/checked-type-alias/` | ||
|
|
||
| Tests for `#![feature(checked_type_aliases)]`. See [Tracking issue for lazy type aliases #112792](https://github.com/rust-lang/rust/issues/112792). |
There was a problem hiding this comment.
| Tests for `#![feature(checked_type_aliases)]`. See [Tracking issue for lazy type aliases #112792](https://github.com/rust-lang/rust/issues/112792). | |
| Tests for `#![feature(checked_type_aliases)]`. See [Tracking issue for checked type aliases](https://github.com/rust-lang/rust/issues/112792). |
|
also needs a rebase |
there's not an open issue for it, though happy to create one if desired, but this is the zulip thread. basically just did a cmd+shift+F on VSCode
r? @lcnr
cc: @BoxyUwU