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

librustc_interface => 2018 #58837

Merged
merged 2 commits into from
Mar 28, 2019
Merged

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Mar 1, 2019

r? @oli-obk

This will likely produce an ICE for some reason... so super-WIP.

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

This comment has been minimized.

@rust-highfive

This comment has been minimized.

@taiki-e
Copy link
Member

taiki-e commented Mar 1, 2019

stage0... It may be the same as the ICE occurring in mingw-check of #58253 (comment).

@Centril
Copy link
Contributor Author

Centril commented Mar 1, 2019

Backtrace (RUST_BACKTRACE=1 ./x.py check):

    Checking rustc_interface v0.0.0 (/home/centril/programming/rust/src/librustc_interface)
thread 'rustc' panicked at 'src/librustc/hir/def.rs:257: attempted .def_id() on invalid def: NonMacroAttr(Builtin)', src/librustc/util/bug.rs:37:26
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
   1: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:70
   2: std::panicking::default_hook::{{closure}}
             at src/libstd/sys_common/backtrace.rs:58
             at src/libstd/panicking.rs:200
   3: std::panicking::default_hook
             at src/libstd/panicking.rs:215
   4: rustc::util::common::panic_hook
   5: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:482
   6: std::panicking::begin_panic
   7: rustc::util::bug::opt_span_bug_fmt::{{closure}}
   8: rustc::ty::context::tls::with_opt::{{closure}}
   9: rustc::ty::context::tls::with_context_opt
  10: rustc::ty::context::tls::with_opt
  11: rustc::util::bug::opt_span_bug_fmt
  12: rustc::util::bug::bug_fmt
  13: rustc::hir::def::Def::def_id::{{closure}}
  14: rustc::hir::def::Def::def_id
  15: rustc_resolve::build_reduced_graph::<impl rustc_resolve::Resolver<'a>>::populate_module_if_necessary
  16: rustc_resolve::resolve_imports::<impl rustc_resolve::Resolver<'a>>::resolve_ident_in_module_unadjusted_ext
  17: rustc_resolve::Resolver::resolve_ident_in_module_ext
  18: rustc_resolve::resolve_imports::ImportResolver::resolve_import::{{closure}}
  19: rustc_resolve::resolve_imports::ImportResolver::resolve_imports
  20: rustc_resolve::macros::<impl syntax::ext::base::Resolver for rustc_resolve::Resolver<'a>>::resolve_imports
  21: syntax::ext::expand::MacroExpander::expand_fragment
  22: syntax::ext::expand::MacroExpander::expand_crate
  23: rustc_driver::driver::phase_2_configure_and_expand_inner::{{closure}}
  24: rustc::util::common::time
  25: rustc_driver::driver::phase_2_configure_and_expand
  26: rustc_driver::driver::compile_input
  27: rustc_driver::run_compiler_with_pool
  28: <scoped_tls::ScopedKey<T>>::set
  29: rustc_driver::run_compiler
  30: <scoped_tls::ScopedKey<T>>::set
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.33.0-beta.7 (08f107300 2019-02-16) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z external-macro-backtrace -Z force-unstable-if-unmarked -C prefer-dynamic -C opt-level=2 -C prefer-dynamic -C debug-assertions=n -C link-args=-Wl,-rpath,$ORIGIN/../lib --crate-type dylib

note: some of the compiler flags provided by cargo are hidden

@oli-obk
Copy link
Contributor

oli-obk commented Mar 1, 2019

Ugh... that resolution error again?! We should fix it quickly and get it back into the bootstrap compiler. Until then, I presume your code has an error, we just don't see it emitted.

@Centril
Copy link
Contributor Author

Centril commented Mar 1, 2019

@oli-obk It's not the same origin as the one we fixed before and got into the bootstrap compiler, going by the backtrace, the origin seems different. I think the fix is the changes I made to librustc_resolve in this PR but I'm not sure... have a look?

@petrochenkov
Copy link
Contributor

@Centril
Could you make a minimized reproduction if possible?
I can't imagine how Module can not have a def-id.

@oli-obk
Copy link
Contributor

oli-obk commented Mar 1, 2019

Yes, I think your solution is correct. I mean, if you want to be really on the safe side you change the last fix and this fix to emit tcx.sess.delay_span_bug in the None case, because I think it can only happen when we are currently trying to emit an error.

@Centril
Copy link
Contributor Author

Centril commented Mar 3, 2019

@petrochenkov Minimized reproduction: https://github.com/Centril/rust/tree/65cbefda9c13b31c2daea5921d997765d0db304b (with beta-2019-02-17-x86_64-unknown-linux-gnu)

@petrochenkov
Copy link
Contributor

@Centril
Thanks!

@petrochenkov
Copy link
Contributor

Fixed in #59047

The backtrace was misleading due to missing frames, there's no NonMacroAttr(Builtin) in module, the ICE comes from fn build_reduced_graph_for_external_crate_def (and it was actually partially fixed in #58253, but that PR didn't land yet due to some other ICE).

@bors
Copy link
Contributor

bors commented Mar 10, 2019

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

@Centril Centril added S-blocked Status: Blocked on something else such as an RFC or other implementation work. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 10, 2019
@Centril
Copy link
Contributor Author

Centril commented Mar 10, 2019

Triage: Blocked on #59047 ending up in the bootstrap compiler.

Centril added a commit to Centril/rust that referenced this pull request Mar 10, 2019
resolve: Account for new importable entities

Fixes the ICE encountered in rust-lang#58837
r? @Centril
Centril added a commit to Centril/rust that referenced this pull request Mar 10, 2019
resolve: Account for new importable entities

Fixes the ICE encountered in rust-lang#58837
r? @Centril
Centril added a commit to Centril/rust that referenced this pull request Mar 10, 2019
resolve: Account for new importable entities

Fixes the ICE encountered in rust-lang#58837
r? @Centril
Centril added a commit to Centril/rust that referenced this pull request Mar 11, 2019
resolve: Account for new importable entities

Fixes the ICE encountered in rust-lang#58837
r? @Centril
pietroalbini added a commit to pietroalbini/rust that referenced this pull request Mar 13, 2019
resolve: Account for new importable entities

Fixes the ICE encountered in rust-lang#58837
r? @Centril
Centril added a commit to Centril/rust that referenced this pull request Mar 13, 2019
resolve: Account for new importable entities

Fixes the ICE encountered in rust-lang#58837
r? @Centril
Centril added a commit to Centril/rust that referenced this pull request Mar 16, 2019
resolve: Account for new importable entities

Fixes the ICE encountered in rust-lang#58837
r? @Centril
Centril added a commit to Centril/rust that referenced this pull request Mar 16, 2019
resolve: Account for new importable entities

Fixes the ICE encountered in rust-lang#58837
r? @Centril
@Centril Centril force-pushed the librustc_interface_2018 branch 3 times, most recently from 80439f2 to b057210 Compare March 26, 2019 18:09
@Centril Centril added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 26, 2019
@Centril
Copy link
Contributor Author

Centril commented Mar 26, 2019

r? @petrochenkov

Should be good to go now, but let's wait on travis first... :)

@Centril Centril changed the title [WIP] librustc_interface => 2018 librustc_interface => 2018 Mar 26, 2019
@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Mar 26, 2019

📌 Commit b0572103841c9a7f30e408d9aa0386279e3de379 has been approved by petrochenkov

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

This comment has been minimized.

@Centril
Copy link
Contributor Author

Centril commented Mar 27, 2019

@bors r=petrochenkov

@bors
Copy link
Contributor

bors commented Mar 27, 2019

📌 Commit bf1068b has been approved by petrochenkov

Centril added a commit to Centril/rust that referenced this pull request Mar 27, 2019
…petrochenkov

librustc_interface => 2018

r? @oli-obk

This will likely produce an ICE for some reason... so super-WIP.
Centril added a commit to Centril/rust that referenced this pull request Mar 27, 2019
…petrochenkov

librustc_interface => 2018

r? @oli-obk

This will likely produce an ICE for some reason... so super-WIP.
cuviper added a commit to cuviper/rust that referenced this pull request Mar 28, 2019
…petrochenkov

librustc_interface => 2018

r? @oli-obk

This will likely produce an ICE for some reason... so super-WIP.
bors added a commit that referenced this pull request Mar 28, 2019
Rollup of 18 pull requests

Successful merges:

 - #57293 (Make some lints incremental)
 - #57565 (syntax: Remove warning for unnecessary path disambiguators)
 - #58253 (librustc_driver => 2018)
 - #58837 (librustc_interface => 2018)
 - #59268 (Add suggestion to use `&*var` when `&str: From<String>` is expected)
 - #59283 (Make ASCII case conversions more than 4× faster)
 - #59284 (adjust MaybeUninit API to discussions)
 - #59372 (add rustfix-able suggestions to trim_{left,right} deprecations)
 - #59390 (Make `ptr::eq` documentation mention fat-pointer behavior)
 - #59393 (Refactor tuple comparison tests)
 - #59420 ([CI] record docker image info for reuse)
 - #59421 (Reject integer suffix when tuple indexing)
 - #59430 (Renames `EvalContext` to `InterpretCx`)
 - #59439 (Generalize diagnostic for `x = y` where `bool` is the expected type)
 - #59449 (fix: Make incremental artifact deletion more robust)
 - #59451 (Add `Default` to `std::alloc::System`)
 - #59459 (Add some tests)
 - #59460 (Include id in Thread's Debug implementation)

Failed merges:

r? @ghost
@bors bors merged commit bf1068b into rust-lang:master Mar 28, 2019
@Centril Centril deleted the librustc_interface_2018 branch March 28, 2019 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants