diff options
| author | Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> | 2023-08-03 21:43:17 +0200 |
|---|---|---|
| committer | Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> | 2023-08-04 13:17:39 +0200 |
| commit | 5706be1854db74d0aafcc4658423884689f139e9 (patch) | |
| tree | 5e4a3543de6a955d72ece8459d3e3353a05cc906 /tests/ui/issues/issue-40861.stderr | |
| parent | fcf3006e0133365ecd26894689c086387edcbecb (diff) | |
| download | rust-5706be1854db74d0aafcc4658423884689f139e9.tar.gz rust-5706be1854db74d0aafcc4658423884689f139e9.zip | |
Improve spans for indexing expressions
Indexing is similar to method calls in having an arbitrary left-hand-side and then something on the right, which is the main part of the expression. Method calls already have a span for that right part, but indexing does not. This means that long method chains that use indexing have really bad spans, especially when the indexing panics and that span in coverted into a panic location. This does the same thing as method calls for the AST and HIR, storing an extra span which is then put into the `fn_span` field in THIR.
Diffstat (limited to 'tests/ui/issues/issue-40861.stderr')
| -rw-r--r-- | tests/ui/issues/issue-40861.stderr | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/ui/issues/issue-40861.stderr b/tests/ui/issues/issue-40861.stderr index 84e38b9bb05..9b6469d05e9 100644 --- a/tests/ui/issues/issue-40861.stderr +++ b/tests/ui/issues/issue-40861.stderr @@ -1,8 +1,8 @@ error[E0608]: cannot index into a value of type `()` - --> $DIR/issue-40861.rs:4:5 + --> $DIR/issue-40861.rs:4:7 | LL | ()[f(&[1.0])]; - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^^ | = help: to access tuple elements, use tuple indexing syntax (e.g., `tuple.0`) |
