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

Fix nested ? matchers #57610

Merged
merged 3 commits into from
Jan 19, 2019
Merged

Fix nested ? matchers #57610

merged 3 commits into from
Jan 19, 2019

Conversation

mark-i-m
Copy link
Member

@mark-i-m mark-i-m commented Jan 14, 2019

fix #57597

I'm not 100% if this works yet...

cc @alercah

When this is ready (but perhaps not yet):

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 14, 2019
@petrochenkov
Copy link
Contributor

LGTM, r=me once Travis is green

@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 14, 2019
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (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.
travis_time:end:15f2dc7f:start=1547511467079056177,finish=1547511469206791470,duration=2127735293
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-6.0
---
[01:12:40] .................................................................................................... 2500/5303
[01:12:44] .................................................................................................... 2600/5303
[01:12:48] .................................................................................................... 2700/5303
[01:12:54] .................................................................................................... 2800/5303
[01:12:58] .......F............................................................................................ 2900/5303
[01:13:06] .................................................................................................... 3100/5303
[01:13:10] ....................................................................................i............... 3200/5303
[01:13:14] .................................................................................................... 3300/5303
[01:13:18] ..............................................ii...i..ii............................................ 3400/5303
---
[01:14:39] 
[01:14:39] ---- [ui] ui/issues/issue-5067.rs stdout ----
[01:14:39] diff of stderr:
[01:14:39] 
[01:14:39] - error: repetition matches empty token tree
[01:14:39] -    |
[01:14:39] -    |
[01:14:39] - LL |     ( $()* ) => {};
[01:14:39] - 
[01:14:39] - 
[01:14:39] - error: repetition matches empty token tree
[01:14:39] -    |
[01:14:39] -    |
[01:14:39] - LL |     ( $()+ ) => {};
[01:14:39] - 
[01:14:39] - 
[01:14:39] - error: repetition matches empty token tree
[01:14:39] -    |
[01:14:39] -    |
[01:14:39] - LL |     ( [$()*] ) => {};
[01:14:39] - 
[01:14:39] - 
[01:14:39] - error: repetition matches empty token tree
[01:14:39] -    |
[01:14:39] -    |
[01:14:39] - LL |     ( [$()+] ) => {};
[01:14:39] - 
[01:14:39] - 
[01:14:39] - error: repetition matches empty token tree
[01:14:39] -    |
[01:14:39] -    |
[01:14:39] - LL |     ( $($()* $(),* $(a)* $(a),* )* ) => {};
[01:14:39] - 
[01:14:39] - 
[01:14:39] - error: repetition matches empty token tree
[01:14:39] -    |
[01:14:39] -    |
[01:14:39] - LL |     ( $($()* $(),* $(a)* $(a),* )+ ) => {};
[01:14:39] - 
[01:14:39] - 
[01:14:39] - error: repetition matches empty token tree
[01:14:39] -    |
[01:14:39] -    |
[01:14:39] - LL |     ( $(a $()+)* ) => {};
[01:14:39] - 
[01:14:39] - 
[01:14:39] - error: repetition matches empty token tree
[01:14:39] -    |
[01:14:39] -    |
[01:14:39] - LL |     ( $(a $()*)+ ) => {};
[01:14:39] - 
[01:14:39] - 
[01:14:39] - error: repetition matches empty token tree
[01:14:39] -    |
[01:14:39] -    |
[01:14:39] - LL |     (a $e1:expr $($(, a $e2:expr)*)*) => ([$e1 $($(, $e2)*)*]);
[01:14:39] - 
[01:14:39] - 
[01:14:39] - error: repetition matches empty token tree
[01:14:39] -    |
[01:14:39] -    |
[01:14:39] - LL |     ( $()* ) => {}
[01:14:39] - 
[01:14:39] - error: aborting due to 10 previous errors
[01:14:39] - 
[01:14:39] - 
[01:14:39] - 
[01:14:39] 
[01:14:39] 
[01:14:39] error: failed to delete `/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-5067/issue-5067.stderr`: No such file or directory (os error 2)
[01:14:39] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[01:14:39] 
[01:14:39] 
[01:14:39] failures:
[01:14:39] failures:
[01:14:39]     [ui] ui/issues/issue-5067.rs
[01:14:39] 
[01:14:39] test result: FAILED. 5279 passed; 1 failed; 23 ignored; 0 measured; 0 filtered out
[01:14:39] 
[01:14:39] thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:495:22
[01:14:39] 
[01:14:39] 
[01:14:39] 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/x86_64-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-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-6.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -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" "--quiet" "--llvm-version" "6.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[01:14:39] 
[01:14:39] 
[01:14:39] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:14:39] Build completed unsuccessfully in 0:04:49
[01:14:39] Build completed unsuccessfully in 0:04:49
[01:14:39] make: *** [check] Error 1
[01:14:39] Makefile:48: recipe for target 'check' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:09f07e98
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Tue Jan 15 01:32:39 UTC 2019

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)

@mark-i-m
Copy link
Member Author

I've been getting the following seeming-unrelated ICE... (maybe from the recent rollup?). I tried rebasing, so hopefully it will be resolved. I have to go ATM...

warning: unreachable arm
 --> src/test/ui/pattern/const-pat-ice.rs:9:18
  |
9 |         &&&42 => {},
  |                  ^^
  |
  = note: #[warn(unreachable_code)] on by default

warning: unreachable pattern
  --> src/test/ui/pattern/const-pat-ice.rs:10:9
   |
10 |         FOO => {},
   |         ^^^
   |
   = note: #[warn(unreachable_patterns)] on by default

thread 'rustc' panicked at 'assertion failed: rows.iter().all(|r| r.len() == v.len())', src/librustc_mir/hair/pattern/_match.rs:1068:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
   1: std::sys_common::backtrace::print
   2: std::panicking::default_hook::{{closure}}
   3: std::panicking::default_hook
   4: rustc::util::common::panic_hook
   5: std::panicking::rust_panic_with_hook
   6: std::panicking::begin_panic
   7: rustc_mir::hair::pattern::_match::is_useful
   8: rustc_mir::hair::pattern::_match::is_useful_specialized
   9: <core::iter::Map<I, F> as core::iter::iterator::Iterator>::try_fold
  10: rustc_mir::hair::pattern::_match::is_useful
  11: rustc_mir::hair::pattern::_match::is_useful_specialized
  12: <core::iter::Map<I, F> as core::iter::iterator::Iterator>::try_fold
  13: rustc_mir::hair::pattern::_match::is_useful
  14: rustc_mir::hair::pattern::check_match::check_arms
  15: rustc_mir::hair::pattern::_match::MatchCheckCtxt::create_and_enter
  16: <rustc_mir::hair::pattern::check_match::MatchVisitor<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_expr
  17: <rustc_mir::hair::pattern::check_match::MatchVisitor<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_expr
  18: <rustc_mir::hair::pattern::check_match::MatchVisitor<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_body
  19: rustc::session::Session::track_errors
  20: rustc_mir::hair::pattern::check_match::check_match
  21: rustc::ty::query::__query_compute::check_match
  22: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::check_match<'tcx>>::compute
  23: rustc::dep_graph::graph::DepGraph::with_task_impl
  24: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::try_get_with
  25: <rustc_mir::hair::pattern::check_match::OuterVisitor<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_body
  26: rustc::hir::intravisit::walk_item
  27: rustc::hir::Crate::visit_all_item_likes
  28: rustc_mir::hair::pattern::check_match::check_crate
  29: rustc::util::common::time
  30: <std::thread::local::LocalKey<T>>::with
  31: rustc::ty::context::TyCtxt::create_and_enter
  32: rustc_driver::driver::compile_input
  33: <scoped_tls::ScopedKey<T>>::set
  34: rustc_driver::run_compiler
  35: <scoped_tls::ScopedKey<T>>::set
query stack during panic:
#0 [check_match] processing `main`
end of query stack

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.33.0-dev running on x86_64-unknown-linux-gnu

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (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.
travis_time:end:00c2ddf3:start=1547579361463827115,finish=1547579365026042169,duration=3562215054
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-6.0
---
[01:03:01] .................................................................................................... 2500/5306
[01:03:04] .................................................................................................... 2600/5306
[01:03:08] .................................................................................................... 2700/5306
[01:03:13] .................................................................................................... 2800/5306
[01:03:16] ...........F........................................................................................ 2900/5306
[01:03:23] .................................................................................................... 3100/5306
[01:03:27] ..........................................................................................i......... 3200/5306
[01:03:30] .................................................................................................... 3300/5306
[01:03:33] ....................................................ii...i...ii..................................... 3400/5306
---
[01:04:45] 
[01:04:45] ---- [ui] ui/issues/issue-5067.rs stdout ----
[01:04:45] diff of stderr:
[01:04:45] 
[01:04:45] 1 error: repetition matches empty token tree
[01:04:45] +   --> $DIR/issue-5067.rs:9:8
[01:04:45] 3    |
[01:04:45] 3    |
[01:04:45] 4 LL |     ( $()* ) => {};
[01:04:45] 
[01:04:45] 6 
[01:04:45] 6 
[01:04:45] 7 error: repetition matches empty token tree
[01:04:45] +   --> $DIR/issue-5067.rs:11:8
[01:04:45] 9    |
[01:04:45] 9    |
[01:04:45] 10 LL |     ( $()+ ) => {};
[01:04:45] 
[01:04:45] 12 
[01:04:45] 12 
[01:04:45] 13 error: repetition matches empty token tree
[01:04:45] +   --> $DIR/issue-5067.rs:13:8
[01:04:45] 15    |
[01:04:45] 15    |
[01:04:45] + LL |     ( $()? ) => {};
[01:04:45] + 
[01:04:45] + 
[01:04:45] + error: repetition matches empty token tree
[01:04:45] +    |
[01:04:45] +    |
[01:04:45] 16 LL |     ( [$()*] ) => {};
[01:04:45] 18 
[01:04:45] 
[01:04:45] 
[01:04:45] 19 error: repetition matches empty token tree
[01:04:45] +   --> $DIR/issue-5067.rs:20:9
[01:04:45] 21    |
[01:04:45] 21    |
[01:04:45] 22 LL |     ( [$()+] ) => {};
[01:04:45] 
[01:04:45] 24 
[01:04:45] 24 
[01:04:45] 25 error: repetition matches empty token tree
[01:04:45] +   --> $DIR/issue-5067.rs:22:9
[01:04:45] 27    |
[01:04:45] 27    |
[01:04:45] + LL |     ( [$()?] ) => {};
[01:04:45] + 
[01:04:45] + 
[01:04:45] + error: repetition matches empty token tree
[01:04:45] +    |
[01:04:45] +    |
[01:04:45] 28 LL |     ( $($()* $(),* $(a)* $(a),* )* ) => {};
[01:04:45] 30 
[01:04:45] 
[01:04:45] 
[01:04:45] 31 error: repetition matches empty token tree
[01:04:45] +   --> $DIR/issue-5067.rs:29:8
[01:04:45] 33    |
[01:04:45] 33    |
[01:04:45] 34 LL |     ( $($()* $(),* $(a)* $(a),* )+ ) => {};
[01:04:45] 
[01:04:45] 36 
[01:04:45] 36 
[01:04:45] 37 error: repetition matches empty token tree
[01:04:45] +   --> $DIR/issue-5067.rs:31:8
[01:04:45] 39    |
[01:04:45] 39    |
[01:04:45] + LL |     ( $($()* $(),* $(a)* $(a),* )? ) => {};
[01:04:45] + 
[01:04:45] + 
[01:04:45] + error: repetition matches empty token tree
[01:04:45] +    |
[01:04:45] +    |
[01:04:45] + LL |     ( $($()? $(),* $(a)? $(a),* )* ) => {};
[01:04:45] + 
[01:04:45] + 
[01:04:45] + error: repetition matches empty token tree
[01:04:45] +    |
[01:04:45] +    |
[01:04:45] + LL |     ( $($()? $(),* $(a)? $(a),* )+ ) => {};
[01:04:45] + 
[01:04:45] + 
[01:04:45] + error: repetition matches empty token tree
[01:04:45] +    |
[01:04:45] +    |
[01:04:45] + LL |     ( $($()? $(),* $(a)? $(a),* )? ) => {};
[01:04:45] + 
[01:04:45] + 
[01:04:45] + error: repetition matches empty token tree
[01:04:45] +    |
[01:04:45] +    |
[01:04:45] 40 LL |     ( $(a $()+)* ) => {};
[01:04:45] 42 
[01:04:45] 
[01:04:45] 
[01:04:45] 43 error: repetition matches empty token tree
[01:04:45] +   --> $DIR/issue-5067.rs:49:12
[01:04:45] 45    |
[01:04:45] 45    |
[01:04:45] 46 LL |     ( $(a $()*)+ ) => {};
[01:04:45] 
[01:04:45] 48 
[01:04:45] 48 
[01:04:45] 49 error: repetition matches empty token tree
[01:04:45] +   --> $DIR/issue-5067.rs:51:12
[01:04:45] 51    |
[01:04:45] 51    |
[01:04:45] + LL |     ( $(a $()+)? ) => {};
[01:04:45] + 
[01:04:45] + 
[01:04:45] + error: repetition matches empty token tree
[01:04:45] +    |
[01:04:45] +    |
[01:04:45] + LL |     ( $(a $()?)+ ) => {};
[01:04:45] + 
[01:04:45] + 
[01:04:45] + error: repetition matches empty token tree
[01:04:45] +    |
[01:04:45] +    |
[01:04:45] 52 LL |     (a $e1:expr $($(, a $e2:expr)*)*) => ([$e1 $($(, $e2)*)*]);
[01:04:45] 54 
[01:04:45] 
[01:04:45] 
[01:04:45] 55 error: repetition matches empty token tree
[01:04:45] +   --> $DIR/issue-5067.rs:71:8
[01:04:45] 57    |
[01:04:45] 57    |
[01:04:45] - LL |     ( $()* ) => {}
[01:04:45] + LL |     ( $()* ) => {};
[01:04:45] 60 
[01:04:45] 60 
[01:04:45] - error: aborting due to 1{};","highlight_start":8,"highlight_end":10}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: repetition matches empty token tree\n  --> /checkout/src/test/ui/issues/issue-5067.rs:9:8\n   |\nLL |     ( $()* ) => {};\n   |        ^^\n\n"}
[01:04:45] {"message":"repetition matches empty token tree","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-5067.rs","byte_start":245,"byte_end":247,"line_start":11,"line_end":11,"column_start":8,"column_end":10,"is_primary":true,"text":[{"text":"    ( $()+ ) => {};","highlight_start":8,"highlight_end":10}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: repetition matches empty token tree\n  --> /checkout/src/test/ui/issues/issue-5067.rs:11:8\n   |\nLL |     ( $()+ ) => {};\n   |        ^^\n\n"}
[01:04:45] {"message":"repetition matches empty token tree","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-5067.rs","byte_start":316,"byte_end":318,"line_start":13,"line_end":13,"column_start":8,"column_end":10,"is_primary":true,"text":[{"text":"    ( $()? ) => {};","highlight_start":8,"highlight_end":10}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: repetition matches empty token tree\n  --> /checkout/src/test/ui/issues/issue-5067.rs:13:8\n   |\nLL |     ( $()? ) => {};\n   |        ^^\n\n"}
[01:04:45] {"message":"repetition matches empty token tree","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-5067.rs","byte_start":484,"byte_end":486,"line_start":18,"line_end":18,"column_start":9,"column_end":11,"is_primary":true,"text":[{"text":"    ( [$()*] ) => {};","highlight_start":9,"highlight_end":11}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: repetition matches empty token tree\n  --> /checkout/src/test/ui/issues/issue-5067.rs:18:9\n   |\nLL |     ( [$()*] ) => {};\n   |         ^^\n\n"}
[01:04:45] {"message":"repetition matches empty token tree","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-5067.rs","byte_start":557,"byte_end":559,"line_start":20,"line_end":20,"column_start":9,"column_end":11,"is_primary":true,"text":[{"text":"    ( [$()+] ) => {};","highlight_start":9,"highlight_end":11}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: repetition matches empty token tree\n  --> /checkout/src/test/ui/issues/issue-5067.rs:20:9\n   |\nLL |     ( [$()+] ) => {};\n   |         ^^\n\n"}
[01:04:45] {"message":"repetition matches empty token tree","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-5067.rs","byte_start":630,"byte_end":632,"line_start":22,"line_end":22,"column_start":9,"column_end":11,"is_primary":true,"text":[{"text":"    ( [$()?] ) => {};","highlight_start":9,"highlight_end":11}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: repetition matches empty token tree\n  --> /checkout/src/test/ui/issues/issue-5067.rs:22:9\n   |\nLL |     ( [$()?] ) => {};\n   |         ^^\n\n"}
[01:04:45] {"message":"repetition matches empty token tree","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-5067.rs","byte_start":802,"byte_end":828,"line_start":27,"line_end":27,"column_start":8,"column_end":34,"is_primary":true,"text":[{"text":"    ( $($()* $(),* $(a)* $(a),* )* ) => {};","highlight_start":8,"highlight_end":34}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: repetition matches empty token tree\n  --> /checkout/src/test/ui/issues/issue-5067.rs:27:8\n   |\nLL |     ( $($()* $(),* $(a)* $(a),* )* ) => {};\n   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[01:04:45] {"message":"repetition matches empty token tree","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-5067.rs","byte_start":897,"byte_end":923,"line_start":29,"line_end":29,"column_start":8,"column_end":34,"is_primary":true,"text":[{"text":"    ( $($()* $(),* $(a)* $(a),* )+ ) => {};","highlight_start":8,"highlight_end":34}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: repetition matches empty token tree\n  --> /checkout/src/test/ui/issues/issue-5067.rs:29:8\n   |\nLL |     ( $($()* $(),* $(a)* $(a),* )+ ) => {};\n   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[01:04:45] {"message":"repetition matches empty token tree","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-5067.rs","byte_start":992,"byte_end":1018,"line_start":31,"line_end":31,"column_start":8,"column_end":34,"is_primary":true,"text":[{"text":"    ( $($()* $(),* $(a)* $(a),* )? ) => {};","highlight_start":8,"highlight_end":34}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: repetition matches empty token tree\n  --> /checkout/src/test/ui/issues/issue-5067.rs:31:8\n   |\nLL |     ( $($()* $(),* $(a)* $(a),* )? ) => {};\n   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[01:04:45] {"message":"repetition matches empty token tree","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-5067.rs","byte_start":1087,"byte_end":1113,"line_start":33,"line_end":33,"column_start":8,"column_end":34,"is_primary":true,"text":[{"text":"    ( $($()? $(),* $(a)? $(a),* )* ) => {};","highlight_start":8,"highlight_end":34}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: repetition matches empty token tree\n  --> /checkout/src/test/ui/issues/issue-5067.rs:33:8\n   |\nLL |     ( $($()? $(),* $(a)? $(a),* )* ) => {};\n   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[01:04:45] {"message":"repetition matches empty token tree","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-5067.rs","byte_start":1182,"byte_end":1208,"line_start":35,"line_end":35,"column_start":8,"column_end":34,"is_primary":true,"text":[{"text":"    ( $($()? $(),* $(a)? $(a),* )+ ) => {};","highlight_start":8,"highlight_end":34}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: repetition matches empty token tree\n  --> /checkout/src/test/ui/issues/issue-5067.rs:35:8\n   |\nLL |     ( $($()? $(),* $(a)? $(a),* )+ ) => {};\n   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[01:04:45] {"message":"repetition matches empty token tree","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-5067.rs","byte_start":1277,"byte_end":1303,"line_start":37,"line_end":37,"column_start":8,"column_end":34,"is_primary":true,"text":[{"text":"    ( $($()? $(),* $(a)? $(a),* )? ) => {};","highlight_start":8,"highlight_end":34}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: repetition matches empty token tree\n  --> /checkout/src/test/ui/issues/issue-5067.rs:37:8\n   |\nLL |     ( $($()? $(),* $(a)? $(a),* )? ) => {};\n   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[01:04:45] {"message":"repetition matches empty token tree","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-5067.rs","byte_start":1696,"byte_end":1698,"line_start":47,"line_end":47,"column_start":12,"column_end":14,"is_primary":true,"text":[{"text":"    ( $(a $()+)* ) => {};","highlight_start":12,"highlight_end":14}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: repetition matches empty token tree\n  --> /checkout/src/test/ui/issues/issue-5067.rs:47:12\n   |\nLL |     ( $(a $()+)* ) => {};\n   |            ^^\n\n"}
[01:04:45] {"message":"repetition matches empty token tree","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-5067.rs","byte_start":1773,"byte_end":1775,"line_start":49,"line_end":49,"column_start":12,"column_end":14,"is_primary":true,"text":[{"text":"    ( $(a $()*)+ ) => {};","highlight_start":12,"highlight_end":14}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: repetition matches empty token tree\n  --> /checkout/src/test/ui/issues/issue-5067.rs:49:12\n   |\nLL |     ( $(a $()*)+ ) => {};\n   |            ^^\n\n"}
[01:04:45] {"message":"repetition matches empty token tree","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-5067.rs","byte_start":1850,"byte_end":1852,"line_start":51,"line_end":51,"column_start":12,"column_end":14,"is_primary":true,"text":[{"text":"    ( $(a $()+)? ) => {};","highlight_start":12,"highlight_end":14}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: repetition matches empty token tree\n  --> /checkout/src/test/ui/issues/issue-5067.rs:51:12\n   |\nLL |     ( $(a $()+)? ) => {};\n   |            ^^\n\n"}
[01:04:45] {"message":"repetition matches empty token tree","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-5067.rs","byte_start":1927,"byte_end":1929,"line_start":53,"line_end":53,"column_start":12,"column_end":14,"is_primary":true,"text":[{"text":"    ( $(a $()?)+ ) => {};","highlight_start":12,"highlight_end":14}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: repetition matches empty token tree\n  --> /checkout/src/test/ui/issues/issue-5067.rs:53:12\n   |\nLL |     ( $(a $()?)+ ) => {};\n   |            ^^\n\n"}
[01:04:45] {"message":"repetition matches empty token tree","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-5067.rs","byte_start":2067,"byte_end":2085,"line_start":60,"line_end":60,"column_start":18,"column_end":36,"is_primary":true,"text":[{"text":"    (a $e1:expr $($(, a $e2:expr)*)*) => ([$e1 $($(, $e2)*)*]);","highlight_start":18,"highlight_end":36}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: repetition matches empty token tree\n  --> /checkout/src/test/ui/issues/issue-5067.rs:60:18\n   |\nLL |     (a $e1:expr $($(, a $e2:expr)*)*) => ([$e1 $($(, $e2)*)*]);\n   |                  ^^^^^^^^^^^^^^^^^^\n\n"}
[01:04:45] {"message":"repetition matches empty token tree","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-5067.rs","byte_start":2275,"byte_end":2277,"line_start":71,"line_end":71,"column_start":8,"column_end":10,"is_primary":true,"text":[{"text":"    ( $()* ) => {};","highlight_start":8,"highlight_end":10}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: repetition matches empty token tree\n  --> /checkout/src/test/ui/issues/issue-5067.rs:71:8\n   |\nLL |     ( $()* ) => {};\n   |        ^^\n\n"}
[01:04:45] {"message":"aborting due to 18 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 18 previous errors\n\n"}
[01:04:45] ------------------------------------------
[01:04:45] 
[01:04:45] thread '[ui] ui/issues/issue-5067.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3245:9
[01:04:45] note: Run with `RUST_BACKTRACE=1` for a backtrace.
---
[01:04:45] 
[01:04:45] thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:495:22
[01:04:45] 
[01:04:45] 
[01:04:45] 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/x86_64-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-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-6.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -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" "--quiet" "--llvm-version" "6.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[01:04:45] 
[01:04:45] 
[01:04:45] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:04:45] Build completed unsuccessfully in 0:04:09
[01:04:45] Build completed unsuccessfully in 0:04:09
[01:04:45] make: *** [check] Error 1
[01:04:45] Makefile:48: recipe for target 'check' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:0f4d6d45
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Tue Jan 15 20:14:20 UTC 2019
---
travis_time:end:22066d4c:start=1547583262011044114,finish=1547583262016416477,duration=5372363
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:00666b1c
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'

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)

@mark-i-m mark-i-m changed the title [WIP] Fix nested ? matchers Fix nested ? matchers Jan 15, 2019
@mark-i-m
Copy link
Member Author

@petrochenkov travis is green 🍏

@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Jan 16, 2019

📌 Commit aa1ce32 has been approved by petrochenkov

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 16, 2019
Centril added a commit to Centril/rust that referenced this pull request Jan 17, 2019
…enkov

Fix nested `?` matchers

fix rust-lang#57597

I'm not 100% if this works yet...

cc @alercah

When  this is ready (but perhaps not yet):
Centril added a commit to Centril/rust that referenced this pull request Jan 17, 2019
…enkov

Fix nested `?` matchers

fix rust-lang#57597

I'm not 100% if this works yet...

cc @alercah

When  this is ready (but perhaps not yet):
Centril added a commit to Centril/rust that referenced this pull request Jan 17, 2019
…enkov

Fix nested `?` matchers

fix rust-lang#57597

I'm not 100% if this works yet...

cc @alercah

When  this is ready (but perhaps not yet):
Centril added a commit to Centril/rust that referenced this pull request Jan 18, 2019
…enkov

Fix nested `?` matchers

fix rust-lang#57597

I'm not 100% if this works yet...

cc @alercah

When  this is ready (but perhaps not yet):
Centril added a commit to Centril/rust that referenced this pull request Jan 18, 2019
…enkov

Fix nested `?` matchers

fix rust-lang#57597

I'm not 100% if this works yet...

cc @alercah

When  this is ready (but perhaps not yet):
Centril added a commit to Centril/rust that referenced this pull request Jan 19, 2019
…enkov

Fix nested `?` matchers

fix rust-lang#57597

I'm not 100% if this works yet...

cc @alercah

When  this is ready (but perhaps not yet):
bors added a commit that referenced this pull request Jan 19, 2019
Rollup of 10 pull requests

Successful merges:

 - #57268 (Add a target option "merge-functions", and a corresponding -Z flag (works around #57356))
 - #57476 (Move glob map use to query and get rid of CrateAnalysis)
 - #57501 (High priority resolutions for associated variants)
 - #57573 (Querify `entry_fn`)
 - #57610 (Fix nested `?` matchers)
 - #57634 (Remove an unused function argument)
 - #57653 (Make the contribution doc reference the guide more)
 - #57666 (Generalize `huge-enum.rs` test and expected stderr for more cross platform cases)
 - #57698 (Fix typo bug in DepGraph::try_mark_green().)
 - #57746 (Update README.md)

Failed merges:

r? @ghost
@bors bors merged commit aa1ce32 into rust-lang:master Jan 19, 2019
@mark-i-m mark-i-m deleted the nested-matchers branch May 25, 2019 02:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nested ? matchers can cause the compiler to infinite loop/crash
4 participants