Skip to content

"failed to process buffered lint here" with macro call in async block #81724

Closed
@clehner

Description

@clehner

This error started appearing with nightly a few days ago.

The source code triggering it is here: https://github.com/timothee-haudebourg/json-ld/blob/9b0e4521f0f600304c508be17021986f90fe07ba/src/expansion/element.rs#L223

This happens when running e.g. cargo build or cargo test.

I was able to minimize the code triggering the error to the following, in the json-ld crate:

diff --git a/src/lib.rs b/src/lib.rs
index e84e86e..c216df1 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -52,0 +53,4 @@ pub use context::{
+
+async fn foo() {
+    warn!("foo {}", "bar")
+}

But I have not been able to reproduce it in a clean new crate.

This warn macro is from the log crate. The error doesn't happen if a semicolon is used after the macro call.

The original error:

error: internal compiler error: failed to process buffered lint here
   --> src/expansion/element.rs:223:8
    |
223 | ...                   warn!("failed to expand key `{}`", key)
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: delayed at /rustc/04caa632dd10c2bf64b69524c7f9c4c30a436877/compiler/rustc_lint/src/early.rs:384:18
    = note: this error: internal compiler error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', compiler/rustc_errors/src/lib.rs:974:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.51.0-nightly (04caa632d 2021-01-30) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type lib

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

query stack during panic:
end of query stack
error: could not compile `json-ld`

To learn more, run the command again with --verbose.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions