| Age | Commit message (Collapse) | Author | Lines |
|
|
|
comment tweaks
|
|
|
|
add tests for panicky drop in thread_local destructor
Adds a test for https://github.com/rust-lang/rust/issues/112285
|
|
|
|
|
|
Rustup
|
|
|
|
|
|
Remove comments from mir-opt MIR dumps
See https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/Line.20numbers.20in.20mir-opt.20tests/near/363849874
In https://github.com/rust-lang/rust/pull/99780 there is mention that "there has been a zulip conversation about disabling line numbers with mixed opinions" which to me means that some people opposed this. I can't find the referenced conversation so... here we go.
The current situation is quite chaotic. It's not hard to find MIR diffs which contain
* Absolute line numbers
* Relative line numbers
* Substituted line numbers (LL)
For example: https://github.com/rust-lang/rust/blob/408bbd040613f6776e0a7d05d582c81f4ddc189a/tests/mir-opt/inline/inline_shims.drop.Inline.diff#L10-L17
And sometimes adding a comment at the top of a mir-opt test generates a diff in the test because a line number changed: https://github.com/rust-lang/rust/pull/98112/files#diff-b8cf4bcce95078e6a3faf075e9abf6864872fb28a64d95c04f04513b9e3bbd81
And irrelevant changes to the standard library can generate diffs in mir-opt tests: https://github.com/rust-lang/rust/pull/110694/files#diff-bf96b0e7c67b8b272814536888fd9428c314991e155beae1f0a2a67f0ac47b2c
https://github.com/rust-lang/rust/commit/769886cc35ce08b76839f4cf72b8af1161c432e1
I think we should, specifically in mir-opt tests, completely remove the comments, or insert placeholders for all line and column numbers.
|
|
Rollup of 8 pull requests
Successful merges:
- #112403 (Prevent `.eh_frame` from being emitted for `-C panic=abort`)
- #112517 (`suspicious_double_ref_op`: don't lint on `.borrow()`)
- #112529 (Extend `unused_must_use` to cover block exprs)
- #112614 (tweak suggestion for argument-position `impl ?Sized`)
- #112654 (normalize closure output in equate_inputs_and_outputs)
- #112660 (Migrate GUI colors test to original CSS color format)
- #112664 (Add support for test tmpdir to fuchsia test runner)
- #112669 (Fix comment for ptr alignment checks in codegen)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Fix comment for ptr alignment checks in codegen
|
|
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`
|
|
Migrate GUI colors test to original CSS color format
Follow-up of https://github.com/rust-lang/rust/pull/111459.
r? `@notriddle`
|
|
normalize closure output in equate_inputs_and_outputs
Fixes #112604
|
|
tweak suggestion for argument-position `impl ?Sized`
fixes this invalid suggestion:
```text
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
1 - fn foo(_: impl ?Sized) {}
1 + fn foo(_: impl ) {}
|
```
|
|
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.
|
|
`suspicious_double_ref_op`: don't lint on `.borrow()`
closes #112489
|
|
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
|
|
|
|
sync_cg_clif-2023-06-15
|
|
|
|
|
|
Support testing of cg_clif in rust's CI
|
|
|
|
|
|
Also format the script to keep the code nice.
|
|
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
|
|
add InlineConst check
add check to close #112438
|
|
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`
|
|
Fix suggestion for E0404 not dealing with multiple generics
Fixes #112472.
|
|
Add chapter in rustdoc book for re-exports and add a regression test for `#[doc(hidden)]` behaviour
Fixes https://github.com/rust-lang/rust/issues/109449.
Fixes https://github.com/rust-lang/rust/issues/53417.
After the discussion in #109697, I made a few PRs to fix a few corner cases:
* https://github.com/rust-lang/rust/pull/112178
* https://github.com/rust-lang/rust/pull/112108
* https://github.com/rust-lang/rust/pull/111997
With this I think I covered all cases. Only thing missing at this point was a chapter covering re-exports in the rustdoc book.
r? `@notriddle`
|
|
Add casting suggestion when assigning negative 2's complement bin or hex literal to a size compatible signed integer
Fixes #107896
The issue stated the case for `iX::MIN` variants. This PR extends the cases for other negative values (in the 2's complement).
Leveraged sign bits to detect such cases.
Example cases:
- <img width="845" alt="image" src="https://user-images.githubusercontent.com/65026286/236289682-19859f59-a9c5-48c5-b15f-78a935fbfcec.png">
- <img width="831" alt="image" src="https://user-images.githubusercontent.com/65026286/236289805-5b16488d-9138-4363-a1b6-a5c027c50aba.png">
- <img width="912" alt="image" src="https://user-images.githubusercontent.com/65026286/236290065-685a9777-034b-4def-83a8-cc4e20b1ed0c.png">
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
Dereference pointers in shims as correct types
Currently, shims will dereference pointers as the type written by the user. This can cause false positives, incorrect behavior such as #2136, and even ICEs if a field is not present.
This PR fixes this by having shims dereference pointers with types from `std` or `libc` that we can rely on the layout and field names of instead of with whatever the user passed in.
Fixes #1123
|
|
|
|
optimize slice::Iter::fold
Fixes 2 of 4 cases from #106288
```
OLD: test slice::fold_to_last ... bench: 248 ns/iter (+/- 3)
NEW: test slice::fold_to_last ... bench: 0 ns/iter (+/- 0)
```
|
|
Rustup
|
|
|
|
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.
|
|
|