about summary refs log tree commit diff
path: root/tests/ui/impl-trait/precise-capturing/overcaptures-2024-but-fine.rs
blob: e30f785b0ae33d323af3491e1227ea9123d95a93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//@ check-pass

#![deny(impl_trait_overcaptures)]

struct Ctxt<'tcx>(&'tcx ());

// In `compute`, we don't care that we're "overcapturing" `'tcx`
// in edition 2024, because it can be shortened at the call site
// and we know it outlives `'_`.

impl<'tcx> Ctxt<'tcx> {
    fn compute(&self) -> impl Sized + '_ {}
}

fn main() {}