Skip to content

Commit 806c0e5

Browse files
committed
ui test formulation of regression test for issue 64872.
(Many thanks to alex for 1. making this even smaller than what I had originally minimized, and 2. pointing out that there is precedent for having ui tests with crate dependency chains of length > 2, thus allowing me to avoid encoding this as a run-make test.)
1 parent 8228ccf commit 806c0e5

File tree

4 files changed

+40
-0
lines changed

4 files changed

+40
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// compile-flags: -C debuginfo=2 --crate-type=rlib
2+
3+
extern crate reexport_obj;
4+
use reexport_obj::Object;
5+
6+
pub fn another_dyn_debug() {
7+
let ref u = 1_u32;
8+
let _d = &u as &dyn crate::Object;
9+
_d.method()
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// compile-flags: -C debuginfo=2 --crate-type=rlib
2+
3+
pub trait Object { fn method(&self) { } }
4+
5+
impl Object for u32 { }
6+
impl Object for () { }
7+
impl<T> Object for &T { }
8+
9+
pub fn unused() {
10+
let ref u = 0_u32;
11+
let _d = &u as &dyn crate::Object;
12+
_d.method()
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// compile-flags: -C debuginfo=2 -C prefer-dynamic --crate-type=dylib
2+
3+
extern crate def_obj;
4+
5+
pub use def_obj::Object;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// note that these aux-build directives must be in this order: the later crates
2+
// depend on the earlier ones.
3+
4+
// aux-build:def_obj.rs
5+
// aux-build:rexport_obj.rs
6+
// aux-build:another_vtable_for_obj.rs
7+
8+
extern crate another_vtable_for_obj;
9+
10+
pub fn main() {
11+
another_vtable_for_obj::another_dyn_debug();
12+
}

0 commit comments

Comments
 (0)