|
2 | 2 | // revisions: success failure
|
3 | 3 | //[success] check-pass
|
4 | 4 |
|
5 |
| -#![feature(return_position_impl_trait_in_trait)] |
| 5 | +#![feature(return_position_impl_trait_in_trait, lint_reasons)] |
6 | 6 |
|
7 | 7 | use std::future::Future;
|
8 | 8 |
|
9 |
| -trait Captures<'a> {} |
| 9 | +pub trait Captures<'a> {} |
10 | 10 | impl<T> Captures<'_> for T {}
|
11 | 11 |
|
12 |
| -trait Captures2<'a, 'b> {} |
| 12 | +pub trait Captures2<'a, 'b> {} |
13 | 13 | impl<T> Captures2<'_, '_> for T {}
|
14 | 14 |
|
15 |
| -trait AsyncTrait { |
| 15 | +pub trait AsyncTrait { |
16 | 16 | #[cfg(success)]
|
17 | 17 | fn async_fn(&self, buff: &[u8]) -> impl Future<Output = Vec<u8>>;
|
18 | 18 |
|
@@ -44,23 +44,23 @@ impl AsyncTrait for Struct {
|
44 | 44 | // Does not capture more lifetimes that trait def'n, since trait def'n
|
45 | 45 | // implicitly captures all in-scope lifetimes.
|
46 | 46 | #[cfg(success)]
|
47 |
| - #[allow(refining_impl_trait)] |
| 47 | + #[expect(refining_impl_trait)] |
48 | 48 | fn async_fn<'a>(&self, buff: &'a [u8]) -> impl Future<Output = Vec<u8>> + 'a {
|
49 | 49 | async move { buff.to_vec() }
|
50 | 50 | }
|
51 | 51 |
|
52 | 52 | // Does not capture more lifetimes that trait def'n, since trait def'n
|
53 | 53 | // implicitly captures all in-scope lifetimes.
|
54 | 54 | #[cfg(success)]
|
55 |
| - #[allow(refining_impl_trait)] |
| 55 | + #[expect(refining_impl_trait)] |
56 | 56 | fn async_fn_early<'a: 'a>(&self, buff: &'a [u8]) -> impl Future<Output = Vec<u8>> + 'a {
|
57 | 57 | async move { buff.to_vec() }
|
58 | 58 | }
|
59 | 59 |
|
60 | 60 | // Does not capture more lifetimes that trait def'n, since trait def'n
|
61 | 61 | // implicitly captures all in-scope lifetimes.
|
62 | 62 | #[cfg(success)]
|
63 |
| - #[allow(refining_impl_trait)] |
| 63 | + #[expect(refining_impl_trait)] |
64 | 64 | fn async_fn_multiple<'a, 'b>(
|
65 | 65 | &'a self,
|
66 | 66 | buff: &'b [u8],
|
|
0 commit comments