Commit Graph

226719 Commits

Author SHA1 Message Date
Matthias Krüger
dbe31bb693
Rollup merge of #112477 - jyn514:assemble-info, r=clubby789
Give more helpful progress messages in `Assemble`

Before (download-rustc):
```
    # no output
```

After (download-rustc):
```
Creating a sysroot for stage2 compiler (use `rustup toolchain link 'name' build/host/stage2`)
```

Before (compiling from source):
```
Building compiler artifacts (stage0 -> stage1, x86_64-unknown-linux-gnu)
Assembling stage1 compiler
Build stage1 library artifacts (x86_64-unknown-linux-gnu -> i686-unknown-linux-gnu)
Building compiler artifacts (stage0:x86_64-unknown-linux-gnu -> stage1:i686-unknown-linux-gnu)
Assembling stage1 compiler (i686-unknown-linux-gnu)
```

After (compiling from source):
```
Building compiler artifacts (stage0 -> stage1, x86_64-unknown-linux-gnu)
Creating a sysroot for stage1 compiler (use `rustup toolchain link 'name' build/host/stage1`)
Build stage1 library artifacts (x86_64-unknown-linux-gnu)
Building compiler artifacts (stage0:x86_64-unknown-linux-gnu -> stage1:i686-unknown-linux-gnu)
Creating a sysroot for stage1 compiler (i686-unknown-linux-gnu) (use `rustup toolchain link 'name' build/i686-unknown-linux-gnu/stage1`)
```
cc https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/Unable.20to.20compile.20rustc.20MSVC, https://discord.com/channels/273534239310479360/957720175619215380/1116867245499498506
2023-06-11 01:57:26 +02:00
Matthias Krüger
e19a509f8f
Rollup merge of #112475 - chenyukang:yukang-fix-112278, r=compiler-errors
Fix issue for module name when surround the struct literal with parentheses

Fixes #112278
2023-06-11 01:57:25 +02:00
Michael Goulet
5dfc17f045 prune some unused code 2023-06-10 23:36:55 +00:00
Michael Goulet
e49b4625df Don't compute opt_suggest_box_span for TAIT 2023-06-10 23:21:38 +00:00
León Orell Valerian Liehr
a995255cf5
iat selection: normalize self ty & completely erase bound vars 2023-06-11 00:19:47 +02:00
bors
b8a50010de Auto merge of #112256 - jyn514:faster-mingw-check, r=Mark-Simulacrum
Don't compile rustc to self-test compiletest

This was changed from stage 0 to 1 in https://github.com/rust-lang/rust/pull/108905, but I'm not sure why. Change it to `top_stage` instead to allow people to choose the stage.

This should save quite a bit of time in the `mingw-check` builder, which explicitly runs `x test --stage 0 compiletest`.

Note that this also fixes a latent bug that depended on running `x build compiler` before `x doc compiler`, as well as a couple cleanups related to symlinks (which made the latent bug easier to find).

cc `@pietroalbini`
2023-06-10 21:47:13 +00:00
Michael Howell
d3a4cd6813 rustdoc: add note about slice/array searches to help popup 2023-06-10 14:08:26 -07:00
Michael Howell
7a1154e159 rustdoc: update book with [] syntax 2023-06-10 13:52:56 -07:00
Michael Howell
2e569274d3 rustdoc: search for slices and arrays by type with []
Part of #60485
2023-06-10 13:52:54 -07:00
Michael Howell
3ed4c17d90 rustdoc: add test case for OsString::into_string 2023-06-10 13:50:40 -07:00
Hankai Zhang
6336da9a75 Use a better link 2023-06-10 14:46:11 -04:00
bors
7820972f86 Auto merge of #107637 - fmease:rustdoc-reelide-x-crate-def-tr-obj-lt-bnds, r=notriddle,cgillot,GuillaumeGomez
rustdoc: re-elide cross-crate default trait-object lifetime bounds

Hide trait-object lifetime bounds (re-exported from an external crate) if they coincide with [their default](https://doc.rust-lang.org/reference/lifetime-elision.html#default-trait-object-lifetimes).
Partially addresses #44306. Follow-up to #103885. [Zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/clean_middle_ty.3A.20I.20need.20to.20add.20a.20parameter/near/307143097).

Most notably, if `std` exported something from `core` containing a type like `Box<dyn Fn()>`, then it would now be rendered as `Box<dyn Fn(), Global>` instead of `Box<dyn Fn() + 'static, Global>` (hiding `+ 'static` as it is the default in this case). Showing `Global` here is a separate issue, #80379, which is on my agenda.

Note that I am not really fond of the fact that I had to add a parameter to such a widely used function (30+ call sites) to address such a niche bug.

CC `@GuillaumeGomez`
Requesting a review from a compiler contributor or team member as recommended on Zulip.
r? compiler

---

`@rustbot` label T-compiler T-rustdoc A-cross-crate-reexports
2023-06-10 18:28:14 +00:00
Zachary Whiteley
ab68390153
Improve documentation for tools profile
Make the build process more beginner friendly:

 - Include information explaining that the stage2 toolchain should be
   used (and not the stage1 toolchain) due to the `download-rustc`
   setting.

 - Display a message when the user runs `x setup tools` explaining that
   they should use the stage2 toolchain.
2023-06-10 19:08:58 +01:00
Hankai Zhang
e5fccf927d Update links to Rust Reference page on literals in diagnostic
Instead of linking to the old Rust Reference site on static.rust-lang.org,
link to the current website doc.rust-lang.org/stable/reference instead in
diagnostic about incorrect literals.
2023-06-10 12:34:16 -04:00
bors
ef8ee73fc4 Auto merge of #112494 - matthiaskrgr:rollup-xdf3om8, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #112297 (bootstrap: Disallow `--exclude test::std`)
 - #112298 (Update field-offset and enable unstable_offset_of)
 - #112335 (ci: Upgrade loongarch64-linux-gnu GCC to 13.1.0)
 - #112413 (Adjust span labels for `HIDDEN_GLOB_REEXPORTS`)
 - #112483 (Add deprecation warning to python versions <3.6 in x.py)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-06-10 15:49:43 +00:00
icecream17
83d7826753
abs_sub: fix typo 0[-:][+.]0 2023-06-10 10:45:50 -05:00
Matthias Krüger
68e162d364
Rollup merge of #112483 - tgross35:py2-dep-warning, r=Mark-Simulacrum
Add deprecation warning to python versions <3.6 in x.py

Introduced based on conversation on Zulip. This is a repeat of #110439 with two changes:

- Warning rather than exit
- Can be suppressed via an environment variable

The min to not get the warning is set to 3.6 because that's a fairly recent "old" version (went EOL in 2021) and it's the first version to support useful modern features like f-strings and type hints.

cc `@Nilstrieb` (author of #110439) and `@Mark-Simulacrum` (reviewer of that PR)
2023-06-10 15:24:44 +02:00
Matthias Krüger
312e676333
Rollup merge of #112413 - jieyouxu:fix-hidden-glob-reexports-span-order, r=petrochenkov
Adjust span labels for `HIDDEN_GLOB_REEXPORTS`

Addresses https://github.com/rust-lang/rust/pull/111378#issuecomment-1581226063.

### Before This PR

The possibility that the private item comes before the glob re-export was not account for, causing the span label messages to say "but private item here shadows it" before "the name `Foo` in the type namespace is supposed to be publicly re-exported here".

### After This PR

```rust
warning: private item shadows public glob re-export
  --> $DIR/hidden_glob_reexports.rs:9:5
   |
LL |     struct Foo;
   |     ^^^^^^^^^^^ the private item here shadows the name `Foo` in the type namespace
...
LL |     pub use self::inner::*;
   |             -------------- but it is supposed to be publicly re-exported here
   |
   = note: `#[warn(hidden_glob_reexports)]` on by default

warning: private item shadows public glob re-export
  --> $DIR/hidden_glob_reexports.rs:27:9
   |
LL |     pub use self::inner::*;
   |             -------------- the name `Foo` in the type namespace is supposed to be publicly re-exported here
LL |
LL |     use self::other::Foo;
   |         ^^^^^^^^^^^^^^^^ but the private item here shadows it
```
2023-06-10 15:24:44 +02:00
Matthias Krüger
8744b1a575
Rollup merge of #112335 - loongarch-rs:gcc13, r=Mark-Simulacrum
ci: Upgrade loongarch64-linux-gnu GCC to 13.1.0

This PR upgrades GCC to 13.1.0 for the `loongarch64-unknown-linux-gnu` target. This upgrade was suggested in a previous review discussion: https://github.com/rust-lang/rust/pull/110519#discussion_r1184613749
2023-06-10 15:24:43 +02:00
Matthias Krüger
e3656ff9fd
Rollup merge of #112298 - est31:update_field_offset, r=Mark-Simulacrum
Update field-offset and enable unstable_offset_of

This makes the compiler use the builtin `offset_of!()` macro, through the wrappers in memoffset and then in field-offset.

cc  #111839
2023-06-10 15:24:43 +02:00
Matthias Krüger
04e41dda83
Rollup merge of #112297 - jyn514:remove-exclude-kind, r=Mark-Simulacrum
bootstrap: Disallow `--exclude test::std`

Use the top-level Kind to determine whether Steps are excluded.

Previously, this would use the `Kind` passed to `--exclude` (and not do any filtering at all if no kind was passed).
That meant that `x test linkchecker --exclude std` would fail - you had to explicitly say `--exclude test::std`.

Change bootstrap to use the top-level Kind instead, which does the right thing automatically.
Note that this breaks things like `x test --exclude doc::std`, but I'm not sure why you'd ever want to do that.

There's a lot of churn here, but the 1-line change in the first commit is the actual behavior change, the rest is just cleanup.

Fixes https://github.com/rust-lang/rust/issues/103201. Note that this effectively reverts most of https://github.com/rust-lang/rust/pull/91965.

cc `@pietroalbini`
2023-06-10 15:24:42 +02:00
bors
788c98df59 Auto merge of #111818 - Urgau:uplift_cmp_nan, r=cjgillot
Uplift `clippy::cmp_nan` lint

This PR aims at uplifting the `clippy::cmp_nan` lint into rustc.

## `invalid_nan_comparisons`

~~(deny-by-default)~~ (warn-by-default)

The `invalid_nan_comparisons` lint checks comparison with `f32::NAN` or `f64::NAN` as one of the operand.

### Example

```rust,compile_fail
let a = 2.3f32;
if a == f32::NAN {}
```

### Explanation

NaN does not compare meaningfully to anything – not even itself – so those comparisons are always false.

-----

Mostly followed the instructions for uplifting a clippy lint described here: https://github.com/rust-lang/rust/pull/99696#pullrequestreview-1134072751

`@rustbot` label: +I-lang-nominated
r? compiler
2023-06-10 12:47:51 +00:00
bdbai
cd523f2f18 Keep uwp specific code in sync with windows-sys 2023-06-10 20:47:10 +08:00
Guillaume Gomez
08e0c12c07 Migrate GUI colors test to original CSS color format 2023-06-10 14:38:08 +02:00
bors
4b71d79c97 Auto merge of #112485 - matthiaskrgr:rollup-ta84xje, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #110141 (expand: Change how `#![cfg(FALSE)]` behaves on crate root)
 - #112369 (More CGU cleanups)
 - #112467 (Compile rustc_driver by default)
 - #112468 (Change format of rustdoc-js tests by putting query and correction directly alongside the expected values)
 - #112473 (Update cargo)
 - #112481 (Ignore tests that hang in new solver)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-06-10 10:02:18 +00:00
Matthias Krüger
dcdfff61d2
Rollup merge of #112481 - compiler-errors:new-solver-ignore-bad-tests, r=lqd
Ignore tests that hang in new solver

This makes it easier to run `--compare-mode=next-solver`, and we can revisit these tests later to find out how to make them less overflowy 😅

r? `@lcnr`
2023-06-10 11:20:11 +02:00
Matthias Krüger
fc9fff6d59
Rollup merge of #112473 - weihanglo:update-cargo, r=weihanglo
Update cargo

12 commits in b0fa79679e717cd077b7fc0fa4166f47107f1ba9..49b6d9e179a91cf7645142541c9563443f64bf2b
2023-06-03 14:19:48 +0000 to 2023-06-09 17:21:19 +0000
- docs: doc comments for all registry kinds (rust-lang/cargo#12247)
- chore: Migrate print-ban from test to clippy (rust-lang/cargo#12246)
- fix: fetch nested git submodules (rust-lang/cargo#12244)
- refactor: registry source cleanup (rust-lang/cargo#12240)
- test: loose overly matches for git cli output (rust-lang/cargo#12241)
- fix: disable multiplexing on macOS for some versions of curl (rust-lang/cargo#12234)
- docs: doc comments for registry source and index (rust-lang/cargo#12239)
- doc: point to nightly cargo doc (rust-lang/cargo#12237)
- Upgrade to `gix` v0.45 for multi-round pack negotiations. (rust-lang/cargo#12236)
- refactor: git source cleanup (rust-lang/cargo#12197)
- Add message on reusing previous temporary path on failed cargo installs (rust-lang/cargo#12231)
- doc: the first line should be a simple sentence instead of a heading (rust-lang/cargo#12228)

r? `@ghost`
2023-06-10 11:20:11 +02:00
Matthias Krüger
299929e035
Rollup merge of #112468 - GuillaumeGomez:change-rustdoc-js-formats, r=notriddle
Change format of rustdoc-js tests by putting query and correction directly alongside the expected values

As I was working on fixing merge conflicts in #108537, I faced quite a big issue when trying to update the `rustdoc-js*` tests. To make it much simpler, this PR moves the `query` and `correction` directly alongside the expected data so now we know what is the query that is being run without needing to add comments or going back to the top of the file.

r? ```@notriddle```
2023-06-10 11:20:10 +02:00
Matthias Krüger
4d36c84668
Rollup merge of #112467 - sigaloid:master, r=albertlarsan68
Compile rustc_driver by default

Fixes #112440. It now properly compiles `rustc_driver` and opens the doc page.
2023-06-10 11:20:10 +02:00
Matthias Krüger
3189ce630d
Rollup merge of #112369 - nnethercote:more-cgu-cleanups, r=wesleywiser
More CGU cleanups

An assortment of improvements.

r? `@wesleywiser`
2023-06-10 11:20:09 +02:00
Matthias Krüger
2baebad063
Rollup merge of #110141 - petrochenkov:cratecfg2, r=WaffleLapkin
expand: Change how `#![cfg(FALSE)]` behaves on crate root

Previously it removed all other attributes from the crate root.
Now it removes only attributes below itself (during both regular expansion and pre-configuration).

So it becomes possible to configure some global crate properties even for fully unconfigured crates.

Fixes https://github.com/rust-lang/rust/issues/104633
Part of https://github.com/rust-lang/rust/issues/110082
2023-06-10 11:20:09 +02:00
Urgau
a8145372d7 Drop uplifted clippy:cmp_nan 2023-06-10 11:13:01 +02:00
Urgau
3e91349c42 Uplift improved version of clippy::cmp_nan to rustc 2023-06-10 11:12:55 +02:00
许杰友 Jieyou Xu (Joe)
80176a120e
Adjust span labels for HIDDEN_GLOB_REEXPORTS 2023-06-10 17:11:38 +08:00
bdbai
48e410e317 Lazy load ntdll functions on UWP 2023-06-10 16:34:20 +08:00
bors
d0ee1908ed Auto merge of #112452 - MU001999:fix/issue-112439, r=petrochenkov
Make "consider importing" consistent for macros

Fixes #112439
2023-06-10 05:07:53 +00:00
Trevor Gross
cec95d74dd Add deprecation warning for python <3.6 in x.py
Soft deprecate old python versions to give users a warning that
eventually it may not be supported.
2023-06-09 23:56:12 -04:00
yukang
f54e75730b remove unwrap 2023-06-10 10:34:19 +08:00
bors
29611778b7 Auto merge of #112426 - Bryanskiy:full_priv_ev, r=petrochenkov
increase the accuracy of effective visibilities calculation

Effective visibilities are calculated lazily due to performance restrictions.  Therefore

- crate should be walked at least 1 time in `compute_effective_visibilities` pass
- Impl's should always be in the effective visibilities table

to ensure that the table is filled in correctly.

r? `@petrochenkov`
2023-06-10 02:16:24 +00:00
jyn
f531fec411 Give more helpful progress messages in Assemble
Before (download-rustc):
```
 # no output
```

After (download-rustc):
```
Creating a sysroot for stage2 compiler (use `rustup toolchain link 'name' build/host/stage2`)
```

Before (compiling from source):
```
Building compiler artifacts (stage0 -> stage1, x86_64-unknown-linux-gnu)
Assembling stage1 compiler
Build stage1 library artifacts (x86_64-unknown-linux-gnu -> i686-unknown-linux-gnu)
Building compiler artifacts (stage0:x86_64-unknown-linux-gnu -> stage1:i686-unknown-linux-gnu)
Assembling stage1 compiler (i686-unknown-linux-gnu)
```

After (compiling from source):
```
Building compiler artifacts (stage0 -> stage1, x86_64-unknown-linux-gnu)
Creating a sysroot for stage1 compiler (use `rustup toolchain link 'name' build/host/stage1`)
Build stage1 library artifacts (x86_64-unknown-linux-gnu)
Building compiler artifacts (stage0:x86_64-unknown-linux-gnu -> stage1:i686-unknown-linux-gnu)
Creating a sysroot for stage1 compiler (i686-unknown-linux-gnu) (use `rustup toolchain link 'name' build/i686-unknown-linux-gnu/stage1`)
```
2023-06-09 18:20:38 -05:00
yukang
e3071eaa60 reword the message to suggest surrounding with parentheses 2023-06-10 06:28:35 +08:00
yukang
3983881d4e take care module name for suggesting surround the struct literal in parentheses 2023-06-10 06:28:35 +08:00
Michael Goulet
3152ac34bd Ignore tests that hang in new solver 2023-06-09 21:57:37 +00:00
Vadim Petrochenkov
46becfdf9c expand: Change how #![cfg(FALSE)] behaves on crate root
Previously it removed all other attributes from the crate root.
Now it removes only attributes below itself.

So it becomes possible to configure some global crate properties even for fully unconfigured crates.
2023-06-10 00:35:21 +03:00
Weihang Lo
a655b4d016
Update cargo 2023-06-09 20:10:43 +01:00
bors
43062c43d2 Auto merge of #112216 - est31:offset_of_deep_tuple, r=petrochenkov
Support float-like tuple indices in offset_of!()

Supports invocations like `offset_of!((((), ()), ()), 0.0)`. This `0.0` gets tokenized as float literal, so it has to be broken up again.

The code that did the breaking up was returning a finished `Expr`, while we need a `Ident`, so this PR splits up the `parse_expr_tuple_field_access_float` function into:

* a function that breaks up the float literal (similar to `TokenKind::break_two_token_op`, but we do access the parser during this splitting operation, so we keep it as an inherent function on the parser)
* and a function that constructs an `Expr` from it

The former we can then re-use in `offset_of` parsing. The edge cases especially involving whitespaces are tricky so this adds a bunch of new tests as well.

fixes #112204
2023-06-09 18:53:58 +00:00
Mu001999
5bd8ba8493 Make "consider importing" consistent for macros 2023-06-10 00:06:34 +08:00
Urgau
3681285df7 Add diagnostic items for f32::NAN and f64::NAN 2023-06-09 17:46:33 +02:00
bors
397641f3bd Auto merge of #112465 - GuillaumeGomez:rollup-gyh5buc, r=GuillaumeGomez
Rollup of 3 pull requests

Successful merges:

 - #112260 (Improve document of `unsafe_code` lint)
 - #112429 ([rustdoc] List matching impls on type aliases)
 - #112442 (Deduplicate identical region constraints in new solver)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-06-09 15:37:22 +00:00
Guillaume Gomez
9803651ee8 Update rustdoc-js* format 2023-06-09 17:00:47 +02:00