Commit Graph

226877 Commits

Author SHA1 Message Date
Guillaume Gomez
ea55d25465 Add regression test for 2023-06-16 20:41:00 +02:00
Guillaume Gomez
f4316392a7 Fix invalid handling of "going back in history" when "Directly go to item in search if there is only one result" setting is set to true 2023-06-16 20:38:48 +02:00
Guillaume Gomez
9f509429cd Unify history interactions in search 2023-06-16 13:43:55 +02:00
bors
0966f3202d Auto merge of - scottmcm:enough-stack, r=compiler-errors
Add an `ensure_sufficient_stack` to `LateContextAndPass::visit_expr`

This is [apparently](https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/.60-alt.60-only.20failures.3F/near/365396801) where it's busting stack in , and the comments for `ensure_sufficient_stack` say that

> E.g. almost any call to visit_expr or equivalent can benefit from this.

So this seems like a reasonable change.

Hopefully it'll keep this from happening in other places too -- https://github.com/rust-lang/rust/pull/111818#issuecomment-1585023914 hit something similar when updating a lint (bors failure is https://github.com/rust-lang-ci/rust/actions/runs/5199591324/jobs/9377196369), so with any luck this will keep small permutations of things from tripping over the limit.
2023-06-16 05:48:08 +00:00
bors
c84d5e7078 Auto merge of - saethlin:no-comment, r=oli-obk
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: 408bbd0406/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
769886cc35

I think we should, specifically in mir-opt tests, completely remove the comments, or insert placeholders for all line and column numbers.
2023-06-16 01:55:34 +00:00
bors
0252b4093f Auto merge of - GuillaumeGomez:rollup-rwn4086, r=GuillaumeGomez
Rollup of 8 pull requests

Successful merges:

 -  (Prevent `.eh_frame` from being emitted for `-C panic=abort`)
 -  (`suspicious_double_ref_op`: don't lint on `.borrow()`)
 -  (Extend `unused_must_use` to cover block exprs)
 -  (tweak suggestion for argument-position `impl ?Sized`)
 -  (normalize closure output in equate_inputs_and_outputs)
 -  (Migrate GUI colors test to original CSS color format)
 -  (Add support for test tmpdir to fuchsia test runner)
 -  (Fix comment for ptr alignment checks in codegen)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-06-15 22:54:43 +00:00
Guillaume Gomez
05d5449522
Rollup merge of - Nilstrieb:typo, r=jyn514
Fix comment for ptr alignment checks in codegen
2023-06-15 22:04:58 +02:00
Guillaume Gomez
56a5b7e504
Rollup merge of - djkoloski:fuchsia_test_runner_tmpdir, r=tmandry
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`
2023-06-15 22:04:58 +02:00
Guillaume Gomez
b36ddeedc0
Rollup merge of - GuillaumeGomez:migrate-gui-test-color-15, r=notriddle
Migrate GUI colors test to original CSS color format

Follow-up of https://github.com/rust-lang/rust/pull/111459.

r? `@notriddle`
2023-06-15 22:04:57 +02:00
Guillaume Gomez
6b9b55ac98
Rollup merge of - aliemjay:closure-output-normalize, r=compiler-errors
normalize closure output in equate_inputs_and_outputs

Fixes 
2023-06-15 22:04:57 +02:00
Guillaume Gomez
af955a647e
Rollup merge of - lukas-code:apit-unsized-suggestion, r=compiler-errors
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 ) {}
  |
```
2023-06-15 22:04:56 +02:00
Guillaume Gomez
d233522418
Rollup merge of - jieyouxu:block-expr-unused-must-use, r=oli-obk
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 .
2023-06-15 22:04:56 +02:00
Guillaume Gomez
db7d8374c1
Rollup merge of - fee1-dead-contrib:sus-op-no-borrow, r=compiler-errors
`suspicious_double_ref_op`: don't lint on `.borrow()`

closes 
2023-06-15 22:04:55 +02:00
Guillaume Gomez
ab314a57fa
Rollup merge of - nbdd0121:eh_frame, r=Nilstrieb
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`
2023-06-15 22:04:55 +02:00
Ben Kimock
0a1fa411ed Remove comments from mir-opt MIR dumps 2023-06-15 15:19:11 -04:00
bors
114fb86ca0 Auto merge of - bjorn3:sync_cg_clif-2023-06-15, r=bjorn3
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
2023-06-15 19:04:13 +00:00
bjorn3
8a120cc867 Update tidy allowed deps list 2023-06-15 17:56:46 +00:00
bjorn3
82b497286d Merge commit '8830dccd1d4c74f1f69b0d3bd982a3f1fcde5807' into sync_cg_clif-2023-06-15 2023-06-15 17:56:01 +00:00
bjorn3
8830dccd1d Rustup to rustc 1.72.0-nightly (8c74a5d27 2023-06-14) 2023-06-15 17:45:30 +00:00
bjorn3
c1fa3cf6c4 Sync from rust 8c74a5d27c 2023-06-15 17:40:32 +00:00
bjorn3
f2895f3143
Merge pull request from bjorn3/build_system_rework6
Support testing of cg_clif in rust's CI
2023-06-15 19:37:23 +02:00
Nilstrieb
465e4d9c9c Fix comment for ptr alignment checks in codegen 2023-06-15 19:27:31 +02:00
bjorn3
e9bd63af3c Ignore -Clink-arg=-import-instr-limit 2023-06-15 17:14:49 +00:00
Scott McMurray
44789b626b Add an ensure_sufficient_stack to LateContextAndPass::visit_expr
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.
2023-06-15 09:57:47 -07:00
David Koloski
71db99935a Add support for test tmpdir to fuchsia test runner
Also format the script to keep the code nice.
2023-06-15 12:17:40 -04:00
bors
331249a949 Auto merge of - matthiaskrgr:rollup-9u5i2zy, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 -  (Add casting suggestion when assigning negative 2's complement bin or hex literal to a size compatible signed integer)
 -  (Add chapter in rustdoc book for re-exports and add a regression test for `#[doc(hidden)]` behaviour)
 -  (Fix suggestion for E0404 not dealing with multiple generics)
 -  (rustdoc-gui: allow running on Windows)
 -  (Mention `env!` in `option_env!`'s docs)
 -  (add InlineConst check)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-06-15 16:05:33 +00:00
Matthias Krüger
c0a089e118
Rollup merge of - mj10021:issue-112438-fix, r=compiler-errors
add InlineConst check

add check to close 
2023-06-15 17:52:38 +02:00
Matthias Krüger
c4c5e0baee
Rollup merge of - GrigorenkoPV:env, r=jyn514
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<...>`.
2023-06-15 17:52:37 +02:00
Matthias Krüger
9fe4630797
Rollup merge of - klensy:rd-gui-test-win, r=GuillaumeGomez
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 )

r? `@GuillaumeGomez`
2023-06-15 17:52:37 +02:00
Matthias Krüger
82eb4a0208
Rollup merge of - jieyouxu:issue-112472, r=oli-obk
Fix suggestion for E0404 not dealing with multiple generics

Fixes .
2023-06-15 17:52:36 +02:00
Matthias Krüger
9bc95a4bc9
Rollup merge of - GuillaumeGomez:re-exports, r=notriddle
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 , 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`
2023-06-15 17:52:36 +02:00
Matthias Krüger
f530016f50
Rollup merge of - nicklimmm:issue-107896-fix, r=pnkfelix
Add casting suggestion when assigning negative 2's complement bin or hex literal to a size compatible signed integer

Fixes 

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">
2023-06-15 17:52:35 +02:00
Guillaume Gomez
c560dbc95d Migrate GUI colors test to original CSS color format 2023-06-15 17:38:15 +02:00
bors
f9097f87c9 Auto merge of - Kobzol:ci-msvc-merge, r=pietroalbini
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.
2023-06-15 13:02:47 +00:00
Ali MJ Al-Nasrawy
c75e6e0f6c normalize closure output before relation 2023-06-15 12:49:49 +00:00
James Dietz
b1f7ab2ea2 add test 2023-06-15 06:50:56 -04:00
许杰友 Jieyou Xu (Joe)
32ae8810fc
Fix suggestion for E0404 not dealing with multiple generics 2023-06-15 18:19:09 +08:00
Lukas Markeffsky
b6a3f126c0 change std::marker::Sized to just Sized 2023-06-15 12:01:38 +02:00
Lukas Markeffsky
ee7e717322 tweak suggestion for argument-position impl ?Sized 2023-06-15 12:00:57 +02:00
许杰友 Jieyou Xu (Joe)
72b3b58efc
Extend unused_must_use to cover block exprs 2023-06-15 17:59:13 +08:00
bors
4996b56ba9 Auto merge of - the8472:slice-iter-fold, r=scottmcm
optimize slice::Iter::fold

Fixes 2 of 4 cases from 

```
OLD: test slice::fold_to_last                                           ... bench:         248 ns/iter (+/- 3)
NEW: test slice::fold_to_last                                           ... bench:           0 ns/iter (+/- 0)
```
2023-06-15 09:38:53 +00:00
bors
5a65be8152 Auto merge of - weihanglo:update-cargo, r=weihanglo
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 ()
- Fix version requirement example in Dependency Resolution, SemVer compatibility section ()
- Update triagebot links. ()
- Show a better error when container tests fail. ()
- chore: update dependencies ()
- refactor(embedded) ()
- docs: clarify the use of `default` branch instead of `main` by default ()
- docs: update changelog for 1.71 backport and 1.72 ()
- feat: Initial support for single-file packages ()
- test(z-flags): Verify `-Z` flags list is sorted ()
- refactor: registry data kinds cleanup ()

---

This commit also update LICENSE exceptions, as Cargo introduced a newer version of `dunce` and `blake3` as dependencies.

r? `@ghost`
2023-06-15 06:04:14 +00:00
bors
314c39d2ea Auto merge of - notriddle:notriddle/search-unify, r=GuillaumeGomez
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.
2023-06-15 03:04:46 +00:00
bors
6ee4265ca6 Auto merge of - the8472:dont-drain-on-drop, r=Amanieu
Don't drain-on-drop in DrainFilter impls of various collections.

This removes drain-on-drop behavior from various unstable DrainFilter impls (not yet for HashSet/Map) because that behavior [is problematic](https://github.com/rust-lang/rust/issues/43244#issuecomment-641638196) (because it can lead to panic-in-drop when user closures panic) and may become forbidden if [this draft RFC passes](https://github.com/rust-lang/rfcs/pull/3288).

closes 

[ACP](https://github.com/rust-lang/libs-team/issues/136)

affected tracking issues
* 
* 
* 

Related hashbrown update: https://github.com/rust-lang/hashbrown/pull/374
2023-06-15 00:03:10 +00:00
James Dietz
20499b9669 add InlineConst check 2023-06-14 18:01:05 -04:00
Jakub Beránek
895eb3035e
Merge msvc-1/2 CI jobs 2023-06-14 23:07:49 +02:00
The 8472
d90508f761 use indexed loop instead of ptr bumping
this seems to produce less IR
2023-06-14 22:22:41 +02:00
bors
8c74a5d27c Auto merge of - matthiaskrgr:rollup-jcobj3g, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 -  (loongarch64-none*: Remove environment component from llvm target)
 -  (Introduce a `Stable` trait to translate MIR to SMIR)
 -  (Improve docs/clean up negative overlap functions)
 -  (Error on unconstrained lifetime in RPITIT)
 -  (Fix explicit-outlives-requirements lint span)
 -  (Fix rustdoc-gui tests on Windows)
 -  (Fix small typo)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-06-14 20:20:40 +00:00
Weihang Lo
b40b92fb99
Update cargo 2023-06-14 20:44:02 +01:00
bors
0b475c705f Auto merge of - matthiaskrgr:rollup-db6ta1b, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 -  (Implement `TryFrom<&OsStr>` for `&str`)
 -  (Specify behavior of HashSet::insert)
 -  (Stabilize String::leak)
 -  (Update runtime guarantee for `select_nth_unstable`)
 -  (Don't print unsupported split-debuginfo modes with `-Zunstable-options`)
 -  (Properly check associated consts for infer placeholders)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-06-14 17:25:04 +00:00