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

HirId-ify intravisit #58232

Merged
merged 7 commits into from
Feb 24, 2019
Merged

HirId-ify intravisit #58232

merged 7 commits into from
Feb 24, 2019

Conversation

ljedrz
Copy link
Contributor

@ljedrz ljedrz commented Feb 6, 2019

A big step towards #57578.

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

@rust-highfive
Copy link
Collaborator

r? @oli-obk

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 6, 2019
@ljedrz
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
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: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
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?

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
@Zoxc
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
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
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
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: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
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
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: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
Copy link
Contributor Author

ljedrz commented Feb 14, 2019

@Zoxc r?

@ljedrz
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
Copy link
Contributor

Zoxc commented Feb 15, 2019

@ljedrz
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
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
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
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
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
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
Copy link
Contributor Author

ljedrz commented Feb 20, 2019

@kennytm cool, done.

@kennytm kennytm added S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 20, 2019
@oli-obk
Copy link
Contributor

oli-obk commented Feb 20, 2019

@bors r=Zoxc

@bors
Copy link
Contributor

bors commented Feb 20, 2019

📌 Commit 404e643 has been approved by Zoxc

@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-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. labels Feb 20, 2019
@Centril
Copy link
Contributor

Centril commented Feb 23, 2019

@bors p=1 due to submodule update so it won't go in a rollup.

@bors
Copy link
Contributor

bors commented Feb 24, 2019

⌛ Testing commit 404e643 with merge f573049...

bors added a commit that referenced this pull request Feb 24, 2019
HirId-ify intravisit

A big step towards #57578.

This affects mostly `hir::{collector, intravisit}` and `rustc::lint`.
@bors
Copy link
Contributor

bors commented Feb 24, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: Zoxc
Pushing f573049 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 24, 2019
@bors
Copy link
Contributor

bors commented Feb 24, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: Zoxc
Pushing f573049 to master...

@bors bors merged commit 404e643 into rust-lang:master Feb 24, 2019
@ljedrz ljedrz deleted the HirIdification_continued branch February 24, 2019 05:42
bors added a commit to rust-lang/rust-clippy that referenced this pull request Feb 24, 2019
bors added a commit to rust-lang/rust-clippy that referenced this pull request Feb 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-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.

9 participants