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

Point at macro definition when no rules expect token #55298

Merged
merged 2 commits into from Oct 26, 2018

Conversation

Projects
None yet
4 participants
@estebank
Contributor

estebank commented Oct 24, 2018

Fix #35150.

@rust-highfive

This comment has been minimized.

Collaborator

rust-highfive commented Oct 24, 2018

r? @pnkfelix

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive

This comment was marked as outdated.

Collaborator

rust-highfive commented Oct 24, 2018

The job x86_64-gnu-llvm-5.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.
[00:50:59] .................................................................................................... 2200/4943
[00:51:04] .................................................................................................... 2300/4943
[00:51:08] .................................................................................................... 2400/4943
[00:51:13] .................................................................................................... 2500/4943
[00:51:17] ................................................iiiiiiiii........................................... 2600/4943
[00:51:21] ..................................................................................................ii 2700/4943
[00:51:29] .................................................................................................... 2900/4943
[00:51:32] ........................................................................................i........... 3000/4943
[00:51:36] .................................................................................................... 3100/4943
[00:51:39] ...............................................i..i.ii.............................................. 3200/4943
---
travis_time:start:test_codegen
Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:04:57] 
[01:04:57] running 111 tests
[01:05:00] i..ii...iii.......i...i.........i..iii...........i.....i.....ii...i.i.ii..............i...ii..ii.i.. 100/111
[01:05:00] ..iiii.....
[01:05:00] 
[01:05:00]  finished in 3.617
[01:05:00] travis_fold:end:test_codegen

---
travis_time:start:test_run-pass-fulldeps
Check compiletest suite=run-pass-fulldeps mode=run-pass (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:06:20] 
[01:06:20] running 97 tests
[01:08:19] ...........................................FFF..........................test [run-pass] run-pass-fulldeps/myriad-closures.rs has been running for over 60 seconds
[01:10:05] thread 'main' panicked at 'Some tests failed', tools/compiletest/src/main.rs:503:22
[01:10:05] failures:
[01:10:05] 
[01:10:05] ---- [run-pass] run-pass-fulldeps/plugin-args-1.rs stdout ----
[01:10:05] 
[01:10:05] 
[01:10:05] error: auxiliary build of "/checkout/src/test/run-pass-fulldeps/auxiliary/plugin_args.rs" failed to compile: 
[01:10:05] status: exit code: 1
[01:10:05] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/run-pass-fulldeps/auxiliary/plugin_args.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass-fulldeps/plugin-args-1/auxiliary" "-Crpath" "-O" "-Zunstable-options" "--crate-type" "dylib" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass-fulldeps/plugin-args-1/auxiliary"
[01:10:05] ------------------------------------------
[01:10:05] 
[01:10:05] ------------------------------------------
[01:10:05] stderr:
[01:10:05] stderr:
[01:10:05] ------------------------------------------
[01:10:05] {"message":"unused import: `syntax::ptr::P`","code":{"code":"unused_imports","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/run-pass-fulldeps/auxiliary/plugin_args.rs","byte_start":864,"byte_end":878,"line_start":27,"line_end":27,"column_start":5,"column_end":19,"is_primary":true,"text":[{"text":"use syntax::ptr::P;","highlight_start":5,"highlight_end":19}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"#[warn(unused_imports)] on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"warning: unused import: `syntax::ptr::P`\n  --> /checkout/src/test/run-pass-fulldeps/auxiliary/plugin_args.rs:27:5\n   |\nLL | use syntax::ptr::P;\n   |     ^^^^^^^^^^^^^^\n   |\n   = note: #[warn(unused_imports)] on by default\n\n"}
[01:10:05] {"message":"method `expand` has 4 parameters but the declaration in trait `syntax::ext::base::TTMacroExpander::expand` has 5","code":{"code":"E0050","explanation":"\nThis error indicates that an attempted implementation of a trait method\nhas the wrong number of function parameters.\n\nFor example, the trait below has a method `foo` with two function parameters\n(`&self` and `u8`), but the implementation of `foo` for the type `Bar` omits\nthe `u8` parameter:\n\n```compile_fail,E0050\ntrait Foo {\n    fn foo(&self, x: u8) -> bool;\n}\n\nstruct Bar;\n\n// error: method `foo` has 1 parameter but the declaration in trait `Foo::foo`\n// has 2\nimpl Foo for Bar {\n    fn foo(&self) -> bool { true }\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/run-pass-fulldeps/auxiliary/plugin_args.rs","byte_start":1209,"byte_end":1220,"line_start":41,"line_end":41,"column_start":23,"column_end":34,"is_primary":true,"text":[{"text":"                   _: TokenStream) -> Box<MacResult+'c, std::option::Option<syntax_pos::Span>) -> std::boxed::Box<(dyn syntax::ext::base::MacResult + 'cx)>`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0050]: method `expand` has 4 parameters but the declaration in trait `syntax::ext::base::TTMacroExpander::expand` has 5\n  --> /checkout/src/test/run-pass-fulldeps/auxiliary/plugin_args.rs:41:23\n   |\nLL |                    _: TokenStream) -> Box<MacResult+'cx> {\n   |                       ^^^^^^^^^^^ expected 5 parameters, found 4\n   |\n   = note: `expand` from trait: `fn(&Self, &'cx mut syntax::ext::base::ExtCtxt<'_>, syntax_pos::Span, syntax::tokenstream::TokenStream, std::option::Option<syntax_pos::Span>) -> std::boxed::Box<(dyn syntax::ext::base::MacResult + 'cx)>`\n\n"}
[01:10:05] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[01:10:05] {"message":"For more information about this error, try `rustc --explain E0050`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0050`.\n"}
[01:10:05] ------------------------------------------
[01:10:05] 
[01:10:05] thread '[run-pass] run-pass-fulldeps/plugin-args-2.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3284:9
[01:10:05] 
[01:10:05] 
[01:10:05] ---- [run-pass] run-pass-fulldeps/plugin-args-3.rs stdout ----
[01:10:05] 
[01:10:05] error: auxiliary build of "/checkout/src/test/run-pass-fulldeps/auxiliary/plugin_args.rs" failed to compile: 
[01:10:05] status: exit code: 1
[01:10:0but the declaration in trait `syntax::ext::base::TTMacroExpander::expand` has 5","code":{"code":"E0050","explanation":"\nThis error indicates that an attempted implementation of a trait method\nhas the wrong number of function parameters.\n\nFor example, the trait below has a method `foo` with two function parameters\n(`&self` and `u8`), but the implementation of `foo` for the type `Bar` omits\nthe `u8` parameter:\n\n```compile_fail,E0050\ntrait Foo {\n    fn foo(&self, x: u8) -> bool;\n}\n\nstruct Bar;\n\n// error: method `foo` has 1 parameter but the declaration in trait `Foo::foo`\n// has 2\nimpl Foo for Bar {\n    fn foo(&self) -> bool { true }\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/run-pass-fulldeps/auxiliary/plugin_args.rs","byte_start":1209,"byte_end":1220,"line_start":41,"line_end":41,"column_start":23,"column_end":34,"is_primary":true,"text":[{"text":"                   _: TokenStream) -> Box<MacResult+'cx> {","highlight_start":23,"highlight_end":34}],"label":"expected 5 parameters, found 4","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`expand` from trait: `fn(&Self, &'cx mut syntax::ext::base::ExtCtxt<'_>, syntax_pos::Span, syntax::tokenstream::TokenStream, std::option::Option<syntax_pos::Span>) -> std::boxed::Box<(dyn syntax::ext::base::MacResult + 'cx)>`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0050]: method `expand` has 4 parameters but the declaration in trait `syntax::ext::base::TTMacroExpander::expand` has 5\n  --> /checkout/src/test/run-pass-fulldeps/auxiliary/plugin_args.wn-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/run-pass-fulldeps" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass-fulldeps" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "run-pass" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-5.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options " "--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" "5.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:10:05] 
[01:10:05] 
[01:10:05] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:10:05] Build completed unsuccessfully in 0:24:25
[01:10:05] Build completed unsuccessfully in 0:24:25
[01:10:05] Makefile:58: recipe for target 'check' failed
[01:10:05] make: *** [check] Error 1
3051832 ./obj
2839780 ./obj/build
2207984 ./obj/build/x86_64-unknown-linux-gnu
1197692 ./.git
---
travis_time:end:1bed80ee:start=1540344727825447141,finish=1540344727831442621,duration=5995480
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:01b7d570
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:16dae0a0
travis_time:start:16dae0a0
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:08855535
$ dmesg | grep -i kill

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)

LL | | ($a:ident, $b:ident, $c:ident, $d:ident) => ();
LL | | ($a:ident, $b:ident, $c:ident, $d:ident, $e:ident) => ();
LL | | }
| |_- when calling this macro

This comment has been minimized.

@pnkfelix

pnkfelix Oct 24, 2018

Member

do we want to highlight the whole definition? Might we be better off just highlighting the macro_rules! foo portion?

This comment has been minimized.

@estebank

estebank Oct 24, 2018

Contributor

As is it will only ever show 7 lines, at most of the macro. For the simple case that's enough to spot the problem without having to dig for the source. Having said that, I can change the PR to only point at the macro_rules! foo portion if needed.

This comment has been minimized.

@estebank

estebank Oct 24, 2018

Contributor

Done.

@pnkfelix

This comment has been minimized.

Member

pnkfelix commented Oct 24, 2018

@bors r+

@bors

This comment has been minimized.

Contributor

bors commented Oct 24, 2018

📌 Commit 1ab45ec has been approved by pnkfelix

@estebank

This comment has been minimized.

Contributor

estebank commented Oct 26, 2018

@bors rollup

kennytm added a commit to kennytm/rust that referenced this pull request Oct 26, 2018

Rollup merge of rust-lang#55298 - estebank:macro-def, r=pnkfelix
Point at macro definition when no rules expect token

Fix rust-lang#35150.

bors added a commit that referenced this pull request Oct 26, 2018

Auto merge of #55371 - kennytm:rollup, r=kennytm
Rollup of 16 pull requests

Successful merges:

 - #53996 ([CI] Run a `thumbv7m-none-eabi` binary using `qemu-system-arm` [IRR-2018-embedded])
 - #54816 (Don't try to promote already promoted out temporaries)
 - #54824 (Cleanup rustdoc tests with `@!has` and `@!matches`)
 - #54921 (Add line numbers option to rustdoc)
 - #55167 (Add a "cheap" mode for `compute_missing_ctors`.)
 - #55258 (Fix Rustdoc ICE when checking blanket impls)
 - #55262 (Change the ICE from #55223 to a hard error)
 - #55271 (Unimplement ExactSizeIterator for MIR traversing iterators)
 - #55292 (Macro diagnostics tweaks)
 - #55298 (Point at macro definition when no rules expect token)
 - #55301 (List allowed tokens after macro fragments)
 - #55325 (Fix link to macros chapter)
 - #55343 (rustbuild: fix remap-debuginfo when building a release)
 - #55346 (Shrink `Statement`.)
 - #55358 (Remove redundant clone (2))
 - #55363 (Bump cargo-vendor version to 0.1.17)

bors added a commit that referenced this pull request Oct 26, 2018

Auto merge of #55371 - kennytm:rollup, r=kennytm
Rollup of 15 pull requests

Successful merges:

 - #53996 ([CI] Run a `thumbv7m-none-eabi` binary using `qemu-system-arm` [IRR-2018-embedded])
 - #54816 (Don't try to promote already promoted out temporaries)
 - #54824 (Cleanup rustdoc tests with `@!has` and `@!matches`)
 - #54921 (Add line numbers option to rustdoc)
 - #55167 (Add a "cheap" mode for `compute_missing_ctors`.)
 - #55258 (Fix Rustdoc ICE when checking blanket impls)
 - #55262 (Change the ICE from #55223 to a hard error)
 - #55271 (Unimplement ExactSizeIterator for MIR traversing iterators)
 - #55292 (Macro diagnostics tweaks)
 - #55298 (Point at macro definition when no rules expect token)
 - #55301 (List allowed tokens after macro fragments)
 - #55325 (Fix link to macros chapter)
 - #55343 (rustbuild: fix remap-debuginfo when building a release)
 - #55346 (Shrink `Statement`.)
 - #55358 (Remove redundant clone (2))

kennytm added a commit to kennytm/rust that referenced this pull request Oct 26, 2018

Rollup merge of rust-lang#55298 - estebank:macro-def, r=pnkfelix
Point at macro definition when no rules expect token

Fix rust-lang#35150.

bors added a commit that referenced this pull request Oct 26, 2018

Auto merge of #55382 - kennytm:rollup, r=kennytm
Rollup of 19 pull requests

Successful merges:

 - #54816 (Don't try to promote already promoted out temporaries)
 - #54824 (Cleanup rustdoc tests with `@!has` and `@!matches`)
 - #54921 (Add line numbers option to rustdoc)
 - #55167 (Add a "cheap" mode for `compute_missing_ctors`.)
 - #55258 (Fix Rustdoc ICE when checking blanket impls)
 - #55262 (Change the ICE from #55223 to a hard error)
 - #55271 (Unimplement ExactSizeIterator for MIR traversing iterators)
 - #55292 (Macro diagnostics tweaks)
 - #55298 (Point at macro definition when no rules expect token)
 - #55301 (List allowed tokens after macro fragments)
 - #55302 (Extend the impl_stable_hash_for! macro for miri.)
 - #55325 (Fix link to macros chapter)
 - #55343 (rustbuild: fix remap-debuginfo when building a release)
 - #55346 (Shrink `Statement`.)
 - #55358 (Remove redundant clone (2))
 - #55363 (Bump cargo-vendor version to 0.1.17)
 - #55370 (Update mailmap for estebank)
 - #55375 (Typo fixes in configure_cmake comments)
 - #55378 (rustbuild: use configured linker to build boostrap)

Failed merges:

r? @ghost

bors added a commit that referenced this pull request Oct 26, 2018

Auto merge of #55382 - kennytm:rollup, r=kennytm
Rollup of 19 pull requests

Successful merges:

 - #54816 (Don't try to promote already promoted out temporaries)
 - #54824 (Cleanup rustdoc tests with `@!has` and `@!matches`)
 - #54921 (Add line numbers option to rustdoc)
 - #55167 (Add a "cheap" mode for `compute_missing_ctors`.)
 - #55258 (Fix Rustdoc ICE when checking blanket impls)
 - #55262 (Change the ICE from #55223 to a hard error)
 - #55271 (Unimplement ExactSizeIterator for MIR traversing iterators)
 - #55292 (Macro diagnostics tweaks)
 - #55298 (Point at macro definition when no rules expect token)
 - #55301 (List allowed tokens after macro fragments)
 - #55302 (Extend the impl_stable_hash_for! macro for miri.)
 - #55325 (Fix link to macros chapter)
 - #55343 (rustbuild: fix remap-debuginfo when building a release)
 - #55346 (Shrink `Statement`.)
 - #55358 (Remove redundant clone (2))
 - #55370 (Update mailmap for estebank)
 - #55375 (Typo fixes in configure_cmake comments)
 - #55378 (rustbuild: use configured linker to build boostrap)
 - #55379 (validity: assert that unions are non-empty)

kennytm added a commit to kennytm/rust that referenced this pull request Oct 26, 2018

Rollup merge of rust-lang#55298 - estebank:macro-def, r=pnkfelix
Point at macro definition when no rules expect token

Fix rust-lang#35150.

bors added a commit that referenced this pull request Oct 26, 2018

Auto merge of #55382 - kennytm:rollup, r=kennytm
Rollup of 21 pull requests

Successful merges:

 - #54816 (Don't try to promote already promoted out temporaries)
 - #54824 (Cleanup rustdoc tests with `@!has` and `@!matches`)
 - #54921 (Add line numbers option to rustdoc)
 - #55167 (Add a "cheap" mode for `compute_missing_ctors`.)
 - #55258 (Fix Rustdoc ICE when checking blanket impls)
 - #55264 (Compile the libstd we distribute with -Ccodegen-unit=1)
 - #55271 (Unimplement ExactSizeIterator for MIR traversing iterators)
 - #55292 (Macro diagnostics tweaks)
 - #55298 (Point at macro definition when no rules expect token)
 - #55301 (List allowed tokens after macro fragments)
 - #55302 (Extend the impl_stable_hash_for! macro for miri.)
 - #55325 (Fix link to macros chapter)
 - #55343 (rustbuild: fix remap-debuginfo when building a release)
 - #55346 (Shrink `Statement`.)
 - #55358 (Remove redundant clone (2))
 - #55370 (Update mailmap for estebank)
 - #55375 (Typo fixes in configure_cmake comments)
 - #55378 (rustbuild: use configured linker to build boostrap)
 - #55379 (validity: assert that unions are non-empty)
 - #55383 (Use `SmallVec` for the queue in `coerce_unsized`.)
 - #55391 (bootstrap: clean up a few clippy findings)
@bors

This comment has been minimized.

Contributor

bors commented Oct 26, 2018

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

@bors bors merged commit 1ab45ec into rust-lang:master Oct 26, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment