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

Initial implementation of `#![feature(move_ref_pattern)]` #68376

Merged
merged 6 commits into from Feb 9, 2020

Conversation

@Centril
Copy link
Member

Centril commented Jan 19, 2020

Following up on #45600, under the gate #![feature(move_ref_pattern)], (ref x, mut y) is allowed subject to restrictions necessary for soundness. The match checking implementation and tests for #![feature(bindings_after_at)] is also adjusted as necessary.

Closes #45600.
Tracking issue: #68354.

r? @matthewjasper

@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

rust-highfive commented Jan 20, 2020

The job x86_64-gnu-llvm-7 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-19T23:33:10.8730233Z ========================== Starting Command Output ===========================
2020-01-19T23:33:10.8733062Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/1923e254-7536-41f8-92e3-dbdef61c13ff.sh
2020-01-19T23:33:10.8733257Z 
2020-01-19T23:33:10.8736248Z ##[section]Finishing: Disable git automatic line ending conversion
2020-01-19T23:33:10.8741993Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/68376/merge to s
2020-01-19T23:33:10.8743734Z Task         : Get sources
2020-01-19T23:33:10.8743876Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-01-19T23:33:10.8743909Z Version      : 1.0.0
2020-01-19T23:33:10.8743941Z Author       : Microsoft
---
2020-01-19T23:33:11.8749123Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-01-19T23:33:11.8829115Z ##[command]git config gc.auto 0
2020-01-19T23:33:11.8833386Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-01-19T23:33:11.8835717Z ##[command]git config --get-all http.proxy
2020-01-19T23:33:11.8848744Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/68376/merge:refs/remotes/pull/68376/merge
---
2020-01-20T00:30:20.0378738Z .................................................................................................... 1700/9543
2020-01-20T00:30:27.8967883Z .................................................................................................... 1800/9543
2020-01-20T00:30:38.8522278Z ................i................................................................................... 1900/9543
2020-01-20T00:30:46.3571131Z .................................................................................................... 2000/9543
2020-01-20T00:31:02.7412419Z ......iiiii......................................................................................... 2100/9543
2020-01-20T00:31:12.7942665Z .................................................................................................... 2300/9543
2020-01-20T00:31:15.4087658Z .................................................................................................... 2400/9543
2020-01-20T00:31:21.3075194Z .................................................................................................... 2500/9543
2020-01-20T00:31:43.0179642Z .................................................................................................... 2600/9543
2020-01-20T00:31:43.0179642Z .................................................................................................... 2600/9543
2020-01-20T00:31:45.8035579Z .................................................................................................... 2700/9543
2020-01-20T00:31:57.0883273Z .............................................................................i...................... 2800/9543
2020-01-20T00:32:04.0358630Z .................................................................................................... 2900/9543
2020-01-20T00:32:12.6899300Z .................................................................................................... 3000/9543
2020-01-20T00:32:17.9132437Z ..............i..................................................................................... 3100/9543
2020-01-20T00:32:26.8594363Z .................................................................................................... 3200/9543
2020-01-20T00:32:32.4016150Z .................................................................................................... 3300/9543
2020-01-20T00:32:40.8653669Z ..ii................................................................................................ 3400/9543
2020-01-20T00:32:57.6495951Z .............................................................................................i...... 3600/9543
2020-01-20T00:33:05.1697927Z ........................................i........................................................... 3700/9543
2020-01-20T00:33:11.3141963Z .................................................................................................... 3800/9543
2020-01-20T00:33:17.2872095Z .................................................................................................... 3900/9543
---
2020-01-20T00:34:36.1880458Z .................................................i...............i.................................. 4900/9543
2020-01-20T00:34:45.0180455Z .................................................................................................... 5000/9543
2020-01-20T00:34:53.1611422Z ...........................................................................................i........ 5100/9543
2020-01-20T00:34:58.9092674Z .................................................................................................... 5200/9543
2020-01-20T00:35:10.7475586Z ...............................................................ii.ii...........i.................... 5300/9543
2020-01-20T00:35:20.9044027Z i................................................................................................... 5500/9543
2020-01-20T00:35:32.0442102Z .................................................................................................... 5600/9543
2020-01-20T00:35:38.8244269Z .................................................i.................................................. 5700/9543
2020-01-20T00:35:46.4804098Z .................................................................................................... 5800/9543
2020-01-20T00:35:46.4804098Z .................................................................................................... 5800/9543
2020-01-20T00:35:57.3948305Z .................................................................................................... 5900/9543
2020-01-20T00:36:04.5495770Z .......................................ii...i..ii...........i....................................... 6000/9543
2020-01-20T00:36:28.6589287Z .................................................................................................... 6200/9543
2020-01-20T00:36:37.4891515Z .................................................................................................... 6300/9543
2020-01-20T00:36:37.4891515Z .................................................................................................... 6300/9543
2020-01-20T00:36:46.9803780Z ...................................................................i..ii............................ 6400/9543
2020-01-20T00:37:17.3587777Z .................................................................................................... 6600/9543
2020-01-20T00:37:19.8883334Z ...........................................i........................................................ 6700/9543
2020-01-20T00:37:22.2577408Z .................................................................................................... 6800/9543
2020-01-20T00:37:24.9201362Z ..........................................i......................................................... 6900/9543
---
2020-01-20T00:39:16.2953741Z .................................................................................................... 7600/9543
2020-01-20T00:39:23.1925031Z .................................................................................................... 7700/9543
2020-01-20T00:39:30.2027413Z .................................................................................................... 7800/9543
2020-01-20T00:39:41.7741681Z .................................................................................................... 7900/9543
2020-01-20T00:39:48.2832245Z ...iiiiiii.......................................................................................... 8000/9543
2020-01-20T00:40:04.5134580Z .................................................................................................... 8200/9543
2020-01-20T00:40:16.5393012Z .................................................................................................... 8300/9543
2020-01-20T00:40:29.9086766Z .................................................................................................... 8400/9543
2020-01-20T00:40:36.4714543Z .................................................................................................... 8500/9543
---
2020-01-20T00:43:09.2892762Z  finished in 7.895
2020-01-20T00:43:09.2894031Z Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2020-01-20T00:43:09.2894295Z 
2020-01-20T00:43:09.2894588Z running 166 tests
2020-01-20T00:43:11.7951814Z iiii......i........ii..iiii...i....i...........i............i..i..................i....i............ 100/166
2020-01-20T00:43:14.2043042Z i.i.i...iii..iiiiiii.......................iii............ii......
2020-01-20T00:43:14.2048131Z 
2020-01-20T00:43:14.2051576Z  finished in 5.877
2020-01-20T00:43:14.2262069Z Check compiletest suite=codegen-units mode=codegen-units (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2020-01-20T00:43:14.4079777Z 
---
2020-01-20T00:43:17.2954293Z  finished in 2.340
2020-01-20T00:43:17.2954618Z Check compiletest suite=assembly mode=assembly (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2020-01-20T00:43:17.2954658Z 
2020-01-20T00:43:17.2954723Z running 9 tests
2020-01-20T00:43:17.2955026Z iiiiiiiii
2020-01-20T00:43:17.2955358Z 
2020-01-20T00:43:17.2955401Z  finished in 0.166
2020-01-20T00:43:17.2955693Z Check compiletest suite=incremental mode=incremental (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2020-01-20T00:43:17.2955746Z 
---
2020-01-20T00:43:39.0140438Z  finished in 22.239
2020-01-20T00:43:39.0424152Z Check compiletest suite=debuginfo mode=debuginfo-gdb+lldb (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2020-01-20T00:43:39.2481032Z 
2020-01-20T00:43:39.2481868Z running 116 tests
2020-01-20T00:44:05.4720756Z .iiiii..i.....i..i...i..i.i.i..i..i..ii....i.i....ii..........iiii..........i.....i..i.......ii.i.ii 100/116
2020-01-20T00:44:09.8089321Z .....iiii.....ii
2020-01-20T00:44:09.8097674Z 
2020-01-20T00:44:09.8098027Z  finished in 30.139
2020-01-20T00:44:09.8098567Z Uplifting stage1 rustc (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2020-01-20T00:44:09.8099048Z Copying stage2 rustc from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
---
2020-01-20T00:57:57.9175396Z 
2020-01-20T00:57:57.9177206Z    Doc-tests core
2020-01-20T00:58:02.7666073Z 
2020-01-20T00:58:02.7667205Z running 2443 tests
2020-01-20T00:58:12.6670235Z ......iiiii......................................................................................... 100/2443
2020-01-20T00:58:22.3143859Z ..................................................................................ii................ 200/2443
2020-01-20T00:58:44.9573862Z .................i.................................................................................. 400/2443
2020-01-20T00:58:44.9573862Z .................i.................................................................................. 400/2443
2020-01-20T00:58:55.2572231Z ..................................................................i..i..................iiii........ 500/2443
2020-01-20T00:59:12.9388717Z .................................................................................................... 700/2443
2020-01-20T00:59:22.1008401Z .................................................................................................... 800/2443
2020-01-20T00:59:31.2033704Z .................................................................................................... 900/2443
2020-01-20T00:59:40.2420791Z .................................................................................................... 1000/2443
---
2020-01-20T01:03:20.2341430Z .................................................................................................... 500/760
2020-01-20T01:03:20.2693732Z .................thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: RecvError', src/libstd/sync/mpsc/mod.rs:2741:22
2020-01-20T01:03:20.2707634Z ....thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: RecvError', src/libstd/sync/mpsc/mod.rs:2778:21
2020-01-20T01:03:20.2712792Z thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: "SendError(..)"', src/libstd/sync/mpsc/mod.rs:2766:17
2020-01-20T01:03:20.2732504Z .......thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: RecvError', src/libstd/sync/mpsc/mod.rs:2645:13
2020-01-20T01:03:20.5674373Z ..........................................thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: RecvError', src/libstd/sync/mpsc/mod.rs:1997:22
2020-01-20T01:03:20.5690317Z .....thread '.<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: RecvError', src/libstd/sync/mpsc/mod.rs:2034:21
2020-01-20T01:03:20.5707801Z ......thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: RecvError', src/libstd/sync/mpsc/mod.rs:1916:13
2020-01-20T01:03:22.6157705Z .........................thread '<unnamed>' panicked at 'explicit panic', src/libstd/sync/mutex.rs:633:13
2020-01-20T01:03:22.6159725Z thread '<unnamed>' panicked at 'test panic in inner thread to poison mutex', src/libstd/sync/mutex.rs:587:13
2020-01-20T01:03:22.6164114Z thread '<unnamed>' panicked at 'test panic in inner thread to poison mutex', src/libstd/sync/mutex.rs:563:13
2020-01-20T01:03:22.6164967Z thread '<unnamed>' panicked at 'explicit panic', src/libstd/sync/mutex.rs:694:13
---
2020-01-20T01:03:32.1921595Z 
2020-01-20T01:03:32.1922401Z running 1003 tests
2020-01-20T01:03:52.3426713Z i................................................................................................... 100/1003
2020-01-20T01:04:03.6024970Z .................................................................................................... 200/1003
2020-01-20T01:04:11.6541993Z ..................iii......i......i...i......i...................................................... 300/1003
2020-01-20T01:04:17.2962893Z .................................................................................................... 400/1003
2020-01-20T01:04:24.9782651Z ..........................................i..i.....................................ii............... 500/1003
2020-01-20T01:04:39.0077390Z .................................................................................................... 700/1003
2020-01-20T01:04:39.0077390Z .................................................................................................... 700/1003
2020-01-20T01:04:46.1298036Z .............................iiii................................................................... 800/1003
2020-01-20T01:05:01.5262822Z .................................................................................................... 900/1003
2020-01-20T01:05:09.2354560Z ...................................................iiii............................................. 1000/1003
2020-01-20T01:05:09.3471755Z test result: ok. 983 passed; 0 failed; 20 ignored; 0 measured; 0 filtered out
2020-01-20T01:05:09.3471905Z 
2020-01-20T01:05:09.3578218Z  finished in 183.218
2020-01-20T01:05:09.3592323Z Testing term stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
---
2020-01-20T01:24:33.6593868Z ---- /checkout/obj/build/x86_64-unknown-linux-gnu/test/error-index.md - Rust_Compiler_Error_Index::E0009 (line 168) stdout ----
2020-01-20T01:24:33.6594130Z error[E0658]: binding by-move and by-ref in the same pattern is unstable
2020-01-20T01:24:33.6594408Z  --> /checkout/obj/build/x86_64-unknown-linux-gnu/test/error-index.md:173:11
2020-01-20T01:24:33.6594458Z   |
2020-01-20T01:24:33.6594812Z 7 |     Some((y, ref z)) => {}, // error: cannot bind by-move and by-ref in the
2020-01-20T01:24:33.6595169Z   |           ^  ----- by-ref pattern here
2020-01-20T01:24:33.6595429Z   |           by-move pattern here
2020-01-20T01:24:33.6595491Z   |
2020-01-20T01:24:33.6595491Z   |
2020-01-20T01:24:33.6595875Z   = note: for more information, see ***/issues/68354
2020-01-20T01:24:33.6595934Z   = help: add `#![feature(move_ref_pattern)]` to the crate attributes to enable
2020-01-20T01:24:33.6596031Z error: aborting due to previous error
2020-01-20T01:24:33.6596060Z 
2020-01-20T01:24:33.6596320Z For more information about this error, try `rustc --explain E0658`.
2020-01-20T01:24:33.6596320Z For more information about this error, try `rustc --explain E0658`.
2020-01-20T01:24:33.6596390Z Some expected error codes were not found: ["E0009"]
2020-01-20T01:24:33.6596462Z failures:
2020-01-20T01:24:33.6596777Z     /checkout/obj/build/x86_64-unknown-linux-gnu/test/error-index.md - Rust_Compiler_Error_Index::E0009 (line 168)
2020-01-20T01:24:33.6596825Z 
2020-01-20T01:24:33.6596874Z test result: FAILED. 820 passed; 1 failed; 27 ignored; 0 measured; 0 filtered out
---
2020-01-20T01:24:33.6597431Z   local time: Mon Jan 20 01:24:32 UTC 2020
2020-01-20T01:24:33.6597496Z   network time: Mon, 20 Jan 2020 01:24:33 GMT
2020-01-20T01:24:33.6597541Z == end clock drift check ==
2020-01-20T01:24:33.6597569Z 
2020-01-20T01:24:33.6656534Z ##[error]Bash exited with code '1'.
2020-01-20T01:24:33.6670685Z ##[section]Finishing: Run build
2020-01-20T01:24:33.6695848Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/68376/merge to s
2020-01-20T01:24:33.6698417Z Task         : Get sources
2020-01-20T01:24:33.6698461Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-01-20T01:24:33.6698521Z Version      : 1.0.0
2020-01-20T01:24:33.6698562Z Author       : Microsoft
2020-01-20T01:24:33.6698562Z Author       : Microsoft
2020-01-20T01:24:33.6698605Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-01-20T01:24:33.6698670Z ==============================================================================
2020-01-20T01:24:34.1354504Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-01-20T01:24:34.1398687Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/68376/merge to s
2020-01-20T01:24:34.1527523Z Cleaning up task key
2020-01-20T01:24:34.1528321Z Start cleaning up orphan processes.
2020-01-20T01:24:34.1645808Z Terminate orphan process: pid (3373) (python)
2020-01-20T01:24:34.1928126Z ##[section]Finishing: Finalize Job

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)

@Centril Centril force-pushed the Centril:move-ref-patterns branch from f6ecb0a to b871dda Jan 20, 2020
@bors

This comment was marked as resolved.

Copy link
Contributor

bors commented Jan 21, 2020

☔️ The latest upstream changes (presumably #68423) made this pull request unmergeable. Please resolve the merge conflicts.

@Centril Centril force-pushed the Centril:move-ref-patterns branch from b871dda to ab261d4 Jan 21, 2020
@estebank

This comment has been minimized.

Copy link
Contributor

estebank commented Jan 25, 2020

CC #30418

@Centril

This comment has been minimized.

@Centril Centril force-pushed the Centril:move-ref-patterns branch from ab261d4 to 0253f86 Feb 2, 2020
@Centril

This comment has been minimized.

Copy link
Member Author

Centril commented Feb 2, 2020

Addressed the comments. :)

@Centril

This comment has been minimized.

Copy link
Member Author

Centril commented Feb 2, 2020

Also, do you think the test suite is sufficient for eventual stabilization purposes or do you think more would be necessary?

@matthewjasper

This comment has been minimized.

Copy link
Contributor

matthewjasper commented Feb 8, 2020

I can't think of any other tests that I would want.
@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Feb 8, 2020

📌 Commit d2b88b7 has been approved by matthewjasper

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Feb 9, 2020

⌛️ Testing commit d2b88b7 with merge f8d830b...

bors added a commit that referenced this pull request Feb 9, 2020
Initial implementation of `#![feature(move_ref_pattern)]`

Following up on #45600, under the gate `#![feature(move_ref_pattern)]`, `(ref x, mut y)` is allowed subject to restrictions necessary for soundness. The match checking implementation and tests for `#![feature(bindings_after_at)]` is also adjusted as necessary.

Closes #45600.
Tracking issue: #68354.

r? @matthewjasper
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Feb 9, 2020

☀️ Test successful - checks-azure
Approved by: matthewjasper
Pushing f8d830b to master...

@bors bors added the merged-by-bors label Feb 9, 2020
@bors bors merged commit d2b88b7 into rust-lang:master Feb 9, 2020
5 checks passed
5 checks passed
homu Test successful
Details
pr Build #20200202.48 succeeded
Details
pr (Linux mingw-check) Linux mingw-check succeeded
Details
pr (Linux x86_64-gnu-llvm-7) Linux x86_64-gnu-llvm-7 succeeded
Details
pr (Linux x86_64-gnu-tools) Linux x86_64-gnu-tools succeeded
Details
@Centril Centril deleted the Centril:move-ref-patterns branch Feb 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

5 participants
You can’t perform that action at this time.