Rewrite rmeta-rpass test to work with the new check for all crate sources being in sync
This commit is contained in:
parent
52853c2694
commit
aa98c5d14e
16
tests/run-make/rmeta-preferred/Makefile
Normal file
16
tests/run-make/rmeta-preferred/Makefile
Normal file
@ -0,0 +1,16 @@
|
||||
# ignore-cross-compile
|
||||
include ../tools.mk
|
||||
|
||||
# Test that using rlibs and rmeta dep crates work together. Specifically, that
|
||||
# there can be both an rmeta and an rlib file and rustc will prefer the rmeta
|
||||
# file.
|
||||
#
|
||||
# This behavior is simply making sure this doesn't accidentally change; in this
|
||||
# case we want to make sure that the rlib isn't being used as that would cause
|
||||
# bugs in -Zbinary-dep-depinfo (see #68298).
|
||||
|
||||
all:
|
||||
$(RUSTC) rmeta_aux.rs --crate-type=rlib --emit link,metadata
|
||||
$(RUSTC) lib.rs --crate-type=rlib --emit dep-info -Zbinary-dep-depinfo
|
||||
$(CGREP) "librmeta_aux.rmeta" < $(TMPDIR)/lib.d
|
||||
$(CGREP) -v "librmeta_aux.rlib" < $(TMPDIR)/lib.d
|
@ -1,4 +1,3 @@
|
||||
// run-pass
|
||||
// Test that using rlibs and rmeta dep crates work together. Specifically, that
|
||||
// there can be both an rmeta and an rlib file and rustc will prefer the rmeta
|
||||
// file.
|
||||
@ -7,12 +6,9 @@
|
||||
// case we want to make sure that the rlib isn't being used as that would cause
|
||||
// bugs in -Zbinary-dep-depinfo (see #68298).
|
||||
|
||||
// aux-build:rmeta-rmeta.rs
|
||||
// aux-build:rmeta-rlib-rpass.rs
|
||||
|
||||
extern crate rmeta_aux;
|
||||
use rmeta_aux::Foo;
|
||||
|
||||
pub fn main() {
|
||||
let _ = Foo { field2: 42 };
|
||||
pub fn foo() {
|
||||
let _ = Foo { field: 42 };
|
||||
}
|
3
tests/run-make/rmeta-preferred/rmeta_aux.rs
Normal file
3
tests/run-make/rmeta-preferred/rmeta_aux.rs
Normal file
@ -0,0 +1,3 @@
|
||||
pub struct Foo {
|
||||
pub field: i32,
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
// no-prefer-dynamic
|
||||
|
||||
#![crate_type="rlib"]
|
||||
#![crate_name="rmeta_aux"]
|
||||
|
||||
pub struct Foo {
|
||||
pub field: i32,
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
// no-prefer-dynamic
|
||||
// compile-flags: --emit=metadata
|
||||
|
||||
#![crate_type="rlib"]
|
||||
#![crate_name="rmeta_aux"]
|
||||
|
||||
pub struct Foo {
|
||||
pub field2: i32,
|
||||
}
|
Loading…
Reference in New Issue
Block a user