This website requires JavaScript.
Explore
Help
Sign in
bjoernager
/
rust
Watch
1
Fork
You've already forked rust
0
Code
Issues
Pull requests
Activity
e96bb6ae1c
rust
/
tests
/
ui
/
array-slice-vec
/
vector-no-ann.rs
5 lines
80 B
Rust
Raw
Normal View
History
Unescape
Escape
Stop inferring bot/static when types/regions are unconstrained. Also, some other changes that came up along the way: - add a 'blk' region for the current block. - detect unused type/region variables.
2012-04-30 10:37:58 -07:00
fn
main
(
)
{
test: Update expected compile-fail message for E0282
2015-05-05 18:22:20 +02:00
let
_foo
=
Vec
::
new
(
)
;
Add more detail to type inference error When encountering code where type inference fails, add more actionable information: ``` fn main() { let foo = Vec::new(); } ``` ``` error[E0282]: type annotations needed for `std::vec::Vec<_>` --> $DIR/vector-no-ann.rs:2:16 | LL | let foo = Vec::new(); | --- ^^^^^^^^ cannot infer type for `T` | | | consider giving `foo` the type `std::vec::Vec<_>` with the type parameter `T` specified ``` We still need to modify type printing to optionally accept a `TypeVariableTable` in order to properly print `std::vec::Vec<T>`. CC #25633.
2019-05-30 10:19:58 -07:00
//~^ ERROR type annotations needed
Stop inferring bot/static when types/regions are unconstrained. Also, some other changes that came up along the way: - add a 'blk' region for the current block. - detect unused type/region variables.
2012-04-30 10:37:58 -07:00
}
Reference in a new issue
Copy permalink