This website requires JavaScript.
Explore
Help
Sign In
nordic-dev.net
/
rust
Watch
2
Star
0
Fork
0
You've already forked rust
mirror of
https://github.com/rust-lang/rust.git
synced
2025-04-28 19:17:43 +00:00
Code
Issues
Packages
Projects
Releases
Wiki
Activity
master
rust
/
tests
/
ui
/
array-slice-vec
/
vector-no-ann.rs
5 lines
80 B
Rust
Raw
Permalink
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 17:37:58 +00:00
fn
main
(
)
{
test: Update expected compile-fail message for E0282
2015-05-05 16:22:20 +00: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 17:19:58 +00: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 17:37:58 +00:00
}
Reference in New Issue
Copy Permalink