-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.D-confusingDiagnostics: Confusing error or lint that should be reworked.Diagnostics: Confusing error or lint that should be reworked.D-papercutDiagnostics: An error or lint that needs small tweaks.Diagnostics: An error or lint that needs small tweaks.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
I tried this code:
fn test() -> Vec<i64, i64> {
let vals = vec![(1, 2), (3, 4)];
vals.into_iter().collect()
}
I expected to see this happen:
error[E0107]: wrong number of type arguments: expected 1, found 2
--> src/main.rs:1:23
|
1 | fn test() -> Vec<i64, i64> {
| ^^^ unexpected type argument
Instead, this happened:
error[E0658]: use of unstable library feature 'allocator_api'
--> src/main.rs:1:23
|
1 | fn test() -> Vec<i64, i64> {
| ^^^
|
= note: see issue #32838 <https://github.com/rust-lang/rust/issues/32838> for more information
= help: add `#![feature(allocator_api)]` to the crate attributes to enable
This was very confusing to me, took me a while to figure out what the real error was.
Meta
rustc --version --verbose
:
rustc 1.50.0-nightly (1f5bc176b 2020-12-19)
binary: rustc
commit-hash: 1f5bc176b0e54a8e464704adcd7e571700207fe9
commit-date: 2020-12-19
host: x86_64-apple-darwin
release: 1.50.0-nightly
macmv and AaronC81
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.D-confusingDiagnostics: Confusing error or lint that should be reworked.Diagnostics: Confusing error or lint that should be reworked.D-papercutDiagnostics: An error or lint that needs small tweaks.Diagnostics: An error or lint that needs small tweaks.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
rossmacarthur commentedon Dec 20, 2020
@rustbot modify labels: +A-diagnostics +D-confusing +D-papercut +C-enhancement -C-bug
TaKO8Ki commentedon Dec 11, 2021
#90856 has already solved this problem.
paulyoung commentedon Dec 5, 2022
I'm using Rust 1.63.0 (
rustc 1.63.0 (4b91a6ea7 2022-08-08)
) and just ran into this.Here's a minimal example: