diff options
Diffstat (limited to 'src/test/ui/for/for-loop-unconstrained-element-type.stderr')
-rw-r--r-- | src/test/ui/for/for-loop-unconstrained-element-type.stderr | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/ui/for/for-loop-unconstrained-element-type.stderr b/src/test/ui/for/for-loop-unconstrained-element-type.stderr new file mode 100644 index 000000000..b1b38f6b9 --- /dev/null +++ b/src/test/ui/for/for-loop-unconstrained-element-type.stderr @@ -0,0 +1,14 @@ +error[E0282]: type annotations needed + --> $DIR/for-loop-unconstrained-element-type.rs:8:14 + | +LL | for i in Vec::new() { } + | ^^^^^^^^ cannot infer type of the type parameter `T` declared on the struct `Vec` + | +help: consider specifying the generic argument + | +LL | for i in Vec::<T>::new() { } + | +++++ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0282`. |