]> git.lizzy.rs Git - rust.git/blob - src/test/run-make-fulldeps/type-mismatch-same-crate-name/crateC.rs
Rollup merge of #95194 - kckeiks:update-algo-in-find-use-placement, r=pnkfelix
[rust.git] / src / test / run-make-fulldeps / type-mismatch-same-crate-name / crateC.rs
1 // This tests the extra note reported when a type error deals with
2 // seemingly identical types.
3 // The main use case of this error is when there are two crates
4 // (generally different versions of the same crate) with the same name
5 // causing a type mismatch.
6
7 // The test is nearly the same as the one in
8 // ui/type/type-mismatch-same-crate-name.rs
9 // but deals with the case where one of the crates
10 // is only introduced as an indirect dependency.
11 // and the type is accessed via a re-export.
12 // This is similar to how the error can be introduced
13 // when using cargo's automatic dependency resolution.
14
15 extern crate crateA;
16
17 fn main() {
18     let foo2 = crateA::Foo;
19     let bar2 = crateA::bar();
20     {
21         extern crate crateB;
22         crateB::try_foo(foo2);
23         crateB::try_bar(bar2);
24     }
25 }