about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
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-30Extend scraped examples layout GUI test for position of buttonsGuillaume Gomez-0/+14
2022-12-30Add codegen test for `Box::new(uninit)` of big arraysNilstrieb-6/+22
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 #106262 - GuillaumeGomez:migrate-more-scraped-examples-css, ↵bors-1/+27
r=notriddle Migrate more scraped examples CSS rules to CSS variables It's based on https://github.com/rust-lang/rust/pull/106218 so it will need to wait for it to be merged first. r? `@notriddle`
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/+130
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-29CFI: Monomorphize transparent ADTs before typeidMatthew Maurer-3/+19
Monomorphise `#[repr(transparent)]` parameterized ADTs before turning them into an Itanium mangled String. `#[repr(transparent)]` ADTs currently use the single field to represent them in their CFI type ID to ensure that they are compatible. However, if that type involves a type parameter instantiated at the ADT level, as in `ManuallyDrop`, this will currently ICE as the `Parameter` type cannot be mangled. Since this happens at lowering time, it should always be concrete after substitution. Fixes #106230
2022-12-29Add codegen test for issue 103840clubby789-0/+9
2022-12-29Rollup merge of #106260 - chenyukang:yukang/fix-106213-doc, r=GuillaumeGomezMatthias Krüger-0/+16
Fix index out of bounds issues in rustdoc Fixes #106213 r? `@matthiaskrgr`
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-11/+510
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-29Fix index out of bounds issues in rustdocyukang-0/+16
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-5/+5
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 #106218 - GuillaumeGomez:migrate-css-var-scraped-examples, ↵Matthias Krüger-0/+34
r=notriddle Migrate css var scraped examples r? ``@notriddle``
2022-12-29Rollup merge of #106217 - notriddle:notriddle/tooltip-center, r=GuillaumeGomezMatthias Krüger-3/+0
rustdoc: remove unnecessary `.tooltip::after { text-align: center }` This doesn't have an effect, since these tooltip are only one line anyway.
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-29Extend rustdoc GUI test for scraped examplesGuillaume Gomez-1/+27
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-16/+20
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
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-5/+5
The name makes a lot more sense, and `ty::TyKind` calls it `Ref` already as well.
2022-12-28rustdoc: remove unnecessary `.tooltip::after { text-align: center }`Michael Howell-3/+0
This doesn't have an effect, since these tooltip are only one line anyway.
2022-12-28Auto merge of #106215 - matthiaskrgr:rollup-53r89ww, r=matthiaskrgrbors-212/+282
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-28Add GUI test for scraped examples colorsGuillaume Gomez-0/+34
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 #106194 - notriddle:notriddle/sidebar-background, ↵Matthias Krüger-1/+90
r=GuillaumeGomez rustdoc: combine common sidebar background color CSS rules
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`