Skip to content

ICE in librustc/middle/region on async fn #52833

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

Closed
cramertj opened this issue Jul 29, 2018 · 3 comments
Closed

ICE in librustc/middle/region on async fn #52833

cramertj opened this issue Jul 29, 2018 · 3 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@cramertj
Copy link
Member

cramertj commented Jul 29, 2018

Edit: minimal repro on playground:

async fn foo<'a>(x: &'a u8, y: &'a u8) -> u8 {
    *x + *y
}

Triggering this assertion. Full backtrace is here.

@cramertj cramertj added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Jul 29, 2018
@cramertj
Copy link
Member Author

The function in question is this:

async fn connect_to_known_network<'a>(                                                               
    sme: &'a fidl_sme::ClientSmeProxy, ssid: &'a [u8], known_ess: &'a KnownEss,                      
) -> Result<bool, failure::Error> {                                                                  
    let ssid_str = String::from_utf8_lossy(ssid).into_owned();                                       
    println!("wlancfg: Auto-connecting to '{}'", ssid_str);                                          
    let connect_txn = start_connect_txn(sme, &ssid, &known_ess.password)?;                           
    let r = await!(wait_until_connected(connect_txn))?;                                              
    match r {                                                                                        
        fidl_sme::ConnectResultCode::Success => {                                                    
            println!("wlancfg: Auto-connected to '{}'", ssid_str);                                   
            Ok(true)                                                                                 
        },                                                                                           
        other => {                                                                                   
            println!("wlancfg: Failed to auto-connect to '{}': {:?}", ssid_str, other);              
            Ok(false)                                                                                
        },                                                                                           
    }                                                                                                
} 

@cramertj
Copy link
Member Author

The ICE goes away if I make the arguments owned and remove the lifetimes.

@estebank
Copy link
Contributor

ICE no longer repros, the diagnostic is terrible though (#51751).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

2 participants