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

Refactor expression parsing thoroughly #67112

Merged
merged 32 commits into from
Dec 29, 2019
Merged

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Dec 7, 2019

Based on #66994 together with which this has refactored basically the entirety of expr.rs.

r? @estebank

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 7, 2019
@bors

This comment has been minimized.

@Centril
Copy link
Contributor Author

Centril commented Dec 20, 2019

Rebased (executed git rebase --onto stmt-polish{,@{1}} -- a super handy tool!)

@Centril
Copy link
Contributor Author

Centril commented Dec 21, 2019

#66994 has landed so this is ready to go. :)

@bors

This comment has been minimized.

@Centril
Copy link
Contributor Author

Centril commented Dec 22, 2019

Rebased. :)

@bors

This comment has been minimized.

| _______________^
LL | |
LL | | }
| |_____^ expected `bool`, found `()`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤯❤️

// Has been misleading, at least in the past (closed Issue #48492).
Applicability::MaybeIncorrect,
)
.emit();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could add extra checks here to not suggest in when it wouldn't be appropriate and bubble the error up in those cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What situations do you have in mind for "inappropriate" ?

@estebank
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Dec 26, 2019

📌 Commit 7a246ac has been approved by estebank

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 26, 2019
@bors
Copy link
Contributor

bors commented Dec 26, 2019

⌛ Testing commit 7a246ac with merge 98b05b6811d198d2601444d635c96d0309ce2edc...

Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request Dec 26, 2019
Refactor expression parsing thoroughly

Based on rust-lang#66994 together with which this has refactored basically the entirety of `expr.rs`.

r? @estebank
@Mark-Simulacrum
Copy link
Member

@bors retry yield to rollup

bors added a commit that referenced this pull request Dec 26, 2019
Rollup of 12 pull requests

Successful merges:

 - #67112 (Refactor expression parsing thoroughly)
 - #67192 (Various const eval and pattern matching ICE fixes)
 - #67287 (typeck: note other end-point when checking range pats)
 - #67459 (prune ill-conceived BTreeMap iter_mut assertion and test its mutability)
 - #67576 (reuse `capacity` variable in slice::repeat)
 - #67602 (Use issue = "none" instead of "0" in intrinsics)
 - #67614 (Set callbacks globally)
 - #67617 (Remove `compiler_builtins_lib` documentation)
 - #67629 (Remove redundant link texts)
 - #67632 (Convert collapsed to shortcut reference links)
 - #67633 (Update .mailmap)
 - #67635 (Document safety of Path casting)

Failed merges:

r? @ghost
@bors
Copy link
Contributor

bors commented Dec 27, 2019

⌛ Testing commit 7a246ac with merge b4aee91...

bors added a commit that referenced this pull request Dec 27, 2019
Refactor expression parsing thoroughly

Based on #66994 together with which this has refactored basically the entirety of `expr.rs`.

r? @estebank
@bors
Copy link
Contributor

bors commented Dec 27, 2019

💔 Test failed - checks-azure

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu 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.
2019-12-27T07:37:31.4492443Z status: exit code: 2
2019-12-27T07:37:31.4492521Z command: "make" "make"
2019-12-27T07:37:31.4492597Z stdout:
2019-12-27T07:37:31.4492871Z ------------------------------------------
2019-12-27T07:37:31.4493378Z # We don't compile `opaque` with either optimizations or instrumentation.
2019-12-27T07:37:31.4493780Z # We don't compile `opaque` with either optimizations or instrumentation.
2019-12-27T07:37:31.4494828Z LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/pgo-branch-weights/pgo-branch-weights:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib" '/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc' --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/pgo-branch-weights/pgo-branch-weights -L /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/pgo-branch-weights/pgo-branch-weights   opaque.rs
2019-12-27T07:37:31.4495127Z # Compile the test program with instrumentation
2019-12-27T07:37:31.4495541Z mkdir -p "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/pgo-branch-weights/pgo-branch-weights"/prof_data_dir
2019-12-27T07:37:31.4496807Z LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/pgo-branch-weights/pgo-branch-weights:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib" '/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc' --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/pgo-branch-weights/pgo-branch-weights -L /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/pgo-branch-weights/pgo-branch-weights   interesting.rs \
2019-12-27T07:37:31.4497455Z  -Cprofile-generate="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/pgo-branch-weights/pgo-branch-weights"/prof_data_dir -O -Ccodegen-units=1
2019-12-27T07:37:31.4499129Z LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/pgo-branch-weights/pgo-branch-weights:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib" '/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc' --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/pgo-branch-weights/pgo-branch-weights -L /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/pgo-branch-weights/pgo-branch-weights   main.rs -Cprofile-generate="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/pgo-branch-weights/pgo-branch-weights"/prof_data_dir -O
2019-12-27T07:37:31.4499508Z # The argument below generates to the expected branch weights
2019-12-27T07:37:31.4500429Z LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/pgo-branch-weights/pgo-branch-weights:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib" /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/pgo-branch-weights/pgo-branch-weights/main aaaaaaaaaaaa2bbbbbbbbbbbb2bbbbbbbbbbbbbbbbcc || exit 1
2019-12-27T07:37:31.4500942Z "/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/bin"/llvm-profdata merge \
2019-12-27T07:37:31.4501619Z  -o "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/pgo-branch-weights/pgo-branch-weights"/prof_data_dir/merged.profdata \
2019-12-27T07:37:31.4502051Z  "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/pgo-branch-weights/pgo-branch-weights"/prof_data_dir
2019-12-27T07:37:31.4503220Z LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/pgo-branch-weights/pgo-branch-weights:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib" '/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc' --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/pgo-branch-weights/pgo-branch-weights -L /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/pgo-branch-weights/pgo-branch-weights   interesting.rs \
2019-12-27T07:37:31.4503900Z  -Cprofile-use="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/pgo-branch-weights/pgo-branch-weights"/prof_data_dir/merged.profdata -O \
2019-12-27T07:37:31.4504225Z  -Ccodegen-units=1 --emit=llvm-ir
2019-12-27T07:37:31.4504706Z cat "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps/pgo-branch-weights/pgo-branch-weights"/interesting.ll | "/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" filecheck-patterns.txt
2019-12-27T07:37:31.4506317Z ------------------------------------------
2019-12-27T07:37:31.4506591Z stderr:
2019-12-27T07:37:31.4506935Z ------------------------------------------
2019-12-27T07:37:31.4506935Z ------------------------------------------
2019-12-27T07:37:31.4507255Z filecheck-patterns.txt:5:8: error: CHECK: expected string not found in input
2019-12-27T07:37:31.4507593Z CHECK: define void @function_called_twice(i32 %c) {{.*}} !prof [[function_called_twice_id:![0-9]+]] {
2019-12-27T07:37:31.4508267Z <stdin>:1:1: note: scanning from here
2019-12-27T07:37:31.4508267Z <stdin>:1:1: note: scanning from here
2019-12-27T07:37:31.4508595Z ; ModuleID = 'interesting.3a1fbbbh-cgu.0'
2019-12-27T07:37:31.4508752Z <stdin>:7:1: note: possible intended match here
2019-12-27T07:37:31.4508752Z <stdin>:7:1: note: possible intended match here
2019-12-27T07:37:31.4508853Z define void @function_called_twice(i32 %c) unnamed_addr #0 {
2019-12-27T07:37:31.4508927Z ^
2019-12-27T07:37:31.4509005Z make: *** [Makefile:30: all] Error 1
2019-12-27T07:37:31.4509311Z ------------------------------------------
2019-12-27T07:37:31.4509359Z 
2019-12-27T07:37:31.4509393Z 
2019-12-27T07:37:31.4509453Z 
2019-12-27T07:37:31.4509453Z 
2019-12-27T07:37:31.4509528Z failures:
2019-12-27T07:37:31.4509789Z     [run-make] run-make-fulldeps/pgo-branch-weights
2019-12-27T07:37:31.4509852Z 
2019-12-27T07:37:31.4510210Z test result: FAILED. 199 passed; 1 failed; 6 ignored; 0 measured; 0 filtered out
2019-12-27T07:37:31.4510277Z 
2019-12-27T07:37:31.4519201Z 
2019-12-27T07:37:31.4575365Z 
2019-12-27T07:37:31.4583822Z 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/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--rustdoc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc" "--src-base" "/checkout/src/test/run-make-fulldeps" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "run-make" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--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/x86_64-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.42.0-nightly\n" "--cc" "cc" "--cxx" "c++" "--cflags" "-ffunction-sections -fdata-sections -fPIC -m64" "--llvm-components" "aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter binaryformat bitreader bitstreamreader bitwriter codegen core coroutines coverage debuginfocodeview debuginfodwarf debuginfogsym debuginfomsf debuginfopdb demangle dlltooldriver engine executionengine fuzzmutate globalisel gtest gtest_main hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo instcombine instrumentation interpreter ipo irreader jitlink libdriver lineeditor linker lto mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts object objectyaml option orcjit passes powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo riscvutils runtimedyld scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target testingsupport textapi transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86utils xray" "--llvm-cxxflags" "-I/checkout/src/llvm-project/llvm/include -I/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/include -std=c++11   -fno-exceptions -fno-rtti -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS" "--ar" "ar" "--llvm-bin-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/bin" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2019-12-27T07:37:31.4585789Z 
2019-12-27T07:37:31.4585829Z 
2019-12-27T07:37:31.4585929Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-12-27T07:37:31.4586017Z Build completed unsuccessfully in 2:35:42
2019-12-27T07:37:31.4586017Z Build completed unsuccessfully in 2:35:42
2019-12-27T07:37:31.4635707Z == clock drift check ==
2019-12-27T07:37:31.4654202Z   local time: Fri Dec 27 07:37:31 UTC 2019
2019-12-27T07:37:32.0515935Z   network time: Fri, 27 Dec 2019 07:37:32 GMT
2019-12-27T07:37:32.0516218Z == end clock drift check ==
2019-12-27T07:37:40.5396093Z 
2019-12-27T07:37:40.5779260Z ##[error]Bash exited with code '1'.
2019-12-27T07:37:40.5839145Z ##[section]Starting: Checkout
2019-12-27T07:37:40.5845902Z ==============================================================================
2019-12-27T07:37:40.5846028Z Task         : Get sources
2019-12-27T07:37:40.5846123Z 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 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 Dec 27, 2019
@Zoxc
Copy link
Contributor

Zoxc commented Dec 29, 2019

Is the pgo-branch-weights test unreliable? I see it failed in #66942 too in the same worker.

@bors
Copy link
Contributor

bors commented Dec 29, 2019

⌛ Testing commit 7a246ac with merge da3629b...

bors added a commit that referenced this pull request Dec 29, 2019
Refactor expression parsing thoroughly

Based on #66994 together with which this has refactored basically the entirety of `expr.rs`.

r? @estebank
@bors
Copy link
Contributor

bors commented Dec 29, 2019

☀️ Test successful - checks-azure
Approved by: estebank
Pushing da3629b to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 29, 2019
@bors bors merged commit 7a246ac into rust-lang:master Dec 29, 2019
@Centril Centril deleted the expr-polish branch December 29, 2019 22:53
@Centril
Copy link
Contributor Author

Centril commented Dec 29, 2019

Is the pgo-branch-weights test unreliable? I see it failed in #66942 too in the same worker.

@Zoxc Seems like it, cc @michaelwoerister.

@estebank
Copy link
Contributor

I've seen that test fail too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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.

6 participants