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

Always register sized obligation for argument #112643

Merged
merged 1 commit into from
Jun 23, 2023

Conversation

compiler-errors
Copy link
Member

Removes a "hack" that skips registering sized obligations for parameters that are simple identifiers. This doesn't seem to affect diagnostics because we're probably already being smart enough about deduplicating identical error messages anyways.

Fixes #112608

@rustbot
Copy link
Collaborator

rustbot commented Jun 15, 2023

r? @wesleywiser

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 15, 2023
@@ -15,22 +15,6 @@ help: function arguments must have a statically known size, borrowed types alway
LL | r: &dyn A + 'static
| +

error[E0277]: the size for values of type `(dyn A + 'static)` cannot be known at compilation time
Copy link
Member Author

Choose a reason for hiding this comment

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

This error goes away because we are now able to successfully deduplicate the duplicated sized obligation that results here.

I'm 99% sure that this is an implementation detail that has to do with the way that the ObligationForest stores and deduplicates the obligations that it knows it has processed already, and the way that the GatherLocalsVisitor registers Sized obligations for parameters. 😅

Copy link
Member

Choose a reason for hiding this comment

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

remove duplicate sized errors with this one simple trick (removing the hack to remove duplicate sized errors)

@wesleywiser
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jun 23, 2023

📌 Commit 0d6da78 has been approved by wesleywiser

It is now in the queue for this repository.

@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 Jun 23, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jun 23, 2023
… r=wesleywiser

Always register sized obligation for argument

Removes a "hack" that skips registering sized obligations for parameters that are simple identifiers. This doesn't seem to affect diagnostics because we're probably already being smart enough about deduplicating identical error messages anyways.

Fixes rust-lang#112608
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jun 23, 2023
… r=wesleywiser

Always register sized obligation for argument

Removes a "hack" that skips registering sized obligations for parameters that are simple identifiers. This doesn't seem to affect diagnostics because we're probably already being smart enough about deduplicating identical error messages anyways.

Fixes rust-lang#112608
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jun 23, 2023
… r=wesleywiser

Always register sized obligation for argument

Removes a "hack" that skips registering sized obligations for parameters that are simple identifiers. This doesn't seem to affect diagnostics because we're probably already being smart enough about deduplicating identical error messages anyways.

Fixes rust-lang#112608
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 23, 2023
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#112616 (Improve tests on targets without unwinding)
 - rust-lang#112643 (Always register sized obligation for argument)
 - rust-lang#112740 (Add link to rustdoc book search chapter in help popover)
 - rust-lang#112810 (Don't ICE on unnormalized struct tail in layout computation)
 - rust-lang#112870 (Migrate `item_bounds` to `ty::Clause`)
 - rust-lang#112925 (Stop hiding const eval limit in external macros)
 - rust-lang#112960 ([tests/rustdoc] Add `@files` command)
 - rust-lang#112962 (Fix rustdoc gui tester)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 27ae068 into rust-lang:master Jun 23, 2023
11 checks passed
@rustbot rustbot added this to the 1.72.0 milestone Jun 23, 2023
@compiler-errors compiler-errors deleted the sized-obl-for-arg branch August 11, 2023 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

ICE: "rust-call" ABI does not support unsized params
5 participants