Remove less relevant info from diagnostic · compiler-errors/rust@8a568d9 (original) (raw)
`@@ -18,37 +18,31 @@ fn main() {
`
18
18
`.extern_("dependency", rust_lib_name("dependency"))
`
19
19
`.extern_("dep_2_reexport", rust_lib_name("foo"))
`
20
20
`.run_fail()
`
21
``
`` -
.assert_stderr_contains(r#"error[E0277]: the trait bound dep_2_reexport::Type: Trait
is not satisfied
``
22
``
`-
--> multiple-dep-versions.rs:7:18
`
23
``
`-
|
`
24
``
`-
7 | do_something(Type);
`
25
``
`` -
| ------------ ^^^^ the trait Trait
is not implemented for dep_2_reexport::Type
``
26
``
`-
| |
`
27
``
`-
| required by a bound introduced by this call
`
28
``
`-
|
`
``
21
`` +
.assert_stderr_contains(r#"error[E0277]: the trait bound dep_2_reexport::Type: Trait
is not satisfied because the trait comes from a different crate version
``
``
22
`+
--> multiple-dep-versions.rs:7:18
`
``
23
`+
|
`
``
24
`+
7 | do_something(Type);
`
``
25
`` +
| ^^^^ the trait Trait
is not implemented for dep_2_reexport::Type
``
``
26
`+
|
`
29
27
`` note: there are multiple different versions of crate dependency
in the dependency graph"#)
``
30
28
`.assert_stderr_contains(r#"
`
31
``
`-
3 | pub struct Type(pub i32);
`
32
``
`-
| --------------- this type implements the required trait
`
33
``
`-
4 | pub trait Trait {
`
34
``
`-
| ^^^^^^^^^^^^^^^ this is the required trait
`
``
29
`+
3 | pub struct Type(pub i32);
`
``
30
`+
| --------------- this type implements the required trait
`
``
31
`+
4 | pub trait Trait {
`
``
32
`+
| ^^^^^^^^^^^^^^^ this is the required trait
`
35
33
`"#)
`
36
34
`.assert_stderr_contains(r#"
`
37
``
`-
1 | extern crate dep_2_reexport;
`
38
``
`` -
| ---------------------------- one version of crate dependency
is used here, as a dependency of crate foo
``
39
``
`-
2 | extern crate dependency;
`
40
``
`` -
| ------------------------ one version of crate dependency
is used here, as a direct dependency of the current crate"#)
``
``
35
`+
1 | extern crate dep_2_reexport;
`
``
36
`` +
| ---------------------------- one version of crate dependency
is used here, as a dependency of crate foo
``
``
37
`+
2 | extern crate dependency;
`
``
38
`` +
| ------------------------ one version of crate dependency
is used here, as a direct dependency of the current crate"#)
``
41
39
`.assert_stderr_contains(r#"
`
42
``
`-
3 | pub struct Type;
`
43
``
`-
| --------------- this type doesn't implement the required trait
`
44
``
`-
4 | pub trait Trait {
`
45
``
`-
| --------------- this is the found trait
`
46
``
`-
= note: two types coming from two different versions of the same crate are different types even if they look the same
`
47
``
`` -
= help: you can use cargo tree
to explore your dependency tree"#)
``
48
``
`` -
.assert_stderr_contains(r#"note: required by a bound in do_something
"#)
``
49
``
`-
.assert_stderr_contains(r#"
`
50
``
`-
12 | pub fn do_something<X: Trait>(_: X) {}
`
51
``
`` -
| ^^^^^ required by this bound in do_something
"#)
``
``
40
`+
3 | pub struct Type;
`
``
41
`+
| --------------- this type doesn't implement the required trait
`
``
42
`+
4 | pub trait Trait {
`
``
43
`+
| --------------- this is the found trait
`
``
44
`+
= note: two types coming from two different versions of the same crate are different types even if they look the same
`
``
45
`` +
= help: you can use cargo tree
to explore your dependency tree"#)
``
52
46
`` .assert_stderr_contains(r#"error[E0599]: no method named foo
found for struct dep_2_reexport::Type
in the current scope
``
53
47
` --> multiple-dep-versions.rs:8:10
`
54
48
` |
`