summaryrefslogtreecommitdiffstats
path: root/tests/ui/typeck/bad-type-in-vec-push.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/typeck/bad-type-in-vec-push.stderr')
-rw-r--r--tests/ui/typeck/bad-type-in-vec-push.stderr29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/ui/typeck/bad-type-in-vec-push.stderr b/tests/ui/typeck/bad-type-in-vec-push.stderr
new file mode 100644
index 000000000..ae46050c9
--- /dev/null
+++ b/tests/ui/typeck/bad-type-in-vec-push.stderr
@@ -0,0 +1,29 @@
+error[E0308]: mismatched types
+ --> $DIR/bad-type-in-vec-push.rs:11:17
+ |
+LL | vector.sort();
+ | ------ here the type of `vector` is inferred to be `Vec<_>`
+LL | result.push(vector);
+ | ---- ^^^^^^ expected integer, found `Vec<_>`
+ | |
+ | arguments to this method are incorrect
+ |
+ = note: expected type `{integer}`
+ found struct `Vec<_>`
+note: method defined here
+ --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
+
+error[E0308]: mismatched types
+ --> $DIR/bad-type-in-vec-push.rs:18:12
+ |
+LL | x.push("");
+ | ---- ^^ expected integer, found `&str`
+ | |
+ | arguments to this method are incorrect
+ |
+note: method defined here
+ --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0308`.