diff --git a/hphp/hack/src/client_and_server/serverConfig.ml b/hphp/hack/src/client_and_server/serverConfig.ml index 0609f073788c6a..55edf0d1200ca6 100644 --- a/hphp/hack/src/client_and_server/serverConfig.ml +++ b/hphp/hack/src/client_and_server/serverConfig.ml @@ -428,7 +428,6 @@ let load_config (config : Config_file_common.t) (options : GlobalOptions.t) : ?tco_error_php_lambdas:(bool_opt "error_php_lambdas" config) ?tco_disallow_discarded_nullable_awaitables: (bool_opt "disallow_discarded_nullable_awaitables" config) - ?tco_report_pos_from_reason:(bool_opt "report_pos_from_reason" config) ?tco_typecheck_sample_rate:(float_opt "typecheck_sample_rate" config) ?tco_enable_sound_dynamic:(bool_opt "enable_sound_dynamic_type" config) ?tco_pessimise_builtins:(bool_opt "pessimise_builtins" config) @@ -654,8 +653,6 @@ let load in Errors.allowed_fixme_codes_strict := GlobalOptions.allowed_fixme_codes_strict global_opts; - Errors.report_pos_from_reason := - TypecheckerOptions.report_pos_from_reason global_opts; Errors.code_agnostic_fixme := GlobalOptions.code_agnostic_fixme global_opts; ( { version; diff --git a/hphp/hack/src/errors/errors.ml b/hphp/hack/src/errors/errors.ml index d99dbdca843758..0ff6d4b121a1e8 100644 --- a/hphp/hack/src/errors/errors.ml +++ b/hphp/hack/src/errors/errors.ml @@ -556,9 +556,7 @@ let format_summary else None -let report_pos_from_reason = ref false - -let to_string error = User_error.to_string !report_pos_from_reason error +let to_string error = User_error.to_string error let log_unexpected error path desc = HackEventLogger.invariant_violation_bug @@ -787,11 +785,6 @@ let try_apply_fixme pos code severity : fixme_outcome = Not_fixmed (Some { explanation; fixme_pos }) else if Relative_path.(is_hhi (prefix (Pos.filename pos))) then Fixmed - else if !report_pos_from_reason && Pos.get_from_reason pos then - let explanation = - "You cannot use `HH_FIXME` or `HH_IGNORE_ERROR` comments to suppress an error whose position was derived from reason information" - in - Not_fixmed (Some { explanation; fixme_pos }) else if forbidden_decl_fixme then let explanation = Printf.sprintf diff --git a/hphp/hack/src/errors/errors.mli b/hphp/hack/src/errors/errors.mli index 8316ab376020f2..c94e9877d64e38 100644 --- a/hphp/hack/src/errors/errors.mli +++ b/hphp/hack/src/errors/errors.mli @@ -62,8 +62,6 @@ val add_error : error -> unit (* Error codes that can be suppressed in strict mode with a FIXME based on configuration. *) val allowed_fixme_codes_strict : ISet.t ref -val report_pos_from_reason : bool ref - val is_strict_code : int -> bool val set_allow_errors_in_default_path : bool -> unit diff --git a/hphp/hack/src/errors/user_error.ml b/hphp/hack/src/errors/user_error.ml index a4a9167c9d49ef..2754cdb8fcddfc 100644 --- a/hphp/hack/src/errors/user_error.ml +++ b/hphp/hack/src/errors/user_error.ml @@ -254,32 +254,24 @@ let error_code_to_string error_code = path/to/other/file.php ... And this too *) -let to_string - report_pos_from_reason { severity; code; claim; reasons; custom_msgs; _ } = +let to_string { severity; code; claim; reasons; custom_msgs; _ } = let buf = Buffer.create 50 in let (pos1, msg1) = claim in Buffer.add_string buf begin let error_code = error_code_to_string code in - let reason_msg = - if report_pos_from_reason && Pos.get_from_reason pos1 then - " [FROM REASON INFO]" - else - "" - in Printf.sprintf (* /!\ WARNING!!!!! Changing this might break emacs and vim. These are not officially supported, but breaking will piss off users. Fix Emacs at fbcode/emacs_config/emacs-packages/compile-mode-regexes.el Fix Vim at fbcode/shellconfigs/rc_deprecated/vim/plugin/hack.vim, variable hack_errorformat *) - "%s: %s\n%s (%s)%s\n" + "%s: %s\n%s (%s)\n" (Severity.to_all_caps_string severity) (Pos.string pos1) msg1 error_code - reason_msg end; let (_ : unit) = List.iter reasons ~f:(fun (p, w) -> diff --git a/hphp/hack/src/errors/user_error.mli b/hphp/hack/src/errors/user_error.mli index e6e76a71a163a9..8f462ad67a6692 100644 --- a/hphp/hack/src/errors/user_error.mli +++ b/hphp/hack/src/errors/user_error.mli @@ -104,7 +104,7 @@ val error_code_to_string : int -> string path/to/other/file.php pos... And this too *) -val to_string : bool -> (Pos.absolute, Pos.absolute) t -> string +val to_string : (Pos.absolute, Pos.absolute) t -> string val to_json : human_formatter:(('a Pos.pos, 'a Pos.pos) t -> string) option -> diff --git a/hphp/hack/src/hh_single_ai.ml b/hphp/hack/src/hh_single_ai.ml index 1e8adcc6bb8fd3..d508ef126c8f93 100644 --- a/hphp/hack/src/hh_single_ai.ml +++ b/hphp/hack/src/hh_single_ai.ml @@ -115,8 +115,6 @@ let parse_options () = in Errors.allowed_fixme_codes_strict := GlobalOptions.allowed_fixme_codes_strict tcopt; - Errors.report_pos_from_reason := - TypecheckerOptions.report_pos_from_reason tcopt; ( { files = fns; extra_builtins = !extra_builtins; ai_options; tcopt }, Ai_options.modify_shared_mem ai_options SharedMem.default_config ) diff --git a/hphp/hack/src/hh_single_type_check.ml b/hphp/hack/src/hh_single_type_check.ml index cf4ad5976382c0..f8c976edf1d3d8 100644 --- a/hphp/hack/src/hh_single_type_check.ml +++ b/hphp/hack/src/hh_single_type_check.ml @@ -946,7 +946,6 @@ let parse_options () = !disallow_discarded_nullable_awaitables ~glean_reponame:!glean_reponame ~tco_higher_kinded_types:!enable_higher_kinded_types - ~tco_report_pos_from_reason:!report_pos_from_reason ~tco_enable_sound_dynamic:true ~tco_skip_check_under_dynamic:!skip_check_under_dynamic ~tco_global_access_check_enabled:!enable_global_access_check @@ -975,8 +974,6 @@ let parse_options () = Errors.allowed_fixme_codes_strict := GlobalOptions.allowed_fixme_codes_strict tcopt; - Errors.report_pos_from_reason := - TypecheckerOptions.report_pos_from_reason tcopt; let tco_experimental_features = tcopt.GlobalOptions.tco_experimental_features diff --git a/hphp/hack/src/options/globalOptions.ml b/hphp/hack/src/options/globalOptions.ml index ad9c1fe485c334..98acbc14356f58 100644 --- a/hphp/hack/src/options/globalOptions.ml +++ b/hphp/hack/src/options/globalOptions.ml @@ -141,7 +141,6 @@ type t = { tco_error_php_lambdas: bool; tco_disallow_discarded_nullable_awaitables: bool; tco_higher_kinded_types: bool; - tco_report_pos_from_reason: bool; tco_typecheck_sample_rate: float; tco_enable_sound_dynamic: bool; tco_pessimise_builtins: bool; @@ -252,7 +251,6 @@ let default = tco_error_php_lambdas = false; tco_disallow_discarded_nullable_awaitables = false; tco_higher_kinded_types = false; - tco_report_pos_from_reason = false; tco_typecheck_sample_rate = 1.0; tco_enable_sound_dynamic = false; tco_pessimise_builtins = false; @@ -361,7 +359,6 @@ let set ?tco_error_php_lambdas ?tco_disallow_discarded_nullable_awaitables ?tco_higher_kinded_types - ?tco_report_pos_from_reason ?tco_typecheck_sample_rate ?tco_enable_sound_dynamic ?tco_pessimise_builtins @@ -555,8 +552,6 @@ let set options.tco_disallow_discarded_nullable_awaitables; tco_higher_kinded_types = setting tco_higher_kinded_types options.tco_higher_kinded_types; - tco_report_pos_from_reason = - setting tco_report_pos_from_reason options.tco_report_pos_from_reason; tco_typecheck_sample_rate = setting tco_typecheck_sample_rate options.tco_typecheck_sample_rate; tco_enable_sound_dynamic = diff --git a/hphp/hack/src/options/globalOptions.mli b/hphp/hack/src/options/globalOptions.mli index 255d65640326e4..391b06376be5b5 100644 --- a/hphp/hack/src/options/globalOptions.mli +++ b/hphp/hack/src/options/globalOptions.mli @@ -169,9 +169,6 @@ type t = { (** Flag to error on using discarded nullable awaitables *) tco_higher_kinded_types: bool; (** Controls if higher-kinded types are supported *) - tco_report_pos_from_reason: bool; - (** If set, then positions derived from reason information are tainted, and primary errors - with such positions are flagged *) tco_typecheck_sample_rate: float; (** Type check this proportion of all files. Default is 1.0. DO NOT set to any other value except for testing purposes. *) @@ -337,7 +334,6 @@ val set : ?tco_error_php_lambdas:bool -> ?tco_disallow_discarded_nullable_awaitables:bool -> ?tco_higher_kinded_types:bool -> - ?tco_report_pos_from_reason:bool -> ?tco_typecheck_sample_rate:float -> ?tco_enable_sound_dynamic:bool -> ?tco_pessimise_builtins:bool -> diff --git a/hphp/hack/src/options/typecheckerOptions.ml b/hphp/hack/src/options/typecheckerOptions.ml index d4608e482080f9..4d94ca0c7b0a72 100644 --- a/hphp/hack/src/options/typecheckerOptions.ml +++ b/hphp/hack/src/options/typecheckerOptions.ml @@ -153,8 +153,6 @@ let is_systemlib t = t.GlobalOptions.po.ParserOptions.is_systemlib let higher_kinded_types t = t.GlobalOptions.tco_higher_kinded_types -let report_pos_from_reason t = t.GlobalOptions.tco_report_pos_from_reason - let enable_sound_dynamic t = t.GlobalOptions.tco_enable_sound_dynamic let enable_no_auto_dynamic t = t.GlobalOptions.tco_enable_no_auto_dynamic diff --git a/hphp/hack/src/oxidized/gen/global_options.rs b/hphp/hack/src/oxidized/gen/global_options.rs index 3ccdc8944af863..c7659f1a326d8e 100644 --- a/hphp/hack/src/oxidized/gen/global_options.rs +++ b/hphp/hack/src/oxidized/gen/global_options.rs @@ -3,7 +3,7 @@ // This source code is licensed under the MIT license found in the // LICENSE file in the "hack" directory of this source tree. // -// @generated SignedSource<<7febc72690d173ffab4606dd14aed244>> +// @generated SignedSource<> // // To regenerate this file, run: // hphp/hack/src/oxidized_regen.sh @@ -204,7 +204,6 @@ pub struct GlobalOptions { pub tco_error_php_lambdas: bool, pub tco_disallow_discarded_nullable_awaitables: bool, pub tco_higher_kinded_types: bool, - pub tco_report_pos_from_reason: bool, pub tco_typecheck_sample_rate: f64, pub tco_enable_sound_dynamic: bool, pub tco_pessimise_builtins: bool, diff --git a/hphp/hack/src/oxidized/manual/global_options_impl.rs b/hphp/hack/src/oxidized/manual/global_options_impl.rs index 673289a5ac5639..86bfb59a661ba6 100644 --- a/hphp/hack/src/oxidized/manual/global_options_impl.rs +++ b/hphp/hack/src/oxidized/manual/global_options_impl.rs @@ -92,7 +92,6 @@ impl Default for GlobalOptions { symbol_write_reindexed_out: None, symbol_write_sym_hash_out: false, tco_higher_kinded_types: false, - tco_report_pos_from_reason: false, tco_typecheck_sample_rate: 1.0, tco_enable_sound_dynamic: false, tco_pessimise_builtins: false, diff --git a/hphp/hack/src/package/packageConfig.ml b/hphp/hack/src/package/packageConfig.ml index 5bce32be507d0a..0b407ac446cf20 100644 --- a/hphp/hack/src/package/packageConfig.ml +++ b/hphp/hack/src/package/packageConfig.ml @@ -33,7 +33,6 @@ let parse (package_v2 : bool) (strict : bool) (path : string) = in User_error.( to_string - true (to_absolute Parsing_error.( to_user_error @@ Package_config_error { pos; msg; reasons })))) diff --git a/hphp/hack/src/typing/typing_reason.ml b/hphp/hack/src/typing/typing_reason.ml index 42c7bd8bff68a3..9d330a18410f61 100644 --- a/hphp/hack/src/typing/typing_reason.ml +++ b/hphp/hack/src/typing/typing_reason.ml @@ -2196,12 +2196,7 @@ let rec to_json_help : type a. a t_ -> Hh_json.json list -> Hh_json.json list = and to_json : type a. a t_ -> Hh_json.json = (fun t -> Hh_json.JSON_Array (List.rev @@ to_json_help t [])) -let to_pos : type ph. ph t_ -> Pos_or_decl.t = - fun r -> - if !Errors.report_pos_from_reason then - Pos_or_decl.set_from_reason (to_raw_pos r) - else - to_raw_pos r +let to_pos : type ph. ph t_ -> Pos_or_decl.t = (fun r -> to_raw_pos r) let rec flow_contains_tyvar = function | Flow diff --git a/hphp/hack/src/utils/hh_config/hh_config.rs b/hphp/hack/src/utils/hh_config/hh_config.rs index 387e81e169ef3c..4980c7de15b9aa 100644 --- a/hphp/hack/src/utils/hh_config/hh_config.rs +++ b/hphp/hack/src/utils/hh_config/hh_config.rs @@ -402,7 +402,6 @@ impl HhConfig { tco_disallow_discarded_nullable_awaitables: default .tco_disallow_discarded_nullable_awaitables, tco_higher_kinded_types: default.tco_higher_kinded_types, - tco_report_pos_from_reason: default.tco_report_pos_from_reason, tco_typecheck_sample_rate: hhconfig .get_float_or("typecheck_sample_rate", default.tco_typecheck_sample_rate)?, tco_enable_sound_dynamic: hhconfig.get_bool_or(