Skip to content

Type parameters should be distinguished from lifetime variables in pretty printer #5313

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
lifthrasiir opened this issue Mar 11, 2013 · 5 comments
Labels
A-lifetimes Area: Lifetimes / regions A-pretty Area: Pretty printing (including `-Z unpretty`)

Comments

@lifthrasiir
Copy link
Contributor

Type parameters (ty_param) are currently pretty-printed as 'a or 'a:foo, where the former is same as new syntax for lifetime variables (#4846, not reflected to pp yet) and confusing enough.

@catamorphism
Copy link
Contributor

Not critical for 0.7, IMO. De-milestoning; nominating for milestone 2 (backwards compatible).

@catamorphism
Copy link
Contributor

(bug triage) Seems like the right milestone. Still open.

@huonw
Copy link
Member

huonw commented Sep 30, 2013

Triage: assuming I'm interpreting the bug correct, this appears to be fixed, e.g.

fn foo<'a, T>(a: &'a int, _: T) -> &'a int {
    a
}
struct Foo<'self, T> {
    bar: &'self T
}
impl<'self, T> Foo<'self, T> {
    fn new<'a>(a: &'a T) -> Foo<'a, T> {
        Foo { bar: a }
    }
}
fn main() {}

run through rustc --pretty normal becomes

fn foo<'a, T>(a: &'a int, _: T) -> &'a int { a }
struct Foo<'self, T> {
    bar: &'self T,
}
impl <'self, T> Foo<'self, T> {
    fn new<'a>(a: &'a T) -> Foo<'a, T> { Foo{bar: a,} }
}
fn main() { }

Is this what this bug is about?

@lifthrasiir
Copy link
Contributor Author

@huonw No, it refers a pretty-printed representation of ty_param in the compiler messages (which was occasionally shown up in pretty-printed types, e.g. Foo<'a> instead of Foo<<V#>>). I almost forgot about this bug, but looking at the history of librustc/util/ppaux.rs this bug seems to be got fixed in 4412df2, so feel free to close this bug.

@catamorphism
Copy link
Contributor

As per lifthrasiir, closing

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-lifetimes Area: Lifetimes / regions A-pretty Area: Pretty printing (including `-Z unpretty`)
Projects
None yet
Development

No branches or pull requests

3 participants