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 encode RPITITs #109400

Closed
wants to merge 4 commits into from
Closed

Conversation

spastorino
Copy link
Member

@spastorino spastorino commented Mar 20, 2023

This fixes tests/ui/impl-trait/in-trait/foreign.rs because RPITIT's def_id on the trait side were not being encoded in some cases.

The only meaningful commit is d948d77
This is placed on top of #109277 but I'm not sure if that's needed, anyway #109277 is next in the queue.

r? @compiler-errors

@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 Mar 20, 2023
@spastorino
Copy link
Member Author

I've also blessed a test that was a known bug and it's now working with the refactor.

// [current] known-bug: #105197
// [current] failure-status:101
// [current] dont-check-compiler-stderr
// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
Copy link
Member

Choose a reason for hiding this comment

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

I am skeptical that this PR passes... I'll look into it though.

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, skeptical why this PR passes.

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 fails because we have no predicates_of for RPITITs. That doesn't seem right 🤔

Let's leave this as not updated currently?

@compiler-errors
Copy link
Member

I don't think this needs to be on top of #109277

// [current] known-bug: #105197
// [current] failure-status:101
// [current] dont-check-compiler-stderr
// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
Copy link
Member

Choose a reason for hiding this comment

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

Sorry, skeptical why this PR passes.

@@ -1,3 +1,6 @@
// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
// revisions: current next
Copy link
Member

Choose a reason for hiding this comment

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

ok I looked into it -- we don't need revisions here. We "inherit" the revisions from the parent. But it does inherit the revisions from the parent, so no extra file needed like in my other PR. Let me fix that.

Suggested change
// revisions: current next

Copy link
Member Author

Choose a reason for hiding this comment

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

we probably want the compile-flags anyway, I'd say.

Copy link
Member Author

Choose a reason for hiding this comment

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

In any case, feel free to close this PR and leave yours open that aggregates this stuff.

Copy link
Member

@compiler-errors compiler-errors Mar 20, 2023

Choose a reason for hiding this comment

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

Yes, the compile-flags is necessary to enable the -Z flag when [next], but re-declaring "// revisions" here does nothing, because the revisions is coming from the actual UI test (foreign.rs)

@rust-log-analyzer
Copy link
Collaborator

The job mingw-check failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
    Checking rustc_query_impl v0.0.0 (/checkout/compiler/rustc_query_impl)
    Checking rustc_ast_lowering v0.0.0 (/checkout/compiler/rustc_ast_lowering)
    Checking rustc_monomorphize v0.0.0 (/checkout/compiler/rustc_monomorphize)
    Checking rustc_smir v0.0.0 (/checkout/compiler/rustc_smir)
error[E0317]: `if` may be missing an `else` clause
    --> compiler/rustc_metadata/src/rmeta/encoder.rs:1049:21
     |
1049 | /                     if tcx.opt_rpitit_info(def_id.to_def_id()).is_some() {
     | |                         ---- found here
1051 | |                     }
     | |_____________________^ expected `bool`, found `()`
     |
     |
     = note: `if` expressions without `else` evaluate to `()`
     = help: consider adding an `else` block that evaluates to the expected type
For more information about this error, try `rustc --explain E0317`.
error: could not compile `rustc_metadata` due to previous error
warning: build failed, waiting for other jobs to finish...
error: could not compile `rustc_metadata` due to previous error

Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Mar 22, 2023
… r=spastorino

RPITITs are `DefKind::Opaque` with new lowering strategy

r? `@spastorino`

Kinda cherry-picked rust-lang#109400
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants