Skip to content

Commit f8ffa47

Browse files
authored
Rollup merge of #139778 - reddevilmidzy:add-success-test, r=lcnr
Add test for issue 34834 closes: #34834 This PR adds a UI test for a case where a trait with an associated type using a higher-ranked trait bound (HRTB) failed to compile in Rust 1.55.0 but succeeded starting from 1.56.0. ```rust pub trait Provides<'a> { type Item; } pub trait Selector: for<'a> Provides<'a> { type Namespace: PartialEq + for<'a> PartialEq<<Self as Provides<'a>>::Item>; fn get_namespace(&self) -> <Self as Provides>::Item; } pub struct MySelector; impl<'a> Provides<'a> for MySelector { type Item = &'a str; } impl Selector for MySelector { type Namespace = String; fn get_namespace(&self) -> &str { unimplemented!() } } fn main() {} ``` * ❌ [compile fail (rustc: 1.55.0)](https://godbolt.org/z/T1jY1Ebo6) * ⭕ [compile pass (rustc: 1.56.0)](https://godbolt.org/z/e4jo11Ma7)
2 parents 87e639e + baed859 commit f8ffa47

File tree

0 file changed

+0
-0
lines changed

    0 file changed

    +0
    -0
    lines changed

    0 commit comments

    Comments
     (0)