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 10 pull requests #63557

Closed
wants to merge 50 commits into from
Closed

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Aug 14, 2019

Successful merges:

Failed merges:

r? @ghost

RalfJung and others added 30 commits July 28, 2019 10:19
This makes `rustc` support `@path` arguments on the command line. The `path` is opened and the file is interpreted
as new command line options which are logically inserted at that point in the command-line. The options in the file
are one per line. The file is UTF-8 encoded, and may have either Unix or Windows line endings.
It does not support recursive use of `@path`.

This is useful for very large command lines, or when command-lines are being generated into files by other tooling.
It already imlements the right behaviour, and it saves us implementing the state machine.
Co-Authored-By: bjorn3 <bjorn3@users.noreply.github.com>
Mark-Simulacrum and others added 12 commits August 14, 2019 05:39
This is needed to permit us building core_arch which is a submodule dep
(so we can't snap it to the new beta compiler).
Add lint for excess trailing semicolons

Closes rust-lang#60876.
A caveat (not necessarily a negative, but something to consider) with this implementation is that excess semicolons after return/continue/break now also cause an 'unreachable statement' warning.

For the following example:
```
fn main() {
    extra_semis();
}
fn extra_semis() -> i32 {
    let mut sum = 0;;;
    for i in 0..10 {
        if i == 5 {
            continue;;
        } else if i == 9 {
            break;;
        } else {
            sum += i;;
        }
    }
    return sum;;
}
```
The output is:
```
warning: unnecessary trailing semicolons
 --> src/main.rs:5:21
  |
5 |     let mut sum = 0;;;
  |                     ^^ help: remove these semicolons
  |
  = note: `#[warn(redundant_semicolon)]` on by default

warning: unnecessary trailing semicolon
 --> src/main.rs:8:22
  |
8 |             continue;;
  |                      ^ help: remove this semicolon

warning: unnecessary trailing semicolon
  --> src/main.rs:10:19
   |
10 |             break;;
   |                   ^ help: remove this semicolon

warning: unnecessary trailing semicolon
  --> src/main.rs:12:22
   |
12 |             sum += i;;
   |                      ^ help: remove this semicolon

warning: unnecessary trailing semicolon
  --> src/main.rs:15:16
   |
15 |     return sum;;
   |                ^ help: remove this semicolon

warning: unreachable statement
 --> src/main.rs:8:22
  |
8 |             continue;;
  |                      ^
  |
  = note: `#[warn(unreachable_code)]` on by default

warning: unreachable statement
  --> src/main.rs:10:19
   |
10 |             break;;
   |                   ^

warning: unreachable statement
  --> src/main.rs:15:16
   |
15 |     return sum;;
   |                ^

```
Miri: Check that a ptr is aligned and inbounds already when evaluating `*`

This syncs Miri with what the Nomicon and the Reference say, and resolves rust-lang/miri#447.

Also this would not have worked without rust-lang#62982 due to new cycles. ;)

r? @oli-obk
rustc: implement argsfiles for command line

Many tools, such as gcc and gnu-ld, support "args files" - that is, being able to specify @file on the command line.  This causes `file` to be opened and parsed for command line options. They're separated with whitespace; whitespace can be quoted with double or single quotes, and everything can be \\-escaped. Args files may recursively include other args files via `@file2`.

See https://sourceware.org/binutils/docs/ld/Options.html#Options for the documentation of gnu-ld's @file parameters.

This is useful for very large command lines, or when command lines are being generated into files by other tooling.
…chenkov

libsyntax: cleanup and refactor `pat.rs`

A smaller refactoring & cleanup of `pat.rs` (best read commit by commit).

r? @petrochenkov
 Remove redundant `ty` fields from `mir::Constant` and `hair::pattern::PatternRange`.

Fixes rust-lang#56137.

As a side-effect, associated const literals have the correct type now, which should make things easier for rust-lang#61041.

r? @oli-obk / @matthewjasper cc @davidtwco @varkor
Point at the right enclosing scope when using `await` in non-async fn

Fix rust-lang#63398.
syntax: Remove `DummyResult::expr_only`

The effect is that if a built-in macro both returns an erroneous AST fragment and is used in unexpected position, then the incorrect position error won't be reported.

This combination of two errors should be rare and isn't worth an extra field that makes people ask questions in comments.
(There wasn't even a test making sure it worked.)

Addresses rust-lang#63468 (comment)
r? @estebank
expand: Unimplement `MutVisitor` on `MacroExpander`

Each call to `fully_expand_fragment` is something unique, interesting, and requiring attention.
It represents a "root" of expansion and its use means that something unusual is happening, like eager expansion or expansion performed outside of the primary expansion pass.
So, it shouldn't hide under a generic visitor call.

Also, from all the implemented visitor methods only two were actually used.

cc rust-lang#63468 (comment)
Add NodeId for Arm, Field and FieldPat

Extracted from rust-lang#63468
@Centril
Copy link
Contributor Author

Centril commented Aug 14, 2019

@bors r+ p=10 rollup=never

@bors
Copy link
Contributor

bors commented Aug 14, 2019

📌 Commit 2c8bf8e has been approved by Centril

@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 Aug 14, 2019
@bors
Copy link
Contributor

bors commented Aug 14, 2019

⌛ Testing commit 2c8bf8e with merge e85923dbd436dd90f91aaa3c6c4e93bd233b0d89...

@bors
Copy link
Contributor

bors commented Aug 14, 2019

💔 Test failed - checks-azure

@rust-highfive
Copy link
Collaborator

The job dist-i586-gnu-i586-i686-musl of your PR failed (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-08-14T16:10:10.5158123Z test [ui] ui/async-await/issues/issue-63388-1.rs ... ok
2019-08-14T16:10:10.5345026Z test [ui] ui/async-await/issues/issue-63388-2.rs ... ok
2019-08-14T16:10:10.5735600Z test [ui] ui/async-await/issues/issue-63388-3.rs ... ok
2019-08-14T16:10:10.5809883Z test [ui] ui/async-await/issues/issue-63388-4.rs ... ok
2019-08-14T16:10:10.6314002Z test [ui] ui/async-await/issues/non-async-enclosing-span.rs ... ok
2019-08-14T16:10:10.7206339Z test [ui] ui/async-await/move-part-await-return-rest-tuple.rs ... ok
2019-08-14T16:10:10.7971231Z test [ui] ui/async-await/multiple-lifetimes/elided.rs ... ok
2019-08-14T16:10:10.8606788Z test [ui] ui/async-await/multiple-lifetimes/fn-ptr.rs ... ok
2019-08-14T16:10:10.9209424Z test [ui] ui/async-await/multiple-lifetimes/hrtb.rs ... ok
---
2019-08-14T16:11:11.1584513Z test [ui] ui/coherence/re-rebalance-coherence.rs ... ok
2019-08-14T16:11:11.2097769Z test [ui] ui/command-line-diagnostics.rs ... ok
2019-08-14T16:11:12.7803923Z test [ui] ui/command-pre-exec.rs ... ok
2019-08-14T16:11:13.1068176Z test [ui] ui/command-exec.rs ... ok
2019-08-14T16:11:13.1172435Z test [ui] ui/commandline-argfile-badutf8.rs ... FAILED
2019-08-14T16:11:13.1240044Z test [ui] ui/commandline-argfile-missing.rs ... FAILED
2019-08-14T16:11:13.3002756Z test [ui] ui/commandline-argfile.rs ... ok
2019-08-14T16:11:13.3976774Z test [ui] ui/compare-method/region-extra-2.rs ... ok
2019-08-14T16:11:13.4031144Z test [ui] ui/command-uid-gid.rs ... ok
2019-08-14T16:11:13.4437677Z test [ui] ui/compare-method/region-unrelated.rs ... ok
2019-08-14T16:11:13.4438241Z test [ui] ui/compare-method/region-extra.rs ... ok
---
2019-08-14T16:22:14.3043798Z test [ui] ui/zero-sized/zero-sized-vec-deque-push.rs ... ok
2019-08-14T16:22:14.3043901Z 
2019-08-14T16:22:14.3043965Z failures:
2019-08-14T16:22:14.3084539Z 
2019-08-14T16:22:14.3085074Z ---- [ui] ui/commandline-argfile-badutf8.rs stdout ----
2019-08-14T16:22:14.3085259Z 
2019-08-14T16:22:14.3085259Z 
2019-08-14T16:22:14.3085592Z - error: Argument 18 is not valid: Utf8 error in $DIR/commandline-argfile-badutf8.args
2019-08-14T16:22:14.3085903Z + error: Argument 19 is not valid: Utf8 error in $DIR/commandline-argfile-badutf8.args
2019-08-14T16:22:14.3086062Z 3 
2019-08-14T16:22:14.3086117Z 
2019-08-14T16:22:14.3086151Z 
2019-08-14T16:22:14.3086215Z The actual stderr differed from the expected stderr.
2019-08-14T16:22:14.3086215Z The actual stderr differed from the expected stderr.
2019-08-14T16:22:14.3086616Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/commandline-argfile-badutf8/commandline-argfile-badutf8.stderr
2019-08-14T16:22:14.3086938Z To update references, rerun the tests and pass the `--bless` flag
2019-08-14T16:22:14.3087244Z To only update this specific test, also pass `--test-args commandline-argfile-badutf8.rs`
2019-08-14T16:22:14.3087388Z error: 1 errors occurred comparing output.
2019-08-14T16:22:14.3087454Z status: exit code: 1
2019-08-14T16:22:14.3087454Z status: exit code: 1
2019-08-14T16:22:14.3088461Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/commandline-argfile-badutf8.rs" "-Zthreads=1" "--target=i586-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/commandline-argfile-badutf8" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/i586-unknown-linux-gnu/native/rust-test-helpers" "-Clinker=cc" "--cfg" "cmdline_set" "@/checkout/src/test/ui/commandline-argfile-badutf8.args" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/commandline-argfile-badutf8/auxiliary" "-A" "unused"
2019-08-14T16:22:14.3089019Z ------------------------------------------
2019-08-14T16:22:14.3089065Z 
2019-08-14T16:22:14.3089299Z ------------------------------------------
2019-08-14T16:22:14.3089387Z stderr:
2019-08-14T16:22:14.3089387Z stderr:
2019-08-14T16:22:14.3089616Z ------------------------------------------
2019-08-14T16:22:14.3090122Z error: Argument 19 is not valid: Utf8 error in /checkout/src/test/ui/commandline-argfile-badutf8.args
2019-08-14T16:22:14.3090266Z 
2019-08-14T16:22:14.3090550Z ------------------------------------------
2019-08-14T16:22:14.3090595Z 
2019-08-14T16:22:14.3090650Z 
2019-08-14T16:22:14.3090650Z 
2019-08-14T16:22:14.3090898Z ---- [ui] ui/commandline-argfile-missing.rs stdout ----
2019-08-14T16:22:14.3090991Z diff of stderr:
2019-08-14T16:22:14.3091029Z 
2019-08-14T16:22:14.3091530Z - error: Argument 18 is not valid: IO Error: $DIR/commandline-argfile-missing.args: No such file or directory (os error 2)
2019-08-14T16:22:14.3091887Z + error: Argument 19 is not valid: IO Error: $DIR/commandline-argfile-missing.args: No such file or directory (os error 2)
2019-08-14T16:22:14.3092050Z 3 
2019-08-14T16:22:14.3092084Z 
2019-08-14T16:22:14.3092137Z 
2019-08-14T16:22:14.3092201Z The actual stderr differed from the expected stderr.
2019-08-14T16:22:14.3092201Z The actual stderr differed from the expected stderr.
2019-08-14T16:22:14.3092589Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/commandline-argfile-missing/commandline-argfile-missing.stderr
2019-08-14T16:22:14.3092890Z To update references, rerun the tests and pass the `--bless` flag
2019-08-14T16:22:14.3093492Z To only update this specific test, also pass `--test-args commandline-argfile-missing.rs`
2019-08-14T16:22:14.3094002Z error: 1 errors occurred comparing output.
2019-08-14T16:22:14.3094072Z status: exit code: 1
2019-08-14T16:22:14.3094072Z status: exit code: 1
2019-08-14T16:22:14.3095122Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/commandline-argfile-missing.rs" "-Zthreads=1" "--target=i586-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/commandline-argfile-missing" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/i586-unknown-linux-gnu/native/rust-test-helpers" "-Clinker=cc" "--cfg" "cmdline_set" "@/checkout/src/test/ui/commandline-argfile-missing.args" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/commandline-argfile-missing/auxiliary" "-A" "unused"
2019-08-14T16:22:14.3095639Z ------------------------------------------
2019-08-14T16:22:14.3095710Z 
2019-08-14T16:22:14.3095947Z ------------------------------------------
2019-08-14T16:22:14.3096035Z stderr:
2019-08-14T16:22:14.3096035Z stderr:
2019-08-14T16:22:14.3096265Z ------------------------------------------
2019-08-14T16:22:14.3096647Z error: Argument 19 is not valid: IO Error: /checkout/src/test/ui/commandline-argfile-missing.args: No such file or directory (os error 2)
2019-08-14T16:22:14.3096757Z 
2019-08-14T16:22:14.3097010Z ------------------------------------------
2019-08-14T16:22:14.3097055Z 
2019-08-14T16:22:14.3097087Z 
2019-08-14T16:22:14.3097087Z 
2019-08-14T16:22:14.3097140Z 
2019-08-14T16:22:14.3097196Z failures:
2019-08-14T16:22:14.3097449Z     [ui] ui/commandline-argfile-badutf8.rs
2019-08-14T16:22:14.3097688Z     [ui] ui/commandline-argfile-missing.rs
2019-08-14T16:22:14.3098060Z test result: FAILED. 8863 passed; 2 failed; 45 ignored; 0 measured; 0 filtered out
2019-08-14T16:22:14.3098120Z 
2019-08-14T16:22:14.3125855Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:536:22
2019-08-14T16:22:14.3125969Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
2019-08-14T16:22:14.3125969Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
2019-08-14T16:22:14.3142300Z 
2019-08-14T16:22:14.3142587Z 
2019-08-14T16:22:14.3145385Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/i586-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-i586-unknown-linux-gnu" "--mode" "ui" "--target" "i586-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--linker" "cc" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/i586-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--llvm-version" "9.0.0-rust-1.39.0-nightly\n" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2019-08-14T16:22:14.3146422Z 
2019-08-14T16:22:14.3146695Z 
2019-08-14T16:22:14.3155173Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --target i586-unknown-linux-gnu,i686-unknown-linux-musl
2019-08-14T16:22:14.3155315Z Build completed unsuccessfully in 1:15:57
2019-08-14T16:22:14.3155315Z Build completed unsuccessfully in 1:15:57
2019-08-14T16:22:14.3220270Z == clock drift check ==
2019-08-14T16:22:14.3235370Z   local time: Wed Aug 14 16:22:14 UTC 2019
2019-08-14T16:22:14.4326318Z   network time: Wed, 14 Aug 2019 16:22:14 GMT
2019-08-14T16:22:14.4326631Z == end clock drift check ==
2019-08-14T16:22:15.1277542Z ##[error]Bash exited with code '1'.
2019-08-14T16:22:15.1322526Z ##[section]Starting: Upload CPU usage statistics
2019-08-14T16:22:15.1331270Z ==============================================================================
2019-08-14T16:22:15.1331399Z Task         : Bash
2019-08-14T16:22:15.1331477Z Description  : Run a Bash script on macOS, Linux, or Windows

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@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 Aug 14, 2019
@Centril Centril closed this Aug 14, 2019
@Centril Centril deleted the rollup-r1c65e7 branch August 14, 2019 16:27
@jsgf
Copy link
Contributor

jsgf commented Aug 14, 2019

Issue #63576

@jsgf
Copy link
Contributor

jsgf commented Aug 14, 2019

It looks like the tests have some platform variations. Is there a way to wildcard/patternmatch/normalize .stderr files to ignore the variations? Otherwise I can make the tests platform specific.

@Centril
Copy link
Contributor Author

Centril commented Aug 14, 2019

@jsgf please follow up re. questions on the PR itself.

@jsgf
Copy link
Contributor

jsgf commented Aug 14, 2019

Oops, didn't notice I'd got to the wrong PR.

@Centril Centril added the rollup A PR which is a rollup label Oct 24, 2019
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.