3 ms·
Yes, monomorphization isn't needed in theory, as long as the user-visible behavior remains the same, and in practice the team is exploring options[1] to identif
by estebank 4y ago
Yes, monomorphization isn't needed in theory, as long as the user-visible behavior remains the same, and in practice the team is exploring options[1] to identify cases where the currently manual practice of writing
pub fn foo<T: AsRef<X>>(x: T) {
inner_foo(x.as_ref());
}
fn inner_foo(_: &X) { todo!() }
can be instead done by the compiler automatically (turning monomorphized code back into polymorphic code, hence the polimorphization hame).
[1]: https://rustc-dev-guide.rust-lang.org/backend/monomorph.html#polymorphization https://rustc-dev-guide.rust-lang.org/backend/monomorph.html...