Use full expr span for return suggestion on type error/ambiguity by compiler-errors · Pull Request #127129 · rust-lang/rust
rustbot
added
S-waiting-on-review
labels
Jun 29, 2024
rustbot
added
S-waiting-on-author
and removed S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.labels
Jul 1, 2024
rustbot
added
S-waiting-on-review
and removed S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.labels
Jul 1, 2024
bors
added
S-waiting-on-bors
and removed S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.labels
Jul 1, 2024GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request
Jul 1, 2024…jieyouxu Use full expr span for return suggestion on type error/ambiguity We sometimes use parts of an expression rather than the whole thing for an obligation span. For example, a method obligation will just point to the path segment corresponding to the `method` in `rcvr.method(args)`. So let's not use that assuming it'll point to the *whole* expression span, which we can access from the expr hir id we store in `ObligationCauseCode::WhereClauseInExpr`. Fixes rust-lang#127109
bors added a commit to rust-lang-ci/rust that referenced this pull request
Jul 1, 2024…llaumeGomez Rollup of 7 pull requests Successful merges: - rust-lang#126753 (Add nightly style guide section for `precise_capturing` `use<>` syntax) - rust-lang#126880 (Migrate `volatile-intrinsics`, `weird-output-filenames`, `wasm-override-linker`, `wasm-exceptions-nostd` to `rmake`) - rust-lang#126941 (Migrate `run-make/llvm-ident` to `rmake.rs`) - rust-lang#127128 (Stabilize `duration_abs_diff`) - rust-lang#127129 (Use full expr span for return suggestion on type error/ambiguity) - rust-lang#127188 ( improve the way bootstrap handles rustlib components) - rust-lang#127201 (Improve run-make-support API) r? `@ghost` `@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request
Jul 1, 2024…llaumeGomez Rollup of 8 pull requests Successful merges: - rust-lang#126732 (Stabilize `PanicInfo::message()` and `PanicMessage`) - rust-lang#126753 (Add nightly style guide section for `precise_capturing` `use<>` syntax) - rust-lang#126832 (linker: Refactor interface for passing arguments to linker) - rust-lang#126880 (Migrate `volatile-intrinsics`, `weird-output-filenames`, `wasm-override-linker`, `wasm-exceptions-nostd` to `rmake`) - rust-lang#127128 (Stabilize `duration_abs_diff`) - rust-lang#127129 (Use full expr span for return suggestion on type error/ambiguity) - rust-lang#127188 ( improve the way bootstrap handles rustlib components) - rust-lang#127201 (Improve run-make-support API) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request
Jul 1, 2024Rollup merge of rust-lang#127129 - compiler-errors:full-expr-span, r=jieyouxu Use full expr span for return suggestion on type error/ambiguity We sometimes use parts of an expression rather than the whole thing for an obligation span. For example, a method obligation will just point to the path segment corresponding to the `method` in `rcvr.method(args)`. So let's not use that assuming it'll point to the *whole* expression span, which we can access from the expr hir id we store in `ObligationCauseCode::WhereClauseInExpr`. Fixes rust-lang#127109
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