diff options
| author | Samuel Tardieu <sam@rfc1149.net> | 2025-04-10 05:51:39 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-10 05:51:39 +0000 |
| commit | 529bb5f2538c4d6ef294aaa1a31e45f264583dd9 (patch) | |
| tree | 5c1e484e016c4164bac84fd550ee930223281a45 /tests/rustdoc-js-std/parser-errors.js | |
| parent | e0e2a93cf2e36be513c36176d26f14ddb9f24002 (diff) | |
| parent | 0aa0d074cd1ce3f58eaffcf6019c1a236adc4dc1 (diff) | |
| download | rust-529bb5f2538c4d6ef294aaa1a31e45f264583dd9.tar.gz rust-529bb5f2538c4d6ef294aaa1a31e45f264583dd9.zip | |
Correctly handle bracketed type in `default_constructed_unit_struct` (#14367)
There were two bugs here. Let's assume `T` is a singleton type implementing `Default` and that `f()` takes a `T`: - `f(<T>::default())` cannot be replaced by `f(<T)` as it was (incorrect spans – this is tricky because the type relative path uses a base span covering only `T`, not `<T>`) (third commit) - The argument of `f(<_>::default())` is inferred correctly, but cannot be replaced by `<_>` or `_`, as this cannot be used to infer an instance of a singleton type (first commit). The second commit offers better error messages by pointing at the whole expression. Fix #12654 changelog: [`default_constructed_unit_struct`]: do not suggest incorrect fix when using a type surrounded by brackets
Diffstat (limited to 'tests/rustdoc-js-std/parser-errors.js')
0 files changed, 0 insertions, 0 deletions
