rental icon indicating copy to clipboard operation
rental copied to clipboard

Mention that you cannot use generic types as a suffix, potentially explain why

Open shepmaster opened this issue 6 years ago • 0 comments

rental! {
    pub mod rent_query {
        use std::sync::Arc;

        #[rental]
        pub struct RentQuery<I: 'static> {
            data: Arc<Vec<u8>>,
            iter: I,
        }
    }
}
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
   --> src/main.rs:118:1
    |
118 | / rental! {
119 | |     pub mod rent_query {
120 | |         use std::sync::Arc;
121 | |
...   |
127 | |     }
128 | | }
    | |_^
    |
    = note: `I` does not have a fixed size
    = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)

shepmaster avatar Apr 11 '20 21:04 shepmaster