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

HirId-ify intravisit #58232

Open
wants to merge 7 commits into
base: master
from

Conversation

Projects
None yet
8 participants
@ljedrz
Copy link
Contributor

ljedrz commented Feb 6, 2019

A big step towards #57578.

This affects mostly hir::{collector, intravisit} and rustc::lint.

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Feb 6, 2019

r? @oli-obk

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

@ljedrz

This comment has been minimized.

Copy link
Contributor Author

ljedrz commented Feb 6, 2019

r? @Zoxc

@rust-highfive rust-highfive assigned Zoxc and unassigned oli-obk Feb 6, 2019

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Feb 6, 2019

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:0459b0f1:start=1549467911228625092,finish=1549467983416116908,duration=72187491816
$ 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:04:27] .................................................................................................... 2500/5369
[01:04:30] .................................................................................................... 2600/5369
[01:04:34] .................................................................................................... 2700/5369
[01:04:38] .................................................................................................... 2800/5369
[01:04:42] ........................................................................................F........... 2900/5369
[01:04:49] .................................................................................................... 3100/5369
[01:04:53] .................................................................................................... 3200/5369
[01:04:56] .........................i.......................................................................... 3300/5369
[01:05:00] ...........................................................................................ii...i..i 3400/5369
---
[01:06:11] failures:
[01:06:11] 
[01:06:11] ---- [ui] ui/issues/issue-56128.rs stdout ----
[01:06:11] 
[01:06:11] error: test compilation failed although it shouldn't!
[01:06:11] status: exit code: 101
[01:06:11] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/issues/issue-56128.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-56128/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-56128/auxiliary" "-A" "unused"
[01:06:11] ------------------------------------------
[01:06:11] 
[01:06:11] ------------------------------------------
[01:06:11] stderr:
[01:06:11] stderr:
[01:06:11] ------------------------------------------
[01:06:11] thread 'rustc' panicked at 'src/librustc/hir/map/collector.rs:261: inconsistent DepNode at `"/checkout/src/test/ui/issues/issue-56128.rs:7:9: 7:14"` for `PathSegment(PathSegment { ident: super#0, id: Some(NodeId(37)), hir_id: Some(HirId { owner: DefIndex(0:4), local_id: 2 }), def: Some(Err), args: None, infer_types: false })`: current_dep_node_owner=::bar[0]::{{?}}[1] (DefIndex(0:5)), hir_id.owner=::bar[0]::{{?}}[0] (DefIndex(0:4))', src/librustc/util/bug.rs:37:26
[01:06:11] 
[01:06:11] error: internal compiler error: unexpected panic
[01:06:11] 
[01:06:11] note: the compiler unexpectedly panicked. this is a bug.
[01:06:11] note: the compiler unexpectedly panicked. this is a bug.
[01:06:11] 
[01:06:11] note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
[01:06:11] 
[01:06:11] note: rustc 1.34.0-dev running on x86_64-unknown-linux-gnu
[01:06:11] 
[01:06:11] note: compiler flags: -Z threads=1 -Z ui-testing -Z unstable-options -C prefer-dynamic -C rpath
[01:06:11] 
[01:06:11] ------------------------------------------
[01:06:11] 
[01:06:11] thread '[ui] ui/issues/issue-56128.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3295:9
---
[01:06:11] 
[01:06:11] thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:502:22
[01:06:11] 
[01:06:11] 
[01:06:11] 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:06:11] 
[01:06:11] 
[01:06:11] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:06:11] Build completed unsuccessfully in 0:04:04
[01:06:11] Build completed unsuccessfully in 0:04:04
[01:06:11] Makefile:48: recipe for target 'check' failed
[01:06:11] make: *** [check] Error 1
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:0634e7aa
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Wed Feb  6 16:52:52 UTC 2019
---
travis_time:end:07c74a1a:start=1549471973982662700,finish=1549471973987061922,duration=4399222
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:063d28c0
$ 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:2ee8a153
travis_time:start:2ee8a153
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynami

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)

@ljedrz

This comment has been minimized.

Copy link
Contributor Author

ljedrz commented Feb 6, 2019

There's a single ui error (so far).

stack trace
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
thread '<unnamed>' panicked at 'src\librustc\hir\map\hir_id_validator.rs:26:
HirIdValidator: The recorded owner of path segment super (id=12) is ::bar[0]::{{?}}[0] instead of ::bar[0]::{{?}}[1]
HirIdValidator: Same HirId ::bar[0]::{{?}}[1]/2 assigned for nodes path segment super (id=12) and path segment baz (id=35)
HirIdValidator: The recorded owner of path segment super (id=12) is ::bar[0]::{{?}}[0] instead of ::bar[0]::{{?}}[2]
HirIdValidator: Same HirId ::bar[0]::{{?}}[2]/2 assigned for nodes path segment super (id=12) and path segment baz (id=39)', src\librustc\util\bug.rs:37:26
stack backtrace:
   0: _report_error
   1: _report_error
   2: _report_error
   3: _report_error
   4: _report_error
   5: _report_error
   6: _report_error
   7: _report_error
   8: _report_error
   9: _report_error
  10: _report_error
  11: _report_error
  12: _report_error
  13: _report_error
  14: _report_error
  15: _report_error
  16: _report_error
  17: _report_error
  18: _report_error
  19: _report_error
  20: _report_error
  21: _report_error
  22: _report_error
  23: _report_error
  24: _report_error
  25: _report_error
  26: _report_error
  27: _report_error
  28: _report_error
  29: _report_error
  30: _report_error
  31: _report_error
  32: _report_error
  33: _report_error
  34: _report_error
query stack during panic:
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.34.0-dev running on x86_64-pc-windows-gnu

note: compiler flags: -Z threads=1 -Z ui-testing -Z unstable-options -C prefer-dynamic -C rpath


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

thread '[ui] ui\issues\issue-56128.rs' panicked at 'explicit panic', src\tools\compiletest\src\runtest.rs:3295:9
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys_common::backtrace::_print
             at src\libstd\sys\windows\backtrace/mod.rs:94
             at src\libstd\sys\windows\backtrace/mod.rs:81
             at src\libstd\sys_common/backtrace.rs:70
   1: std::panicking::default_hook::{{closure}}
             at src\libstd\sys_common/backtrace.rs:58
             at src\libstd/panicking.rs:200
   2: std::panicking::default_hook
             at src\libstd/panicking.rs:209
   3: std::panicking::rust_panic_with_hook
             at src\libstd/panicking.rs:478
   4: std::panicking::begin_panic
   5: compiletest::runtest::ProcRes::fatal
   6: compiletest::runtest::TestCx::fatal_proc_rec
   7: compiletest::runtest::TestCx::check_if_test_should_compile
   8: compiletest::runtest::TestCx::run_revision
   9: compiletest::runtest::run
  10: <F as alloc::boxed::FnBox<A>>::call_box
  11: <F as alloc::boxed::FnBox<A>>::call_box
             at src\libtest/lib.rs:1468
             at /rustc/d1add97236b64048294692d91fe82b601577dd1f\src\liballoc/boxed.rs:734
  12: _rust_maybe_catch_panic
             at src\libpanic_unwind/lib.rs:92
  13: test::run_test::run_test_inner::{{closure}}
             at /rustc/d1add97236b64048294692d91fe82b601577dd1f\src\libstd/panicking.rs:276
             at /rustc/d1add97236b64048294692d91fe82b601577dd1f\src\libstd/panic.rs:388
             at src\libtest/lib.rs:1430


failures:
    [ui] ui\issues\issue-56128.rs

test result: FAILED. 5338 passed; 1 failed; 27 ignored; 0 measured; 0 filtered out

thread 'main' panicked at 'Some tests failed', src\tools\compiletest\src\main.rs:502:22
stack backtrace:
   0: std::sys_common::backtrace::_print
             at src\libstd\sys\windows\backtrace/mod.rs:94
             at src\libstd\sys\windows\backtrace/mod.rs:81
             at src\libstd\sys_common/backtrace.rs:70
   1: std::panicking::default_hook::{{closure}}
             at src\libstd\sys_common/backtrace.rs:58
             at src\libstd/panicking.rs:200
   2: std::panicking::default_hook
             at src\libstd/panicking.rs:215
   3: std::panicking::rust_panic_with_hook
             at src\libstd/panicking.rs:478
   4: std::panicking::begin_panic
   5: compiletest::main
   6: std::rt::lang_start::{{closure}}
   7: std::panicking::try::do_call
             at src\libstd/rt.rs:49
             at src\libstd/panicking.rs:297
   8: _rust_maybe_catch_panic
             at src\libpanic_unwind/lib.rs:92
   9: std::rt::lang_start_internal
             at src\libstd/panicking.rs:276
             at src\libstd/panic.rs:388
             at src\libstd/rt.rs:48
  10: main
  11: _tmainCRTStartup
  12: mainCRTStartup
  13: unit_addrs_search
  14: unit_addrs_search

I think it's caused by the way the intravisit::Visitor::visit_id check is currently implemented for HirIdValidator.

@Zoxc: I think HirIdValidator.hir_ids_seen should now be changed to an FxHashSet and that error check should be adjusted. Would you agree or am I missing something?

Show resolved Hide resolved src/librustc/lint/context.rs Outdated
Show resolved Hide resolved src/librustc/lint/context.rs Outdated
Show resolved Hide resolved src/librustc/lint/context.rs Outdated
Show resolved Hide resolved src/librustc/lint/context.rs Outdated
Show resolved Hide resolved src/librustc/hir/map/collector.rs Outdated
@Zoxc

This comment has been minimized.

Copy link
Contributor

Zoxc commented Feb 7, 2019

I'm not sure what the cause of the error here is. I'd try reverting the change to collector.rs and see if it's due to anything there.

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Feb 7, 2019

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

@ljedrz ljedrz force-pushed the ljedrz:HirIdification_continued branch from bce6cc8 to 962c04b Feb 14, 2019

@ljedrz

This comment has been minimized.

Copy link
Contributor Author

ljedrz commented Feb 14, 2019

I haven't cracked the error yet; it doesn't seem to be caused by changes to collector.rs, though - reverting as many changes as possible from it didn't help.

I have an idea for a fix based on #56143, though.

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Feb 14, 2019

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:160d5bcc:start=1550150691763516033,finish=1550150692715615405,duration=952099372
$ 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:06:55] .................................................................................................... 5000/5387
[01:06:59] .................................................................................................... 5100/5387
[01:07:02] .................................................................................................... 5200/5387
[01:07:04] .................................................................................................... 5300/5387
x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-56128/auxiliary" "-A" "unused"
[01:07:07] ------------------------------------------
[01:07:07] 
[01:07:07] ------------------------------------------
[01:07:07] stderr:
[01:07:07] stderr:
[01:07:07] ------------------------------------------
[01:07:07] thread 'rustc' panicked at 'src/librustc/hir/map/collector.rs:261: inconsistent DepNode at `"/checkout/src/test/ui/issues/issue-56128.rs:7:9: 7:14"` for `PathSegment(PathSegment { ident: super#0, id: Some(NodeId(37)), hir_id: Some(HirId { owner: DefIndex(0:4), local_id: 2 }), def: Some(Err), args: None, infer_types: false })`: current_dep_node_owner=::bar[0]::{{?}}[1] (DefIndex(0:5)), hir_id.owner=::bar[0]::{{?}}[0] (DefIndex(0:4))', src/librustc/util/bug.rs:37:26
[01:07:07] 
[01:07:07] error: internal compiler error: unexpected panic
[01:07:07] 
[01:07:07] note: the compiler unexpectedly panicked. this is a bug.
[01:07:07] note: the compiler unexpectedly panicked. this is a bug.
[01:07:07] 
[01:07:07] note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
[01:07:07] 
[01:07:07] note: rustc 1.34.0-dev running on x86_64-unknown-linux-gnu
[01:07:07] 
[01:07:07] note: compiler flags: -Z threads=1 -Z ui-testing -Z unstable-options -C prefer-dynamic -C rpath
[01:07:07] 
[01:07:07] ------------------------------------------
[01:07:07] 
[01:07:07] thread '[ui] ui/issues/issue-56128.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3295:9
---
[01:07:07] 
[01:07:07] thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:496:22
[01:07:07] 
[01:07:07] 
[01:07:07] 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:07:07] 
[01:07:07] 
[01:07:07] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:07:07] Build completed unsuccessfully in 0:04:09
[01:07:07] Build completed unsuccessfully in 0:04:09
[01:07:07] make: *** [check] Error 1
[01:07:07] Makefile:48: recipe for target 'check' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:05032f3a
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Thu Feb 14 14:32:14 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)

@ljedrz ljedrz force-pushed the ljedrz:HirIdification_continued branch from 962c04b to 693b1f1 Feb 14, 2019

@ljedrz

This comment has been minimized.

Copy link
Contributor Author

ljedrz commented Feb 14, 2019

Yep, following issue #56128 was the right way to go; hir::lowering::renumber_segment_ids had to be adjusted to take into account segments' HirId.

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Feb 14, 2019

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:3d9e10e0:start=1550158341153138694,finish=1550158343629805017,duration=2476666323
$ 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
---
travis_time:start:test_debuginfo
Check compiletest suite=debuginfo mode=debuginfo-both (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:08:27] 
[01:08:27] running 119 tests
[01:08:51] .iiiii...i.....i..i...i..i.i..i.ii...i.....i..i....i..........iiii..........i...ii...i.......ii.i.i. 100/119
[01:08:54] i......iii.i.....ii
[01:08:54] 
[01:08:54]  finished in 27.683
[01:08:54] travis_fold:end:test_debuginfo

---
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:09:01] 
[01:09:01] running 47 tests
[01:10:30] ........................F.....................test [run-pass] run-pass-fulldeps/myriad-closures.rs has been running for over 60 seconds
[01:12:26] failures:
[01:12:26] 
[01:12:26] ---- [run-pass] run-pass-fulldeps/issue-40001.rs stdout ----
[01:12:26] 
[01:12:26] 
[01:12:26] error: auxiliary build of "/checkout/src/test/run-pass-fulldeps/auxiliary/issue-40001-plugin.rs" failed to compile: 
[01:12:26] status: exit code: 1
[01:12:26] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/run-pass-fulldeps/auxiliary/issue-40001-plugin.rs" "-Zthreads=1" "--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/issue-40001/auxiliary" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--crate-type" "dylib" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass-fulldeps/issue-40001/auxiliary"
[01:12:26] ------------------------------------------
[01:12:26] 
[01:12:26] ------------------------------------------
[01:12:26] stderr:
[01:12:26] stderr:
[01:12:26] ------------------------------------------
[01:12:26] {"message":"unused import: `syntax::ext::base::*`","code":{"code":"unused_imports","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/run-pass-fulldeps/auxiliary/issue-40001-plugin.rs","byte_start":223,"byte_end":243,"line_start":11,"line_end":11,"column_start":5,"column_end":25,"is_primary":true,"text":[{"text":"use syntax::ext::base::*;","highlight_start":5,"highlight_end":25}],"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},{"message":"remove the whole `use` item","code":null,"level":"help","spans":[{"file_name":"/checkout/src/test/run-pass-fulldeps/auxiliary/issue-40001-plugin.rs","byte_start":219,"byte_end":244,"line_start":11,"line_end":11,"column_start":1,"column_end":26,"is_primary":true,"text":[{"text":"use syntax::ext::base::*;","highlight_start":1,"highlight_end":26}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"warning: unused import: `syntax::ext::base::*`\n  --> /checkout/src/test/run-pass-fulldeps/auxiliary/issue-40001-plugin.rs:11:5\n   |\nLL | use syntax::ext::base::*;\n   |     ^^^^^^^^^^^^^^^^^^^^\n   |\n   = note: #[warn(unused_imports)] on by default\n\n"}
[01:12:26] {"message":"unused import: `syntax::symbol::Symbol`","code":{"code":"unused_imports","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/run-pass-fulldeps/auxiliary/issue-40001-plugin.rs","byte_start":303,"byte_end":325,"line_start":13,"line_end":13,"column_start":5,"column_end":27,"is_primary":true,"text":[{"text":"use syntax::symbol::Symbol;","highlight_start":5,"highlight_end":27}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"remove the whole `use` item","code":null,"level":"help","spans":[{"file_name":"/checkout/src/test/run-pass-fulldeps/auxiliary/issue-40001-plugin.rs","byte_start":299,"byte_end":326,"line_start":13,"line_end":13,"column_start":1,"column_end":28,"is_primary":true,"text":[{"text":"use syntax::symbol::Symbol;","highlight_start":1,"highlight_end":28}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"warning: unused import: `syntax::symbol::Symbol`\n  --> /checkout/src/test/run-pass-fulldeps/auxiliary/issue-40001-plugin.rs:13:5\n   |\nLL | use syntax::symbol::Symbol;\n   |     ^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[01:12:26] {"message":"unused import: `rustc::hir::map as hir_map`","code":{"code":"unused_imports","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/run-pass-fulldeps/auxiliary/issue-40001-plugin.rs","byte_start":376,"byte_end":402,"line_start":17,"line_end":17,"column_start":5,"column_end":31,"is_primary":true,"text":[{"text":"use rustc::hir::map as hir_map;","highlight_start":5,"highlight_end":31}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"remove the whole `use` item","code":null,"level":"help","spans":[{"file_name":"/checkout/src/test/run-pass-fulldeps/auxiliary/issue-40001-plugin.rs","byte_start":372,"byte_end":403,"line_start":17,"line_end":17,"column_start":1,"column_end":32,"is_primary":true,"text":[{"text":"use rustc::hir::map as hir_map;","highlight_start":1,"highlight_end":32}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"warning: unused import: `rustc::hir::map as hir_map`\n  --> /checkout/src/test/run-pass-fulldeps/auxiliary/issue-40001-plugin.rs:17:5\n   |\nLL | use rustc::hir::map as hir_map;\n   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[01:12:26] {"message":"unused import: `rustc::ty`","code":{"code":"unused_imports","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/run-pass-fulldeps/auxiliary/issue-40001-plugin.rs","byte_start":503,"byte_end":512,"line_start":20,"line_end":20,"column_start":5,"column_end":14,"is_primary":true,"text":[{"text":"use rustc::ty;","highlight_start":5,"highlight_end":14}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"remove the whole `use` item","code":null,"level":"help","spans":[{"file_name":"/checkout/src/test/run-pass-fulldeps/auxiliary/issue-40001-plugin.rs","byte_start":499,"byte_end":513,"line_start":20,"line_end":20,"column_start":1,"column_end":15,"is_primary":true,"text":[{"text":"use rustc::ty;","highlight_start":1,"highlight_end":15}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"warning: unused import: `rustc::ty`\n  --> /checkout/src/test/run-pass-fulldeps/auxiliary/issue-40001-plugin.rs:20:5\n   |\nLL | use rustc::ty;\n   |     ^^^^^^^^^\n\n"}
[01:12:26] {"message":"method `check_fn` has an incompatible type for trait","code":{"code":"E0053","explanation":"\nThe parameters of any trait method must match between a trait implementation\nand the trait definition.\n\nHere are a couple examples of this error:\n\n```compile_fail,E0053\ntrait Foo {\n    fn foo(x: u16);\n    fn bar(&self);\n}\n\nstruct Bar;\n\nimpl Foo for Bar {\n    // error, expected u16, found i16\n    fn foo(x: i16) { }\n\n    // error, types differ in mutability\n    fn bar(&mut self) { }\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/run-pass-fulldeps/auxiliary/issue-40001-plugin.rs","byte_start":1199,"byte_end":1836,"line_start":45,"line_end":62,"column_start":5,"column_end":6,"is_primary":true,"text":[{"text":"    fn check_fn(&mut self,","highlight_start":5,"highlight_end":27},{"text":"                cx: &LateContext<'a, 'tcx>,","highlight_start":1,"highlight_end":44},{"text":"                _: intravisit::FnKind<'tcx>,","highlight_start":1,"highlight_end":45},{"text":"                _: &'tcx hir::FnDecl,","highlight_start":1,"highlight_end":38},{"text":"                _: &'tcx hir::Body,","highlight_start":1,"highlight_end":36},{"text":"                span: source_map::Span,","highlight_start":1,"highlight_end":40},{"text":"                id: ast::NodeId) {","highlight_start":1,"highlight_end":35},{"text":"","highlight_start":1,"highlight_end":1},{"text":"        let item = match cx.tcx.hir().get(id) {","highlight_start":1,"highlight_end":48},{"text":"            Node::Item(item) => item,","highlight_start":1,"highlight_end":38},{"text":"            _ => cx.tcx.hir().expect_item(cx.tcx.hir().get_parent(id)),","highlight_start":1,"highlight_end":72},{"text":"        };","highlight_start":1,"highlight_end":11},{"text":"","highlight_start":1,"highlight_end":1},{"text":"        if !attr::contains_name(&item.attrs, \"whitelisted_attr\") {","highlight_start":1,"highlight_end":67},{"text":"            cx.span_lint(MISSING_WHITELISTED_ATTR, span,","highlight_start":1,"highlight_end":57},{"text":"                         \"Missing 'whitelisted_attr' attribute\");","highlight_start":1,"highlight_end":66},{"text":"        }","highlight_start":1,"highlight_end":10},{"text":"    }","highlight_start":1,"highlight_end":6}],"label":"expected struct `rustc::hir::HirId`, found struct `syntax::ast::NodeId`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `fn(&mut MissingWhitelistedAttrPass, &rustc::lint::LateContext<'a, 'tcx>, rustc::hir::intravisit::FnKind<'tcx>, &'tcx rustc::hir::FnDecl, &'tcx rustc::hir::Body, syntax::source_map::Span, rustc::hir::HirId)`\n   found type `fn(&mut MissingWhitelistedAttrPass, &rustc::lint::LateContext<'a, 'tcx>, rustc::hir::intravisit::FnKind<'tcx>, &'tcx rustc::hir::FnDecl, &'tcx rustc::hir::Body, syntax::source_map::Span, syntax::ast::NodeId)`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0053]: method `check_fn` has an incompatible type for trait\n  --> /checkout/src/test/run-pass-fulldeps/auxiliary/issue-40001-plugin.rs:45:5\n   |\nLL | /     fn check_fn(&mut self,\nLL | |                 cx: &LateContext<'a, 'tcx>,\nLL | |                 _: intravisit::FnKind<'tcx>,\nLL | |                 _: &'tcx hir::FnDecl,\n...  |\nLL | |         }\nLL | |     }\n   | |_____^ expected struct `rustc::hir::HirId`, found struct `syntax::ast::NodeId`\n   |\n   = note: expected type `fn(&mut MissingWhitelistedAttrPass, &rustc::lint::LateContext<'a, 'tcx>, rustc::hir::intravisit::FnKind<'tcx>, &'tcx rustc::hir::FnDecl, &'tcx rustc::hir::Body, syntax::source_map::Span, rustc::hir::HirId)`\n              found type `fn(&mut MissingWhitelistedAttrPass, &rustc::lint::LateContext<'a, 'tcx>, rustc::hir::intravisit::FnKind<'tcx>, &'tcx rustc::hir::FnDecl, &'tcx rustc::hir::Body, syntax::source_map::Span, syntax::ast::NodeId)`\n\n"}
[01:12:26] {"message":"For more information about this error, try `rustc --explain E0053`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0053`.\n"}
[01:12:26] 
[01:12:26] ------------------------------------------
[01:12:26] 
---
[01:12:26] 
[01:12:26] thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:496:22
[01:12:26] 
[01:12:26] 
[01:12:26] 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/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-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:12:26] 
[01:12:26] 
[01:12:26] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:12:26] Build completed unsuccessfully in 0:14:59
[01:12:26] Build completed unsuccessfully in 0:14:59
[01:12:26] make: *** [check] Error 1
[01:12:26] Makefile:48: recipe for target 'check' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:1c632f94
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Thu Feb 14 16:44:59 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)

@ljedrz ljedrz force-pushed the ljedrz:HirIdification_continued branch from 693b1f1 to a8e1052 Feb 14, 2019

@ljedrz

This comment has been minimized.

Copy link
Contributor Author

ljedrz commented Feb 14, 2019

@Zoxc r?

@ljedrz ljedrz force-pushed the ljedrz:HirIdification_continued branch from a8e1052 to 3cdc2c0 Feb 15, 2019

@ljedrz

This comment has been minimized.

Copy link
Contributor Author

ljedrz commented Feb 15, 2019

@Zoxc done.

Now in order to be able to later remove NodeIds from HIR nodes I need to drop it from collector::{insert, insert_entry} as the next step. How do you suggest it could be done? Change NodeCollector.map to an FxHashMap<Entry<'hir>> or perhaps to a Vec<Option<ItemLocalId>>?

@Zoxc

This comment has been minimized.

Copy link
Contributor

Zoxc commented Feb 15, 2019

@ljedrz ljedrz referenced this pull request Feb 18, 2019

Open

Remove NodeId from some HIR nodes #58561

6 of 6 tasks complete

kennytm added a commit to kennytm/rust that referenced this pull request Feb 19, 2019

Rollup merge of rust-lang#58232 - ljedrz:HirIdification_continued, r=…
…Zoxc

HirId-ify intravisit

A big step towards rust-lang#57578.

This affects mostly `hir::{collector, intravisit}` and `rustc::lint`.

bors added a commit that referenced this pull request Feb 20, 2019

Auto merge of #58578 - kennytm:rollup, r=kennytm
Rollup of 24 pull requests

Successful merges:

 - #56470 (Modify doctest's auto-`fn main()` to allow `Result`s)
 - #58232 (HirId-ify intravisit)
 - #58303 (Improve stability tags display)
 - #58336 (Fix search results interactions)
 - #58384 (Fix tables display)
 - #58392 (Use less explicit shifting in std::net::ip)
 - #58409 (rustdoc: respect alternate flag when formatting impl trait)
 - #58456 (Remove no longer accurate diagnostic code about NLL)
 - #58528 (Don't use an allocation for ItemId in StmtKind)
 - #58530 (Monomorphize less code in fs::{read|write})
 - #58534 (Mention capping forbid lints)
 - #58536 (Remove UB in pointer tests)
 - #58538 (Add missing fmt structs examples)
 - #58539 (Add alias methods to PathBuf for underlying OsString (#58234))
 - #58544 (Fix doc for rustc "-g" flag)
 - #58545 (Add regression test for a specialization-related ICE (#39448))
 - #58546 (librustc_codegen_llvm => 2018)
 - #58551 (Explain a panic in test case net::tcp::tests::double_bind )
 - #58553 (Use more impl header lifetime elision)
 - #58562 (Fix style nits)
 - #58565 (Fix typo in std::future::Future docs)
 - #58568 (Fix a transposition in driver.rs.)
 - #58569 (Reduce Some Code Repetitions like `(n << amt) >> amt`)
 - #58576 (Stabilize iter::successors and iter::from_fn)

Failed merges:

r? @ghost
@kennytm

This comment has been minimized.

Copy link
Member

kennytm commented Feb 20, 2019

This PR breaks clippy in #58578 (comment). Should we hold this on until next week (after the release)?

[01:15:06] error[E0053]: method `check_fn` has an incompatible type for trait
[01:15:06]    --> src/tools/clippy/clippy_lints/src/cyclomatic_complexity.rs:119:5
[01:15:06]     |
[01:15:06] 119 | /     fn check_fn(
[01:15:06] 119 | /     fn check_fn(
[01:15:06] 120 | |         &mut self,
[01:15:06] 121 | |         cx: &LateContext<'a, 'tcx>,
[01:15:06] 122 | |         _: intravisit::FnKind<'tcx>,
[01:15:06] 131 | |         }
[01:15:06] 132 | |     }
[01:15:06]     | |_____^ expected struct `rustc::hir::HirId`, found struct `syntax::ast::NodeId`
[01:15:06]     |
[01:15:06]     |
[01:15:06]     = note: expected type `fn(&mut cyclomatic_complexity::CyclomaticComplexity, &rustc::lint::LateContext<'a, 'tcx>, rustc::hir::intravisit::FnKind<'tcx>, &'tcx rustc::hir::FnDecl, &'tcx rustc::hir::Body, syntax_pos::Span, rustc::hir::HirId)`
[01:15:06]                found type `fn(&mut cyclomatic_complexity::CyclomaticComplexity, &rustc::lint::LateContext<'a, 'tcx>, rustc::hir::intravisit::FnKind<'tcx>, &'tcx rustc::hir::FnDecl, &'tcx rustc::hir::Body, syntax_pos::Span, syntax::ast::NodeId)`
@ljedrz

This comment has been minimized.

Copy link
Contributor Author

ljedrz commented Feb 20, 2019

@kennytm if only I had known this earlier; it's already a 2 week old PR and it has been blocking the rest of HirIdification :/.

@kennytm

This comment has been minimized.

Copy link
Member

kennytm commented Feb 20, 2019

You could also update clippy in this PR. As long as all tools don't regress it's fine to merge within this week.

@ljedrz ljedrz force-pushed the ljedrz:HirIdification_continued branch from 81ce9bf to e39bb00 Feb 20, 2019

@ljedrz

This comment has been minimized.

Copy link
Contributor Author

ljedrz commented Feb 20, 2019

I think this should do the trick.

@kennytm if breaking tools breaks merges now, wouldn't it make sense for tool tests to be included in Travis?

@kennytm

This comment has been minimized.

Copy link
Member

kennytm commented Feb 20, 2019

@ljedrz We'd need extra capacity to run the tool check for every PR. But if the last commit message of the PR contains the words "Update Clippy" then Travis will run the tool tests.

@ljedrz ljedrz force-pushed the ljedrz:HirIdification_continued branch from e39bb00 to 404e643 Feb 20, 2019

@ljedrz

This comment has been minimized.

Copy link
Contributor Author

ljedrz commented Feb 20, 2019

The tools build is green; can I get an r+ or rollup? I'd really like to move on now ^^.

@mati865

This comment has been minimized.

Copy link
Contributor

mati865 commented Feb 20, 2019

Where does this Clippy commit comes from?
I couldn't find it in Clippy repository and it's absent in my checkout:

$ git branch --contains 1fac38088609747627b07807945224cf1ea642ca
error: no such commit 1fac38088609747627b07807945224cf1ea642ca

Submodule commit should always point to merge commit.

@ljedrz

This comment has been minimized.

Copy link
Contributor Author

ljedrz commented Feb 20, 2019

@mati865 it's in my clippy branch. Won't it be merged with clippy's master? It's my first time modifying a submodule, I'd be happy to adjust it if necessary.

@kennytm

This comment has been minimized.

Copy link
Member

kennytm commented Feb 20, 2019

@ljedrz That commit must exist inside the rust-clippy repository. You'll need to submit a PR to the rust-clippy repository, which a clippy maintainer could create a branch pointing to that commit (or merge it).

@ljedrz

This comment has been minimized.

Copy link
Contributor Author

ljedrz commented Feb 20, 2019

@kennytm cool, done.

@kennytm kennytm added S-blocked and removed S-waiting-on-bors labels Feb 20, 2019

@oli-obk

This comment has been minimized.

Copy link
Contributor

oli-obk commented Feb 20, 2019

@bors r=Zoxc

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Feb 20, 2019

📌 Commit 404e643 has been approved by Zoxc

@bors bors added S-waiting-on-bors and removed S-blocked labels Feb 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment