Add test for showing rmeta candidates in error

This commit is contained in:
Noah Lev 2021-10-05 20:40:24 -07:00
parent 642a43a9cd
commit ad49cb6e0c
5 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,5 @@
// compile-flags:-C extra-filename=-1 --emit=metadata
#![crate_name = "crateresolve2"]
#![crate_type = "lib"]
pub fn f() -> isize { 10 }

View File

@ -0,0 +1,5 @@
// compile-flags:-C extra-filename=-2 --emit=metadata
#![crate_name = "crateresolve2"]
#![crate_type = "lib"]
pub fn f() -> isize { 20 }

View File

@ -0,0 +1,5 @@
// compile-flags:-C extra-filename=-3 --emit=metadata
#![crate_name = "crateresolve2"]
#![crate_type = "lib"]
pub fn f() -> isize { 30 }

View File

@ -0,0 +1,14 @@
// check-fail
// aux-build:crateresolve2-1.rs
// aux-build:crateresolve2-2.rs
// aux-build:crateresolve2-3.rs
// normalize-stderr-test: "\.nll/" -> "/"
// normalize-stderr-test: "\\\?\\" -> ""
extern crate crateresolve2;
//~^ ERROR multiple matching crates for `crateresolve2`
fn main() {
}

View File

@ -0,0 +1,10 @@
error[E0464]: multiple matching crates for `crateresolve2`
--> $DIR/crateresolve2.rs:10:1
|
LL | extern crate crateresolve2;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: candidates:
error: aborting due to previous error