about summary refs log tree commit diff
path: root/src/test/ui
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2022-02-27 16:09:52 +0100
committerCamille GILLOT <gillot.camille@gmail.com>2022-02-27 19:05:56 +0100
commite77e4fcf898ca4b2aa2041d2cbac200ed0f11b5b (patch)
tree9994c3a36e798d935142a9dbee2c84c872be4b0c /src/test/ui
parent6cbc6c35e4b0c948114619a1c883a75b731d32c5 (diff)
downloadrust-e77e4fcf898ca4b2aa2041d2cbac200ed0f11b5b.tar.gz
rust-e77e4fcf898ca4b2aa2041d2cbac200ed0f11b5b.zip
Only create a single expansion for each inline integration.
Diffstat (limited to 'src/test/ui')
-rw-r--r--src/test/ui/const_prop/inline_spans.rs6
-rw-r--r--src/test/ui/const_prop/inline_spans.stderr6
2 files changed, 8 insertions, 4 deletions
diff --git a/src/test/ui/const_prop/inline_spans.rs b/src/test/ui/const_prop/inline_spans.rs
index adc7874104a..f1cfcfee557 100644
--- a/src/test/ui/const_prop/inline_spans.rs
+++ b/src/test/ui/const_prop/inline_spans.rs
@@ -5,10 +5,14 @@
 
 fn main() {
     let _ = add(u8::MAX, 1);
-    //~^ ERROR this arithmetic operation will overflow
+    //~^ NOTE in this expansion of inlined source
+    //~| NOTE in this expansion of inlined source
 }
 
 #[inline(always)]
 fn add(x: u8, y: u8) -> u8 {
     x + y
+    //~^ ERROR this arithmetic operation will overflow
+    //~| NOTE attempt to compute `u8::MAX + 1_u8`, which would overflow
+    //~| NOTE `#[deny(arithmetic_overflow)]` on by default
 }
diff --git a/src/test/ui/const_prop/inline_spans.stderr b/src/test/ui/const_prop/inline_spans.stderr
index 5a54967e0d0..f99a3142386 100644
--- a/src/test/ui/const_prop/inline_spans.stderr
+++ b/src/test/ui/const_prop/inline_spans.stderr
@@ -1,11 +1,11 @@
 error: this arithmetic operation will overflow
-  --> $DIR/inline_spans.rs:7:13
+  --> $DIR/inline_spans.rs:14:5
    |
 LL |     let _ = add(u8::MAX, 1);
-   |             ^^^^^^^^^^^^^^^ attempt to compute `u8::MAX + 1_u8`, which would overflow
+   |             --------------- in this inlined function call
 ...
 LL |     x + y
-   |     ----- in the inlined copy of this code
+   |     ^^^^^ attempt to compute `u8::MAX + 1_u8`, which would overflow
    |
    = note: `#[deny(arithmetic_overflow)]` on by default