| Age | Commit message (Collapse) | Author | Lines |
|
There is no `reset` anymore
|
|
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.
|
|
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.
|
|
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
|
|
core/slice: Fix inconsistency between docs for `rotate_left` and `rotate_right`
A minor fix for documentation inconsistency as shown below:
## Before:

## After:

Docs url: https://doc.rust-lang.org/stable/core/primitive.slice.html#method.rotate_left
|
|
rustdoc: rename `issue-\d+.rs` tests to have meaningful names
|
|
Add regression test for rust-lang#56098
Closes #56098
|
|
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
|
|
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`)
|
|
|
|
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.
|
|
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
|
|
r=compiler-errors
Tweak wording of missing angle backets in qualified path
|
|
Document -Zlink-native-libraries
Originally added in #70095.
|
|
more clippy complextity fixes
redundant_guards, useless_format, clone_on_copy
|
|
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`.
|
|
format doc-comment code examples in std::process
|
|
Change the wording in `std::fmt::Write::write_str`
Refer to the error instead of expanding its name.
|
|
|
|
|
|
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.
|
|
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`
|
|
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.
|
|
rustdoc: while -> if
we will always return once we step inside the while-loop thus `if` is sufficient here
|
|
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
|
|
|
|
|
|
Originally added in #70095.
|
|
|
|
|
|
Fix whitespace in rustdoc type_layout.html
`Size: <size>` was missing a space after the colon:

|
|
|
|
|
|
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
```
|
|
we will always return once we step inside the while-loop thus `if` is sufficient here
|
|
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`
|
|
|
|
|
|
Update location of `personality/gcc.rs`
**PR Summary**:
PR updates the location of `personality/gcc.rs` file in the docs.
|
|
|
|
A cosmetic change, so the callsite doesn't have to import things
|
|
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!
|
|
|
|
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).
|
|
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
|
|
Add context to `let: Ty = loop { break };`
We weren't accounting for the case where `break` was immediately within the `loop` block.
|
|
Milo123459:milo/add-test-for-const-async-function-in-main, r=wesleywiser
Add test for `const async fn`
This adds a test for #102796
|
|
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
|
|
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`
|
|
|