nightly feature tracking: get rid of the per-feature bool fields
This commit is contained in:
parent
e1f3068995
commit
ad3991d303
108 changed files with 299 additions and 331 deletions
|
@ -95,7 +95,7 @@ impl<'tcx> LateLintPass<'tcx> for AsyncFnInTrait {
|
|||
&& let hir::IsAsync::Async(async_span) = sig.header.asyncness
|
||||
{
|
||||
// RTN can be used to bound `async fn` in traits in a better way than "always"
|
||||
if cx.tcx.features().return_type_notation {
|
||||
if cx.tcx.features().return_type_notation() {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -1235,7 +1235,7 @@ impl<'tcx> LateLintPass<'tcx> for UngatedAsyncFnTrackCaller {
|
|||
def_id: LocalDefId,
|
||||
) {
|
||||
if fn_kind.asyncness().is_async()
|
||||
&& !cx.tcx.features().async_fn_track_caller
|
||||
&& !cx.tcx.features().async_fn_track_caller()
|
||||
// Now, check if the function has the `#[track_caller]` attribute
|
||||
&& let Some(attr) = cx.tcx.get_attr(def_id, sym::track_caller)
|
||||
{
|
||||
|
@ -1424,7 +1424,7 @@ impl<'tcx> LateLintPass<'tcx> for TypeAliasBounds {
|
|||
// See also `tests/ui/const-generics/generic_const_exprs/type-alias-bounds.rs`.
|
||||
let ty = cx.tcx.type_of(item.owner_id).instantiate_identity();
|
||||
if ty.has_type_flags(ty::TypeFlags::HAS_CT_PROJECTION)
|
||||
&& cx.tcx.features().generic_const_exprs
|
||||
&& cx.tcx.features().generic_const_exprs()
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -1538,7 +1538,7 @@ impl<'tcx> LateLintPass<'tcx> for TrivialConstraints {
|
|||
fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::Item<'tcx>) {
|
||||
use rustc_middle::ty::ClauseKind;
|
||||
|
||||
if cx.tcx.features().trivial_bounds {
|
||||
if cx.tcx.features().trivial_bounds() {
|
||||
let predicates = cx.tcx.predicates_of(item.owner_id);
|
||||
for &(predicate, span) in predicates.predicates {
|
||||
let predicate_kind_name = match predicate.kind().skip_binder() {
|
||||
|
|
|
@ -243,7 +243,7 @@ impl_lint_pass!(
|
|||
|
||||
impl<'tcx> LateLintPass<'tcx> for IfLetRescope {
|
||||
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'tcx>) {
|
||||
if expr.span.edition().at_least_rust_2024() || !cx.tcx.features().if_let_rescope {
|
||||
if expr.span.edition().at_least_rust_2024() || !cx.tcx.features().if_let_rescope() {
|
||||
return;
|
||||
}
|
||||
if let (Level::Allow, _) = cx.tcx.lint_level_at_node(IF_LET_RESCOPE, expr.hir_id) {
|
||||
|
|
|
@ -263,8 +263,8 @@ where
|
|||
&& parent == self.parent_def_id
|
||||
{
|
||||
let opaque_span = self.tcx.def_span(opaque_def_id);
|
||||
let new_capture_rules =
|
||||
opaque_span.at_least_rust_2024() || self.tcx.features().lifetime_capture_rules_2024;
|
||||
let new_capture_rules = opaque_span.at_least_rust_2024()
|
||||
|| self.tcx.features().lifetime_capture_rules_2024();
|
||||
if !new_capture_rules
|
||||
&& !opaque.bounds.iter().any(|bound| matches!(bound, hir::GenericBound::Use(..)))
|
||||
{
|
||||
|
|
|
@ -137,7 +137,7 @@ impl<'tcx> LateLintPass<'tcx> for TailExprDropOrder {
|
|||
_: Span,
|
||||
def_id: rustc_span::def_id::LocalDefId,
|
||||
) {
|
||||
if cx.tcx.sess.at_least_rust_2024() && cx.tcx.features().shorter_tail_lifetimes {
|
||||
if cx.tcx.sess.at_least_rust_2024() && cx.tcx.features().shorter_tail_lifetimes() {
|
||||
Self::check_fn_or_closure(cx, fn_kind, body, def_id);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue