Hello, i need some help with traits. I'm using glium and glium_text_rusttype (gtr) crates to put text on a window, there is a function in gtr that creates a Textsystem struct which needs a Facade trait.
The problem is that the compiler tells me that the trait "Facade" is not implemented for the struct "Display" even though it is (see the images).
I'm not that good at Rust so i don't know if i'm missing something.
bound on the ::new method refers to glium at version 0.23, whereas the latest glium version as of now is 0.32, an incompatible version. Thus, the glium dependency would have been duplicated by cargo, both versions of glium coexisting in parallel and considered distinct crates, and the error message talks about Display of email@example.com not implementing Facade of firstname.lastname@example.org. Go to your Cargo.toml file and adjust the glium version accordingly to 0.23 to fix the problem.
They're using glium_text_rusttype (a fork) rather than glium_text, but I think this could still be the issue - glium_text_rusttype depends on glium ">=0.29.1, <0.32.0", but there's now a glium 0.32.1 that's been released. I think if they have 0.32.1 in their Cargo.toml, they'd end up in the same situation you described.
Ah, I see. I don’t have experience working with crates that have version ranges as dependencies. Anyways, presumably 0.31 in the Cargo.toml should work then? Otherwise, @Mendred, just look at the output of cargo tree, and look at the versions of glium it lists, which would presumably be two versions (one newer one appearing as a direct dependency, and one older one as an indirect dependency through glium_text_rusttype), and adjust your Cargo.toml to choose the older one as the direct dependency, too.
Ah, it looks like the crates.io version of glium_text_rusttype has the 0.26 version dependency, whereas the latest master branch on GitHub has the newer dependency that @17cupsofcoffee pointed out above.