Infer consts more consistently
Moved some duplicated logic in `TypeRelation` methods into `super_combined_consts`. Before some `TypeRelation`s like `Lub` wasn't using `replace_if_possible`, meaning some inference types were staying around longer than they should be.
Fixes https://github.com/rust-lang/rust/issues/64519
r? @varkor
Cleanup syntax::ext::build
I suspect most of this code could be inlined but I only removed the bits where the inlining didn't really hurt readability (i.e., method call -> function call) or the completely unused code.
Fix `Stdio::piped` example code and lint
Summary:
Invoking `rev` does not add a trailing newline when none is present in
the input (at least on my Debian). Nearby examples use `echo` rather
than `rev`, which probably explains the source of the discrepancy.
Also, a `mut` qualifier is unused.
Test Plan:
Copy the code block into <https://play.rust-lang.org> with a `fn main`
wrapper, and run it. Note that it compiles and runs cleanly; prior to
this commit, it would emit an `unused_mut` warning and then panic.
wchargin-branch: stdio-piped-docs
Rollup of 9 pull requests
Successful merges:
- #63907 (Add explanation to type mismatch involving type params and assoc types)
- #64615 (rustbuild: Turn down compression on exe installers)
- #64617 (rustbuild: Turn down compression on msi installers)
- #64618 (rustbuild: Improve output of `dist` step)
- #64619 (Fixes#63962. Hint about missing tuple parentheses in patterns)
- #64634 (Update to LLVM 9.0.0)
- #64635 (Allow using fn pointers in const fn with unleash miri)
- #64660 (unify errors for tuple/struct variants)
- #64664 (fully remove AstBuilder)
Failed merges:
r? @ghost
Allow using fn pointers in const fn with unleash miri
This allows using function pointers in const fns when `-Zunleash-the-miri-within-you` is enabled.
If the call to the `const fn` happens in a `const`-context, the function pointer is required to point to a `const fn`:
```rust
fn non_const_fn() -> i32 { 42 }
const fn const_fn() -> i32 { 42 }
const fn foo(x: fn() -> i32) -> i32 { x() }
let x: i32 = foo(non_const_fn_ptr); // OK
let y: i32 = foo(const_fn_ptr); // OK
const X: i32 = foo(non_const_fn_ptr); // ERROR: `non_const_fn` is not `const fn`
const Y: i32 = foo(const_fn_ptr); // OK
```
r? @oli-obk
rustbuild: Improve output of `dist` step
* Pass `/Q` to `iscc` on Windows to supress the thousands of lines of
output about compressing documentation.
* Print out what's happening before long steps
* Use `timeit` to print out timing information for long-running
installer assemblies.
* Try to scope output of `Dist ...` to not also encompass actual build steps