rust/tests/ui/impl-trait/precise-capturing/overcaptures-2024-but-fine.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
329 B
Rust
Raw Normal View History

//@ 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() {}