@@ -42,10 +42,16 @@ impl ScrapeExamplesOptions {
4242 scrape_tests,
4343 } ) ,
4444 ( Some ( _) , false , _) | ( None , true , _) => {
45- dcx. fatal ( "must use --scrape-examples-output-path and --scrape-examples-target-crate together" ) ;
45+ dcx. fatal (
46+ "must use --scrape-examples-output-path and --scrape-examples-target-crate \
47+ together",
48+ ) ;
4649 }
4750 ( None , false , true ) => {
48- dcx. fatal ( "must use --scrape-examples-output-path and --scrape-examples-target-crate with --scrape-tests" ) ;
51+ dcx. fatal (
52+ "must use --scrape-examples-output-path and \
53+ --scrape-examples-target-crate with --scrape-tests",
54+ ) ;
4955 }
5056 ( None , false , false ) => None ,
5157 }
@@ -163,34 +169,37 @@ where
163169 } ;
164170
165171 // If this span comes from a macro expansion, then the source code may not actually show
166- // a use of the given item, so it would be a poor example. Hence, we skip all uses in macros.
172+ // a use of the given item, so it would be a poor example. Hence, we skip all uses in
173+ // macros.
167174 if call_span. from_expansion ( ) {
168175 trace ! ( "Rejecting expr from macro: {call_span:?}" ) ;
169176 return ;
170177 }
171178
172- // If the enclosing item has a span coming from a proc macro, then we also don't want to include
173- // the example.
179+ // If the enclosing item has a span coming from a proc macro, then we also don't want to
180+ // include the example.
174181 let enclosing_item_span =
175182 tcx. hir ( ) . span_with_body ( tcx. hir ( ) . get_parent_item ( ex. hir_id ) . into ( ) ) ;
176183 if enclosing_item_span. from_expansion ( ) {
177184 trace ! ( "Rejecting expr ({call_span:?}) from macro item: {enclosing_item_span:?}" ) ;
178185 return ;
179186 }
180187
181- // If the enclosing item doesn't actually enclose the call, this means we probably have a weird
182- // macro issue even though the spans aren't tagged as being from an expansion.
188+ // If the enclosing item doesn't actually enclose the call, this means we probably have a
189+ // weird macro issue even though the spans aren't tagged as being from an expansion.
183190 if !enclosing_item_span. contains ( call_span) {
184191 warn ! (
185- "Attempted to scrape call at [{call_span:?}] whose enclosing item [{enclosing_item_span:?}] doesn't contain the span of the call."
192+ "Attempted to scrape call at [{call_span:?}] whose enclosing item \
193+ [{enclosing_item_span:?}] doesn't contain the span of the call."
186194 ) ;
187195 return ;
188196 }
189197
190198 // Similarly for the call w/ the function ident.
191199 if !call_span. contains ( ident_span) {
192200 warn ! (
193- "Attempted to scrape call at [{call_span:?}] whose identifier [{ident_span:?}] was not contained in the span of the call."
201+ "Attempted to scrape call at [{call_span:?}] whose identifier [{ident_span:?}] was \
202+ not contained in the span of the call."
194203 ) ;
195204 return ;
196205 }
@@ -224,7 +233,8 @@ where
224233 Some ( url) => url,
225234 None => {
226235 trace ! (
227- "Rejecting expr ({call_span:?}) whose clean span ({clean_span:?}) cannot be turned into a link"
236+ "Rejecting expr ({call_span:?}) whose clean span ({clean_span:?}) \
237+ cannot be turned into a link"
228238 ) ;
229239 return ;
230240 }
@@ -272,7 +282,8 @@ pub(crate) fn run(
272282 let ( cx, _) = Context :: init ( krate, renderopts, cache, tcx) . map_err ( |e| e. to_string ( ) ) ?;
273283
274284 // Collect CrateIds corresponding to provided target crates
275- // If two different versions of the crate in the dependency tree, then examples will be collected from both.
285+ // If two different versions of the crate in the dependency tree, then examples will be
286+ // collected from both.
276287 let all_crates = tcx
277288 . crates ( ( ) )
278289 . iter ( )
0 commit comments