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

no errors encountered even though delay_span_bug issued #107824

Closed
CyMule opened this issue Feb 9, 2023 · 3 comments
Closed

no errors encountered even though delay_span_bug issued #107824

CyMule opened this issue Feb 9, 2023 · 3 comments
Labels
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

@CyMule
Copy link

CyMule commented Feb 9, 2023

Code

This error occurred when running tests cargo test --all --all-features for foundry at commit 249538faaaee2d916b656829fdd82815d4c46a55
According to the error message, the panic is at the Ok(()) in the code snippet below.

Unfortunately, my lack of Rust knowledge prevents me from providing any further guidance here. I'm happy to help troubleshoot / respond to any questions.

#[doc(hidden)]
#[macro_export]
macro_rules! clone_resetable {
    (( $($params: tt)* ) $ty: ty) => {
        impl<$($params)*> ResetStream for $ty
            where Self: StreamOnce
        {
            type Checkpoint = Self;

            fn checkpoint(&self) -> Self {
                self.clone()
            }
            #[inline]
            fn reset(&mut self, checkpoint: Self) -> Result<(), Self::Error> {
                *self = checkpoint;
                Ok(())
            }
        }
    }
}

Meta

rustc --version --verbose:

rustc 1.69.0-nightly (bd39bbb4b 2023-02-07)
binary: rustc
commit-hash: bd39bbb4bb92df439bf6d85470e296cc6a47ffbd
commit-date: 2023-02-07
host: x86_64-apple-darwin
release: 1.69.0-nightly
LLVM version: 15.0.7

Error output

   Compiling ethers-contract v1.0.2 (https://github.com/gakonst/ethers-rs#806af08f)
error: internal compiler error: no errors encountered even though `delay_span_bug` issued

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:3469 ~ combine[f3ba]::stream::{impl#47}::reset), const_param_did: None }) (after phase change to runtime-optimized) at bb0[2]:
                                encountered `Assign((_0, const Result::<(), StringStreamError>::Ok(())))` with incompatible types:
                                left-hand side has type: Result<(), <&str as StreamOnce>::Error>
                                right-hand side has type: Result<(), StringStreamError>
   --> /Users/nick/.cargo/registry/src/github.com-1ecc6299db9ec823/combine-4.6.6/src/stream/mod.rs:44:17
    |
44  |                 Ok(())
    |                 ^^^^^^
...
153 | clone_resetable! {('a) &'a str}
    | ------------------------------- in this macro invocation
    |
    = note: delayed at    0: std::backtrace::Backtrace::create
               1: std::backtrace::Backtrace::force_capture
               2: <rustc_errors::HandlerInner>::emit_diagnostic
               3: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, &alloc::string::String>
               4: <rustc_const_eval::transform::validate::TypeChecker>::fail::<alloc::string::String>
               5: <rustc_const_eval::transform::validate::TypeChecker as rustc_middle::mir::visit::Visitor>::visit_statement
               6: <rustc_const_eval::transform::validate::Validator as rustc_middle::mir::MirPass>::run_pass
               7: rustc_mir_transform::pass_manager::run_passes_inner
               8: rustc_mir_transform::optimized_mir
               9: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::optimized_mir, rustc_query_impl::plumbing::QueryCtxt>
              10: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::optimized_mir
              11: <rustc_metadata::rmeta::encoder::EncodeContext>::encode_crate_root
              12: rustc_metadata::rmeta::encoder::encode_metadata_impl
              13: rustc_data_structures::sync::join::<rustc_metadata::rmeta::encoder::encode_metadata::{closure#0}, rustc_metadata::rmeta::encoder::encode_metadata::{closure#1}, (), ()>
              14: rustc_metadata::rmeta::encoder::encode_metadata
              15: rustc_metadata::fs::encode_and_write_metadata
              16: rustc_interface::passes::start_codegen
              17: <rustc_interface::passes::QueryContext>::enter::<<rustc_interface::queries::Queries>::ongoing_codegen::{closure#0}::{closure#0}, core::result::Result<alloc::boxed::Box<dyn core::any::Any>, rustc_errors::ErrorGuaranteed>>
              18: <rustc_interface::queries::Queries>::ongoing_codegen
              19: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_errors::ErrorGuaranteed>>
              20: rustc_span::with_source_map::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
              21: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
              22: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
              23: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
              24: std::sys::unix::thread::Thread::new::thread_start
              25: __pthread_start

    = note: this error: internal compiler error originates in the macro `clone_resetable` (in Nightly builds, run with -Z macro-backtrace for more info)

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.69.0-nightly (bd39bbb4b 2023-02-07) running on x86_64-apple-darwin

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

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

query stack during panic:
end of query stack
error: could not compile `combine`

Backtrace is same as above...

Backtrace

error: internal compiler error: no errors encountered even though `delay_span_bug` issued

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:3469 ~ combine[f3ba]::stream::{impl#47}::reset), const_param_did: None }) (after phase change to runtime-optimized) at bb0[2]:
                                encountered `Assign((_0, const Result::<(), StringStreamError>::Ok(())))` with incompatible types:
                                left-hand side has type: Result<(), <&str as StreamOnce>::Error>
                                right-hand side has type: Result<(), StringStreamError>
   --> /Users/nick/.cargo/registry/src/github.com-1ecc6299db9ec823/combine-4.6.6/src/stream/mod.rs:44:17
    |
44  |                 Ok(())
    |                 ^^^^^^
...
153 | clone_resetable! {('a) &'a str}
    | ------------------------------- in this macro invocation
    |
    = note: delayed at    0: std::backtrace::Backtrace::create
               1: std::backtrace::Backtrace::force_capture
               2: <rustc_errors::HandlerInner>::emit_diagnostic
               3: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, &alloc::string::String>
               4: <rustc_const_eval::transform::validate::TypeChecker>::fail::<alloc::string::String>
               5: <rustc_const_eval::transform::validate::TypeChecker as rustc_middle::mir::visit::Visitor>::visit_statement
               6: <rustc_const_eval::transform::validate::Validator as rustc_middle::mir::MirPass>::run_pass
               7: rustc_mir_transform::pass_manager::run_passes_inner
               8: rustc_mir_transform::optimized_mir
               9: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::optimized_mir, rustc_query_impl::plumbing::QueryCtxt>
              10: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::optimized_mir
              11: <rustc_metadata::rmeta::encoder::EncodeContext>::encode_crate_root
              12: rustc_metadata::rmeta::encoder::encode_metadata_impl
              13: rustc_data_structures::sync::join::<rustc_metadata::rmeta::encoder::encode_metadata::{closure#0}, rustc_metadata::rmeta::encoder::encode_metadata::{closure#1}, (), ()>
              14: rustc_metadata::rmeta::encoder::encode_metadata
              15: rustc_metadata::fs::encode_and_write_metadata
              16: rustc_interface::passes::start_codegen
              17: <rustc_interface::passes::QueryContext>::enter::<<rustc_interface::queries::Queries>::ongoing_codegen::{closure#0}::{closure#0}, core::result::Result<alloc::boxed::Box<dyn core::any::Any>, rustc_errors::ErrorGuaranteed>>
              18: <rustc_interface::queries::Queries>::ongoing_codegen
              19: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_errors::ErrorGuaranteed>>
              20: rustc_span::with_source_map::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
              21: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
              22: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
              23: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
              24: std::sys::unix::thread::Thread::new::thread_start
              25: __pthread_start

    = note: this error: internal compiler error originates in the macro `clone_resetable` (in Nightly builds, run with -Z macro-backtrace for more info)

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.69.0-nightly (bd39bbb4b 2023-02-07) running on x86_64-apple-darwin

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

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

query stack during panic:
end of query stack
error: could not compile `combine`
warning: build failed, waiting for other jobs to finish...

@CyMule CyMule 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 Feb 9, 2023
@CyMule
Copy link
Author

CyMule commented Feb 9, 2023

This is probably a duplicate of #107440 ?

@clubby789
Copy link
Contributor

#107678 I think, given that the error is in compiling combine. This has been fixed on master, so updating your nightly version may fix this.

@CyMule
Copy link
Author

CyMule commented Feb 9, 2023

@clubby789 looks like you were correct! updating did work

Compiling was successful on:

rustc 1.69.0-nightly (ef934d9b6 2023-02-08)
binary: rustc
commit-hash: ef934d9b632b8ac00276558824664c104b92b5f0
commit-date: 2023-02-08
host: x86_64-apple-darwin
release: 1.69.0-nightly
LLVM version: 15.0.7

@CyMule CyMule closed this as completed Feb 9, 2023
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. 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

No branches or pull requests

2 participants