1
Fork 0

nightly feature tracking: get rid of the per-feature bool fields

This commit is contained in:
Ralf Jung 2024-10-09 09:01:57 +02:00
parent e1f3068995
commit ad3991d303
108 changed files with 299 additions and 331 deletions

View file

@ -163,7 +163,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
let tcx = this.tcx;
if tcx.features().unsized_fn_params {
if tcx.features().unsized_fn_params() {
let ty = expr.ty;
let param_env = this.param_env;

View file

@ -149,7 +149,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
if let ty::Adt(def, _) = ty.kind()
&& tcx.is_lang_item(def.did(), LangItem::String)
{
if !tcx.features().string_deref_patterns {
if !tcx.features().string_deref_patterns() {
span_bug!(
test.span,
"matching on `String` went through without enabling string_deref_patterns"

View file

@ -777,7 +777,7 @@ impl<'tcx> Cx<'tcx> {
if_then_scope: region::Scope {
id: then.hir_id.local_id,
data: {
if expr.span.at_least_rust_2024() && tcx.features().if_let_rescope {
if expr.span.at_least_rust_2024() && tcx.features().if_let_rescope() {
region::ScopeData::IfThenRescope
} else {
region::ScopeData::IfThen

View file

@ -1126,7 +1126,7 @@ fn report_non_exhaustive_match<'p, 'tcx>(
.map(|witness| cx.print_witness_pat(witness))
.collect::<Vec<String>>()
.join(" | ");
if witnesses.iter().all(|p| p.is_never_pattern()) && cx.tcx.features().never_patterns {
if witnesses.iter().all(|p| p.is_never_pattern()) && cx.tcx.features().never_patterns() {
// Arms with a never pattern don't take a body.
pattern
} else {