Ixrec

Results 48 comments of Ixrec

My impression was that this newtype Deref pattern was mostly a hackaround for the lack of a proper "delegation" feature (or https://crates.io/crates/ambassador). Unfortunately I've forgotten most of the details since...

Maybe a desirable limitation. If that was lifted, we'd get a backwards-compatibility hazard where the lack of privates with interior mutability becomes a non-obvious part of your public API, right?...

> Essentially, the type const fn is only different from fn when are are in const-context, and is otherwise considered the same type. What meaningful work could a `const fn`...

In languages like C++ or Java with "traditional inheritance", when you want a type that has mostly the same behavior as an existing type, a common solution is to use...

Would specialization help with this case? (I don't understand specialization enough to figure that out myself)

I just noticed that [withoutboats thinks mutually exclusive traits are part of the solution](https://internals.rust-lang.org/t/follow-up-the-rust-platform/3782/8?u=ixrec) (or at least he did back in 2016). That seems significant.

Excellent point, I did not think about Deref at all when I was doing these write ups. My vague, mostly baseless impression is that using Deref on newtypes is par...

That specific blog post is actually the reason I added "In Rust" to that sentence; it seemed like it was giving a significantly different definition of "coherence" in the context...

Hm, I see what you mean, but I'm not sure I want to go against the established usage in what seems to be all past Rust RFCs that talk about...

Ah, is the key distinction that "just coherence" means that any given context only has one impl available, but different contexts might have different impls? Sort of like "local uniqueness"...