Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

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

Closed
camelid opened this issue May 8, 2021 · 1 comment · Fixed by #103080
Closed

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

camelid opened this issue May 8, 2021 · 1 comment · Fixed by #103080
Assignees
Labels
A-hir Area: The high-level intermediate representation (HIR) A-pretty Area: Pretty printing. C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@camelid
Copy link
Member

camelid commented May 8, 2021

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.

@camelid camelid added A-pretty Area: Pretty printing. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-hir Area: The high-level intermediate representation (HIR) C-bug Category: This is a bug. labels May 8, 2021
@ohno418
Copy link
Contributor

ohno418 commented Oct 15, 2022

@rustbot claim

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Oct 15, 2022
…imes, r=cjgillot

pretty: fix to print some lifetimes on HIR pretty-print

HIR pretty-printer doesn't seem to print some lifetimes in types. This PR fixes that.

Closes rust-lang#85089
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Oct 15, 2022
…imes, r=cjgillot

pretty: fix to print some lifetimes on HIR pretty-print

HIR pretty-printer doesn't seem to print some lifetimes in types. This PR fixes that.

Closes rust-lang#85089
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Oct 15, 2022
…imes, r=cjgillot

pretty: fix to print some lifetimes on HIR pretty-print

HIR pretty-printer doesn't seem to print some lifetimes in types. This PR fixes that.

Closes rust-lang#85089
@bors bors closed this as completed in d08f4a6 Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-hir Area: The high-level intermediate representation (HIR) A-pretty Area: Pretty printing. C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants