-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
47 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#![crate_name = "dependency"] | ||
#![crate_type = "rlib"] | ||
pub struct Type; | ||
pub trait Trait {} | ||
impl Trait for Type {} | ||
pub fn do_something<X: Trait>(_: X) {} |
5 changes: 2 additions & 3 deletions
5
...ding/auxiliary/multiple-dep-versions-2.rs → .../crate-loading/multiple-dep-versions-2.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
extern crate dep_2_reexport; | ||
extern crate dependency; | ||
use dep_2_reexport::do_something; | ||
use dependency::Type; | ||
|
||
fn main() { | ||
do_something(Type); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
//@ only-linux | ||
//@ ignore-wasm32 | ||
//@ ignore-wasm64 | ||
|
||
use run_make_support::rfs::copy; | ||
use run_make_support::{assert_contains, rust_lib_name, rustc}; | ||
|
||
fn main() { | ||
rustc().input("multiple-dep-versions-1.rs").run(); | ||
rustc().input("multiple-dep-versions-2.rs").extra_filename("2").metadata("2").run(); | ||
|
||
let out = rustc() | ||
.input("multiple-dep-versions.rs") | ||
.extern_("dependency", rust_lib_name("dependency")) | ||
.extern_("dep_2_reexport", rust_lib_name("dependency2")) | ||
.inspect(|cmd| eprintln!("{cmd:?}")) | ||
.run_fail(); | ||
let stderr = out.stderr_utf8(); | ||
assert_contains( | ||
&stderr, | ||
"you have multiple different versions of crate `dependency` in your dependency graph", | ||
); | ||
assert_contains( | ||
&stderr, | ||
"two types coming from two different versions of the same crate are different types even \ | ||
if they look the same", | ||
); | ||
assert_contains(&stderr, "this type doesn't implement the required trait"); | ||
assert_contains(&stderr, "this type implements the required trait"); | ||
assert_contains(&stderr, "this is the required trait"); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.