about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-10-30Rollup merge of #117396 - oli-obk:privacy_visitor_types, r=compiler-errorsMatthias Krüger-28/+56
Don't treat closures/coroutine types as part of the public API Fixes a regression from https://github.com/rust-lang/rust/pull/117076 r? `@compiler-errors`
2023-10-30Rollup merge of #117389 - oli-obk:gen_fn, r=compiler-errorsMatthias Krüger-10/+49
Some diagnostics improvements of `gen` blocks These are leftovers from https://github.com/rust-lang/rust/pull/116447
2023-10-30Rollup merge of #116862 - estebank:issue-57457, r=oli-obkMatthias Krüger-28/+49
Detect when trait is implemented for type and suggest importing it Fix #57457.
2023-10-30Detect when trait is implemented for type and suggest importing itEsteban Küber-28/+49
Fix #57457.
2023-10-30Only run panic tests on targets that can unwindOli Scherer-1/+2
2023-10-30Auto merge of #117267 - RalfJung:miri-tests, r=Mark-Simulacrumbors-3/+30
update which targets we test Miri on I hope this doesn't cost too much time; running only the "pass" tests should be reasonably fast (1-2 minutes on my system). Fixes https://github.com/rust-lang/rust/issues/117167
2023-10-30Some manual rustfmt as rustfmt is broken on this fileOli Scherer-3/+4
2023-10-30Merge two equal match armsOli Scherer-6/+1
2023-10-30Don't treat closures/coroutines as part of the public APIOli Scherer-36/+16
2023-10-30Add regression testOli Scherer-0/+52
2023-10-30Auto merge of #116939 - chenx97:bootstrap-fd-lock, r=onur-ozkanbors-86/+68
bootstrap: bump fd-lock, clap and windows This update is proposed as an effort to update target-sensitive dependencies like `libc` and `rustix`. Since the Cargo.toml file is modified to prevent downgrading, cargo will update the dependencies automatically when you build the binary.
2023-10-30Auto merge of #117387 - fmease:rollup-5958nsf, r=fmeasebors-459/+386
Rollup of 8 pull requests Successful merges: - #117147 (Print variadic argument pattern in HIR pretty printer) - #117177 (Use ImageDataType for allocation type) - #117205 (Allows `#[diagnostic::on_unimplemented]` attributes to have multiple) - #117350 (coverage: Replace manual debug indents with nested tracing spans in `counters`) - #117365 (Stabilize inline asm usage with rustc_codegen_cranelift) - #117371 (Ignore RPIT duplicated lifetimes in `opaque_types_defined_by`) - #117382 (Fail typeck for illegal break-with-value) - #117385 (deduce_param_attrs: explain a read-only case) r? `@ghost` `@rustbot` modify labels: rollup
2023-10-30Add a custom panic message for resuming `gen` blocks after they panickedOli Scherer-2/+40
2023-10-30Talk about `gen fn` in diagnostics about `gen fn`Oli Scherer-8/+8
2023-10-30update which targets we test Miri onRalf Jung-3/+30
2023-10-30Rollup merge of #117385 - RalfJung:deduce_param_attrs, r=oli-obkLeón Orell Valerian Liehr-0/+1
deduce_param_attrs: explain a read-only case This takes the discussion [here](https://github.com/rust-lang/rust/pull/111517/files#r1243443625) and adds it as comment in the code. Cc `@lukas-code`
2023-10-30Rollup merge of #117382 - gurry:114529-ice-const-eval, r=oli-obkLeón Orell Valerian Liehr-4/+58
Fail typeck for illegal break-with-value This is fixes the issue wherein typeck was succeeding for break-with-value exprs at illegal locations such as inside `while`, `while let` and `for` loops which eventually caused an ICE during MIR interpretation for const eval. Now we fail typeck for such code which prevents faulty MIR from being generated and interpreted, thus fixing the ICE. Fixes #114529
2023-10-30Rollup merge of #117371 - compiler-errors:unique-params, r=oli-obkLeón Orell Valerian Liehr-2/+37
Ignore RPIT duplicated lifetimes in `opaque_types_defined_by` An RPIT's or TAIT's own generics are kinda useless -- so just ignore them. For TAITs, they will always be empty, and for RPITs, they're always duplicated lifetimes. Fixes #115013.
2023-10-30Rollup merge of #117365 - bjorn3:sync_cg_clif-2023-10-29, r=oli-obkLeón Orell Valerian Liehr-334/+100
Stabilize inline asm usage with rustc_codegen_cranelift Previously using inline asm with the cg_clif version built as part of rustc would return an error that inline asm support is unstable. Recently I implemented everything that remained for full support of inline asm with the exception of sym operands (which remain marked as unstable for cg_clif). As such I think it is time to declare the inline asm support of cg_clif stable. `@rustbot` label +A-codegen +A-cranelift +T-compiler
2023-10-30Rollup merge of #117350 - Zalathar:counters-indent, r=oli-obkLeón Orell Valerian Liehr-78/+19
coverage: Replace manual debug indents with nested tracing spans in `counters` Instead of indenting these debug messages manually, we can get `#[instrument]` to do a better job of it for us, giving us some nice little simplifications.
2023-10-30Rollup merge of #117205 - weiznich:multiple_notes_for_on_unimplemented, ↵León Orell Valerian Liehr-23/+111
r=compiler-errors Allows `#[diagnostic::on_unimplemented]` attributes to have multiple notes This commit extends the `#[diagnostic::on_unimplemented]` (and `#[rustc_on_unimplemented]`) attributes to allow multiple `note` options. This enables emitting multiple notes for custom error messages. For now I've opted to not change any of the existing usages of `#[rustc_on_unimplemented]` and just updated the relevant compile tests. r? `@compiler-errors` I'm happy to adjust any of the existing changed location to emit the old error message if that's desired.
2023-10-30Rollup merge of #117177 - Ayush1325:uefi-alloc-type, r=workingjubileeLeón Orell Valerian Liehr-3/+19
Use ImageDataType for allocation type Suggested at #100499 cc `@dvdhrm` cc `@nicholasbishop`
2023-10-30Rollup merge of #117147 - DaniPopes:pphir-fn-variadic, r=compiler-errorsLeón Orell Valerian Liehr-15/+41
Print variadic argument pattern in HIR pretty printer Variadic argument name/pattern was ignored during HIR pretty printing. Could not figure out why it only works on normal functions (`va2`) and not in foreign ones (`va1`).
2023-10-30deduce_param_attrs: explain a read-only caseRalf Jung-0/+1
2023-10-30bootstrap: bump fd-lock, clap and windows.chenx97-86/+68
this also updates target-sensitive dependencies like rustix and libc.
2023-10-30Fail typeck for illegal break-with-valueGurinder Singh-4/+58
This is fixes the issue wherein typeck was succeeding for break-with-value at illegal locations such as inside `while`, `while let` and `for` loops which eventually caused an ICE during MIR interpetation for const eval. Now we fail typeck for such code which prevents faulty MIR from being generated and interpreted, thus fixing the ICE.
2023-10-30Use ImageDataType for allocation typeAyush Singh-3/+19
Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
2023-10-30Auto merge of #116485 - coastalwhite:stabilize-riscv-target-features, r=Amanieubors-20/+20
Stabilize Ratified RISC-V Target Features Stabilization PR for the ratified RISC-V target features. This stabilizes some of the target features tracked by #44839. This is also a part of #114544 and eventually needed for the RISC-V part of rust-lang/rfcs#3268. There is a similar PR for the the stdarch crate which can be found at rust-lang/stdarch#1476. This was briefly discussed on Zulip (https://rust-lang.zulipchat.com/#narrow/stream/250483-t-compiler.2Frisc-v/topic/Stabilization.20of.20RISC-V.20Target.20Features/near/394793704). Specifically, this PR stabilizes the: * Atomic Instructions (A) on v2.0 * Compressed Instructions (C) on v2.0 * ~Double-Precision Floating-Point (D) on v2.2~ * ~Embedded Base (E) (Given as `RV32E` / `RV64E`) on v2.0~ * ~Single-Precision Floating-Point (F) on v2.2~ * Integer Multiplication and Division (M) on v2.0 * ~Vector Operations (V) on v1.0~ * Bit Manipulations (B) on v1.0 listed as `zba`, `zbc`, `zbs` * Scalar Cryptography (Zk) v1.0.1 listed as `zk`, `zkn`, `zknd`, `zkne`, `zknh`, `zkr`, `zks`, `zksed`, `zksh`, `zkt`, `zbkb`, `zbkc` `zkbx` * ~Double-Precision Floating-Point in Integer Register (Zdinx) on v1.0~ * ~Half-Precision Floating-Point (Zfh) on v1.0~ * ~Minimal Half-Precision Floating-Point (Zfhmin) on v1.0~ * ~Single-Precision Floating-Point in Integer Register (Zfinx) on v1.0~ * ~Half-Precision Floating-Point in Integer Register (Zhinx) on v1.0~ * ~Minimal Half-Precision Floating-Point in Integer Register (Zhinxmin) on v1.0~ r? `@Amanieu`
2023-10-30Auto merge of #117328 - lqd:cranelift-rocket, r=Mark-Simulacrumbors-0/+12
pass `CODEGEN_BACKENDS` to docker The backends to build are now defined in the `CODEGEN_BACKENDS` env var. It's correctly set in CI, but wasn't passed to docker, hence cg_clif wasn't actually built in #81746. r? `@Kobzol:` I locally tried `CODEGEN_BACKENDS="cranelift" DEPLOY=1 src/ci/docker/run.sh dist-x86_64-linux` and this change was enough for `ci/run.sh` to read the env var. So I'll try as-is and we'll see.
2023-10-30coverage: Use a tracing span to group the parts of a sum-up expressionZalathar-1/+4
2023-10-30coverage: Inline the "recursive" worker methods for assigning countersZalathar-21/+5
Now that we don't manually pass around indent levels, there's no need for these worker methods to exist separately from their main callers.
2023-10-30coverage: Replace manual debug indents with nested tracing spansZalathar-65/+19
2023-10-30Auto merge of #117332 - saethlin:panic-immediate-abort, r=workingjubileebors-10/+87
Increase the reach of panic_immediate_abort I wanted to use/abuse this recently as part of another project, and I was surprised how many panic-related things were left in my binaries if I built a large crate with the feature enabled along with LTO. These changes get all the panic-related symbols that I could find out of my set of locally installed Rust utilities.
2023-10-29Ignore RPIT duplicated lifetimes in opaque_types_defined_byMichael Goulet-2/+37
2023-10-29Auto merge of #117089 - wesleywiser:update_backtrace, r=Mark-Simulacrumbors-0/+0
Update backtrace submodule This pulls in a few notable changes (see the [complete list](https://github.com/rust-lang/backtrace-rs/compare/99faef833f890fe89f1a959d89b951954118828b...e9da96eb452aa65e79e2342be700544afe509440) for details): - https://github.com/rust-lang/backtrace-rs/pull/508 - https://github.com/rust-lang/backtrace-rs/pull/566 - https://github.com/rust-lang/backtrace-rs/pull/569 - Fixes #116403 by no longer using `dbghelp.dll` during backtrace capture.
2023-10-29Merge commit 'dde58803fd6cbb270c7a437f36a8a3a29fbef679' into ↵bjorn3-334/+100
sync_cg_clif-2023-10-29
2023-10-29Rustup to rustc 1.75.0-nightly (e5cfc5547 2023-10-28)bjorn3-18/+1
2023-10-29Sync from rust e5cfc55477eceed1317a02189fdf77a4a98f2124bjorn3-69/+34
2023-10-29Merge pull request #1403 from rust-lang/use_llvm_backend_as_assemblerbjorn3-316/+99
Support and stabilize inline asm on all platforms
2023-10-29Avoid infinite recursion when cranelift is the default codegen backendbjorn3-3/+8
2023-10-29Auto merge of #116733 - compiler-errors:alias-liveness-but-this-time-sound, ↵bors-20/+357
r=aliemjay Consider alias bounds when computing liveness in NLL (but this time sound hopefully) This is a revival of #116040, except removing the changes to opaque lifetime captures check to make sure that we're not triggering any unsoundness due to the lack of general existential regions and the currently-existing `ReErased` hack we use instead. r? `@aliemjay` -- I appreciate you pointing out the unsoundenss in the previous iteration of this PR, and I'd like to hear that you're happy with this iteration of this PR before this goes back into FCP :> Fixes #116794 as well --- (mostly copied from #116040 and reworked slightly) # Background Right now, liveness analysis in NLL is a bit simplistic. It simply walks through all of the regions of a type and marks them as being live at points. This is problematic in the case of aliases, since it requires that we mark **all** of the regions in their args[^1] as live, leading to bugs like #42940. In reality, we may be able to deduce that fewer regions are allowed to be present in the projected type (or "hidden type" for opaques) via item bounds or where clauses, and therefore ideally, we should be able to soundly require fewer regions to be live in the alias. For example: ```rust trait Captures<'a> {} impl<T> Captures<'_> for T {} fn capture<'o>(_: &'o mut ()) -> impl Sized + Captures<'o> + 'static {} fn test_two_mut(mut x: ()) { let _f1 = capture(&mut x); let _f2 = capture(&mut x); //~^ ERROR cannot borrow `x` as mutable more than once at a time } ``` In the example above, we should be able to deduce from the `'static` bound on `capture`'s opaque that even though `'o` is a captured region, it *can never* show up in the opaque's hidden type, and can soundly be ignored for liveness purposes. # The Fix We apply a simple version of RFC 1214's `OutlivesProjectionEnv` and `OutlivesProjectionTraitDef` rules to NLL's `make_all_regions_live` computation. Specifically, when we encounter an alias type, we: 1. Look for a unique outlives bound in the param-env or item bounds for that alias. If there is more than one unique region, bail, unless any of the outlives bound's regions is `'static`, and in that case, prefer `'static`. If we find such a unique region, we can mark that outlives region as live and skip walking through the args of the opaque. 2. Otherwise, walk through the alias's args recursively, as we do today. ## Limitation: Multiple choices This approach has some limitations. Firstly, since liveness doesn't use the same type-test logic as outlives bounds do, we can't really try several options when we're faced with a choice. If we encounter two unique outlives regions in the param-env or bounds, we simply fall back to walking the opaque via its args. I expect this to be mostly mitigated by the special treatment of `'static`, and can be fixed in a forwards-compatible by a more sophisticated analysis in the future. ## Limitation: Opaque hidden types Secondly, we do not employ any of these rules when considering whether the regions captured by a hidden type are valid. That causes this code (cc #42940) to fail: ```rust trait Captures<'a> {} impl<T> Captures<'_> for T {} fn a() -> impl Sized + 'static { b(&vec![]) } fn b<'o>(_: &'o Vec<i32>) -> impl Sized + Captures<'o> + 'static {} ``` We need to have existential regions to avoid [unsoundness](https://github.com/rust-lang/rust/pull/116040#issuecomment-1751628189) when an opaque captures a region which is not represented in its own substs but which outlives a region that does. ## Read more Context: https://github.com/rust-lang/rust/pull/115822#issuecomment-1731153952 (for the liveness case) More context: https://github.com/rust-lang/rust/issues/42940#issuecomment-455198309 (for the opaque capture case, which this does not fix) [^1]: except for bivariant region args in opaques, which will become less relevant when we move onto edition 2024 capture semantics for opaques.
2023-10-29Auto merge of #116889 - MU001999:master, r=petrochenkovbors-0/+26
Eat close paren if capture_cfg to avoid unbalanced parens Fixes #116781
2023-10-29Stabilize inline asm usage on all platformsbjorn3-299/+29
But exclude sym operands for now as they are somewhat broken.
2023-10-29Unconditionally handle int $$0x29 using a shimbjorn3-6/+8
2023-10-29Use the LLVM rustc backend as external assemblerbjorn3-12/+58
The LLVM backend is generally available, while the gnu assembler is not on Windows and many other platforms by default.
2023-10-29Auto merge of #116270 - cjgillot:gvn-aggregate, r=oli-obk,RalfJungbors-2588/+4299
See through aggregates in GVN This PR is extracted from https://github.com/rust-lang/rust/pull/111344 The first 2 commit are cleanups to avoid repeated work. I propose to stop removing useless assignments as part of this pass, and let a later `SimplifyLocals` do it. This makes tests easier to read (among others). The next 3 commits add a constant folding mechanism to the GVN pass, presented in https://github.com/rust-lang/rust/pull/116012. ~This pass is designed to only use global allocations, to avoid any risk of accidental modification of the stored state.~ The following commits implement opportunistic simplifications, in particular: - projections of aggregates: `MyStruct { x: a }.x` gets replaced by `a`, works with enums too; - projections of arrays: `[a, b][0]` becomes `a`; - projections of repeat expressions: `[a; N][x]` becomes `a`; - transform arrays of equal operands into a repeat rvalue. Fixes https://github.com/rust-lang/miri/issues/3090 r? `@oli-obk`
2023-10-29Increase the reach of panic_immediate_abortBen Kimock-10/+87
2023-10-29handle dry runs in `dist::CodegenBackend`Rémy Rakic-0/+4
self.number_of_times_dry_runs_have_caused_issues += 1;
2023-10-29Auto merge of #117354 - GuillaumeGomez:rollup-k9xtq0g, r=GuillaumeGomezbors-43/+122
Rollup of 5 pull requests Successful merges: - #115968 (Don't use LFS64 symbols on musl) - #117043 (add bootstrap flag `--skip-stage0-validation`) - #117082 (Fix closure-inherit-target-feature test for SGX platform) - #117312 (memcpy assumptions: link to source showing that GCC makes the same assumption) - #117337 (rustdoc: Use `ThinVec` in `GenericParamDefKind`) r? `@ghost` `@rustbot` modify labels: rollup
2023-10-29Rollup merge of #117337 - camelid:genparamdefkind-thinvec, r=GuillaumeGomezGuillaume Gomez-11/+11
rustdoc: Use `ThinVec` in `GenericParamDefKind` This should hopefully reduce memory usage and improve performance since these vectors are often empty (and `GenericParamDefKind` is constructed *a lot*).