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

librustc: Allow trait bounds on structures and enumerations, and check #16432

Closed
wants to merge 1 commit into from

Conversation

pcwalton
Copy link
Contributor

them during kind checking.

This implements RFC #11.

Closes #15759.

r? @nikomatsakis

ABar(int),
BBar(T),
CBar(uint),
}
Copy link
Member

Choose a reason for hiding this comment

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

Could you also add tests for these cases? (I think they're mentioned in the RFC as well)

struct Foo2<T> {
    x: Foo<T>, // error
}

impl<T> Foo<T> { } // error

fn foo<T>(f: Foo<T>) {} // error (with a generic T)

Copy link
Member

Choose a reason for hiding this comment

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

Could you also add some run-pass tests like the small ones mentioned in the RFC?

@nikomatsakis
Copy link
Contributor

Looks basically good modulo but that we need to check in type definitions (as I now see that @alexcrichton also pointed out). That should be a minor diff I believe. Let me know when it's ready and I'll review again quickly.

@pcwalton
Copy link
Contributor Author

@nikomatsakis re-r?

@pcwalton
Copy link
Contributor Author

@bors: retry

bors added a commit that referenced this pull request Aug 17, 2014
them during kind checking.

This implements RFC #11.

Closes #15759.

r? @nikomatsakis
@bors bors closed this Aug 17, 2014
matthiaskrgr pushed a commit to matthiaskrgr/rust that referenced this pull request Feb 11, 2024
fix: preserve where clause when builtin derive

Closes rust-lang#16432.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tracking RFC 11 - bounded struct typarams
4 participants