Add a suggestion when using a type alias instead of trait alias#83729
Add a suggestion when using a type alias instead of trait alias#83729bors merged 2 commits intorust-lang:masterfrom
Conversation
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
I would change this to be something along the lines of
Alternatively, you could introduce a new trait with your desired restrictions as a super trait:
```
# trait Foo {}
# struct Bar;
# impl Foo for Bar {}
trait Qux: Foo {} // Anything that implements Qux also needs to implement Foo
fn baz<T: Qux>(t: T) {} // also ok!
```
Finally, if you are on nightly and want to use a trait alias instead of a type alias, you should use `#![feature(trait_alias)]`:
There was a problem hiding this comment.
Thanks, just applied your suggestion.
This comment has been minimized.
This comment has been minimized.
|
@estebank Approving means r=you? |
|
this looks fine to me, so assuming the approval to mean a r+, giving it a pass @bors r=estebank rollup |
|
📌 Commit eea27b8 has been approved by |
Add a suggestion when using a type alias instead of trait alias Fixes rust-lang#43913 r? `@estebank`
Add a suggestion when using a type alias instead of trait alias Fixes rust-lang#43913 r? ``@estebank``
Add a suggestion when using a type alias instead of trait alias Fixes rust-lang#43913 r? ```@estebank```
|
⌛ Testing commit eea27b8 with merge 3a5e0119313a0c45261e05e8ce9e826a9542ead9... |
Add a suggestion when using a type alias instead of trait alias Fixes rust-lang#43913 r? ```@estebank```
Add a suggestion when using a type alias instead of trait alias Fixes rust-lang#43913 r? ````@estebank````
Add a suggestion when using a type alias instead of trait alias Fixes rust-lang#43913 r? `````@estebank`````
Add a suggestion when using a type alias instead of trait alias Fixes rust-lang#43913 r? ``````@estebank``````
|
@Dylan-DPC Hm, why did you think it's related? I haven't figured out how the change here caused the failure. |
|
@JohnTitor i'm not sure, a few rollups have failed because of the same error, and this one seems to be one of the few that are common between them. I don't have time right now to investigate, but if you can find the culprit PR would be helpful :) |
It was meant as "r+ after addressing the comment". Sorry I didn't see the PR again since. Should we try r+ing this with rollup=never? |
Let's try it. @bors r=estebank rollup=never |
|
📌 Commit eea27b8 has been approved by |
|
☀️ Test successful - checks-actions |
Fixes #43913
r? @estebank