about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-09-28Remove outdated commentMaybe Waffle-2/+1
There is no `reset` anymore
2023-09-28Auto merge of #116199 - Urgau:simplify-invalid_ref_casting, r=cjgillotbors-134/+182
Simplify some of the logic in the `invalid_reference_casting` lint This PR simplifies 2 areas of the logic for the `invalid_reference_casting` lint: - The init detection: we now use the newly added `expr_or_init` function instead of a manual detection - The ref-to-mut-ptr casting detection logic: I simplified this logic by caring less hardly about the order of the casting operations Those two simplifications permits us to detect more cases, as can be seen in the test output changes.
2023-09-28Auto merge of #116227 - nikic:update-llvm-14, r=cuviperbors-0/+0
Update LLVM submodule Update LLVM submodule to pull in additional 17.x backports. Fixes https://github.com/rust-lang/rust/issues/115970. Fixes miscompile from https://github.com/rust-lang/rust/pull/115554. Fixes miscompile from https://github.com/rust-lang/rust/pull/102099. Fixes inlining regressions mentioned at https://github.com/rust-lang/llvm-project/pull/153.
2023-09-28Auto merge of #116230 - matthiaskrgr:rollup-hi1ciwy, r=matthiaskrgrbors-1/+64
Rollup of 3 pull requests Successful merges: - #116191 (Add regression test for rust-lang#56098) - #116214 (rustdoc: rename `issue-\d+.rs` tests to have meaningful names) - #116221 (core/slice: Fix inconsistency between docs for `rotate_left` and `rotate_right`) r? `@ghost` `@rustbot` modify labels: rollup
2023-09-28Rollup merge of #116221 - ArchUsr64:patch-1, r=ChrisDentonMatthias Krüger-1/+1
core/slice: Fix inconsistency between docs for `rotate_left` and `rotate_right` A minor fix for documentation inconsistency as shown below: ## Before: ![2023_09_28_0k3_Kleki](https://github.com/rust-lang/rust/assets/83179501/569a49d3-0d72-49ac-92a2-ef5e1d94130b) ## After: ![image](https://github.com/rust-lang/rust/assets/83179501/afd0c8d7-6fb7-4878-801b-b47c8fe23c7d) Docs url: https://doc.rust-lang.org/stable/core/primitive.slice.html#method.rotate_left
2023-09-28Rollup merge of #116214 - notriddle:master, r=aDotInTheVoidMatthias Krüger-0/+60
rustdoc: rename `issue-\d+.rs` tests to have meaningful names
2023-09-28Rollup merge of #116191 - apekros:issue-56098, r=petrochenkovMatthias Krüger-0/+3
Add regression test for rust-lang#56098 Closes #56098
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-28Update LLVM submoduleNikita Popov-0/+0
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-28changed 'rotate' to 'rotating'Anshul-1/+1
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-27rustdoc: add URLs for test issuesMichael Howell-0/+25
2023-09-27Document -Zlink-native-librariesTyler Mandry-0/+8
Originally added in #70095.
2023-09-27Rename issue-\d+.rs tests to have meaningful namesMichael Howell-0/+0
2023-09-27Add `crate_name` to test so that it can be renamedMichael Howell-0/+35
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-27Fix ICE by introducing an expr_or_init variant for outside bodiesUrgau-3/+44
2023-09-27Simplify casting logic of the invalid_reference_casting lintUrgau-105/+87
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-27Prefer expr_or_init over manual init detectionUrgau-49/+74
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-27Add regression test for rust-lang#56098apekros-0/+3