about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-06-07wasm exception handlingJan-Mirko Otter-14/+117
2023-06-07add commentJan-Mirko Otter-0/+9
2023-06-07add wasm eh intrinsicsJan-Mirko Otter-0/+9
2023-06-07wasm target feature: exception handlingJan-Mirko Otter-0/+1
2023-06-07Auto merge of #111047 - compiler-errors:rtn-no-ty-ct-params, r=spastorinobors-44/+100
Emit an error when return-type-notation is used with type/const params These are not intended to be supported initially, even though the compiler supports them internally...
2023-06-07Auto merge of #96875 - SabrinaJewson:noop-waker, r=m-ou-sebors-0/+40
Add `task::Waker::noop` I have found myself reimplementing this function many times when I need a `Context` but don't have a runtime or `futures` to hand. Prior art: [`futures::task::noop_waker`](https://docs.rs/futures/0.3/futures/task/fn.noop_waker.html) and [`futures::task::noop_waker_ref`](https://docs.rs/futures/0.3/futures/task/fn.noop_waker_ref.html) Tracking issue: https://github.com/rust-lang/rust/issues/98286 Unresolved questions: 1. Should we also add `RawWaker::noop()`? (I don't think so, I can't think of a use case for it) 2. Should we also add `Context::noop()`? Depending on the future direction `Context` goes a "noop context" might not even make sense in future. 3. Should it be an associated constant instead? That would allow for `let cx = &mut Context::from_waker(&Waker::NOOP);` to work on one line which is pretty nice. I don't really know what the guideline is here. r? rust-lang/libs-api `@rustbot` label +T-libs-api -T-libs
2023-06-07Auto merge of #111819 - nikarh:vita-improved, r=Amanieubors-88/+81
Improved std support for ps vita target Fixed a couple of things in std support for ps vita via Vita SDK newlib oss implementation: - Added missing hardware features to target spec - Compile in thumb by default (newlib is also compiled in thumb) - Fixed fs calls. Vita newlib has a not-very-posix dirent. Also vita does not expose inodes, it's stubbed as 0 in stat, and I'm stubbing it here for dirent (because vita newlibs's dirent doesn't even have that field) - Enabled signal handlers for panic unwinding - Dropped static link requirement from the platform support md. Also, rearranged sections to better stick with the template.
2023-06-07Auto merge of #111495 - Kobzol:dist-tests, r=Mark-Simulacrumbors-7/+127
Run tests on PGO/LTO/BOLT optimized dist artifacts This PR adds baisc tests for the optimized dist builds on x64 Linux and Windows. A subset of the test suite is run, so it's not perfect, but it's better than the status quo (which is basically no testing at all, apart from the perf bot on Linux). r? `@ghost`
2023-06-06Auto merge of #112361 - matthiaskrgr:rollup-39zxrw1, r=matthiaskrgrbors-86/+188
Rollup of 8 pull requests Successful merges: - #111250 (Add Terminator conversion from MIR to SMIR, part #2) - #112310 (Add new Tier-3 targets: `loongarch64-unknown-none*`) - #112334 (Add myself to highfive rotation) - #112340 (remove `TyCtxt::has_error_field` helper method) - #112343 (Prevent emitting `missing_docs` for `pub extern crate`) - #112350 (Avoid duplicate type sanitization of local decls in borrowck) - #112356 (Fix comment for `get_region_var_origins`) - #112358 (Remove default visitor impl in region constraint generation) r? `@ghost` `@rustbot` modify labels: rollup
2023-06-06Rollup merge of #112358 - Nilstrieb:fancy-more-borrowck-cleanups, ↵Matthias Krüger-6/+2
r=compiler-errors Remove default visitor impl in region constraint generation I wanted to group it together with other possibly minor borrowck cleanups but that's all I have right now so I rather put it up than forget about it before doing something else. r? `@compiler-errors`
2023-06-06Rollup merge of #112356 - Nilstrieb:get-region-var-origins, r=compiler-errorsMatthias Krüger-5/+5
Fix comment for `get_region_var_origins` #109753 changed the logic but not the comment. r? `@compiler-errors`
2023-06-06Rollup merge of #112350 - Nilstrieb:borrow-me-some-cleanups, r=compiler-errorsMatthias Krüger-3/+1
Avoid duplicate type sanitization of local decls in borrowck The type of the local decl is already sanitized in `visit_local_decl`.
2023-06-06Rollup merge of #112343 - GuillaumeGomez:extern-crate-missing-docs, r=notriddleMatthias Krüger-28/+37
Prevent emitting `missing_docs` for `pub extern crate` Fixes #112308. r? `@notriddle`
2023-06-06Rollup merge of #112340 - lcnr:tyctxt-cleanup, r=compiler-errorsMatthias Krüger-40/+9
remove `TyCtxt::has_error_field` helper method
2023-06-06Rollup merge of #112334 - fee1-dead-contrib:add-rotation, r=NilstriebMatthias Krüger-0/+1
Add myself to highfive rotation
2023-06-06Rollup merge of #112310 - loongarch-rs:bare-metal, r=WaffleLapkinMatthias Krüger-0/+132
Add new Tier-3 targets: `loongarch64-unknown-none*` This PR adds new Tier-3 targets `loongarch64-unknown-none*` that are introduced by MCP rust-lang/compiler-team#628
2023-06-06Rollup merge of #111250 - spastorino:smir-terminator-2, r=oli-obkMatthias Krüger-4/+1
Add Terminator conversion from MIR to SMIR, part #2 r? `@oli-obk`
2023-06-06Remove default visitor impl in region constraint generationNilstrieb-6/+2
2023-06-06Avoid duplicate type sanitization of local declsNilstrieb-3/+1
The type of the local decl is already sanitized in `visit_local_decl`.
2023-06-06Fix comment for `get_region_var_origins`Nilstrieb-5/+5
2023-06-06Auto merge of #112344 - matthiaskrgr:rollup-tswr83e, r=matthiaskrgrbors-41/+320
Rollup of 7 pull requests Successful merges: - #111058 (Correct fortanix LVI test print function) - #111369 (Added custom risc32-imac for esp-espidf target) - #111962 (Make GDB Python Pretty Printers loadable after spawning GDB, avoiding required `rust-gdb`) - #112019 (Don't suggest changing `&self` and `&mut self` in function signature to be mutable when taking `&mut self` in closure) - #112199 (Fix suggestion for matching struct with `..` on both ends) - #112220 (Cleanup some `EarlyBinder::skip_binder()` -> `EarlyBinder::subst_identity()`) - #112325 (diagnostics: do not suggest type name tweaks on type-inferred closure args) r? `@ghost` `@rustbot` modify labels: rollup
2023-06-06Bumped libc versionNikolay Arhipov-3/+3
2023-06-06Rollup merge of #112325 - notriddle:notriddle/issue-111932, r=compiler-errorsMatthias Krüger-8/+62
diagnostics: do not suggest type name tweaks on type-inferred closure args Fixes #111932
2023-06-06Rollup merge of #112220 - kylematsuda:earlybinder-fix, r=compiler-errorsMatthias Krüger-5/+5
Cleanup some `EarlyBinder::skip_binder()` -> `EarlyBinder::subst_identity()` fix some incorrect `skip_binder()`'s as identified in https://github.com/rust-lang/rust/pull/112006#pullrequestreview-1448369203 r? ``@compiler-errors`` ``@lcnr`` ``@jackh726`` (hope it's alright to just tag everyone who commented :sweat_smile:)
2023-06-06Rollup merge of #112199 - jieyouxu:issue-112188, r=compiler-errorsMatthias Krüger-13/+111
Fix suggestion for matching struct with `..` on both ends ### Before This PR ``` error: expected `}`, found `,` --> src\main.rs:8:17 | 8 | Foo { .., x, .. } => (), | --^ | | | | | expected `}` | `..` must be at the end and cannot have a trailing comma | help: move the `..` to the end of the field list | 8 - Foo { .., x, .. } => (), 8 + Foo { .., x, , .. } => (), | ``` ### After This PR ``` error: expected `}`, found `,` --> tests/ui/parser/issue-112188.rs:11:17 | 11 | let Foo { .., x, .. } = f; //~ ERROR expected `}`, found `,` | --^- | | | | | expected `}` | `..` must be at the end and cannot have a trailing comma | help: remove the starting `..` ``` Fixes #112188.
2023-06-06Rollup merge of #112019 - jieyouxu:issue-111554, r=compiler-errorsMatthias Krüger-6/+79
Don't suggest changing `&self` and `&mut self` in function signature to be mutable when taking `&mut self` in closure Current suggestion for when taking a mutable reference to `self` in a closure (as an upvar) will produce a machine-applicable suggestion to change the `self` in the function signature to `mut self`, but does not account for the specialness of implicit self in that it can already have `&` and `&mut` (see #111554). This causes the function signature to become `test(&mut mut self)` which does not seem desirable. ``` error[E0596]: cannot borrow `self` as mutable, as it is not declared as mutable --> src/sound_player.rs:870:11 | 869 | pub fn test(&mut self) { | ---- help: consider changing this to be mutable: `mut self` 870 | || test2(&mut self); | ^^^^^^^^^ cannot borrow as mutable ``` This PR suppresses the "changing this to be mutable" suggestion if the implicit self is either `ImplicitSelfKind::ImmRef` or `ImplicitSelfKind::MutRef`. Fixes #111554.
2023-06-06Rollup merge of #111962 - theIDinside:better-gdb, r=Mark-SimulacrumMatthias Krüger-1/+12
Make GDB Python Pretty Printers loadable after spawning GDB, avoiding required `rust-gdb` Fixes #111961 Makes the Python pretty printer library source'able from within GDB after spawn, making the wrapper script `rust-gdb` become not the required approach to use the pretty printer library. Allows for integration into GUI:s that wrap GDB extremely easy. The previous design complicates this feature.
2023-06-06Rollup merge of #111369 - Nassiel:master, r=oli-obkMatthias Krüger-4/+38
Added custom risc32-imac for esp-espidf target ESP32-C6 and the upcoming ESP32-P4 are the first Espressif chips that support the "A" (atomic) extension of the RISCV specification. As such, they do not work with the existing `riscv32imc-esp-espidf` target and instead need a new one (in this PR) called `riscv32imac-esp-espidf`.
2023-06-06Rollup merge of #111058 - fortanix:raoul/fix_lvi_mitigations, r=cuviperMatthias Krüger-4/+13
Correct fortanix LVI test print function A recent change resulted in a different machine code for the `print` function. This caused the LVI test for this function to fail. This PR: - Fixes the test for the `print` function - Simplified the test a bit so future modifications are more unlikely cc: ``@jethrogb``
2023-06-06Add regression test for #112308Guillaume Gomez-26/+31
2023-06-06Prevent emitting `missing_docs` for `pub extern crate`Guillaume Gomez-2/+6
2023-06-06Auto merge of #112312 - nikic:llvm-16.0.5, r=cuviperbors-1/+1
Update to LLVM 16.0.5 Rebase to LLVM 16.0.5, plus one cherry-pick. Fixes #111823. Fixes #112061. Fixes #112170.
2023-06-06remove `has_error_field` helper methodlcnr-40/+9
2023-06-06Add myself to highfive rotationDeadbeef-0/+1
2023-06-06Add new Tier-3 targets: `loongarch64-unknown-none*`WANG Rui-0/+132
MCP: https://github.com/rust-lang/compiler-team/issues/628
2023-06-05diagnostics: do not suggest type name tweaks on type-inferred closure argsMichael Howell-8/+62
Fixes #111932
2023-06-06Auto merge of #111999 - scottmcm:codegen-less-memcpy, r=compiler-errorsbors-6/+146
Use `load`+`store` instead of `memcpy` for small integer arrays I was inspired by #98892 to see whether, rather than making `mem::swap` do something smart in the library, we could update MIR assignments like `*_1 = *_2` to do something smarter than `memcpy` for sufficiently-small types that doing it inline is going to be better than a `memcpy` call in assembly anyway. After all, special code may help `mem::swap`, but if the "obvious" MIR can just result in the correct thing that helps everything -- other code like `mem::replace`, people doing it manually, and just passing around by value in general -- as well as makes MIR inlining happier since it doesn't need to deal with all the complicated library code if it just sees a couple assignments. LLVM will turn the short, known-length `memcpy`s into direct instructions in the backend, but that's too late for it to be able to remove `alloca`s. In general, replacing `memcpy`s with typed instructions is hard in the middle-end -- even for `memcpy.inline` where it knows it won't be a function call -- is hard [due to poison propagation issues](https://rust-lang.zulipchat.com/#narrow/stream/187780-t-compiler.2Fwg-llvm/topic/memcpy.20vs.20load-store.20for.20MIR.20assignments/near/360376712). So because we know more about the type invariants -- these are typed copies -- rustc can emit something more specific, allowing LLVM to `mem2reg` away the `alloca`s in some situations. #52051 previously did something like this in the library for `mem::swap`, but it ended up regressing during enabling mir inlining (https://github.com/rust-lang/rust/commit/cbbf06b0cd39dc93033568f1e65f5363cbbdebcd), so this has been suboptimal on stable for ≈5 releases now. The code in this PR is narrowly targeted at just integer arrays in LLVM, but works via a new method on the [`LayoutTypeMethods`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_codegen_ssa/traits/trait.LayoutTypeMethods.html) trait, so specific backends based on cg_ssa can enable this for more situations over time, as we find them. I don't want to try to bite off too much in this PR, though. (Transparent newtypes and simple things like the 3×usize `String` would be obvious candidates for a follow-up.) Codegen demonstrations: <https://llvm.godbolt.org/z/fK8hT9aqv> Before: ```llvm define void `@swap_rgb48_old(ptr` noalias nocapture noundef align 2 dereferenceable(6) %x, ptr noalias nocapture noundef align 2 dereferenceable(6) %y) unnamed_addr #1 { %a.i = alloca [3 x i16], align 2 call void `@llvm.lifetime.start.p0(i64` 6, ptr nonnull %a.i) call void `@llvm.memcpy.p0.p0.i64(ptr` noundef nonnull align 2 dereferenceable(6) %a.i, ptr noundef nonnull align 2 dereferenceable(6) %x, i64 6, i1 false) tail call void `@llvm.memcpy.p0.p0.i64(ptr` noundef nonnull align 2 dereferenceable(6) %x, ptr noundef nonnull align 2 dereferenceable(6) %y, i64 6, i1 false) call void `@llvm.memcpy.p0.p0.i64(ptr` noundef nonnull align 2 dereferenceable(6) %y, ptr noundef nonnull align 2 dereferenceable(6) %a.i, i64 6, i1 false) call void `@llvm.lifetime.end.p0(i64` 6, ptr nonnull %a.i) ret void } ``` Note it going to stack: ```nasm swap_rgb48_old: # `@swap_rgb48_old` movzx eax, word ptr [rdi + 4] mov word ptr [rsp - 4], ax mov eax, dword ptr [rdi] mov dword ptr [rsp - 8], eax movzx eax, word ptr [rsi + 4] mov word ptr [rdi + 4], ax mov eax, dword ptr [rsi] mov dword ptr [rdi], eax movzx eax, word ptr [rsp - 4] mov word ptr [rsi + 4], ax mov eax, dword ptr [rsp - 8] mov dword ptr [rsi], eax ret ``` Now: ```llvm define void `@swap_rgb48(ptr` noalias nocapture noundef align 2 dereferenceable(6) %x, ptr noalias nocapture noundef align 2 dereferenceable(6) %y) unnamed_addr #0 { start: %0 = load <3 x i16>, ptr %x, align 2 %1 = load <3 x i16>, ptr %y, align 2 store <3 x i16> %1, ptr %x, align 2 store <3 x i16> %0, ptr %y, align 2 ret void } ``` still lowers to `dword`+`word` operations, but has no stack traffic: ```nasm swap_rgb48: # `@swap_rgb48` mov eax, dword ptr [rdi] movzx ecx, word ptr [rdi + 4] movzx edx, word ptr [rsi + 4] mov r8d, dword ptr [rsi] mov dword ptr [rdi], r8d mov word ptr [rdi + 4], dx mov word ptr [rsi + 4], cx mov dword ptr [rsi], eax ret ``` And as a demonstration that this isn't just `mem::swap`, a `mem::replace` on a small array (since replace doesn't use swap since #83022), which used to be `memcpy`s in LLVM changes in IR ```llvm define void `@replace_short_array(ptr` noalias nocapture noundef sret([3 x i32]) dereferenceable(12) %0, ptr noalias noundef align 4 dereferenceable(12) %r, ptr noalias nocapture noundef readonly dereferenceable(12) %v) unnamed_addr #0 { start: %1 = load <3 x i32>, ptr %r, align 4 store <3 x i32> %1, ptr %0, align 4 %2 = load <3 x i32>, ptr %v, align 4 store <3 x i32> %2, ptr %r, align 4 ret void } ``` but that lowers to reasonable `dword`+`qword` instructions still ```nasm replace_short_array: # `@replace_short_array` mov rax, rdi mov rcx, qword ptr [rsi] mov edi, dword ptr [rsi + 8] mov dword ptr [rax + 8], edi mov qword ptr [rax], rcx mov rcx, qword ptr [rdx] mov edx, dword ptr [rdx + 8] mov dword ptr [rsi + 8], edx mov qword ptr [rsi], rcx ret ```
2023-06-05cleanup some skip_binder -> subst_identityKyle Matsuda-5/+5
2023-06-05Auto merge of #112324 - matthiaskrgr:rollup-qscmi3c, r=matthiaskrgrbors-136/+364
Rollup of 6 pull requests Successful merges: - #112081 (Avoid ICE on `#![doc(test(...)]` with literal parameter) - #112196 (Resolve vars in result from `scrape_region_constraints`) - #112303 (Normalize in infcx instead of globally for `Option::as_deref` suggestion) - #112316 (Ensure space is inserted after keyword in `unused_delims`) - #112318 (Merge method, type and const object safety checks) - #112322 (Don't mention `IMPLIED_BOUNDS_ENTAILMENT` if signatures reference error) Failed merges: - #112251 (rustdoc: convert `if let Some()` that always matches to variable) r? `@ghost` `@rustbot` modify labels: rollup
2023-06-05Rollup merge of #112322 - ↵Matthias Krüger-1/+32
compiler-errors:no-IMPLIED_BOUNDS_ENTAILMENT-if-errs, r=eholk Don't mention `IMPLIED_BOUNDS_ENTAILMENT` if signatures reference error Fixes #112321
2023-06-05Rollup merge of #112318 - oli-obk:assoc_ty_sized_bound_for_object_safety, ↵Matthias Krüger-55/+51
r=compiler-errors Merge method, type and const object safety checks cc `@spastorino` and `@compiler-errors` on the first commit. I believe it to be correct, as the field is only `Some` for assoc types, so just checking the field without checking the assoc kind to be `Type` is fine. The second commit avoids going through all associated items thrice and just goes over all of them once, running the object safety checks per assoc item kind.
2023-06-05Rollup merge of #112316 - clubby789:unused-parens-space, r=compiler-errorsMatthias Krüger-30/+131
Ensure space is inserted after keyword in `unused_delims` Fixes #112276
2023-06-05Rollup merge of #112303 - Nilstrieb:as-deref, r=compiler-errorsMatthias Krüger-39/+89
Normalize in infcx instead of globally for `Option::as_deref` suggestion fixes #112293 The projection may contain inference variables. These inference variables are local to the local inference context. Using `tcx.normalize_erasing_regions` doesn't work here because this method is global and does not have access to the inference context. It's therefore unable to deal with the inference variables. We normalize in the local inference context instead, which knowns about the inference variables. The test looks a little different than the issue example, I made it more minimal and verified that it still ICEs on nightly. Also contains a drive-by fix to properly compare the types. r? `@compiler-errors`
2023-06-05Rollup merge of #112196 - compiler-errors:new-solver-resolv, r=lcnrMatthias Krüger-5/+18
Resolve vars in result from `scrape_region_constraints` Since we perform `type_op::Normalize` in the local infcx when the new solver is enabled, vars aren't necessarily resolved, which triggers this ICE: https://github.com/rust-lang/rust/blob/f85ab544dfbbce7448993c490ad16c176339b939/compiler/rustc_infer/src/infer/nll_relate/mod.rs#L481 There are more tests that go from ICE -> pass due to this change, but I just added revisions to a few for CI. r? `@lcnr`
2023-06-05Rollup merge of #112081 - obeis:doc-test-literal, r=compiler-errorsMatthias Krüger-6/+43
Avoid ICE on `#![doc(test(...)]` with literal parameter Close #109066 r? `@compiler-errors`
2023-06-05Don't mention IMPLIED_BOUNDS_ENTAILMENT if signatures reference errorMichael Goulet-1/+32
2023-06-05Remove redundant InferCtxtExt::fresh_item_substsMichael Goulet-41/+3
2023-06-05Test the PGO/BOLT/LTO optimized x64 Linux compiler on CIJakub Beránek-7/+127
2023-06-05Emit an error when RTN is used with ty/ct paramsMichael Goulet-3/+97
2023-06-05Resolve vars in result from scrape_region_constraintsMichael Goulet-5/+18