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 When Building combine in DEBUG MODE (WITHOUT --release) #107678

Closed
HTGAzureX1212 opened this issue Feb 5, 2023 · 7 comments · Fixed by #107688
Closed

ICE When Building combine in DEBUG MODE (WITHOUT --release) #107678

HTGAzureX1212 opened this issue Feb 5, 2023 · 7 comments · Fixed by #107688
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@HTGAzureX1212
Copy link
Contributor

Code

/* this ICE lies in the combine crate */

Meta

rustc --version --verbose:

rustc 1.69.0-nightly (50d3ba5bc 2023-02-04)
binary: rustc
commit-hash: 50d3ba5bcbf5c7e13d4ce068d3339710701dd603
commit-date: 2023-02-04
host: x86_64-pc-windows-msvc
release: 1.69.0-nightly
LLVM version: 15.0.7

Error output

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:3569 ~ combine[b357]::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>
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:3569 ~ combine[b357]::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>
   --> C:\Users\USER\.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::disabled
               1: std::backtrace::Backtrace::force_capture
               2: <rustc_errors::HandlerInner>::emit_diagnostic
               3: <rustc_const_eval::interpret::validity::PathElem as core::fmt::Debug>::fmt
               4: rustc_const_eval::transform::promote_consts::is_const_fn_in_array_repeat_expression
               5: <rustc_const_eval::transform::validate::Validator as rustc_middle::mir::MirPass>::run_pass
               6: <rustc_mir_transform::ctfe_limit::CtfeLimit as rustc_middle::mir::MirPass>::run_pass
               7: <rustc_mir_transform::unreachable_prop::UnreachablePropagation as rustc_middle::mir::MirPass>::run_pass
               8: <rustc_middle::ty::Visibility as rustc_privacy::VisibilityLike>::new_min
               9: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::as_any
              10: <rustc_metadata::rmeta::encoder::EncodeContext as rustc_type_ir::codec::TyEncoder>::position
              11: rustc_metadata::rmeta::encoder::encode_metadata
              12: <rustc_metadata::rmeta::LazyTables as rustc_serialize::serialize::Decodable<rustc_metadata::rmeta::decoder::DecodeContext>>::decode
              13: rustc_metadata::rmeta::encoder::encode_metadata
              14: rustc_metadata::fs::encode_and_write_metadata
              15: rustc_interface::passes::start_codegen
              16: rustc_interface::passes::output_filenames
              17: <rustc_interface::queries::Queries>::ongoing_codegen
              18: rustc_driver_impl::args::arg_expand_all
              19: <rustc_data_structures::temp_dir::MaybeTempDir>::new
              20: rustc_driver_impl::args::arg_expand_all
              21: <rustc_data_structures::temp_dir::MaybeTempDir>::new
              22: <rustc_data_structures::temp_dir::MaybeTempDir>::new
              23: std::sys::windows::thread::Thread::new
              24: BaseThreadInitThunk
              25: RtlUserThreadStart

    = 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 (50d3ba5bc 2023-02-04) running on x86_64-pc-windows-msvc

note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C target-cpu=native

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

query stack during panic:
end of query stack

@HTGAzureX1212 HTGAzureX1212 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 5, 2023
@HTGAzureX1212
Copy link
Contributor Author

Compilation works fine when building WITH --release.

@lukas-code
Copy link
Contributor

searched nightlies: from nightly-2023-02-03 to nightly-2023-02-05
regressed nightly: nightly-2023-02-05
searched commit range: 658fad6...50d3ba5
regressed commit: 9dee4e4 (#107267)

bisected with cargo-bisect-rustc v0.6.5

Host triple: x86_64-unknown-linux-gnu
Reproduce with:

cargo bisect-rustc --regress=ice -- build 

@lukas-code
Copy link
Contributor

reduced example:

#![crate_type = "lib"]

pub trait StreamOnce {
    type Error;
}

pub trait ResetStream: StreamOnce {
    fn reset(&mut self) -> Result<(), Self::Error>;
}

impl<'a> ResetStream for &'a str
    where Self: StreamOnce
{
    #[inline]
    fn reset(&mut self) -> Result<(), Self::Error> {
        Ok(())
    }
}

// impl<T> StreamOnce for T {
//     type Error = ();
// }

Building a library and the inline attribute are required to reproduce.

This example will also ICE on stable, but if you uncomment the last three lines it only ICEs on nighly. So #107267 probably only revealed this bug and isn't the root cause of it.

@rustbot label S-bug-has-mcve

@rustbot rustbot added the S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue label Feb 5, 2023
hlisdero added a commit to hlisdero/cargo-check-deadlock that referenced this issue Feb 5, 2023
…ms introduced by the new nightly compiler.

Related issue:
rust-lang/rust#107678
The commit that caused the issue:
rust-lang/rust@9dee4e4
bors bot added a commit to TeamHarTex/HarTex that referenced this issue Feb 5, 2023
614: Use Older Nightly For `discord-frontend` Test r=HTG-YT a=HTG-YT

In light of rust-lang/rust#107678 which causes nightly to break for the `discord-frontend` test, a nightly rollback will be in place to temporarily fix the CI until the abovementioned issue is fixed.

Co-authored-by: HTGAzureX1212 <39023054+HTG-YT@users.noreply.github.com>
@matthiaskrgr matthiaskrgr pinned this issue Feb 6, 2023
@lqd
Copy link
Member

lqd commented Feb 6, 2023

@rustbot label regression-from-stable-to-nightly

@Bjohnson131
Copy link

Bjohnson131 commented Feb 7, 2023

I'm also seeing this. in nightly 2/7/23 back until at least 1/1/23. This date is a mistake. My bad.

@JakobDegen
Copy link
Contributor

JakobDegen commented Feb 8, 2023

cc either @oli-obk or @lcnr , this seems to be some weirdness in the handling of trivially false bounds (at least the stable variant, the nightly one might be a different root cause)

Edit: Oh, I didn't see that there was a fix up already

@NobodyXu
Copy link
Contributor

NobodyXu commented Feb 8, 2023

This ICE also happens on target x86_64-unknown-linux-gnu in cargo-bins/cargo-binstall#773 , however on target x86_64-pc-windows-msvc it did not occur.

bors bot added a commit to TeamHarTex/HarTex that referenced this issue Feb 9, 2023
622: Revert Nightly Downgrade r=HTG-YT a=HTG-YT

Now that the issue in rust-lang/rust#107678 is fixed, the nightly downgrade will hereby be reverted.

Co-authored-by: HTGAzureX1212 <39023054+HTG-YT@users.noreply.github.com>
@matthiaskrgr matthiaskrgr unpinned this issue Feb 11, 2023
@apiraino apiraino removed the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Feb 14, 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) ❄️ regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue 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.

8 participants