Stream: t-compiler/rust-analyzer

Topic: Vec


matthiaskrgr (Feb 20 2021 at 20:43, on Zulip):

In this code:

fn main() {
    let mut x = Vec::new();
    x.push(3);
}

when I hover xit says Vec<i32, Global>.
What does the Global mean / where is it coming from?

matthiaskrgr (Feb 20 2021 at 20:44, on Zulip):

seems to link to alloc::alloc::Global

Florian Diebold (Feb 20 2021 at 22:38, on Zulip):

Vec now has a second type parameter for the Allocator: https://doc.rust-lang.org/std/vec/struct.Vec.html

Florian Diebold (Feb 20 2021 at 22:40, on Zulip):

see https://github.com/rust-lang/rust/issues/32838

Jonas Schievink [he/him] (Feb 20 2021 at 23:52, on Zulip):

Though, isn't r-a supposed to filter out defaulted type parameters?

Kirill Bulatov (Feb 21 2021 at 06:48, on Zulip):

We do filter them out for hints, but not for hovers, showing "full" type information there.

Last update: Jul 28 2021 at 04:30UTC