The other places are more accurate and up-to-date.
- Link to `std-dev-guide` in CONTRIBUTING.md
Thom and Mara said the guide is in reasonably good shape, and it's tailored more closely to people working on the standard library.
- Link to CONTRIBUTING.md instead of rustc-dev-guide in the main readme
CONTRIBUTING.md has more information and also links the std-dev-guide.
- Link to forge for the list of tested platforms; the one in the readme
was hopelessly out of date.
rustdoc: simplify CSS selectors for item table `.stab`
The module-item and import-item classes are attached to the item-left. Just target that, instead.
normalize before handling simple checks for evaluatability of `ty::Const`
`{{{{{{{ N }}}}}}}` is desugared into a `ConstKind::Unevaluated` for an anonymous `const` item so when calling `is_const_evaluatable` on it we skip the `ConstKind::Param(_) => Ok(())` arm which is incorrect.
Simplify attribute handling in rustc_ast_lowering
Given that attributes is stored in a separate BTreeMap, it's not necessary to pass it in when constructing `hir::Expr`. We can just construct `hir::Expr` and then call `self.lower_attrs` later if it needs attributes.
As most desugaring code don't use attributes, this allows some code cleanup.
Pass on null handle values to child process
Fixes#101645
In Windows, stdio handles are (semantically speaking) `Option<Handle>` where `Handle` is a non-zero value. When spawning a process with `Stdio::Inherit`, Rust currently turns zero values into `-1` values. This has the unfortunate effect of breaking console subprocesses (which typically need stdio) that are spawned from gui applications (that lack stdio by default) because the console process won't be assigned handles from the newly created console (as they usually would in that situation). Worse, `-1` is actually [a valid handle](https://doc.rust-lang.org/std/os/windows/io/struct.OwnedHandle.html) which means "the current process". So if a console process, for example, waits on stdin and it has a `-1` value then the process will end up waiting on itself.
This PR fixes it by propagating the nulls instead of converting them to `-1`.
While I think the current behaviour is a mistake, changing it (however justified) is an API change so I think this PR should at least have some input from t-libs-api. So choosing at random...
r? `@joshtriplett`
Remove `{Early,Late}LintPassObjects`.
`EarlyContextAndPass` wraps a single early lint pass. We aggregate multiple passes into that single pass by using `EarlyLintPassObjects`.
This commit removes `EarlyLintPassObjects` by changing `EarlyContextAndPass` into `EarlyContextAndPasses`. I.e. it just removes a level of indirection. This makes the code simpler and slightly faster.
The commit does likewise for late lints.
r? `@cjgillot`
rustdoc: remove redundant CSS `.import-item .stab { font-size }`
This sets the exact same font size that `.stab` has by default anyway. It used to be slightly different, but dd5ff428ed made it identical.
Rollup of 9 pull requests
Successful merges:
- #104898 (Put all cached values into a central struct instead of just the stable hash)
- #105004 (Fix `emit_unused_delims_expr` ICE)
- #105174 (Suggest removing struct field from destructive binding only in shorthand scenario)
- #105250 (Replace usage of `ResumeTy` in async lowering with `Context`)
- #105286 (Add -Z maximal-hir-to-mir-coverage flag)
- #105320 (rustdoc: simplify CSS selectors on top-doc and non-exhaustive toggles)
- #105349 (Point at args in associated const fn pointers)
- #105362 (Cleanup macro-expanded code in `rustc_type_ir`)
- #105370 (Remove outdated syntax from trait alias pretty printing)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
Remove outdated syntax from trait alias pretty printing
Given the following program:
```rust
#![feature(trait_alias)]
trait A = ?Sized;
fn main() {}
```
Old output of `rustc +nightly ./t.rs -Zunpretty=normal`:
```rust
#![feature(trait_alias)]
trait A for ? Sized ;
fn main() {}
```
New output of `rustc +a ./t.rs -Zunpretty=normal`:
```rust
#![feature(trait_alias)]
trait A = ?Sized;
fn main() {}
```
cc `@durka` (you've written the `FIXME` in #45047, see https://github.com/rust-lang/rust/pull/45047#discussion_r144960751)
Cleanup macro-expanded code in `rustc_type_ir`
We could of course just leave this as-is, but every time I go-to-def to this file it's painful to see all this `(&A(ref __self_1_0),)` stuff.
Point at args in associated const fn pointers
Tiny follow-up to #105201, not so sure it's worth it but 🤷
The UI test example is a bit more compelling when it's `GlUniformScalar::FACTORY`
r? `@cjgillot`
Add -Z maximal-hir-to-mir-coverage flag
This PR adds a new unstable flag `-Z maximal-hir-to-mir-coverage` that changes the behavior of `maybe_lint_level_root_bounded`, pursuant to [a discussion on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Mapping.20MIR.20to.20HIR). When enabled, this function will not search upwards for a lint root, but rather immediately return the provided HIR node ID. This change increases the granularity of the mapping between MIR locations and HIR nodes inside the `SourceScopeLocalData` data structures. This increase in granularity is useful for rustc consumers like [Flowistry](https://github.com/willcrichton/flowistry) that rely on getting source-mapping information about the MIR CFG that is as precise as possible.
A test `maximal_mir_to_hir_coverage.rs` has been added to verify that this flag does not break anything.
r? `@cjgillot`
cc `@gavinleroy`
Replace usage of `ResumeTy` in async lowering with `Context`
Replaces using `ResumeTy` / `get_context` in favor of using `&'static mut Context<'_>`.
Usage of the `'static` lifetime here is technically "cheating", and replaces the raw pointer in `ResumeTy` and the `get_context` fn that pulls the correct lifetimes out of thin air.
fixes https://github.com/rust-lang/rust/issues/104828 and https://github.com/rust-lang/rust/pull/104321#issuecomment-1336363077
r? `@oli-obk`
Put all cached values into a central struct instead of just the stable hash
cc `@nnethercote`
this allows re-use of the type for Predicate without duplicating all the logic for the non-hash cached fields
Re-enable removal of ZST writes to unions
This was previously disabled because Miri was lazily allocating unsized locals. But we aren't doing that anymore since https://github.com/rust-lang/rust/pull/98831, so we can have this optimization back.
Rollup of 11 pull requests
Successful merges:
- #104439 (Add prototype to generate `COPYRIGHT` from REUSE metadata)
- #105005 (On E0195 point at where clause lifetime bounds)
- #105098 (propagate the error from parsing enum variant to the parser and emit out)
- #105243 (remove no-op 'let _ = ')
- #105254 (Recurse into nested impl-trait when computing variance.)
- #105287 (Synthesize substitutions for bad auto traits in dyn types)
- #105310 (Be more careful about unresolved exprs in suggestion)
- #105318 (Make `get_impl_future_output_ty` work with AFIT)
- #105339 (support `ConstKind::Expr` in `is_const_evaluatable` and `WfPredicates::compute`)
- #105340 (Avoid ICE by accounting for missing type)
- #105342 (Make `note_obligation_cause_code` take a `impl ToPredicate` for predicate)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup