Skip to content
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

check where-clause for explicit Sized before suggesting ?Sized #86455

Merged
merged 2 commits into from
Nov 16, 2021

Conversation

tlyu
Copy link
Contributor

@tlyu tlyu commented Jun 19, 2021

Fixes #85945.

Based on #86454.

@rustbot label +A-diagnostics +A-traits +A-typesystem +D-papercut +T-compiler

@rustbot rustbot added A-diagnostics Area: Messages for errors, warnings, and lints A-traits Area: Trait system A-typesystem Area: The type system D-papercut Diagnostics: An error or lint that needs small tweaks. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 19, 2021
@rust-highfive
Copy link
Collaborator

r? @estebank

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 19, 2021
@JohnCSimon JohnCSimon added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 6, 2021
@camelid camelid added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 23, 2021
@JohnCSimon JohnCSimon added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 15, 2021
@camelid camelid added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 2, 2021
Comment on lines 4 to 5
LL | fn foo<T>(_: &T) where T: Sized {}
| - required by this bound in `foo`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally this should point at the T: Sized span instead of where it was introduced, but it's ok either way.

@estebank
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Sep 16, 2021

📌 Commit 6beef88654189ae68026f3ba30f7edee95dc6562 has been approved by estebank

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 16, 2021
@bors
Copy link
Contributor

bors commented Sep 20, 2021

⌛ Testing commit 6beef88654189ae68026f3ba30f7edee95dc6562 with merge d508daa3f0dc774459a4045fe18b4502d3a63015...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Sep 20, 2021

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 20, 2021
@estebank
Copy link
Contributor

You will need to git rebase master on a recent master and re-run ./x.py test src/test/ui --bless.

@bors
Copy link
Contributor

bors commented Oct 2, 2021

☔ The latest upstream changes (presumably #89405) made this pull request unmergeable. Please resolve the merge conflicts.

@tlyu
Copy link
Contributor Author

tlyu commented Oct 8, 2021

Looks like there is also a recently introduced invariant that I'm breaking somehow. I haven't worked out the details yet.

@apiraino apiraino added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 21, 2021
@bors
Copy link
Contributor

bors commented Oct 26, 2021

🔒 Merge conflict

This pull request and the master branch diverged in a way that cannot be automatically merged. Please rebase on top of the latest master branch, and let the reviewer approve again.

How do I rebase?

Assuming self is your fork and upstream is this repository, you can resolve the conflict following these steps:

  1. git checkout check-where-before-suggesting-unsized (switch to your branch)
  2. git fetch upstream master (retrieve the latest master)
  3. git rebase upstream/master -p (rebase on top of it)
  4. Follow the on-screen instruction to resolve conflicts (check git status if you got lost).
  5. git push self check-where-before-suggesting-unsized --force-with-lease (update this PR)

You may also read Git Rebasing to Resolve Conflicts by Drew Blessing for a short tutorial.

Please avoid the "Resolve conflicts" button on GitHub. It uses git merge instead of git rebase which makes the PR commit history more difficult to read.

Sometimes step 4 will complete without asking for resolution. This is usually due to difference between how Cargo.lock conflict is handled during merge and rebase. This is normal, and you should still perform step 5 to update this PR.

Error message
Auto-merging compiler/rustc_typeck/src/collect.rs
CONFLICT (content): Merge conflict in compiler/rustc_typeck/src/collect.rs
Auto-merging compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
Auto-merging compiler/rustc_hir/src/hir.rs
warning: inexact rename detection was skipped due to too many files.
warning: you may want to set your merge.renamelimit variable to at least 2542 and retry the command.
Automatic merge failed; fix conflicts and then commit the result.

@JohnCSimon
Copy link
Member

Ping from triage:
@tlyu - Can you post your status on this PR?

@tlyu tlyu force-pushed the check-where-before-suggesting-unsized branch from 6beef88 to 1a50725 Compare November 16, 2021 04:32
@tlyu
Copy link
Contributor Author

tlyu commented Nov 16, 2021

Rebased, and also reblessed UI tests due to upstream changes.

@rustbot label -S-waiting-on-author +S-waiting-on-review

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 16, 2021
Comment on lines +10 to +14
note: required by a bound in `foo`
--> $DIR/issue-85945-check-where-clause-before-suggesting-unsized.rs:3:8
|
LL | fn foo<T>(_: &T) where T: Sized {}
| ^ required by this bound in `foo`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally this should point at the where clause.

@estebank
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Nov 16, 2021

📌 Commit 1a50725 has been approved by estebank

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 16, 2021
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Nov 16, 2021
…unsized, r=estebank

check where-clause for explicit `Sized` before suggesting `?Sized`

Fixes rust-lang#85945.

Based on rust-lang#86454.

`@rustbot` label +A-diagnostics +A-traits +A-typesystem +D-papercut +T-compiler
This was referenced Nov 16, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 16, 2021
Rollup of 8 pull requests

Successful merges:

 - rust-lang#86455 (check where-clause for explicit `Sized` before suggesting `?Sized`)
 - rust-lang#90801 (Normalize both arguments of `equate_normalized_input_or_output`)
 - rust-lang#90803 (Suggest `&str.chars()` on attempt to `&str.iter()`)
 - rust-lang#90819 (Fixes incorrect handling of TraitRefs when emitting suggestions.)
 - rust-lang#90910 (fix getting the discriminant of a zero-variant enum)
 - rust-lang#90925 (rustc_mir_build: reorder bindings)
 - rust-lang#90928 (Use a different server for checking clock drift)
 - rust-lang#90936 (Add a regression test for rust-lang#80772)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit ebef3ce into rust-lang:master Nov 16, 2021
@rustbot rustbot added this to the 1.58.0 milestone Nov 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-traits Area: Trait system A-typesystem Area: The type system D-papercut Diagnostics: An error or lint that needs small tweaks. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

before suggesting ?Sized, check where clause for explicit Sized
9 participants