about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-05-11Auto merge of #96888 - Aaron1011:fake-borrow-no-sort, r=petrochenkovbors-4/+4
Use `FxIndexSet` to avoid sorting fake borrows This fixes #96449, but I haven't yet been able to make the reproducer work using `#[cfg]` attributes, so we can't use the 'revision' infra to write a test The previous implementation relied on sorting by `PlaceRef`. This requires sorting by a `DefId`, which uses untracked state (see #93315)
2022-05-10Auto merge of #96904 - JohnTitor:rollup-f1sz5x0, r=JohnTitorbors-15/+187
Rollup of 6 pull requests Successful merges: - #96717 (Handle mismatched generic param kinds in trait impls betterly) - #96725 (Expose process windows_process_extensions_main_thread_handle on Windows) - #96849 (Move some tests to more reasonable places) - #96861 (Use Rust 2021 prelude in std itself.) - #96879 (rustdoc: search result ranking fix) - #96882 (Don't subst an AdtDef with its own substs) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-05-11Rollup merge of #96879 - notriddle:notriddle/search-ranking, r=GuillaumeGomezYuki Okushi-0/+35
rustdoc: search result ranking fix # Before ![image](https://user-images.githubusercontent.com/1593513/167477286-91049761-67f9-4a73-8fb7-09dbb19ca76c.png) # After ![image](https://user-images.githubusercontent.com/1593513/167477345-6733bc0f-4bb2-4625-9f7f-094031e36414.png)
2022-05-11Rollup merge of #96849 - c410-f3r:z-errors, r=petrochenkovYuki Okushi-0/+0
Move some tests to more reasonable places cc https://github.com/rust-lang/rust/issues/73494 r? `@petrochenkov`
2022-05-11Rollup merge of #96717 - BoxyUwU:gats_const_param_types_mismatch_err, r=lcnrYuki Okushi-15/+152
Handle mismatched generic param kinds in trait impls betterly - Check that generic params on a generic associated type are the same as in the trait definition - Check that const generics are not used in place of type generics (and the other way round too) r? `@lcnr`
2022-05-10Auto merge of #96736 - oli-obk:tait_missing_wf_check, r=davidtwcobors-137/+229
Check hidden types for well formedness at the definition site instead of only at the opaque type itself work towards #90409 . We'll need to look into closure and generator bodies of closures and generators nested inside the hidden type in order to fix that. In hindsight this PR is not necessary for that, but it may be a bit easier with it and we'll get better diagnostics from it on its own.
2022-05-10Check hidden types for well formedness at the definition site instead of ↵Oli Scherer-137/+229
only at the opaque type itself
2022-05-10Rollup merge of #96872 - RalfJung:layout-sanity, r=eddybDylan DPC-22/+110
make sure ScalarPair enums have ScalarPair variants; add some layout sanity checks `@eddyb` suggested that it might be reasonable for `ScalarPair` enums to simply adjust the ABI of their variants accordingly, such that the layout invariant Miri expects actually holds. This PR implements that. I should note though that I don't know much about this layout computation code and what non-Miri consumers expect from it, so tread with caution! I also added a function to sanity-check that computed layouts are internally consistent. This helped a lot in figuring out the final shape of this PR, though I am also not 100% sure that these sanity checks are the right ones. Cc `@oli-obk` Fixes https://github.com/rust-lang/rust/issues/96221
2022-05-10Rollup merge of #96812 - cjgillot:no-lint-outllives-macro, r=petrochenkovDylan DPC-0/+48
Do not lint on explicit outlives requirements from external macros. The current implementation of the list rightfully skipped where predicates from external macros. However, if the where predicate came from the current macro but the bounds were from an external macro, the lint still fired. Closes https://github.com/rust-lang/rust/issues/96640
2022-05-09Use `FxIndexSet` to avoid sorting fake borrowsAaron Hill-4/+4
This fixes #96449, but I haven't yet been able to make the reproducer work using `#[cfg]` attributes, so we can't use the 'revision' infra to write a test The previous implementation relied on sorting by `PlaceRef`. This requires sorting by a `DefId`, which uses untracked state (see #93315)
2022-05-10Auto merge of #96715 - cjgillot:trait-alias-loop, r=compiler-errorsbors-11/+45
Fortify handing of where bounds on trait & trait alias definitions Closes https://github.com/rust-lang/rust/issues/96664 Closes https://github.com/rust-lang/rust/issues/96665 Since https://github.com/rust-lang/rust/pull/93803, when listing all bounds and predicates we now need to account for the possible presence of predicates on any of the generic parameters. Both bugs were hidden by the special handling of bounds at the generic parameter declaration position. Trait alias expansion used to confuse predicates on `Self` and where predicates. Exiting too late when listing all the bounds caused a cycle error.
2022-05-09Add test case for `hashset::insert` rankingMichael Howell-0/+12
2022-05-09rustdoc: search result ranking fixMichael Howell-0/+23
2022-05-09Point to the empty trait alias.Camille GILLOT-0/+9
2022-05-09Rollup merge of #96844 - Badel2:actually-fix-96583, r=compiler-errorsMatthias Krüger-2/+17
Actually fix ICE from #96583 PR #96746 fixed a very similar bug, so the same logic is used in a different place. I originally concluded that the two issues (#96583 and #96738) were identical by comparing the backtrace, but I didn't look close enough.
2022-05-09Rollup merge of #96008 - ↵Matthias Krüger-0/+151
fmease:warn-on-useless-doc-hidden-on-assoc-impl-items, r=lcnr Warn on unused `#[doc(hidden)]` attributes on trait impl items [Zulip conversation](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/.E2.9C.94.20Validy.20checks.20for.20.60.23.5Bdoc.28hidden.29.5D.60). Whether an associated item in a trait impl is shown or hidden in the documentation entirely depends on the corresponding item in the trait declaration. Rustdoc completely ignores `#[doc(hidden)]` attributes on impl items. No error or warning is emitted: ```rust pub trait Tr { fn f(); } pub struct Ty; impl Tr for Ty { #[doc(hidden)] fn f() {} } // ^^^^^^^^^^^^^^ ignored by rustdoc and currently // no error or warning issued ``` This may lead users to the wrong belief that the attribute has an effect. In fact, several such cases are found in the standard library (I've removed all of them in this PR). There does not seem to exist any incentive to allow this in the future either: Impl'ing a trait for a type means the type *fully* conforms to its API. Users can add `#[doc(hidden)]` to the whole impl if they want to hide the implementation or add the attribute to the corresponding associated item in the trait declaration to hide the specific item. Hiding an implementation of an associated item does not make much sense: The associated item can still be found on the trait page. This PR emits the warn-by-default lint `unused_attribute` for this case with a future-incompat warning. `@rustbot` label T-compiler T-rustdoc A-lint
2022-05-09fix codegen test failureRalf Jung-1/+1
2022-05-09make sure ScalarPair enums have ScalarPair variants; add some layout sanity ↵Ralf Jung-21/+109
checks
2022-05-09Auto merge of #95960 - jhpratt:remove-rustc_deprecated, r=compiler-errorsbors-49/+88
Remove `#[rustc_deprecated]` This removes `#[rustc_deprecated]` and introduces diagnostics to help users to the right direction (that being `#[deprecated]`). All uses of `#[rustc_deprecated]` have been converted. CI is expected to fail initially; this requires #95958, which includes converting `stdarch`. I plan on following up in a short while (maybe a bootstrap cycle?) removing the diagnostics, as they're only intended to be short-term.
2022-05-09Auto merge of #95542 - xFrednet:rfc-2383-expect-query, r=wesleywiserbors-0/+392
Support tool lints with the `#[expect]` attribute (RFC 2383) This PR fixes the ICE https://github.com/rust-lang/rust/issues/94953 by making the assert for converted expectation IDs conditional. Additionally, it moves the lint expectation check into a separate query to support rustdoc and other tools. On the way, I've also added some tests to ensure that the attribute works for Clippy and rustdoc lints. The number of changes comes from the long test file. This may look like a monster PR, this may smell like a monster PR and this may be a monster PR, but it's a harmless monster. :sauropod: --- Closes: https://github.com/rust-lang/rust/issues/94953 cc: https://github.com/rust-lang/rust/issues/85549 r? `@wesleywiser` cc: `@rust-lang/rustdoc`
2022-05-08Auto merge of #96846 - matthiaskrgr:rollup-yxu9ot9, r=matthiaskrgrbors-1/+101
Rollup of 5 pull requests Successful merges: - #96617 (Fix incorrect syntax suggestion with `pub async fn`) - #96828 (Further elaborate the lack of guarantees from `Hasher`) - #96829 (Fix the `x.py clippy` command) - #96830 (Add and tweak const-generics tests) - #96835 (Add more eslint rules) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-05-08Warn on unused doc(hidden) on trait impl itemsLeón Orell Valerian Liehr-0/+151
2022-05-08Move some tests to more reasonable placesCaio-0/+0
2022-05-08Rollup merge of #96830 - JohnTitor:issue-96654, r=compiler-errorsMatthias Krüger-1/+16
Add and tweak const-generics tests Closes #96654 Also correct the src/test/ui/const-generics/issues/issue-77357.rs test's issue number.
2022-05-08Rollup merge of #96617 - ↵Matthias Krüger-0/+85
ken-matsui:fix-incorrect-syntax-suggestion-with-pub-async-fn, r=cjgillot Fix incorrect syntax suggestion with `pub async fn` This PR closes: https://github.com/rust-lang/rust/issues/96555
2022-05-08Auto merge of #96302 - Serial-ATA:more-diagnostic-items, r=manishearthbors-40/+0
Add more diagnostic items This just adds a handful diagnostic items I noticed were missing. Would it be worth doing this for all of the remaining types? I'm willing to do it if it'd be helpful.
2022-05-08Actually fix ICE from #96583Badel2-2/+17
PR #96746 fixed a very similar bug, so the same logic is used in a different place.
2022-05-08Support `#[expect]` attributes for rustdoc lints (RFC 2383)xFrednet-0/+185
2022-05-08Test `expect` attribute for tool lints, rustc edition (RFC 2383)xFrednet-0/+171
2022-05-08Only assert for unstable expectation ids after conversion (RFC 2383)xFrednet-0/+36
This ICE was reported by `@matthiaskrgr`. A big THANK YOU to him. See `rust#94953`
2022-05-08Auto merge of #96155 - jackh726:param-heuristics-followup, r=estebankbors-225/+192
Followups for method call error change Each commit is self-contained. Fixes most of the followup reviews from that PR. r? `@estebank`
2022-05-08Correct the issue number of a testYuki Okushi-1/+1
2022-05-08Add regression test for #96654Yuki Okushi-0/+15
2022-05-08Fix incorrect syntax suggestion with `pub async fn`Ken Matsui-0/+85
2022-05-07Rollup merge of #96777 - JohnTitor:do-not-run-pass-save-analysis, ↵Matthias Krüger-1/+1
r=Mark-Simulacrum Make the test `check-pass` not to produce a JSON file `run-pass` produces a JSON file when enabling save analysis. The original ICE happened on `cargo check`, moreover **without** the `generic_const_exprs` feature, so `check-pass` should be enough.
2022-05-07Rollup merge of #96726 - oli-obk:no_cross_inference, r=Mark-SimulacrumMatthias Krüger-0/+103
Add regression and bug tests this tracks the behaviour from https://github.com/rust-lang/rust/issues/96572 in our test suite
2022-05-07Rollup merge of #96667 - oli-obk:collect_hidden_types, r=Mark-SimulacrumMatthias Krüger-0/+43
Add regression test fixes #69785 This issue seems to have been fixed in the meantime.
2022-05-07Rollup merge of #96760 - davidtwco:diagnostic-translation-vec, r=oli-obkGuillaume Gomez-0/+8
diagnostics: port more diagnostics to derive + add support for `Vec` fields - Port "unconstrained opaque type" diagnostic to using the derive. - Allow `Vec` fields in diagnostic derive - enables support for diagnostics that have multiple primary spans, or have subdiagnostics repeated at multiple locations. `Vec<..>` fields in the diagnostic derive become loops in the generated code. - Add `create_{err,warning}` - there wasn't a way to create a diagnostic from a struct and not emit it straight away. - Port "explicit generic args w/ impl trait" diagnostic to using the derive. r? `````@oli-obk````` cc `````@pvdrz`````
2022-05-07Rollup merge of #96636 - GuillaumeGomez:fix-jump-to-def-regression, r=notriddleGuillaume Gomez-0/+18
Fix jump to def regression https://github.com/rust-lang/rust/pull/93803 introduced a regression in the "jump to def" feature. This fixes it. Nice side-effect: it adds a new regression test. :) I also used this opportunity to add documentation about this unstable feature in the rustdoc book. cc ``@cjgillot`` r? ``@notriddle``
2022-05-07Rollup merge of #96581 - RalfJung:debug-size-align, r=oli-obkGuillaume Gomez-551/+220
make Size and Align debug-printing a bit more compact In particular in `{:#?}`-mode, these take up a lot of space, so I think this is the better alternative (even though it is a bit longer in `{:?}` mode, I think it is still more readable). We could make it even smaller by deviating further from what the actual code looks like, e.g. via something like `Size(4 bytes)`. Not sure what people would think about that? Cc `````@oli-obk`````
2022-05-07Add test.Camille GILLOT-0/+48
2022-05-07Auto merge of #96804 - compiler-errors:rollup-1mc6aw3, r=compiler-errorsbors-0/+55
Rollup of 8 pull requests Successful merges: - #96660 ([bootstrap] Give a better error when trying to run a path with no registered step) - #96701 (update `jemallocator` example to use 2018 edition import syntax) - #96746 (Fix an ICE on #96738) - #96758 (bootstrap: bsd platform flags for split debuginfo) - #96778 (Remove closures on `expect_local` to apply `#[track_caller]`) - #96781 (Fix an incorrect link in The Unstable Book) - #96783 (Link to correct issue in issue-95034 known-bug) - #96801 (Add regression test for #96319) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-05-06Rollup merge of #96801 - Aaron1011:coinductive-cycle-test, r=compiler-errorsMichael Goulet-0/+34
Add regression test for #96319
2022-05-06Rollup merge of #96783 - aliemjay:typo-issue-95034, r=compiler-errorsMichael Goulet-0/+2
Link to correct issue in issue-95034 known-bug fix a typo is issue number: 94034 -> 95034
2022-05-06Rollup merge of #96746 - JohnTitor:issue-96738, r=petrochenkovMichael Goulet-0/+19
Fix an ICE on #96738 In the block we don't know if the method actually exists thus `expect_local` panics. Fixes #96738 Fixes #96583
2022-05-06Resolve vars before emitting coerce suggestions tooJack Huey-0/+16
2022-05-06Resolve vars in note_type_errJack Huey-129/+134
2022-05-06Add regression test for #96319Aaron Hill-0/+34
2022-05-07Auto merge of #96531 - kckeiks:remove-item-like-visitor-from-rustc-typeck, ↵bors-2/+2
r=cjgillot Remove ItemLikeVisitor impls from rustc_typeck Issue #95004 cc `@cjgillot`
2022-05-06Point at closure args tooJack Huey-3/+42