• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2023 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 // The explicit `extern crate` will catch if a GN target specifies conflicting
6 // dependencies.
7 //
8 // When libraries are included implicitly from the command line, rustc seems to
9 // silently pick the first one that matches. On the other hand with an explicit
10 // "extern crate" directive, which tells rustc to link a dependency no matter
11 // what, rustc will see the conflict.
12 extern crate transitive_dep;
13 
14 pub use foo_dependency::say_foo;
15 pub use foo_dependency::say_foo_directly;
16 pub use transitive_dep::say_something;
17 
18 #[no_mangle]
print_foo_bar()19 pub extern "C" fn print_foo_bar() {
20     println!("{}", foo_dependency::say_foo());
21     println!("{}", transitive_dep::say_something());
22 }
23