Im losing it please help

⚓ Rust    📅 2025-12-02    👤 surdeus    👁️ 2      

surdeus

Info

This post is auto-generated from RSS feed The Rust Programming Language Forum - Latest topics. Source: Im losing it please help

Heres the code :

    fn enable_raw_mode() -> R<()> {
    let mut o_ts_guard = O_TS.lock()?;
    let o_ts = &mut *o_ts_guard;

    let ret = unsafe { ioctl(0, TCGETS, o_ts) };
    if ret == -1 {
        return Err("syscall failed".into());
    }
// stuck now..
    Ok(())
}

i get the following error message:

 cannot return value referencing temporary value
   returns a value referencing data owned by the current function [E0515]

i have been banging my head cause i really do not know the issue please help me thank you

3 posts - 2 participants

Read full topic

🏷️ Rust_feed