@@ -14,7 +14,7 @@ pub struct Directive {
1414 pub is_rustc_attr : bool ,
1515 /// This is never nested more than once, i.e. the directives in this
1616 /// thinvec have no filters of their own.
17- pub filters : ThinVec < ( OnUnimplementedCondition , Directive ) > ,
17+ pub filters : ThinVec < ( Filter , Directive ) > ,
1818 pub message : Option < ( Span , FormatString ) > ,
1919 pub label : Option < ( Span , FormatString ) > ,
2020 pub notes : ThinVec < FormatString > ,
@@ -51,29 +51,29 @@ impl Directive {
5151
5252 pub fn eval (
5353 & self ,
54- condition_options : Option < & ConditionOptions > ,
54+ filter_options : Option < & FilterOptions > ,
5555 args : & FormatArgs ,
5656 ) -> CustomDiagnostic {
5757 let this = & args. this ;
5858 debug ! (
59- "Directive::eval({self:?}, this={this}, options={condition_options :?}, args ={args:?})"
59+ "Directive::eval({self:?}, this={this}, options={filter_options :?}, args ={args:?})"
6060 ) ;
6161
6262 let mut ret = CustomDiagnostic :: default ( ) ;
6363
64- if let Some ( condition_options ) = condition_options {
64+ if let Some ( filter_options ) = filter_options {
6565 for ( filter, directive) in & self . filters {
66- if filter. matches_predicate ( condition_options ) {
66+ if filter. matches_predicate ( filter_options ) {
6767 debug ! ( "eval: {filter:?} succeeded" ) ;
6868 ret. update ( directive, args) ;
6969 } else {
70- debug ! ( "eval: skipping {filter:?} due to condition " ) ;
70+ debug ! ( "eval: skipping {filter:?} due to {filter_options:?} " ) ;
7171 }
7272 }
7373 } else {
7474 debug_assert ! (
7575 !self . is_rustc_attr,
76- "Directive::eval called for `rustc_on_unimplemented` without `condition_options `"
76+ "Directive::eval called for `rustc_on_unimplemented` without `filter_options `"
7777 ) ;
7878 } ;
7979 ret. update ( self , args) ;
@@ -237,12 +237,12 @@ pub enum FormatArg {
237237
238238/// Represents the `on` filter in `#[rustc_on_unimplemented]`.
239239#[ derive( Clone , Debug , HashStable , Encodable , Decodable , PrintAttribute ) ]
240- pub struct OnUnimplementedCondition {
240+ pub struct Filter {
241241 pub span : Span ,
242242 pub pred : Predicate ,
243243}
244- impl OnUnimplementedCondition {
245- pub fn matches_predicate ( self : & OnUnimplementedCondition , options : & ConditionOptions ) -> bool {
244+ impl Filter {
245+ pub fn matches_predicate ( & self , options : & FilterOptions ) -> bool {
246246 self . pred . eval ( & mut |p| match p {
247247 FlagOrNv :: Flag ( b) => options. has_flag ( * b) ,
248248 FlagOrNv :: NameValue ( NameValue { name, value } ) => {
@@ -257,7 +257,7 @@ impl OnUnimplementedCondition {
257257 }
258258}
259259
260- /// Predicate(s) in `#[rustc_on_unimplemented]`'s `on` filter. See [`OnUnimplementedCondition `].
260+ /// Predicate(s) in `#[rustc_on_unimplemented]`'s `on` filter. See [`Filter `].
261261///
262262/// It is similar to the predicate in the `cfg` attribute,
263263/// and may contain nested predicates.
@@ -391,8 +391,7 @@ pub enum LitOrArg {
391391 Arg ( Symbol ) ,
392392}
393393
394- /// Used with `OnUnimplementedCondition::matches_predicate` to evaluate the
395- /// [`OnUnimplementedCondition`].
394+ /// Used with `Filter::matches_predicate` to evaluate the [`Filter`].
396395///
397396/// For example, given a
398397/// ```rust,ignore (just an example)
@@ -418,7 +417,7 @@ pub enum LitOrArg {
418417/// it will look like this:
419418///
420419/// ```rust,ignore (just an example)
421- /// ConditionOptions {
420+ /// FilterOptions {
422421/// self_types: ["u32", "{integral}"],
423422/// from_desugaring: Some("QuestionMark"),
424423/// cause: None,
@@ -431,7 +430,7 @@ pub enum LitOrArg {
431430/// }
432431/// ```
433432#[ derive( Debug ) ]
434- pub struct ConditionOptions {
433+ pub struct FilterOptions {
435434 /// All the self types that may apply.
436435 pub self_types : Vec < String > ,
437436 // The kind of compiler desugaring.
@@ -445,7 +444,7 @@ pub struct ConditionOptions {
445444 pub generic_args : Vec < ( Symbol , String ) > ,
446445}
447446
448- impl ConditionOptions {
447+ impl FilterOptions {
449448 pub fn has_flag ( & self , name : Flag ) -> bool {
450449 match name {
451450 Flag :: CrateLocal => self . crate_local ,
0 commit comments