-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Various fixes to trait alias feature #55994
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
400a7ad
to
6d33374
Compare
This comment has been minimized.
This comment has been minimized.
6d33374
to
abb21ad
Compare
I still want to improve error messages a bit, but this is nearly ready. Feel free to review. |
This comment has been minimized.
This comment has been minimized.
abb21ad
to
10c8e72
Compare
Ready for review and (hopefully) merge now, I think. |
This comment has been minimized.
This comment has been minimized.
10c8e72
to
ddb7ca3
Compare
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.
Looks great! Left one nit (on the test)
@bors r+ |
📌 Commit c180d7ce09bba0ab7c97365e2a1d1c33face2618 has been approved by |
☔ The latest upstream changes (presumably #55808) made this pull request unmergeable. Please resolve the merge conflicts. |
What on Earth... this didn't merge yet?! |
c180d7c
to
adbab16
Compare
This comment has been minimized.
This comment has been minimized.
adbab16
to
4fb40da
Compare
@bors r=nikomatsakis |
📌 Commit 4fb40da has been approved by |
174915c
to
d56ef2d
Compare
This comment has been minimized.
This comment has been minimized.
d56ef2d
to
14e8c6a
Compare
14e8c6a
to
d246b2c
Compare
@nikomatsakis Okay, finally reading for r+ I think! Linting has been removed; that will be addressed in a separated PR. |
☔ The latest upstream changes (presumably #56837) made this pull request unmergeable. Please resolve the merge conflicts. |
Ping from triage @alexreg : Have you been able to make any progress on this PR? |
@stokhos 2 and 4 have been factored out into a separate PR by @nikomatsakis (and merged), while he is still working on 1, because it's slightly non-trivial. 3 is postponed for now. Perhaps we should close this PR? |
Let's go ahead and close this PR, the relevant commits are in other branches by now. |
…nikomatsakis make trait-aliases work across crates This is rebase of a small part of @alexreg's PR rust-lang#55994. It focuses just on the changes that integrate trait aliases properly into crate metadata, excluding the stylistic edits and the trait objects. The stylistic edits I also rebased and can open a separate PR. The trait object stuff I found challenging and decided it basically needed to be reimplemented. For now I've excluded it. Since this is really @alexreg's work (I really just rebased) I am going to make it r=me once it is working. Fixes rust-lang#56488. Fixes rust-lang#57023.
…=oli-obk Ban multi-trait objects via trait aliases Obviously, multi-trait objects are not normally supported, so they should not be supported via trait aliases. This has been factored out from the previous PR #55994 (see point 1). r? @Centril CC @nikomatsakis
…=oli-obk Ban multi-trait objects via trait aliases Obviously, multi-trait objects are not normally supported, so they should not be supported via trait aliases. This has been factored out from the previous PR #55994 (see point 1). r? @Centril CC @nikomatsakis ------------------ ### RELNOTES: We now allow `dyn Send + fmt::Debug` with equivalent semantics to `dyn fmt::Debug + Send`. That is, the order of the mentioned traits does not matter wrt. principal/not-principal traits. This is a small change that might deserve a mention in the blog post because it is a language change but most likely not. See https://github.com/rust-lang/rust/blob/ce2ee305f9165c037ecddddb5792588a15ff6c37/src/test/ui/traits/wf-trait-object-reverse-order.rs. // @Centril
Disallows multiple regular traits in trait objects when trait aliases used, ensuring code like the following fails to compile.
Implemented cross-crate usage of trait aliases. They know get properly encoded and decoded in crate metadata. Added test.
Introduces the
DUPLICATE_AUTO_TRAITS_IN_BOUNDS
lint (warn-by-default).Added test for issue ICE with trait aliases and use items #56488. (Appears to be false positive.)
Issue fixes
unexpected definition: TraitAlias
#57023.INCOHERENT_AUTO_TRAIT_OBJECTS
future-compatibility warning #57059.CC @nikomatsakis @scalexm