Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
58e901b6fd1163172149fd422565523b17eed5f0
rust/tests/ui/array-slice-vec/vector-no-ann.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

5 lines
80 B
Rust
Raw Normal View History

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 New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 5548ms Template: 3ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API