Skip to content

Don't wf-check non-local RPITs #107038

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 3 commits into from
Jan 19, 2023

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Jan 18, 2023

We were using ty::is_impl_trait_defn(..).is_none() to check if we need to add WF obligations for an opaque type.

This is supposed to be checking if the type is a TAIT, since RPITs' wfness is implied by wf checking its parent item, but since is_impl_trait_defn returns None for non-local RPIT and async futures, we unnecessarily consider wf predicates for an RPIT if it is coming from a foreign crate.

Fixes #107036

r? @oli-obk but feel free to reassign

@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 Jan 18, 2023
@compiler-errors compiler-errors added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Jan 19, 2023
@compiler-errors compiler-errors force-pushed the dont-wfcheck-non-local-rpit branch from aa17359 to 9793abc Compare January 19, 2023 15:53
@compiler-errors
Copy link
Member Author

@compiler-errors compiler-errors added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Jan 19, 2023
@@ -404,6 +404,7 @@ define_tables! {
proc_macro: Table<DefIndex, MacroKind>,
module_reexports: Table<DefIndex, LazyArray<ModChild>>,
deduced_param_attrs: Table<DefIndex, LazyArray<DeducedParamAttrs>>,
is_type_alias_impl_trait: Table<DefIndex, LazyValue<bool>>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
is_type_alias_impl_trait: Table<DefIndex, LazyValue<bool>>,
is_type_alias_impl_trait: Table<DefIndex, ()>,

we usually don't encode false, and just use the lack of an entry for that

@oli-obk
Copy link
Contributor

oli-obk commented Jan 19, 2023

@bors r+ p=5

let's land this now and figure out the encoding nit later

@bors
Copy link
Collaborator

bors commented Jan 19, 2023

📌 Commit 9793abc has been approved by oli-obk

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 Jan 19, 2023
@compiler-errors
Copy link
Member Author

Encoding nit addressed

@bors r=oli-obk

@bors
Copy link
Collaborator

bors commented Jan 19, 2023

📌 Commit 7e0b1f1 has been approved by oli-obk

It is now in the queue for this repository.

Copy link
Member

@wesleywiser wesleywiser left a comment

Choose a reason for hiding this comment

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

Thanks for the quick turn around on this @compiler-errors!

@bors
Copy link
Collaborator

bors commented Jan 19, 2023

⌛ Testing commit 7e0b1f1 with merge 4c83bd0...

@bors
Copy link
Collaborator

bors commented Jan 19, 2023

☀️ Test successful - checks-actions
Approved by: oli-obk
Pushing 4c83bd0 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 19, 2023
@bors bors merged commit 4c83bd0 into rust-lang:master Jan 19, 2023
@rustbot rustbot added this to the 1.68.0 milestone Jan 19, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (4c83bd0): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.1% [-1.1%, -1.1%] 1
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
3.9% [3.9%, 3.9%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.7% [-1.7%, -1.7%] 1
All ❌✅ (primary) 3.9% [3.9%, 3.9%] 1

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
2.2% [2.0%, 2.5%] 4
Regressions ❌
(secondary)
4.3% [3.9%, 5.0%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.7% [-3.7%, -3.7%] 1
All ❌✅ (primary) 2.2% [2.0%, 2.5%] 4

@Mark-Simulacrum Mark-Simulacrum removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Jan 21, 2023
@Mark-Simulacrum Mark-Simulacrum modified the milestones: 1.68.0, 1.67.0 Jan 21, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 22, 2023
…mulacrum

[beta] backport

*  Don't wf-check non-local RPITs rust-lang#107038
* Revert "Make PROC_MACRO_DERIVE_RESOLUTION_FALLBACK a hard error" rust-lang#107133
* bump bootstrap 1.66.1

r? `@Mark-Simulacrum`
@compiler-errors compiler-errors deleted the dont-wfcheck-non-local-rpit branch August 11, 2023 19:59
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel. merged-by-bors This PR was explicitly merged by bors. 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]: Region parameter out of range when substituting in region 'a (index=2, substs = ['_#1r, '_#1r])
7 participants