Add support for test tmpdir to fuchsia test runner
Also format the script to keep the code nice.
This fixes the `tests/ui/std/switch-stdout.rs` test on Fuchsia.
r? `@tmandry`
Extend `unused_must_use` to cover block exprs
Given code like
```rust
#[must_use]
fn foo() -> i32 {
42
}
fn warns() {
{
foo();
}
}
fn does_not_warn() {
{
foo()
};
}
fn main() {
warns();
does_not_warn();
}
```
### Before This PR
```
warning: unused return value of `foo` that must be used
--> test.rs:8:9
|
8 | foo();
| ^^^^^
|
= note: `#[warn(unused_must_use)]` on by default
help: use `let _ = ...` to ignore the resulting value
|
8 | let _ = foo();
| +++++++
warning: 1 warning emitted
```
### After This PR
```
warning: unused return value of `foo` that must be used
--> test.rs:8:9
|
8 | foo();
| ^^^^^
|
= note: `#[warn(unused_must_use)]` on by default
help: use `let _ = ...` to ignore the resulting value
|
8 | let _ = foo();
| +++++++
warning: unused return value of `foo` that must be used
--> test.rs:14:9
|
14 | foo()
| ^^^^^
|
help: use `let _ = ...` to ignore the resulting value
|
14 | let _ = foo();
| +++++++ +
warning: 2 warnings emitted
```
Fixes#104253.
Prevent `.eh_frame` from being emitted for `-C panic=abort`
Since `CheckAlignment` pass is after the `AbortUnwindingCalls` pass, the `UnwindAction::Terminate` inserted in it has no chance to be converted to `UnwindAction::Unreachable` anymore, causing us to emit landing pads that are not necessary. Although these landing pads can themselves be eliminated by LLVM, `.eh_frame` sections are still generated. This causes trouble for Rust-for-Linux project recently.
This PR changes it to generate `UnwindAction::Terminate` when we opt for `-Cpanic=unwind`, and `UnwindAction::Unreachable` for `-Cpanic=abort`.
`@ojeda`
Sync rustc_codegen_cranelift
The main highlights this time are a cranelift update, some x86 vendor intrinsic implementations and preparations for testing cg_clif in CI here.
r? `@ghost`
`@rustbot` label +A-codegen +A-cranelift +T-compiler
This is apparently where it's busting stack, and the comments for `ensure_sufficient_stack` say that
> E.g. almost any call to visit_expr or equivalent can benefit from this.
Rollup of 6 pull requests
Successful merges:
- #111212 (Add casting suggestion when assigning negative 2's complement bin or hex literal to a size compatible signed integer)
- #112304 (Add chapter in rustdoc book for re-exports and add a regression test for `#[doc(hidden)]` behaviour)
- #112486 (Fix suggestion for E0404 not dealing with multiple generics)
- #112562 (rustdoc-gui: allow running on Windows)
- #112621 (Mention `env!` in `option_env!`'s docs)
- #112634 (add InlineConst check)
r? `@ghost`
`@rustbot` modify labels: rollup
Mention `env!` in `option_env!`'s docs
`env!` mentions that there is an alternative that returns an `Option<...>` instead of emitting a compile error.
Now `option_env!` also mentions that there is an alternative that emits a compile error instead of returning an `Option<...>`.
rustdoc-gui: allow running on Windows
This adds few fixes to allow running `python x.py test rustdoc-gui` on Windows.
* path to npm required to be `npm.cmd` on Windows (otherwise don't work for me)
* properly parse node module version on Windows
* properly provide path to browser-ui-test runner (fixed in #112613)
r? `@GuillaumeGomez`
Like for rlibs, the paths on the linker command line need to be relative
paths if the sysroot was specified by the user to be a relative path.
Dylibs put the path in /LIBPATH instead of into the file path of the
library itself, so we rehome the libpath and adjust the rehoming function
to be able to support both use cases, rlibs and dylibs.
CI: merge `msvc` test CI jobs
Merges `msvc` jobs together to save CI time. Currently, both runners take about 1h 15 minutes, but nowadays it should be possible to just run everything in a single job.
CI run: https://github.com/rust-lang/rust/actions/runs/5272144087/jobs/9534015536?pr=112633 (both finish under ~1h 35 minutes)
After this change, we no longer test both `x.py` and `x.ps1`, but I don't suppose that it's worth it to spend 1.5 hours of additional CI time just for that. I suggest to run all tests using e.g. `x.py` and then run just `x.ps1 test --stage 2 --force-rerun tests/<single-quick-test>`.
Also I'm not sure if it's worth it to keep using the Makefile for this.
Update cargo
11 commits in 49b6d9e179a91cf7645142541c9563443f64bf2b..0c14026aa84ee2ec4c67460c0a18abc8519ca6b2
2023-06-09 17:21:19 +0000 to 2023-06-14 18:43:05 +0000
- fix(embedded): Don't append hash to bin names (rust-lang/cargo#12269)
- Fix version requirement example in Dependency Resolution, SemVer compatibility section (rust-lang/cargo#12267)
- Update triagebot links. (rust-lang/cargo#12265)
- Show a better error when container tests fail. (rust-lang/cargo#12264)
- chore: update dependencies (rust-lang/cargo#12261)
- refactor(embedded) (rust-lang/cargo#12262)
- docs: clarify the use of `default` branch instead of `main` by default (rust-lang/cargo#12251)
- docs: update changelog for 1.71 backport and 1.72 (rust-lang/cargo#12256)
- feat: Initial support for single-file packages (rust-lang/cargo#12245)
- test(z-flags): Verify `-Z` flags list is sorted (rust-lang/cargo#12224)
- refactor: registry data kinds cleanup (rust-lang/cargo#12248)
---
This commit also update LICENSE exceptions, as Cargo introduced a newer version of `dunce` and `blake3` as dependencies.
r? `@ghost`
rustdoc-search: clean up type unification and "unboxing"
This PR redesigns parameter matching, return matching, and generics matching to use a single function that compares two lists of types.
It also makes the algorithms more consistent, so the "unboxing" behavior where `Vec<i32>` is considered a match for `i32` works inside generics, and not just at the top level.
Always put the `create_size_estimate` calls and `debug_dump` calls
within a timed scopes. This makes the four main steps look more similar
to each other.
The comment says "Find the smallest CGU that has exported symbols and
put the dead function stubs in that CGU". But the code sorts the CGUs by
size (smallest first) and then searches them in reverse order, which
means it will find the *largest* CGU that has exported symbols.
The erroneous code was introduced in #92142.
This commit changes it to use a simpler search, avoiding the sort, and
fixes the bug in the process.