Skip to content

Commit aa98c5d

Browse files
committed
Rewrite rmeta-rpass test to work with the new check for all crate sources being in sync
1 parent 52853c2 commit aa98c5d

File tree

5 files changed

+21
-23
lines changed

5 files changed

+21
-23
lines changed
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# ignore-cross-compile
2+
include ../tools.mk
3+
4+
# Test that using rlibs and rmeta dep crates work together. Specifically, that
5+
# there can be both an rmeta and an rlib file and rustc will prefer the rmeta
6+
# file.
7+
#
8+
# This behavior is simply making sure this doesn't accidentally change; in this
9+
# case we want to make sure that the rlib isn't being used as that would cause
10+
# bugs in -Zbinary-dep-depinfo (see #68298).
11+
12+
all:
13+
$(RUSTC) rmeta_aux.rs --crate-type=rlib --emit link,metadata
14+
$(RUSTC) lib.rs --crate-type=rlib --emit dep-info -Zbinary-dep-depinfo
15+
$(CGREP) "librmeta_aux.rmeta" < $(TMPDIR)/lib.d
16+
$(CGREP) -v "librmeta_aux.rlib" < $(TMPDIR)/lib.d
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// run-pass
21
// Test that using rlibs and rmeta dep crates work together. Specifically, that
32
// there can be both an rmeta and an rlib file and rustc will prefer the rmeta
43
// file.
@@ -7,12 +6,9 @@
76
// case we want to make sure that the rlib isn't being used as that would cause
87
// bugs in -Zbinary-dep-depinfo (see #68298).
98

10-
// aux-build:rmeta-rmeta.rs
11-
// aux-build:rmeta-rlib-rpass.rs
12-
139
extern crate rmeta_aux;
1410
use rmeta_aux::Foo;
1511

16-
pub fn main() {
17-
let _ = Foo { field2: 42 };
12+
pub fn foo() {
13+
let _ = Foo { field: 42 };
1814
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pub struct Foo {
2+
pub field: i32,
3+
}

tests/ui/rmeta/auxiliary/rmeta-rlib-rpass.rs

-8
This file was deleted.

tests/ui/rmeta/auxiliary/rmeta-rmeta.rs

-9
This file was deleted.

0 commit comments

Comments
 (0)