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 7 pull requests #68094

Closed
wants to merge 16 commits into from
Closed

Conversation

JohnTitor
Copy link
Member

Successful merges:

Failed merges:

r? @ghost

cuviper and others added 16 commits January 8, 2020 09:44
The Cargo book can be generated the same way as the other books.
Use `shrink_to_hi` instead of `next_point`
Fix rust-lang#68000.
This feature adds `X..`, `..X`, and `..=X` patterns.
Introduce `X..`, `..X`, and `..=X` range patterns

Tracking issue: rust-lang#67264
Feature gate: `#![feature(half_open_range_patterns)]`

---------------------------

In this PR, we introduce range-from (`X..`), range-to (`..X`), and range-to-inclusive (`..=X`) patterns.
These correspond to the `RangeFrom`, `RangeTo`, and `RangeToInclusive` expression forms introduced with the same syntaxes. The correspondence is both syntactic and semantic (in the sense that e.g. a `X..` pattern matching on a scrutinee `s` holds exactly when `(X..).contains(&s)` holds).

---------------------------

Noteworthy:

- The compiler complexity added with this PR is around 10 lines (discounting new tests, which account for the large PR size).

- `...X` is accepted syntactically with the same meaning as `..=X`. This is done primarily to simplify and unify the implementation & spec. If-and-when we decide to make `X...Y` a hard error on a new edition, we can do the same for `...X` patterns as well.

- `X...` and `X..=` is rejected syntactically just like it is for the expression equivalents. We should perhaps make these into semantic restrictions (cc @petrochenkov).

- In HAIR, these half-open ranges are represented by inserting the max/min values for the approprate types. That is, `X..` where `X: u8` would become `X..=u8::MAX` in HAIR (note the `..=` since `RangeFrom` includes the end).

- Exhaustive integer / char matching does not (yet) allow for e.g. exhaustive matching on `0usize..` or `..5usize | 5..` (same idea for `isize`). This would be a substantially more invasive change, and could be added in some other PR.

- The issues with slice pattern syntax has been resolved as we decided to use `..` to mean a "rest-pattern" and `[xs @ ..]` to bind the rest to a name in a slice pattern.

- Like with rust-lang#35712, which provided `X..Y` range patterns, this is not yet backed up by an RFC. I'm providing this experimental implementation now to have something concrete to discuss. I would be happy to provide an RFC for this PR as well as for rust-lang#35712 to finalize and confirm the ideas with the larger community.

Closes rust-lang/rfcs#947.

---------------------------

r? @varkor cc @matthewjasper @oli-obk

I would recommend reviewing this (in particular HAIR-lowering and pattern parsing changes) with whitespace changes ignored.
…-Simulacrum

Build compiletest with in-tree libtest

This updates compiletest to build in `Mode::ToolStd`, using the locally-built crates for `std` and especially `test`. This way we're immune to unstable differences in the bootstrap compiler crates, whether that's a prior-release stage0 or a current release local rebuild. Fixes rust-lang#59264.

As a minor cleanup, this also removes the unused `llvm_tools` flag.
remove explicit strip-hidden pass from compiler doc generation

`strip-hidden` is now implied by `--document-private-items` with rust-lang#67875, so there's no need to specify it anymore.
…ulacrum

rustbuild: Cleanup book generation

The Cargo book can be generated the same way as the other books.
Do not ICE on unicode next point

Use `shrink_to_hi` instead of `next_point`.
Fix rust-lang#68000.
@JohnTitor
Copy link
Member Author

@bors r+ p=7 rollup=never

@bors
Copy link
Contributor

bors commented Jan 10, 2020

📌 Commit 0d7a792 has been approved by JohnTitor

@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 Jan 10, 2020
@JohnTitor JohnTitor added the rollup A PR which is a rollup label Jan 10, 2020
@bors
Copy link
Contributor

bors commented Jan 10, 2020

⌛ Testing commit 0d7a792 with merge 8dab749ac529f87cd7f43f3960b0be959bd45228...

@rust-highfive
Copy link
Collaborator

The job test-various of your PR failed (pretty log, 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.
2020-01-10T16:50:56.2961256Z ---- [ui] ui/macros/issue-68058.rs stdout ----
2020-01-10T16:50:56.2961321Z 
2020-01-10T16:50:56.2961739Z error: test compilation failed although it shouldn't!
2020-01-10T16:50:56.2961924Z status: exit code: 1
2020-01-10T16:50:56.2962749Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/macros/issue-68058.rs" "-Zthreads=1" "--target=wasm32-unknown-unknown" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/issue-68058" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/wasm32-unknown-unknown/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/issue-68058/auxiliary" "-A" "unused"
2020-01-10T16:50:56.2963418Z ------------------------------------------
2020-01-10T16:50:56.2963461Z 
2020-01-10T16:50:56.2963813Z ------------------------------------------
2020-01-10T16:50:56.2963981Z stderr:
2020-01-10T16:50:56.2963981Z stderr:
2020-01-10T16:50:56.2964306Z ------------------------------------------
2020-01-10T16:50:56.2964481Z error: the feature named `avx2` is not valid for this target
2020-01-10T16:50:56.2964786Z   --> /checkout/src/test/ui/macros/issue-68058.rs:5:26
2020-01-10T16:50:56.2964975Z    |
2020-01-10T16:50:56.2965084Z LL |         #[target_feature(enable=$target)]
2020-01-10T16:50:56.2965165Z    |                          ^^^^^^^^^^^^^^ `avx2` is not valid for this target
2020-01-10T16:50:56.2965321Z ...
2020-01-10T16:50:56.2965459Z LL | def_target!("avx2");
2020-01-10T16:50:56.2965857Z 
2020-01-10T16:50:56.2966007Z error: aborting due to previous error
2020-01-10T16:50:56.2966091Z 
2020-01-10T16:50:56.2966121Z 
---
2020-01-10T16:50:56.2993055Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:386:22
2020-01-10T16:50:56.2993153Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
2020-01-10T16:50:56.3004982Z 
2020-01-10T16:50:56.3005910Z 
2020-01-10T16:50:56.3010465Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "/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/wasm32-unknown-unknown/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-wasm32-unknown-unknown" "--mode" "ui" "--target" "wasm32-unknown-unknown" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--nodejs" "/node-v9.2.0-linux-x64/bin/node" "--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/wasm32-unknown-unknown/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.42.0-nightly\n" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2020-01-10T16:50:56.3011320Z 
2020-01-10T16:50:56.3011374Z 
2020-01-10T16:50:56.3020291Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --target wasm32-unknown-unknown src/test/run-make src/test/ui src/test/compile-fail src/test/mir-opt src/test/codegen-units src/libcore
2020-01-10T16:50:57.1434987Z Build completed unsuccessfully in 1:03:59
2020-01-10T16:50:57.1434987Z Build completed unsuccessfully in 1:03:59
2020-01-10T16:50:57.1435662Z == clock drift check ==
2020-01-10T16:50:57.1435858Z   local time: Fri Jan 10 16:50:56 UTC 2020
2020-01-10T16:50:57.1436002Z   network time: Fri, 10 Jan 2020 16:50:56 GMT
2020-01-10T16:50:57.1436148Z == end clock drift check ==
2020-01-10T16:50:57.2604043Z 
2020-01-10T16:50:57.2683239Z ##[error]Bash exited with code '1'.
2020-01-10T16:50:57.2726622Z ##[section]Starting: Checkout
2020-01-10T16:50:57.2728175Z ==============================================================================
2020-01-10T16:50:57.2728262Z Task         : Get sources
2020-01-10T16:50:57.2728324Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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
Copy link
Contributor

bors commented Jan 10, 2020

💔 Test failed - checks-azure

@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 Jan 10, 2020
@JohnTitor JohnTitor mentioned this pull request Jan 10, 2020
@JohnTitor JohnTitor closed this Jan 10, 2020
@JohnTitor JohnTitor deleted the rollup-9xfrag0 branch January 10, 2020 17:07
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.

8 participants