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

Add a suggestion when using a type alias instead of trait alias #83729

Merged
merged 2 commits into from
Apr 24, 2021

Conversation

JohnTitor
Copy link
Member

Fixes #43913

r? @estebank

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 31, 2021
@rust-log-analyzer

This comment has been minimized.

Comment on lines 38 to 39
or, if you want to use a trait alias, not a type alias, you should use
`#![feature(trait_alias)]`:
Copy link
Contributor

Choose a reason for hiding this comment

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

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)]`:

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, just applied your suggestion.

@rust-log-analyzer

This comment has been minimized.

@JohnCSimon JohnCSimon added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 18, 2021
@JohnTitor
Copy link
Member Author

@estebank Approving means r=you?

@Dylan-DPC-zz
Copy link

this looks fine to me, so assuming the approval to mean a r+, giving it a pass

@bors r=estebank rollup

@bors
Copy link
Contributor

bors commented Apr 20, 2021

📌 Commit eea27b8 has been approved by estebank

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 20, 2021
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Apr 20, 2021
Add a suggestion when using a type alias instead of trait alias

Fixes rust-lang#43913

r? `@estebank`
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Apr 20, 2021
Add a suggestion when using a type alias instead of trait alias

Fixes rust-lang#43913

r? ``@estebank``
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Apr 20, 2021
Add a suggestion when using a type alias instead of trait alias

Fixes rust-lang#43913

r? ```@estebank```
@bors
Copy link
Contributor

bors commented Apr 21, 2021

⌛ Testing commit eea27b8 with merge 3a5e0119313a0c45261e05e8ce9e826a9542ead9...

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Apr 22, 2021
Add a suggestion when using a type alias instead of trait alias

Fixes rust-lang#43913

r? ```@estebank```
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Apr 22, 2021
Add a suggestion when using a type alias instead of trait alias

Fixes rust-lang#43913

r? ````@estebank````
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Apr 22, 2021
Add a suggestion when using a type alias instead of trait alias

Fixes rust-lang#43913

r? `````@estebank`````
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Apr 23, 2021
Add a suggestion when using a type alias instead of trait alias

Fixes rust-lang#43913

r? ``````@estebank``````
@Dylan-DPC-zz
Copy link

likely failure of rollup

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 23, 2021
@JohnTitor
Copy link
Member Author

@Dylan-DPC Hm, why did you think it's related? I haven't figured out how the change here caused the failure.

@Dylan-DPC-zz
Copy link

@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 :)

@estebank
Copy link
Contributor

estebank commented Apr 23, 2021

Approving means r=you?

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?

@JohnTitor
Copy link
Member Author

Should we try r+ing this with rollup=never?

Let's try it.

@bors r=estebank rollup=never

@bors
Copy link
Contributor

bors commented Apr 23, 2021

📌 Commit eea27b8 has been approved by estebank

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 23, 2021
@bors
Copy link
Contributor

bors commented Apr 23, 2021

⌛ Testing commit eea27b8 with merge 8ad0821...

@bors
Copy link
Contributor

bors commented Apr 24, 2021

☀️ Test successful - checks-actions
Approved by: estebank
Pushing 8ad0821 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 24, 2021
@bors bors merged commit 8ad0821 into rust-lang:master Apr 24, 2021
@rustbot rustbot added this to the 1.53.0 milestone Apr 24, 2021
@JohnTitor JohnTitor deleted the issue-43913 branch April 24, 2021 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incomplete explanation of E0404
8 participants