Jeff Burdges
Jeff Burdges
You cannot `impl Trait for value` anywhere in Rust, so doing exactly this sounds impossible. You should ask if const generics could achieve similar, roughly like: ``` type F =...
Afaik there is no ghost type behind the function `x`, only behind closures.
If some ghost type already exist then whatever, not sure why it'd exist but maybe so. Anyways, that playground link seemingly uses the function pointer type, not some ghost type:...
Cool. Yes it seems to show a ghost type, not sure why that exists, but maybe it helps in inlining? If you add the line `not_really_a_ghost(this_has_a_ghost_type);` then you print `fn()`...
Is this useful? It maybe useful to have traits that declare invariants, like ``` let my_closure = |..| ..; unsafe impl SafeforFoo for type_of!(my_closure) { } something_that_requires_foo(my_closure) ``` It'd work...
As an aside, it'd be nice if type aliases permitted instantiation: ``` pub struct FooT([T; 32]); pub type Bar = Foo; impl Default for Bar { fn default() -> Bar...
There are situations where you want casts of `Arc` to `Arc` too, which came up in https://github.com/rust-lang/rust/pull/80505
Yes, but the question is about specific containers.
We've seen numerous proposals for this, so maybe review them before attempting to push any serious discussion. If the variants contain data then you normally require said data, but you...
I'd suggest `#[allow(non_snake_case)]` for autogenerated one, so they look like ``` #[allow(non_snake_case)] pub fn is_A(&self) { if let MyEnum::A = self { true } else { false } } ```...