| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
Create new lint `option_map_or_err_ok`
Fixes #10045.
For the following code:
```rust
let opt = Some(1);
opt.map_or(Err("error"), Ok);
```
It suggests to instead write:
```rust
let opt = Some(1);
opt.ok_or("error");
```
r? `@flip1995`
changelog: Create new lint `option_map_or_err_ok`
|
|
|
|
r=flip1995
Simplify code for `result_map_or_else_none`
As mentioned in https://github.com/rust-lang/rust-clippy/pull/11864.
r? `@flip1995`
changelog: Simplify code for `result_map_or_else_none`
|
|
Rollup of 9 pull requests
Successful merges:
- #118220 (general improvements/fixes on bootstrap)
- #118251 (rustdoc-search: avoid infinite where clause unbox)
- #118253 (Replace `option.map(cond) == Some(true)` with `option.is_some_and(cond)`)
- #118255 (Request that rust-analyzer changes are sent upstream first if possible)
- #118259 (Move EagerResolution to rustc_infer::infer::resolve)
- #118262 (Relate Inherent Associated Types using eq)
- #118266 (Move stuff around on `stable_mir` and `rustc_smir` crate)
- #118271 (Separate `NaN`/`Inf` floats with `_`)
- #118274 (Fix smir's `Ty::Ref` pretty printing)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
test Miri on 32bit FreeBSD
|
|
|
|
|
|
sync_cg_clif-2023-11-25
|
|
sync_cg_clif-2023-11-25
|
|
Implement another batch of vendor intrinsics
|
|
|
|
|
|
|
|
|
|
|
|
Fix smir's `Ty::Ref` pretty printing
Add `&` or `&mut` to reference when generating a string for `TyKind::Ref`.
r? `@ouz-a`
|
|
Separate `NaN`/`Inf` floats with `_`
r? RalfJung
Fixes #118221
No test 🤷 unless you know a good way to print an `ImmTy` in a unit test?
|
|
Move stuff around on `stable_mir` and `rustc_smir` crate
1. Break down rustc_smir/mod.rs file.
- This file was getting too big and causing a lot of merge conflicts.
All these changes shouldn't be visible to users since this module is private.
2. Move the compiler interface defs to its own module
- Separate items that are exposed in the `stable_mir` crate to be used
by the compiler from items that we expect to be used by tool developers.
|
|
Relate Inherent Associated Types using eq
We should call `eq` instead of `sup` as we're relating `Ty` directly and not `Binder<TraitRef>`.
This is part of #118118 but unrelated to that PR.
r? `@compiler-errors` `@lcnr`
|
|
r=compiler-errors
Move EagerResolution to rustc_infer::infer::resolve
`EagerResolver` fits better in `rustc_infer::infer::resolver`.
Started to disentagle #118118 that has a lot of unrelated things.
r? `@compiler-errors` `@lcnr`
|
|
Request that rust-analyzer changes are sent upstream first if possible
This automates `@lnicola's` comment https://github.com/rust-lang/rust/pull/118253#issuecomment-1825925242.
Rustbot will write a comment similar to https://github.com/rust-lang/rust/pull/116743#issuecomment-1763178813.
|
|
Replace `option.map(cond) == Some(true)` with `option.is_some_and(cond)`
Requested by `@fmease` in https://github.com/rust-lang/rust/pull/118226#pullrequestreview-1747432292.
There is also a much larger number of `option.map_or(false, cond)` that can be changed separately if someone wants.
r? fmease
|
|
rustdoc-search: avoid infinite where clause unbox
Fixes #118242
|
|
general improvements/fixes on bootstrap
- adds #117813 into change tracker https://github.com/rust-lang/rust/pull/118220/commits/6d9b92f83fc024d4e86fc90436860903829289bb
- fixes a bug in change tracker https://github.com/rust-lang/rust/pull/118220/commits/63a44109525d7ead76390cf50024939b2118b5ba
- relocates `CONFIG_CHANGE_HISTORY` https://github.com/rust-lang/rust/pull/118220/commits/a7dcb984f644eaa56d91028abcc6e71c2cc2511b
|
|
|
|
|
|
Validate there are no critical call edges in optimized MIR
|
|
Rustup
|
|
|
|
Minor `rustc_mir_dataflow` cleanups
r? `@cjgillot`
|
|
|
|
|
|
|
|
Make PlaceholderReplacer shallow_resolver and recur when infer vars
This makes resolve type and const infer vars resolve.
Given:
```rust
#![feature(inherent_associated_types)]
#![allow(incomplete_features)]
struct Foo<T>(T);
impl<'a> Foo<fn(&'a ())> {
type Assoc = &'a ();
}
fn bar(_: for<'a> fn(Foo<fn(Foo<fn(&'static ())>::Assoc)>::Assoc)) {}
fn main() {}
```
We should normalize `for<'a> fn(Foo<fn(Foo<fn(&'static ())>::Assoc)>::Assoc)` to `for<'0> fn(&'1 ())` with `'1 == '0` and `'0 == 'static` constraints. We have to resolve `'1` to `'static` in the infcx associated to `PlaceholderReplacer`.
This is part of https://github.com/rust-lang/rust/pull/118118 but unrelated to that PR.
r? `@compiler-errors` `@lcnr`
|
|
This removes the check to ensure that `rustfix` between
* src/tools/cargo
* src/tools/compiletest
has the same version,
since `rust-lang/rustfix` has migrated to under `rust-lang/cargo`.
|
|
|
|
Optimize QueryArena allocation
This shifts the WorkerLocal wrapper to be outside the QueryArena, meaning that instead of having each query allocate distinct arenas per-worker we allocate the full set of arenas per-worker. This is primarily a code size optimization (locally, ~85 kilobytes, [perf is reporting >100 kilobytes](https://perf.rust-lang.org/compare.html?start=1fd418f92ed13db88a21865ba5d909abcf16b6cc&end=884c95a3f1fe8d28630ec3cdb0c8f95b2e539fde&stat=instructions%3Au&tab=artifact-size)), saving a bunch of code in the initialization of the arenas which was previously duplicated lots of times (per arena type).
Additionally this tells LLVM that the thread count can't be zero in this code (I believe this is true?) which shaves some small amount of bytes off as well since we eliminate checks for zero in the vec allocations.
|
|
This explains why we don't have to worry about bcb0 having multiple in-edges.
|
|
`BcbBranch` represented an out-edge of a coverage graph node, but would
silently refer to a node instead in cases where that node only had one in-edge.
Instead we now refer to a graph edge as a `(from_bcb, to_bcb)` pair, or
sometimes as just one of those nodes when the other node is implied by the
surrounding context. The case of sole in-edges is handled by special code added
directly to `get_or_make_edge_counter_operand`.
|
|
This was previously a helper method in `MakeBcbCounters`, but putting it in the
graph lets us call it from `BcbBranch`, and gives us a more fine-grained
borrow.
|
|
In some cases we need to prepare a coverage expression that is the sum of an
arbitrary number of other terms. This patch simplifies the code paths that
build those sums.
This causes some churn in the mappings, because the previous code was building
its sums in a somewhat idiosyncratic order.
|
|
This means that we no longer have to manage the distinction between
`BcbCounter` and `CovTerm` when preparing expressions.
|
|
Now that this code path unconditionally calls `make_branch_counters`, we might
as well make that method responsible for creating the node's counter as well,
since it needs the resulting term anyway.
|
|
This lets us avoid creating two copies of the node's branch list.
|
|
|
|
They are for more specific cases than old benches.
Also, better usage of blackbox
|
|
Fix build on Solaris after #117815.
|
|
|