oxalica/nil

Merging recursive and non-recursive attrsets panics

dasJ opened this issue · 0 comments

dasJ commented

This is very ugly code and does honestly deserve its own warning. This file panics nil right now, while being perfectly evaluated by nix:

{
  test = rec {};

  test.abc = "test";
}

Not having the first attrset rec fixes the issue.

Full backtrace:

thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', crates/ide/src/def/liveness.rs:60:54
stack backtrace:
   0:     0x5599ec6c564a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h1792633461806265
   1:     0x5599ec6ff00e - core::fmt::write::h86858dfe747be413
   2:     0x5599ec6de2f5 - std::io::Write::write_fmt::h74e0842d6f1ebf1a
   3:     0x5599ec6c5415 - std::sys_common::backtrace::print::h18201883e81727b4
   4:     0x5599ec6defef - std::panicking::default_hook::{{closure}}::he7684422edfb8e5d
   5:     0x5599ec6decb5 - std::panicking::default_hook::h0f55305c4c7e7f71
   6:     0x5599ec6df4b8 - std::panicking::rust_panic_with_hook::hb89fb9ee5a2c564f
   7:     0x5599ec6c62b2 - std::panicking::begin_panic_handler::{{closure}}::hc641e1ce95f25c1f
   8:     0x5599ec6c5756 - std::sys_common::backtrace::__rust_end_short_backtrace::h6a9bb70d00ab18d8
   9:     0x5599ec6df1a2 - rust_begin_unwind
  10:     0x5599ec2c4f83 - core::panicking::panic_fmt::h71a20a5609c5aabf
  11:     0x5599ec2c501d - core::panicking::panic::h6358615eb4eff706
  12:     0x5599ec520606 - <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::fold::h73888e5d0fbd9a7a
  13:     0x5599ec50cd59 - ide::def::liveness::LivenessCheckResult::to_diagnostics::ha0f1898bd05ebe21
  14:     0x5599ec5ac5a4 - ide::ide::diagnostics::diagnostics::ha2276cdc4d21e7fb
  15:     0x5599ec511f5f - ide::ide::Analysis::diagnostics::hf5deb562decf8d9e
  16:     0x5599ec30bffa - nil::main::hebeaac3ffacb96b8
  17:     0x5599ec2d5f33 - std::sys_common::backtrace::__rust_begin_short_backtrace::h71142145c30ccdbd
  18:     0x5599ec2cea69 - std::rt::lang_start::{{closure}}::h83a3a23bdcefbbff
  19:     0x5599ec6d32f8 - std::rt::lang_start_internal::h34bd518f25d68bbe
  20:     0x5599ec30e4f5 - main
  21:     0x7f1401fecb0e - __libc_start_call_main
  22:     0x7f1401fecbc9 - __libc_start_main@@GLIBC_2.34
  23:     0x5599ec2c54d5 - _start
  24:                0x0 - <unknown>