]> git.lizzy.rs Git - rust.git/blob - src/librustdoc/core.rs
Fix tests and rustdoc
[rust.git] / src / librustdoc / core.rs
1 // Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 use rustc_lint;
12 use rustc_driver::{self, driver, target_features, abort_on_err};
13 use rustc::session::{self, config};
14 use rustc::hir::def_id::{DefId, DefIndex, DefIndexAddressSpace, CrateNum, LOCAL_CRATE};
15 use rustc::hir::def::Def;
16 use rustc::hir::{self, HirVec};
17 use rustc::middle::cstore::CrateStore;
18 use rustc::middle::privacy::AccessLevels;
19 use rustc::ty::{self, TyCtxt, AllArenas};
20 use rustc::hir::map as hir_map;
21 use rustc::lint::{self, LintPass};
22 use rustc::session::config::ErrorOutputType;
23 use rustc::util::nodemap::{FxHashMap, FxHashSet};
24 use rustc_resolve as resolve;
25 use rustc_metadata::creader::CrateLoader;
26 use rustc_metadata::cstore::CStore;
27 use rustc_target::spec::TargetTriple;
28
29 use syntax::ast::{self, Ident, NodeId};
30 use syntax::source_map;
31 use syntax::edition::Edition;
32 use syntax::feature_gate::UnstableFeatures;
33 use syntax::json::JsonEmitter;
34 use syntax::ptr::P;
35 use syntax::symbol::keywords;
36 use syntax_pos::DUMMY_SP;
37 use errors;
38 use errors::emitter::{Emitter, EmitterWriter};
39 use parking_lot::ReentrantMutex;
40
41 use std::cell::RefCell;
42 use std::mem;
43 use rustc_data_structures::sync::{self, Lrc};
44 use std::rc::Rc;
45 use std::sync::Arc;
46 use std::path::PathBuf;
47
48 use visit_ast::RustdocVisitor;
49 use clean;
50 use clean::{get_path_for_type, Clean, MAX_DEF_ID, AttributesExt};
51 use html::render::RenderInfo;
52 use passes;
53
54 pub use rustc::session::config::{Input, Options, CodegenOptions};
55 pub use rustc::session::search_paths::SearchPaths;
56
57 pub type ExternalPaths = FxHashMap<DefId, (Vec<String>, clean::TypeKind)>;
58
59 pub struct DocContext<'a, 'tcx: 'a, 'rcx: 'a, 'cstore: 'rcx> {
60     pub tcx: TyCtxt<'a, 'tcx, 'tcx>,
61     pub resolver: &'a RefCell<resolve::Resolver<'rcx, 'cstore>>,
62     /// The stack of module NodeIds up till this point
63     pub crate_name: Option<String>,
64     pub cstore: Rc<CStore>,
65     // Note that external items for which `doc(hidden)` applies to are shown as
66     // non-reachable while local items aren't. This is because we're reusing
67     // the access levels from crateanalysis.
68     /// Later on moved into `html::render::CACHE_KEY`
69     pub renderinfo: RefCell<RenderInfo>,
70     /// Later on moved through `clean::Crate` into `html::render::CACHE_KEY`
71     pub external_traits: Arc<ReentrantMutex<RefCell<FxHashMap<DefId, clean::Trait>>>>,
72     /// Used while populating `external_traits` to ensure we don't process the same trait twice at
73     /// the same time.
74     pub active_extern_traits: RefCell<Vec<DefId>>,
75     // The current set of type and lifetime substitutions,
76     // for expanding type aliases at the HIR level:
77
78     /// Table type parameter definition -> substituted type
79     pub ty_substs: RefCell<FxHashMap<Def, clean::Type>>,
80     /// Table node id of lifetime parameter definition -> substituted lifetime
81     pub lt_substs: RefCell<FxHashMap<DefId, clean::Lifetime>>,
82     /// Table DefId of `impl Trait` in argument position -> bounds
83     pub impl_trait_bounds: RefCell<FxHashMap<DefId, Vec<clean::GenericBound>>>,
84     pub send_trait: Option<DefId>,
85     pub fake_def_ids: RefCell<FxHashMap<CrateNum, DefId>>,
86     pub all_fake_def_ids: RefCell<FxHashSet<DefId>>,
87     /// Maps (type_id, trait_id) -> auto trait impl
88     pub generated_synthetics: RefCell<FxHashSet<(DefId, DefId)>>,
89     pub all_traits: Vec<DefId>,
90 }
91
92 impl<'a, 'tcx, 'rcx, 'cstore> DocContext<'a, 'tcx, 'rcx, 'cstore> {
93     pub fn sess(&self) -> &session::Session {
94         &self.tcx.sess
95     }
96
97     /// Call the closure with the given parameters set as
98     /// the substitutions for a type alias' RHS.
99     pub fn enter_alias<F, R>(&self,
100                              ty_substs: FxHashMap<Def, clean::Type>,
101                              lt_substs: FxHashMap<DefId, clean::Lifetime>,
102                              f: F) -> R
103     where F: FnOnce() -> R {
104         let (old_tys, old_lts) =
105             (mem::replace(&mut *self.ty_substs.borrow_mut(), ty_substs),
106              mem::replace(&mut *self.lt_substs.borrow_mut(), lt_substs));
107         let r = f();
108         *self.ty_substs.borrow_mut() = old_tys;
109         *self.lt_substs.borrow_mut() = old_lts;
110         r
111     }
112
113     // This is an ugly hack, but it's the simplest way to handle synthetic impls without greatly
114     // refactoring either librustdoc or librustc. In particular, allowing new DefIds to be
115     // registered after the AST is constructed would require storing the defid mapping in a
116     // RefCell, decreasing the performance for normal compilation for very little gain.
117     //
118     // Instead, we construct 'fake' def ids, which start immediately after the last DefId in
119     // DefIndexAddressSpace::Low. In the Debug impl for clean::Item, we explicitly check for fake
120     // def ids, as we'll end up with a panic if we use the DefId Debug impl for fake DefIds
121     pub fn next_def_id(&self, crate_num: CrateNum) -> DefId {
122         let start_def_id = {
123             let next_id = if crate_num == LOCAL_CRATE {
124                 self.tcx
125                     .hir
126                     .definitions()
127                     .def_path_table()
128                     .next_id(DefIndexAddressSpace::Low)
129             } else {
130                 self.cstore
131                     .def_path_table(crate_num)
132                     .next_id(DefIndexAddressSpace::Low)
133             };
134
135             DefId {
136                 krate: crate_num,
137                 index: next_id,
138             }
139         };
140
141         let mut fake_ids = self.fake_def_ids.borrow_mut();
142
143         let def_id = fake_ids.entry(crate_num).or_insert(start_def_id).clone();
144         fake_ids.insert(
145             crate_num,
146             DefId {
147                 krate: crate_num,
148                 index: DefIndex::from_array_index(
149                     def_id.index.as_array_index() + 1,
150                     def_id.index.address_space(),
151                 ),
152             },
153         );
154
155         MAX_DEF_ID.with(|m| {
156             m.borrow_mut()
157                 .entry(def_id.krate.clone())
158                 .or_insert(start_def_id);
159         });
160
161         self.all_fake_def_ids.borrow_mut().insert(def_id);
162
163         def_id.clone()
164     }
165
166     /// Like the function of the same name on the HIR map, but skips calling it on fake DefIds.
167     /// (This avoids a slice-index-out-of-bounds panic.)
168     pub fn as_local_node_id(&self, def_id: DefId) -> Option<NodeId> {
169         if self.all_fake_def_ids.borrow().contains(&def_id) {
170             None
171         } else {
172             self.tcx.hir.as_local_node_id(def_id)
173         }
174     }
175
176     pub fn get_real_ty<F>(&self,
177                           def_id: DefId,
178                           def_ctor: &F,
179                           real_name: &Option<Ident>,
180                           generics: &ty::Generics,
181     ) -> hir::Ty
182     where F: Fn(DefId) -> Def {
183         let path = get_path_for_type(self.tcx, def_id, def_ctor);
184         let mut segments = path.segments.into_vec();
185         let last = segments.pop().expect("segments were empty");
186
187         segments.push(hir::PathSegment::new(
188             real_name.unwrap_or(last.ident),
189             None,
190             None,
191             self.generics_to_path_params(generics.clone()),
192             false,
193         ));
194
195         let new_path = hir::Path {
196             span: path.span,
197             def: path.def,
198             segments: HirVec::from_vec(segments),
199         };
200
201         hir::Ty {
202             id: ast::DUMMY_NODE_ID,
203             node: hir::TyKind::Path(hir::QPath::Resolved(None, P(new_path))),
204             span: DUMMY_SP,
205             hir_id: hir::DUMMY_HIR_ID,
206         }
207     }
208
209     pub fn generics_to_path_params(&self, generics: ty::Generics) -> hir::GenericArgs {
210         let mut args = vec![];
211
212         for param in generics.params.iter() {
213             match param.kind {
214                 ty::GenericParamDefKind::Lifetime => {
215                     let name = if param.name == "" {
216                         hir::ParamName::Plain(keywords::StaticLifetime.ident())
217                     } else {
218                         hir::ParamName::Plain(ast::Ident::from_interned_str(param.name))
219                     };
220
221                     args.push(hir::GenericArg::Lifetime(hir::Lifetime {
222                         id: ast::DUMMY_NODE_ID,
223                         span: DUMMY_SP,
224                         name: hir::LifetimeName::Param(name),
225                     }));
226                 }
227                 ty::GenericParamDefKind::Type {..} => {
228                     args.push(hir::GenericArg::Type(self.ty_param_to_ty(param.clone())));
229                 }
230             }
231         }
232
233         hir::GenericArgs {
234             args: HirVec::from_vec(args),
235             bindings: HirVec::new(),
236             parenthesized: false,
237         }
238     }
239
240     pub fn ty_param_to_ty(&self, param: ty::GenericParamDef) -> hir::Ty {
241         debug!("ty_param_to_ty({:?}) {:?}", param, param.def_id);
242         hir::Ty {
243             id: ast::DUMMY_NODE_ID,
244             node: hir::TyKind::Path(hir::QPath::Resolved(
245                 None,
246                 P(hir::Path {
247                     span: DUMMY_SP,
248                     def: Def::TyParam(param.def_id),
249                     segments: HirVec::from_vec(vec![
250                         hir::PathSegment::from_ident(Ident::from_interned_str(param.name))
251                     ]),
252                 }),
253             )),
254             span: DUMMY_SP,
255             hir_id: hir::DUMMY_HIR_ID,
256         }
257     }
258 }
259
260 pub trait DocAccessLevels {
261     fn is_doc_reachable(&self, did: DefId) -> bool;
262 }
263
264 impl DocAccessLevels for AccessLevels<DefId> {
265     fn is_doc_reachable(&self, did: DefId) -> bool {
266         self.is_public(did)
267     }
268 }
269
270 /// Creates a new diagnostic `Handler` that can be used to emit warnings and errors.
271 ///
272 /// If the given `error_format` is `ErrorOutputType::Json` and no `SourceMap` is given, a new one
273 /// will be created for the handler.
274 pub fn new_handler(error_format: ErrorOutputType,
275                    source_map: Option<Lrc<source_map::SourceMap>>,
276                    treat_err_as_bug: bool,
277                    ui_testing: bool,
278 ) -> errors::Handler {
279     // rustdoc doesn't override (or allow to override) anything from this that is relevant here, so
280     // stick to the defaults
281     let sessopts = Options::default();
282     let emitter: Box<dyn Emitter + sync::Send> = match error_format {
283         ErrorOutputType::HumanReadable(color_config) => Box::new(
284             EmitterWriter::stderr(
285                 color_config,
286                 source_map.map(|cm| cm as _),
287                 false,
288                 sessopts.debugging_opts.teach,
289             ).ui_testing(ui_testing)
290         ),
291         ErrorOutputType::Json(pretty) => {
292             let source_map = source_map.unwrap_or_else(
293                 || Lrc::new(source_map::SourceMap::new(sessopts.file_path_mapping())));
294             Box::new(
295                 JsonEmitter::stderr(
296                     None,
297                     source_map,
298                     pretty,
299                 ).ui_testing(ui_testing)
300             )
301         },
302         ErrorOutputType::Short(color_config) => Box::new(
303             EmitterWriter::stderr(
304                 color_config,
305                 source_map.map(|cm| cm as _),
306                 true,
307                 false)
308         ),
309     };
310
311     errors::Handler::with_emitter_and_flags(
312         emitter,
313         errors::HandlerFlags {
314             can_emit_warnings: true,
315             treat_err_as_bug,
316             report_delayed_bugs: false,
317             external_macro_backtrace: false,
318             ..Default::default()
319         },
320     )
321 }
322
323 pub fn run_core(search_paths: SearchPaths,
324                 cfgs: Vec<String>,
325                 externs: config::Externs,
326                 input: Input,
327                 triple: Option<TargetTriple>,
328                 maybe_sysroot: Option<PathBuf>,
329                 allow_warnings: bool,
330                 crate_name: Option<String>,
331                 force_unstable_if_unmarked: bool,
332                 edition: Edition,
333                 cg: CodegenOptions,
334                 error_format: ErrorOutputType,
335                 cmd_lints: Vec<(String, lint::Level)>,
336                 lint_cap: Option<lint::Level>,
337                 describe_lints: bool,
338                 mut manual_passes: Vec<String>,
339                 mut default_passes: passes::DefaultPassOption,
340                 treat_err_as_bug: bool,
341                 ui_testing: bool,
342 ) -> (clean::Crate, RenderInfo, Vec<String>) {
343     // Parse, resolve, and typecheck the given crate.
344
345     let cpath = match input {
346         Input::File(ref p) => Some(p.clone()),
347         _ => None
348     };
349
350     let intra_link_resolution_failure_name = lint::builtin::INTRA_DOC_LINK_RESOLUTION_FAILURE.name;
351     let warnings_lint_name = lint::builtin::WARNINGS.name;
352     let missing_docs = rustc_lint::builtin::MISSING_DOCS.name;
353     let missing_doc_example = rustc_lint::builtin::MISSING_DOC_CODE_EXAMPLES.name;
354
355     // In addition to those specific lints, we also need to whitelist those given through
356     // command line, otherwise they'll get ignored and we don't want that.
357     let mut whitelisted_lints = vec![warnings_lint_name.to_owned(),
358                                      intra_link_resolution_failure_name.to_owned(),
359                                      missing_docs.to_owned(),
360                                      missing_doc_example.to_owned()];
361
362     whitelisted_lints.extend(cmd_lints.iter().map(|(lint, _)| lint).cloned());
363
364     let lints = lint::builtin::HardwiredLints.get_lints()
365                     .into_iter()
366                     .chain(rustc_lint::SoftLints.get_lints().into_iter())
367                     .filter_map(|lint| {
368                         if lint.name == warnings_lint_name ||
369                            lint.name == intra_link_resolution_failure_name {
370                             None
371                         } else {
372                             Some((lint.name_lower(), lint::Allow))
373                         }
374                     })
375                     .chain(cmd_lints.into_iter())
376                     .collect::<Vec<_>>();
377
378     let host_triple = TargetTriple::from_triple(config::host_triple());
379     // plays with error output here!
380     let sessopts = config::Options {
381         maybe_sysroot,
382         search_paths,
383         crate_types: vec![config::CrateType::Rlib],
384         lint_opts: if !allow_warnings {
385             lints
386         } else {
387             vec![]
388         },
389         lint_cap: Some(lint_cap.unwrap_or_else(|| lint::Forbid)),
390         cg,
391         externs,
392         target_triple: triple.unwrap_or(host_triple),
393         // Ensure that rustdoc works even if rustc is feature-staged
394         unstable_features: UnstableFeatures::Allow,
395         actually_rustdoc: true,
396         debugging_opts: config::DebuggingOptions {
397             force_unstable_if_unmarked,
398             treat_err_as_bug,
399             ui_testing,
400             ..config::basic_debugging_options()
401         },
402         error_format,
403         edition,
404         describe_lints,
405         ..Options::default()
406     };
407     driver::spawn_thread_pool(sessopts, move |sessopts| {
408         let source_map = Lrc::new(source_map::SourceMap::new(sessopts.file_path_mapping()));
409         let diagnostic_handler = new_handler(error_format,
410                                              Some(source_map.clone()),
411                                              treat_err_as_bug,
412                                              ui_testing);
413
414         let mut sess = session::build_session_(
415             sessopts, cpath, diagnostic_handler, source_map,
416         );
417
418         lint::builtin::HardwiredLints.get_lints()
419                                      .into_iter()
420                                      .chain(rustc_lint::SoftLints.get_lints().into_iter())
421                                      .filter_map(|lint| {
422                                          // We don't want to whitelist *all* lints so let's
423                                          // ignore those ones.
424                                          if whitelisted_lints.iter().any(|l| &lint.name == l) {
425                                              None
426                                          } else {
427                                              Some(lint)
428                                          }
429                                      })
430                                      .for_each(|l| {
431                                          sess.driver_lint_caps.insert(lint::LintId::of(l),
432                                                                       lint::Allow);
433                                      });
434
435         let codegen_backend = rustc_driver::get_codegen_backend(&sess);
436         let cstore = Rc::new(CStore::new(codegen_backend.metadata_loader()));
437         rustc_lint::register_builtins(&mut sess.lint_store.borrow_mut(), Some(&sess));
438
439         let mut cfg = config::build_configuration(&sess, config::parse_cfgspecs(cfgs));
440         target_features::add_configuration(&mut cfg, &sess, &*codegen_backend);
441         sess.parse_sess.config = cfg;
442
443         let control = &driver::CompileController::basic();
444
445         let krate = panictry!(driver::phase_1_parse_input(control, &sess, &input));
446
447         let name = match crate_name {
448             Some(ref crate_name) => crate_name.clone(),
449             None => ::rustc_codegen_utils::link::find_crate_name(Some(&sess), &krate.attrs, &input),
450         };
451
452         let mut crate_loader = CrateLoader::new(&sess, &cstore, &name);
453
454         let resolver_arenas = resolve::Resolver::arenas();
455         let result = driver::phase_2_configure_and_expand_inner(&sess,
456                                                         &cstore,
457                                                         krate,
458                                                         None,
459                                                         &name,
460                                                         None,
461                                                         resolve::MakeGlobMap::No,
462                                                         &resolver_arenas,
463                                                         &mut crate_loader,
464                                                         |_| Ok(()));
465         let driver::InnerExpansionResult {
466             mut hir_forest,
467             resolver,
468             ..
469         } = abort_on_err(result, &sess);
470
471         // We need to hold on to the complete resolver, so we clone everything
472         // for the analysis passes to use. Suboptimal, but necessary in the
473         // current architecture.
474         let defs = resolver.definitions.clone();
475         let resolutions = ty::Resolutions {
476             freevars: resolver.freevars.clone(),
477             export_map: resolver.export_map.clone(),
478             trait_map: resolver.trait_map.clone(),
479             maybe_unused_trait_imports: resolver.maybe_unused_trait_imports.clone(),
480             maybe_unused_extern_crates: resolver.maybe_unused_extern_crates.clone(),
481             extern_prelude: resolver.extern_prelude.iter().map(|(ident, entry)| {
482                 (ident.name, entry.introduced_by_item)
483             }).collect(),
484         };
485         let analysis = ty::CrateAnalysis {
486             access_levels: Lrc::new(AccessLevels::default()),
487             name: name.to_string(),
488             glob_map: if resolver.make_glob_map { Some(resolver.glob_map.clone()) } else { None },
489         };
490
491         let arenas = AllArenas::new();
492         let hir_map = hir_map::map_crate(&sess, &*cstore, &mut hir_forest, &defs);
493         let output_filenames = driver::build_output_filenames(&input,
494                                                             &None,
495                                                             &None,
496                                                             &[],
497                                                             &sess);
498
499         let resolver = RefCell::new(resolver);
500         abort_on_err(driver::phase_3_run_analysis_passes(&*codegen_backend,
501                                                         control,
502                                                         &sess,
503                                                         &*cstore,
504                                                         hir_map,
505                                                         analysis,
506                                                         resolutions,
507                                                         &arenas,
508                                                         &name,
509                                                         &output_filenames,
510                                                         |tcx, analysis, _, result| {
511             if result.is_err() {
512                 sess.fatal("Compilation failed, aborting rustdoc");
513             }
514
515             let ty::CrateAnalysis { access_levels, .. } = analysis;
516
517             // Convert from a NodeId set to a DefId set since we don't always have easy access
518             // to the map from defid -> nodeid
519             let access_levels = AccessLevels {
520                 map: access_levels.map.iter()
521                                     .map(|(&k, &v)| (tcx.hir.local_def_id(k), v))
522                                     .collect()
523             };
524
525             let send_trait = if crate_name == Some("core".to_string()) {
526                 clean::path_to_def_local(&tcx, &["marker", "Send"])
527             } else {
528                 clean::path_to_def(&tcx, &["core", "marker", "Send"])
529             };
530
531             let mut renderinfo = RenderInfo::default();
532             renderinfo.access_levels = access_levels;
533
534             let ctxt = DocContext {
535                 tcx,
536                 resolver: &resolver,
537                 crate_name,
538                 cstore: cstore.clone(),
539                 external_traits: Default::default(),
540                 active_extern_traits: Default::default(),
541                 renderinfo: RefCell::new(renderinfo),
542                 ty_substs: Default::default(),
543                 lt_substs: Default::default(),
544                 impl_trait_bounds: Default::default(),
545                 send_trait: send_trait,
546                 fake_def_ids: Default::default(),
547                 all_fake_def_ids: Default::default(),
548                 generated_synthetics: Default::default(),
549                 all_traits: tcx.all_traits(LOCAL_CRATE).to_vec(),
550             };
551             debug!("crate: {:?}", tcx.hir.krate());
552
553             let mut krate = {
554                 let mut v = RustdocVisitor::new(&ctxt);
555                 v.visit(tcx.hir.krate());
556                 v.clean(&ctxt)
557             };
558
559             fn report_deprecated_attr(name: &str, diag: &errors::Handler) {
560                 let mut msg = diag.struct_warn(&format!("the `#![doc({})]` attribute is \
561                                                          considered deprecated", name));
562                 msg.warn("please see https://github.com/rust-lang/rust/issues/44136");
563
564                 if name == "no_default_passes" {
565                     msg.help("you may want to use `#![doc(document_private_items)]`");
566                 }
567
568                 msg.emit();
569             }
570
571             // Process all of the crate attributes, extracting plugin metadata along
572             // with the passes which we are supposed to run.
573             for attr in krate.module.as_ref().unwrap().attrs.lists("doc") {
574                 let diag = ctxt.sess().diagnostic();
575
576                 let name = attr.name().map(|s| s.as_str());
577                 let name = name.as_ref().map(|s| &s[..]);
578                 if attr.is_word() {
579                     if name == Some("no_default_passes") {
580                         report_deprecated_attr("no_default_passes", diag);
581                         if default_passes == passes::DefaultPassOption::Default {
582                             default_passes = passes::DefaultPassOption::None;
583                         }
584                     }
585                 } else if let Some(value) = attr.value_str() {
586                     let sink = match name {
587                         Some("passes") => {
588                             report_deprecated_attr("passes = \"...\"", diag);
589                             &mut manual_passes
590                         },
591                         Some("plugins") => {
592                             report_deprecated_attr("plugins = \"...\"", diag);
593                             eprintln!("WARNING: #![doc(plugins = \"...\")] no longer functions; \
594                                       see CVE-2018-1000622");
595                             continue
596                         },
597                         _ => continue,
598                     };
599                     for p in value.as_str().split_whitespace() {
600                         sink.push(p.to_string());
601                     }
602                 }
603
604                 if attr.is_word() && name == Some("document_private_items") {
605                     if default_passes == passes::DefaultPassOption::Default {
606                         default_passes = passes::DefaultPassOption::Private;
607                     }
608                 }
609             }
610
611             let mut passes: Vec<String> =
612                 passes::defaults(default_passes).iter().map(|p| p.to_string()).collect();
613             passes.extend(manual_passes);
614
615             for pass in &passes {
616                 // the "unknown pass" error will be reported when late passes are run
617                 if let Some(pass) = passes::find_pass(pass).and_then(|p| p.early_fn()) {
618                     krate = pass(krate, &ctxt);
619                 }
620             }
621
622             ctxt.sess().abort_if_errors();
623
624             (krate, ctxt.renderinfo.into_inner(), passes)
625         }), &sess)
626     })
627 }