Skip to content

Conversation

marmeladema
Copy link
Contributor

Use ObligationClause::dummy() when appropriate or replace hir::DUMMY_HIR_IDby hir::CRATE_HIR_ID, as used in ObligationClause::dummy().

@rust-highfive
Copy link
Contributor

r? @davidtwco

(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 Apr 12, 2020
@marmeladema
Copy link
Contributor Author

cc @eddyb
Its a (small) attempt to reduce the usage of DUMMY_HIR_ID

cause: ObligationCause::misc(span, hir::DUMMY_HIR_ID),
cause: ObligationCause::misc(span, hir::CRATE_HIR_ID),
Copy link
Member

Choose a reason for hiding this comment

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

cc @nikomatsakis Is this a good way to encode this?

Copy link
Member

Choose a reason for hiding this comment

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

Oh this is what ObligationCause::dummy does, heh.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, i just "copied" what was done in dummy

Copy link
Member

@eddyb eddyb left a comment

Choose a reason for hiding this comment

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

r=me after it passes tests (when not broken, GHA PR CI is probably the thing to watch)

EDIT: oh this PR isn't a few minutes old, and it has already passed.

@eddyb
Copy link
Member

eddyb commented Apr 12, 2020

@bors r+ Thanks!

@bors
Copy link
Collaborator

bors commented Apr 12, 2020

📌 Commit 8f5605a71ad2d2c74b3b3120fbbe193561dca9bc has been approved by eddyb

@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 Apr 12, 2020
@eddyb
Copy link
Member

eddyb commented Apr 12, 2020

@bors rollup

@eddyb
Copy link
Member

eddyb commented Apr 12, 2020

@bors r- in case @marmeladema wants to add more commits to it, it's not like it's high up in the queue

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 12, 2020
@marmeladema marmeladema force-pushed the dummy-hir-id-obligation-clause branch from 8f5605a to 71d99b3 Compare April 12, 2020 20:01
@marmeladema marmeladema changed the title Remove usage of DUMMY_HIR_ID in calls to ObligationClause::misc Remove some usage of DUMMY_HIR_ID Apr 12, 2020
@marmeladema marmeladema force-pushed the dummy-hir-id-obligation-clause branch from 71d99b3 to 0634789 Compare April 12, 2020 20:02
Comment on lines -363 to +362
self.check_inline(DUMMY_HIR_ID, attr, &stmt.span, Target::Statement);
self.check_inline(l.hir_id, attr, &stmt.span, Target::Statement);
Copy link
Member

Choose a reason for hiding this comment

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

Heh this is a bugfix (#[allow] & friends will now work correctly).

@eddyb
Copy link
Member

eddyb commented Apr 12, 2020

@bors r+

@bors
Copy link
Collaborator

bors commented Apr 12, 2020

📌 Commit 0634789 has been approved by eddyb

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 12, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 12, 2020
Rollup of 4 pull requests

Successful merges:

 - rust-lang#67766 (Fix warning for unused variables in or pattern (issue rust-lang#67691))
 - rust-lang#71013 (Pass the `PlaceElem::Index` local to `visit_local`)
 - rust-lang#71064 (fix issue 69130)
 - rust-lang#71069 (Remove some usage of `DUMMY_HIR_ID`)

Failed merges:

r? @ghost
@bors bors merged commit 69862b7 into rust-lang:master Apr 13, 2020
@marmeladema marmeladema deleted the dummy-hir-id-obligation-clause branch April 24, 2021 09:12
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants