flux-rs / flux

Refinement Types for Rust
MIT License
648 stars 21 forks source link

Struct with `fn()` field causes `unsupported type` error #749

Closed enjhnsn2 closed 1 month ago

enjhnsn2 commented 2 months ago

The following code:

pub struct WierdStruct {
    f: fn(),
}

crashes flux with the error:

error[E0999]: refinement of unsupported struct
   --> src/main.rs:229:12
    |
229 | pub struct WierdStruct {
    |            ^^^^^^^^^^^ this struct contains unsupported features
    |
    = note: unsupported type: `fn()`

This pattern can be found in Tock's Iter<...> struct (link) which uses it inside a core::iter::FilterMap field.