-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Account for bad placeholder types in where clauses #70294
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
r? @Centril |
0410eee
to
5af9042
Compare
5af9042
to
7c8fe98
Compare
@bors try @rust-timer queue |
Awaiting bors try build completion |
⌛ Trying commit 7c8fe98681ac93740c1c959f0b4951ad090034ee with merge 50962f2a2876523fc8f966266bee06123a5dcd3b... |
☀️ Try build successful - checks-azure |
Queued 50962f2a2876523fc8f966266bee06123a5dcd3b with parent 37c945d, future comparison URL. |
Finished benchmarking try commit 50962f2a2876523fc8f966266bee06123a5dcd3b, comparison URL. |
This as it stands doesn't handle |
@estebank does it ICE in that case? If not, then let's not fix it in this PR. |
It does ICE. Changing this to use |
@estebank Could we do the simple thing in this PR for backportability reasons and follow up with possible de-dup improvements? |
7c8fe98
to
b8bca24
Compare
I'm comfortable with the current state of the PR. |
if !inferred_params.is_empty() { | ||
// We always collect the spans for placeholder types when evaluating `fn`s, but we | ||
// only want to emit an error complaining about them if infer types (`_`) are not | ||
// allowed. `allow_ty_infer` gates this behavior. | ||
crate::collect::placeholder_type_error( | ||
tcx, | ||
inferred_params[0], | ||
&[], | ||
inferred_params, | ||
false, | ||
); | ||
} |
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.
Removing this got rid of the duplicated errors.
I am too, let's @bors r+ |
📌 Commit b8bca241cb7f372170bdc628ef2cdbc19f7d3f14 has been approved by |
b8bca24
to
e75158d
Compare
rustfmt an import 🤦♂️ @bors r=Centril |
📌 Commit e75158d has been approved by |
…r=Centril Account for bad placeholder types in where clauses Fix rust-lang#70291. Follow up to rust-lang#69148.
…r=Centril Account for bad placeholder types in where clauses Fix rust-lang#70291. Follow up to rust-lang#69148.
Rollup of 11 pull requests Successful merges: - rust-lang#67761 (Move the dep_graph construction to a dedicated crate.) - rust-lang#69740 (Replace some desc logic in librustc_lint with article_and_desc) - rust-lang#69981 (Evaluate repeat expression lengths as late as possible) - rust-lang#70087 (Remove const eval loop detector) - rust-lang#70242 (Improve E0308 error message wording) - rust-lang#70264 (Fix invalid suggestion on `&mut` iterators yielding `&` references) - rust-lang#70267 (get rid of ConstPropUnsupported; use ZST marker structs instead) - rust-lang#70277 (Remove `ReClosureBound`) - rust-lang#70283 (Add regression test for rust-lang#70155.) - rust-lang#70294 (Account for bad placeholder types in where clauses) - rust-lang#70309 (Clean up E0452 explanation) Failed merges: r? @ghost
…r=Centril Fix smaller issues with invalid placeholder type errors Follow up to rust-lang#70294. - Fix placement of suggested generic param when bounds are present. - Reduce error duplication for invalid placeholder types in `fn` types. r? @Centril
…r=Centril Fix smaller issues with invalid placeholder type errors Follow up to rust-lang#70294. - Fix placement of suggested generic param when bounds are present. - Reduce error duplication for invalid placeholder types in `fn` types. r? @Centril
Discussed in T-compiler meeting. Accepted for beta-backport. |
…ulacrum [beta] backport 4 PRs This backports the following PRs: * parse_and_disallow_postfix_after_cast: account for `ExprKind::Err`. rust-lang#70556 * Account for bad placeholder types in where clauses rust-lang#70294 * Fix "since" field for `Once::is_complete`'s `#[stable]` attribute rust-lang#70018 * Ensure HAS_FREE_LOCAL_NAMES is set for ReFree rust-lang#69956 All commits cherry picked cleanly.
Fix #70291. Follow up to #69148.