about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2022-04-27Auto merge of #96195 - sunfishcode:sunfishcode/handle-or-error-type, ↵bors-2/+100
r=joshtriplett Define a dedicated error type for `HandleOrNull` and `HandleOrInvalid`. Define `NullHandleError` and `InvalidHandleError` types, that implement std::error::Error, and use them as the error types in `HandleOrNull` and `HandleOrInvalid`, This addresses [this concern](https://github.com/rust-lang/rust/issues/87074#issuecomment-1080031167). This is the same as #95387. r? `@joshtriplett`
2022-04-27Auto merge of #96459 - Dylan-DPC:rollup-de6ud9d, r=Dylan-DPCbors-27/+436
Rollup of 6 pull requests Successful merges: - #92569 (Improve Error Messaging for Unconstructed Structs and Enum Variants in Generic Contexts) - #96370 (Cleanup `report_method_error` a bit) - #96383 (Fix erased region escaping into wfcheck due to #95395) - #96385 (Recover most `impl Trait` and `dyn Trait` lifetime bound suggestions under NLL) - #96410 (rustdoc: do not write `{{root}}` in `pub use ::foo` docs) - #96430 (Fix handling of `!` in rustdoc search) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-04-27Rollup merge of #96430 - GuillaumeGomez:search-exclamation, r=notriddleDylan DPC-3/+148
Fix handling of `!` in rustdoc search Fixes #96399. I also updated the eBNF. cc `@jsha` r? `@notriddle`
2022-04-27Rollup merge of #96410 - notriddle:notriddle/issue-95873, r=GuillaumeGomezDylan DPC-1/+4
rustdoc: do not write `{{root}}` in `pub use ::foo` docs Fixes #95873
2022-04-27Rollup merge of #96385 - ↵Dylan DPC-6/+128
marmeladema:nll-fix-trait-lifetime-bound-suggestions, r=jackh726 Recover most `impl Trait` and `dyn Trait` lifetime bound suggestions under NLL This is done by replacing the duplicated (and very partial) implementation from borrowck with one inspsired from `NiceRegionError::try_report_static_impl_trait` and by re-using `suggest_new_region_bound`. Fixes #96277 r? ```@jackh726```
2022-04-27Rollup merge of #96383 - compiler-errors:issue-96381, r=estebankDylan DPC-0/+16
Fix erased region escaping into wfcheck due to #95395 We can just use `liberate_late_bound_regions` instead of `erase_late_bound_regions`... This gives us `ReEarlyBound` instead of `ReErased`, the former being something typeck actually knows how to deal with... Fixes #96381 Side-note: We only actually get far enough in the compiler pipeline to cause this ICE when we're invoking rustdoc. We actually abort rustc right before wfcheck because of the error that we emit (having `_` in the type signature). Why does rustdoc keep going even though we raise an error?
2022-04-26Auto merge of #96425 - oli-obk:fix_incremental_regression_unsafety_checking, ↵bors-113/+148
r=compiler-errors Fix incremental perf regression unsafety checking Perf regression introduced in #96294 We will simply avoid emitting the name of the unsafe function in MIR unsafeck, since we're moving to THIR unsafeck anyway.
2022-04-26TidyGeorge-4/+4
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-26Update rustdoc search parser to handle `!` correctlyGuillaume Gomez-2/+13
2022-04-26Add `only-windows` versions of the coerce-issue-49593-box-never test.Dan Gohman-0/+97
2022-04-26Auto merge of #96428 - GuillaumeGomez:rollup-4noqr33, r=GuillaumeGomezbors-228/+542
Rollup of 8 pull requests Successful merges: - #94022 (Clarify that `Cow::into_owned` returns owned data) - #94703 (Fix codegen bug in "ptx-kernel" abi related to arg passing) - #95949 (Implement Default for AssertUnwindSafe) - #96361 (Switch JS code to ES6) - #96372 (Suggest calling method on nested field when struct is missing method) - #96386 (simplify `describe_field` func in borrowck's diagnostics part) - #96400 (Correct documentation for `Rvalue::ShallowInitBox`) - #96415 (Remove references to git.io) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
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 #96361 - GuillaumeGomez:es6, r=notriddleGuillaume Gomez-228/+232
Switch JS code to ES6 Considering it's already quite big, I'll do the remaining files in another PR. Part of #93058. r? ``@notriddle``
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 #96424 - oli-obk:miri_update, r=oli-obkbors-8/+8
update miri submodule r? `@ghost` fixes #96402
2022-04-26update miri submoduleOli Scherer-8/+8
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-26Auto merge of #96404 - tmandry:roll-llvm, r=cuviperbors-0/+0
Update LLVM submodule * [[fuchsia] Don't include duplicate profiling symbols for Fuchsia ](https://github.com/rust-lang/llvm-project/commit/326efc90ac5bf79a8fdd90898addf86bb6a6e404) * [[MIPS] Initial support for MIPS-I load delay slots ](https://github.com/rust-lang/llvm-project/commit/161fd6b0b10464dd3f7ed50af7aea7df5a1acccf) r? `@rust-lang/wg-llvm`
2022-04-25Update unop path, fix testsWill Crichton-60/+12
2022-04-26Auto merge of #96414 - Dylan-DPC:rollup-t4ofhoa, r=Dylan-DPCbors-94/+161
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-88/+33
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-1/+4
2022-04-25Fix issue 96381Michael Goulet-0/+16
2022-04-25Update LLVM submoduleTyler Mandry-0/+0
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-25Auto merge of #96106 - jihiggins:issue-96060, r=Mark-Simulacrumbors-2/+11
Add type_name info to [TIMING] log output Adds type_name to the [TIMING] log output: ``` [TIMING] (bootstrap::compile::Sysroot) Sysroot { compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } } -- 0.020 [TIMING] (bootstrap::builder::Builder::sysroot_libdir::Libdir) Libdir { compiler: Compiler { stage: 0, host: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } }, target: TargetSelection { triple: "x86_64-unknown-linux-gnu", file: None } } -- 0.007 ``` Not sure if that's the best way to format it. Thought about replacing the struct's name with the type_name output, but that feels kind of hacky? Closes #96060
2022-04-24suggestion if struct field has methodMichael Goulet-0/+56
2022-04-25Rollup merge of #96366 - jyn514:remove-dead-code, r=Mark-SimulacrumMatthias Krüger-9/+2
bootstrap: Remove dead code in rustdoc shim The `RUSTDOC_RESOURCE_SUFFIX` variable was never actually set.
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-34/+135
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