-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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 help if implicitly required Sized
bounds can be relaxed.
#71790
Labels
A-lint
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
lcnr
changed the title
Add a help to implicitly required
Add a help if implicitly required May 2, 2020
Sized
bound in case it can be relaxed.Sized
bounds can be relaxed.
I would actually prefer if we add a lint for structs which implicitly require i.e. struct Struct<T> {
field: *const T,
}
// Overly strict implicit `Sized` bound, consider making this trait bound explicit:
struct Struct<T: ?Sized> {
field: *const T,
}
// or
struct Struct<T: Sized> {
field: *const T,
} |
jonas-schievink
added
A-diagnostics
Area: Messages for errors, warnings, and lints
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
May 2, 2020
estebank
added
the
A-lint
Area: Lints (warnings about flaws in source code) such as unused_mut.
label
Jun 17, 2020
#73261 addresses the diagnostics part of this ticket, but won't close it so that we can track the following
|
estebank
removed
the
A-diagnostics
Area: Messages for errors, warnings, and lints
label
Jun 17, 2020
Manishearth
added a commit
to Manishearth/rust
that referenced
this issue
Jun 19, 2020
…akis Suggest `?Sized` when applicable for ADTs Address rust-lang#71790, fix rust-lang#27964.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-lint
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Currently errors with
This seems to cause at least some confusion (see #71788)
When adding the "help: the trait
std::marker::Sized
is not implemented forSelf
",we can check if the implicit
Sized
bound is required forSelf
and if not, add"help: consider relaxing this trait bound" and recommend adding
?Sized
toT
.The text was updated successfully, but these errors were encountered: