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

error: internal compiler error: compiler/rustc_mir/src/transform/generator.rs:751:13: Broken MIR: generator contains type #83840

Closed
rainliu opened this issue Apr 4, 2021 · 1 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.

Comments

@rainliu
Copy link

rainliu commented Apr 4, 2021

Code

https://github.com/webrtc-rs/ice/runs/2262774206?check_suite_focus=true

Meta

rustc --version --verbose:

note: rustc 1.53.0-nightly (0b417ab5c 2021-04-03) running on x86_64-unknown-linux-gnu

Error output

error: internal compiler error: compiler/rustc_mir/src/transform/generator.rs:751:13: Broken MIR: generator contains type [closure@src/agent/agent_test.rs:1817:9: 1829:10] in MIR, but typeck only knows about for<'r, 's, 't0, 't1, 't2, 't3, 't4, 't5, 't6, 't7, 't8, 't9, 't10, 't11, 't12, 't13, 't14, 't15, 't16> {ResumeTy, std::time::Duration, [closure@src/agent/agent_test.rs:1817:9: 1829:10], &'s std::time::Duration, Option<std::time::Duration>, agent_config::AgentConfig, Option<agent_config::AgentConfig>, impl std::future::Future, (), std::sync::Arc<agent::Agent>, &'t0 [closure@src/agent/agent_test.rs:1817:9: 1829:10], &'t2 agent::Agent, impl std::future::Future, String, Box<(dyn FnMut(state::ConnectionState) + Send + Sync + 't4)>, tokio::sync::mpsc::Receiver<()>, impl std::future::Future, &'t6 str, impl std::future::Future, impl std::future::Future, impl std::future::Future, &'t10 std::sync::Arc<agent::Agent>, impl std::future::Future, &'t13 mut tokio::sync::mpsc::Receiver<()>, impl std::future::Future, &'t15 String, impl std::future::Future}
    --> src/agent/agent_test.rs:1811:62
     |
1811 |   async fn test_agent_restart_both_side() -> Result<(), Error> {
     |  ______________________________________________________________^
1812 | |     let one_second = Duration::from_secs(1);
1813 | |     //"Restart Both Sides"
1814 | |
...    |
1887 | |     Ok(())
1888 | | }
     | |_^

thread 'rustc' panicked at 'Box<Any>', /rustc/0b417ab5cdfdedffd74fb22cf22d27033c851304/library/std/src/panic.rs:59:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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.53.0-nightly (0b417ab5c 2021-04-03) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z profile -Z panic_abort_tests -C embed-bitcode=no -C debuginfo=2 -C codegen-units=1 -C opt-level=0 -C link-dead-code -C overflow-checks=off -C panic=abort -C debug-assertions=off

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

query stack during panic:
#0 [optimized_mir] optimizing MIR for `agent::agent_test::test_agent_restart_both_side::{closure#0}`
#1 [layout_raw] computing layout of `[static generator@src/agent/agent_test.rs:1811:62: 1888:2 for<'r, 's, 't0, 't1, 't2, 't3, 't4, 't5, 't6, 't7, 't8, 't9, 't10, 't11, 't12, 't13, 't14, 't15, 't16> {std::future::ResumeTy, std::time::Duration, [closure@src/agent/agent_test.rs:1817:9: 1829:10], &'s std::time::Duration, std::option::Option<std::time::Duration>, agent::agent_config::AgentConfig, std::option::Option<agent::agent_config::AgentConfig>, std::future::from_generator::GenFuture<[static generator@src/agent/agent_transport_test.rs:11:78: 45:2 for<'t17, 't18, 't19, 't20, 't21, 't22, 't23, 't24> {std::future::ResumeTy, std::option::Option<agent::agent_config::AgentConfig>, std::boxed::Box<(dyn std::ops::FnMut(state::ConnectionState) + std::marker::Send + std::marker::Sync + 't17)>, tokio::sync::mpsc::Receiver<()>, agent::agent_config::AgentConfig, std::future::from_generator::GenFuture<[static generator@src/agent/mod.rs:95:71: 279:6 for<'t25, 't26, 't27, 't28, 't29, 't30, 't31, 't32, 't33, 't34> {std::future::ResumeTy, agent::agent_config::AgentConfig, std::string::String, mdns::MulticastDnsMode, std::option::Option<std::sync::Arc<webrtc_mdns::conn::DNSConn>>, tokio::sync::mpsc::Sender<state::ConnectionState>, tokio::sync::mpsc::Receiver<state::ConnectionState>, tokio::sync::mpsc::Sender<std::option::Option<std::sync::Arc<(dyn candidate::Candidate + std::marker::Send + std::marker::Sync + 't25)>>>, tokio::sync::mpsc::Receiver<std::option::Option<std::sync::Arc<(dyn candidate::Candidate + std::marker::Send + std::marker::Sync + 't26)>>>, tokio::sync::mpsc::Sender<()>, tokio::sync::mpsc::Receiver<()>, tokio::sync::mpsc::Sender<bool>, tokio::sync::mpsc::Receiver<bool>, tokio::sync::broadcast::Sender<()>, agent::agent_internal::AgentInternal, std::vec::Vec<candidate::CandidateType>, &'t27 std::option::Option<std::sync::Arc<webrtc_mdns::conn::DNSConn>>, impl std::future::Future, (), &'t29 agent::agent_config::AgentConfig, &'t30 [candidate::CandidateType], &'t31 std::vec::Vec<candidate::CandidateType>, std::result::Result<std::option::Option<external_ip_mapper::ExternalIpMapper>, webrtc_util::Error>, webrtc_util::Error, std::option::Option<external_ip_mapper::ExternalIpMapper>, std::sync::Arc<webrtc_util::vnet::net::Net>, agent::Agent, std::sync::Arc<tokio::sync::Mutex<agent::agent_internal::AgentInternal>>, std::future::from_generator::GenFuture<[static generator@src/agent/mod.rs:306:7: 363:6 {}]>, &'t32 agent::Agent, impl std::future::Future, std::result::Result<(), webrtc_util::Error>, impl std::future::Future}]>, (), std::sync::Arc<agent::Agent>, &'t18 agent::Agent, impl std::future::Future, &'t20 std::sync::Arc<agent::Agent>, impl std::future::Future, std::sync::Arc<agent::agent_transport::AgentConn>, std::sync::Arc<agent::agent_transport::AgentConn>, &'t23 mut tokio::sync::mpsc::Receiver<()>, impl std::future::Future}]>, (), std::sync::Arc<agent::Agent>, &'t0 [closure@src/agent/agent_test.rs:1817:9: 1829:10], &'t2 agent::Agent, impl std::future::Future, std::string::String, std::boxed::Box<(dyn std::ops::FnMut(state::ConnectionState) + std::marker::Send + std::marker::Sync + 't4)>, tokio::sync::mpsc::Receiver<()>, impl std::future::Future, &'t6 str, impl std::future::Future, impl std::future::Future, impl std::future::Future, &'t10 std::sync::Arc<agent::Agent>, impl std::future::Future, &'t13 mut tokio::sync::mpsc::Receiver<()>, impl std::future::Future, &'t15 std::string::String, impl std::future::Future}]`
Backtrace

<backtrace>

@rainliu rainliu 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 Apr 4, 2021
@rainliu rainliu changed the title rustc 1.53.0-nightly (0b417ab5c 2021-04-03) running on x86_64-unknown-linux-gnu error: internal compiler error: compiler/rustc_mir/src/transform/generator.rs:751:13: Broken MIR: generator contains type Apr 4, 2021
@SNCPlay42
Copy link
Contributor

Reduced:

async fn test_agent_restart_both_side() -> () {
    let generate_candidate_address_strings = |_: Box<dyn Candidate>| -> () {};
    generate_candidate_address_strings(get_local_candidates().await);
}
async fn get_local_candidates() -> Box<dyn Candidate> {
    unimplemented!()
}
trait Candidate {}

So this is a duplicate of #83737.

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

3 participants