Skip to content

Fix; correct placement of type inference error for method calls - #147398

Merged
bors merged 1 commit into
rust-lang:masterfrom
Jamesbarford:fix/method-call-type-inference-error
Oct 7, 2025
Merged

Fix; correct placement of type inference error for method calls#147398
bors merged 1 commit into
rust-lang:masterfrom
Jamesbarford:fix/method-call-type-inference-error

Conversation

@Jamesbarford

Copy link
Copy Markdown
Contributor

Addresses a FIXME for displaying errors on method calls;

Before;

error[E0282]: type annotations needed
--> /<location>/src/main.rs:48:15
|
## | e.is_conversion_error();
| ^^^^^^^^^^^^^^^^^^^ cannot infer type

After;

error[E0282]: type annotations needed
--> /<location>/src/main.rs:48:15
|
## | e.is_conversion_error();
| ^ cannot infer type

@rustbot

Copy link
Copy Markdown
Collaborator

This PR modifies tests/ui/issues/. If this PR is adding new tests to tests/ui/issues/,
please refrain from doing so, and instead add it to more descriptive subdirectories.

@rustbotrustbot 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 6, 2025
@rustbot

Copy link
Copy Markdown
Collaborator

r? @davidtwco

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

@Jamesbarford
Jamesbarfordforce-pushed the fix/method-call-type-inference-error branch from 43436a8 to c682a70CompareOctober 7, 2025 08:13
@chenyukang

Copy link
Copy Markdown
Member

could you please squash into one commit.

@Jamesbarford
Jamesbarfordforce-pushed the fix/method-call-type-inference-error branch from c682a70 to 43f7eaaCompareOctober 7, 2025 08:51
@chenyukang

Copy link
Copy Markdown
Member

r? chenyukang @bors r+ rollup

@bors

bors commented Oct 7, 2025

Copy link
Copy Markdown
Collaborator

📌 Commit 43f7eaa has been approved by chenyukang

It is now in the queue for this repository.

@rustbotrustbot assigned chenyukang and unassigned davidtwcoOct 7, 2025
@borsbors 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 7, 2025
Zalathar added a commit to Zalathar/rust that referenced this pull request Oct 7, 2025
…inference-error, r=chenyukang
Fix; correct placement of type inference error for method calls
Addresses a FIXME for displaying errors on method calls;
Before;
```
error[E0282]: type annotations needed
--> /<location>/src/main.rs:48:15
|
## | e.is_conversion_error();
| ^^^^^^^^^^^^^^^^^^^ cannot infer type
```
After;
```
error[E0282]: type annotations needed
--> /<location>/src/main.rs:48:15
|
## | e.is_conversion_error();
| ^ cannot infer type
```
@ZalatharZalathar mentioned this pull request Oct 7, 2025
bors added a commit that referenced this pull request Oct 7, 2025
Rollup of 7 pull requests
Successful merges:
- #143900 ([rustdoc] Correctly handle `should_panic` doctest attribute and fix `--no-run` test flag on the 2024 edition)
- #145608 (Prevent downstream `impl DerefMut for Pin<LocalType>`)
- #146865 (kcfi: only reify trait methods when dyn-compatible)
- #147390 (Use globals instead of metadata for std::autodiff)
- #147398 (Fix; correct placement of type inference error for method calls)
- #147431 (compiletest: Read the whole test file before parsing directives)
- #147433 (Fix doc comment)
r? `@ghost`
`@rustbot` modify labels: rollup
Zalathar added a commit to Zalathar/rust that referenced this pull request Oct 7, 2025
…inference-error, r=chenyukang
Fix; correct placement of type inference error for method calls
Addresses a FIXME for displaying errors on method calls;
Before;
```
error[E0282]: type annotations needed
--> /<location>/src/main.rs:48:15
|
## | e.is_conversion_error();
| ^^^^^^^^^^^^^^^^^^^ cannot infer type
```
After;
```
error[E0282]: type annotations needed
--> /<location>/src/main.rs:48:15
|
## | e.is_conversion_error();
| ^ cannot infer type
```
@ZalatharZalathar mentioned this pull request Oct 7, 2025
bors added a commit that referenced this pull request Oct 7, 2025
Rollup of 8 pull requests
Successful merges:
- #145608 (Prevent downstream `impl DerefMut for Pin<LocalType>`)
- #146865 (kcfi: only reify trait methods when dyn-compatible)
- #147205 (Add a new `wasm32-wasip3` target to Rust)
- #147390 (Use globals instead of metadata for std::autodiff)
- #147398 (Fix; correct placement of type inference error for method calls)
- #147422 (collect-license-metadata: Print a diff of the expected output)
- #147431 (compiletest: Read the whole test file before parsing directives)
- #147433 (Fix doc comment)
r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Oct 7, 2025
Rollup of 8 pull requests
Successful merges:
- #145608 (Prevent downstream `impl DerefMut for Pin<LocalType>`)
- #146865 (kcfi: only reify trait methods when dyn-compatible)
- #147205 (Add a new `wasm32-wasip3` target to Rust)
- #147390 (Use globals instead of metadata for std::autodiff)
- #147398 (Fix; correct placement of type inference error for method calls)
- #147422 (collect-license-metadata: Print a diff of the expected output)
- #147431 (compiletest: Read the whole test file before parsing directives)
- #147433 (Fix doc comment)
r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Oct 7, 2025
Rollup of 8 pull requests
Successful merges:
- #146865 (kcfi: only reify trait methods when dyn-compatible)
- #147205 (Add a new `wasm32-wasip3` target to Rust)
- #147322 (cg_llvm: Consistently import `llvm::Type` and `llvm::Value`)
- #147398 (Fix; correct placement of type inference error for method calls)
- #147410 (Update `S-waiting-on-team` refs to new `S-waiting-on-{team}` labels)
- #147422 (collect-license-metadata: Print a diff of the expected output)
- #147431 (compiletest: Read the whole test file before parsing directives)
- #147433 (Fix doc comment)
Failed merges:
- #147390 (Use globals instead of metadata for std::autodiff)
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit 0174900 into rust-lang:masterOct 7, 2025
10 checks passed
@rustbotrustbot added this to the 1.92.0 milestone Oct 7, 2025
rust-timer added a commit that referenced this pull request Oct 7, 2025
Rollup merge of #147398 - Jamesbarford:fix/method-call-type-inference-error, r=chenyukang
Fix; correct placement of type inference error for method calls
Addresses a FIXME for displaying errors on method calls;
Before;
```
error[E0282]: type annotations needed
--> /<location>/src/main.rs:48:15
|
## | e.is_conversion_error();
| ^^^^^^^^^^^^^^^^^^^ cannot infer type
```
After;
```
error[E0282]: type annotations needed
--> /<location>/src/main.rs:48:15
|
## | e.is_conversion_error();
| ^ cannot infer type
```
@Jamesbarford
Jamesbarford deleted the fix/method-call-type-inference-error branch October 8, 2025 07:17
github-actionsBot pushed a commit to model-checking/verify-rust-std that referenced this pull request Oct 9, 2025
…iaskrgr
Rollup of 8 pull requests
Successful merges:
- rust-lang#146865 (kcfi: only reify trait methods when dyn-compatible)
- rust-lang#147205 (Add a new `wasm32-wasip3` target to Rust)
- rust-lang#147322 (cg_llvm: Consistently import `llvm::Type` and `llvm::Value`)
- rust-lang#147398 (Fix; correct placement of type inference error for method calls)
- rust-lang#147410 (Update `S-waiting-on-team` refs to new `S-waiting-on-{team}` labels)
- rust-lang#147422 (collect-license-metadata: Print a diff of the expected output)
- rust-lang#147431 (compiletest: Read the whole test file before parsing directives)
- rust-lang#147433 (Fix doc comment)
Failed merges:
- rust-lang#147390 (Use globals instead of metadata for std::autodiff)
r? `@ghost`
`@rustbot` modify labels: rollup
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant 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.

5 participants

@Jamesbarford@rustbot@chenyukang@bors@davidtwco