Does that matter if it is the way for accomplishing what you want?
By the way, if there's a common trait that both types implement, you can just require the type to be specified:
fn parse<T: MyTrait>(input: &str) -> T {
…
}
Incidentally, this is exactly how str::parse() is implemented.
This approach uses static dispatch, while dyn Trait results in dynamic dispatch. This pretty much implies all the advantages and disadvantages of the two different methods.
When you need to dynamically decide the type that comes from deserializing loosely-typed data such as XML, the typical thing to do in Rust is creating an enum as @naim suggested above.