summaryrefslogtreecommitdiffstats
path: root/tests/incremental/issue-49595
diff options
context:
space:
mode:
Diffstat (limited to 'tests/incremental/issue-49595')
-rw-r--r--tests/incremental/issue-49595/auxiliary/lit_a.rs1
-rw-r--r--tests/incremental/issue-49595/auxiliary/lit_b.rs1
-rw-r--r--tests/incremental/issue-49595/issue-49595.rs31
3 files changed, 33 insertions, 0 deletions
diff --git a/tests/incremental/issue-49595/auxiliary/lit_a.rs b/tests/incremental/issue-49595/auxiliary/lit_a.rs
new file mode 100644
index 000000000..295a0b481
--- /dev/null
+++ b/tests/incremental/issue-49595/auxiliary/lit_a.rs
@@ -0,0 +1 @@
+pub const A: &str = "hello";
diff --git a/tests/incremental/issue-49595/auxiliary/lit_b.rs b/tests/incremental/issue-49595/auxiliary/lit_b.rs
new file mode 100644
index 000000000..5d377edfb
--- /dev/null
+++ b/tests/incremental/issue-49595/auxiliary/lit_b.rs
@@ -0,0 +1 @@
+pub const A: &str = "xxxxx";
diff --git a/tests/incremental/issue-49595/issue-49595.rs b/tests/incremental/issue-49595/issue-49595.rs
new file mode 100644
index 000000000..7b1096a64
--- /dev/null
+++ b/tests/incremental/issue-49595/issue-49595.rs
@@ -0,0 +1,31 @@
+// revisions:cfail1 cfail2 cfail3
+// compile-flags: -Z query-dep-graph --test
+// build-pass
+
+#![feature(rustc_attrs)]
+#![crate_type = "rlib"]
+
+#![rustc_partition_codegened(module="issue_49595-tests", cfg="cfail2")]
+#![rustc_partition_codegened(module="issue_49595-lit_test", cfg="cfail3")]
+
+mod tests {
+ #[cfg_attr(not(cfail1), test)]
+ fn test() {
+ }
+}
+
+
+// Checks that changing a string literal without changing its span
+// takes effect.
+
+// replacing a module to have a stable span
+#[cfg_attr(not(cfail3), path = "auxiliary/lit_a.rs")]
+#[cfg_attr(cfail3, path = "auxiliary/lit_b.rs")]
+mod lit;
+
+pub mod lit_test {
+ #[test]
+ fn lit_test() {
+ println!("{}", ::lit::A);
+ }
+}