-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Handle projections as uncovered types during coherence check #100555
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
Conversation
r? @oli-obk (rust-highfive has picked a reviewer for you, use r? to override) |
r? @lcnr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there are still 2 tests where the error messages aren't quite right
please fix the error messages for them and add them as additional tests
going to start a crater run for this
@bors try |
⌛ Trying commit ba88709461a684be5ef433e2da892492ebde60b0 with merge df0acfe6d8f079d1fdd8e6b7447569d81b00f126... |
☀️ Try build successful - checks-actions |
@craterbot check |
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
🎉 Experiment
|
ok, we have more regressions than I would like. Most of them look like they use fully concrete projections though, and these are fine. I see two ways forward here:
edit: The second approach sadly does not work, as even a local impl can use a type parameter as an associated type if it's used as in input. |
This comment has been minimized.
This comment has been minimized.
| | ||
LL | impl<T> Remote1<Box<T>> for u32 { | ||
| ^ type parameter `T` must be used as the type parameter for some local type | ||
| ^^^^^^ type parameter `T` must be used as the type parameter for some local type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lcnr This is one of the last (visual) kinks... I was able to detect the fundamental type for cases like impl<T> Remote for Box<T>
where the T
is at idx=0, and I can look at self_ty
which is a rustc_middle::Ty.
But in this case, I only have a hir::Ty
and can't figure out how it's a fundamental type from that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
urgh the link broke after rebase+force push, https://github.com/rust-lang/rust/pull/100555/files#diff-fddbd2e2a2a86430f2f013d5d787d7ad6c85427cd81a2282ac0fcc7d641733bc
🔔 This is now entering its final comment period, as per the review above. 🔔 |
@lcnr can you give a bit more details about the wasmer crate? I feel like we ought to reach out to them to discuss possible solutions, as that is a pretty broadly used crate. |
The root cause seems to be the This derive emits the following impl: #[derive(Deserialize, Archive)]
struct Foo<T>(T); impl<T, D> Deserialize<Foo<T>, D> for <Foo<T> as Archive>::Archived {
// ...
}
impl<T> Archive for Foo<T> {
type Assoc = LocalType;
} See https://gist.github.com/lcnr/75d99bd2900f9dd2eaa558b3c68c42e2 for the full (cleaned up) output. This could be adapted to pass the new orphan rules by switching the argument ordering of There are hacks which would only require a minor update of |
cc @djkoloski |
If I'm understanding this problem correctly, this could also be addressed by emitting a concrete |
yes, using the concrete type for the archive instead of an associated type works as well |
Great, I'll take action on rkyv/rkyv#289 and cut a new release as soon as possible. |
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. This will be merged soon. |
@atsuzaki could you rebase the PR and fix the conflict? I think we're ready to merge |
we still have to convert this to a future-compat lint before merging this, intend to meet with @atsuzaki to figure out how exactly this should be done |
Ping from triage: I'm closing this due to inactivity, Please reopen when you are ready to continue with this. @rustbot label: +S-inactive |
Normalize trait ref before orphan check & consider ty params in alias types to be uncovered Fixes rust-lang#99554, fixes rust-lang/types-team#104. Supersedes rust-lang#100555. r? lcnr
Lazily normalize inside trait ref during orphan check & consider ty params in rigid alias types to be uncovered Fixes rust-lang#99554, fixes rust-lang/types-team#104. Fixes rust-lang#114061. Supersedes rust-lang#100555. Tracking issue for the future compatibility lint: rust-lang#124559. r? lcnr
Fixes #99554. Update code to handle projections as uncovered types during coherence check/orphan check & update error messages accordingly.