about summary refs log tree commit diff
path: root/tests/ui/coercion/coerce-box-new-to-unboxed.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/coercion/coerce-box-new-to-unboxed.stderr')
-rw-r--r--tests/ui/coercion/coerce-box-new-to-unboxed.stderr19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/ui/coercion/coerce-box-new-to-unboxed.stderr b/tests/ui/coercion/coerce-box-new-to-unboxed.stderr
new file mode 100644
index 00000000000..bdd962686e4
--- /dev/null
+++ b/tests/ui/coercion/coerce-box-new-to-unboxed.stderr
@@ -0,0 +1,19 @@
+error[E0308]: mismatched types
+  --> $DIR/coerce-box-new-to-unboxed.rs:2:21
+   |
+LL |     let _: String = Box::new(String::new());
+   |            ------   ^^^^^^^^^^^^^^^^^^^^^^^ expected `String`, found `Box<String>`
+   |            |
+   |            expected due to this
+   |
+   = note: expected struct `String`
+              found struct `Box<String>`
+help: consider removing the Box
+   |
+LL -     let _: String = Box::new(String::new());
+LL +     let _: String = String::new();
+   |
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0308`.