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

Defaulted type parameters generate invalid code #12

Closed
dtolnay opened this issue Mar 8, 2017 · 2 comments
Closed

Defaulted type parameters generate invalid code #12

dtolnay opened this issue Mar 8, 2017 · 2 comments

Comments

@dtolnay
Copy link
Contributor

dtolnay commented Mar 8, 2017

#[derive(Template)]
#[template(path = "test")]
struct Test<T: Display = u8> {
    t: T,
}
error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions.
   --> tests/simple.rs:119:10
    |
119 | #[derive(Template)]
    |          ^^^^^^^^
    |
    = note: #[deny(invalid_type_param_default)] on by default
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #36887 <https://github.com/rust-lang/rust/issues/36887>
@djc djc closed this as completed in ed89e5f Mar 8, 2017
@djc
Copy link
Collaborator

djc commented Mar 8, 2017

Nice. 😄 Anything else I've missed?

And, thanks again for helping out so much.

@dtolnay
Copy link
Contributor Author

dtolnay commented Mar 8, 2017

LGTM. Nicely done.

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

No branches or pull requests

2 participants