2020-07-02 01:17:39 -05:00
|
|
|
// run-rustfix
|
|
|
|
|
2019-12-08 05:19:53 -06:00
|
|
|
// In this regression test for #67146, we check that the
|
|
|
|
// negative outlives bound `!'a` is rejected by the parser.
|
|
|
|
// This regression was first introduced in PR #57364.
|
|
|
|
|
|
|
|
fn main() {}
|
|
|
|
|
2020-07-02 01:17:39 -05:00
|
|
|
pub fn f1<T: !'static>() {}
|
2019-12-08 05:19:53 -06:00
|
|
|
//~^ ERROR negative bounds are not supported
|
2023-04-25 00:15:50 -05:00
|
|
|
//~| ERROR `!` may only modify trait bounds, not lifetime bound
|
2020-07-02 01:17:39 -05:00
|
|
|
pub fn f2<'a, T: Ord + !'a>() {}
|
2019-12-08 05:19:53 -06:00
|
|
|
//~^ ERROR negative bounds are not supported
|
2023-04-25 00:15:50 -05:00
|
|
|
//~| ERROR `!` may only modify trait bounds, not lifetime bound
|
2020-07-02 01:17:39 -05:00
|
|
|
pub fn f3<'a, T: !'a + Ord>() {}
|
2019-12-08 05:19:53 -06:00
|
|
|
//~^ ERROR negative bounds are not supported
|
2023-04-25 00:15:50 -05:00
|
|
|
//~| ERROR `!` may only modify trait bounds, not lifetime bound
|