Skip to content

HIR pretty-printer does not print lifetimes in types #85089

Closed
@camelid

Description

@camelid

Code

trait A<'x> {}
trait B<'x> {}

struct Foo<'b> {
    pub bar: &'b dyn for<'a> A<'a>,
}

impl<'a> B<'a> for dyn for<'b> A<'b> {}

impl<'a> A<'a> for Foo<'a> {}

Output

(From the Playground.)

#[prelude_import]
use std::prelude::rust_2018::*;
#[macro_use]
extern crate std;
trait A<'x> { }
trait B<'x> { }

struct Foo<'b> {
    pub bar: &'b dyn for<'a> A,
}

impl <'a> B for dyn for<'b> A { }

impl <'a> A for Foo { }

Note that the uses of A, B, and Foo don't include their lifetimes.

Metadata

Metadata

Assignees

Labels

A-HIRArea: The high-level intermediate representation (HIR)A-prettyArea: Pretty printing (including `-Z unpretty`)C-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions