about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-04-26Add new diagnosticGeorge-17/+140
2022-04-26Fix the filename in the expected error message.Dan Gohman-2/+2
2022-04-26Update rustdoc search test to check `!`Guillaume Gomez-1/+135
2022-04-26rustdoc: Resolve doc links on fields during early resolutionVadim Petrochenkov-0/+44
2022-04-26Add `only-windows` versions of the coerce-issue-49593-box-never test.Dan Gohman-0/+97
2022-04-26Revert "add `DefId` to unsafety violations and display function path in E0133"Oli Scherer-113/+148
This reverts commit 8b8f6653cfd54525714f02efe7af0a0f830e185c.
2022-04-26Update src/test/rustdoc/issue-95873.rsMichael Howell-1/+1
Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
2022-04-26Rollup merge of #96372 - compiler-errors:field-method-suggest, r=oli-obkGuillaume Gomez-0/+56
Suggest calling method on nested field when struct is missing method Similar to the suggestion to change `x.field` to `x.nested.field`, implement a similar suggestion for when `x.method()` should be replaced with `x.nested.method()`.
2022-04-26Rollup merge of #94703 - kjetilkjeka:nvptx-kernel-args-abi2, r=nagisaGuillaume Gomez-0/+254
Fix codegen bug in "ptx-kernel" abi related to arg passing I found a codegen bug in the nvptx abi related to that args are passed as ptrs ([see comment](https://github.com/rust-lang/rust/issues/38788#issuecomment-1048999928)), this is not as specified in the [ptx-interoperability doc](https://docs.nvidia.com/cuda/ptx-writers-guide-to-interoperability/) or how C/C++ does it. It will also almost always fail in practice since device/host uses different memory spaces for most hardware. This PR fixes the bug and add tests for passing structs to ptx kernels. I observed that all nvptx assembly tests had been marked as [ignore a long time ago](https://github.com/rust-lang/rust/pull/59752#issuecomment-501713428). I'm not sure if the new one should be marked as ignore, it passed on my computer but it might fail if ptx-linker is missing on the server? I guess this is outside scope for this PR and should be looked at in a different issue/PR. I only fixed the nvptx64-nvidia-cuda target and not the potential code paths for the non-existing 32bit target. Even though 32bit nvptx is not a supported target there are still some code under the hood supporting codegen for 32 bit ptx. I was advised to create an MCP to find out if this code should be removed or updated. Perhaps ``@RDambrosio016`` would have interest in taking a quick look at this.
2022-04-26Auto merge of #94034 - willcrichton:fix-trait-suggestion-for-binops, r=estebankbors-71/+62
Fix incorrect suggestion for trait bounds involving binary operators This PR fixes #93927, #92347, #93744 by replacing the bespoke trait-suggestion logic in `op.rs` with a more common code path. The downside is that this fix causes some suggestions to not include an `Output=` type, reducing their usefulness. Note that this causes one case in the `missing-bounds.rs` test to fail rustfix. So I would need to move that code into a separate non-fix test if this PR is otherwise acceptable.
2022-04-25Update unop path, fix testsWill Crichton-60/+12
2022-04-26Auto merge of #96414 - Dylan-DPC:rollup-t4ofhoa, r=Dylan-DPCbors-9/+131
Rollup of 6 pull requests Successful merges: - #90312 (Fix some confusing wording and improve slice-search-related docs) - #96149 (Remove unused macro rules) - #96279 (rustdoc: Remove .woff font files) - #96355 (Better handle too many `#` recovery in raw str) - #96379 (delay bug when adjusting `NeverToAny` twice during diagnostic code) - #96384 (do not consider two extern types to be similar) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-04-25Replace suggest_constraining_param with suggest_restricting_param_boundWill Crichton-12/+51
to fix incorrect suggestion for trait bounds involving binary operators. Fixes #93927, #92347, #93744.
2022-04-26Rollup merge of #96384 - lcnr:extern-types-similar, r=compiler-errorsDylan DPC-0/+38
do not consider two extern types to be similar
2022-04-26Rollup merge of #96379 - PrestonFrom:issue_96335, r=compiler-errorsDylan DPC-0/+40
delay bug when adjusting `NeverToAny` twice during diagnostic code Addresses Issue 96335 (https://github.com/rust-lang/rust/issues/96335) by using `delay_span_bug` instead of an assert and returning an error type from `check_expr_meets_expectation_or_error`. Fixes #96335
2022-04-26Rollup merge of #96355 - estebank:issue-95030, r=compiler-errorsDylan DPC-6/+50
Better handle too many `#` recovery in raw str Point at all the unnecessary trailing `#`. Better handle interaction with outer attributes when `;` is missing. Fix #95030.
2022-04-26Rollup merge of #96279 - GuillaumeGomez:remove-woff-fonts, r=camelid,jshaDylan DPC-3/+3
rustdoc: Remove .woff font files Copying `@jsha's` great comment: > Right now we ship 1.5MB of woff files in the rustdoc binary, and 1MB of woff2 files, for a total of 2.5MB. > > Per: > > https://caniuse.com/woff > https://caniuse.com/woff2 > > The only listed browser that supports woff and not woff2 is IE, which is not supported per https://github.com/rust-lang/rfcs/blob/master/text/1985-tiered-browser-support.md. > > I propose we stop shipping woff files and save 1.5MB from the rustdoc binary (and from each doc build). r? `@jsha`
2022-04-25Auto merge of #96294 - Emilgardis:def_id-in-unsafetyviolationdetails, r=oli-obkbors-97/+101
Display function path in unsafety violations - E0133 adds `DefId` to `UnsafetyViolationDetails` this enables consumers to access the function definition that was reported to be unsafe and also changes the output for some E0133 diagnostics
2022-04-25rustdoc: do not write `{{root}}` in `pub use ::foo` docsMichael Howell-0/+2
2022-04-25Fix issue 96381Michael Goulet-0/+16
2022-04-25Auto merge of #96116 - ouz-a:mir-opt, r=oli-obkbors-215/+516
Make derefer work everwhere Follow up work on previous PR's #95649 and #95857. r? rust-lang/mir-opt _Co-Authored-By: `@oli-obk_`
2022-04-25Auto merge of #95604 - nbdd0121:used2, r=petrochenkovbors-0/+43
Generate synthetic object file to ensure all exported and used symbols participate in the linking Fix #50007 and #47384 This is the synthetic object file approach that I described in https://github.com/rust-lang/rust/pull/95363#issuecomment-1079932354, allowing all exported and used symbols to be linked while still allowing them to be GCed. Related #93791, #95363 r? `@petrochenkov` cc `@carbotaniuman`
2022-04-25Add test for asserting correct generation of ptx-kernel argsKjetil Kjeka-0/+254
2022-04-25avoid fully qualifying error output of issue-43733 testEmil Gardström-8/+10
2022-04-25Auto merge of #95246 - ChrisDenton:command-args, r=joshtriplettbors-13/+14
Windows Command: Don't run batch files using verbatim paths Fixes #95178 Note that the first commit does some minor refactoring (moving command line argument building to args.rs). The actual changes are in the second.
2022-04-25Recover most `impl Trait` and `dyn Trait` lifetime bound suggestions under NLLmarmeladema-6/+128
2022-04-25do not consider two extern types to be similarlcnr-0/+38
2022-04-24Delay bug when adjusting NeverToAny twice during diagnosticPreston From-0/+40
2022-04-24suggestion if struct field has methodMichael Goulet-0/+56
2022-04-25Rollup merge of #96215 - nikic:legacy-pm-removal, r=nagisaMatthias Krüger-7/+5
Drop support for legacy PM with LLVM 15 LLVM 15 already removes some of the legacy PM APIs we're using. This patch forces use of NewPM with LLVM 15 (with `-Z new-llvm-pass-manager=no` throwing a warning) and stubs out various FFI methods with a report_fatal_error on LLVM 15. For LLVMPassManagerBuilderPopulateLTOPassManager() I went with adding our own wrapper, as the alternative would be to muck about with weak symbols, which seems to be non-trivial as far as cross-platform support is concerned (std has `weak!` for this purpose, but only as an internal utility.) Fixes #96072. Fixes #96362.
2022-04-25Rollup merge of #96212 - marmeladema:nll-revisions-regions, r=jackh726Matthias Krüger-470/+743
Use revisions instead of nll compare mode for `/regions/` ui tests Created https://github.com/rust-lang/rust/issues/96211 for the duplicated mismatched types errors r? `@jackh726`
2022-04-25Rollup merge of #96090 - JakobDegen:mir-tests, r=nagisaMatthias Krüger-33/+123
Implement MIR opt unit tests This implements rust-lang/compiler-team#502 . There's not much to say here, this implementation does everything as proposed. I also added the flag to a bunch of existing tests (mostly those to which I could add it without causing huge diffs due to changes in line numbers). Summarizing the changes to test outputs: - Every time an `MirPatch` is created, it adds a cleanup block to the body if it did not exist already. If this block is unused (as is usually the case), it usually gets removed soon after by some pass calling `SimplifyCFG` for unrelated reasons (in many cases this cycle happens quite a few times for a single body). We now run `SimplifyCFG` less often, so those blocks end up in some of our outputs. I looked at changing `MirPatch` to not do this, but that seemed too complicated for this PR. I may still do that in a follow-up. - The `InstCombine` test had set `-C opt-level=0` in its flags and so there were no storage markers. I don't really see a good motivation for doing this, so bringing it back in line with what everything else does seems correct. - One of the `EarlyOtherwiseBranch` tests had `UnreachableProp` running on it. Preventing that kind of thing is the goal of this feature, so this seems fine. For the remaining tests for which this feature might be useful, we can gradually migrate them as opportunities present themselves. In terms of documentation, I plan on submitting a PR to the rustc dev guide in the near future documenting this and other recent changes to MIR. If there's any other places to update, do let me know r? `@nagisa`
2022-04-24Fix suggestion for `_` on return type for fn in impl for TraitMichael Goulet-23/+32
2022-04-24Suggest replacing `_` in type signature of impl for TraitMichael Goulet-6/+49
2022-04-24Use revisions instead of nll compare mode for `/regions/` ui testsmarmeladema-470/+743
2022-04-24only show a simple description in E0133 span labelEmil Gardström-63/+63
2022-04-24add `DefId` to unsafety violations and display function path in E0133Emil Gardström-158/+160
this enables consumers to access the function definition that was reported to be unsafe
2022-04-24Rollup merge of #96352 - marmeladema:fix-nll-lifetime-bound-suggestions, ↵Matthias Krüger-114/+201
r=jackh726 Improve span for `consider adding an explicit lifetime bound` suggestions under NLL Because NLL borrowck is run after typeck, `in_progress_typeck_results` was always `None` which was preventing the retrieval of the span to which the suggestion is suppose to add the lifetime bound. We now manually pass the `LocalDefId` owner to `construct_generic_bound_failure` so that under NLL, we give the owner id of the current body. This helps with #96332
2022-04-24diagnostics: regression test for <usize as Iterator>::revMichael Howell-0/+20
Closes #90315
2022-04-24Bless testsmarmeladema-66/+136
2022-04-24Recover missing suggestion part under NLLmarmeladema-16/+22
2022-04-24Improve span for `consider adding an explicit lifetime bound` suggestions ↵marmeladema-32/+43
under NLL Because NLL borrowck is run after typeck, `in_progress_typeck_results` was always `None` which was preventing the retrieval of the span to which the suggestion is suppose to add the lifetime bound. We now manually pass the `LocalDefId` owner to `construct_generic_bound_failure` so that under NLL, we give the owner id of the current body.
2022-04-23Add support for `nounused` --extern flagJeremy Fitzhardinge-0/+23
This adds `nounused` to the set of extern flags: `--extern nounused:core=/path/to/core/libcore.rlib`. The effect of this flag is to suppress `unused-crate-dependencies` warnings relating to the crate.
2022-04-23Better handle too many `#` recovery in raw strEsteban Küber-6/+50
Point at all the unnecessary trailing `#`. Better handle interaction with outer attributes when `;` is missing. Fix #95030.
2022-04-23Provide consistent output order for suggestionsEsteban Küber-8/+8
2022-04-23Auto merge of #93970 - cjgillot:novis, r=petrochenkovbors-54/+60
Remove visibility information from HIR The resolver exports all the necessary visibility information through the `tcx.visibility` query. This PR stops having a dedicated visibility field in HIR, in order to use this query. We keep a `vis_span` field for diagnostic purposes.
2022-04-23Bless pretty-print output.Camille GILLOT-12/+12
2022-04-23Fix lints.Camille GILLOT-18/+28
2022-04-23Use more targetted suggestion span for fully qualified pathEsteban Küber-21/+24
2022-04-23Erase type params when suggesting fully qualified pathEsteban Küber-0/+57
When suggesting the use of a fully qualified path for a method call that is ambiguous because it has multiple candidates, erase type params in the resulting code, as they would result in an error when applied. We replace them with `_` in the output to rely on inference. There might be cases where this still produces slighlty incomplete suggestions, but it otherwise produces many more errors in relatively common cases. Fix #96292