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

String formatting crashing compiler #57681

Closed
fsamuel opened this issue Jan 16, 2019 · 3 comments
Closed

String formatting crashing compiler #57681

fsamuel opened this issue Jan 16, 2019 · 3 comments
Labels
A-syntaxext Area: Syntax extensions I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@fsamuel
Copy link

fsamuel commented Jan 16, 2019

   fn write_indented(&self, f: &mut fmt::Formatter, indent: usize) -> fmt::Result {
        write!(
            f,
            "{:indent$}{}[{}]: {}",
            indent = indent
            self.name,
            self.job_id,
            self.url,
        )?;

        for child in &self.child_components {
            child.write_indented(f, indent + 2)?;
        }

        Ok(())
    }

This block of code crashes the compiler.

FAILED: rust_crates/cs obj/garnet/bin/cs/bin_build_info.json
/usr/bin/env ../../build/rust/build_rustc_target.py --crate-root /usr/local/google/Projects/fuchsia/garnet/bin/cs/src/main.rs --cargo-toml-dir /usr/local/google/Projects/fuchsia/out/x64/gen/garnet/bin/cs/bin --n
thread 'rustc' panicked at 'called Result::unwrap() on an Err value: Diagnostic { level: Fatal, message: [("expected =, found .", NoStyle)], code: None, span: MultiSpan { primary_spans: [Span { lo: Byte5
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
             at src/libstd/sys_common/backtrace.rs:58
   2: std::panicking::default_hook::{{closure}}
             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::continue_panic_fmt
             at src/libstd/panicking.rs:385
   7: rust_begin_unwind
             at src/libstd/panicking.rs:312
   8: core::panicking::panic_fmt
             at src/libcore/panicking.rs:85
   9: core::result::unwrap_failed
  10: syntax_ext::format::parse_args
  11: <F as syntax::ext::base::TTMacroExpander>::expand
  12: syntax::ext::expand::MacroExpander::expand_invoc
  13: syntax::ext::expand::MacroExpander::expand_fragment
  14: syntax::ext::expand::MacroExpander::expand_crate
  15: rustc_driver::driver::phase_2_configure_and_expand_inner::{{closure}}
  16: rustc_driver::driver::phase_2_configure_and_expand_inner
  17: rustc_driver::driver::compile_input
  18: <scoped_tls::ScopedKey<T>>::set
  19: rustc_driver::run_compiler
  20: <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-nightly (7ad470c0a 2019-01-08) running on x86_64-unknown-linux-gnu

note: compiler flags: -C opt-level=0 -C debuginfo=2 -C link-arg=--pack-dyn-relocs=relr -C link-arg=--sysroot=/usr/local/google/Projects/fuchsia/out/x64/sdk/exported/zircon_sysroot/arch/x64/sysroot -C link-arg=-n
@sfackler sfackler added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Jan 16, 2019
@estebank estebank added the A-syntaxext Area: Syntax extensions label Jan 17, 2019
@hellow554
Copy link
Contributor

hellow554 commented Jan 17, 2019

The code does not compile (and does not crash). Can you provide a MCVE on the playground please?

@euclio
Copy link
Contributor

euclio commented Jan 17, 2019

This was fixed in #57522.

@nagisa
Copy link
Member

nagisa commented Jan 17, 2019

This was fixed in #57522.

Thanks! Closing.

@nagisa nagisa closed this as completed Jan 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-syntaxext Area: Syntax extensions I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

6 participants