News for hackers. Stuff that matters.
Re:Experimenting with Rust generics and dynamic traits by bjz_ on Tuesday March 29, 2016 @09:00AM (#11381081)
> You are being protected against panics that might have resulted from passing vectors of non-printable types in.

Not quite. Rust's generics are instantiated statically - the compiler generates code specific to the type parameters passed in. The compiler must handle cases where it could not find a conforming function implemented for that the type, otherwise no code can be generated. Without the use of traits to constrain types you could get around this by printing a stack trace of the instantiation, but that causes even worse error messages - ie. the ones you see coming from C++ compilers.

There are no comments on this comment yet.