Skip to content

Commit 4b676bd

Browse files
committed
rdr: add incremental test exercising rustc_public_hash_changed and rustc_public_hash_unchanged attributes
1 parent 08e9b32 commit 4b676bd

2 files changed

Lines changed: 31 additions & 0 deletions

File tree

  • tests/incremental/rdr/public_api_hash_attributes
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//@ [cpass_public_hash1]compile-flags: -Zpublic-api-hash
2+
//@ [cpass_public_hash2]compile-flags: -Zpublic-api-hash
3+
//@ [cpass_public_hash3]compile-flags: -Zpublic-api-hash
4+
5+
#![crate_name = "dep"]
6+
#![crate_type = "rlib"]
7+
8+
#[cfg(any(cpass1, cpass2))]
9+
pub fn generic<T: std::fmt::Debug>(v: T) {
10+
panic!("{v:?}");
11+
}
12+
13+
#[cfg(any(cpass3))]
14+
pub fn generic<T: std::fmt::Debug>(v: T) {
15+
panic!("{v:?}");
16+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//@ revisions: cpass1 cpass2 cpass3
2+
//@ compile-flags: -Z query-dep-graph -Z public-api-hash
3+
//@ aux-build: dep.rs
4+
//@ ignore-backends: gcc
5+
6+
#![feature(rustc_attrs)]
7+
#![crate_type = "bin"]
8+
#![rustc_public_hash_unchanged(crate_name = "dep", cfg = "cpass2")]
9+
#![rustc_public_hash_changed(crate_name = "dep", cfg = "cpass3")]
10+
11+
extern crate dep;
12+
13+
fn main() {
14+
dep::generic::<u32>(1);
15+
}

0 commit comments

Comments
 (0)