Skip to content

Commit

Permalink
Add test for showing rmeta candidates in error
Browse files Browse the repository at this point in the history
  • Loading branch information
camelid committed Oct 6, 2021
1 parent 2219e0b commit 62f4cc9
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/test/ui/crate-loading/auxiliary/crateresolve2-1.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// compile-flags:-C extra-filename=-1 --emit=metadata
#![crate_name = "crateresolve2"]
#![crate_type = "lib"]

pub fn f() -> isize { 10 }
5 changes: 5 additions & 0 deletions src/test/ui/crate-loading/auxiliary/crateresolve2-2.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// compile-flags:-C extra-filename=-2 --emit=metadata
#![crate_name = "crateresolve2"]
#![crate_type = "lib"]

pub fn f() -> isize { 20 }
5 changes: 5 additions & 0 deletions src/test/ui/crate-loading/auxiliary/crateresolve2-3.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// compile-flags:-C extra-filename=-3 --emit=metadata
#![crate_name = "crateresolve2"]
#![crate_type = "lib"]

pub fn f() -> isize { 30 }
11 changes: 11 additions & 0 deletions src/test/ui/crate-loading/crateresolve2.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// check-fail

// aux-build:crateresolve2-1.rs
// aux-build:crateresolve2-2.rs
// aux-build:crateresolve2-3.rs

extern crate crateresolve2;
//~^ ERROR multiple matching crates for `crateresolve2`

fn main() {
}
10 changes: 10 additions & 0 deletions src/test/ui/crate-loading/crateresolve2.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
error[E0464]: multiple matching crates for `crateresolve2`
--> $DIR/crateresolve2.rs:7:1
|
LL | extern crate crateresolve2;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: candidates:

error: aborting due to previous error

0 comments on commit 62f4cc9

Please sign in to comment.