Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 17 pull requests #73947

Closed
wants to merge 41 commits into from

Conversation

Manishearth
Copy link
Member

Successful merges:

Failed merges:

r? @ghost

ChrisDenton and others added 30 commits May 25, 2020 13:53
On Windows the InnoSetup installer was superseded by the MSI installer. It's no longer needed.
This commit applies the existing 'extra angle bracket recovery' logic
when parsing fields in struct definitions. This allows us to continue
parsing the struct's fields, avoiding spurious 'missing field' errors in
code that tries to use the struct.
Use back-ticks instead of quotation marks in docs for the block comment
variant of TokenKind.
Emscripten's SDK recently bumped the version of NodeJS they shipped, but
our Dockerfile for the wasm32 builder hardcoded the version number. This
will cause consistent CI failures once the currently cached image is
rebuilt (either due to a change or due to the cache expiring).

This commit fixes the problem by finding the latest version of NodeJS in
the Emscripten SDK and symlinking it to a "latest" directory, which is
then added to the PATH.
There were a few instances of this pattern:

```rust
while index < vec.len() {
    let item = &vec[index];
    // ...
}
```

These can be indexed at once:

```rust
while let Some(item) = vec.get(index) {
    // ...
}
```

Particularly in `ObligationForest::process_obligations`, this mitigates
a codegen regression found with LLVM 11 (rust-lang#73526).
…omatsakis

Remove legacy InnoSetup GUI installer

On Windows the InnoSetup `.exe` installer was superseded by the MSI installer long ago. It's no longer needed.

The `.exe` installer hasn't been linked from the [other installation methods](https://forge.rust-lang.org/infra/other-installation-methods.html#standalone) page in many years. As far as I can tell the intent was always to remove this installer once the MSI proved itself. Though admittedly both installers feel very "legacy" at this point.

Removing this would mean we only maintain one Windows GUI installer and would speed up the distribution phase.

As a result of removing InnoSetup, this closes rust-lang#24397
Rename TypeckTables to TypeckResults.

Originally suggested by @eddyb.
…trait-soundness, r=nikomatsakis

Don't implement Fn* traits for #[target_feature] functions

Closes rust-lang#72012.
expand: Stop using nonterminals for passing tokens to attribute and derive macros

Make one more step towards fully token-based expansion and fix issues described in rust-lang#72545 (comment).

Now `struct S;` is passed to `foo!(struct S;)` and `#[foo] struct S;` in the same way - as a token stream `struct S ;`, rather than a single non-terminal token `NtItem` which is then broken into parts later.

The cost is making pretty-printing of token streams less pretty.
Some of the pretty-printing regressions will be recovered by keeping jointness with each token, which we will need to do anyway.

Unfortunately, this is not exactly the same thing as rust-lang#73102.
One more observable effect is how `$crate` is printed in the attribute input.
Inside `NtItem` was printed as `crate` or `that_crate`, now as a part of a token stream it's printed as `$crate` (there are good reasons for these differences, see rust-lang#62393 and related PRs).
This may break old proc macros (custom derives) written before the main portion of the proc macro API (macros 1.2) was stabilized, those macros did `input.to_string()` and reparsed the result, now that result can contain `$crate` which cannot be reparsed.

So, I think we should do this regardless, but we need to run crater first.
r? @Aaron1011
…wjasper

Provide more information on duplicate lang item error.

This gives some notes on the location of the files where the lang items were loaded from. Some duplicate lang item errors can be a little confusing, and this might help in diagnosing what has happened.

Here's an example when hitting a bug with Cargo's build-std:

```
error: duplicate lang item in crate `core` (which `rustc_std_workspace_core` depends on): `try`.
  |
  = note: the lang item is first defined in crate `core` (which `z10` depends on)
  = note: first definition in `core` loaded from /Users/eric/Proj/rust/cargo/scratch/z10/target/target/debug/deps/libcore-a764da499c7385f4.rmeta
  = note: second definition in `core` loaded from /Users/eric/Proj/rust/cargo/scratch/z10/target/target/debug/deps/libcore-5b082675aea34986.rmeta
```
…ery, r=matthewjasper

Recover extra trailing angle brackets in struct definition

This commit applies the existing 'extra angle bracket recovery' logic
when parsing fields in struct definitions. This allows us to continue
parsing the struct's fields, avoiding spurious 'missing field' errors in
code that tries to use the struct.
ast_pretty: Pass some token streams and trees by reference

Salvaged from an intermediate version of rust-lang#73345.
…nishearth

Split and expand nonstandard-style lints unicode unit test.

RFC 2457 requested that the `nonstandard_style` series of linted be adjusted to cover the non_ascii_identifier case. However when i read the code of those implementations, it seems they're already supporting non_ascii_identifiers. But the exact rules is a little different than what's proposed in RFC 2457.

So I splitted and expanded the existing test case to try to exercise every branch in the code. I think it'll also be easier to examine the cases in these unit tests to see whether it's ok to just leave them as is, or some adjustments are needed.

r? @Manishearth
…Simulacrum

Remove defunct `-Z print-region-graph`
…r=jonas-schievink

Fix markdown rendering in librustc_lexer docs

Use back-ticks instead of quotation marks in docs for the block comment variant of TokenKind.

## [Before](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lexer/enum.TokenKind.html#variant.BlockComment) and after

<img width="1103" alt="Screen Shot 2020-06-28 at 1 22 30 PM" src="https://user-images.githubusercontent.com/19642016/85957562-446a8380-b943-11ea-913a-442cf7744083.png">

<img width="1015" alt="Screen Shot 2020-06-28 at 1 28 29 PM" src="https://user-images.githubusercontent.com/19642016/85957566-4af8fb00-b943-11ea-8fef-a09c1d586772.png">

## Question

For visual consistency, should we use back-ticks throughout the docs for these enum variants?
Fix Zulip topic format

Yet another instance of me making a mistake after copy-pasting :D
r? @Dylan-DPC
Fix wasm32 being broken due to a NodeJS version bump

Emscripten's SDK [recently bumped the version of NodeJS they shipped](emscripten-core/emsdk#529), but our Dockerfile for the wasm32 builder hardcoded the version number. This will cause consistent CI failures once the currently cached image is rebuilt (either due to a change or due to the cache expiring).

This PR fixes the problem by finding the latest version of NodeJS in the Emscripten SDK and symlinking it to a "latest" directory, which is then added to the `PATH`.
remove duplicate test for rust-lang#61935

Apparently I somehow messed up the issue number in rust-lang#67890
which caused us to add this test twice, both as https://github.com/rust-lang/rust/blob/master/src/test/ui/const-generics/issues/issue-61935.rs and https://github.com/rust-lang/rust/blob/master/src/test/ui/const-generics/lazy-normalization/issue-71922.rs

rust-lang#61935 is the actually fixed issue while rust-lang#71922 is still not working, as it depends on lazy norm of repeat expressions
…ckler

`#[deny(unsafe_op_in_unsafe_fn)]` in libstd/fs.rs

The `libstd/fs.rs` part of rust-lang#73904 . Wraps the two calls to an unsafe fn `Initializer::nop()` in an `unsafe` block.

Followed instructions in parent issue, ran `./x.py check src/libstd/` after adding the lint and two warnings were given. After adding these changes, those disappear.
Rewrite a few manual index loops with while-let

There were a few instances of this pattern:

```rust
while index < vec.len() {
    let item = &vec[index];
    // ...
}
```

These can be indexed at once:

```rust
while let Some(item) = vec.get(index) {
    // ...
}
```

Particularly in `ObligationForest::process_obligations`, this mitigates
a codegen regression found with LLVM 11 (rust-lang#73526).
@Manishearth
Copy link
Member Author

@rustbot modify labels: +rollup
@bors r+ rollup=never p=5

@bors
Copy link
Contributor

bors commented Jul 2, 2020

📌 Commit b5c5382 has been approved by Manishearth

@rustbot rustbot added the rollup A PR which is a rollup label Jul 2, 2020
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jul 2, 2020
@bors
Copy link
Contributor

bors commented Jul 2, 2020

⌛ Testing commit b5c5382 with merge cbabace8862a241f402f0320cc2f404e42c93398...

@bors
Copy link
Contributor

bors commented Jul 2, 2020

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 2, 2020
@Manishearth
Copy link
Member Author

2020-07-02T03:23:50.7570916Z thread '[compile-fail] compile-fail/intrinsics/exact_div2.rs' panicked at 'explicit panic', /cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.5.0/src/runtest.rs:1091:13
2020-07-02T03:23:50.7571167Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2020-07-02T03:23:50.7571860Z error: tests/compile-fail/intrinsics/exact_div2.rs:4: unexpected error: '4:14: 4:49: Undefined Behavior: exact_div: 2_u16 cannot be divided by 3_u16 without remainder'
2020-07-02T03:23:50.7572313Z 
2020-07-02T03:23:50.7572948Z error: tests/compile-fail/intrinsics/exact_div2.rs:4: expected error not found: 2u16 cannot be divided by 3u16 without remainder
2020-07-02T03:23:50.7573060Z 
2020-07-02T03:23:50.7573210Z error: 1 unexpected errors found, 1 expected errors not found
2020-07-02T03:23:50.7573368Z status: exit code: 1
2020-07-02T03:23:50.7579207Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools-bin/miri" "tests/compile-fail/intrinsics/exact_div2.rs" "-L" "/tmp/compiletestPb2EL8" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-C" "prefer-dynamic" "-o" "/tmp/compiletestPb2EL8/intrinsics/exact_div2.stage-id" "-A" "unused" "--edition" "2018" "-Astable-features" "--sysroot" "/home/user/.cache/miri/HOST" "-L" "/tmp/compiletestPb2EL8/intrinsics/exact_div2.stage-id.aux"
2020-07-02T03:23:50.7579531Z unexpected errors (from JSON output): [
2020-07-02T03:23:50.7579685Z     Error {
2020-07-02T03:23:50.7579828Z         line_num: 4,
2020-07-02T03:23:50.7579970Z         kind: Some(
2020-07-02T03:23:50.7580106Z             Error,
2020-07-02T03:23:50.7580242Z         ),
2020-07-02T03:23:50.7649233Z         msg: "4:14: 4:49: Undefined Behavior: exact_div: 2_u16 cannot be divided by 3_u16 without remainder",
2020-07-02T03:23:50.7654938Z     },
2020-07-02T03:23:50.7655087Z ]
2020-07-02T03:23:50.7655171Z 
2020-07-02T03:23:50.7655309Z not found errors (from test file): [
2020-07-02T03:23:50.7655453Z     Error {
2020-07-02T03:23:50.7655627Z         line_num: 4,
2020-07-02T03:23:50.7655768Z         kind: Some(
2020-07-02T03:23:50.7655903Z             Error,
2020-07-02T03:23:50.7656039Z         ),
2020-07-02T03:23:50.7883001Z thread '[compile-fail] compile-fail/intrinsics/exact_div3.rs' panicked at 'explicit panic', /cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.5.0/src/runtest.rs:1091:13
2020-07-02T03:23:50.7883293Z         msg: "2u16 cannot be divided by 3u16 without remainder",
2020-07-02T03:23:50.7883503Z     },
2020-07-02T03:23:50.7883634Z ]
2020-07-02T03:23:50.7883701Z 
2020-07-02T03:23:50.7884060Z test [compile-fail] compile-fail/intrinsics/exact_div2.rs ... FAILED
2020-07-02T03:23:50.7884169Z 
2020-07-02T03:23:50.7884620Z error: tests/compile-fail/intrinsics/exact_div3.rs:4: unexpected error: '4:14: 4:50: Undefined Behavior: exact_div: -19_i8 cannot be divided by 2_i8 without remainder'
2020-07-02T03:23:50.7884754Z 
2020-07-02T03:23:50.7885158Z error: tests/compile-fail/intrinsics/exact_div3.rs:4: expected error not found: -19i8 cannot be divided by 2i8 without remainder
2020-07-02T03:23:50.7885265Z 
2020-07-02T03:23:50.7983767Z error: 1 unexpected errors found, 1 expected errors not found
2020-07-02T03:23:50.7984094Z status: exit code: 1
2020-07-02T03:23:50.7985624Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools-bin/miri" "tests/compile-fail/intrinsics/exact_div3.rs" "-L" "/tmp/compiletestPb2EL8" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-C" "prefer-dynamic" "-o" "/tmp/compiletestPb2EL8/intrinsics/exact_div3.stage-id" "-A" "unused" "--edition" "2018" "-Astable-features" "--sysroot" "/home/user/.cache/miri/HOST" "-L" "/tmp/compiletestPb2EL8/intrinsics/exact_div3.stage-id.aux"
2020-07-02T03:23:50.7985977Z unexpected errors (from JSON output): [
2020-07-02T03:23:50.7986150Z     Error {
2020-07-02T03:23:50.7986292Z         line_num: 4,
2020-07-02T03:23:50.7986435Z         kind: Some(
2020-07-02T03:23:50.7986575Z             Error,
2020-07-02T03:23:50.7986980Z         ),
2020-07-02T03:23:50.7987467Z         msg: "4:14: 4:50: Undefined Behavior: exact_div: -19_i8 cannot be divided by 2_i8 without remainder",
2020-07-02T03:23:50.7987636Z     },
2020-07-02T03:23:50.7987789Z ]
2020-07-02T03:23:50.7987858Z 
2020-07-02T03:23:50.7987996Z not found errors (from test file): [
2020-07-02T03:23:50.7988141Z     Error {
2020-07-02T03:23:50.7988278Z         line_num: 4,
2020-07-02T03:23:50.7988418Z         kind: Some(
2020-07-02T03:23:50.7988692Z             Error,
2020-07-02T03:23:50.7988827Z         ),
2020-07-02T03:23:50.7989191Z         msg: "-19i8 cannot be divided by 2i8 without remainder",
2020-07-02T03:23:50.7989362Z     },
2020-07-02T03:23:50.7989495Z ]
2020-07-02T03:23:50.7989559Z 

@Manishearth Manishearth closed this Jul 2, 2020
@Manishearth Manishearth deleted the rollup-c8j4fem branch July 18, 2020 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.