You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.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
-
|
27
-
note: there are multiple different versions of crate `dependency` in the dependency graph"#)
28
-
.assert_stderr_contains(r#"
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
33
-
"#)
34
-
.assert_stderr_contains(r#"
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"#)
39
-
.assert_stderr_contains(r#"
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"#)
46
-
.assert_stderr_contains(r#"error[E0599]: no method named `foo` found for struct `dep_2_reexport::Type` in the current scope
47
-
--> multiple-dep-versions.rs:8:10
48
-
|
49
-
8 | Type.foo();
50
-
| ^^^ method not found in `Type`
51
-
|
52
-
note: there are multiple different versions of crate `dependency` in the dependency graph"#)
53
-
.assert_stderr_contains(r#"
54
-
4 | pub trait Trait {
55
-
| ^^^^^^^^^^^^^^^ this is the trait that is needed
56
-
5 | fn foo(&self);
57
-
| -------------- the method is available for `dep_2_reexport::Type` here
58
-
|
59
-
::: multiple-dep-versions.rs:4:18
60
-
|
61
-
4 | use dependency::{Trait, do_something};
62
-
| ----- `Trait` imported here doesn't correspond to the right version of crate `dependency`"#)
63
-
.assert_stderr_contains(r#"
64
-
4 | pub trait Trait {
65
-
| --------------- this is the trait that was imported"#)
66
-
.assert_stderr_contains(r#"
67
-
error[E0599]: no function or associated item named `bar` found for struct `dep_2_reexport::Type` in the current scope
68
-
--> multiple-dep-versions.rs:9:11
69
-
|
70
-
9 | Type::bar();
71
-
| ^^^ function or associated item not found in `Type`
72
-
|
73
-
note: there are multiple different versions of crate `dependency` in the dependency graph"#)
74
-
.assert_stderr_contains(r#"
75
-
4 | pub trait Trait {
76
-
| ^^^^^^^^^^^^^^^ this is the trait that is needed
77
-
5 | fn foo(&self);
78
-
6 | fn bar();
79
-
| --------- the associated function is available for `dep_2_reexport::Type` here
80
-
|
81
-
::: multiple-dep-versions.rs:4:18
82
-
|
83
-
4 | use dependency::{Trait, do_something};
84
-
| ----- `Trait` imported here doesn't correspond to the right version of crate `dependency`"#)
85
-
.assert_stderr_contains(
86
-
r#"
87
-
6 | pub struct OtherType;
88
-
| -------------------- this type doesn't implement the required trait"#);
22
+
.stderr_utf8();
23
+
24
+
// We don't remap all the paths, so we remap it here.
0 commit comments