scottmcm

Results 209 comments of scottmcm

@jgarvin Good comment! Makes me think that, rather than `Send` and `Sync` being special, perhaps they should just be ordinary `#[marker]` traits, and all `#[marker]` traits should get the "can...

@jgarvin That's been discussed as a possible change for a future edition, actually. To make it so that you can't `dyn Foo` unless it was originally defined as `dyn trait...

> Would this result in `println!"Hello world";` working? That's an interesting point. This could well be *far* more than numerics, because with [captured identifiers](https://blog.rust-lang.org/2022/01/13/Rust-1.58.0.html#captured-identifiers-in-format-strings), would this be a de-facto transition...

:+1: the `IpAddr`-`Ipv4Addr`-and-`Ipv6Addr` version of this. I like that the version-specific ones have well-defined byte orders and sizes, so there are no real surpises or choices here. Harder questions like...

One thing I'd like to see here is more about alternatives for different places it could be other than on the `impl`. That's certainly the place it has to go...

An concept that [occurred](https://rust-lang.zulipchat.com/#narrow/stream/257879-project-portable-simd/topic/Using.20traits.20to.20eliminate.20boilerplate/near/242020948) to me: Can this be used with a *private* trait? This could offer an interesting alternative to macros and sealed traits, by defining methods on a...

Note that this is available in the ecosystem with [`Integer::div_ceil`](https://docs.rs/num/0.3.1/num/integer/trait.Integer.html#method.div_ceil). (Marking libs because it's highly unlikely that a new operator would be added for this, just new methods.)

I suspect most people wouldn't want the enum for that, since they don't want the *enum* for the return type, but rather they want it to return the type they...

I'll add that try blocks cover this in a bunch of other scenarios where I wouldn't know where to put the `!` proposed here. For example, `Option, Option -> Option`...

If we were to have [`map` and `zip` and such over arrays](https://docs.rs/arraytools/0.1.5/arraytools/) in the standard library, would that be sufficient for this? Then you could `let z = x.zip_with(y, BitXor::bitxor);`,...