impl const wrongly accepts impl with non-const provided methods · Issue #79450 · rust-lang/rust (original) (raw)

This prints no error, but prov is not const-safe, so the impl const Tr should not be accepted:

#![feature(const_trait_impl)]

trait Tr { fn req(&self);

fn prov(&self) {
    println!("lul");
    self.req();
}

}

struct S;

impl const Tr for S { fn req(&self) {} }