@@ -137,6 +137,7 @@ mod alias_relation_direction;
137
137
mod bound_constness;
138
138
mod field_def;
139
139
mod impl_polarity;
140
+ mod main_definition;
140
141
mod opaque_hidden_type;
141
142
mod param_env;
142
143
mod placeholder;
@@ -152,6 +153,7 @@ pub use alias_relation_direction::AliasRelationDirection;
152
153
pub use bound_constness:: BoundConstness ;
153
154
pub use field_def:: FieldDef ;
154
155
pub use impl_polarity:: ImplPolarity ;
156
+ pub use main_definition:: MainDefinition ;
155
157
pub use opaque_hidden_type:: OpaqueHiddenType ;
156
158
pub use param_env:: { ParamEnv , ParamEnvAnd } ;
157
159
pub use placeholder:: { Placeholder , PlaceholderConst , PlaceholderRegion , PlaceholderType } ;
@@ -168,19 +170,6 @@ pub use ty_::Ty;
168
170
pub use variant_def:: VariantDef ;
169
171
pub use visibility:: Visibility ;
170
172
171
- #[ derive( Clone , Copy , Debug ) ]
172
- pub struct MainDefinition {
173
- pub res : Res < ast:: NodeId > ,
174
- pub is_import : bool ,
175
- pub span : Span ,
176
- }
177
-
178
- impl MainDefinition {
179
- pub fn opt_fn_def_id ( self ) -> Option < DefId > {
180
- if let Res :: Def ( DefKind :: Fn , def_id) = self . res { Some ( def_id) } else { None }
181
- }
182
- }
183
-
184
173
/// The "header" of an impl is everything outside the body: a Self type, a trait
185
174
/// ref (in the case of a trait impl), and a set of predicates (from the
186
175
/// bounds / where-clauses).
0 commit comments