about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2022-12-28Tweak wordingEsteban Küber-33/+77
2022-12-28Account for ADT bodies and struct expressionsEsteban Küber-0/+112
2022-12-28Detect diff markers in the parserEsteban Küber-0/+157
Partly address #32059.
2022-12-29docs/test: add UI test and long-form error docs for `E0519`Ezra Shaw-0/+17
2022-12-28Rollup merge of #105570 - Nilstrieb:actual-best-failure, r=compiler-errorsMatthias Krüger-0/+32
Properly calculate best failure in macro matching Previously, we used spans. This was not good. Sometimes, the span of the token that failed to match may come from a position later in the file which has been transcribed into a token stream way earlier in the file. If precisely this token fails to match, we think that it was the best match because its span is so high, even though other arms might have gotten further in the token stream. We now try to properly use the location in the token stream. This needs a little cleanup as the `best_failure` field is getting out of hand but it should be mostly good to go. I hope I didn't violate too many abstraction boundaries..
2022-12-28On unsized locals with explicit types suggest `&`Esteban Küber-0/+87
Fix #72742.
2022-12-28Add test for bad suggestionMichael Goulet-0/+29
2022-12-28Make trait/impl where clause mismatch on region error a bit more actionableMichael Goulet-3/+37
2022-12-28Rename `Rptr` to `Ref` in AST and HIRNilstrieb-4/+4
The name makes a lot more sense, and `ty::TyKind` calls it `Ref` already as well.
2022-12-28Auto merge of #106215 - matthiaskrgr:rollup-53r89ww, r=matthiaskrgrbors-211/+192
Rollup of 6 pull requests Successful merges: - #106028 (docs/test: add UI test and long-form error docs for `E0461`) - #106172 (Suggest `impl Iterator` when possible for `_` return type) - #106173 (Deduplicate `op` methods) - #106176 (Recover `fn` keyword as `Fn` trait in bounds) - #106194 (rustdoc: combine common sidebar background color CSS rules) - #106199 (Silence knock-down errors on `[type error]` bindings) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-28Improve heuristics whether `format_args` string is a source literalNilstrieb-1/+42
Previously, it only checked whether there was _a_ literal at the span of the first argument, not whether the literal actually matched up. This caused issues when a proc macro was generating a different literal with the same span. This requires an annoying special case for literals ending in `\n` because otherwise `println` wouldn't give detailed diagnostics anymore which would be bad.
2022-12-28Rollup merge of #106199 - estebank:quiet-type-err-in-binding, r=compiler-errorsMatthias Krüger-134/+70
Silence knock-down errors on `[type error]` bindings Fix #56036, fix #76589.
2022-12-28Rollup merge of #106176 - compiler-errors:fn-kw-as-fn-trait, r=estebankMatthias Krüger-74/+90
Recover `fn` keyword as `Fn` trait in bounds `impl fn()` -> `impl Fn()` Fixes #82515
2022-12-28Rollup merge of #106172 - estebank:suggest-impl-trait, r=compiler-errorsMatthias Krüger-3/+32
Suggest `impl Iterator` when possible for `_` return type Address #106096.
2022-12-28Auto merge of #106129 - compiler-errors:compare_method-tweaks, r=BoxyUwUbors-25/+4
Some `compare_method` tweaks 1. Make some of the comparison functions' names more regular 2. Reduce pub scope of some of the things in `compare_method` ~3. Remove some unnecessary opaque type handling code -- `InferCtxt` already is in a mode that doesn't define opaque types~ * moved to a different PR 4. Bubble up `ErrorGuaranteed` for region constraint errors in `compare_method` - Improves a redundant error message in one unit test. 5. Move the `compare_method` module to have a more general name, since it's more like `compare_impl_item` :) 6. Rename `collect_trait_impl_trait_tys`
2022-12-28Allow trait method paths to satisfy const Fn boundsDeadbeef-0/+61
2022-12-28Rollup merge of #106201 - estebank:verbose-transparent, r=compiler-errorsfee1-dead-0/+21
Emit fewer errors on invalid `#[repr(transparent)]` on `enum` Fix #68420.
2022-12-28Rollup merge of #105484 - nbdd0121:upcast, r=compiler-errorsfee1-dead-0/+93
Implement allow-by-default `multiple_supertrait_upcastable` lint The lint detects when an object-safe trait has multiple supertraits. Enabled in libcore and liballoc as they are low-level enough that many embedded programs will use them. r? `@nikomatsakis`
2022-12-28Rollup merge of #105347 - estebank:single-line-match, r=compiler-errorsfee1-dead-0/+15
Account for `match` expr in single line When encountering `match Some(42) { Some(x) => x, None => "" };`, output ``` error[E0308]: `match` arms have incompatible types --> f53.rs:2:52 | 2 | let _ = match Some(42) { Some(x) => x, None => "" }; | -------------- - ^^ expected integer, found `&str` | | | | | this is found to be of type `{integer}` | `match` arms have incompatible types ```
2022-12-28Rollup merge of #104024 - noeddl:unused-must-use, r=compiler-errorsfee1-dead-1/+1
Fix `unused_must_use` warning for `Box::from_raw`
2022-12-27Trim more paths in obligation typesEsteban Küber-7/+7
2022-12-27Emit fewer errors on invalid `#[repr(transparent)]` on `enum`Esteban Küber-0/+21
Fix #68420.
2022-12-27Silence knock-down errors on `[type error]` bindingsEsteban Küber-134/+70
Fix #56036, fix #76589.
2022-12-27Account for `match` expr in single lineEsteban Küber-0/+15
When encountering `match Some(42) { Some(x) => x, None => "" };`, output ``` error[E0308]: `match` arms have incompatible types --> f53.rs:2:52 | 2 | let _ = match Some(42) { Some(x) => x, None => "" }; | -------------- - ^^ expected integer, found `&str` | | | | | this is found to be of type `{integer}` | `match` arms have incompatible types ```
2022-12-27Shorten type in noteEsteban Küber-3/+3
2022-12-27Auto merge of #106193 - compiler-errors:rollup-0l54wka, r=compiler-errorsbors-8/+524
Rollup of 9 pull requests Successful merges: - #103718 (More inference-friendly API for lazy) - #105765 (Detect likely `.` -> `..` typo in method calls) - #105852 (Suggest rewriting a malformed hex literal if we expect a float) - #105965 (Provide local extern function arg names) - #106064 (Partially fix `explicit_outlives_requirements` lint in macros) - #106179 (Fix a formatting error in Iterator::for_each docs) - #106181 (Fix doc comment parsing description in book) - #106187 (Update the documentation of `Vec` to use `extend(array)` instead of `extend(array.iter().copied())`) - #106189 (Fix UnsafeCell Documentation Spelling Error) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-27Rollup merge of #106064 - lukas-code:outlives-macro, r=cjgillotMichael Goulet-8/+350
Partially fix `explicit_outlives_requirements` lint in macros Show the suggestion if and only if the bounds are from the same source context. fixes https://github.com/rust-lang/rust/issues/106044 fixes https://github.com/rust-lang/rust/issues/106063
2022-12-27Rollup merge of #105965 - compiler-errors:issue-105896, r=cjgillotMichael Goulet-0/+35
Provide local extern function arg names Fixes #105896
2022-12-27Rollup merge of #105852 - compiler-errors:hex-float-lit, r=cjgillotMichael Goulet-0/+61
Suggest rewriting a malformed hex literal if we expect a float Fixes #104706
2022-12-27Rollup merge of #105765 - estebank:range-typo, r=compiler-errorsMichael Goulet-0/+78
Detect likely `.` -> `..` typo in method calls Fix #65015.
2022-12-27Make resolve suggestion more genericEsteban Küber-1/+1
2022-12-27Auto merge of #97176 - kraktus:cmd_debug, r=the8472bors-21/+0
More verbose `Debug` implementation of `std::process:Command` Mainly based on commit: https://github.com/zackmdavis/rust/commit/ccc019aabfdd550944c049625e66c92c815ea1d0 from https://github.com/zackmdavis close https://github.com/rust-lang/rust/issues/42200
2022-12-27More testsMichael Goulet-0/+34
2022-12-27Restore cyclic closure messageMichael Goulet-16/+16
2022-12-27Don't deduce a signature that makes a closure cyclicMichael Goulet-16/+91
2022-12-27review comments: make suggestion more accurateEsteban Küber-20/+31
2022-12-27Provide local extern function arg namesMichael Goulet-0/+35
2022-12-27Suggest rewriting a malformed hex literal if we expect a floatMichael Goulet-0/+61
2022-12-27Rollup merge of #106066 - JohnTitor:rm-bindings-after-at-fixme, ↵Matthias Krüger-23/+75
r=compiler-errors Always suggest as `MachineApplicable` in `recover_intersection_pat` This resolves one FIXME in `recover_intersection_pat` by always applying `MachineApplicable` when suggesting, as `bindings_after_at` is now stable. This also separates a test to apply `// run-rustfix`. Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-27Rollup merge of #105994 - JohnTitor:issue-99647, r=compiler-errorsMatthias Krüger-0/+15
Add regression test for #99647 Closes #99647 r? `@compiler-errors` Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-27Rollup merge of #105817 - chenyukang:yukang/fix-105788-sugg-for-auto-trait, ↵Matthias Krüger-14/+5
r=TaKO8Ki Remove unreasonable help message for auto trait Fixes #105788
2022-12-27Fix ui constant tests for big-endian platformsUlrich Weigand-1130/+1716
A number of tests under ui/const-ptr and ui/consts are currently failing on big-endian platforms as the binary encoding of some constants is hard-coded in the stderr test files. Fix this by providing a normalize-stderr-test rule that strips out the raw bytes hex dump, so the comparison can be done in an endianness-independent manner. Note that in most cases, this means the tests are now also independent of word size, so the 32bit and 64bit cases can be re-unified. To keep tests that verify the details of those raw bytes dumps, a new test case raw-bytes.rs performs the tests where the hex dumps were stripped out a second time, but only on little- endian platforms. In addition, src/test/ui/const-ptr/forbidden_slices.rs exposes an endian-specific difference in this diagnostic output: constructing invalid value at .<deref>[0]: encountered 0x11, but expected a boolean depending on which byte of D0 is not a boolean value (0 or 1). Fixed this by choosing a value of D0 that differs from 0 or 1 in all bytes. Fixes part of https://github.com/rust-lang/rust/issues/105383.
2022-12-27Auto merge of #106177 - matthiaskrgr:rollup-oe7z8ix, r=matthiaskrgrbors-0/+100
Rollup of 4 pull requests Successful merges: - #105515 (Account for macros in const generics) - #106146 (Readme: update section on how to run `x.py`) - #106150 (Detect when method call on LHS might be shadowed) - #106174 (Remove unused empty CSS rules in ayu theme) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-27More verbose `Debug` implementation of `std::process:Command`kraktus-21/+0
based on commit: https://github.com/zackmdavis/rust/commit/ccc019aabfdd550944c049625e66c92c815ea1d0 from https://github.com/zackmdavis close https://github.com/rust-lang/rust/issues/42200 Add env variables and cwd to the shell-like debug output. Also use the alternate syntax to display a more verbose display, while not showing internal fields and hiding fields when they have their default value.
2022-12-27Rollup merge of #106150 - estebank:issue-39232, r=compiler-errorsMatthias Krüger-0/+94
Detect when method call on LHS might be shadowed Address #39232.
2022-12-27Rollup merge of #105515 - estebank:issue-104141, r=oli-obkMatthias Krüger-0/+6
Account for macros in const generics Fix #104141.
2022-12-27Auto merge of #106095 - estebank:pin-mut-reborrow, r=compiler-errorsbors-13/+146
Suggest `Pin::as_mut` when encountering borrow error Fix #65409 for `Pin<&mut T>`.
2022-12-27Fix some totally useless suggestionsMichael Goulet-12/+2
2022-12-27Dont clobber `as ..` rename in import suggestionMichael Goulet-2/+43
2022-12-27Recover `fn` keyword as `Fn` trait in boundsMichael Goulet-74/+90