Uh oh!
There was an error while loading. Please reload this page.
wf-check generators - #97183
Conversation
This comment has been minimized.
This comment has been minimized.
cjgillot
commented
May 19, 2022
@oli-obk what's broken and how? |
oli-obk
commented
May 19, 2022
This PR checks predicates on generators at all use sites, so also if the generator is used in a different function than where it was defined (via impl trait). This breaks two async tests (see PR diff), even though they should be fine afaict. It looks like the async fn generated TAIT does not know about the predicates of the function, but it may be even subtler, not sure. If nothing is obvious to you, i'll dig in, just wanted to check whether this rang a bell for you |
cjgillot
commented
May 22, 2022
I have no idea what happens. From the test outputs, this looks more like an issue of missing predicates in the param_env, doesn't it? Lowering for async closures is just an expression, with nothing smart on the generic parameters. |
cjgillot
commented
May 22, 2022
|
oli-obk
commented
Jun 2, 2022
Blocked on #97607 |
bors
commented
Jun 8, 2022
☔ The latest upstream changes (presumably #97447) made this pull request unmergeable. Please resolve the merge conflicts. |
oli-obk
commented
Jun 14, 2022
#97607 has been resolved by stabilizing nll r? rust-lang/compiler |
bors
commented
Jun 20, 2022
☔ The latest upstream changes (presumably #97674) made this pull request unmergeable. Please resolve the merge conflicts. |
Uh oh!
There was an error while loading. Please reload this page.
oli-obk
commented
Jun 22, 2022
@rustbot review |
cjgillot
commented
Jun 26, 2022
r? rust-lang/types |
jackh726
commented
Jun 26, 2022
crater run, maybe? |
oli-obk
commented
Jun 27, 2022
@bors try |
bors
commented
Jun 27, 2022
⌛ Trying commit b394703ec62dd42d725e83381460e9281fdeb539 with merge 0f68263c719c986445acfdd2b05d69e200c95710... |
bors
commented
Jun 27, 2022
☀️ Try build successful - checks-actions |
oli-obk
commented
Jun 27, 2022
@craterbot check |
craterbot
commented
Jun 27, 2022
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
craterbot
commented
Jun 29, 2022
🎉 Experiment
|
oli-obk
commented
Jun 29, 2022
The only real regression is |
jackh726
left a comment
There was a problem hiding this comment.
The monoio "regression" should be added as a test.
There was a problem hiding this comment.
This error seems incorrect, given that there is a B: Bar bound on foo and we throw away bounds on type aliases.
There was a problem hiding this comment.
We do not throw away bounds on type alias impl trait though. Performing the suggested change will actually work.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Don't know if it's just me, but I'm having a difficult time actually figuring out what the problem here is...
There was a problem hiding this comment.
yea, but that's not a generator issue, closures would have the same issue.
Uh oh!
There was an error while loading. Please reload this page.
oli-obk
commented
Jul 11, 2022
it adds nothing new that isn't already covered by the existing tests |
oli-obk
commented
Jul 14, 2022
@rustbot review |
bors
commented
Jul 18, 2022
☔ The latest upstream changes (presumably #99137) made this pull request unmergeable. Please resolve the merge conflicts. |
jackh726
commented
Jul 18, 2022
I'm torn on if this needs types team FCP or not. I lean towards no, since this is imo a bug fix. But also can see a case for it. I can't imagine any reason why we wouldn't want to do this, so r=me after rebase |
oli-obk
commented
Jul 18, 2022
since it only affects unstable code, I think not @bors r=jackh726 |
bors
commented
Jul 18, 2022
wf-check generators fixesrust-lang#90409 We should not rely on generators being well formed by construction now that they can get used via type alias impl trait (and thus users can choose generic arguments that are invalid). This can cause surprising behaviour if (definitely unsound) transmutes are used, and it's generally saner to just check for well formedness.
Rollup of 8 pull requests Successful merges: - rust-lang#97183 (wf-check generators) - rust-lang#98320 (Mention first and last macro in backtrace) - rust-lang#99335 (Use split_once in FromStr docs) - rust-lang#99347 (Use `LocalDefId` in `OpaqueTypeKey`) - rust-lang#99392 (Fix debuginfo tests.) - rust-lang#99404 (Use span_bug for unexpected field projection type) - rust-lang#99410 (Update invalid atomic ordering lint) - rust-lang#99434 (Fix `Skip::next` for non-fused inner iterators) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
fixes#90409
We should not rely on generators being well formed by construction now that they can get used via type alias impl trait (and thus users can choose generic arguments that are invalid). This can cause surprising behaviour if (definitely unsound) transmutes are used, and it's generally saner to just check for well formedness.