This is a nice small feature. I'm curious about the commit description:
foo(const { 1 + 1 })
which is roughly desugared into
struct Foo;
impl Foo {
const FOO: i32 = 1 + 1;
}
foo(Foo::FOO)
I would have expected it to desugar to something like:
foo({
const TMP: i32 = 1 + 1;
TMP
})
But I can't seem an explanation why the struct with impl
is used. I wonder if it has something to do with propagating generics.