-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NLL: User type annotations refactor, associated constant patterns and ref bindings. #55937
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
861c01e
to
711599a
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
052aedc
to
c3a9f4d
Compare
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Left one nit.
r=me once tests passed and comment is added
ef8f048
to
5069d62
Compare
Pushed the first version of this that does what it says on the tin. Will need a fresh review as a lot has changed. |
This comment has been minimized.
This comment has been minimized.
5069d62
to
d27f344
Compare
This comment has been minimized.
This comment has been minimized.
Added a fix for #55511 to this PR. Still seeing an ICE on three tests for the original fix, worked out that is due to this addition: But without that addition, the test change in |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
bde1f0d
to
874ebbe
Compare
Added a fix for #55401 too. Yet to look into the failures for the original PR issue. |
e73bf75
to
9cacc0c
Compare
This comment has been minimized.
This comment has been minimized.
I'm not sure I understand the fallout here.
With Indeed, matched value |
This exchanges a compilation error for a warning-but-future-error but at least it compiles now and I'm not exactly sure how to fix it without cloning those `METHOD` constants on every match (which is less than ideal, to say the least).
I filed #57280, as this seems like a bug (and a regression). |
Breakage was due to rust-lang#55937, which seemed to introduce a regression (tracked over at rust-lang#57280).
Changes: ```` Update Clippy Move TestFailures when collecting failures Update languageserver-types to 0.51.1 update clippy hash and rustc_tools_util and use rustc_tools_util from crates.io Work around rust-lang#55937 Update Clippy... again Update Clippy Update clippy ````
submodules: update clippy and rls Fixes clippy toolstate Changes: ```` Update to latest compiletest-rs release add testcase for #3462 deps: bump rustc_tools_util version from 0.1.0 to 0.1.1 just in case... rustc_tool_utils: fix failure to create proper non-repo version string when used in crates on crates.io, bump version UI test cleanup: Extract ifs_same_cond tests UI test cleanup: Extract for_kv_map lint tests Fix test for #57250 Limit infinite_iter collect() check to known types Some improvements to util documentation Use hashset for name blacklist Reformat random_state tests Use node_id_to_type_opt instead of node_it_to_type in random_state Check pattern equality while checking declaration equality random_state lint Use an FxHashSet for valid idents in documentation lint Fix suggestion for unnecessary_ref lint Update CONTRIBUTING.md for rustfix tests Update .fixed files via update-references.sh Run rustfix on first UI test Use WIP branch for compiletest_rs ```` Also updates RLS and removes the patching of rustc_tool_utils from cargo.toml RLS changes: ```` update clippy hash and rustc_tools_util and use rustc_tools_util from crates.io Work around #55937 Update Clippy... again Update Clippy Update clippy ```` r? @oli-obk
Changes: ```` Update Clippy Move TestFailures when collecting failures Update languageserver-types to 0.51.1 update clippy hash and rustc_tools_util and use rustc_tools_util from crates.io Work around rust-lang#55937 Update Clippy... again Update Clippy Update clippy ````
submodules: update clippy and rls Fixes clippy toolstate Changes: ```` Update to latest compiletest-rs release add testcase for #3462 deps: bump rustc_tools_util version from 0.1.0 to 0.1.1 just in case... rustc_tool_utils: fix failure to create proper non-repo version string when used in crates on crates.io, bump version UI test cleanup: Extract ifs_same_cond tests UI test cleanup: Extract for_kv_map lint tests Fix test for #57250 Limit infinite_iter collect() check to known types Some improvements to util documentation Use hashset for name blacklist Reformat random_state tests Use node_id_to_type_opt instead of node_it_to_type in random_state Check pattern equality while checking declaration equality random_state lint Use an FxHashSet for valid idents in documentation lint Fix suggestion for unnecessary_ref lint Update CONTRIBUTING.md for rustfix tests Update .fixed files via update-references.sh Run rustfix on first UI test Use WIP branch for compiletest_rs ```` Also updates RLS and removes the patching of rustc_tool_utils from cargo.toml RLS changes: ```` update clippy hash and rustc_tools_util and use rustc_tools_util from crates.io Work around #55937 Update Clippy... again Update Clippy Update clippy ```` r? @oli-obk
This commit fixes a bug introduced by rust-lang#55937 which started checking user type annotations for associated type patterns. Where lowering a associated constant expression would previously return a `PatternKind::Constant`, it now returns a `PatternKind::AscribeUserType` with a `PatternKind::Constant` inside, this commit unwraps that to access the constant pattern inside and behaves as before.
Lower constant patterns with ascribed types. Fixes #57960. This PR fixes a bug introduced by #55937 which started checking user type annotations for associated type patterns. Where lowering a associated constant expression would previously return a `PatternKind::Constant`, it now returns a `PatternKind::AscribeUserType` with a `PatternKind::Constant` inside, this PR unwraps that to access the constant pattern inside and behaves as before. r? @pnkfelix
This commit fixes a bug introduced by rust-lang#55937 which started checking user type annotations for associated type patterns. Where lowering a associated constant expression would previously return a `PatternKind::Constant`, it now returns a `PatternKind::AscribeUserType` with a `PatternKind::Constant` inside, this commit unwraps that to access the constant pattern inside and behaves as before.
Fixes #55511 and Fixes #55401. Contributes to #54943.
This PR performs a large refactoring on user type annotations, checks user type annotations for associated constants in patterns and that user type annotations for
ref
bindings are respected.r? @nikomatsakis