summaryrefslogtreecommitdiffstats
path: root/tests/incremental/issue-49595
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
commit218caa410aa38c29984be31a5229b9fa717560ee (patch)
treec54bd55eeb6e4c508940a30e94c0032fbd45d677 /tests/incremental/issue-49595
parentReleasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz
rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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);
+ }
+}