about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2022-04-11Auto merge of #95125 - JakobDegen:uninit-variant-rvalue, r=oli-obkbors-201/+567
Add new `Deinit` statement This rvalue replaces `SetDiscriminant` for ADTs. This PR is an alternative to #94590 , which only specifies that the behavior of `SetDiscriminant` is the same as what this rvalue would do. The motivation for this change are discussed in that PR and [on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/SetDiscriminant.20and.20aggregate.20initialization.20.2394590) r? `@oli-obk`
2022-04-11Remove inlining cost of `Deinit` statementsJakob Degen-109/+263
2022-04-11Add new `MutatatingUseContext`s for deinit and `SetDiscriminant`Jakob Degen-13/+26
2022-04-11Add const eval tests ensuring padding gets correctly marked as deinit on ↵Jakob Degen-0/+37
deaggregation
2022-04-11Fix tests broken by deaggregation changeJakob Degen-465/+619
2022-04-11Bless tests that broke in a trivial way due to change in deaggregationJakob Degen-11/+18
2022-04-11Add new `Deinit` statement kindJakob Degen-1/+2
2022-04-11Auto merge of #95931 - matthiaskrgr:rollup-1c5zhit, r=matthiaskrgrbors-25/+50
Rollup of 7 pull requests Successful merges: - #95743 (Update binary_search example to instead redirect to partition_point) - #95771 (Update linker-plugin-lto.md to 1.60) - #95861 (Note that CI tests Windows 10) - #95875 (bootstrap: show available paths help text for aliased subcommands) - #95876 (Add a note for unsatisfied `~const Drop` bounds) - #95907 (address fixme for diagnostic variable name) - #95917 (thin_box test: import from std, not alloc) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-04-11Rollup merge of #95876 - fee1-dead:note-const-drop, r=oli-obkMatthias Krüger-17/+26
Add a note for unsatisfied `~const Drop` bounds r? ``@oli-obk``
2022-04-11Rollup merge of #95875 - aswild:pr/alias-cmd-paths, r=Mark-SimulacrumMatthias Krüger-3/+3
bootstrap: show available paths help text for aliased subcommands Running `./x.py build -h -v` shows a list of available build targets, but the short alias `./x.py b -h -v` does not. Fix so that the aliases behave the same as their spelled out counterparts.
2022-04-11Rollup merge of #95861 - ChrisDenton:windows7-support, r=Dylan-DPCMatthias Krüger-4/+6
Note that CI tests Windows 10 Currently being [discussed on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/Windows.207). r? `````@joshtriplett`````
2022-04-11Rollup merge of #95771 - str4d:update-linker-plugin-lto.md-to-1.60, ↵Matthias Krüger-1/+15
r=pietroalbini Update linker-plugin-lto.md to 1.60 I remembered this table when I was looking into what version of LLVM 1.60.0 was using 🙂
2022-04-11Auto merge of #95758 - compiler-errors:issue-54771, r=estebankbors-21/+75
Only suggest removing semicolon when expression is compatible with `impl Trait` https://github.com/rust-lang/rust/issues/54771#issuecomment-476423690 > It still needs checking that the last statement's expr can actually conform to the trait, but the naïve behavior is there. Only suggest removing a semicolon when the type behind the semicolon actually implements the trait in an RPIT `-> impl Trait`. Also upgrade the label that suggests removing the semicolon to a suggestion (should it be verbose?). cc #54771
2022-04-11Auto merge of #95754 - compiler-errors:binder-assoc-ty, r=nagisabors-0/+19
Better error for `for<...>` on associated type bound With GATs just around the corner, we'll probably see more people trying out `Trait<for<'a> Assoc<'a> = ..>`. This PR improves the syntax error slightly, and also makes it slightly easier to make this into real syntax in the future. Feel free to push back if the reviewer thinks this should have a suggestion on how to fix it (i.e. push the `for<'a>` outside of the angle brackets), but that can also be handled in a follow-up PR.
2022-04-11Add a note for unsatisfied `~const Drop` boundsDeadbeef-17/+26
2022-04-11Auto merge of #94243 - compiler-errors:compiler-flags-typo, r=Mark-Simulacrumbors-3/+8
`s/compiler-flags/compile-flags` in compiletest Also make compiletest panic so this doesn't happen in the future! I literally always forget which it's called, so I wanted to make my life easier in the future. Also open to the possibility of parsing both.
2022-04-10better error for binder on associated type boundMichael Goulet-0/+19
2022-04-10only suggest removing semicolon when expr implements traitMichael Goulet-21/+75
2022-04-10Rollup merge of #95868 - vacuus:markdown-code-blocks, r=GuillaumeGomezDylan DPC-7/+5
rustdoc: Reduce allocations in a `html::markdown` function
2022-04-10Rollup merge of #95857 - ouz-a:mir-opt, r=oli-obkDylan DPC-0/+109
Allow multiple derefs to be splitted in deref_separator Previously in #95649 only a single deref within projection was supported and multiple derefs caused a bunch of issues, this PR fixes those issues. ```@oli-obk``` helped a ton again ❤️
2022-04-10Rollup merge of #95852 - niluxv:strict-provenance-lint-fixup, r=Dylan-DPCDylan DPC-2/+2
Fix missing space in lossy provenance cast lint See https://github.com/rust-lang/rust/pull/95599#discussion_r846425050
2022-04-10Rollup merge of #95849 - ehuss:check-submodules, r=Mark-SimulacrumDylan DPC-2/+13
Check for git submodules in non-git source tree. People occasionally download the source from https://github.com/rust-lang/rust/releases, but those source distributions will not work because they are missing the submodules. They will get a confusing `failed to load manifest for workspace member` error. Unfortunately AFAIK there is no way to disable the GitHub source links. This change tries to detect this scenario and provide an error message that guides them toward a solution. Closes #95608
2022-04-10Rollup merge of #95807 - TaKO8Ki:suggest-local-var-for-vector, r=fee1-deadDylan DPC-0/+78
Suggest adding a local for vector to fix borrowck errors closes #95574
2022-04-10Rollup merge of #95784 - WaffleLapkin:typeof_cool_suggestion, r=compiler-errorsDylan DPC-0/+15
Suggest replacing `typeof(...)` with an actual type This PR adds suggestion to replace `typeof(...)` with an actual type of `...`, for example in case of `typeof(1)` we suggest replacing it with `i32`. If the expression 1. Is not const (`{ let a = 1; let _: typeof(a); }`) 2. Can't be found (`let _: typeof(this_variable_does_not_exist)`) 3. Or has non-suggestable type (closure, generator, error, etc) we don't suggest anything. The 1 one is sad, but it's not clear how to support non-consts expressions for `typeof`. _This PR is inspired by [this tweet]._ [this tweet]: https://twitter.com/compiler_errors/status/1511945354752638976
2022-04-10Auto merge of #95848 - RalfJung:miri, r=RalfJungbors-8/+8
update Miri Fixes https://github.com/rust-lang/rust/issues/95844 r? `@ghost`
2022-04-10--bless testsMaybe Waffle-0/+15
2022-04-10Auto merge of #95253 - jyn514:cargo-run, r=Mark-Simulacrumbors-10/+3
Make it possible to run `cargo test` for bootstrap Note that this only runs bootstrap's self-tests, not compiler or library tests. Helps with https://github.com/rust-lang/rust/issues/94829.
2022-04-10bootstrap: show available paths help text for aliased subcommandsAllen Wild-3/+3
Running `./x.py build -h -v` shows a list of available build targets, but the short alias `./x.py b -h -v` does not. Fix so that the aliases behave the same as their spelled out counterparts.
2022-04-10Auto merge of #95502 - jyn514:doc-rustc, r=Mark-Simulacrumbors-68/+30
Fix `x doc compiler/rustc` This also has a few cleanups to `doc.rs`. The last two commits I don't care about, but the first commit I'd like to keep - it will be very useful for https://github.com/rust-lang/rust/issues/44293. Fixes https://github.com/rust-lang/rust/issues/95447.
2022-04-10Auto merge of #95254 - jyn514:fix-windows-builds, r=Mark-Simulacrumbors-2/+17
Fix `cargo run` on Windows Fixes the following error: ``` error: failed to run custom build command for `bootstrap v0.0.0 (C:\Users\Walther\git\rust\src\bootstrap)` Caused by: process didn't exit successfully: `C:\Users\Walther\git\rust\target\debug\build\bootstrap-7757a4777dec0f86\build-script-build` (exit code: 101) --- stdout cargo:rerun-if-changed=build.rs cargo:rerun-if-env-changed=RUSTC cargo:rustc-env=BUILD_TRIPLE=x86_64-pc-windows-msvc cargo:rerun-if-env-changed=PATH --- stderr thread 'main' panicked at 'assertion failed: rustc.is_absolute()', src\bootstrap\build.rs:22:5 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace warning: build failed, waiting for other jobs to finish... error: build failed ``` The problem was that the `dir.join` check only works with `rustc.exe`, not `rustc`. Thanks `@Walther` for the help testing the fix! Helps with https://github.com/rust-lang/rust/issues/94829.
2022-04-09rustdoc: Reduce allocations in a `html::markdown` functionRoc Yu-7/+5
2022-04-09Auto merge of #95435 - cjgillot:one-name, r=oli-obkbors-0/+3
Make def names and HIR names consistent. The name in the `DefKey` is interned to create the `DefId`, so it does not require any query to access. This can be leveraged to avoid a few useless HIR accesses for names. ~In order to achieve that, generic parameters created from universal impl-trait are given the pretty-printed ast as a name, instead of `{{opaque}}`.~ ~Drive-by: the `TyCtxt::opt_item_name` used a dummy span for non-local definitions. We have access to `def_ident_span`, so we use it.~
2022-04-09Note that CI tests Windows 10Chris Denton-4/+6
2022-04-09support multiple derefsouz-a-0/+109
2022-04-09Make it possible to run `cargo test` for bootstrapJoshua Nelson-10/+3
Note that this only runs bootstrap's self-tests, not compiler or library tests.
2022-04-09Rollup merge of #95808 - petrochenkov:fragspec, r=nnethercoteDylan DPC-9/+116
expand: Remove `ParseSess::missing_fragment_specifiers` It was used for deduplicating some errors for legacy code which are mostly deduplicated even without that, but at cost of global mutable state, which is not a good tradeoff. cc https://github.com/rust-lang/rust/pull/95747#issuecomment-1091619403 r? ``@nnethercote``
2022-04-09Rollup merge of #95369 - jyn514:test-rustdoc, r=Mark-SimulacrumDylan DPC-6/+29
Fix `x test src/librustdoc` with `download-rustc` enabled The problem was two-fold: - Bootstrap was hard-coding that unit tests should always run with stage1, not stage2, and - It hard-coded the sysroot layout in stage1, which puts libLLVM.so in `lib/rustlib/` instead of just `lib/`. This also takes the liberty of fixing `test src/librustdoc --no-doc`, which has been broken since it was first added. It would be nice at some point to unify this logic with other tests; I opened a Zulip thread: https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Inconsistency.20in.20.60x.20test.60 Fixes https://github.com/rust-lang/rust/issues/91071.
2022-04-09Rollup merge of #95361 - scottmcm:valid-align, r=Mark-SimulacrumDylan DPC-9/+36
Make non-power-of-two alignments a validity error in `Layout` Inspired by the zulip conversation about how `Layout` should better enforce `size <= isize::MAX as usize`, this uses an N-variant enum on N-bit platforms to require at the validity level that the existing invariant of "must be a power of two" is upheld. This was MIRI can catch it, and means there's a more-specific type for `Layout` to store than just `NonZeroUsize`. It's left as `pub(crate)` here; a future PR could consider giving it a tracking issue for non-internal usage.
2022-04-09Fix missing space in lossy provenance cast lintniluxv-2/+2
2022-04-09Check for git submodules in non-git source tree.Eric Huss-2/+13
2022-04-09update MiriRalf Jung-8/+8
2022-04-09expand: Remove `ParseSess::missing_fragment_specifiers`Vadim Petrochenkov-9/+116
It was used for deduplicating some errors for legacy code which are mostly deduplicated even without that, but at cost of global mutable state, which is not a good tradeoff.
2022-04-09Rollup merge of #95769 - fmease:fix-issue-95717, r=GuillaumeGomezDylan DPC-4/+59
Hide cross-crate `#[doc(hidden)]` associated items in trait impls Fixes #95717. r? ```@GuillaumeGomez``` This is the bug I ran into in #95316. ```@rustbot``` label T-rustdoc A-cross-crate-reexports
2022-04-09Rollup merge of #95676 - pietroalbini:pa-bump-rls, r=pietroalbiniDylan DPC-0/+0
Update RLS This PR updates RLS to include the following PRs: * https://github.com/rust-lang/rls/pull/1766 * https://github.com/rust-lang/rls/pull/1767 * https://github.com/rust-lang/rls/pull/1771 * https://github.com/rust-lang/rls/pull/1772 It also updates racer to fix RLS compilation with the parallel compiler enabled.
2022-04-09Bless tests.Camille GILLOT-0/+3
2022-04-09Auto merge of #95724 - Kobzol:ci-update-rustc-perf, r=nnethercotebors-8/+14
CI: update `rustc-perf` version used in CI and also the corresponding PGO benchmarks The old version was from May 2021. The `rustc-perf` benchmarks have seen a significant overhaul recently, so let's see if the new benchmarks can improve PGO performance.
2022-04-09Auto merge of #95835 - Dylan-DPC:rollup-l5mf2ad, r=Dylan-DPCbors-35/+489
Rollup of 8 pull requests Successful merges: - #90066 (Add new ThinBox type for 1 stack pointer wide heap allocated trait objects) - #95374 (assert_uninit_valid: ensure we detect at least arrays of uninhabited types) - #95599 (Strict provenance lints) - #95751 (Don't report numeric inference ambiguity when we have previous errors) - #95764 ([macro_metavar_expr] Add tests to ensure the feature requirement) - #95787 (reword panic vs result section to remove recoverable vs unrecoverable framing) - #95797 (Remove explicit delimiter token trees from `Delimited`.) - #95804 (rustdoc: Fix empty doc comment with backline ICE) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-04-09Rollup merge of #95804 - GuillaumeGomez:empty-doc-comment-with-backline, ↵Dylan DPC-0/+22
r=notriddle rustdoc: Fix empty doc comment with backline ICE Fixes #95800. r? ```@notriddle```
2022-04-09Rollup merge of #95764 - c410-f3r:metavar-test, r=petrochenkovDylan DPC-1/+117
[macro_metavar_expr] Add tests to ensure the feature requirement These tests should have been added in the initial implementation they were unintentionally forgotten cc #83527 r? ````@petrochenkov````
2022-04-09Rollup merge of #95751 - compiler-errors:ambig-int, r=jackh726Dylan DPC-32/+29
Don't report numeric inference ambiguity when we have previous errors Fixes #95648