Commit Graph

1819 Commits

Author SHA1 Message Date
Matthias Krüger
27db39b1b3
Rollup merge of #106470 - ehuss:tidy-no-wasm, r=Mark-Simulacrum
tidy: Don't include wasm32 in compiler dependency check

This changes the tidy compiler dependency check so that it does not include wasm32-unknown-unknown dependencies in the PERMITTED_RUSTC_DEPENDENCIES. This just helps keep the list cleaner under the assumption that the compiler will never work on wasm32-unknown-unknown.

This also fixes a bug in the check to verify there are no unused dependencies in the PERMITTED_RUSTC_DEPENDENCIES. Previously the check was verifying that the dependency was used *anywhere* in the workspace, when it should have been checking if it was used for the compiler.

There's also just a little general cleanup here. For example, the old `normal_deps_of_r` function was changed a while ago to return *all* dependencies, but the function name and description wasn't updated to remove `normal_`.
2023-01-14 13:04:24 +01:00
bors
44a500c8c1 Auto merge of #106646 - Amanieu:ilp32-object, r=Mark-Simulacrum
Fix aarch64-unknown-linux-gnu_ilp32 target

This was broken because the synthetic object files produced by rustc were for 64-bit AArch64, which caused link failures when combined with 32-bit ILP32 object files.

This PR updates the object crate to 0.30.1 which adds support for generating ILP32 AArch64 object files.
2023-01-14 08:33:09 +00:00
bors
c0b8735959 Auto merge of #106833 - JohnTitor:rollup-z8398jk, r=JohnTitor
Rollup of 13 pull requests

Successful merges:

 - #104965 (reword Option::as_ref and Option::map examples)
 - #105172 (Added error documentation for write_fmt)
 - #106605 (rustdoc: fix outdated lint section of the book)
 - #106670 (Check compiler docs in PR CI)
 - #106692 (mv binary_heap.rs binary_heap/mod.rs)
 - #106693 (rustdoc: rename CSS rustdoc-toggle -> toggle and toggle -> settings-toggle)
 - #106707 (Remove duplicate sha-1 dependency)
 - #106762 (Add `AtomicPtr::as_mut_ptr`)
 - #106766 (Remove dead code in rustdoc stripper)
 - #106775 (Remove stale reference to the test suite location)
 - #106799 (Stop having unused lifetimes on some `impl`s)
 - #106816 (Update `rental` hack to work with remapped paths.)
 - #106819 (rustdoc: remove unnecessary DOM class `h1.fqn`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-01-14 05:51:55 +00:00
bors
e9e0908367 Auto merge of #106520 - ehuss:update-mdbook, r=Mark-Simulacrum
Update mdbook

This updates mdbook from 0.4.21 to 0.4.25. The list of changes is [here](https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-0425). The only user-visible changes are some changes around the theme picker, and change to the copy-to-clipboard ignoring hidden lines.

Internally there were some dependency updates and small fixes.

This also updates `clap` from 4.0.15 to 4.0.32 whose changelog is [here](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md#4032---2022-12-22). This impacts tools like cargo. I don't see anything particularly noteworthy there, though there are some small user-visible changes.

Unfortunately this required adding a hack for building `rustix` with a bootstrap tool. The comment explains why. I am unable to think of some other workaround (or even a cleaner way to set the rustflag). Ideas are welcome if you can think of alternatives. I'm struggling to even think of a long-term solution, other than asking projects not to do auto-nightly feature detection.

One medium-term solution is to avoid the clap dependency for the mdbook library (which is how rustix gets pulled in). That is one of my goals for the 0.5 release of mdbook, but that probably won't happen until later this year. It would also require dropping clap from `rustbook` and using some other means to parse arguments (there's only two options, so it can probably be done manually).
2023-01-14 03:04:40 +00:00
Yuki Okushi
6486b02105
Rollup merge of #106707 - ehuss:remove-dupe-sha-1, r=Mark-Simulacrum
Remove duplicate sha-1 dependency

[`sha-1`](https://crates.io/crates/sha-1) is more or less a duplicate of [`sha1`](https://crates.io/crates/sha1). The `sha-1` is deprecated and no longer updated. This updates the dependencies to use the new name.

Some other dependencies that got updated as a consequence:
* The updated pest dependencies are currently only used by mdbook, and shouldn't have any issues.
* ucd-trie 0.1.3 to 0.1.5: No changelog, but looks like some tables were updated for new unicode versions: https://github.com/BurntSushi/ucd-generate/commits/master/ucd-trie. This is only used by pest (and thus mdbook).
* thiserror 1.33 to 1.38: Nothing significant in the notes at https://github.com/dtolnay/thiserror/releases.
2023-01-14 12:04:34 +09:00
Matthias Krüger
96bb02f35c
Rollup merge of #104645 - yukiomoto:log-backtrace-option, r=oli-obk
Add log-backtrace option to show backtraces along with logging

according to #90698, I added a compiler option, `-Zlog-backtrace=filter`, where `filter` is a module name, to show backtraces for logging without rebuilding.

resolve #90698
2023-01-13 19:16:41 +01:00
J Haigh
1a993611d2
Revert "warn newer available version of the x tool" 2023-01-11 11:11:56 -07:00
Yuki Omoto
4e2a3567bc Add log-backtrace option to show backtraces along with logging 2023-01-12 00:17:48 +09:00
Eric Huss
bb60a764f6 Remove duplicate sha-1 dependency 2023-01-10 21:02:06 -08:00
Pietro Albini
4f40eee2bc
bump Cargo submodule to fix CVE-2022-46176 2023-01-10 17:28:37 +01:00
Eric Huss
2717f60093 Update mdbook 2023-01-09 17:04:14 -08:00
Amanieu d'Antras
a529ba8f67 Fix aarch64-unknown-linux-gnu_ilp32 target
This was broken because the synthetic object files produced by rustc
were for 64-bit AArch64, which caused link failures when combined with
32-bit ILP32 object files.

This PR updates the object crate to 0.30.1 which adds support for
generating ILP32 AArch64 object files.
2023-01-09 17:49:24 +00:00
bors
2afe58571e Auto merge of #104658 - thomcc:rand-update-and-usable-no_std, r=Mark-Simulacrum
Update `rand` in the stdlib tests, and remove the `getrandom` feature from it.

The main goal is actually removing `getrandom`, so that eventually we can allow running the stdlib test suite on tier3 targets which don't have `getrandom` support. Currently those targets can only run the subset of stdlib tests that exist in uitests, and (generally speaking), we prefer not to test libstd functionality in uitests, which came up recently in https://github.com/rust-lang/rust/pull/104095 and https://github.com/rust-lang/rust/pull/104185. Additionally, the fact that we can't update `rand`/`getrandom` means we're stuck with the old set of tier3 targets, so can't test new ones.

~~Anyway, I haven't checked that this actually does allow use on tier3 targets (I think it does not, as some work is needed in stdlib submodules) but it moves us slightly closer to this, and seems to allow at least finally updating our `rand` dep, which definitely improves the status quo.~~ Checked and works now.

For the most part, our tests and benchmarks are fine using hard-coded seeds. A couple tests seem to fail with this (stuff manipulating the environment expecting no collisions, for example), or become pointless (all inputs to a function become equivalent). In these cases I've done a (gross) dance (ab)using `RandomState` and `Location::caller()` for some extra "entropy".

Trying to share that code seems *way* more painful than it's worth given that the duplication is a 7-line function, even if the lines are quite gross. (Keeping in mind that sharing it would require adding `rand` as a non-dev dep to std, and exposing a type from it publicly, all of which sounds truly awful, even if done behind a perma-unstable feature).

See also some previous attempts:
- https://github.com/rust-lang/rust/pull/86963 (in particular https://github.com/rust-lang/rust/pull/86963#issuecomment-885438936 which explains why this is non-trivial)
- https://github.com/rust-lang/rust/pull/89131
- https://github.com/rust-lang/rust/pull/96626#issuecomment-1114562857 (I tried in that PR at the same time, but settled for just removing the usage of `thread_rng()` from the benchmarks, since that was the main goal).
- https://github.com/rust-lang/rust/pull/104185
- Probably more. It's very tempting of a thing to "just update".

r? `@Mark-Simulacrum`
2023-01-08 01:34:05 +00:00
Matthias Krüger
771cfa5581
Rollup merge of #104543 - JhonnyBillM:migrate-codegen-ssa-to-diagnostics-structs-pt3, r=davidtwco
Migrate `codegen_ssa` to diagnostics structs - [Part 3]

Completes migrating `codegen_ssa` module except 2 outstanding errors that depend on other crates:
1. [`rustc_middle::mir::interpret::InterpError`](b6097f2e1b/compiler/rustc_middle/src/mir/interpret/error.rs (L475)): I saw `rustc_middle` is unassigned, I am open to take this work.

2.  `codegen_llvm`'s use of `fn span_invalid_monomorphization_error`, which I started to replace in the [last commit](9a31b3cdda) of this PR, but would like to know the team's preference on how we should keep replacing the other macros:
2.1. Update macros to expect a `Diagnostic`
2.2. Remove macros and expand the code on each use.
See [some examples of the different options in this experimental commit](64aee83e80)

_Part 2 - https://github.com/rust-lang/rust/pull/103792_

r? ``@davidtwco``
Cc ``@compiler-errors``
2023-01-07 20:43:19 +01:00
bors
7ac9572c48 Auto merge of #106415 - Nilstrieb:where-is-my-master-branch, r=jyn514
Handle non-existent upstream master branches in `x fmt`

People who do have a remote for `rust-lang/rust` but don't have the master branch checked out there used to get this error when running `x fmt`:
> fatal: ambiguous argument 'rust/master': unknown revision or path not in the working tree.
> Use '--' to separate paths from revisions, like this:
> 'git <command> [<revision>...] -- [<file>...]'
> rust/master

Which is not exactly helpful.

Now, we fall back to `origin/master` (hoping that at least that remote exists) for that case. If there is still some error, we just fall back to `x fmt .` and print a warning.

r? `@jyn514`
2023-01-06 21:51:44 +00:00
Nilstrieb
d5e5762211 Handle non-existant upstream master branches in x fmt 2023-01-06 20:18:50 +01:00
Thom Chiovoloni
a4bf36e87b
Update rand in the stdlib tests, and remove the getrandom feature from it 2023-01-04 14:52:41 -08:00
Eric Huss
1d7d10a93d tidy: Don't include wasm32 in compiler dependency check 2023-01-04 14:05:58 -08:00
Weihang Lo
6306fd3be4
Update cargo
8 commits in 2381cbdb4e9b07090f552d34a44a529b6e620e44..8c460b2237a6359a7e3335890db8da049bdd62fc
2022-12-23 12:19:27 +0000 to 2023-01-04 14:30:01 +0000
- test: revive nightly plugin tests to work (rust-lang/cargo#11534)
- Add note to release notes about rejecting multiple registries. (rust-lang/cargo#11531)
- Fix a typo `fresheness` -&gt; `freshness` (rust-lang/cargo#11529)
- Reasons for rebuilding (rust-lang/cargo#11407)
- Asymmetric tokens (rust-lang/cargo#10771)
- Use proper git URL for GitHub repos (rust-lang/cargo#11517)
- Add `registry.default` example (rust-lang/cargo#11516)
- Support vendoring with different revs from same git repo (rust-lang/cargo#10690)

Also update license exceptions and permitted dependencies
for new cargo dependency "pasetors".

A new dependency `getrandom` is added into `rustc-workspace-hacks`,
since it requires feature `js`.
2023-01-04 15:58:52 +00: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
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
Nilstrieb
25c153149e Add build_helper crate to share code between tidy and bootstrap 2023-01-03 17:45:34 +01: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
7680b164b0 jsondoclint: Parse args with clap. 2023-01-03 14:54:46 +00:00
DebugSteven
376dd8a9b3 use cargo_metadata to get x version 2023-01-02 19:31:18 -07:00
DebugSteven
e9ca6636e1 get latest x version from parsing cargo command 2023-01-02 16:36:29 -07:00
Joshua Nelson
eb53eea609 Add json output to -Zdump-mono-stats
This allows analyzing the output programatically; for example, finding
the item with the highest `total_estimate`.

I also took the liberty of adding `untracked` tests to `rustc_session` and documentation to the unstable book for `dump-mono-items`.
2023-01-02 23:02:58 +00:00
DebugSteven
b9b33d983d spawn x command and compare semvers 2022-12-31 11:38:41 -07:00
Nilstrieb
75b3ee26cb Make tidy errors red
This makes it easier to see them (and makes people go owo).
2022-12-30 21:47:11 +01:00
Ralf Jung
3487fe3249 update lockfile 2022-12-28 22:47:42 +01:00
Jhonny Bill Mena
d1030fab22 UPDATE - migrate fn simd_simple_float_intrinsic error messages 2022-12-27 20:59:21 -05:00
bors
14e2fe4039 Auto merge of #106033 - ChrisDenton:bump-cfg-if, r=Mark-Simulacrum
Remove old version of `cfg-if` by bumping `packed_simd_2` and `getrandom v0.2` versions

```console
> cargo update --package packed_simd_2 --package getrandom@0.2.0
    Updating crates.io index
    Removing cfg-if v0.1.10
    Updating getrandom v0.2.0 -> v0.2.8
    Updating packed_simd_2 v0.3.4 -> v0.3.8
```

`packed_simd_2` is only used as a dependency of `bytecount` which in turn is only used by `rustfmt`. I can't see any issue with the minor version bump.

The bigger jump is `getrandom@0.2.0` which is used by a number of things, but 0.2.8 is still semver compatible and there doesn't seem to be any worrying changes (see the [changelog](https://github.com/rust-random/getrandom/blob/master/CHANGELOG.md)). The only breaking change are the removal of XP, stdweb and CloudAbi support but these are not host targets and rustc lacks support for them in any case (stdweb development was [abandonded](https://rustsec.org/advisories/RUSTSEC-2020-0056.html), XP is [tier 3 and `no_std`](https://doc.rust-lang.org/beta/rustc/platform-support.html#tier-3) and CloubAbi is [no longer supported](https://github.com/rust-lang/rust/pull/78439)).

Note that this doesn't affect `getrandom@0.1.16` which is what std depends on and which is already using the latest version of `cfg-if` (besides, there are already plans to remove that entirely).
2022-12-23 10:46:58 +00:00
bors
5e656baf8b Auto merge of #106070 - matthiaskrgr:rollup-jv9ctkl, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #105978 (Mark `proc_macro_decls_static` as always used)
 - #106051 (Allow building std with cranelift)
 - #106056 (Make `sess.bug` much less noisy)
 - #106057 (Give a more helpful error for "trimmed_def_paths constructed")
 - #106058 (Fix the issue number in comment for as_local_call_operand)
 - #106059 (Avoid running the `Profile` step twice on `x setup`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-12-23 02:44:32 +00:00
Matthias Krüger
da370fe25a
Rollup merge of #106057 - jyn514:trimmed-def-paths-ice, r=compiler-errors
Give a more helpful error for "trimmed_def_paths constructed"

cc https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/ice.20debugging/near/315928294, https://github.com/rust-lang/rust/pull/106056

`@mejrs` do you think this would have helped you figure out the problem faster?
2022-12-23 01:17:51 +01:00
Joshua Nelson
f94c926aec Support documenting Cargo
The primary motivation is to have the cargo docs show up on https://doc.rust-lang.org/nightly/nightly-rustc/cargo, but as a nice side effect this makes `x doc cargo` work locally.
2022-12-22 14:33:22 -06:00
Joshua Nelson
e4330295d9 Give a more helpful error for "trimmed_def_paths construted" 2022-12-22 13:12:15 -06:00
Chris Denton
531f3c9ee5
Bump packed_simd_2 and getrandom v0.2
Remove old versions of `cfg-if` by bumping `packed_simd_2` and `getrandom v0.2` versions

```console
> cargo update --package packed_simd_2 --package getrandom@0.2.0
    Updating crates.io index
    Removing cfg-if v0.1.10
    Updating getrandom v0.2.0 -> v0.2.8
    Updating packed_simd_2 v0.3.4 -> v0.3.8
```

`packed_simd_2` is only used as a dependency `bytecount`. The bigger jump is `getrandom@0.2.0`, but it's still semver compatible and there doesn't seem to be any worrying changes (see the [changelog](https://github.com/rust-random/getrandom/blob/master/CHANGELOG.md)). Note that this doesn't affect `getrandom@0.1.16`, which is already using the latest version of `cfg-if` (besides, there are already plans to remove that entirely).
2022-12-20 15:28:19 +00:00
Chris Denton
b859b8b62b
Bump cfg-if to 1.0 2022-12-20 13:03:45 +00:00
Weihang Lo
4ab78da50e
Update cargo
11 commits in cc0a320879c17207bbfb96b5d778e28a2c62030d..c994a4a638370bc7e0ffcbb0e2865afdfa7d4415
2022-12-14 14:46:57 +0000 to 2022-12-18 21:50:58 +0000
- Fix examples of proc-macro crates being scraped for examples (rust-lang/cargo#11497)
- Enable triagebot's relabel functionality (rust-lang/cargo#11498)
- Revert "temporarily disable test `lto::test_profile`" (rust-lang/cargo#11495)
- Bump to 0.69.0, update changelog (rust-lang/cargo#11493)
- Fix typo (rust-lang/cargo#11491)
- Display CPU info in CI (rust-lang/cargo#11488)
- Fix collision_doc_profile test error (rust-lang/cargo#11489)
- fix: Make auto-fix note work with `clippy` (rust-lang/cargo#11399)
- fix(add): use the possessive in error message (rust-lang/cargo#11483)
- Document home crate in contrib docs (rust-lang/cargo#11481)
- Split up registry documentation into multiple sections (rust-lang/cargo#11480)
2022-12-18 23:41:09 +00:00
bors
35a99eef32 Auto merge of #104417 - mejrs:mir_build, r=davidtwco
Migrate rustc_mir_build diagnostics

Rebases https://github.com/rust-lang/rust/pull/100854

~~The remaining issue is how to better resolve 72bea68af4~~

~~The diagnostic macros seems to generate a broken diagnostic, and I couldn't figure out how to manually format the fluent message, so I hardcoded the format string for now. I'd like pointers to a better fix for this.~~

Also, I'm not 100% sure I didn't mess up a rebase somewhere 🙂

r? `@davidtwco`
2022-12-18 08:53:49 +00:00
bors
ff016a55c2 Auto merge of #105617 - bjorn3:update_crossbeam, r=Mark-Simulacrum
Update crossbeam

This fixes builds for Gentoo

This should fix https://github.com/rust-lang/rust/issues/104866 (cc `@stefson)`
2022-12-18 02:17:54 +00:00
TheOddGarlic
82f05446a5 Migrate "function cannot return without recursing" diagnostic 2022-12-17 19:08:24 +01:00
Philipp Krones
10f2a6de75
Update Cargo.lock 2022-12-17 14:21:37 +01:00
bjorn3
aa1ab5147e Update crossbeam
This fixes builds for Gentoo
2022-12-12 16:51:39 +00:00
Matthias Krüger
97aa7cb68f
Rollup merge of #105511 - luqmana:rustix-upgrade, r=Mark-Simulacrum
Update rustix to 0.36.5

Pull in fix for https://github.com/bytecodealliance/rustix/issues/467 on recent cargo nightlies.
2022-12-11 00:30:19 +01:00
Matthias Krüger
e47c96a9cf
Rollup merge of #105460 - mkroening:compiler-builtins-0.1.85, r=Mark-Simulacrum
Bump compiler-builtins to 0.1.85

This makes minimal floating point symbols available on `x86_64-unknown-none`.

See https://github.com/rust-lang/compiler-builtins/issues/509 and https://github.com/rust-lang/compiler-builtins/pull/510.
2022-12-11 00:30:19 +01:00
bors
b12b83674f Auto merge of #105525 - matthiaskrgr:rollup-ricyw5s, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - #98391 (Reimplement std's thread parker on top of events on SGX)
 - #104019 (Compute generator sizes with `-Zprint_type_sizes`)
 - #104512 (Set `download-ci-llvm = "if-available"` by default when `channel = dev`)
 - #104901 (Implement masking in FileType comparison on Unix)
 - #105082 (Fix Async Generator ABI)
 - #105109 (Add LLVM KCFI support to the Rust compiler)
 - #105505 (Don't warn about unused parens when they are used by yeet expr)
 - #105514 (Introduce `Span::is_visible`)
 - #105516 (Update cargo)
 - #105522 (Remove wrong note for short circuiting operators)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-12-10 11:16:18 +00:00
Matthias Krüger
947fe7e341
Rollup merge of #105109 - rcvalle:rust-kcfi, r=bjorn3
Add LLVM KCFI support to the Rust compiler

This PR adds LLVM Kernel Control Flow Integrity (KCFI) support to the Rust compiler. It initially provides forward-edge control flow protection for operating systems kernels for Rust-compiled code only by aggregating function pointers in groups identified by their return and parameter types. (See llvm/llvm-project@cff5bef.)

Forward-edge control flow protection for C or C++ and Rust -compiled code "mixed binaries" (i.e., for when C or C++ and Rust -compiled code share the same virtual address space) will be provided in later work as part of this project by identifying C char and integer type uses at the time types are encoded (see Type metadata in the design document in the tracking issue #89653).

LLVM KCFI can be enabled with -Zsanitizer=kcfi.

Thank you again, `@bjorn3,` `@eddyb,` `@nagisa,` and `@ojeda,` for all the help!
2022-12-10 09:24:43 +01:00
bors
cbc70ff277 Auto merge of #105357 - oli-obk:feeding, r=cjgillot,petrochenkov
Group some fields in a common struct so we only pass one reference instead of three

r? `@cjgillot`
2022-12-10 08:23:16 +00:00
bors
0d5573e6da Auto merge of #105363 - WaffleLapkin:thin2win_box_next_argument, r=nnethercote
Shrink `rustc_parse_format::Piece`

This makes both variants closer together in size (previously they were different by 208 bytes -- 16 vs 224). This may make things worse, but it's worth a try.

r? `@nnethercote`
2022-12-09 21:27:35 +00:00