Commit Graph

213910 Commits

Author SHA1 Message Date
Matthias Krüger
30846f6ff1
Rollup merge of #106396 - jyn514:bump-stage-date, r=pietroalbini
Allow passing a specific date to `bump-stage0`

This allows regenerating `src/stage0.json` on changes to the tool, without needing to hard-code the date in the source. It was useful for https://github.com/rust-lang/rust/pull/106394, which added clippy to the list of required components.

r? `@pietroalbini`
2023-01-04 07:28:56 +01:00
Matthias Krüger
11020b93b6
Rollup merge of #106361 - clubby789:int-literal-too-large, r=estebank
Note maximum integer literal for `IntLiteralTooLarge`

Closes #105908

`@rustbot` label +A-diagnostics
2023-01-04 07:28:56 +01:00
Matthias Krüger
d24b229072
Rollup merge of #106327 - gimbles:dbg, r=jyn514
Add tidy check for dbg

Fixes #106169
2023-01-04 07:28:55 +01:00
Matthias Krüger
336124797f
Rollup merge of #106292 - Nilstrieb:box-uninit-test, r=RalfJung
Add codegen test for `Box::new(uninit)` of big arrays

Closes #58201

r? `@RalfJung`
2023-01-04 07:28:55 +01:00
Matthias Krüger
fbfaeb6795
Rollup merge of #106274 - jyn514:dump-mono-stats, r=lqd
Add JSON output to -Zdump-mono-stats

Follow-up to https://github.com/rust-lang/rust/pull/105481

r? `@lqd` cc `@wesleywiser`
2023-01-04 07:28:54 +01:00
Matthias Krüger
70468af591
Rollup merge of #106200 - compiler-errors:suggest-impl-trait, r=estebank
Suggest `impl Fn*` and `impl Future` in `-> _` return suggestions

Follow-up to #106172, only the last commit is relevant. Can rebase once that PR is landed for easier review.

Suggests `impl Future` and `impl Fn{,Mut,Once}` in `-> _` return suggestions.

r? `@estebank`
2023-01-04 07:28:54 +01:00
bors
c361616c3c Auto merge of #106432 - compiler-errors:rollup-lzj0lnp, r=compiler-errors
Rollup of 8 pull requests

Successful merges:

 - #104748 (Ensure `lld` is supported with `download-ci-llvm`)
 - #105541 (Simplify some iterator combinators)
 - #106045 (default OOM handler: use non-unwinding panic, to match std handler)
 - #106157 (Don't trim path for `unsafe_op_in_unsafe_fn` lints)
 - #106353 (Reduce spans for `unsafe impl` errors)
 - #106381 (Jsondoclint: Add `--verbose` and `--json-output` options)
 - #106411 (rustdoc: remove legacy font-feature-settings CSS)
 - #106414 (Add cuviper to the review rotation for libs)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-01-04 03:37:21 +00:00
Michael Goulet
1a984435df
Rollup merge of #106414 - cuviper:libs-review, r=Mark-Simulacrum
Add cuviper to the review rotation for libs
2023-01-03 17:19:28 -08:00
Michael Goulet
aac0096cef
Rollup merge of #106411 - notriddle:notriddle/font-feature-settings, r=GuillaumeGomez
rustdoc: remove legacy font-feature-settings CSS

According to [caniuse], these vendor prefixes aren't needed in any supported web browsers as defined in [RFC 1985].

* The last version of Chrome that required a vendor prefix was version 47. The current version is 108.
* Firefox 33 is the last version that required a vendor prefix. The [current Firefox ESR] is version 102.
* The last version of Safari that required a vendor prefix was version 9.1. The current version is 16.
* The last version of Safari/iOS that required a vendor prefix was version 9.3. The current version is 16.
* Edge never required vendor prefixes.
* UCAndroid never required vendor prefixes.

[caniuse]: https://caniuse.com/?search=font-feature-settings
[RFC 1985]: https://rust-lang.github.io/rfcs/1985-tiered-browser-support.html
[current Firefox ESR]: https://wiki.mozilla.org/Releases
2023-01-03 17:19:28 -08:00
Michael Goulet
f24dab764f
Rollup merge of #106381 - aDotInTheVoid:jsondoclint-more-options, r=notriddle
Jsondoclint: Add `--verbose` and `--json-output` options

There quite helpful for manually using jsondoclint as a debugging tool, especially on large files (these were written to look into core.json).

r? rustdoc
2023-01-03 17:19:27 -08:00
Michael Goulet
5d828d2440
Rollup merge of #106353 - lukas-code:reduce-red-lines-in-my-ide, r=wesleywiser
Reduce spans for `unsafe impl` errors

Because huge spans aren't great for IDEs.

Prior art: https://github.com/rust-lang/rust/pull/103749
2023-01-03 17:19:27 -08:00
Michael Goulet
dc5247bf29
Rollup merge of #106157 - LeSeulArtichaut:106126-thir-unsafeck-good-path-bug-2, r=compiler-errors
Don't trim path for `unsafe_op_in_unsafe_fn` lints

Fixes #106126, alternative to #106127.
r? `@ghost` for now.
2023-01-03 17:19:26 -08:00
Michael Goulet
f6b0f4707b
Rollup merge of #106045 - RalfJung:oom-nounwind-panic, r=Amanieu
default OOM handler: use non-unwinding panic, to match std handler

The OOM handler in std will by default abort. This adjusts the default in liballoc to do the same, using the `can_unwind` flag on the panic info to indicate a non-unwinding panic.

In practice this probably makes little difference since the liballoc default will only come into play in no-std situations where people write a custom panic handler, which most likely will not implement unwinding. But still, this seems more consistent.

Cc `@rust-lang/wg-allocators,` https://github.com/rust-lang/rust/issues/66741
2023-01-03 17:19:26 -08:00
Michael Goulet
c56d8eda46
Rollup merge of #105541 - compiler-errors:iter-comb, r=cjgillot
Simplify some iterator combinators

Saw a `flat_map().next()` instead of a `find_map()` in some method probe code, so did a quick search for some similar usages.
2023-01-03 17:19:25 -08:00
Michael Goulet
752c0f57ea
Rollup merge of #104748 - lqd:download_lld, r=jyn514
Ensure `lld` is supported with `download-ci-llvm`

This PR:
- ensures LLD's step in bootstrap's dist, but it's not strictly necessary since dist will already package it when it's present.
- makes bootstrap's `native::LLD` step support using the packaged `ci-llvm/bin/lld`, instead of building it from source (which would most likely not be available today, nor in the future where `download-ci-llvm = if-available` is the default).

If I understand correctly, `--enable-full-tools` will also enable `rust.lld`, and this is why LLD is already packaged today in the `rust-dev` component on the main targets (and why `-Zgcc-ld=lld` does work there).

That means it's likely that this PR will not be able to land before I've reworked and landed #101792: if LLD is available in `download-ci-llvm`, the `needs-rust-lld` tests should start being executed on the x64 macOS test builders, and CI would fail today.

I've tested locally that building with `download-ci-llvm = true` and `lld = true` with the LLVM submodule unregistered was successful, and that `rust-lld` and the various `lld-wrapper`s are present and `-Zgcc-ld=lld` works as well, on a few different platforms:
- `x86_64-unknown-linux-gnu`
- `aarch64-apple-darwin`
- `x86_64-pc-windows-msvc` (with `-Clinker=rust-lld` rather than `-Zgcc-ld=lld`)
- `x86_64-apple-darwin`, with the `MACOSX_DEPLOYMENT_TARGET` workaround for #101653

I don't think we really need to bump the `download-ci-llvm-stamp` in this case, since `./build/$triple/ci-llvm/bin/lld` is present on all the above targets already, but have added it mechanically, and it should probably be removed to avoid unnecessary downloads/churn.

Fixes #98340
Supersedes #100010
2023-01-03 17:19:25 -08:00
Michael Goulet
2baee88bdb Address comments 2023-01-04 00:51:50 +00:00
Michael Goulet
7690fe3bc6 Simplify some iterator combinators 2023-01-04 00:48:07 +00:00
Michael Goulet
89086f7d36 Restore Fn trait note 2023-01-04 00:37:34 +00:00
Michael Goulet
a0390463fc Suggest more impl Trait on -> _ 2023-01-03 23:50:31 +00:00
bors
fbe8292872 Auto merge of #105712 - amg98:feat/vita-support, r=wesleywiser
PlayStation Vita support

Just the compiler definitions for no-std projects and std support using newlib

Earlier PR: https://github.com/rust-lang/rust/pull/105606
2023-01-03 23:38:28 +00:00
bors
c7572670a1 Auto merge of #105752 - chenyukang:yukang/refactor-method-error, r=compiler-errors
Refactoring report_method_error

While working on #105732, I found it's hard to follow this long function,
so I tried to make it shorter.

It's not easy for code reviewing, since so many lines of code changes,
but only the positions are changed.

Generally, I extract two sub-methods from `report_method_error`:

397b66e77b/compiler/rustc_hir_typeck/src/method/suggest.rs (L117)
to `note_candidates_on_method_error`

And this long block:
397b66e77b/compiler/rustc_hir_typeck/src/method/suggest.rs (L263)

to `report_no_match_method_error`.

r? `@compiler-errors`
2023-01-03 20:44:40 +00:00
Rémy Rakic
e0f5c6da1d ensure lld's step unconditionally for RustDev component 2023-01-03 20:21:49 +00:00
Rémy Rakic
c73a46c6bf bump download-ci-llvm-stamp 2023-01-03 20:14:27 +00:00
Rémy Rakic
f635f9d4e4 turn a comment into an actual doc comment 2023-01-03 20:14:27 +00:00
Rémy Rakic
4e4658f0aa slight cleanup 2023-01-03 20:14:24 +00:00
Rémy Rakic
835b58d619 make the native::LLD step able to use an already built lld
Makes the lld step avoid building it from source when possible: when
dist has packaged it along the other LLVM binaries for the rust-dev
component.
2023-01-03 20:06:45 +00:00
Rémy Rakic
6eb205d591 bootstrap dist: ensure LLD's step 2023-01-03 20:06:45 +00:00
Josh Stone
9914a8924e Add cuviper to the review rotation for libs 2023-01-03 09:47:03 -08:00
Michael Howell
4fe2bd5675 rustdoc: remove legacy font-feature-settings CSS
According to [caniuse], these vendor prefixes aren't needed in any supported
web browsers as defined in [RFC 1985].

* The last version of Chrome that required a vendor prefix was version 47.
  The current version is 108.
* Firefox 33 is the last version that required a vendor prefix. The
  [current Firefox ESR] is version 102.
* The last version of Safari that required a vendor prefix was version 9.1.
  The current version is 16.
* The last version of Safari/iOS that required a vendor prefix was version
  9.3. The current version is 16.
* Edge never required vendor prefixes.
* UCAndroid never required vendor prefixes.

[caniuse]: https://caniuse.com/?search=font-feature-settings
[RFC 1985]: https://rust-lang.github.io/rfcs/1985-tiered-browser-support.html
[current Firefox ESR]: https://wiki.mozilla.org/Releases
2023-01-03 10:23:55 -07:00
bors
ab10908e8c Auto merge of #106409 - matthiaskrgr:rollup-b58z1hz, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #104552 (warn newer available version of the x tool)
 - #105681 (some fixes/improvements to mir::visit module)
 - #106005 (Test the borrowck behavior of if-let guards)
 - #106356 (clean: Remove `ctor_kind` from `VariantStruct`.)
 - #106365 (Grammar : Missing "is" in format specifier diagnostic)
 - #106388 (rustdoc: remove legacy box-sizing CSS)
 - #106392 (`has_overflow` only if value is *not* within limit)
 - #106402 (Fix dupe word typos)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-01-03 17:08:17 +00:00
Matthias Krüger
e2f7108459
Rollup merge of #106402 - Rageking8:fix_dupe_word_typos, r=Nilstrieb
Fix dupe word typos

r? `@Nilstrieb`
Thanks!
2023-01-03 17:12:13 +01:00
Matthias Krüger
9d1193310f
Rollup merge of #106392 - compiler-errors:new-trait-solver-overflow, r=lcnr
`has_overflow` only if value is *not* within limit

New solver forgot a not operator, I think.
2023-01-03 17:12:13 +01:00
Matthias Krüger
83b11f70ad
Rollup merge of #106388 - notriddle:notriddle/box-sizing, r=camelid
rustdoc: remove legacy box-sizing CSS

According to [caniuse], these vendor prefixes aren't needed in any supported web browsers as defined in [RFC 1985]

* The last version of Chrome that required a vendor prefix was version 9. The current version is 108.
* Firefox 28 is the last version that required a vendor prefix. The [current Firefox ESR] is version 102.
* The last version of Safari that required a vendor prefix was version 5. The current version is 16.
* The last version of Safari/iOS that required a vendor prefix was version 4. The current version is 16.
* Edge never required vendor prefixes.
* UCAndroid never required vendor prefixes.

[caniuse]: https://caniuse.com/?search=box-sizing
[RFC 1985]: https://rust-lang.github.io/rfcs/1985-tiered-browser-support.html
[current Firefox ESR]: https://wiki.mozilla.org/Releases
2023-01-03 17:12:12 +01:00
Matthias Krüger
01d99f6569
Rollup merge of #106365 - gimbles:patch-1, r=jyn514
Grammar : Missing "is" in format specifier diagnostic
2023-01-03 17:12:12 +01:00
Matthias Krüger
a0458d41ba
Rollup merge of #106356 - aDotInTheVoid:del-ctor-kind, r=jyn514
clean: Remove `ctor_kind` from `VariantStruct`.

It's always `None`.

r? `@ghost`
2023-01-03 17:12:11 +01:00
Matthias Krüger
6e94012c67
Rollup merge of #106005 - LeSeulArtichaut:if-let-guard-borrowck-test, r=Nilstrieb
Test the borrowck behavior of if-let guards

Add some tests to make sure that if-let guards behave the same as if guards with respect to borrow-checking. Most of them are a naive adaptation, replacing an `if` guard with `if let Some(())`.
This includes regression tests for notable issues that arose for if guards (#24535, #27282, #29723, #31287) as suggested in https://github.com/rust-lang/rust/issues/51114#issuecomment-900470419.

cc `@pnkfelix` are there any other tests that you would want to see?
cc tracking issue #51114
2023-01-03 17:12:11 +01:00
Matthias Krüger
da07053ee1
Rollup merge of #105681 - tshepang:doc-mir-visit, r=Nilstrieb
some fixes/improvements to mir::visit module
2023-01-03 17:12:10 +01:00
Matthias Krüger
258a0fb89e
Rollup merge of #104552 - DebugSteven:warn-newer-x, r=jyn514
warn newer available version of the x tool

This PR adds a check to `tidy` to assert that the installed version of `x` is equal to the version in `src/tools/x/Cargo.toml`. It adds a `--wrapper-version` argument to `x` to determine the version at runtime, .

It does not warn if `x` has not yet been installed, on the assumption that the user isn't interested in using it.
2023-01-03 17:12:10 +01:00
Nixon Enraght-Moony
f1f99c611a clean: Remove ctor_kind from VariantStruct.
It's always `None`.
2023-01-03 15:10:53 +00:00
Nixon Enraght-Moony
226ab7fd75 jsondoclint: Add option to dump errors as json.
The output looks like:
{
  "errors": [
    {
      "id": "2:2017:1833",
      "kind": {
        "NotFound": [
          [
            {"Field": "index"},
            {"Field": "0:0:1571"},
            {"Field": "links"},
            {"Field": "pointer::read"}
          ]
        ]
      }
    }
  ],
  "path": "/home/nixon/dev/rust/rust/build/x86_64-unknown-linux-gnu/test/rustdoc-json/intra-doc-links/pointer_method/pointer_method.json"
}
2023-01-03 14:54:46 +00:00
Nixon Enraght-Moony
95329080d3 jsondoclint: Find selector for missing ID when error is created, not reported.
This is needed for json output, but even without that, it increases
performance massivly. On my machine, in reduces the time to check
core.json from 40.190s to 11.333s.
2023-01-03 14:54:46 +00:00
Nixon Enraght-Moony
855b7e8cf3 jsondoclint: Add --verbose flag.
Without verbose:
    0:61941:36627 not in index or paths, but refered to at '$.index["0:62007"].inner.for.inner.id' and 12 more

With verbose:
    0:10808:27206 not in index or paths, but refered to at '$.index["0:10813"].inner.for.inner.id', '$.index["0:52495"].inner.for.inner.id', '$.index["a:0:2666:215-0:10808:27206"].inner.for.inner.id', '$.index["a:0:2680:223-0:10808:27206"].inner.for.inner.id', '$.index["a:0:2730:7845-0:10808:27206"].inner.for.inner.id', '$.index["a:0:7731:21706-0:10808:27206"].inner.for.inner.id', '$.index["a:0:7732:21705-0:10808:27206"].inner.for.inner.id'
2023-01-03 14:54:46 +00:00
Nixon Enraght-Moony
7680b164b0 jsondoclint: Parse args with clap. 2023-01-03 14:54:46 +00:00
bors
312c9a37f2 Auto merge of #101792 - lqd:rust-lld, r=petrochenkov
Only specify `--target` by default for `-Zgcc-ld=lld` on wasm

On macOS, it's not yet clear which cases of clang/OS/target/SDK version impact how to find ld/lld/rust-lld. The `--target` argument is not needed on our current targets with a vanilla config to do so, but may be in some cases ?

That is, things look to be different and more subtle than suggested in https://github.com/rust-lang/rust/issues/97402#issuecomment-1147404520.

Specifying this argument unconditionally currently breaks `-Zgcc-ld=lld` on the 10.7+ targets on x64 macOS. Vanilla configs on x64 and aarch64 don't seem to need it to be able to find `rust-lld`.

This fixes #101653 on macOS (I've tried on x64 and aarch64: vanilla installs with the most recent command line tools available for each of the OS versions I have access to, `run-make/issue-71519` passes).

I didn't expect the previous PRs to fail because of the existing tests, but CI does not actually run those tests yet, which explains the regressions. I was hoping to fix those in this PR but it's more involved (building lld is required for the tests to run, llvm/lld is not built on the test builders but on the dist builders, the dist builders don't run tests). This PR is just to unblock current users on macOS who have reported issues, but a regression could happen in the future by mistake until then.

r? `@petrochenkov`
2023-01-03 14:05:44 +00:00
bors
b435960c4c Auto merge of #95644 - WaffleLapkin:str_split_as_str_refactor_take2, r=Amanieu
`Split*::as_str` refactor

I've made this patch almost a year ago, so the rename and the behavior change are in one commit, sorry 😅

This fixes #84974, as it's required to make other changes work.

This PR
- Renames `as_str` method of string `Split*` iterators to `remainder` (it seems like the `as_str` name was confusing to users)
- Makes `remainder` return `Option<&str>`, to distinguish between "the iterator is exhausted" and "the tail is empty", this was [required on the tracking issue](https://github.com/rust-lang/rust/issues/77998#issuecomment-832696619)

r? `@m-ou-se`
2023-01-03 11:06:08 +00:00
bors
3b1c8a94a4 Auto merge of #105609 - bjorn3:shrink_rustc_dev, r=jyn514
Only include metadata for non-dynamic libraries in rustc-dev

The actual object code should be linked from librustc_driver.so, which is still included in rustc-dev. This saves on download time and disk usage.

Fixes https://github.com/rust-lang/rust/issues/103538
2023-01-03 08:05:54 +00:00
Rageking8
e808a69911 fix dupe word typos 2023-01-03 15:48:16 +08:00
bors
442f997f98 Auto merge of #106371 - RalfJung:no-ret-position-noalias, r=nikic
do not add noalias in return position

`noalias` as a return attribute in LLVM indicates that the returned pointer does not alias anything else that is reachable from the caller, *including things reachable before this function call*. This is clearly not the case with a function like `fn id(Box<T>) -> Box<T>`, so we cannot use this attribute.

Fixes https://github.com/rust-lang/unsafe-code-guidelines/issues/385 (including an actual miscompilation that `@comex` managed to produce).
2023-01-03 04:54:03 +00:00
J Haigh
85f649fd27
no_deps
Co-authored-by: Joshua Nelson <github@jyn.dev>
2023-01-02 20:49:18 -07:00
Joshua Nelson
6f1d9ba581 Allow passing a specific date to bump-stage0
This allows regenerating `src/stage0.json` on changes to the tool,
without needing to hard-code the date in the source.
2023-01-03 03:40:58 +00:00