Skip to content

infer outlives doesn't work across crates #51858

Closed
@nikomatsakis

Description

@nikomatsakis

This example fails to compile:

#![feature(infer_outlives_requirements)]

struct Bar<'a, T> {
    f: std::slice::IterMut<'a, T>
}

fn main() { }

however this purely intra-crate example works:

#![feature(infer_outlives_requirements)]

struct Foo<'a, T: 'a> {
    x: &'a T
}

struct Bar<'a, T> {
    f: Foo<'a, T>
}

fn main() { }

cc @toidiu

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-edition-2018Area: The 2018 editionC-enhancementCategory: An issue proposing an enhancement or a PR with one.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.F-rust_2018_preview`#![feature(rust_2018_preview)]`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