Peter Jaszkowiak

Results 312 comments of Peter Jaszkowiak

> ```rust > impl bool> Pattern for F {} > ``` IIRC, this is currently forbidden due to coherence rules.

AFAIK all of today's `Pattern`s are defined in core, but `OsStr` lives in std. That's where the coherence issues come in.

Last I checked, there's a mechanism for inherent impls, but not for traits. That said, it's probably something that could be added.

> Should it short-circuit? Good idea. Given saturation should usually be rare, it may not be worth the extra check. Unless there is no extra check because the saturation is...

Hmm yeah how should signed saturating sum be implemented? Saturating in from an unbounded integer type feels more intuitive to me.

I'll just note that we could add macros to the prelude on an edition boundary. Also, are there any places where macro invocations are not currently allowed, but `const _:...

What about making `.rev().rev()` return the original type: ```rust impl Rev { fn rev(self) -> T { self.0 } } ```

Yeah it would be a breaking change

One method I think would be really nice to have in the standard library is something like `peeking_take_while` - a version of `take_while` that doesn't consume the first element that...

What about an enum adt_const_generic parameter? (A bool would work but isn't as meaningful) ```rust enum Behavior { Poisoning, NonPoisoning, } struct Mutex; impl Mutex { fn lock(&self) -> LockResult;...