- Don't touch rustc's `-Zon-broken-pipe=kill` env var in `compile.rs`.
- Use an untracked env var to pass `-Zon-broken-pipe=kill` for tools but
skip cargo still, because cargo wants `-Zon-broken-pipe=kill` unset.
Remove `CombineFields`
This conflicts with #131263, but if this one lands first then perhaps #131263 could then go ahead and remove all the branching on solver in `TypeRelating`. We could perhaps then rename `TypeRelating` to `OldSolverRelating` or something, idk.
r? lcnr
Rollup of 7 pull requests
Successful merges:
- #128721 (Don't allow the `#[pointee]` attribute where it doesn't belong)
- #130479 (skip in-tree compiler build for llvm-bitcode-linker if ci-rustc is on)
- #130899 (Couple of changes to make it easier to compile rustc for wasm)
- #131225 (`rustc_borrowck` memory management tweaks)
- #131351 (Remove valgrind test suite and support from compiletest, bootstrap and opt-dist)
- #131359 (Fix used_underscore_binding in rustc_serialize)
- #131367 (Mark Boxy as on vacation)
r? `@ghost`
`@rustbot` modify labels: rollup
Fix used_underscore_binding in rustc_serialize
Hi,
This PR fixes the following clippy warnings in rustc_serialize
```
warning: used underscore-prefixed binding
--> compiler/rustc_serialize/src/opaque.rs:443:27
|
443 | debug_assert_eq!((_end_pos - _start_pos), IntEncodedWithFixedSize::ENCODED_SIZE);
| ^^^^^^^^
|
note: binding is defined here
--> compiler/rustc_serialize/src/opaque.rs:442:13
|
442 | let _end_pos = e.position();
| ^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_binding
= note: requested on the command line with `-W clippy::used-underscore-binding`
warning: used underscore-prefixed binding
--> compiler/rustc_serialize/src/opaque.rs:443:38
|
443 | debug_assert_eq!((_end_pos - _start_pos), IntEncodedWithFixedSize::ENCODED_SIZE);
| ^^^^^^^^^^
|
note: binding is defined here
--> compiler/rustc_serialize/src/opaque.rs:440:13
|
440 | let _start_pos = e.position();
| ^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_binding
```
Best regards,
Michal
Couple of changes to make it easier to compile rustc for wasm
This is a subset of the patches I have on my rust fork to compile rustc for wasm32-wasip1.
Don't allow the `#[pointee]` attribute where it doesn't belong
Error if the `#[pointee]` attribute is applied to anything but generic type parameters.
Closes#128485
Related to #123430
Restrict `ignore-mode-*` directives
This is only used by coverage test suites where the same sources get run under different coverage modes. Restrict `ignore-mode-<coverage_mode>` to only coverage modes.
coverage: Multiple small tweaks to counter creation
I've been experimenting with some larger changes to how coverage counters are assigned to parts of the control-flow graph, and while none of that is ready yet, along the way I've repeatedly found myself wanting these smaller tweaks as a base.
There are no changes to compiler output.
liballoc: introduce String, Vec const-slicing
This change `const`-qualifies many methods on `Vec` and `String`, notably `as_slice`, `as_str`, `len`. These changes are made behind the unstable feature flag `const_vec_string_slice`.
## Motivation
This is to support simultaneous variance over ownership and constness. I have an enum type that may contain either `String` or `&str`, and I want to produce a `&str` from it in a possibly-`const` context.
```rust
enum StrOrString<'s> {
Str(&'s str),
String(String),
}
impl<'s> StrOrString<'s> {
const fn as_str(&self) -> &str {
match self {
// In a const-context, I really only expect to see this variant, but I can't switch the implementation
// in some mode like #[cfg(const)] -- there has to be a single body
Self::Str(s) => s,
// so this is a problem, since it's not `const`
Self::String(s) => s.as_str(),
}
}
}
```
Currently `String` and `Vec` don't support this, but can without functional changes. Similar logic applies for `len`, `capacity`, `is_empty`.
## Changes
The essential thing enabling this change is that `Unique::as_ptr` is `const`. This lets us convert `RawVec::ptr` -> `Vec::as_ptr` -> `Vec::as_slice` -> `String::as_str`.
I had to move the `Deref` implementations into `as_{str,slice}` because `Deref` isn't `#[const_trait]`, but I would expect this change to be invisible up to inlining. I moved the `DerefMut` implementations as well for uniformity.