about summary refs log tree commit diff
path: root/tests/ui/generics
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2024-02-01 22:45:00 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2024-02-08 08:10:43 +0000
commiteab2adb6607d94fd0c70de93abf546ae9282afaa (patch)
treedb09af54e3ca25180b67a09018fe4ac604a3c98a /tests/ui/generics
parente5461de39287fcec2179bb7051f65d987cdff270 (diff)
downloadrust-eab2adb6607d94fd0c70de93abf546ae9282afaa.tar.gz
rust-eab2adb6607d94fd0c70de93abf546ae9282afaa.zip
Continue to borrowck even if there were previous errors
Diffstat (limited to 'tests/ui/generics')
-rw-r--r--tests/ui/generics/generic-extern.rs2
-rw-r--r--tests/ui/generics/generic-extern.stderr13
2 files changed, 12 insertions, 3 deletions
diff --git a/tests/ui/generics/generic-extern.rs b/tests/ui/generics/generic-extern.rs
index 3690d6fd07d..36fa5eaafd6 100644
--- a/tests/ui/generics/generic-extern.rs
+++ b/tests/ui/generics/generic-extern.rs
@@ -3,5 +3,5 @@ extern "C" {
 }
 
 fn main() {
-    foo::<i32>();
+    foo::<i32>(); //~ ERROR requires unsafe
 }
diff --git a/tests/ui/generics/generic-extern.stderr b/tests/ui/generics/generic-extern.stderr
index 4d9f6fedef1..a3f28825316 100644
--- a/tests/ui/generics/generic-extern.stderr
+++ b/tests/ui/generics/generic-extern.stderr
@@ -6,6 +6,15 @@ LL |     fn foo<T>();
    |
    = help: replace the type parameters with concrete types like `u32`
 
-error: aborting due to 1 previous error
+error[E0133]: call to unsafe function `foo` is unsafe and requires unsafe function or block
+  --> $DIR/generic-extern.rs:6:5
+   |
+LL |     foo::<i32>();
+   |     ^^^^^^^^^^^^ call to unsafe function
+   |
+   = note: consult the function's documentation for information on how to avoid undefined behavior
+
+error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0044`.
+Some errors have detailed explanations: E0044, E0133.
+For more information about an error, try `rustc --explain E0044`.