flux-rs / flux

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

Dyn trait causes `values of this type cannot be used as base sorted instances` #837

Closed nilehmann closed 1 month ago

nilehmann commented 1 month ago

The following code:

use flux_rs::*;

#[generics(Self as base)]
trait Trait {}

fn foo(x: &dyn Trait) {}

gives:

error[E0999]: values of this type cannot be used as base sorted instances
 --> attic/playground.rs:6:16
  |
6 | fn foo(x: &dyn Trait) {}
  |                ^^^^^
-Ztrack-diagnostics: created at crates/flux-fhir-analysis/src/conv/mod.rs:1455:26