Repository navigation
Use span context for enclosing item(s) of unmet bound - #163057
Merged
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
Point at item that introduced an unmet bound and in the case of associated items, their container (trait/impl), without using a span label. This adds bits of code to the diagnostic, without explicitly pointing to it.
```
error[E0277]: cannot add `<T as SubEncoder>::ActualSize` to `<T as SubEncoder>::ActualSize`
--> $DIR/issue-54108.rs:23:17
|
LL | type Size = <Self as SubEncoder>::ActualSize;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `<T as SubEncoder>::ActualSize + <T as SubEncoder>::ActualSize`
|
= help: the trait `Add` is not implemented for `<T as SubEncoder>::ActualSize`
note: required by a bound in `Encoder::Size`
--> $DIR/issue-54108.rs:8:16
|
LL | pub trait Encoder {
LL | type Size: Add<Output = Self::Size>;
| ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Encoder::Size`
```
estebank
force-pushed
the
required-bound-context
branch
from
September 20, 2026 17:36
522cd43 to
65dd911
Compare
This comment has been minimized.
This comment has been minimized.
oli-obk
approved these changes
Sep 21, 2026
Contributor
There was a problem hiding this comment.
oh yea, that redundant message annoyed me before, much better to just have context
@bors r+ rollup
Contributor
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Sep 21, 2026
…=oli-obk
Use span context for enclosing item(s) of unmet bound
Point at item that introduced an unmet bound and in the case of associated items, their container (trait/impl), without using a span label. This adds bits of code to the diagnostic, without explicitly pointing to it.
```
error[E0277]: cannot add `<T as SubEncoder>::ActualSize` to `<T as SubEncoder>::ActualSize`
--> $DIR/issue-54108.rs:23:17
|
LL | type Size = <Self as SubEncoder>::ActualSize;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `<T as SubEncoder>::ActualSize + <T as SubEncoder>::ActualSize`
|
= help: the trait `Add` is not implemented for `<T as SubEncoder>::ActualSize`
note: required by a bound in `Encoder::Size`
--> $DIR/issue-54108.rs:8:16
|
LL | pub trait Encoder {
LL | type Size: Add<Output = Self::Size>;
| ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Encoder::Size`
```
r? @oli-obk
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 21, 2026
…uwer Rollup of 6 pull requests Successful merges: - #163083 (Remove `G` generic param from `Diag<'_, G>`) - #160679 (Staticlib rename internal symbols: add COFF support) - #162007 (Preserve parentheses in raw borrow suggestions) - #163057 (Use span context for enclosing item(s) of unmet bound) - #163070 (label the path segment that is not an associated item of the trait) - #163078 ( Add a README in tests/rustdoc-html to explain what each folder content is for)
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 21, 2026
…uwer Rollup of 10 pull requests Successful merges: - #163083 (Remove `G` generic param from `Diag<'_, G>`) - #160679 (Staticlib rename internal symbols: add COFF support) - #160859 (`core::num::f16b` Rust's 16bit Brain Float) - #162007 (Preserve parentheses in raw borrow suggestions) - #162821 (Avoid suggesting closures when captures cross associated item boundaries) - #163057 (Use span context for enclosing item(s) of unmet bound) - #163070 (label the path segment that is not an associated item of the trait) - #163078 ( Add a README in tests/rustdoc-html to explain what each folder content is for) - #163107 (Implement Allocator for Pin unstably) - #163108 (remove old solver use of `SolverRelating`)
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 21, 2026
…uwer Rollup of 10 pull requests Successful merges: - #163083 (Remove `G` generic param from `Diag<'_, G>`) - #160679 (Staticlib rename internal symbols: add COFF support) - #160859 (`core::num::f16b` Rust's 16bit Brain Float) - #162007 (Preserve parentheses in raw borrow suggestions) - #162821 (Avoid suggesting closures when captures cross associated item boundaries) - #163057 (Use span context for enclosing item(s) of unmet bound) - #163070 (label the path segment that is not an associated item of the trait) - #163078 ( Add a README in tests/rustdoc-html to explain what each folder content is for) - #163107 (Implement Allocator for Pin unstably) - #163108 (remove old solver use of `SolverRelating`)
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 21, 2026
Rollup merge of #163057 - estebank:required-bound-context, r=oli-obk Use span context for enclosing item(s) of unmet bound Point at item that introduced an unmet bound and in the case of associated items, their container (trait/impl), without using a span label. This adds bits of code to the diagnostic, without explicitly pointing to it. ``` error[E0277]: cannot add `<T as SubEncoder>::ActualSize` to `<T as SubEncoder>::ActualSize` --> $DIR/issue-54108.rs:23:17 | LL | type Size = <Self as SubEncoder>::ActualSize; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `<T as SubEncoder>::ActualSize + <T as SubEncoder>::ActualSize` | = help: the trait `Add` is not implemented for `<T as SubEncoder>::ActualSize` note: required by a bound in `Encoder::Size` --> $DIR/issue-54108.rs:8:16 | LL | pub trait Encoder { LL | type Size: Add<Output = Self::Size>; | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Encoder::Size` ``` r? @oli-obk
github-actions Bot
pushed a commit
to rust-lang/rustc-dev-guide
that referenced
this pull request
Sep 21, 2026
…uwer Rollup of 10 pull requests Successful merges: - rust-lang/rust#163083 (Remove `G` generic param from `Diag<'_, G>`) - rust-lang/rust#160679 (Staticlib rename internal symbols: add COFF support) - rust-lang/rust#160859 (`core::num::f16b` Rust's 16bit Brain Float) - rust-lang/rust#162007 (Preserve parentheses in raw borrow suggestions) - rust-lang/rust#162821 (Avoid suggesting closures when captures cross associated item boundaries) - rust-lang/rust#163057 (Use span context for enclosing item(s) of unmet bound) - rust-lang/rust#163070 (label the path segment that is not an associated item of the trait) - rust-lang/rust#163078 ( Add a README in tests/rustdoc-html to explain what each folder content is for) - rust-lang/rust#163107 (Implement Allocator for Pin unstably) - rust-lang/rust#163108 (remove old solver use of `SolverRelating`)
bjorn3
pushed a commit
to rust-lang/rustc_codegen_cranelift
that referenced
this pull request
Sep 22, 2026
…uwer Rollup of 10 pull requests Successful merges: - rust-lang/rust#163083 (Remove `G` generic param from `Diag<'_, G>`) - rust-lang/rust#160679 (Staticlib rename internal symbols: add COFF support) - rust-lang/rust#160859 (`core::num::f16b` Rust's 16bit Brain Float) - rust-lang/rust#162007 (Preserve parentheses in raw borrow suggestions) - rust-lang/rust#162821 (Avoid suggesting closures when captures cross associated item boundaries) - rust-lang/rust#163057 (Use span context for enclosing item(s) of unmet bound) - rust-lang/rust#163070 (label the path segment that is not an associated item of the trait) - rust-lang/rust#163078 ( Add a README in tests/rustdoc-html to explain what each folder content is for) - rust-lang/rust#163107 (Implement Allocator for Pin unstably) - rust-lang/rust#163108 (remove old solver use of `SolverRelating`)
pull Bot
pushed a commit
to xtqqczze/rust-lang-miri
that referenced
this pull request
Sep 22, 2026
…uwer Rollup of 10 pull requests Successful merges: - rust-lang/rust#163083 (Remove `G` generic param from `Diag<'_, G>`) - rust-lang/rust#160679 (Staticlib rename internal symbols: add COFF support) - rust-lang/rust#160859 (`core::num::f16b` Rust's 16bit Brain Float) - rust-lang/rust#162007 (Preserve parentheses in raw borrow suggestions) - rust-lang/rust#162821 (Avoid suggesting closures when captures cross associated item boundaries) - rust-lang/rust#163057 (Use span context for enclosing item(s) of unmet bound) - rust-lang/rust#163070 (label the path segment that is not an associated item of the trait) - rust-lang/rust#163078 ( Add a README in tests/rustdoc-html to explain what each folder content is for) - rust-lang/rust#163107 (Implement Allocator for Pin unstably) - rust-lang/rust#163108 (remove old solver use of `SolverRelating`)
makai410
pushed a commit
to makai410/rust
that referenced
this pull request
Oct 1, 2026
…nathanBrouwer Rollup of 10 pull requests Successful merges: - rust-lang#163083 (Remove `G` generic param from `Diag<'_, G>`) - rust-lang#160679 (Staticlib rename internal symbols: add COFF support) - rust-lang#160859 (`core::num::f16b` Rust's 16bit Brain Float) - rust-lang#162007 (Preserve parentheses in raw borrow suggestions) - rust-lang#162821 (Avoid suggesting closures when captures cross associated item boundaries) - rust-lang#163057 (Use span context for enclosing item(s) of unmet bound) - rust-lang#163070 (label the path segment that is not an associated item of the trait) - rust-lang#163078 ( Add a README in tests/rustdoc-html to explain what each folder content is for) - rust-lang#163107 (Implement Allocator for Pin unstably) - rust-lang#163108 (remove old solver use of `SolverRelating`)
makai410
pushed a commit
to makai410/rustc_public
that referenced
this pull request
Oct 1, 2026
…uwer Rollup of 10 pull requests Successful merges: - rust-lang/rust#163083 (Remove `G` generic param from `Diag<'_, G>`) - rust-lang/rust#160679 (Staticlib rename internal symbols: add COFF support) - rust-lang/rust#160859 (`core::num::f16b` Rust's 16bit Brain Float) - rust-lang/rust#162007 (Preserve parentheses in raw borrow suggestions) - rust-lang/rust#162821 (Avoid suggesting closures when captures cross associated item boundaries) - rust-lang/rust#163057 (Use span context for enclosing item(s) of unmet bound) - rust-lang/rust#163070 (label the path segment that is not an associated item of the trait) - rust-lang/rust#163078 ( Add a README in tests/rustdoc-html to explain what each folder content is for) - rust-lang/rust#163107 (Implement Allocator for Pin unstably) - rust-lang/rust#163108 (remove old solver use of `SolverRelating`)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Point at item that introduced an unmet bound and in the case of associated items, their container (trait/impl), without using a span label. This adds bits of code to the diagnostic, without explicitly pointing to it.
r? @oli-obk