about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-09-28Auto merge of #114882 - ChrisDenton:riddle-me, r=dtolnaybors-154/+138
Update windows ffi bindings Bump `windows-bindgen` to version 0.51.1. This brings with it some changes to the generated FFI bindings, but little that affects the code. One change that does have more of an impact is `SOCKET` being `usize` instead of either `u64` or `u32` (as is used in std's public `SOCKET` type). However, it's now easy enough to abstract over that difference. Finally I added a few new bindings that are likely to be used in pending PRs, mostly to make sure they're ok with the new metadata. r? libs
2023-09-28Auto merge of #114428 - ChaiTRex:master, r=dtolnaybors-3/+3
Convert `Into<ExitStatus> for ExitStatusError` to `From<ExitStatusError> for ExitStatus` in `std::process` Implementing suggestion from https://github.com/rust-lang/rust/issues/84908#issuecomment-912352902: > I believe the impl on ExitStatusError should be > > ```rust > impl From<ExitStatusError> for ExitStatus > ``` > > rather than > > ```rust > impl Into<ExitStatus> for ExitStatusError > ``` > > (there is generally never anything implemented as `Into` first, because implementing `From` reflexively provides `Into`)
2023-09-28Auto merge of #98704 - vthib:impl-from-raw-for-childstd-structs, r=dtolnaybors-2/+95
Implement From<OwnedFd/Handle> for ChildStdin/out/err object ## Summary Comments in `library/std/src/process.rs` ( https://github.com/rust-lang/rust/commit/ab08639e5950f5c8a42a2870c9636181308c3686 ) indicates that `ChildStdin`, `ChildStdout`, `ChildStderr` implements some traits that are not actually implemented: `FromRawFd`, `FromRawHandle`, and the `From<OwnedFd>/From<OwnedHandle>` from the io_safety feature. In this PR I implement `FromRawHandle` and `FromRawFd` for those 3 objects. ## Usecase I have a usecase where those implementations are basically needed. I want to customize in the `Command::spawn` API how the pipes for the parent/child communications are created (mainly to strengthen the security attributes on them). I can properly setup the pipes, and the "child" handles can be provided to `Child::spawn` easily using `Stdio::from_raw_handle`. However, there is no way to generate the `ChildStd*` objects from the raw handle of the created name pipe, which would be very useful to still expose the same API than in other OS (basically a `spawn(...) -> (Child, ChildStdin, ChildStdout, ChildSterr)`, where on windows this is customized), and to for example use `tokio::ChildStdin::from_std` afterwards. ## Questions * Are those impls OK to add? I have searched to see if those impls were missing on purpose, or if it was just never implemented because never needed. I haven't found any indication on why they couldn't be added, although the user clearly has to be very careful that the handle provided makes sense (i think, mainly that it is in overlapped mode for windows). * If this change is ok, adding the impls for the io_safety feature would probably be best, or should it be done in another PR? * I just copy-pasted the `#[stable(...)]` attributes, but the `since` value has to be updated, I'm not sure to which value.
2023-09-28Auto merge of #116222 - matthiaskrgr:rollup-dnag90q, r=matthiaskrgrbors-132/+263
Rollup of 6 pull requests Successful merges: - #112959 (Change the wording in `std::fmt::Write::write_str`) - #115535 (format doc-comment code examples in std::process) - #115888 (fix a comment about assert_receiver_is_total_eq) - #116211 (more clippy complextity fixes ) - #116213 (Document -Zlink-native-libraries) - #116215 (Tweak wording of missing angle backets in qualified path) r? `@ghost` `@rustbot` modify labels: rollup
2023-09-28Rollup merge of #116215 - estebank:parse-type-angle-bracket-tweak, ↵Matthias Krüger-32/+162
r=compiler-errors Tweak wording of missing angle backets in qualified path
2023-09-28Rollup merge of #116213 - tmandry:doclnl, r=ehussMatthias Krüger-0/+8
Document -Zlink-native-libraries Originally added in #70095.
2023-09-28Rollup merge of #116211 - matthiaskrgr:clippy3, r=compiler-errorsMatthias Krüger-24/+19
more clippy complextity fixes redundant_guards, useless_format, clone_on_copy
2023-09-28Rollup merge of #115888 - RalfJung:assert_receiver_is_total_eq, r=dtolnayMatthias Krüger-3/+3
fix a comment about assert_receiver_is_total_eq "a type implements #[deriving]" doesn't make any sense, so I assume they meant "implement `Eq`"? Also the attribute is called `derive`.
2023-09-28Rollup merge of #115535 - tshepang:patch-2, r=dtolnayMatthias Krüger-71/+69
format doc-comment code examples in std::process
2023-09-28Rollup merge of #112959 - tbu-:pr_fmt_error_wording, r=dtolnayMatthias Krüger-2/+2
Change the wording in `std::fmt::Write::write_str` Refer to the error instead of expanding its name.
2023-09-28Update stability attribute for child stream From implsDavid Tolnay-6/+6
2023-09-28Auto merge of #114041 - nvzqz:nvzqz/shared_from_array, r=dtolnaybors-0/+42
Implement `From<[T; N]>` for `Rc<[T]>` and `Arc<[T]>` Given that `Box<[T]>` already has this conversion, the shared counterparts should also have it.
2023-09-27Fix "unresolved link to std::fmt::Error" David Tolnay-1/+1
error: unresolved link to `std::fmt::Error` --> library/core/src/fmt/mod.rs:115:52 | 115 | /// This function will return an instance of [`std::fmt::Error`] on error. | | = note: `-D rustdoc::broken-intra-doc-links` implied by `-D warnings`
2023-09-28Auto merge of #111278 - EFanZh:implement-from-array-refs-for-vec, r=dtolnaybors-0/+40
Implement `From<{&,&mut} [T; N]>` for `Vec<T>` where `T: Clone` Currently, if `T` implements `Clone`, we can create a `Vec<T>` from an `&[T]` or an `&mut [T]`, can we also support creating a `Vec<T>` from an `&[T; N]` or an `&mut [T; N]`? Also, do I need to add `#[inline]` to the implementation? ACP: rust-lang/libs-team#220. [Accepted] Closes #100880.
2023-09-28Auto merge of #116208 - matthiaskrgr:the_loop_that_wasnt, r=GuillaumeGomezbors-1/+1
rustdoc: while -> if we will always return once we step inside the while-loop thus `if` is sufficient here
2023-09-28Auto merge of #116204 - Alexendoo:rustc-lint-macro-paths, r=cjgillotbors-84/+78
Use absolute paths in rustc_lint::passes macros A cosmetic change, so the callsite doesn't have to import things. Makes nicer for us to try in clippy
2023-09-28Tweak wording of missing angle backets in qualified pathEsteban Küber-32/+162
2023-09-27Document -Zlink-native-librariesTyler Mandry-0/+8
Originally added in #70095.
2023-09-27Auto merge of #116148 - DaniPopes:rustdoc-type-layout-ws, r=jshabors-2/+2
Fix whitespace in rustdoc type_layout.html `Size: <size>` was missing a space after the colon: ![image](https://github.com/rust-lang/rust/assets/57450786/c5a672f3-a28a-4b56-91e7-a4e6ffc8106e)
2023-09-28don't clone copy typesMatthias Krüger-3/+3
2023-09-27fix clippy::{redundant_guards, useless_format}Matthias Krüger-21/+16
2023-09-27Auto merge of #109597 - cjgillot:gvn, r=oli-obkbors-23/+7204
Implement a global value numbering MIR optimization The aim of this pass is to avoid repeated computations by reusing past assignments. It is based on an analysis of SSA locals, in order to perform a restricted form of common subexpression elimination. By opportunity, this pass allows for some simplifications by combining assignments. For instance, this pass could be able to see through projections of aggregates to directly reuse the aggregate field (not in this PR). We handle references by assigning a different "provenance" index to each `Ref`/`AddressOf` rvalue. This ensure that we do not spuriously merge borrows that should not be merged. Meanwhile, we consider all the derefs of an immutable reference to a freeze type to give the same value: ```rust _a = *_b // _b is &Freeze _c = *_b // replaced by _c = _a ```
2023-09-27rustdoc: while -> ifMatthias Krüger-1/+1
we will always return once we step inside the while-loop thus `if` is sufficient here
2023-09-27Auto merge of #114901 - compiler-errors:style-guide-wc, r=calebcartwrightbors-6/+32
Amend style guide section for formatting where clauses in type aliases This PR has two parts: 1. Amend wording about breaking before or after the `=`, which is a style guide bugfix to align it with current rustfmt behavior. 2. Explain how to format trailing (#89122) where clauses, which are preferred in both GATs (#90076) and type aliases (#114662). r? `@joshtriplett`
2023-09-27Auto merge of #116202 - emmanuel-ferdman:wip, r=ehussbors-1/+1
Update location of `personality/gcc.rs` **PR Summary**: PR updates the location of `personality/gcc.rs` file in the docs.
2023-09-27Update location of personalityEmmanuel Ferdman-1/+1
2023-09-27Use absolute paths in rustc_lint::passes macrosAlex Macleod-84/+78
A cosmetic change, so the callsite doesn't have to import things
2023-09-27Auto merge of #115887 - RalfJung:pat, r=oli-obkbors-17/+27
thir::pattern: update some comments and error type names Follow-up to [these comments](https://github.com/rust-lang/rust/pull/105750#pullrequestreview-1629697578). Please carefully fact-check, I'm new to this area of the compiler!
2023-09-27Auto merge of #116093 - RalfJung:link_llvm_intrinsics, r=oli-obkbors-3/+3
make link_llvm_intrinsics and platform_intrinsics features internal These are both a lot like `feature(intrinsics)`, just slightly different syntax, so IMO it should be treated the same (also in terms of: if you get ICEs with this feature, that's on you -- we are not doing "nice" type-checking for intrinsics).
2023-09-27Auto merge of #116193 - matthiaskrgr:rollup-wpt7m5t, r=matthiaskrgrbors-235/+272
Rollup of 4 pull requests Successful merges: - #115934 (Split out the stable part of smir into its own crate to prevent accidental usage of forever unstable things) - #116149 (Anonymize binders for `refining_impl_trait` check) - #116178 (Add test for `const async fn`) - #116187 (Add context to `let: Ty = loop { break };`) r? `@ghost` `@rustbot` modify labels: rollup
2023-09-27Rollup merge of #116187 - estebank:small-tweak, r=compiler-errorsMatthias Krüger-5/+23
Add context to `let: Ty = loop { break };` We weren't accounting for the case where `break` was immediately within the `loop` block.
2023-09-27Rollup merge of #116178 - ↵Matthias Krüger-0/+18
Milo123459:milo/add-test-for-const-async-function-in-main, r=wesleywiser Add test for `const async fn` This adds a test for #102796
2023-09-27Rollup merge of #116149 - compiler-errors:anonymize, r=lcnrMatthias Krüger-4/+38
Anonymize binders for `refining_impl_trait` check We're naively using the equality impl for `ty::Clause` in the refinement check, which is okay *except* for binders, which carry some information about where they come from in the AST. Those locations are not gonna be equal between traits and impls, so anonymize those clauses so that this doesn't matter. Fixes #116135
2023-09-27Rollup merge of #115934 - oli-obk:smir_identity, r=spastorinoMatthias Krüger-226/+193
Split out the stable part of smir into its own crate to prevent accidental usage of forever unstable things Some groundwork for being able to work on https://github.com/rust-lang/project-stable-mir/issues/27 at all r? `@spastorino`
2023-09-27Auto merge of #116166 - Zalathar:unreachable, r=cjgillotbors-1/+5
Skip MIR pass `UnreachablePropagation` when coverage is enabled When coverage instrumentation and MIR opts are both enabled, coverage relies on two assumptions: - MIR opts that would delete `StatementKind::Coverage` statements instead move them into bb0 and change them to `CoverageKind::Unreachable`. - MIR opts won't delete all `CoverageKind::Counter` statements from an instrumented function. Most MIR opts naturally satisfy the second assumption, because they won't remove coverage statements from bb0, but `UnreachablePropagation` can do so if it finds that bb0 is unreachable. If this happens, LLVM thinks the function isn't instrumented, and it vanishes from coverage reports. A proper solution won't be possible until after per-function coverage info lands in #116046, but for now we can avoid the problem by turning off this particular pass when coverage instrumentation is enabled. --- cc `@cjgillot` since I found this while investigating coverage problems encountered by #113970 `@rustbot` label +A-code-coverage +A-mir-opt
2023-09-27Auto merge of #116189 - weihanglo:update-cargo, r=weihanglobors-2/+2
Update cargo 11 commits in 414d9e3a6d8096f3e276234ce220c868767a8792..e6aabe8b3fcf639be3a5bf68e77853bd7b3fa27d 2023-09-22 07:03:57 +0000 to 2023-09-26 16:31:53 +0000 - Use full target spec for `cargo rustc --print --target` (rust-lang/cargo#12743) - feat(embedded): Hack in code fence support (rust-lang/cargo#12681) - chore(ci): Update Renovate schema (rust-lang/cargo#12741) - more specific registry index not found msg (rust-lang/cargo#12732) - docs: warn about upload timeout (rust-lang/cargo#12733) - Fix some typos (rust-lang/cargo#12730) - upgrade gitoxide to v0.54 (rust-lang/cargo#12731) - Update target-arch-aware crates to support mips r6 targets (rust-lang/cargo#12720) - Buffer console status messages. (rust-lang/cargo#12727) - Fix spurious errors with networking tests. (rust-lang/cargo#12726) - refactor(SourceId): merge `name` and `alt_registry_key` into one enum (rust-lang/cargo#12675) r? ghost
2023-09-27Auto merge of #116163 - compiler-errors:lazyness, r=oli-obkbors-189/+128
Don't store lazyness in `DefKind::TyAlias` 1. Don't store lazyness of a type alias in its `DefKind`, but instead via a query. 2. This allows us to treat type aliases as lazy if `#[feature(lazy_type_alias)]` *OR* if the alias contains a TAIT, rather than having checks for both in separate parts of the codebase. r? `@oli-obk` cc `@fmease`
2023-09-27Update cargoWeihang Lo-2/+2
New license exceptions from gix: * (byteyarn", "Apache-2.0") * ("encoding_rs", "(Apache-2.0 OR MIT) AND BSD-3-Clause")
2023-09-27Auto merge of #116156 - oli-obk:opaque_place_unwrap, r=compiler-errorsbors-1/+37
Only prevent field projections into opaque types, not types containing opaque types fixes https://github.com/rust-lang/rust/issues/115778 I did not think that original condition through properly... I'll also need to check the similar check around the other `ProjectionKind::OpaqueCast` creation site (this one is in hir, the other one is in mir), but I'll do that change in another PR that doesn't go into a beta backport.
2023-09-26Add context to `let: Ty = loop { break };`Esteban Küber-5/+23
We weren't accounting for the case where `break` was immediately within the `loop` block.
2023-09-26Auto merge of #116144 - lcnr:subst-less, r=oli-obkbors-75/+66
subst -> instantiate continues #110793, there are still quite a few uses of `subst` and `substitute`, but changing them all in the same PR was a bit too much, so I've stopped here for now.
2023-09-26add testMilo-0/+18
fix tidy remove dir
2023-09-26Auto merge of #116102 - cjgillot:indirect-scalar, r=oli-obkbors-12/+11
Correct codegen of `ConstValue::Indirect` scalar and scalar pair This concerns 3 tricky cases with `ConstValue::Indirect`: - if we want a non-pointer scalar; - if we have non-zero offset; - if offset points to uninit memory => generate `poison` instead of an ICE. This case could happen in unreachable code, trying to extract a field from the wrong variant. Those cases are not currently emitted by the compiler, but are exercised by https://github.com/rust-lang/rust/pull/116012.
2023-09-26Anonymize binders for refining_impl_trait checkMichael Goulet-4/+38
2023-09-26Auto merge of #116154 - cjgillot:retain-cfg, r=oli-obkbors-19/+24
Use Vec::retain in remove_dead_blocks. r? `@ghost`
2023-09-26Explicit simplify_place.Camille GILLOT-8/+19
2023-09-26Auto merge of #116175 - matthiaskrgr:rollup-cwteiwy, r=matthiaskrgrbors-27/+131
Rollup of 5 pull requests Successful merges: - #116099 (Add regression test for issue #79865) - #116131 (Rename `cold_path` to `outline`) - #116151 (Fix typo in rustdoc unstable features doc) - #116153 (Update books) - #116162 (Gate and validate `#[rustc_safe_intrinsic]`) r? `@ghost` `@rustbot` modify labels: rollup
2023-09-26Rollup merge of #116162 - fmease:gate-n-validate-rustc_safe_intrinsic, ↵Matthias Krüger-11/+79
r=Nilstrieb Gate and validate `#[rustc_safe_intrinsic]` Copied over from #116159: > This was added as ungated in https://github.com/rust-lang/rust/pull/100719/files#diff-09c366d3ad3ec9a42125253b610ca83cad6b156aa2a723f6c7e83eddef7b1e8fR502, probably because the author looked at the surrounding attributes, which are ungated because they are gated specially behind the staged_api feature. > > I don't think we need to crater this, the attribute is entirely useless without the intrinsics feature, which is already unstable.. r? ``@Nilstrieb``
2023-09-26Rollup merge of #116153 - rustbot:docs-update, r=ehussMatthias Krüger-0/+0
Update books ## rust-embedded/book 1 commits in 99ad2847b865e96d8ae7b333d3ee96963557e621..eac173690b8cc99094e1d88bd49dd61127fbd285 2023-09-12 07:34:44 UTC to 2023-09-12 07:34:44 UTC - USB connector-type correction (rust-embedded/book#360) ## rust-lang/nomicon 1 commits in e3f3af69dce71cd37a785bccb7e58449197d940c..ddfa4214487686e91b21aa29afb972c08a8f0d5b 2023-09-22 17:04:10 UTC to 2023-09-22 17:04:10 UTC - Fill "Beneath `std`" (rust-lang/nomicon#413) ## rust-lang/reference 1 commits in ee7c676fd6e287459cb407337652412c990686c0..5262e1c3b43a2c489df8f6717683a44c7a2260fd 2023-09-18 18:28:31 UTC to 2023-09-18 18:28:31 UTC - we reserve the right to reduce our amount of UB (rust-lang/reference#1397) ## rust-lang/rustc-dev-guide 8 commits in 08bb147d51e815b96e8db7ba4cf870f201c11ff8..a13b7c28ed705891c681ce5417b3d1cdb12cecd1 2023-09-25 05:14:41 UTC to 2023-09-11 21:29:18 UTC - Clarify all the `{AP,RP}IT{,IT}` impl trait types (rust-lang/rustc-dev-guide#1798) - Modify build instructions for optimized build (rust-lang/rustc-dev-guide#1795) - Remove outdated references to coverage debug code (rust-lang/rustc-dev-guide#1797) - Add deep dive document about early/late bound parameters interacting with turbofish (rust-lang/rustc-dev-guide#1794) - explain the MIR const vs TY const situation (rust-lang/rustc-dev-guide#1793) - fix type name (rust-lang/rustc-dev-guide#1792) - Clarify that `run-coverage` only runs in some of the CI jobs (rust-lang/rustc-dev-guide#1791) - Document the `coverage-map` and `run-coverage` test suites (rust-lang/rustc-dev-guide#1790)
2023-09-26Rollup merge of #116151 - DaniPopes:rustdoc-unstable-typo, r=fmeaseMatthias Krüger-1/+1
Fix typo in rustdoc unstable features doc