about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-09-08Auto merge of #101504 - lqd:rust-lld-fix, r=petrochenkovbors-0/+1
Fix `-Zgcc-ld=lld` `-Zgcc-ld=lld` is currently broken. CI is currently ignoring its tests. cc `@Mark-Simulacrum` on the `compiletest` change: I'm not sure which of `bootstrap`'s test step or `compiletest` is currently incorrect wrt windows' `--compile-lib-path`. Since `sysroot/bin` is passed on windows, that means that `compiletest` can't find `rust-lld` on windows and tests are currently ignored: it's looking for something that is in `sysroot/lib` instead. They are currently ignored on unixes for a different reason: the lld wrapper has a different name than what is checked. (I've changed `compiletest` in this PR, just because I could make a very targeted change there, whereas completely changing the intentional lib path that is passed seemed it'd have wider reaching implications on all tests.) And in both unix/win cases, I've changed the detection to look for `rust-lld` rather than the wrappers in `bin/gcc-ld/`. It seems like the more stable of all these executable names. r? `@petrochenkov` I've tested the `lld-wrapper` change on linux and osx, but couldn't test on windows gnu targets (I only have MSVC targets, and these can't use `rust-lld` via `-Zgcc-ld=lld`, nor do they use the lld wrapper IIUC). I'd expect it to work whether or not the wrapper is called with or without an executable suffix. But at least now CI should test it in these targets. Fixes #101370.
2022-09-08We can print futures with {integer} tooMichael Goulet-1/+1
2022-09-08Adjust spacing in suggestion, add a testMichael Goulet-8/+46
2022-09-08Add associated item binding to non-param-ty where clause suggestionsMichael Goulet-2/+2
2022-09-08Avoid source-map call in operator errorMichael Goulet-5/+5
2022-09-07Auto merge of #94075 - mikebenfield:wip-enum, r=oli-obkbors-28/+108
Use niche-filling optimization even when multiple variants have data. Fixes #46213
2022-09-07Use niche-filling optimization even when multiple variants have data.Michael Benfield-22/+102
Fixes #46213
2022-09-07Change name of "dataful" variant to "untagged"Michael Benfield-6/+6
This is in anticipation of a new enum layout, in which the niche optimization may be applied even when multiple variants have data.
2022-09-07Rollup merge of #101521 - aDotInTheVoid:rdj-structkind, r=GuillaumeGomezMatthias Krüger-28/+71
Rustdoc-Json: More accurate struct type. Closes #101489 r? `@GuillaumeGomez`
2022-09-07Rollup merge of #101502 - ↵Matthias Krüger-2/+13
TaKO8Ki:do-not-suggest-semicolon-for-macro-without-exclamation-mark, r=wesleywiser Do not suggest a semicolon for a macro without `!` Fixes a regression in #101490
2022-09-07Rollup merge of #101435 - JakobDegen:bitwidth-tests, r=wesleywiserMatthias Krüger-1152/+12
Remove unnecessary `EMIT_MIR_FOR_EACH_BITWIDTH` This commit removes the annotation only for those tests where the 32 bit and 64 bit files were exactly identical. I didn't touch anything in the `mir-opt/const` directory, since having this annotation there seems more principled, even if it doesn't make a difference. This also removes four additional files related to the `separate_const_switch.rs` test. The associated annotations were removed in #100827 , but I forgot to remove the files as well. (#97564 is the issue tracking an automated check here) r? ```@wesleywiser```
2022-09-07ssa: implement `#[collapse_debuginfo]`David Wood-0/+594
Debuginfo line information for macro invocations are collapsed by default - line information are replaced by the line of the outermost expansion site. Using `-Zdebug-macros` disables this behaviour. When the `collapse_debuginfo` feature is enabled, the default behaviour is reversed so that debuginfo is not collapsed by default. In addition, the `#[collapse_debuginfo]` attribute is available and can be applied to macro definitions which will then have their line information collapsed. Signed-off-by: David Wood <david.wood@huawei.com>
2022-09-07ignore `-Zgcc-ld=lld` test on msvcRémy Rakic-0/+1
now that CI correctly detects rust-lld in run-make tests, we ignore this test since it relies on `-Zgcc-ld=lld` which is not made to work on the windows-msvc targets: it requires a gcc flavor.
2022-09-07Auto merge of #98332 - oli-obk:assume, r=wesleywiserbors-447/+120
Lower the assume intrinsic to a MIR statement This makes https://github.com/rust-lang/rust/pull/96862#issuecomment-1153739068 easier and will generally allow us to cheaply insert assume intrinsic calls in mir building. r? rust-lang/wg-mir-opt
2022-09-07Rustdoc-Json: More accurate struct type.Nixon Enraght-Moony-28/+71
Closes #101489
2022-09-07Auto merge of #101232 - nikic:issue-98294, r=Mark-Simulacrumbors-0/+19
Add test for #98294 Add a test to make that the failure condition for this pattern is optimized away. Fixes #98294.
2022-09-07Auto merge of #100801 - Kobzol:track-pgo-profile-paths, r=michaelwoeristerbors-0/+27
Track PGO profiles in depinfo This PR makes sure that PGO profiles (`-Cprofile-use` and `-Cprofile-sample-use`) are tracked in depinfo, so that when they change, the compilation session will be invalidated. This approach was discussed on [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/Tracking.20PGO.20profile.20files.20in.20cargo). I tried it locally and it seems that the code is recompiled just with this change, and https://github.com/rust-lang/rust/pull/100413 is not even needed. But it's possible that not everything required is recompiled, so we will probably want to land both changes. Another approach to implement this could be to store the PGO profiles in `sess.parse_sess.file_depinfo` when the session is being created, but then the paths would have to be converted to a string and then to a symbol, which seemed unnecessarily complicated. CC `@michaelwoerister` r? `@Eh2406`
2022-09-07Rollup merge of #101486 - asquared31415:invalid_repr_list, r=estebankYuki Okushi-0/+56
Add list of recognized repr attributes to the unrecognized repr error
2022-09-07Rollup merge of #101468 - spastorino:fix-ice-rpit-hrtb-without-dyn, r=cjgillotYuki Okushi-0/+43
fix RPIT ICE for implicit HRTB when missing dyn Closes #101297 r? `@cjgillot` cc `@nikomatsakis`
2022-09-07Rollup merge of #101451 - cjgillot:test-100521, r=TaKO8KiYuki Okushi-0/+65
Add incremental test for changing struct name in assoc type. The ICE appears on beta and is fixed on nightly. Fixes #100521
2022-09-07do not suggest a semicolon for a macro without `!`Takayuki Maeda-2/+13
2022-09-06Shrink span for bindings with subpatterns.Camille GILLOT-234/+183
2022-09-06Allow lint passes to be bound by `TyCtxt`Jason Newcomb-6/+6
2022-09-07suggest adding array lengths to references to arraysTakayuki Maeda-5/+89
2022-09-06add list of recognized repr attributes to the unrecognized repr errorasquared31415-0/+56
2022-09-06Rollup merge of #101462 - aDotInTheVoid:rdj-enum-field-2, r=GuillaumeGomezGuillaume Gomez-1/+149
Rustdoc-Json: Store Variant Fields as their own item. Closes #100587 Closes #92945 Successor to #100762 Unlike that one, we don't have merge `StructType` and `Variant`, as after #101386 `Variant` stores enum specific information (discriminant). Resolves the naming discussion (https://github.com/rust-lang/rust/pull/100762#discussion_r950690526) by having seperate enums for struct and enum kinds Resolves `#[doc(hidden)]` on tuple structs (https://github.com/rust-lang/rust/pull/100762#discussion_r950833884) by storing as a `Vec<Option<Id>>` r? `@GuillaumeGomez`
2022-09-06Rollup merge of #101457 - ChayimFriedman2:struct-field-semi, r=fee1-deadGuillaume Gomez-3/+48
Recover from using `;` as separator between fields Partially fixes #101440 (only for record structs). Doing that for tuple structs is harder as their parsing passes through a bunch of helper functions. I don't know how to do that. But [their error message is better anyway](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=cc6ee8bb2593596c0cea89d49e79bcb4) and suggests using a comma, even if it doesn't suggest replacing the semicolon with it.
2022-09-06Rollup merge of #101445 - TaKO8Ki:suggest-introducing-explicit-lifetime, ↵Guillaume Gomez-10/+44
r=oli-obk Suggest introducing an explicit lifetime if it does not exist Fixes #101027
2022-09-06Rollup merge of #101434 - ↵Guillaume Gomez-24/+26
JhonnyBillM:replace-session-for-handler-in-into-diagnostic, r=davidtwco Update `SessionDiagnostic::into_diagnostic` to take `Handler` instead of `ParseSess` Suggested by the team in [this Zulip Topic](https://rust-lang.zulipchat.com/#narrow/stream/336883-i18n/topic/.23100717.20SessionDiagnostic.20on.20Handler). `Handler` already has almost all the capabilities of `ParseSess` when it comes to diagnostic emission, in this migration we only needed to add the ability to access `source_map` from the emitter in order to get a `Snippet` and the `start_point`. Not sure if adding these two methods [`span_to_snippet_from_emitter` and `span_start_point_from_emitter`] is the best way to address this gap. P.S. If this goes in the right direction, then we probably may want to move `SessionDiagnostic` to `rustc_errors` and rename it to `DiagnosticHandler` or something similar. r? `@davidtwco` r? `@compiler-errors`
2022-09-06Rollup merge of #101357 - compiler-errors:variant-sugg-tweak, r=oli-obkGuillaume Gomez-232/+232
Include enum path in variant suggestion (except for `Result` and `Option`, which we should have via the prelude) Fixes #101356
2022-09-06Test bumpOli Scherer-448/+2
2022-09-06Generalize the Assume intrinsic statement to a general Intrinsic statementOli Scherer-1/+1
2022-09-06Lower the assume intrinsic to a MIR statementOli Scherer-1/+120
2022-09-06fix RPIT ICE for implicit HRTB when missing dynSantiago Pastorino-0/+43
2022-09-06Auto merge of #101479 - Dylan-DPC:rollup-v8ite0y, r=Dylan-DPCbors-0/+91
Rollup of 5 pull requests Successful merges: - #100658 (TyCtxt::get_attr should check that no duplicates are allowed) - #101021 (Migrate ``rustc_middle`` diagnostic) - #101287 (Document eager evaluation of `bool::then_some` argument) - #101412 (Some more cleanup in `core`) - #101427 (Fix ICE, generalize 'move generics to trait' suggestion for >0 non-rcvr arguments) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-09-06Rollup merge of #101427 - compiler-errors:issue-101421, r=cjgillotDylan DPC-0/+71
Fix ICE, generalize 'move generics to trait' suggestion for >0 non-rcvr arguments Fixes #101421 cc #100838
2022-09-06Rollup merge of #100658 - chenyukang:100631-check-get-attr, r=lcnrDylan DPC-0/+20
TyCtxt::get_attr should check that no duplicates are allowed Fixes #100631
2022-09-06Auto merge of #101362 - compiler-errors:unnecessary-let, r=cjgillotbors-0/+31
Suggest removing unnecessary prefix let in patterns Helps with #101291, though I think `@estebank` probably wants this: > Finally, I think it'd be nice if we could detect that we don't know for sure and "just" swallow the rest of the expression (find the next ; accounting for nested braces) or the end of the item (easier). ... to be implemented before we close that issue out completely.
2022-09-06get_attr should check that no duplicates are allowedyukang-0/+20
2022-09-06Auto merge of #101359 - ↵bors-3/+1
compiler-errors:cannot-call-trait-object-with-unsized-return, r=lcnr Point out when a callable is not actually callable because its return is not sized Fixes #100755 I didn't add a UI test for that one because it's equivalent to the UI test that already exists in the suite.
2022-09-06Rollup merge of #101425 - compiler-errors:point-at-ty-param, r=spastorinoYuki Okushi-0/+23
Point at type parameter in plain path expr Slightly better error message for a kinda unique use case.
2022-09-06Rollup merge of #99291 - est31:let_else_tests, r=joshtriplettYuki Okushi-0/+321
Add let else drop order tests Add a systematic matrix based test that checks temporary drop order in various settings, `let-else-drop-order.rs`, as requested [here](https://github.com/rust-lang/rust/pull/93628#issuecomment-1055738523). The drop order of let and let else is supposed to be the and in order to ensure this, the test checks that this holds for a number of cases. The test also ensures that we drop the temporaries of the condition before executing the else block. cc #87335 tracking issue for `let else`
2022-09-05Rustdoc-Json: Store Variant Fields as their own item.Nixon Enraght-Moony-1/+149
Closes #100587 Closes #92945
2022-09-05Point out when a callable is not actually callable because its return is not ↵Michael Goulet-3/+1
sized
2022-09-05Fix ICE, generalize 'move generics to trait' suggestion for >0 non-rcvr ↵Michael Goulet-0/+71
arguments
2022-09-05Recover from using `;` as separator between fieldsChayim Refael Friedman-3/+48
2022-09-05Add test.Camille GILLOT-0/+65
2022-09-05FIX - broken translatable diagnostics testsJhonny Bill Mena-5/+5
2022-09-05FIX - broken translatable diagnostics testsJhonny Bill Mena-13/+15
2022-09-05use `propagate_through_exprs` instead of `propagate_through_expr`Takayuki Maeda-22/+22
fix `ExprKind` static_assert_size fix hir-stats