Rip out legacy reactivity from the typechecker and HackC
[hiphop-php.git] / hphp / hack / src / oxidized_by_ref / manual / tast_impl.rs
blob2c188b8a50adfa2efa3180bf613a36c1edaacbd4
1 // Copyright (c) Facebook, Inc. and its affiliates.
2 //
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 #[allow(unused_imports)]
7 use crate::*;
9 use i_map::IMap;
10 use s_map::SMap;
11 use tast::SavedEnv;
12 use type_parameter_env::TypeParameterEnv;
13 use typing_inference_env::TypingInferenceEnv;
14 use typing_logic::SubtypeProp;
15 use typing_tyvar_occurrences::TypingTyvarOccurrences;
17 const INFERENCE_ENV: TypingInferenceEnv<'_> = TypingInferenceEnv {
18     tvenv: IMap::empty(),
19     tyvars_stack: &[],
20     subtype_prop: SubtypeProp::default_ref(),
21     tyvar_occurrences: &TYVAR_OCCURRENCES,
22     allow_solve_globals: false,
25 const TYVAR_OCCURRENCES: TypingTyvarOccurrences<'_> = TypingTyvarOccurrences {
26     tyvar_occurrences: IMap::empty(),
27     tyvars_in_tyvar: IMap::empty(),
30 const TPENV: TypeParameterEnv<'_> = TypeParameterEnv {
31     tparams: SMap::empty(),
32     consistent: false,
35 impl Default for SavedEnv<'_> {
36     fn default() -> Self {
37         Self {
38             tcopt: Default::default(),
39             inference_env: &INFERENCE_ENV,
40             tpenv: &TPENV,
41             condition_types: Default::default(),
42             pessimize: Default::default(),
43         }
44     }