Skip to content

Neither require nor imply lifetime bounds on opaque type for well formedness #95474

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

Merged
merged 18 commits into from
Sep 25, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make the test actually show the problematic case
  • Loading branch information
oli-obk committed Sep 23, 2022
commit e9d219e97c9b87e928d131ac071fef96e906c464
29 changes: 19 additions & 10 deletions src/test/ui/type-alias-impl-trait/implied_lifetime_wf_check.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
trait Mirror<'a> {
type Item;
}
#![feature(type_alias_impl_trait)]

// known-bug: #99840
// this should not compile
// check-pass

type Alias = impl Sized;

impl<'a, T> Mirror<'a> for T {
type Item = T;
fn constrain() -> Alias {
1i32
}

trait AnotherTrait {
type Blah;
trait HideIt {
type Assoc;
}

impl<'a> AnotherTrait for <u32 as Mirror<'a>>::Item {
//~^ ERROR: the lifetime parameter `'a` is not constrained
type Blah = &'a u32;
impl HideIt for () {
type Assoc = Alias;
}

pub trait Yay {}

impl Yay for <() as HideIt>::Assoc {}
// impl Yay for i32 {} // this already errors
// impl Yay for u32 {} // this also already errors

fn main() {}

This file was deleted.