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: prefix is unknown #123079

Closed
matthiaskrgr opened this issue Mar 26, 2024 · 3 comments · Fixed by #123223
Closed

ICE: prefix is unknown #123079

matthiaskrgr opened this issue Mar 26, 2024 · 3 comments · Fixed by #123223
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-edition-2021 Area: The 2021 edition A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) 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.

Comments

@matthiaskrgr
Copy link
Member

snippet:

macro_rules! TrivialTypeTraversalImpls {
    ( ) => {
        $(
            impl<'tcx> $crate::ty::fold::<$crate::ty::TyCtxt<'tcx>> for $ty {
                fn <F: $crate::ty::fold::<$crate::ty::TyCtxtty'format_args>>> -> ::std::result::Result<Self, F::Error>

                #[inline]
                fn fold_with<F: $crate::ty::fold::TypeFolder<$crate::ty::TyCtxt<'tcx>>> -> Self
            }

            impl<'tcx> $crate::ty::visit::<$crate::ty::TyCtxt<'tcx>> for $fmt
        )+
    };
}

Version information

rustc 1.79.0-nightly (35936c483 2024-03-25)
binary: rustc
commit-hash: 35936c4839dd272646394779d151e060d0f6b3ac
commit-date: 2024-03-25
host: x86_64-unknown-linux-gnu
release: 1.79.0-nightly
LLVM version: 18.1.2

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc --edition=2021 --crate-type=lib

Program output

warning: unused macro definition: `TrivialTypeTraversalImpls`
 --> /tmp/icemaker_global_tempdir.FffekGIQB7Un/rustc_testrunner_tmpdir_reporting.U2wAqBOnvaRS/mvce.rs:1:14
  |
1 | macro_rules! TrivialTypeTraversalImpls {
  |              ^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_macros)]` on by default

warning: 1 warning emitted

note: no errors encountered even though delayed bugs were created

note: those delayed bugs will now be shown as internal compiler errors

error: internal compiler error: prefix `TyCtxtty` is unknown
 --> /tmp/icemaker_global_tempdir.FffekGIQB7Un/rustc_testrunner_tmpdir_reporting.U2wAqBOnvaRS/mvce.rs:5:55
  |
5 |                 fn <F: $crate::ty::fold::<$crate::ty::TyCtxtty'format_args>>> -> ::std::result::Result<Self, F::Error>
  |                                                       ^^^^^^^^ unknown prefix
  |
  = note: prefixed identifiers and literals are reserved since Rust 2021
note: delayed at compiler/rustc_parse/src/lexer/mod.rs:724:28
         0: <rustc_errors::DiagCtxtInner>::emit_diagnostic
         1: <rustc_errors::DiagCtxt>::emit_diagnostic
         2: <rustc_span::ErrorGuaranteed as rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee
         3: <rustc_parse::lexer::StringReader>::report_unknown_prefix
         4: <rustc_parse::lexer::tokentrees::TokenTreesReader>::bump
         5: <rustc_parse::lexer::tokentrees::TokenTreesReader>::parse_token_trees
         6: <rustc_parse::lexer::tokentrees::TokenTreesReader>::parse_token_trees
         7: <rustc_parse::lexer::tokentrees::TokenTreesReader>::parse_token_trees
         8: <rustc_parse::lexer::tokentrees::TokenTreesReader>::parse_token_trees
         9: <rustc_parse::lexer::tokentrees::TokenTreesReader>::parse_token_trees
        10: rustc_parse::maybe_file_to_stream
        11: rustc_parse::maybe_source_file_to_parser
        12: rustc_parse::new_parser_from_file
        13: rustc_interface::passes::parse
        14: <rustc_interface::queries::Queries>::parse
        15: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}
        16: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
        17: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
        18: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/35936c4839dd272646394779d151e060d0f6b3ac/library/alloc/src/boxed.rs:2015:9
        19: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/35936c4839dd272646394779d151e060d0f6b3ac/library/alloc/src/boxed.rs:2015:9
        20: std::sys::pal::unix::thread::Thread::new::thread_start
                   at /rustc/35936c4839dd272646394779d151e060d0f6b3ac/library/std/src/sys/pal/unix/thread.rs:108:17
        21: <unknown>
        22: <unknown>
 --> /tmp/icemaker_global_tempdir.FffekGIQB7Un/rustc_testrunner_tmpdir_reporting.U2wAqBOnvaRS/mvce.rs:5:55
  |
5 |                 fn <F: $crate::ty::fold::<$crate::ty::TyCtxtty'format_args>>> -> ::std::result::Result<Self, F::Error>
  |                                                       ^^^^^^^^
help: if you meant to write a string literal, use double quotes
  |
4 ~             impl<'tcx> $crate::ty::fold::<$crate::ty::TyCtxt<"tcx>> for $ty {
5 ~                 fn <F: $crate::ty::fold::<$crate::ty::TyCtxtty"format_args>>> -> ::std::result::Result<Self, F::Error>
  |

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.79.0-nightly (35936c483 2024-03-25) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -Z dump-mir-dir=dir

query stack during panic:
end of query stack

@matthiaskrgr matthiaskrgr added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. A-edition-2021 Area: The 2021 edition labels Mar 26, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Mar 26, 2024
@matthiaskrgr
Copy link
Member Author

🤔 this bisects to #122217 cc @estebank

@fmease
Copy link
Member

fmease commented Mar 26, 2024

🤔 this bisects to #122217

very plausible 👍

@GrigorenkoPV
Copy link
Contributor

Reduced

macro_rules! a {
    ( ) => {
        impl<'b> c for d {
            e::<f'g>
        }
    };
}

@jieyouxu jieyouxu added A-diagnostics Area: Messages for errors, warnings, and lints and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Mar 26, 2024
estebank added a commit to estebank/rust that referenced this issue Mar 30, 2024
Given

```rust
macro_rules! a {
    ( ) => {
        impl<'b> c for d {
            e::<f'g>
        }
    };
}
```

ensure an error is emitted.

Fix rust-lang#123079.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Apr 12, 2024
Fix invalid silencing of parsing error

Given

```rust
macro_rules! a {
    ( ) => {
        impl<'b> c for d {
            e::<f'g>
        }
    };
}
```

ensure an error is emitted.

Fix rust-lang#123079.
@bors bors closed this as completed in e572a19 Apr 12, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Apr 12, 2024
Rollup merge of rust-lang#123223 - estebank:issue-123079, r=pnkfelix

Fix invalid silencing of parsing error

Given

```rust
macro_rules! a {
    ( ) => {
        impl<'b> c for d {
            e::<f'g>
        }
    };
}
```

ensure an error is emitted.

Fix rust-lang#123079.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-edition-2021 Area: The 2021 edition A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) 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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants