1
Fork 0

Rollup merge of #101409 - WaffleLapkin:rust_2021_compatibility_no_warn_in_2021_crates, r=TaKO8Ki

Don't fire `rust_2021_incompatible_closure_captures` in `edition = 2021` crates

Fixes #101284
This commit is contained in:
Dylan DPC 2022-09-05 14:15:53 +05:30 committed by GitHub
commit 3a9e2ff3d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 2 deletions

View file

@ -2024,6 +2024,10 @@ fn should_do_rust_2021_incompatible_closure_captures_analysis(
tcx: TyCtxt<'_>,
closure_id: hir::HirId,
) -> bool {
if tcx.sess.rust_2021() {
return false;
}
let (level, _) =
tcx.lint_level_at_node(lint::builtin::RUST_2021_INCOMPATIBLE_CLOSURE_CAPTURES, closure_id);