-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
diagnostics: make implicit Sized bounds explicit in E0277 #150737
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
Conversation
|
r? @chenyukang rustbot has assigned @chenyukang. Use |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
7e3e3d8 to
f1b51ac
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This comment has been minimized.
This comment has been minimized.
|
Reverting to draft while I fix the tests. My apologies for the noise. |
This comment has been minimized.
This comment has been minimized.
e18e7d2 to
ec252cf
Compare
When a trait parameter depends upon Sized, the error message only referred to the full trait itself and didn't mention Sized. This makes the failure to implement Sized explicit. It also notes when the Sized trait bound is explicit or implicit.
ec252cf to
291d0a9
Compare
|
Fixed up the tests and dealt with the other warnings here. |
| | ^^^^^^ the trait `Sized` is not implemented for `[i32]` | ||
| | | ||
| = note: the trait bound `[i32]: IntoIterator` is not satisfied | ||
| = note: the trait bound `Sized` is not satisfied |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not blocking this PR:
I'm seems more reasonable than IntoIterator, but not sure whether this is helpful enough for Rust beginners.
maybe something like: the value of type [i32] cannot be iterated because it is unsized is better.
|
@bors r=chenyukang |
diagnostics: make implicit Sized bounds explicit in E0277 When a trait parameter depends upon Sized, the error message only referred to the full trait itself and didn't mention Sized. This makes the failure to implement Sized explicit. It also notes when the Sized trait bound is explicit or implicit. Fixes rust-lang#150576
diagnostics: make implicit Sized bounds explicit in E0277 When a trait parameter depends upon Sized, the error message only referred to the full trait itself and didn't mention Sized. This makes the failure to implement Sized explicit. It also notes when the Sized trait bound is explicit or implicit. Fixes rust-lang#150576
…uwer Rollup of 13 pull requests Successful merges: - #150586 (rustdoc: Fix intra-doc link bugs involving type aliases and associated items) - #150677 (Improve std::path::Path::join documentation) - #150723 (std: move `errno` and related functions into `sys::io`) - #150737 (diagnostics: make implicit Sized bounds explicit in E0277) - #150771 (Remove legacy homu `try` and `auto` branch mentions) - #150915 (Regression test for type params on eii) - #150962 (Remove `FeedConstTy` and provide ty when lowering const arg) - #151017 (Port the rustc dump attributes to the attribute parser) - #151019 (Make `Type::of` support unsized types) - #151034 (std: Change UEFI env vars to volatile storage) - #151052 (ui: add regression test for macro resolution ICE (issue #150711)) - #151053 (Reduce flakyness for `tests/rustdoc-gui/notable-trait.goml`) - #151055 (Emit error instead of delayed bug when meeting mismatch type for const array) r? @ghost
diagnostics: make implicit Sized bounds explicit in E0277 When a trait parameter depends upon Sized, the error message only referred to the full trait itself and didn't mention Sized. This makes the failure to implement Sized explicit. It also notes when the Sized trait bound is explicit or implicit. Fixes rust-lang#150576
Rollup of 13 pull requests Successful merges: - #150587 (triagebot: add A-rustdoc-js autolabel) - #150677 (Improve std::path::Path::join documentation) - #150737 (diagnostics: make implicit Sized bounds explicit in E0277) - #150771 (Remove legacy homu `try` and `auto` branch mentions) - #150840 (Make `--print=check-cfg` output compatible `--check-cfg` arguments) - #150915 (Regression test for type params on eii) - #151017 (Port the rustc dump attributes to the attribute parser) - #151019 (Make `Type::of` support unsized types) - #151031 (Support arrays in type reflection) - #151043 (armv7-unknown-linux-uclibceabihf.md: Fix bootstrap.toml syntax) - #151052 (ui: add regression test for macro resolution ICE (issue #150711)) - #151053 (Reduce flakyness for `tests/rustdoc-gui/notable-trait.goml`) - #151055 (Emit error instead of delayed bug when meeting mismatch type for const array) r? @ghost
Rollup merge of #150737 - smithdb3/fix-150576, r=chenyukang diagnostics: make implicit Sized bounds explicit in E0277 When a trait parameter depends upon Sized, the error message only referred to the full trait itself and didn't mention Sized. This makes the failure to implement Sized explicit. It also notes when the Sized trait bound is explicit or implicit. Fixes #150576
When a trait parameter depends upon Sized, the error message only referred to the full trait itself and didn't mention Sized. This makes the failure to implement Sized explicit. It also notes when the Sized trait bound is explicit or implicit.
Fixes #150576