Skip to content

When mentioning that closure doesn't implement trait, point at closure - #164000

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
estebank:point-at-closure
Oct 9, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
estebank:point-at-closure

Conversation

@estebank

@estebank estebank commented Oct 8, 2026

Copy link
Copy Markdown
Contributor
error[E0277]: `{closure@$DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:33:19: 33:21}` is not an iterator
  --> $DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:34:14
   |
LL |     for _ in closure {}
   |              ^^^^^^^ `{closure@$DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:33:19: 33:21}` is not an iterator
   |
help: the trait `Iterator` is not implemented for closure `{closure@$DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:33:19: 33:21}`
  --> $DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:33:19
   |
LL |     let closure = || vec![1u8].into_iter();
   |                   ^^
   = note: required for `{closure@$DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:33:19: 33:21}` to implement `IntoIterator`
help: use parentheses to call this closure
   |
LL |     for _ in closure() {}
   |                     ++

```
error[E0277]: `{closure@$DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:33:19: 33:21}` is not an iterator
  --> $DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:34:14
   |
LL |     for _ in closure {}
   |              ^^^^^^^ `{closure@$DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:33:19: 33:21}` is not an iterator
   |
help: the trait `Iterator` is not implemented for closure `{closure@$DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:33:19: 33:21}`
  --> $DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:33:19
   |
LL |     let closure = || vec![1u8].into_iter();
   |                   ^^
   = note: required for `{closure@$DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:33:19: 33:21}` to implement `IntoIterator`
help: use parentheses to call this closure
   |
LL |     for _ in closure() {}
   |                     ++
```
@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 Oct 8, 2026
@rustbot

rustbot commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

r? @mati865

rustbot has assigned @mati865.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 77 candidates
  • Random selection from 19 candidates

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job test-pr-check-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
#15 2.461 Building wheels for collected packages: reuse
#15 2.461   Building wheel for reuse (pyproject.toml): started
#15 2.614   Building wheel for reuse (pyproject.toml): finished with status 'done'
#15 2.615   Created wheel for reuse: filename=reuse-4.0.3-cp310-cp310-linux_x86_64.whl size=132855 sha256=78b18759d7868af836e6c653035275b9564ead1e102ae69b3b788a82f243d193
#15 2.615   Stored in directory: /tmp/pip-ephem-wheel-cache-xup6cywu/wheels/3d/8d/0a/e0fc6aba4494b28a967ab5eaf951c121d9c677958714e34532
#15 2.617 Successfully built reuse
#15 2.617 Installing collected packages: boolean-py, binaryornot, tomlkit, reuse, python-debian, markupsafe, license-expression, jinja2, chardet, attrs
#15 2.885 Successfully installed attrs-23.2.0 binaryornot-0.4.4 boolean-py-4.0 chardet-5.2.0 jinja2-3.1.4 license-expression-30.3.0 markupsafe-2.1.5 python-debian-0.1.49 reuse-4.0.3 tomlkit-0.13.0
#15 2.886 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
#15 DONE 3.0s

@mati865 mati865 left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rust-bors

rust-bors Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

❌ Cannot approve commit 86a1b2f, because CI currently fails on this PR. Use @bors r+ force to override the PR CI check.

@mati865

This comment has been minimized.

@rust-bors

This comment has been minimized.

@mati865

mati865 commented Oct 9, 2026

Copy link
Copy Markdown
Member

@bors r+ force rollup

@rust-bors

rust-bors Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 86a1b2f has been approved by mati865

It is now in the queue for this repository.

Warning

This PR was force-approved despite failing PR CI.

@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 Oct 9, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 9, 2026
When mentioning that closure doesn't implement trait, point at closure

```
error[E0277]: `{closure@$DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:33:19: 33:21}` is not an iterator
  --> $DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:34:14
   |
LL |     for _ in closure {}
   |              ^^^^^^^ `{closure@$DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:33:19: 33:21}` is not an iterator
   |
help: the trait `Iterator` is not implemented for closure `{closure@$DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:33:19: 33:21}`
  --> $DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:33:19
   |
LL |     let closure = || vec![1u8].into_iter();
   |                   ^^
   = note: required for `{closure@$DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:33:19: 33:21}` to implement `IntoIterator`
help: use parentheses to call this closure
   |
LL |     for _ in closure() {}
   |                     ++
```
rust-bors Bot pushed a commit that referenced this pull request Oct 9, 2026
…uwer

Rollup of 4 pull requests

Successful merges:

 - #163666 (Updates the expect message library/core/src/time.rs)
 - #164000 (When mentioning that closure doesn't implement trait, point at closure)
 - #164007 ([rustdoc] Prefer local paths over remote ones when foreign item is locally reexported)
 - #164017 (cg_llvm: Avoid some explicit casts to `*const c_char`)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 9, 2026
When mentioning that closure doesn't implement trait, point at closure

```
error[E0277]: `{closure@$DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:33:19: 33:21}` is not an iterator
  --> $DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:34:14
   |
LL |     for _ in closure {}
   |              ^^^^^^^ `{closure@$DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:33:19: 33:21}` is not an iterator
   |
help: the trait `Iterator` is not implemented for closure `{closure@$DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:33:19: 33:21}`
  --> $DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:33:19
   |
LL |     let closure = || vec![1u8].into_iter();
   |                   ^^
   = note: required for `{closure@$DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:33:19: 33:21}` to implement `IntoIterator`
help: use parentheses to call this closure
   |
LL |     for _ in closure() {}
   |                     ++
```
rust-bors Bot pushed a commit that referenced this pull request Oct 9, 2026
…uwer

Rollup of 11 pull requests

Successful merges:

 - #162652 (Syntactically reject leading parenthesized precise capturing lists in bare trait object types (`(use<…>)+`))
 - #163337 (MIR move elimination [3/6]: PreciseLiveness)
 - #163954 (fix(bootstrap/darwin): fix rpath for distributed LLD)
 - #163956 (Pass the unremapped path to the `rustc` invocation for doctests)
 - #163634 (move overflow lint computation into decorator)
 - #163666 (Updates the expect message library/core/src/time.rs)
 - #163727 (rigid aliases to non-rigid for fully normalized check)
 - #163745 (replace `fully_monomorphized` with `cx.typing_env()`)
 - #164000 (When mentioning that closure doesn't implement trait, point at closure)
 - #164007 ([rustdoc] Prefer local paths over remote ones when foreign item is locally reexported)
 - #164017 (cg_llvm: Avoid some explicit casts to `*const c_char`)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 9, 2026
When mentioning that closure doesn't implement trait, point at closure

```
error[E0277]: `{closure@$DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:33:19: 33:21}` is not an iterator
  --> $DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:34:14
   |
LL |     for _ in closure {}
   |              ^^^^^^^ `{closure@$DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:33:19: 33:21}` is not an iterator
   |
help: the trait `Iterator` is not implemented for closure `{closure@$DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:33:19: 33:21}`
  --> $DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:33:19
   |
LL |     let closure = || vec![1u8].into_iter();
   |                   ^^
   = note: required for `{closure@$DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:33:19: 33:21}` to implement `IntoIterator`
help: use parentheses to call this closure
   |
LL |     for _ in closure() {}
   |                     ++
```
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 9, 2026
When mentioning that closure doesn't implement trait, point at closure

```
error[E0277]: `{closure@$DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:33:19: 33:21}` is not an iterator
  --> $DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:34:14
   |
LL |     for _ in closure {}
   |              ^^^^^^^ `{closure@$DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:33:19: 33:21}` is not an iterator
   |
help: the trait `Iterator` is not implemented for closure `{closure@$DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:33:19: 33:21}`
  --> $DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:33:19
   |
LL |     let closure = || vec![1u8].into_iter();
   |                   ^^
   = note: required for `{closure@$DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:33:19: 33:21}` to implement `IntoIterator`
help: use parentheses to call this closure
   |
LL |     for _ in closure() {}
   |                     ++
```
rust-bors Bot pushed a commit that referenced this pull request Oct 9, 2026
…uwer

Rollup of 14 pull requests

Successful merges:

 - #162652 (Syntactically reject leading parenthesized precise capturing lists in bare trait object types (`(use<…>)+`))
 - #163337 (MIR move elimination [3/6]: PreciseLiveness)
 - #163954 (fix(bootstrap/darwin): fix rpath for distributed LLD)
 - #163193 (cfi: mangle `f128` as `e` rather than `g` on platforms without `_Float128`)
 - #163634 (move overflow lint computation into decorator)
 - #163666 (Updates the expect message library/core/src/time.rs)
 - #163727 (rigid aliases to non-rigid for fully normalized check)
 - #163745 (replace `fully_monomorphized` with `cx.typing_env()`)
 - #163912 (Fix debug assert failure in `note_obligation_cause_code_inner`)
 - #163972 (const-eval: ICE when we hit a non-const fn)
 - #164000 (When mentioning that closure doesn't implement trait, point at closure)
 - #164007 ([rustdoc] Prefer local paths over remote ones when foreign item is locally reexported)
 - #164017 (cg_llvm: Avoid some explicit casts to `*const c_char`)
 - #164025 (Less `CanonicalVarValues`)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 9, 2026
When mentioning that closure doesn't implement trait, point at closure

```
error[E0277]: `{closure@$DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:33:19: 33:21}` is not an iterator
  --> $DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:34:14
   |
LL |     for _ in closure {}
   |              ^^^^^^^ `{closure@$DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:33:19: 33:21}` is not an iterator
   |
help: the trait `Iterator` is not implemented for closure `{closure@$DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:33:19: 33:21}`
  --> $DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:33:19
   |
LL |     let closure = || vec![1u8].into_iter();
   |                   ^^
   = note: required for `{closure@$DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:33:19: 33:21}` to implement `IntoIterator`
help: use parentheses to call this closure
   |
LL |     for _ in closure() {}
   |                     ++
```
rust-bors Bot pushed a commit that referenced this pull request Oct 9, 2026
…uwer

Rollup of 14 pull requests

Successful merges:

 - #162652 (Syntactically reject leading parenthesized precise capturing lists in bare trait object types (`(use<…>)+`))
 - #163337 (MIR move elimination [3/6]: PreciseLiveness)
 - #163954 (fix(bootstrap/darwin): fix rpath for distributed LLD)
 - #163193 (cfi: mangle `f128` as `e` rather than `g` on platforms without `_Float128`)
 - #163634 (move overflow lint computation into decorator)
 - #163666 (Updates the expect message library/core/src/time.rs)
 - #163727 (rigid aliases to non-rigid for fully normalized check)
 - #163745 (replace `fully_monomorphized` with `cx.typing_env()`)
 - #163912 (Fix debug assert failure in `note_obligation_cause_code_inner`)
 - #163950 (don't treat inherited opaques as defining)
 - #164000 (When mentioning that closure doesn't implement trait, point at closure)
 - #164007 ([rustdoc] Prefer local paths over remote ones when foreign item is locally reexported)
 - #164017 (cg_llvm: Avoid some explicit casts to `*const c_char`)
 - #164025 (Less `CanonicalVarValues`)
rust-bors Bot pushed a commit that referenced this pull request Oct 9, 2026
…uwer

Rollup of 24 pull requests

Successful merges:

 - #161998 ( Support type-relative assoc item paths in generic param defaults & const param types)
 - #162106 (Helpful suggestions for incorrect address-of mutability (2))
 - #162652 (Syntactically reject leading parenthesized precise capturing lists in bare trait object types (`(use<…>)+`))
 - #163337 (MIR move elimination [3/6]: PreciseLiveness)
 - #163938 (-Zassumptions-on-binders: rewrite alias outlives constraints more goodly)
 - #163939 (Better debug impls for some assumptions on binders types)
 - #163954 (fix(bootstrap/darwin): fix rpath for distributed LLD)
 - #163956 (Pass the unremapped path to the `rustc` invocation for doctests)
 - #164042 (Allow testing cg-gcc on any target)
 - #162443 (Do not retain `Normalization` goal errors in nested goals for `BestObligationVisitor:: non_trivial_candidates `)
 - #162908 (Fix - const parameters rejected when identical)
 - #163193 (cfi: mangle `f128` as `e` rather than `g` on platforms without `_Float128`)
 - #163634 (move overflow lint computation into decorator)
 - #163666 (Updates the expect message library/core/src/time.rs)
 - #163727 (rigid aliases to non-rigid for fully normalized check)
 - #163745 (replace `fully_monomorphized` with `cx.typing_env()`)
 - #163912 (Fix debug assert failure in `note_obligation_cause_code_inner`)
 - #163950 (don't treat inherited opaques as defining)
 - #163972 (const-eval: ICE when we hit a non-const fn)
 - #164000 (When mentioning that closure doesn't implement trait, point at closure)
 - #164007 ([rustdoc] Prefer local paths over remote ones when foreign item is locally reexported)
 - #164008 (properly ignore the current goal's usages)
 - #164017 (cg_llvm: Avoid some explicit casts to `*const c_char`)
 - #164025 (Less `CanonicalVarValues`)
@rust-bors
rust-bors Bot merged commit c8b148f into rust-lang:main Oct 9, 2026
3 of 14 checks passed
@rustbot rustbot added this to the 1.101.0 milestone Oct 9, 2026
rust-bors Bot pushed a commit that referenced this pull request Oct 9, 2026
Rollup merge of #164000 - estebank:point-at-closure, r=mati865

When mentioning that closure doesn't implement trait, point at closure

```
error[E0277]: `{closure@$DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:33:19: 33:21}` is not an iterator
  --> $DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:34:14
   |
LL |     for _ in closure {}
   |              ^^^^^^^ `{closure@$DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:33:19: 33:21}` is not an iterator
   |
help: the trait `Iterator` is not implemented for closure `{closure@$DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:33:19: 33:21}`
  --> $DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:33:19
   |
LL |     let closure = || vec![1u8].into_iter();
   |                   ^^
   = note: required for `{closure@$DIR/suggest-calling-fn-in-for-loop-issue-161564.rs:33:19: 33:21}` to implement `IntoIterator`
help: use parentheses to call this closure
   |
LL |     for _ in closure() {}
   |                     ++
```
bjorn3 pushed a commit to rust-lang/rustc_codegen_cranelift that referenced this pull request Oct 12, 2026
…uwer

Rollup of 24 pull requests

Successful merges:

 - rust-lang/rust#161998 ( Support type-relative assoc item paths in generic param defaults & const param types)
 - rust-lang/rust#162106 (Helpful suggestions for incorrect address-of mutability (2))
 - rust-lang/rust#162652 (Syntactically reject leading parenthesized precise capturing lists in bare trait object types (`(use<…>)+`))
 - rust-lang/rust#163337 (MIR move elimination [3/6]: PreciseLiveness)
 - rust-lang/rust#163938 (-Zassumptions-on-binders: rewrite alias outlives constraints more goodly)
 - rust-lang/rust#163939 (Better debug impls for some assumptions on binders types)
 - rust-lang/rust#163954 (fix(bootstrap/darwin): fix rpath for distributed LLD)
 - rust-lang/rust#163956 (Pass the unremapped path to the `rustc` invocation for doctests)
 - rust-lang/rust#164042 (Allow testing cg-gcc on any target)
 - rust-lang/rust#162443 (Do not retain `Normalization` goal errors in nested goals for `BestObligationVisitor:: non_trivial_candidates `)
 - rust-lang/rust#162908 (Fix - const parameters rejected when identical)
 - rust-lang/rust#163193 (cfi: mangle `f128` as `e` rather than `g` on platforms without `_Float128`)
 - rust-lang/rust#163634 (move overflow lint computation into decorator)
 - rust-lang/rust#163666 (Updates the expect message library/core/src/time.rs)
 - rust-lang/rust#163727 (rigid aliases to non-rigid for fully normalized check)
 - rust-lang/rust#163745 (replace `fully_monomorphized` with `cx.typing_env()`)
 - rust-lang/rust#163912 (Fix debug assert failure in `note_obligation_cause_code_inner`)
 - rust-lang/rust#163950 (don't treat inherited opaques as defining)
 - rust-lang/rust#163972 (const-eval: ICE when we hit a non-const fn)
 - rust-lang/rust#164000 (When mentioning that closure doesn't implement trait, point at closure)
 - rust-lang/rust#164007 ([rustdoc] Prefer local paths over remote ones when foreign item is locally reexported)
 - rust-lang/rust#164008 (properly ignore the current goal's usages)
 - rust-lang/rust#164017 (cg_llvm: Avoid some explicit casts to `*const c_char`)
 - rust-lang/rust#164025 (Less `CanonicalVarValues`)
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.

4 participants