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

ICE - "interpolated tokens should not be present in the HIR" #78892

Closed
mrowqa opened this issue Nov 9, 2020 · 1 comment · Fixed by #78898
Closed

ICE - "interpolated tokens should not be present in the HIR" #78892

mrowqa opened this issue Nov 9, 2020 · 1 comment · Fixed by #78898
Labels
C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@mrowqa
Copy link
Contributor

mrowqa commented Nov 9, 2020

Code

#![deny(clippy::pedantic)]

#[doc(hidden)]
#[macro_export]
macro_rules! __clippy_allow_workaround {
    ($($lint_name:ident,)+ $def:tt) => {{
        #[allow( $(clippy::$lint_name),* )]
        let workaround = || { $def };
        workaround()
    }};
}

pub fn foo() -> u32 {
    __clippy_allow_workaround!(items_after_statements, {
        let x = 4;
        fn y() -> u32 {
            42
        }
        x + y()
    })
}
Off-topic note regarding clippy In the project I work on I deny everything and allow specific lints on "minimal" scopes. I run both clippy stable and nightly. "minimal", because it is not that rare that I need to apply `#[allow()]` to a larger scope; otherwise it does not work.

Meta

rustc --version --verbose:

rustc 1.47.0 (18bf6b4f0 2020-10-07)
binary: rustc
commit-hash: 18bf6b4f01a6feaf7259ba7cdae58031af1b7b39
commit-date: 2020-10-07
host: x86_64-pc-windows-msvc
release: 1.47.0
LLVM version: 11.0

Note: the bug does not occur in nightly:

rustc 1.49.0-nightly (1773f60ea 2020-11-08)
binary: rustc
commit-hash: 1773f60ea5d42e86b8fdf78d2fc5221ead222bc1
commit-date: 2020-11-08
host: x86_64-pc-windows-msvc
release: 1.49.0-nightly

Error output

thread 'rustc' panicked at 'interpolated tokens should not be present in the HIR', /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39\src\librustc_ast\token.rs:892:9
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.
Backtrace

$ RUST_BACKTRACE=1 cargo build
   Compiling ice-example v0.1.0 (C:\Users\Artur\tmp\ice-example)
thread 'rustc' panicked at 'interpolated tokens should not be present in the HIR', /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39\src\librustc_ast\token.rs:892:9
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose 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.47.0 (18bf6b4f0 2020-10-07) running on x86_64-pc-windows-msvc

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:
#0 [index_hir] index HIR
#1 [hir_owner] HIR owner of `{{misc}}#0`
#2 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `ice-example`.

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

@mrowqa mrowqa added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 9, 2020
@SNCPlay42
Copy link
Contributor

Fixed by #77255 according to cargo bisect-rustc

@rustbot modify labels: +E-needs-test

@rustbot rustbot added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Nov 9, 2020
bors added a commit to rust-lang-ci/rust that referenced this issue Nov 11, 2020
…as-schievink

Rollup of 14 pull requests

Successful merges:

 - rust-lang#76765 (Make it more clear what an about async fn's returns when referring to what it returns)
 - rust-lang#78574 (Use check-pass instead of build-pass in regions ui test suite)
 - rust-lang#78669 (Use check-pass instead of build-pass in some consts ui test suits)
 - rust-lang#78847 (Assert that a return place is not used for indexing during integration)
 - rust-lang#78854 (Workaround for "could not fully normalize" ICE )
 - rust-lang#78875 (rustc_target: Further cleanup use of target options)
 - rust-lang#78887 (Add comments to explain memory usage optimization)
 - rust-lang#78890 (comment attribution fix)
 - rust-lang#78896 (Clarified description of write! macro)
 - rust-lang#78897 (Add missing newline to error message of the default OOM hook)
 - rust-lang#78898 (add regression test for rust-lang#78892)
 - rust-lang#78908 ((rustdoc) [src] link for types defined by macros shows invocation, not defintion)
 - rust-lang#78910 (Fix links to stabilized versions of some intrinsics)
 - rust-lang#78912 (Add macro test for min-const-generics)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors closed this as completed in 6b27f0d Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants