1 // Copyright (c) Facebook, Inc. and its affiliates.
3 // This source code is licensed under the MIT license found in the
4 // LICENSE file in the "hack" directory of this source tree.
6 use crate::gen::global_options::GlobalOptions;
11 const DEFAULT: GlobalOptions<'_> = GlobalOptions {
12 tco_experimental_features: s_set::SSet::empty(),
13 tco_migration_flags: s_set::SSet::empty(),
14 tco_num_local_workers: None,
15 tco_parallel_type_checking_threshold: 10,
16 tco_max_typechecker_worker_memory_mb: None,
17 tco_defer_class_declaration_threshold: None,
18 tco_prefetch_deferred_files: false,
19 tco_remote_type_check_threshold: 1_000_000,
20 tco_remote_type_check: false,
21 tco_remote_worker_key: None,
22 tco_remote_check_id: None,
23 tco_remote_max_batch_size: 8000,
24 tco_remote_min_batch_size: 5000,
25 tco_num_remote_workers: 0,
26 so_remote_version_specifier: None,
27 so_remote_worker_vfs_checkout_threshold: 0,
28 so_naming_sqlite_path: None,
29 po_auto_namespace_map: &[],
31 po_deregister_php_stdlib: false,
32 po_disallow_toplevel_requires: false,
33 po_allow_unstable_features: false,
34 tco_log_large_fanouts_threshold: None,
35 tco_log_inference_constraints: false,
36 tco_language_feature_logging: false,
38 tco_disallow_invalid_arraykey: false,
39 tco_disallow_byref_dynamic_calls: false,
40 tco_disallow_byref_calls: true,
41 allowed_fixme_codes_strict: i_set::ISet::empty(),
42 log_levels: s_map::SMap::empty(),
43 po_disable_lval_as_an_expression: false,
44 tco_shallow_class_decl: false,
45 tco_force_shallow_decl_fanout: false,
46 tco_remote_old_decls_no_limit: false,
47 tco_force_load_hot_shallow_decls: false,
48 tco_fetch_remote_old_decls: false,
49 tco_populate_member_heaps: true,
50 tco_skip_hierarchy_checks: false,
51 tco_skip_tast_checks: false,
52 tco_like_type_hints: false,
53 tco_union_intersection_type_hints: false,
55 tco_coeffects_local: true,
56 tco_strict_contexts: true,
57 tco_like_casts: false,
58 tco_simple_pessimize: 0.0,
59 tco_complex_coercion: false,
60 tco_check_xhp_attribute: false,
61 tco_check_redundant_generics: false,
62 tco_disallow_unresolved_type_variables: false,
63 po_enable_class_level_where_clauses: false,
64 po_disable_legacy_soft_typehints: true,
65 po_allowed_decl_fixme_codes: i_set::ISet::empty(),
66 po_allow_new_attribute_syntax: false,
67 tco_global_inference: false,
68 tco_gi_reinfer_types: &[],
69 tco_ordered_solving: false,
70 tco_const_static_props: false,
71 po_disable_legacy_attribute_syntax: false,
72 tco_const_attribute: false,
73 po_const_default_func_args: false,
74 po_const_default_lambda_args: false,
75 po_disallow_silence: false,
76 po_abstract_static_props: false,
77 po_parser_errors_only: false,
78 tco_check_attribute_locations: true,
79 po_disallow_func_ptrs_in_constants: false,
80 tco_error_php_lambdas: false,
81 tco_disallow_discarded_nullable_awaitables: false,
82 po_enable_xhp_class_modifier: false,
83 po_disable_xhp_element_mangling: false,
84 po_disable_xhp_children_declarations: false,
89 symbol_write_ownership: false,
90 symbol_write_root_path: "",
91 symbol_write_hhi_path: "",
92 symbol_write_ignore_paths: &[],
93 symbol_write_index_paths: &[],
94 symbol_write_index_paths_file: None,
95 symbol_write_include_hhi: true,
96 symbol_write_index_paths_file_output: None,
97 po_enable_enum_classes: true,
98 po_disable_hh_ignore_error: 0,
99 tco_is_systemlib: false,
100 tco_higher_kinded_types: false,
101 tco_method_call_inference: false,
102 tco_report_pos_from_reason: false,
103 tco_typecheck_sample_rate: 1.0,
104 tco_enable_sound_dynamic: false,
105 po_disallow_fun_and_cls_meth_pseudo_funcs: false,
106 po_disallow_inst_meth: false,
107 tco_use_direct_decl_parser: true,
108 tco_ifc_enabled: &[],
109 tco_global_write_check_enabled: &[],
110 tco_global_write_check_functions_enabled: s_set::SSet::empty(),
111 po_enable_enum_supertyping: true,
112 po_interpret_soft_types_as_like_types: false,
113 tco_enable_strict_string_concat_interp: false,
114 tco_ignore_unsafe_cast: false,
115 tco_no_parser_readonly_check: false,
116 tco_enable_expression_trees: false,
117 tco_enable_modules: false,
118 tco_allowed_expression_tree_visitors: &[],
119 tco_math_new_code: false,
120 tco_typeconst_concrete_concrete_error: false,
121 tco_enable_strict_const_semantics: 0,
122 tco_strict_wellformedness: 0,
123 tco_meth_caller_only_public_visibility: true,
124 tco_require_extends_implements_ancestors: false,
125 tco_strict_value_equality: false,
126 tco_enforce_sealed_subclasses: false,
127 tco_everything_sdt: false,
128 tco_pessimise_builtins: false,
129 tco_explicit_consistent_constructors: 0,
130 tco_require_types_class_consts: 0,
131 tco_type_printer_fuel: 100,
132 tco_log_saved_state_age_and_distance: false,
133 tco_specify_manifold_api_key: false,
134 tco_saved_state_manifold_api_key: None,
135 tco_profile_top_level_definitions: false,
136 tco_allow_all_files_for_module_declarations: false,
137 tco_allowed_files_for_module_declarations: &[],
138 tco_use_manifold_cython_client: false,
139 tco_record_fine_grained_dependencies: false,
140 tco_loop_iteration_upper_bound: None,
141 tco_expression_tree_virtualize_functions: false,
142 tco_substitution_mutation: false,
143 tco_use_type_alias_heap: false,
146 impl GlobalOptions<'static> {
147 pub const DEFAULT: &'static Self = &DEFAULT;
149 pub const fn default_ref() -> &'static Self {
154 impl Default for &GlobalOptions<'_> {
155 fn default() -> Self {
156 GlobalOptions::default_ref()
160 impl Eq for GlobalOptions<'_> {}
162 impl std::hash::Hash for GlobalOptions<'_> {
163 fn hash<H>(&self, _: &mut H) {
168 impl no_pos_hash::NoPosHash for GlobalOptions<'_> {
169 fn hash<H>(&self, _: &mut H) {
174 impl Ord for GlobalOptions<'_> {
175 fn cmp(&self, _: &Self) -> std::cmp::Ordering {