Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
5216ea6
ExprUseVisitor: properly report discriminant reads
meithecatte Mar 26, 2025
e0c6949
ExprUseVisitor: remove maybe_read_scrutinee
meithecatte Mar 26, 2025
213fa59
Add test case for issue 138973
meithecatte Mar 27, 2025
2d6503c
Avoid using #[derive] in test
meithecatte Apr 1, 2025
2b16835
Add debug logging in hir_typeck::upvar
meithecatte Apr 21, 2025
6890336
Add miri tests for new closure capture behavior
meithecatte Apr 22, 2025
bddc1e2
add a comment: MatchPair and ExprUseVisitor must stay in sync
meithecatte Apr 22, 2025
ca47a91
Mark crash 140011 as fixed
meithecatte May 30, 2025
21da351
ExprUseVisitor: resolve a FIXME – it's fine as is
meithecatte May 30, 2025
0bc7f13
Bless miri tests
traviscross Oct 15, 2025
a625b77
Add a test for deref projections in new pattern capture behavior
meithecatte Oct 18, 2025
39d09eb
Rewrite the comment on is_multivariant_adt
meithecatte Oct 18, 2025
736e322
Add more variations from the PR thread
meithecatte Oct 19, 2025
4e72c4d
re-bless miri tests
meithecatte Nov 14, 2025
9d031bc
`search_is_some`: move to nursery
meithecatte Nov 14, 2025
04fedf7
Remove unused code in `cfg_old`
JonathanBrouwer Dec 12, 2025
acea7df
Remove last remaining usages of `UnsupportedLiteral`
JonathanBrouwer Dec 12, 2025
3f63f52
Don't pass an unused `--color` to compiletest
Zalathar Dec 12, 2025
ac5c70a
time: Implement SystemTime::{MIN, MAX}
cvengler Nov 11, 2025
0e7dc32
Inline `BootstrapCommand::force_coloring_in_ci` into its only call site
Zalathar Dec 12, 2025
0ab4b8b
Remove the E0536 error code
JonathanBrouwer Dec 12, 2025
d025cde
If there are too many suggestions for malformed attribute, do not sug…
GuillaumeGomez Dec 12, 2025
3981e0b
Rollup merge of #138961 - meithecatte:expr-use-visitor, r=Nadrieril,t…
GuillaumeGomez Dec 12, 2025
7cfd8d1
Rollup merge of #148825 - cvengler:time_systemtime_limits, r=ChrisDenton
GuillaumeGomez Dec 12, 2025
d2faf85
Rollup merge of #149903 - JonathanBrouwer:cfg_old_cleanup, r=jdonszel…
GuillaumeGomez Dec 12, 2025
7c778ca
Rollup merge of #149911 - Zalathar:no-color, r=jieyouxu
GuillaumeGomez Dec 12, 2025
1bdf820
Rollup merge of #149917 - GuillaumeGomez:malformed-attribute-suggesti…
GuillaumeGomez Dec 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions compiler/rustc_attr_parsing/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ attr_parsing_bundle_needs_static =
attr_parsing_cfg_attr_bad_delim = wrong `cfg_attr` delimiters
attr_parsing_cfg_predicate_identifier =
`cfg` predicate key must be an identifier
attr_parsing_deprecated_item_suggestion =
suggestions on deprecated items are unstable
.help = add `#![feature(deprecated_suggestion)]` to the crate root
Expand Down Expand Up @@ -41,9 +38,6 @@ attr_parsing_empty_link_name =
link name must not be empty
.label = empty link name
attr_parsing_expected_one_cfg_pattern =
expected 1 cfg-pattern
attr_parsing_expected_single_version_literal =
expected single version literal
Expand Down Expand Up @@ -241,12 +235,6 @@ attr_parsing_unstable_cfg_target_compact =
attr_parsing_unstable_feature_bound_incompatible_stability = item annotated with `#[unstable_feature_bound]` should not be stable
.help = If this item is meant to be stable, do not use any functions annotated with `#[unstable_feature_bound]`. Otherwise, mark this item as unstable with `#[unstable]`
attr_parsing_unsupported_literal_cfg_boolean =
literal in `cfg` predicate value must be a boolean
attr_parsing_unsupported_literal_cfg_string =
literal in `cfg` predicate value must be a string
attr_parsing_unsupported_literal_generic =
unsupported literal
attr_parsing_unsupported_literal_suggestion =
consider removing the prefix
Expand Down
22 changes: 20 additions & 2 deletions compiler/rustc_attr_parsing/src/attributes/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ use rustc_ast::token::Delimiter;
use rustc_ast::tokenstream::DelimSpan;
use rustc_ast::{AttrItem, Attribute, CRATE_NODE_ID, LitKind, ast, token};
use rustc_errors::{Applicability, PResult};
use rustc_feature::{AttrSuggestionStyle, AttributeTemplate, Features, template};
use rustc_feature::{
AttrSuggestionStyle, AttributeTemplate, Features, GatedCfg, find_gated_cfg, template,
};
use rustc_hir::attrs::CfgEntry;
use rustc_hir::lints::AttributeLintKind;
use rustc_hir::{AttrPath, RustcVersion};
Expand All @@ -23,7 +25,7 @@ use crate::session_diagnostics::{
AttributeParseError, AttributeParseErrorReason, CfgAttrBadDelim, MetaBadDelimSugg,
ParsedDescription,
};
use crate::{AttributeParser, fluent_generated, parse_version, session_diagnostics, try_gate_cfg};
use crate::{AttributeParser, fluent_generated, parse_version, session_diagnostics};

pub const CFG_TEMPLATE: AttributeTemplate = template!(
List: &["predicate"],
Expand Down Expand Up @@ -410,3 +412,19 @@ fn parse_cfg_attr_internal<'a>(

Ok((cfg_predicate, expanded_attrs))
}

fn try_gate_cfg(name: Symbol, span: Span, sess: &Session, features: Option<&Features>) {
let gate = find_gated_cfg(|sym| sym == name);
if let (Some(feats), Some(gated_cfg)) = (features, gate) {
gate_cfg(gated_cfg, span, sess, feats);
}
}

#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
fn gate_cfg(gated_cfg: &GatedCfg, cfg_span: Span, sess: &Session, features: &Features) {
let (cfg, feature, has_feature) = gated_cfg;
if !has_feature(features) && !cfg_span.allows_unstable(*feature) {
let explain = format!("`cfg({cfg})` is experimental and subject to change");
feature_err(sess, *feature, cfg_span, explain).emit();
}
}
210 changes: 0 additions & 210 deletions compiler/rustc_attr_parsing/src/attributes/cfg_old.rs

This file was deleted.

1 change: 0 additions & 1 deletion compiler/rustc_attr_parsing/src/attributes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ mod prelude;
pub(crate) mod allow_unstable;
pub(crate) mod body;
pub(crate) mod cfg;
pub(crate) mod cfg_old;
pub(crate) mod cfg_select;
pub(crate) mod codegen_attrs;
pub(crate) mod confusables;
Expand Down
16 changes: 3 additions & 13 deletions compiler/rustc_attr_parsing/src/attributes/stability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use rustc_hir::{

use super::prelude::*;
use super::util::parse_version;
use crate::session_diagnostics::{self, UnsupportedLiteralReason};
use crate::session_diagnostics::{self};

macro_rules! reject_outside_std {
($cx: ident) => {
Expand Down Expand Up @@ -302,12 +302,7 @@ pub(crate) fn parse_stability<S: Stage>(
for param in list.mixed() {
let param_span = param.span();
let Some(param) = param.meta_item() else {
cx.emit_err(session_diagnostics::UnsupportedLiteral {
span: param_span,
reason: UnsupportedLiteralReason::Generic,
is_bytestr: false,
start_point_span: cx.sess().source_map().start_point(param_span),
});
cx.unexpected_literal(param.span());
return None;
};

Expand Down Expand Up @@ -382,12 +377,7 @@ pub(crate) fn parse_unstability<S: Stage>(

for param in list.mixed() {
let Some(param) = param.meta_item() else {
cx.emit_err(session_diagnostics::UnsupportedLiteral {
span: param.span(),
reason: UnsupportedLiteralReason::Generic,
is_bytestr: false,
start_point_span: cx.sess().source_map().start_point(param.span()),
});
cx.unexpected_literal(param.span());
return None;
};

Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_attr_parsing/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ pub mod validate_attr;
pub use attributes::cfg::{
CFG_TEMPLATE, EvalConfigResult, eval_config_entry, parse_cfg, parse_cfg_attr, parse_cfg_entry,
};
pub use attributes::cfg_old::*;
pub use attributes::cfg_select::*;
pub use attributes::util::{is_builtin_attr, parse_version};
pub use context::{Early, Late, OmitDoc, ShouldEmit};
Expand Down
Loading
Loading