Skip to content

Conversation

@Daniel-B-Smith
Copy link
Contributor

@Daniel-B-Smith Daniel-B-Smith commented Jan 6, 2026

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

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 6, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 6, 2026

r? @chenyukang

rustbot has assigned @chenyukang.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rustbot
Copy link
Collaborator

rustbot commented Jan 7, 2026

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.

@rustbot

This comment has been minimized.

@rustbot rustbot added has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 7, 2026
@Daniel-B-Smith
Copy link
Contributor Author

Reverting to draft while I fix the tests. My apologies for the noise.

@Daniel-B-Smith Daniel-B-Smith marked this pull request as draft January 7, 2026 16:33
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 7, 2026
@rust-log-analyzer

This comment has been minimized.

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.
@Daniel-B-Smith Daniel-B-Smith marked this pull request as ready for review January 8, 2026 23:21
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. has-merge-commits PR has merge commits, merge with caution. labels Jan 8, 2026
@Daniel-B-Smith
Copy link
Contributor Author

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
Copy link
Member

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.

@chenyukang
Copy link
Member

@bors r=chenyukang

@rust-bors rust-bors bot 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 Jan 13, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 13, 2026

📌 Commit 291d0a9 has been approved by chenyukang

It is now in the queue for this repository.

JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jan 13, 2026
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
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jan 13, 2026
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
rust-bors bot pushed a commit that referenced this pull request Jan 13, 2026
…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
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jan 13, 2026
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
rust-bors bot pushed a commit that referenced this pull request Jan 14, 2026
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
@rust-bors rust-bors bot merged commit 6c700ec into rust-lang:main Jan 14, 2026
11 checks passed
@rustbot rustbot added this to the 1.94.0 milestone Jan 14, 2026
rust-timer added a commit that referenced this pull request Jan 14, 2026
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unsatisfied implicit trait bound is not made explicit in E0277

4 participants