about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2023-01-04Rollup merge of #106200 - compiler-errors:suggest-impl-trait, r=estebankMatthias Krüger-5/+121
Suggest `impl Fn*` and `impl Future` in `-> _` return suggestions Follow-up to #106172, only the last commit is relevant. Can rebase once that PR is landed for easier review. Suggests `impl Future` and `impl Fn{,Mut,Once}` in `-> _` return suggestions. r? `@estebank`
2023-01-04Auto merge of #104376 - compiler-errors:thin-metadata-implies-thin-ptr, ↵bors-0/+11
r=wesleywiser layout_of: `T: Thin` implies `sizeof(&T) == sizeof(usize)` Use the `<T as Pointee>::Metadata` associated type to calculate the layout of a pointee's metadata, instead of hard-coding rules about certain types. Maybe this approach is overkill -- we could instead hard-code this approach as a fallback, with the matching on `Slice`/`Dynamic`/etc. happening first Fixes this issue here https://github.com/rust-lang/rust/pull/104338#issuecomment-1312595844 .. But is also useful with transmutes, for example, given the UI test I added below.
2023-01-04Auto merge of #106432 - compiler-errors:rollup-lzj0lnp, r=compiler-errorsbors-26/+33
Rollup of 8 pull requests Successful merges: - #104748 (Ensure `lld` is supported with `download-ci-llvm`) - #105541 (Simplify some iterator combinators) - #106045 (default OOM handler: use non-unwinding panic, to match std handler) - #106157 (Don't trim path for `unsafe_op_in_unsafe_fn` lints) - #106353 (Reduce spans for `unsafe impl` errors) - #106381 (Jsondoclint: Add `--verbose` and `--json-output` options) - #106411 (rustdoc: remove legacy font-feature-settings CSS) - #106414 (Add cuviper to the review rotation for libs) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-01-03Rollup merge of #106353 - lukas-code:reduce-red-lines-in-my-ide, r=wesleywiserMichael Goulet-26/+12
Reduce spans for `unsafe impl` errors Because huge spans aren't great for IDEs. Prior art: https://github.com/rust-lang/rust/pull/103749
2023-01-03Rollup merge of #106157 - ↵Michael Goulet-0/+21
LeSeulArtichaut:106126-thir-unsafeck-good-path-bug-2, r=compiler-errors Don't trim path for `unsafe_op_in_unsafe_fn` lints Fixes #106126, alternative to #106127. r? `@ghost` for now.
2023-01-04layout_of: `T: Thin` implies `sizeof(&T) == sizeof(usize)`Michael Goulet-0/+11
2023-01-04Restore Fn trait noteMichael Goulet-2/+14
2023-01-03Suggest more impl Trait on `-> _`Michael Goulet-7/+111
2023-01-03Auto merge of #105712 - amg98:feat/vita-support, r=wesleywiserbors-1/+1
PlayStation Vita support Just the compiler definitions for no-std projects and std support using newlib Earlier PR: https://github.com/rust-lang/rust/pull/105606
2023-01-03Add note about wrapping in braceskadmin-0/+51
Previously it was not clear why this errored or if it was even supported, as there was no diagnostic that suggested wrapping it in braces. Thus, add a simple diagnostic that suggests wrapping enum variants in braces.
2023-01-03Rollup merge of #106365 - gimbles:patch-1, r=jyn514Matthias Krüger-10/+10
Grammar : Missing "is" in format specifier diagnostic
2023-01-03Rollup merge of #106005 - LeSeulArtichaut:if-let-guard-borrowck-test, ↵Matthias Krüger-62/+645
r=Nilstrieb Test the borrowck behavior of if-let guards Add some tests to make sure that if-let guards behave the same as if guards with respect to borrow-checking. Most of them are a naive adaptation, replacing an `if` guard with `if let Some(())`. This includes regression tests for notable issues that arose for if guards (#24535, #27282, #29723, #31287) as suggested in https://github.com/rust-lang/rust/issues/51114#issuecomment-900470419. cc `@pnkfelix` are there any other tests that you would want to see? cc tracking issue #51114
2023-01-03Don't trim path for `unsafe_op_in_unsafe_fn` lintsLéo Lanteri Thauvin-0/+21
2023-01-02Reduce HIR debug outputNilstrieb-6/+1
HIR debug output is currently very verbose, especially when used with the alternate (`#`) flag. This commit reduces the amount of noisy newlines by forcing a few small key types to stay on one line, which makes the output easier to read and scroll by. ``` $ rustc +after hello_world.rs -Zunpretty=hir-tree | wc -l 582 $ rustc +before hello_world.rs -Zunpretty=hir-tree | wc -l 932 ```
2023-01-02Print correct base for too-large literalsclubby789-24/+70
Also update tests
2023-01-02maybegimbles-10/+10
2023-01-02Auto merge of #106284 - estebank:merge-mut-errors, r=jyn514bors-226/+435
Merge multiple mutable borrows of immutable binding errors Fix #53466.
2023-01-01Verbose suggestionsEsteban Küber-185/+360
2023-01-01Implement fix for #67535Troy Neubauer-0/+61
2023-01-01Use the correct tracking issue for `dyn_star`Léo Lanteri Thauvin-10/+10
2023-01-01Merge multiple mutable borrows of immutable binding errorsEsteban Küber-53/+87
Fix #53466.
2023-01-01reduce spans for `unsafe impl` errorsLukas Markeffsky-26/+12
2022-12-31Auto merge of #106282 - Ezrashaw:merge-e0465, r=estebankbors-24/+24
refactor: merge error code `E0465` into `E0464` `E0465` is an undocumented and untested error code that is functionally identical to `E0464`. This PR merges `E0465` into `E0464`, thus documenting and testing another error code (#61137). r? `@GuillaumeGomez` (not sure if you want to review this but it's relevant to my other PRs that you have reviewed)
2022-12-31Auto merge of #106302 - compiler-errors:terr-coerce-w-infer, r=estebankbors-72/+31
Suppress errors due to TypeError not coercing with inference variables Fixes #75331 Fixes #68507 Fixes #82323 cc `@estebank`
2022-12-31Auto merge of #106245 - estebank:mutability-suggestions, r=jyn514bors-160/+326
Use verbose suggestions for mutability errors
2022-12-31refactor: merge `E0465` into `E0464`Ezra Shaw-24/+24
2022-12-30Rollup merge of #106248 - dtolnay:revertupcastlint, r=jackh726Michael Goulet-93/+9
Revert "Implement allow-by-default `multiple_supertrait_upcastable` lint" This is a clean revert of #105484. I confirmed that reverting that PR fixes the regression reported in #106247. ~~I can't say I understand what this code is doing, but maybe it can be re-landed with a different implementation.~~ **Edit:** https://github.com/rust-lang/rust/issues/106247#issuecomment-1367174384 has an explanation of why #105484 ends up surfacing spurious `where_clause_object_safety` errors. The implementation of `where_clause_object_safety` assumes we only check whether a trait is object safe when somebody actually uses that trait with `dyn`. However the implementation of `multiple_supertrait_upcastable` added in the problematic PR involves checking *every* trait for whether it is object-safe. FYI `@nbdd0121` `@compiler-errors`
2022-12-30Add ui test for #106182Obei Sideg-0/+46
2022-12-30Fix incorrect suggestion for extra `&` in patternObei Sideg-3/+2
see #106182
2022-12-30Suppress errors due to TypeError not coercing with inference variablesMichael Goulet-72/+31
2022-12-30Regression test for issue 106247Gary Guo-0/+9
2022-12-30Add regression test for #105501Arpad Borsos-0/+165
The test was minified from the published `msf-ice:0.2.1` crate which failed in a crater run. A faulty compiler was triggering a `higher-ranked lifetime error`: > could not prove `[async block@...]: Send`
2022-12-30Auto merge of #106210 - fee1-dead-contrib:const-closure-trait-method, ↵bors-0/+61
r=compiler-errors Allow trait method paths to satisfy const Fn bounds r? `@oli-obk`
2022-12-29Auto merge of #106266 - matthiaskrgr:rollup-cxrdbzy, r=matthiaskrgrbors-43/+114
Rollup of 9 pull requests Successful merges: - #104531 (Provide a better error and a suggestion for `Fn` traits with lifetime params) - #105899 (`./x doc library --open` opens `std`) - #106190 (Account for multiple multiline spans with empty padding) - #106202 (Trim more paths in obligation types) - #106234 (rustdoc: simplify settings, help, and copy button CSS by not reusing) - #106236 (docs/test: add docs and a UI test for `E0514` and `E0519`) - #106259 (Update Clippy) - #106260 (Fix index out of bounds issues in rustdoc) - #106263 (Formatter should not try to format non-Rust files) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-29Rollup merge of #106236 - Ezrashaw:add-test+docs-e0519-e0514, r=GuillaumeGomezMatthias Krüger-0/+17
docs/test: add docs and a UI test for `E0514` and `E0519` No UI test on `E0514`, it would need to compile with a different `rustc` version. r? `@GuillaumeGomez`
2022-12-29Rollup merge of #106202 - estebank:trim-paths, r=NilstriebMatthias Krüger-7/+7
Trim more paths in obligation types
2022-12-29Rollup merge of #106190 - estebank:multiline-start-tweak, r=jackh726Matthias Krüger-36/+8
Account for multiple multiline spans with empty padding Instead of ``` LL | fn oom( | __^ | | _| | || LL | || ) { | ||_- LL | | } | |__^ ``` emit ``` LL | // fn oom( LL | || ) { | ||_- LL | | } | |__^ ```
2022-12-29Rollup merge of #104531 - ohno418:recover-fn-traits-with-lifetime-params, ↵Matthias Krüger-0/+82
r=estebank Provide a better error and a suggestion for `Fn` traits with lifetime params Given `Fn`-family traits with lifetime params in trait bounds like `fn f(_: impl Fn<'a>(&'a str) -> bool)`, we currently produce many unhelpful errors. This PR allows these situations to suggest simply using Higher-Rank Trait Bounds like `for<'a> Fn(&'a str) -> bool`. Fixes https://github.com/rust-lang/rust/issues/103490.
2022-12-29Account for multiple multiline spans with empty paddingEsteban Küber-36/+8
Instead of ``` LL | fn oom( | __^ | | _| | || LL | || ) { | ||_- LL | | } | |__^ ``` emit ``` LL | // fn oom( LL | || ) { | ||_- LL | | } | |__^ ```
2022-12-29Auto merge of #106256 - matthiaskrgr:rollup-g1ovcqq, r=matthiaskrgrbors-7/+475
Rollup of 9 pull requests Successful merges: - #106208 (Make trait/impl `where` clause mismatch on region error a bit more actionable) - #106216 (Powershell: Use `WaitForExit` instead of `-Wait`) - #106217 (rustdoc: remove unnecessary `.tooltip::after { text-align: center }`) - #106218 (Migrate css var scraped examples) - #106221 (Rename `Rptr` to `Ref` in AST and HIR) - #106223 (On unsized locals with explicit types suggest `&`) - #106225 (Remove CraftSpider from review rotation) - #106229 (update Miri) - #106242 (Detect diff markers in the parser) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-29Rollup merge of #106242 - estebank:diff-markers, r=jyn514Matthias Krüger-0/+318
Detect diff markers in the parser Partly address #32059.
2022-12-29Rollup merge of #106223 - estebank:suggest-let-ty-borrow, r=compiler-errorsMatthias Krüger-0/+87
On unsized locals with explicit types suggest `&` Fix #72742.
2022-12-29Rollup merge of #106221 - Nilstrieb:rptr-more-like-ref-actually, ↵Matthias Krüger-4/+4
r=compiler-errors Rename `Rptr` to `Ref` in AST and HIR The name makes a lot more sense, and `ty::TyKind` calls it `Ref` already as well.
2022-12-29Rollup merge of #106208 - compiler-errors:compare-item-region-err, r=estebankMatthias Krüger-3/+66
Make trait/impl `where` clause mismatch on region error a bit more actionable Improve `where` clause suggestions for GATs/methods that have incompatible region predicates in their `where` clauses. Also addresses this diagnostic that went away https://github.com/rust-lang/rust/pull/106129#discussion_r1056875772
2022-12-29Auto merge of #106195 - ↵bors-1/+42
Nilstrieb:no-more-being-clueless-whether-it-really-is-a-literal, r=compiler-errors Improve heuristics whether `format_args` string is a source literal 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. Fixes #106191
2022-12-29Revert "Add tests"David Tolnay-93/+0
This reverts commit b656e2413022de1863b9ea8db87454477b816042.
2022-12-29Auto merge of #106139 - cjgillot:mir-inline-location, r=eholkbors-0/+4
Give the correct track-caller location with MIR inlining. Fixes https://github.com/rust-lang/rust/issues/105538
2022-12-29Provide a better error for `Fn` traits with lifetime paramsYutaro Ohno-0/+82
Currently, given `Fn`-family traits with lifetime params like `Fn<'a>(&'a str) -> bool`, many unhelpful errors show up. These are a bit confusing. This commit allows these situations to suggest simply using higher-ranked trait bounds like `for<'a> Fn(&'a str) -> bool`.
2022-12-28Use verbose suggestions for mutability errorsEsteban Küber-160/+326
2022-12-28Add support for diff3 formatEsteban Küber-2/+7