Skip to content

new() for Vec<T> requires type information #2049

@mohammadfawaz

Description

@mohammadfawaz

Currently, we need to write:

let vector = ~Vec::new::<u8>();

The type annotation u8 has to be supplied to new(). The following, however, doesn't work:

let vector: Vec<u8> = ~Vec::new();

The second syntax is a bit more intuitive to users and should probably work.

Metadata

Metadata

Assignees

Labels

P: criticalShould be looked at before anything elsebugSomething isn't workingcompiler: frontendEverything to do with type checking, control flow analysis, and everything between parsing and IRgenenhancementNew feature or requestteam:compilerCompiler Team

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions