From 8a827b160fb9a4b5af7ce7e5c3d5e09174bcf3a1 Mon Sep 17 00:00:00 2001 From: Corentin De Souza <9597216+fantazio@users.noreply.github.com> Date: Fri, 5 Dec 2025 18:48:11 +0100 Subject: [PATCH 01/12] [src] compile in 5.3 Naively fix compilation issues. In particular, the use of `cmt_declaration_dependecies` instead of `cmt_value_dependencies` is a simple translation from the latter to the former and is not exactly equivalent because `uid`s may not be found in the `cmt_uid_to_decl` table. This is certainly the root cause of the introduced FP and FN --- .github/workflows/workflow.yml | 6 +- README.md | 2 +- check/classic/classic.ref | 63 +-- check/internal/internal.ref | 108 +++-- check/threshold-1/threshold-1.ref | 300 +++++++++----- check/threshold-3-0.5/threshold-3-0.5.ref | 484 +++++++++++++--------- dead_code_analyzer.opam | 2 +- dune-project | 2 +- src/deadCode.ml | 48 ++- src/deadLexiFi.ml | 3 +- src/utils.ml | 2 +- 11 files changed, 656 insertions(+), 364 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index ef090779..190eb0aa 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -25,7 +25,7 @@ jobs: - name: Set-up OCaml uses: ocaml/setup-ocaml@v3 with: - ocaml-compiler: "5.2" + ocaml-compiler: "5.3" - run: opam install . --deps-only --with-test @@ -45,7 +45,7 @@ jobs: - name: Set-up OCaml uses: ocaml/setup-ocaml@v3 with: - ocaml-compiler: "5.2" + ocaml-compiler: "5.3" - uses: ocaml/setup-ocaml/lint-doc@v3 lint-opam: @@ -56,5 +56,5 @@ jobs: - name: Set-up OCaml uses: ocaml/setup-ocaml@v3 with: - ocaml-compiler: "5.2" + ocaml-compiler: "5.3" - uses: ocaml/setup-ocaml/lint-opam@v3 diff --git a/README.md b/README.md index a02f4868..4158c892 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ For more information, see [the documentation](docs/USER_DOC.md) ## Requirements -- Currently tested and working on **OCaml 5.2** +- Currently tested and working on **OCaml 5.3** ## Install diff --git a/check/classic/classic.ref b/check/classic/classic.ref index ba7997bf..5c224477 100644 --- a/check/classic/classic.ref +++ b/check/classic/classic.ref @@ -12,6 +12,7 @@ ./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused ./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Should not be detected ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement @@ -43,11 +44,23 @@ ./examples/using_dune/reduced_lib/reduced_lib.mli:19: Values_in_submodules.Exported.internally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:27: Values_in_submodules_no_intf.Exported.used_by_API ./examples/using_dune/reduced_lib/reduced_lib.mli:28: Values_in_submodules_no_intf.Exported.internally_used +./examples/using_dune/reduced_lib/values.mli:1: used: Should not be detected +./examples/using_dune/reduced_lib/values.mli:2: used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values.mli:3: internally_used: Should not be detected +./examples/using_dune/reduced_lib/values.mli:4: externally_used: Should not be detected ./examples/using_dune/reduced_lib/values.mli:7: lib_internal_unused ./examples/using_dune/reduced_lib/values.mli:8: lib_internal_internally_used +./examples/using_dune/reduced_lib/values_in_submodules.mli:2: Exported.used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:3: Exported.used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:4: Exported.internally_used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:8: Exported.lib_internal_unused ./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused +./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_unused ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg @@ -92,7 +105,8 @@ ./examples/using_make/advanced/inc_val.mli:1: x ./examples/using_make/advanced/inc_val.mli:2: y - +./examples/using_make/advanced/val.mli:1: x: Should not be detected +./examples/using_make/advanced/val.mli:2: y: Should not be detected ./examples/using_make/bar.ml:1: x ./examples/using_make/bar_fn.ml:3: h ./examples/using_make/baz.mli:1: z @@ -151,7 +165,7 @@ Nothing else to report in this section .> UNUSED METHODS: ================= -./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused +./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused: Not detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:1: unused#unused @@ -161,15 +175,14 @@ Nothing else to report in this section ./examples/using_dune/unwrapped_lib/obj/with_class.mli:25: fun_class#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:35: _self_used#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:41: _self_used_fun_class#unused -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int - +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected ./examples/using_dune/wrapped_lib/obj/with_class.mli:1: unused#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#never_used_fun ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#never_used_int @@ -177,15 +190,14 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/with_class.mli:25: fun_class#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:35: _self_used#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:41: _self_used_fun_class#unused -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int - +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected ./examples/using_make/obj/class.mli:1: c#h ./examples/using_make/obj/class_type.mli:9: c#h ./examples/using_make/obj/coerce.mli:6: p#f @@ -419,6 +431,8 @@ Nothing else to report in this section ./examples/using_make/if_end.ml:5: ?b ./examples/using_make/letIn.mli:1: ?a ./examples/using_make/let_in.ml:1: ?a +./examples/using_make/opt/sig_struct.ml:6: ?x: Should not be detected +./examples/using_make/opt/sig_struct.ml:11: ?x: Should not be detected ./examples/using_make/opt_in_opt.ml:1: ?a ./examples/using_make/opt_in_opt.ml:5: ?a ./examples/using_make/partial_opt.ml:1: ?a @@ -538,6 +552,7 @@ Nothing else to report in this section ./examples/using_make/foo.ml:1: ?a ./examples/using_make/letIn.mli:1: ?b ./examples/using_make/let_in.ml:1: ?c +./examples/using_make/opt/sig_struct.ml:2: ?x: Should not be detected ./examples/using_make/opt_in_opt.ml:2: ?a ./examples/using_make/opt_in_opt.ml:2: ?b ./examples/using_make/record.ml:12: ?b @@ -623,7 +638,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 536 -Success: 531 -Failed: 5 -Ratio: 99.0671641791% +Total: 554 +Success: 514 +Failed: 40 +Ratio: 92.7797833935% diff --git a/check/internal/internal.ref b/check/internal/internal.ref index 9c869823..afc8cde8 100644 --- a/check/internal/internal.ref +++ b/check/internal/internal.ref @@ -2,25 +2,37 @@ ========================= ./examples/docs/exported_values/code_constructs/function/function_lib.mli:7: unused +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:9: F.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:10: F.unused +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:14: Internal_param.used_required: Should not be detected +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:15: Internal_param.unused_required: Should not be detected +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:26: Internal_app.unused ./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused ./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Should not be detected ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement +./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:19: M_redef.unused +./examples/docs/exported_values/code_constructs/module/module_lib.mli:5: M.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/module/module_lib.mli:6: M.unused +./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello: Should not be detected +./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye: Should not be detected +./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:4: world: Should not be detected ./examples/docs/exported_values/limitations/incl_same_name/oo.mli:20: copy: Should not be detected ./examples/docs/exported_values/limitations/incl_same_name/oo.mli:25: id: Should not be detected ./examples/docs/exported_values/limitations/incl_same_name/oo.mli:40: new_method: Should not be detected ./examples/docs/exported_values/limitations/incl_same_name/oo.mli:41: public_method_label: Should not be detected ./examples/docs/exported_values/limitations/sigincl/sigincl_lib.mli:10: I.x: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:1: unused +./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used: Should not be detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:38: internally_used_f: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused ./examples/using_dune/reduced_lib/reduced_lib.mli:3: Values.used_by_API @@ -31,18 +43,38 @@ ./examples/using_dune/reduced_lib/reduced_lib.mli:19: Values_in_submodules.Exported.internally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:27: Values_in_submodules_no_intf.Exported.used_by_API ./examples/using_dune/reduced_lib/reduced_lib.mli:28: Values_in_submodules_no_intf.Exported.internally_used +./examples/using_dune/reduced_lib/values.mli:1: used: Should not be detected +./examples/using_dune/reduced_lib/values.mli:2: used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values.mli:3: internally_used: Should not be detected +./examples/using_dune/reduced_lib/values.mli:4: externally_used: Should not be detected ./examples/using_dune/reduced_lib/values.mli:7: lib_internal_unused +./examples/using_dune/reduced_lib/values.mli:8: lib_internal_internally_used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:2: Exported.used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:3: Exported.used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:4: Exported.internally_used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:8: Exported.lib_internal_unused +./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused +./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_unused ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg - +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:12: internally_used_fun_with_single_sometimes_used_opt_arg: Should not be detected ./examples/using_dune/unwrapped_lib/values/values.mli:2: unused_int +./examples/using_dune/unwrapped_lib/values/values.mli:3: internally_used_int: Should not be detected ./examples/using_dune/unwrapped_lib/values/values.mli:14: unused_fun +./examples/using_dune/unwrapped_lib/values/values.mli:15: internally_used_fun: Should not be detected ./examples/using_dune/unwrapped_lib/values/values.mli:20: unused_alias_fun ./examples/using_dune/unwrapped_lib/values/values.mli:25: unused_closure +./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int +./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun @@ -50,12 +82,18 @@ ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg - +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:12: internally_used_fun_with_single_sometimes_used_opt_arg: Should not be detected ./examples/using_dune/wrapped_lib/values/values.mli:2: unused_int +./examples/using_dune/wrapped_lib/values/values.mli:3: internally_used_int: Should not be detected ./examples/using_dune/wrapped_lib/values/values.mli:14: unused_fun +./examples/using_dune/wrapped_lib/values/values.mli:15: internally_used_fun: Should not be detected ./examples/using_dune/wrapped_lib/values/values.mli:20: unused_alias_fun ./examples/using_dune/wrapped_lib/values/values.mli:25: unused_closure +./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int +./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected ./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int ./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int ./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun @@ -64,7 +102,8 @@ ./examples/using_make/advanced/inc_val.mli:1: x ./examples/using_make/advanced/inc_val.mli:2: y - +./examples/using_make/advanced/val.mli:1: x: Should not be detected +./examples/using_make/advanced/val.mli:2: y: Should not be detected ./examples/using_make/bar.ml:1: x ./examples/using_make/bar_fn.ml:3: h ./examples/using_make/baz.mli:1: z @@ -81,32 +120,46 @@ ./examples/using_make/dir/anon_call2.ml:9: h ./examples/using_make/dir/match_opt.ml:8: l ./examples/using_make/dir/matchopt.ml:5: w +./examples/using_make/dir/mod.mli:10: M.f: Should not be detected ./examples/using_make/dir/mod.mli:11: M.g ./examples/using_make/dir/refFn.mli:3: x ./examples/using_make/dir/ref_opt.ml:3: no ./examples/using_make/dir/ref_opt.ml:11: x +./examples/using_make/exported.mli:6: M1.five: Should not be detected +./examples/using_make/exported.mli:10: F.plus_five: Should not be detected ./examples/using_make/exported.mli:11: F.times_five +./examples/using_make/exported.mli:15: M2.five: Should not be detected +./examples/using_make/exported.mli:16: M2.plus_five: Should not be detected ./examples/using_make/exported.mli:17: M2.ten ./examples/using_make/foo.mli:2: y ./examples/using_make/fooFn.mli:2: g +./examples/using_make/functor.mli:2: M.f: Should not be detected ./examples/using_make/functor.mli:3: M.none +./examples/using_make/functor.mli:7: F.g: Should not be detected +./examples/using_make/functor.mli:11: N.g: Should not be detected ./examples/using_make/let_in.ml:3: parent ./examples/using_make/let_test.ml:3: g ./examples/using_make/matchopt.ml:5: w +./examples/using_make/mod_alias.mli:2: M1.id: Should not be detected +./examples/using_make/mod_alias.mli:6: M2.id: Should not be detected +./examples/using_make/obj/class.mli:7: o: Should not be detected +./examples/using_make/obj/class.mli:9: f: Should not be detected +./examples/using_make/obj/inher.mli:11: o: Should not be detected +./examples/using_make/obj/inher.mli:13: f: Should not be detected ./examples/using_make/opt_in_opt.ml:7: x ./examples/using_make/qux.ml:1: z ./examples/using_make/unused_fn.ml:3: g ./examples/using_make/unused_fn.ml:5: var ./examples/using_make/useless_opt.ml:3: x - +./examples/using_make/variant.mli:5: f: Should not be detected Nothing else to report in this section -------------------------------------------------------------------------------- .> UNUSED METHODS: ================= -./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused +./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused: Not detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:1: unused#unused @@ -116,15 +169,14 @@ Nothing else to report in this section ./examples/using_dune/unwrapped_lib/obj/with_class.mli:25: fun_class#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:35: _self_used#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:41: _self_used_fun_class#unused -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int - +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected ./examples/using_dune/wrapped_lib/obj/with_class.mli:1: unused#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#never_used_fun ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#never_used_int @@ -132,15 +184,14 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/with_class.mli:25: fun_class#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:35: _self_used#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:41: _self_used_fun_class#unused -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int - +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected ./examples/using_make/obj/class.mli:1: c#h ./examples/using_make/obj/class_type.mli:9: c#h ./examples/using_make/obj/coerce.mli:6: p#f @@ -374,6 +425,8 @@ Nothing else to report in this section ./examples/using_make/if_end.ml:5: ?b ./examples/using_make/letIn.mli:1: ?a ./examples/using_make/let_in.ml:1: ?a +./examples/using_make/opt/sig_struct.ml:6: ?x: Should not be detected +./examples/using_make/opt/sig_struct.ml:11: ?x: Should not be detected ./examples/using_make/opt_in_opt.ml:1: ?a ./examples/using_make/opt_in_opt.ml:5: ?a ./examples/using_make/partial_opt.ml:1: ?a @@ -493,6 +546,7 @@ Nothing else to report in this section ./examples/using_make/foo.ml:1: ?a ./examples/using_make/letIn.mli:1: ?b ./examples/using_make/let_in.ml:1: ?c +./examples/using_make/opt/sig_struct.ml:2: ?x: Should not be detected ./examples/using_make/opt_in_opt.ml:2: ?a ./examples/using_make/opt_in_opt.ml:2: ?b ./examples/using_make/record.ml:12: ?b @@ -578,7 +632,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 494 -Success: 489 -Failed: 5 -Ratio: 98.987854251% +Total: 554 +Success: 472 +Failed: 82 +Ratio: 85.1985559567% diff --git a/check/threshold-1/threshold-1.ref b/check/threshold-1/threshold-1.ref index 0f3a3f17..c1237269 100644 --- a/check/threshold-1/threshold-1.ref +++ b/check/threshold-1/threshold-1.ref @@ -2,25 +2,37 @@ ========================= ./examples/docs/exported_values/code_constructs/function/function_lib.mli:7: unused +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:9: F.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:10: F.unused +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:14: Internal_param.used_required: Should not be detected +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:15: Internal_param.unused_required: Should not be detected +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:26: Internal_app.unused ./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused ./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Should not be detected ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement +./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:19: M_redef.unused +./examples/docs/exported_values/code_constructs/module/module_lib.mli:5: M.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/module/module_lib.mli:6: M.unused +./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello: Should not be detected +./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye: Should not be detected +./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:4: world: Should not be detected ./examples/docs/exported_values/limitations/incl_same_name/oo.mli:20: copy: Should not be detected ./examples/docs/exported_values/limitations/incl_same_name/oo.mli:25: id: Should not be detected ./examples/docs/exported_values/limitations/incl_same_name/oo.mli:40: new_method: Should not be detected ./examples/docs/exported_values/limitations/incl_same_name/oo.mli:41: public_method_label: Should not be detected ./examples/docs/exported_values/limitations/sigincl/sigincl_lib.mli:10: I.x: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:1: unused +./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used: Should not be detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:38: internally_used_f: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused ./examples/using_dune/reduced_lib/reduced_lib.mli:3: Values.used_by_API @@ -31,18 +43,38 @@ ./examples/using_dune/reduced_lib/reduced_lib.mli:19: Values_in_submodules.Exported.internally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:27: Values_in_submodules_no_intf.Exported.used_by_API ./examples/using_dune/reduced_lib/reduced_lib.mli:28: Values_in_submodules_no_intf.Exported.internally_used +./examples/using_dune/reduced_lib/values.mli:1: used: Should not be detected +./examples/using_dune/reduced_lib/values.mli:2: used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values.mli:3: internally_used: Should not be detected +./examples/using_dune/reduced_lib/values.mli:4: externally_used: Should not be detected ./examples/using_dune/reduced_lib/values.mli:7: lib_internal_unused +./examples/using_dune/reduced_lib/values.mli:8: lib_internal_internally_used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:2: Exported.used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:3: Exported.used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:4: Exported.internally_used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:8: Exported.lib_internal_unused +./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused +./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_unused ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg - +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:12: internally_used_fun_with_single_sometimes_used_opt_arg: Should not be detected ./examples/using_dune/unwrapped_lib/values/values.mli:2: unused_int +./examples/using_dune/unwrapped_lib/values/values.mli:3: internally_used_int: Should not be detected ./examples/using_dune/unwrapped_lib/values/values.mli:14: unused_fun +./examples/using_dune/unwrapped_lib/values/values.mli:15: internally_used_fun: Should not be detected ./examples/using_dune/unwrapped_lib/values/values.mli:20: unused_alias_fun ./examples/using_dune/unwrapped_lib/values/values.mli:25: unused_closure +./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int +./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun @@ -50,12 +82,18 @@ ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg - +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:12: internally_used_fun_with_single_sometimes_used_opt_arg: Should not be detected ./examples/using_dune/wrapped_lib/values/values.mli:2: unused_int +./examples/using_dune/wrapped_lib/values/values.mli:3: internally_used_int: Should not be detected ./examples/using_dune/wrapped_lib/values/values.mli:14: unused_fun +./examples/using_dune/wrapped_lib/values/values.mli:15: internally_used_fun: Should not be detected ./examples/using_dune/wrapped_lib/values/values.mli:20: unused_alias_fun ./examples/using_dune/wrapped_lib/values/values.mli:25: unused_closure +./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int +./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected ./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int ./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int ./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun @@ -64,7 +102,8 @@ ./examples/using_make/advanced/inc_val.mli:1: x ./examples/using_make/advanced/inc_val.mli:2: y - +./examples/using_make/advanced/val.mli:1: x: Should not be detected +./examples/using_make/advanced/val.mli:2: y: Should not be detected ./examples/using_make/bar.ml:1: x ./examples/using_make/bar_fn.ml:3: h ./examples/using_make/baz.mli:1: z @@ -81,24 +120,39 @@ ./examples/using_make/dir/anon_call2.ml:9: h ./examples/using_make/dir/match_opt.ml:8: l ./examples/using_make/dir/matchopt.ml:5: w +./examples/using_make/dir/mod.mli:10: M.f: Should not be detected ./examples/using_make/dir/mod.mli:11: M.g ./examples/using_make/dir/refFn.mli:3: x ./examples/using_make/dir/ref_opt.ml:3: no ./examples/using_make/dir/ref_opt.ml:11: x +./examples/using_make/exported.mli:6: M1.five: Should not be detected +./examples/using_make/exported.mli:10: F.plus_five: Should not be detected ./examples/using_make/exported.mli:11: F.times_five +./examples/using_make/exported.mli:15: M2.five: Should not be detected +./examples/using_make/exported.mli:16: M2.plus_five: Should not be detected ./examples/using_make/exported.mli:17: M2.ten ./examples/using_make/foo.mli:2: y ./examples/using_make/fooFn.mli:2: g +./examples/using_make/functor.mli:2: M.f: Should not be detected ./examples/using_make/functor.mli:3: M.none +./examples/using_make/functor.mli:7: F.g: Should not be detected +./examples/using_make/functor.mli:11: N.g: Should not be detected ./examples/using_make/let_in.ml:3: parent ./examples/using_make/let_test.ml:3: g ./examples/using_make/matchopt.ml:5: w +./examples/using_make/mod_alias.mli:2: M1.id: Should not be detected +./examples/using_make/mod_alias.mli:6: M2.id: Should not be detected +./examples/using_make/obj/class.mli:7: o: Should not be detected +./examples/using_make/obj/class.mli:9: f: Should not be detected +./examples/using_make/obj/inher.mli:11: o: Should not be detected +./examples/using_make/obj/inher.mli:13: f: Should not be detected ./examples/using_make/opt_in_opt.ml:7: x ./examples/using_make/qux.ml:1: z ./examples/using_make/unused_fn.ml:3: g ./examples/using_make/unused_fn.ml:5: var ./examples/using_make/useless_opt.ml:3: x +./examples/using_make/variant.mli:5: f: Should not be detected -------- @@ -109,32 +163,28 @@ ./examples/docs/exported_values/code_constructs/function/function_lib.mli:9: do_nothing ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:8: F.externally_used -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:9: F.internally_used -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:14: Internal_param.used_required -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:15: Internal_param.unused_required +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:9: F.internally_used: Not detected +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:14: Internal_param.used_required: Not detected +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:15: Internal_param.unused_required: Not detected ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:19: External_param.used_required ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:20: External_param.unused_required ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:24: Internal_app.externally_used -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used - +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used: Not detected ./examples/docs/exported_values/code_constructs/include/include_lib.ml:3: Original.used_directly ./examples/docs/exported_values/code_constructs/include/include_lib.ml:4: Original.used_indirectly ./examples/docs/exported_values/code_constructs/include/include_lib.ml:14: Redefine.used_directly ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:3: Original.used_directly ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:4: Original.used_indirectly -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement - +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Not detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:17: M_redef.externally_used -./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used - +./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used: Not detected ./examples/docs/exported_values/code_constructs/module/module_lib.mli:4: M.externally_used -./examples/docs/exported_values/code_constructs/module/module_lib.mli:5: M.internally_used - +./examples/docs/exported_values/code_constructs/module/module_lib.mli:5: M.internally_used: Not detected ./examples/docs/exported_values/hello_world/hello_world_lib.mli:2: hello ./examples/docs/exported_values/hello_world/hello_world_lib.mli:3: goodbye -./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello -./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye +./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello: Not detected +./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye: Not detected ./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:2: hello ./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:3: goodbye @@ -180,8 +230,10 @@ ./examples/using_dune/bin/use_wrapped_lib/use_without_class.mli:1: mark_used ./examples/using_dune/bin/use_wrapped_lib/use_wrapped_lib.mli:1: mark_used -./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used +./examples/using_dune/preprocessed_lib/preprocessed.mli:2: used: Should not be detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:4: externally_used +./examples/using_dune/preprocessed_lib/preprocessed.mli:31: exported_f: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:4: internally_used ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:5: externally_used @@ -193,44 +245,69 @@ ./examples/using_dune/reduced_lib/reduced_lib.mli:20: Values_in_submodules.Exported.externally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:26: Values_in_submodules_no_intf.Exported.used ./examples/using_dune/reduced_lib/reduced_lib.mli:29: Values_in_submodules_no_intf.Exported.externally_used -./examples/using_dune/reduced_lib/values.mli:2: used_by_API -./examples/using_dune/reduced_lib/values.mli:4: externally_used -./examples/using_dune/reduced_lib/values.mli:8: lib_internal_internally_used +./examples/using_dune/reduced_lib/values.mli:2: used_by_API: Not detected +./examples/using_dune/reduced_lib/values.mli:4: externally_used: Not detected +./examples/using_dune/reduced_lib/values.mli:6: lib_internal_used: Should not be detected +./examples/using_dune/reduced_lib/values.mli:8: lib_internal_internally_used: Not detected ./examples/using_dune/reduced_lib/values.mli:9: lib_internal_externally_used -./examples/using_dune/reduced_lib/values_in_submodules.mli:3: Exported.used_by_API -./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used -./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used +./examples/using_dune/reduced_lib/values_in_submodules.mli:3: Exported.used_by_API: Not detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Not detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:7: Exported.lib_internal_used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used: Not detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:10: Exported.lib_internal_externally_used -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:2: Exported.used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Not detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:4: Exported.internally_used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Not detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:9: Exported.lib_internal_internally_used ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:10: Exported.lib_internal_externally_used -./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API -./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used +./examples/using_dune/reduced_lib/values_no_intf.ml:1: used: Should not be detected +./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Not detected +./examples/using_dune/reduced_lib/values_no_intf.ml:3: internally_used: Should not be detected +./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Not detected ./examples/using_dune/reduced_lib/values_no_intf.ml:12: lib_internal_internally_used ./examples/using_dune/reduced_lib/values_no_intf.ml:13: lib_internal_externally_used -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg +./examples/using_dune/unwrapped_lib/obj/with_class.mli:33: fun_class_factory: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:5: used_fun_with_single_always_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Not detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Not detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:14: externally_used_fun_with_single_never_used_opt_arg ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:16: externally_used_fun_with_single_always_used_opt_arg - +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:20: multiple_never_used_opt_args: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:22: multiple_always_used_opt_args: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:1: partially_applied_with_never_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:3: partially_applied_with_always_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:7: shadowing_never_used_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:8: shadowing_always_used_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:10: expect_fun_with_never_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig: Should not be detected ./examples/using_dune/unwrapped_lib/style/style.ml:1: all -./examples/using_dune/unwrapped_lib/values/values.mli:3: internally_used_int +./examples/using_dune/unwrapped_lib/values/values.mli:1: used_int: Should not be detected +./examples/using_dune/unwrapped_lib/values/values.mli:3: internally_used_int: Not detected ./examples/using_dune/unwrapped_lib/values/values.mli:4: externally_used_int ./examples/using_dune/unwrapped_lib/values/values.mli:5: externally_used_as_parameter_int ./examples/using_dune/unwrapped_lib/values/values.mli:7: externally_written_bool_ref ./examples/using_dune/unwrapped_lib/values/values.mli:8: externally_matched_option ./examples/using_dune/unwrapped_lib/values/values.mli:10: externally_stored_in_ref_bool ./examples/using_dune/unwrapped_lib/values/values.mli:11: externally_stored_in_option_bool -./examples/using_dune/unwrapped_lib/values/values.mli:15: internally_used_fun +./examples/using_dune/unwrapped_lib/values/values.mli:13: used_fun: Should not be detected +./examples/using_dune/unwrapped_lib/values/values.mli:15: internally_used_fun: Not detected ./examples/using_dune/unwrapped_lib/values/values.mli:16: externally_used_fun ./examples/using_dune/unwrapped_lib/values/values.mli:17: externally_used_as_parameter_fun +./examples/using_dune/unwrapped_lib/values/values.mli:19: used_alias_fun: Should not be detected ./examples/using_dune/unwrapped_lib/values/values.mli:21: externally_used_alias_fun -./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure +./examples/using_dune/unwrapped_lib/values/values.mli:23: partially_used_fun: Should not be detected +./examples/using_dune/unwrapped_lib/values/values.mli:24: used_closure: Should not be detected +./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure: Not detected ./examples/using_dune/unwrapped_lib/values/values.mli:27: externally_used_closure -./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int +./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Should not be detected +./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Not detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:5: Exported.externally_used_int ./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int ./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int @@ -248,27 +325,46 @@ ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:27: internally_used_closure ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:28: externally_used_closure -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg +./examples/using_dune/wrapped_lib/obj/with_class.mli:33: fun_class_factory: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:5: used_fun_with_single_always_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Not detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Not detected ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:14: externally_used_fun_with_single_never_used_opt_arg ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:16: externally_used_fun_with_single_always_used_opt_arg - +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:20: multiple_never_used_opt_args: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:22: multiple_always_used_opt_args: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:1: partially_applied_with_never_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:3: partially_applied_with_always_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:7: shadowing_never_used_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:8: shadowing_always_used_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:10: expect_fun_with_never_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig: Should not be detected ./examples/using_dune/wrapped_lib/style/style.ml:1: all -./examples/using_dune/wrapped_lib/values/values.mli:3: internally_used_int +./examples/using_dune/wrapped_lib/values/values.mli:1: used_int: Should not be detected +./examples/using_dune/wrapped_lib/values/values.mli:3: internally_used_int: Not detected ./examples/using_dune/wrapped_lib/values/values.mli:4: externally_used_int ./examples/using_dune/wrapped_lib/values/values.mli:5: externally_used_as_parameter_int ./examples/using_dune/wrapped_lib/values/values.mli:7: externally_written_bool_ref ./examples/using_dune/wrapped_lib/values/values.mli:8: externally_matched_option ./examples/using_dune/wrapped_lib/values/values.mli:10: externally_stored_in_ref_bool ./examples/using_dune/wrapped_lib/values/values.mli:11: externally_stored_in_option_bool -./examples/using_dune/wrapped_lib/values/values.mli:15: internally_used_fun +./examples/using_dune/wrapped_lib/values/values.mli:13: used_fun: Should not be detected +./examples/using_dune/wrapped_lib/values/values.mli:15: internally_used_fun: Not detected ./examples/using_dune/wrapped_lib/values/values.mli:16: externally_used_fun ./examples/using_dune/wrapped_lib/values/values.mli:17: externally_used_as_parameter_fun +./examples/using_dune/wrapped_lib/values/values.mli:19: used_alias_fun: Should not be detected ./examples/using_dune/wrapped_lib/values/values.mli:21: externally_used_alias_fun -./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure +./examples/using_dune/wrapped_lib/values/values.mli:23: partially_used_fun: Should not be detected +./examples/using_dune/wrapped_lib/values/values.mli:24: used_closure: Should not be detected +./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure: Not detected ./examples/using_dune/wrapped_lib/values/values.mli:27: externally_used_closure -./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int +./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Should not be detected +./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Not detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:5: Exported.externally_used_int ./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int ./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int @@ -289,9 +385,8 @@ ./examples/using_make/advanced/incl.ml:7: f ./examples/using_make/advanced/mod.mli:1: f ./examples/using_make/advanced/mod.mli:2: x -./examples/using_make/advanced/val.mli:1: x -./examples/using_make/advanced/val.mli:2: y - +./examples/using_make/advanced/val.mli:1: x: Not detected +./examples/using_make/advanced/val.mli:2: y: Not detected ./examples/using_make/baz.mli:2: t ./examples/using_make/cond_sel.ml:9: f ./examples/using_make/cond_sel.ml:11: g @@ -306,25 +401,24 @@ ./examples/using_make/dir/hidden_opt_use.ml:1: f ./examples/using_make/dir/hidden_opt_use.ml:3: apply ./examples/using_make/dir/match_opt.ml:3: m -./examples/using_make/dir/mod.mli:10: M.f +./examples/using_make/dir/mod.mli:10: M.f: Not detected ./examples/using_make/dir/partial.ml:5: g ./examples/using_make/dir/ref_fn.ml:5: g ./examples/using_make/dir/ref_opt.ml:7: g ./examples/using_make/foo.mli:1: x ./examples/using_make/fooFn.mli:1: f -./examples/using_make/functor.mli:2: M.f +./examples/using_make/functor.mli:2: M.f: Not detected ./examples/using_make/if_end.ml:1: f ./examples/using_make/if_end.ml:3: g ./examples/using_make/if_end.ml:5: h ./examples/using_make/letIn.mli:1: f -./examples/using_make/mod_alias.mli:2: M1.id -./examples/using_make/mod_alias.mli:6: M2.id - -./examples/using_make/obj/class.mli:9: f +./examples/using_make/mod_alias.mli:2: M1.id: Not detected +./examples/using_make/mod_alias.mli:6: M2.id: Not detected +./examples/using_make/obj/class.mli:9: f: Not detected ./examples/using_make/obj/fun_class.ml:8: f ./examples/using_make/obj/fun_obj_param.ml:7: app_m -./examples/using_make/obj/inher.mli:13: f +./examples/using_make/obj/inher.mli:13: f: Not detected ./examples/using_make/obj/obj_inher.ml:7: o ./examples/using_make/obj/obj_inher.ml:12: o4 ./examples/using_make/obj/obj_inher.ml:17: o2 @@ -335,15 +429,14 @@ ./examples/using_make/opt_in_opt.ml:5: baz ./examples/using_make/partial_opt.ml:1: f ./examples/using_make/useless_opt.ml:1: foo -./examples/using_make/variant.mli:5: f - +./examples/using_make/variant.mli:5: f: Not detected Nothing else to report in this section -------------------------------------------------------------------------------- .> UNUSED METHODS: ================= -./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused +./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused: Not detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:1: unused#unused @@ -353,15 +446,14 @@ Nothing else to report in this section ./examples/using_dune/unwrapped_lib/obj/with_class.mli:25: fun_class#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:35: _self_used#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:41: _self_used_fun_class#unused -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int - +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected ./examples/using_dune/wrapped_lib/obj/with_class.mli:1: unused#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#never_used_fun ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#never_used_int @@ -369,15 +461,14 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/with_class.mli:25: fun_class#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:35: _self_used#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:41: _self_used_fun_class#unused -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int - +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected ./examples/using_make/obj/class.mli:1: c#h ./examples/using_make/obj/class_type.mli:9: c#h ./examples/using_make/obj/coerce.mli:6: p#f @@ -403,41 +494,39 @@ Nothing else to report in this section .>-> ALMOST UNUSED METHODS: Called 1 time(s): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#externally_used -./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#internally_used +./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#externally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#internally_used: Not detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#externally_used ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#internally_used ./examples/using_dune/unwrapped_lib/obj/with_class.mli:35: _self_used#used ./examples/using_dune/unwrapped_lib/obj/with_class.mli:41: _self_used_fun_class#used -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#externally_used_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#externally_used_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#internally_used_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#internally_used_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#externally_used_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#externally_used_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#internally_used_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#internally_used_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#used_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#used_int - +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#externally_used_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#externally_used_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#internally_used_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#internally_used_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#externally_used_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#externally_used_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#internally_used_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#internally_used_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#used_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#used_int: Not detected ./examples/using_dune/wrapped_lib/obj/with_class.mli:35: _self_used#used ./examples/using_dune/wrapped_lib/obj/with_class.mli:41: _self_used_fun_class#used -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#externally_used_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#externally_used_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#internally_used_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#internally_used_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#externally_used_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#externally_used_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#internally_used_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#internally_used_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_int - +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#externally_used_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#externally_used_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#internally_used_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#internally_used_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#externally_used_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#externally_used_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#internally_used_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#internally_used_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_int: Not detected ./examples/using_make/advanced/func.mli:3: M.c#f ./examples/using_make/advanced/mod.mli:4: p#f @@ -751,6 +840,8 @@ Nothing else to report in this section ./examples/using_make/if_end.ml:5: ?b ./examples/using_make/letIn.mli:1: ?a ./examples/using_make/let_in.ml:1: ?a +./examples/using_make/opt/sig_struct.ml:6: ?x: Should not be detected +./examples/using_make/opt/sig_struct.ml:11: ?x: Should not be detected ./examples/using_make/opt_in_opt.ml:1: ?a ./examples/using_make/opt_in_opt.ml:5: ?a ./examples/using_make/partial_opt.ml:1: ?a @@ -870,6 +961,7 @@ Nothing else to report in this section ./examples/using_make/foo.ml:1: ?a ./examples/using_make/letIn.mli:1: ?b ./examples/using_make/let_in.ml:1: ?c +./examples/using_make/opt/sig_struct.ml:2: ?x: Should not be detected ./examples/using_make/opt_in_opt.ml:2: ?a ./examples/using_make/opt_in_opt.ml:2: ?b ./examples/using_make/record.ml:12: ?b @@ -955,7 +1047,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 825 -Success: 820 -Failed: 5 -Ratio: 99.3939393939% +Total: 933 +Success: 736 +Failed: 197 +Ratio: 78.8853161844% diff --git a/check/threshold-3-0.5/threshold-3-0.5.ref b/check/threshold-3-0.5/threshold-3-0.5.ref index 518f3410..8b1f8ddc 100644 --- a/check/threshold-3-0.5/threshold-3-0.5.ref +++ b/check/threshold-3-0.5/threshold-3-0.5.ref @@ -2,25 +2,37 @@ ========================= ./examples/docs/exported_values/code_constructs/function/function_lib.mli:7: unused +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:9: F.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:10: F.unused +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:14: Internal_param.used_required: Should not be detected +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:15: Internal_param.unused_required: Should not be detected +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:26: Internal_app.unused ./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused ./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Should not be detected ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement +./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:19: M_redef.unused +./examples/docs/exported_values/code_constructs/module/module_lib.mli:5: M.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/module/module_lib.mli:6: M.unused +./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello: Should not be detected +./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye: Should not be detected +./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:4: world: Should not be detected ./examples/docs/exported_values/limitations/incl_same_name/oo.mli:20: copy: Should not be detected ./examples/docs/exported_values/limitations/incl_same_name/oo.mli:25: id: Should not be detected ./examples/docs/exported_values/limitations/incl_same_name/oo.mli:40: new_method: Should not be detected ./examples/docs/exported_values/limitations/incl_same_name/oo.mli:41: public_method_label: Should not be detected ./examples/docs/exported_values/limitations/sigincl/sigincl_lib.mli:10: I.x: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:1: unused +./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used: Should not be detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:38: internally_used_f: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused ./examples/using_dune/reduced_lib/reduced_lib.mli:3: Values.used_by_API @@ -31,18 +43,38 @@ ./examples/using_dune/reduced_lib/reduced_lib.mli:19: Values_in_submodules.Exported.internally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:27: Values_in_submodules_no_intf.Exported.used_by_API ./examples/using_dune/reduced_lib/reduced_lib.mli:28: Values_in_submodules_no_intf.Exported.internally_used +./examples/using_dune/reduced_lib/values.mli:1: used: Should not be detected +./examples/using_dune/reduced_lib/values.mli:2: used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values.mli:3: internally_used: Should not be detected +./examples/using_dune/reduced_lib/values.mli:4: externally_used: Should not be detected ./examples/using_dune/reduced_lib/values.mli:7: lib_internal_unused +./examples/using_dune/reduced_lib/values.mli:8: lib_internal_internally_used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:2: Exported.used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:3: Exported.used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:4: Exported.internally_used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:8: Exported.lib_internal_unused +./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused +./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_unused ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg - +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:12: internally_used_fun_with_single_sometimes_used_opt_arg: Should not be detected ./examples/using_dune/unwrapped_lib/values/values.mli:2: unused_int +./examples/using_dune/unwrapped_lib/values/values.mli:3: internally_used_int: Should not be detected ./examples/using_dune/unwrapped_lib/values/values.mli:14: unused_fun +./examples/using_dune/unwrapped_lib/values/values.mli:15: internally_used_fun: Should not be detected ./examples/using_dune/unwrapped_lib/values/values.mli:20: unused_alias_fun ./examples/using_dune/unwrapped_lib/values/values.mli:25: unused_closure +./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int +./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun @@ -50,12 +82,18 @@ ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg - +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:12: internally_used_fun_with_single_sometimes_used_opt_arg: Should not be detected ./examples/using_dune/wrapped_lib/values/values.mli:2: unused_int +./examples/using_dune/wrapped_lib/values/values.mli:3: internally_used_int: Should not be detected ./examples/using_dune/wrapped_lib/values/values.mli:14: unused_fun +./examples/using_dune/wrapped_lib/values/values.mli:15: internally_used_fun: Should not be detected ./examples/using_dune/wrapped_lib/values/values.mli:20: unused_alias_fun ./examples/using_dune/wrapped_lib/values/values.mli:25: unused_closure +./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int +./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected ./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int ./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int ./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun @@ -64,7 +102,8 @@ ./examples/using_make/advanced/inc_val.mli:1: x ./examples/using_make/advanced/inc_val.mli:2: y - +./examples/using_make/advanced/val.mli:1: x: Should not be detected +./examples/using_make/advanced/val.mli:2: y: Should not be detected ./examples/using_make/bar.ml:1: x ./examples/using_make/bar_fn.ml:3: h ./examples/using_make/baz.mli:1: z @@ -81,24 +120,39 @@ ./examples/using_make/dir/anon_call2.ml:9: h ./examples/using_make/dir/match_opt.ml:8: l ./examples/using_make/dir/matchopt.ml:5: w +./examples/using_make/dir/mod.mli:10: M.f: Should not be detected ./examples/using_make/dir/mod.mli:11: M.g ./examples/using_make/dir/refFn.mli:3: x ./examples/using_make/dir/ref_opt.ml:3: no ./examples/using_make/dir/ref_opt.ml:11: x +./examples/using_make/exported.mli:6: M1.five: Should not be detected +./examples/using_make/exported.mli:10: F.plus_five: Should not be detected ./examples/using_make/exported.mli:11: F.times_five +./examples/using_make/exported.mli:15: M2.five: Should not be detected +./examples/using_make/exported.mli:16: M2.plus_five: Should not be detected ./examples/using_make/exported.mli:17: M2.ten ./examples/using_make/foo.mli:2: y ./examples/using_make/fooFn.mli:2: g +./examples/using_make/functor.mli:2: M.f: Should not be detected ./examples/using_make/functor.mli:3: M.none +./examples/using_make/functor.mli:7: F.g: Should not be detected +./examples/using_make/functor.mli:11: N.g: Should not be detected ./examples/using_make/let_in.ml:3: parent ./examples/using_make/let_test.ml:3: g ./examples/using_make/matchopt.ml:5: w +./examples/using_make/mod_alias.mli:2: M1.id: Should not be detected +./examples/using_make/mod_alias.mli:6: M2.id: Should not be detected +./examples/using_make/obj/class.mli:7: o: Should not be detected +./examples/using_make/obj/class.mli:9: f: Should not be detected +./examples/using_make/obj/inher.mli:11: o: Should not be detected +./examples/using_make/obj/inher.mli:13: f: Should not be detected ./examples/using_make/opt_in_opt.ml:7: x ./examples/using_make/qux.ml:1: z ./examples/using_make/unused_fn.ml:3: g ./examples/using_make/unused_fn.ml:5: var ./examples/using_make/useless_opt.ml:3: x +./examples/using_make/variant.mli:5: f: Should not be detected -------- @@ -109,32 +163,28 @@ ./examples/docs/exported_values/code_constructs/function/function_lib.mli:9: do_nothing ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:8: F.externally_used -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:9: F.internally_used -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:14: Internal_param.used_required -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:15: Internal_param.unused_required +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:9: F.internally_used: Not detected +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:14: Internal_param.used_required: Not detected +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:15: Internal_param.unused_required: Not detected ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:19: External_param.used_required ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:20: External_param.unused_required ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:24: Internal_app.externally_used -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used - +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used: Not detected ./examples/docs/exported_values/code_constructs/include/include_lib.ml:3: Original.used_directly ./examples/docs/exported_values/code_constructs/include/include_lib.ml:4: Original.used_indirectly ./examples/docs/exported_values/code_constructs/include/include_lib.ml:14: Redefine.used_directly ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:3: Original.used_directly ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:4: Original.used_indirectly -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement - +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Not detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:17: M_redef.externally_used -./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used - +./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used: Not detected ./examples/docs/exported_values/code_constructs/module/module_lib.mli:4: M.externally_used -./examples/docs/exported_values/code_constructs/module/module_lib.mli:5: M.internally_used - +./examples/docs/exported_values/code_constructs/module/module_lib.mli:5: M.internally_used: Not detected ./examples/docs/exported_values/hello_world/hello_world_lib.mli:2: hello ./examples/docs/exported_values/hello_world/hello_world_lib.mli:3: goodbye -./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello -./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye +./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello: Not detected +./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye: Not detected ./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:2: hello ./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:3: goodbye @@ -180,8 +230,10 @@ ./examples/using_dune/bin/use_wrapped_lib/use_without_class.mli:1: mark_used ./examples/using_dune/bin/use_wrapped_lib/use_wrapped_lib.mli:1: mark_used -./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used +./examples/using_dune/preprocessed_lib/preprocessed.mli:2: used: Should not be detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:4: externally_used +./examples/using_dune/preprocessed_lib/preprocessed.mli:31: exported_f: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:4: internally_used ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:5: externally_used @@ -193,44 +245,69 @@ ./examples/using_dune/reduced_lib/reduced_lib.mli:20: Values_in_submodules.Exported.externally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:26: Values_in_submodules_no_intf.Exported.used ./examples/using_dune/reduced_lib/reduced_lib.mli:29: Values_in_submodules_no_intf.Exported.externally_used -./examples/using_dune/reduced_lib/values.mli:2: used_by_API -./examples/using_dune/reduced_lib/values.mli:4: externally_used -./examples/using_dune/reduced_lib/values.mli:8: lib_internal_internally_used +./examples/using_dune/reduced_lib/values.mli:2: used_by_API: Not detected +./examples/using_dune/reduced_lib/values.mli:4: externally_used: Not detected +./examples/using_dune/reduced_lib/values.mli:6: lib_internal_used: Should not be detected +./examples/using_dune/reduced_lib/values.mli:8: lib_internal_internally_used: Not detected ./examples/using_dune/reduced_lib/values.mli:9: lib_internal_externally_used -./examples/using_dune/reduced_lib/values_in_submodules.mli:3: Exported.used_by_API -./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used -./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used +./examples/using_dune/reduced_lib/values_in_submodules.mli:3: Exported.used_by_API: Not detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Not detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:7: Exported.lib_internal_used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used: Not detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:10: Exported.lib_internal_externally_used -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:2: Exported.used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Not detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:4: Exported.internally_used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Not detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:9: Exported.lib_internal_internally_used ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:10: Exported.lib_internal_externally_used -./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API -./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used +./examples/using_dune/reduced_lib/values_no_intf.ml:1: used: Should not be detected +./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Not detected +./examples/using_dune/reduced_lib/values_no_intf.ml:3: internally_used: Should not be detected +./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Not detected ./examples/using_dune/reduced_lib/values_no_intf.ml:12: lib_internal_internally_used ./examples/using_dune/reduced_lib/values_no_intf.ml:13: lib_internal_externally_used -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg +./examples/using_dune/unwrapped_lib/obj/with_class.mli:33: fun_class_factory: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:5: used_fun_with_single_always_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Not detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Not detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:14: externally_used_fun_with_single_never_used_opt_arg ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:16: externally_used_fun_with_single_always_used_opt_arg - +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:20: multiple_never_used_opt_args: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:22: multiple_always_used_opt_args: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:1: partially_applied_with_never_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:3: partially_applied_with_always_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:7: shadowing_never_used_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:8: shadowing_always_used_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:10: expect_fun_with_never_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig: Should not be detected ./examples/using_dune/unwrapped_lib/style/style.ml:1: all -./examples/using_dune/unwrapped_lib/values/values.mli:3: internally_used_int +./examples/using_dune/unwrapped_lib/values/values.mli:1: used_int: Should not be detected +./examples/using_dune/unwrapped_lib/values/values.mli:3: internally_used_int: Not detected ./examples/using_dune/unwrapped_lib/values/values.mli:4: externally_used_int ./examples/using_dune/unwrapped_lib/values/values.mli:5: externally_used_as_parameter_int ./examples/using_dune/unwrapped_lib/values/values.mli:7: externally_written_bool_ref ./examples/using_dune/unwrapped_lib/values/values.mli:8: externally_matched_option ./examples/using_dune/unwrapped_lib/values/values.mli:10: externally_stored_in_ref_bool ./examples/using_dune/unwrapped_lib/values/values.mli:11: externally_stored_in_option_bool -./examples/using_dune/unwrapped_lib/values/values.mli:15: internally_used_fun +./examples/using_dune/unwrapped_lib/values/values.mli:13: used_fun: Should not be detected +./examples/using_dune/unwrapped_lib/values/values.mli:15: internally_used_fun: Not detected ./examples/using_dune/unwrapped_lib/values/values.mli:16: externally_used_fun ./examples/using_dune/unwrapped_lib/values/values.mli:17: externally_used_as_parameter_fun +./examples/using_dune/unwrapped_lib/values/values.mli:19: used_alias_fun: Should not be detected ./examples/using_dune/unwrapped_lib/values/values.mli:21: externally_used_alias_fun -./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure +./examples/using_dune/unwrapped_lib/values/values.mli:23: partially_used_fun: Should not be detected +./examples/using_dune/unwrapped_lib/values/values.mli:24: used_closure: Should not be detected +./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure: Not detected ./examples/using_dune/unwrapped_lib/values/values.mli:27: externally_used_closure -./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int +./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Should not be detected +./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Not detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:5: Exported.externally_used_int ./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int ./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int @@ -248,27 +325,46 @@ ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:27: internally_used_closure ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:28: externally_used_closure -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg +./examples/using_dune/wrapped_lib/obj/with_class.mli:33: fun_class_factory: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:5: used_fun_with_single_always_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Not detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Not detected ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:14: externally_used_fun_with_single_never_used_opt_arg ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:16: externally_used_fun_with_single_always_used_opt_arg - +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:20: multiple_never_used_opt_args: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:22: multiple_always_used_opt_args: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:1: partially_applied_with_never_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:3: partially_applied_with_always_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:7: shadowing_never_used_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:8: shadowing_always_used_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:10: expect_fun_with_never_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig: Should not be detected ./examples/using_dune/wrapped_lib/style/style.ml:1: all -./examples/using_dune/wrapped_lib/values/values.mli:3: internally_used_int +./examples/using_dune/wrapped_lib/values/values.mli:1: used_int: Should not be detected +./examples/using_dune/wrapped_lib/values/values.mli:3: internally_used_int: Not detected ./examples/using_dune/wrapped_lib/values/values.mli:4: externally_used_int ./examples/using_dune/wrapped_lib/values/values.mli:5: externally_used_as_parameter_int ./examples/using_dune/wrapped_lib/values/values.mli:7: externally_written_bool_ref ./examples/using_dune/wrapped_lib/values/values.mli:8: externally_matched_option ./examples/using_dune/wrapped_lib/values/values.mli:10: externally_stored_in_ref_bool ./examples/using_dune/wrapped_lib/values/values.mli:11: externally_stored_in_option_bool -./examples/using_dune/wrapped_lib/values/values.mli:15: internally_used_fun +./examples/using_dune/wrapped_lib/values/values.mli:13: used_fun: Should not be detected +./examples/using_dune/wrapped_lib/values/values.mli:15: internally_used_fun: Not detected ./examples/using_dune/wrapped_lib/values/values.mli:16: externally_used_fun ./examples/using_dune/wrapped_lib/values/values.mli:17: externally_used_as_parameter_fun +./examples/using_dune/wrapped_lib/values/values.mli:19: used_alias_fun: Should not be detected ./examples/using_dune/wrapped_lib/values/values.mli:21: externally_used_alias_fun -./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure +./examples/using_dune/wrapped_lib/values/values.mli:23: partially_used_fun: Should not be detected +./examples/using_dune/wrapped_lib/values/values.mli:24: used_closure: Should not be detected +./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure: Not detected ./examples/using_dune/wrapped_lib/values/values.mli:27: externally_used_closure -./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int +./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Should not be detected +./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Not detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:5: Exported.externally_used_int ./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int ./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int @@ -289,9 +385,8 @@ ./examples/using_make/advanced/incl.ml:7: f ./examples/using_make/advanced/mod.mli:1: f ./examples/using_make/advanced/mod.mli:2: x -./examples/using_make/advanced/val.mli:1: x -./examples/using_make/advanced/val.mli:2: y - +./examples/using_make/advanced/val.mli:1: x: Not detected +./examples/using_make/advanced/val.mli:2: y: Not detected ./examples/using_make/baz.mli:2: t ./examples/using_make/cond_sel.ml:9: f ./examples/using_make/cond_sel.ml:11: g @@ -306,25 +401,24 @@ ./examples/using_make/dir/hidden_opt_use.ml:1: f ./examples/using_make/dir/hidden_opt_use.ml:3: apply ./examples/using_make/dir/match_opt.ml:3: m -./examples/using_make/dir/mod.mli:10: M.f +./examples/using_make/dir/mod.mli:10: M.f: Not detected ./examples/using_make/dir/partial.ml:5: g ./examples/using_make/dir/ref_fn.ml:5: g ./examples/using_make/dir/ref_opt.ml:7: g ./examples/using_make/foo.mli:1: x ./examples/using_make/fooFn.mli:1: f -./examples/using_make/functor.mli:2: M.f +./examples/using_make/functor.mli:2: M.f: Not detected ./examples/using_make/if_end.ml:1: f ./examples/using_make/if_end.ml:3: g ./examples/using_make/if_end.ml:5: h ./examples/using_make/letIn.mli:1: f -./examples/using_make/mod_alias.mli:2: M1.id -./examples/using_make/mod_alias.mli:6: M2.id - -./examples/using_make/obj/class.mli:9: f +./examples/using_make/mod_alias.mli:2: M1.id: Not detected +./examples/using_make/mod_alias.mli:6: M2.id: Not detected +./examples/using_make/obj/class.mli:9: f: Not detected ./examples/using_make/obj/fun_class.ml:8: f ./examples/using_make/obj/fun_obj_param.ml:7: app_m -./examples/using_make/obj/inher.mli:13: f +./examples/using_make/obj/inher.mli:13: f: Not detected ./examples/using_make/obj/obj_inher.ml:7: o ./examples/using_make/obj/obj_inher.ml:12: o4 ./examples/using_make/obj/obj_inher.ml:17: o2 @@ -335,90 +429,111 @@ ./examples/using_make/opt_in_opt.ml:5: baz ./examples/using_make/partial_opt.ml:1: f ./examples/using_make/useless_opt.ml:1: foo -./examples/using_make/variant.mli:5: f +./examples/using_make/variant.mli:5: f: Not detected -------- .>-> ALMOST UNUSED EXPORTED VALUES: Called 2 time(s): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./examples/docs/exported_values/hello_world/hello_world_lib.mli:4: world -./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:4: world +./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:4: world: Not detected ./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:4: world -./examples/using_dune/preprocessed_lib/preprocessed.mli:2: used -./examples/using_dune/preprocessed_lib/preprocessed.mli:31: exported_f -./examples/using_dune/preprocessed_lib/preprocessed.mli:38: internally_used_f +./examples/using_dune/preprocessed_lib/preprocessed.mli:2: used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate: Should not be detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:31: exported_f: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:38: internally_used_f: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:44: externally_used_f ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:3: used ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:53: f ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:59: internally_used_f ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:64: externally_used_f -./examples/using_dune/reduced_lib/values.mli:1: used -./examples/using_dune/reduced_lib/values.mli:3: internally_used -./examples/using_dune/reduced_lib/values.mli:6: lib_internal_used -./examples/using_dune/reduced_lib/values_in_submodules.mli:2: Exported.used -./examples/using_dune/reduced_lib/values_in_submodules.mli:4: Exported.internally_used -./examples/using_dune/reduced_lib/values_in_submodules.mli:7: Exported.lib_internal_used -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:2: Exported.used -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:4: Exported.internally_used +./examples/using_dune/reduced_lib/values.mli:1: used: Not detected +./examples/using_dune/reduced_lib/values.mli:3: internally_used: Not detected +./examples/using_dune/reduced_lib/values.mli:6: lib_internal_used: Not detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:2: Exported.used: Not detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:4: Exported.internally_used: Not detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:7: Exported.lib_internal_used: Not detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:2: Exported.used: Not detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:4: Exported.internally_used: Not detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:7: Exported.lib_internal_used -./examples/using_dune/reduced_lib/values_no_intf.ml:1: used -./examples/using_dune/reduced_lib/values_no_intf.ml:3: internally_used +./examples/using_dune/reduced_lib/values_no_intf.ml:1: used: Not detected +./examples/using_dune/reduced_lib/values_no_intf.ml:3: internally_used: Not detected ./examples/using_dune/reduced_lib/values_no_intf.ml:10: lib_internal_used -./examples/using_dune/unwrapped_lib/obj/with_class.mli:33: fun_class_factory - -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:5: used_fun_with_single_always_used_opt_arg -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:12: internally_used_fun_with_single_sometimes_used_opt_arg +./examples/using_dune/unwrapped_lib/obj/with_class.mli:21: basics_factory: Should not be detected +./examples/using_dune/unwrapped_lib/obj/with_class.mli:33: fun_class_factory: Not detected +./examples/using_dune/unwrapped_lib/opt_args/mixed_args.mli:1: interlaced_mandatory_and_opt: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/mixed_args.mli:3: interlaced_labeled_and_opt: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/mixed_args.mli:7: interlaced_mandatory_labeled_and_opt: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg: Not detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg: Not detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:5: used_fun_with_single_always_used_opt_arg: Not detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:6: used_fun_with_single_sometimes_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:12: internally_used_fun_with_single_sometimes_used_opt_arg: Not detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:18: externally_used_fun_with_single_sometimes_used_opt_arg -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:20: multiple_never_used_opt_args -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:22: multiple_always_used_opt_args -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:1: partially_applied_with_never_used_opt_arg -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:3: partially_applied_with_always_used_opt_arg -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:7: shadowing_never_used_arg -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:8: shadowing_always_used_arg -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:10: expect_fun_with_never_used_opt_arg -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig - -./examples/using_dune/unwrapped_lib/values/values.mli:1: used_int -./examples/using_dune/unwrapped_lib/values/values.mli:13: used_fun -./examples/using_dune/unwrapped_lib/values/values.mli:19: used_alias_fun -./examples/using_dune/unwrapped_lib/values/values.mli:24: used_closure -./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:2: Exported.used_int +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:20: multiple_never_used_opt_args: Not detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:22: multiple_always_used_opt_args: Not detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:26: multiple_nas_used_opt_args: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:28: multiple_ans_used_opt_args: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:30: multiple_sna_used_opt_args: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:32: multiple_san_used_opt_args: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:34: multiple_nsa_used_opt_args: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:36: multiple_asn_used_opt_args: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:1: partially_applied_with_never_used_opt_arg: Not detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:3: partially_applied_with_always_used_opt_arg: Not detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:5: partially_applied_with_sometimes_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:7: shadowing_never_used_arg: Not detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:8: shadowing_always_used_arg: Not detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:10: expect_fun_with_never_used_opt_arg: Not detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg: Not detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig: Not detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig: Not detected +./examples/using_dune/unwrapped_lib/values/values.mli:1: used_int: Not detected +./examples/using_dune/unwrapped_lib/values/values.mli:13: used_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values.mli:19: used_alias_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values.mli:24: used_closure: Not detected +./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Not detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:2: Exported.used_int ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:1: used_int ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:14: used_fun ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:21: used_alias_fun ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:26: used_closure -./examples/using_dune/wrapped_lib/obj/with_class.mli:33: fun_class_factory - -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:5: used_fun_with_single_always_used_opt_arg -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:12: internally_used_fun_with_single_sometimes_used_opt_arg +./examples/using_dune/wrapped_lib/obj/with_class.mli:21: basics_factory: Should not be detected +./examples/using_dune/wrapped_lib/obj/with_class.mli:33: fun_class_factory: Not detected +./examples/using_dune/wrapped_lib/opt_args/mixed_args.mli:1: interlaced_mandatory_and_opt: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/mixed_args.mli:3: interlaced_labeled_and_opt: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/mixed_args.mli:7: interlaced_mandatory_labeled_and_opt: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg: Not detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg: Not detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:5: used_fun_with_single_always_used_opt_arg: Not detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:6: used_fun_with_single_sometimes_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:12: internally_used_fun_with_single_sometimes_used_opt_arg: Not detected ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:18: externally_used_fun_with_single_sometimes_used_opt_arg -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:20: multiple_never_used_opt_args -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:22: multiple_always_used_opt_args -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:1: partially_applied_with_never_used_opt_arg -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:3: partially_applied_with_always_used_opt_arg -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:7: shadowing_never_used_arg -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:8: shadowing_always_used_arg -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:10: expect_fun_with_never_used_opt_arg -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig - -./examples/using_dune/wrapped_lib/values/values.mli:1: used_int -./examples/using_dune/wrapped_lib/values/values.mli:13: used_fun -./examples/using_dune/wrapped_lib/values/values.mli:19: used_alias_fun -./examples/using_dune/wrapped_lib/values/values.mli:24: used_closure -./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:2: Exported.used_int +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:20: multiple_never_used_opt_args: Not detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:22: multiple_always_used_opt_args: Not detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:26: multiple_nas_used_opt_args: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:28: multiple_ans_used_opt_args: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:30: multiple_sna_used_opt_args: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:32: multiple_san_used_opt_args: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:34: multiple_nsa_used_opt_args: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:36: multiple_asn_used_opt_args: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:1: partially_applied_with_never_used_opt_arg: Not detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:3: partially_applied_with_always_used_opt_arg: Not detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:5: partially_applied_with_sometimes_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:7: shadowing_never_used_arg: Not detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:8: shadowing_always_used_arg: Not detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:10: expect_fun_with_never_used_opt_arg: Not detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg: Not detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig: Not detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig: Not detected +./examples/using_dune/wrapped_lib/values/values.mli:1: used_int: Not detected +./examples/using_dune/wrapped_lib/values/values.mli:13: used_fun: Not detected +./examples/using_dune/wrapped_lib/values/values.mli:19: used_alias_fun: Not detected +./examples/using_dune/wrapped_lib/values/values.mli:24: used_closure: Not detected +./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Not detected ./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:2: Exported.used_int ./examples/using_dune/wrapped_lib/values/values_no_intf.ml:1: used_int ./examples/using_dune/wrapped_lib/values/values_no_intf.ml:14: used_fun @@ -433,16 +548,16 @@ ./examples/using_make/dir/ref_opt.ml:1: f ./examples/using_make/dir/ref_opt.ml:5: r -./examples/using_make/exported.mli:6: M1.five -./examples/using_make/exported.mli:15: M2.five -./examples/using_make/functor.mli:7: F.g -./examples/using_make/functor.mli:11: N.g - -./examples/using_make/obj/class.mli:7: o +./examples/using_make/exported.mli:6: M1.five: Not detected +./examples/using_make/exported.mli:15: M2.five: Not detected +./examples/using_make/functor.mli:7: F.g: Not detected +./examples/using_make/functor.mli:11: N.g: Not detected +./examples/using_make/obj/class.mli:7: o: Not detected ./examples/using_make/obj/fun_obj_param.ml:1: f -./examples/using_make/obj/inher.mli:11: o +./examples/using_make/obj/inher.mli:11: o: Not detected ./examples/using_make/obj/object.ml:1: o +./examples/using_make/opt/sig_struct.ml:6: f: Should not be detected ./examples/using_make/opt_in_opt.ml:1: foo ./examples/using_make/unused_fn.ml:1: f -------- @@ -450,28 +565,30 @@ .>-> ALMOST UNUSED EXPORTED VALUES: Called 3 time(s): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:24: multiple_sometimes_used_opt_args: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:19: aliased_fun +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:24: multiple_sometimes_used_opt_args: Should not be detected ./examples/using_dune/wrapped_lib/values/values_no_intf.ml:19: aliased_fun ./examples/using_make/dir/anonFn2.mli:1: f ./examples/using_make/dir/anonFn2.mli:2: g ./examples/using_make/dir/match_opt.ml:1: f +./examples/using_make/dir/refFn.mli:1: r: Should not be detected ./examples/using_make/dir/ref_fn.ml:1: f -./examples/using_make/exported.mli:10: F.plus_five -./examples/using_make/exported.mli:16: M2.plus_five +./examples/using_make/exported.mli:10: F.plus_five: Not detected +./examples/using_make/exported.mli:16: M2.plus_five: Not detected ./examples/using_make/let_in.ml:1: complicated -./examples/using_make/opt/sig_struct.ml:6: f - +./examples/using_make/opt/sig_struct.ml:6: f: Not detected Nothing else to report in this section -------------------------------------------------------------------------------- .> UNUSED METHODS: ================= -./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused +./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused: Not detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:1: unused#unused @@ -481,15 +598,14 @@ Nothing else to report in this section ./examples/using_dune/unwrapped_lib/obj/with_class.mli:25: fun_class#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:35: _self_used#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:41: _self_used_fun_class#unused -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int - +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected ./examples/using_dune/wrapped_lib/obj/with_class.mli:1: unused#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#never_used_fun ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#never_used_int @@ -497,15 +613,14 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/with_class.mli:25: fun_class#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:35: _self_used#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:41: _self_used_fun_class#unused -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int - +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected ./examples/using_make/obj/class.mli:1: c#h ./examples/using_make/obj/class_type.mli:9: c#h ./examples/using_make/obj/coerce.mli:6: p#f @@ -531,41 +646,39 @@ Nothing else to report in this section .>-> ALMOST UNUSED METHODS: Called 1 time(s): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#externally_used -./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#internally_used +./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#externally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#internally_used: Not detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#externally_used ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#internally_used ./examples/using_dune/unwrapped_lib/obj/with_class.mli:35: _self_used#used ./examples/using_dune/unwrapped_lib/obj/with_class.mli:41: _self_used_fun_class#used -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#externally_used_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#externally_used_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#internally_used_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#internally_used_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#externally_used_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#externally_used_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#internally_used_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#internally_used_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#used_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#used_int - +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#externally_used_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#externally_used_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#internally_used_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#internally_used_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#externally_used_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#externally_used_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#internally_used_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#internally_used_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#used_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#used_int: Not detected ./examples/using_dune/wrapped_lib/obj/with_class.mli:35: _self_used#used ./examples/using_dune/wrapped_lib/obj/with_class.mli:41: _self_used_fun_class#used -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#externally_used_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#externally_used_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#internally_used_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#internally_used_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#externally_used_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#externally_used_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#internally_used_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#internally_used_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_int - +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#externally_used_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#externally_used_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#internally_used_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#internally_used_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#externally_used_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#externally_used_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#internally_used_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#internally_used_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_int: Not detected ./examples/using_make/advanced/func.mli:3: M.c#f ./examples/using_make/advanced/mod.mli:4: p#f @@ -597,7 +710,7 @@ Nothing else to report in this section .>-> ALMOST UNUSED METHODS: Called 2 time(s): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#used +./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#used: Not detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#used ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#externally_used_fun @@ -607,11 +720,10 @@ Nothing else to report in this section ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#sometimes_used_fun ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#sometimes_used_int ./examples/using_dune/unwrapped_lib/obj/with_class.mli:25: fun_class#used -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#used_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#used_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#used_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#used_int - +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#used_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#used_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#used_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#used_int: Not detected ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#externally_used_fun ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#externally_used_int ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#internally_used_fun @@ -619,11 +731,10 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#sometimes_used_fun ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#sometimes_used_int ./examples/using_dune/wrapped_lib/obj/with_class.mli:25: fun_class#used -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#used_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#used_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#used_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#used_int - +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#used_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#used_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#used_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#used_int: Not detected ./examples/using_make/obj/class_type.mli:7: p#g ./examples/using_make/obj/coerce.mli:8: c#f ./examples/using_make/obj/named.mli:1: p1#f @@ -961,6 +1072,8 @@ Nothing else to report in this section ./examples/using_make/if_end.ml:5: ?b ./examples/using_make/letIn.mli:1: ?a ./examples/using_make/let_in.ml:1: ?a +./examples/using_make/opt/sig_struct.ml:6: ?x: Should not be detected +./examples/using_make/opt/sig_struct.ml:11: ?x: Should not be detected ./examples/using_make/opt_in_opt.ml:1: ?a ./examples/using_make/opt_in_opt.ml:5: ?a ./examples/using_make/partial_opt.ml:1: ?a @@ -1058,9 +1171,7 @@ Nothing else to report in this section ./examples/using_make/dir/ref_fn.ml:1: ?b (2/3 calls) ./examples/using_make/matchopt.ml:1: ?x (3/4 calls) - -./examples/using_make/opt/sig_struct.ml:2: ?x (2/3 calls) - +./examples/using_make/opt/sig_struct.ml:2: ?x (2/3 calls): Not detected ./examples/using_make/opt_in_opt.ml:1: ?b (1/2 calls) -------- @@ -1178,6 +1289,7 @@ Nothing else to report in this section ./examples/using_make/foo.ml:1: ?a ./examples/using_make/letIn.mli:1: ?b ./examples/using_make/let_in.ml:1: ?c +./examples/using_make/opt/sig_struct.ml:2: ?x: Should not be detected ./examples/using_make/opt_in_opt.ml:2: ?a ./examples/using_make/opt_in_opt.ml:2: ?b ./examples/using_make/record.ml:12: ?b @@ -1344,7 +1456,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 1137 -Success: 1132 -Failed: 5 -Ratio: 99.5602462621% +Total: 1274 +Success: 975 +Failed: 299 +Ratio: 76.5306122449% diff --git a/dead_code_analyzer.opam b/dead_code_analyzer.opam index 2ae96e5e..116ede5d 100644 --- a/dead_code_analyzer.opam +++ b/dead_code_analyzer.opam @@ -15,7 +15,7 @@ homepage: "https://github.com/LexiFi/dead_code_analyzer" bug-reports: "https://github.com/LexiFi/dead_code_analyzer/issues" depends: [ "dune" {>= "3.20"} - "ocaml" {>= "5.2" & < "5.3"} + "ocaml" {>= "5.3" & < "5.4"} "odoc" {with-doc} ] build: [ diff --git a/dune-project b/dune-project index 3eb6ae40..6ce3b6fa 100644 --- a/dune-project +++ b/dune-project @@ -22,6 +22,6 @@ (synopsis "Dead code analyzer for OCaml") (license MIT) (depends - (ocaml (and (>= 5.2) (< 5.3))) + (ocaml (and (>= 5.3) (< 5.4))) ) ) diff --git a/src/deadCode.ml b/src/deadCode.ml index a05a491b..22d96e26 100644 --- a/src/deadCode.ml +++ b/src/deadCode.ml @@ -112,8 +112,12 @@ let rec treat_exp exp args = | Texp_field (_, _, {lbl_loc = {Location.loc_start = loc; _}; _}) -> DeadArg.register_uses loc args - | Texp_match (_, l, _) -> - List.iter (fun {c_rhs = exp; _} -> treat_exp exp args) l + | Texp_match (_, comp_l, val_l, _) -> + let process_cases l = + List.iter (fun {c_rhs = exp; _} -> treat_exp exp args) l + in + process_cases comp_l; + process_cases val_l | Texp_ifthenelse (_, exp_then, exp_else) -> treat_exp exp_then args; @@ -302,7 +306,7 @@ let expr super self e = "let () = ... in ... (=> use sequence)" end - | Texp_match (_, [{c_lhs; _}], _) + | Texp_match (_, [{c_lhs; _}], [], _) when DeadType.is_unit c_lhs.pat_type && sections.style.seq -> begin match c_lhs.pat_desc with | Tpat_value tpat_arg -> @@ -502,15 +506,31 @@ let load_file fn state = regabs state; match state.file_infos.cmt_infos with | None -> bad_files := fn :: !bad_files - | Some {cmt_annots = Implementation x; cmt_value_dependencies; _} -> - let prepare = function - | {Types.val_loc = {Location.loc_start = loc1; loc_ghost = false; _}; _}, - {Types.val_loc = {Location.loc_start = loc2; loc_ghost = false; _}; _} -> - DeadObj.add_equal loc1 loc2; - VdNode.merge_locs ~force:true loc2 loc1 - | _ -> () + | Some ({cmt_annots = Implementation x; _} as cmt_infos) -> + let uid_decl_dep_to_loc_pair (_dep_kind, uid_def, uid_decl) = + let ( let* ) x f = Option.bind x f in + let loc_opt_of_uid uid = + let* decl = + Uid.Tbl.find_opt cmt_infos.cmt_uid_to_decl uid + in + match decl with + | Value {val_loc = {loc_start; loc_ghost = false; _}; _} -> + Some loc_start + | _ -> None + in + let* def_loc = loc_opt_of_uid uid_def in + let* decl_loc = loc_opt_of_uid uid_decl in + Some (def_loc, decl_loc) + in + let value_dep = + cmt_infos.cmt_declaration_dependencies + |> List.filter_map uid_decl_dep_to_loc_pair + in + let prepare (loc1, loc2) = + DeadObj.add_equal loc1 loc2; + VdNode.merge_locs ~force:true loc2 loc1 in - List.iter prepare cmt_value_dependencies; + List.iter prepare value_dep; ignore (collect_references.Tast_mapper.structure collect_references x); @@ -523,14 +543,12 @@ let load_file fn state = String.equal (Utils.Filepath.unit pos.pos_fname) sourceunit in List.filter_map - (fun (vd1, vd2) -> - let loc1 = vd1.Types.val_loc.Location.loc_start in - let loc2 = vd2.Types.val_loc.Location.loc_start in + (fun (loc1, loc2) -> if in_sourceunit loc1 || in_sourceunit loc2 then Some (loc1, loc2) else None ) - cmt_value_dependencies + value_dep else [] in eof loc_dep diff --git a/src/deadLexiFi.ml b/src/deadLexiFi.ml index 2fd31876..f76ac0b9 100644 --- a/src/deadLexiFi.ml +++ b/src/deadLexiFi.ml @@ -38,7 +38,8 @@ let () = DeadLexiFi.sig_value := (fun value -> let add strct = match strct.pstr_desc with - | Pstr_eval ({pexp_desc = Pexp_constant (Pconst_string (s, _, _)); _}, _) -> + | Pstr_eval ({pexp_desc = Pexp_constant {pconst_desc= (Pconst_string (s, _, _)); _}; + _}, _) -> hashtbl_add_unique_to_list str s value.val_loc.loc_start | _ -> () in diff --git a/src/utils.ml b/src/utils.ml index bb524456..8c015531 100644 --- a/src/utils.ml +++ b/src/utils.ml @@ -10,7 +10,7 @@ module Filepath = struct | _ -> filepath let unit filepath = - Unit_info.modname_from_source filepath + Unit_info.lax_modname_from_source filepath type kind = | Cmi From a953e878d25a2db956684b42acda14f5c4f0200d Mon Sep 17 00:00:00 2001 From: Corentin De Souza <9597216+fantazio@users.noreply.github.com> Date: Sat, 6 Dec 2025 19:15:52 +0100 Subject: [PATCH 02/12] [src][utils] move `Mod.sign` to `Utils.signature_of_modtype` This will be used in by the state component --- src/deadCode.ml | 6 +++--- src/deadMod.ml | 12 ++---------- src/utils.ml | 8 ++++++++ src/utils.mli | 9 +++++++++ 4 files changed, 22 insertions(+), 13 deletions(-) diff --git a/src/deadCode.ml b/src/deadCode.ml index 22d96e26..dc75fe6c 100644 --- a/src/deadCode.ml +++ b/src/deadCode.ml @@ -98,7 +98,7 @@ let rec collect_export ~context path u stock = function | Sig_modtype _, _ -> in_modtype, In_modtyp (id, loc) | _, _ -> stock, In_module (id, loc) in - DeadMod.sign t + Utils.signature_of_modtype t |> List.iter (collect_export ~context (id :: path) u stock) | _ -> () @@ -195,9 +195,9 @@ let structure_item super self i = in let rec includ mod_expr = match mod_expr.mod_desc with - | Tmod_ident (_, _) -> collect_include (DeadMod.sign mod_expr.mod_type) + | Tmod_ident (_, _) -> collect_include (Utils.signature_of_modtype mod_expr.mod_type) | Tmod_structure structure -> collect_include structure.str_type - | Tmod_unpack (_, mod_type) -> collect_include (DeadMod.sign mod_type) + | Tmod_unpack (_, mod_type) -> collect_include (Utils.signature_of_modtype mod_type) | Tmod_functor (_, mod_expr) | Tmod_apply (_, mod_expr, _) | Tmod_apply_unit mod_expr diff --git a/src/deadMod.ml b/src/deadMod.ml index 84742948..6d0fd9a3 100644 --- a/src/deadMod.ml +++ b/src/deadMod.ml @@ -16,14 +16,6 @@ open DeadCommon let defined : string list ref = ref [] - -let rec sign ?(select_param = false) = function - | Mty_signature sg -> sg - | Mty_functor (_, t) when not select_param -> sign t - | Mty_functor (Named (_, t), _) -> sign t - | _ -> [] - - let item maker = function | Sig_value (id, {val_loc = {Location.loc_start= loc; _}; _}, _) -> (Ident.name id, loc)::[] @@ -52,12 +44,12 @@ let item maker = function | _ -> [] let rec make_content typ = - List.map (item make_content) (sign typ) + List.map (item make_content) (Utils.signature_of_modtype typ) |> List.flatten let rec make_arg typ = - List.map (item make_arg) (sign ~select_param:true typ) + List.map (item make_arg) (Utils.signature_of_modtype ~select_param:true typ) |> List.flatten diff --git a/src/utils.ml b/src/utils.ml index 8c015531..59bbb0a0 100644 --- a/src/utils.ml +++ b/src/utils.ml @@ -31,4 +31,12 @@ module Filepath = struct else Ignore end +let rec signature_of_modtype ?(select_param = false) modtype = + let open Types in + match modtype with + | Mty_signature sg -> sg + | Mty_functor (_, t) when not select_param -> signature_of_modtype t + | Mty_functor (Named (_, t), _) -> signature_of_modtype t + | _ -> [] + module StringSet = Set.Make(String) diff --git a/src/utils.mli b/src/utils.mli index f9fe1424..86407a5d 100644 --- a/src/utils.mli +++ b/src/utils.mli @@ -22,4 +22,13 @@ module Filepath : sig Other kinds are self explanatory. *) end +val signature_of_modtype : + ?select_param:bool -> Types.module_type -> Types.signature +(** [signature_of_modtype ?select_param modtype] returns the selected signature + of [modtype]. If [modtype] is a functor, then [select_param] is used to + select either the signature of the parameter or the result of the functor. + Note: [select_param] is [false] by default. If set to [true], it is reset to + [false] after looking for the parameter of the first functor. + There is currently no way to select the parameter of a parameter. *) + module StringSet : Set.S with type elt = String.t From 1bd10b534e99aa3954f58bcc460db41f31d668a5 Mon Sep 17 00:00:00 2001 From: Corentin De Souza <9597216+fantazio@users.noreply.github.com> Date: Fri, 5 Dec 2025 22:44:35 +0100 Subject: [PATCH 03/12] [src][input][1/n] rely on `.cmti` instead of `.cmi` If a compilation has a`.mli`, then it has a `.cmti` which is more complete than the `.cmi`. This extra information is useful to fill the state's `file_infos`. However, a `.ml` wihtout a corresponding `.mli` does not have a corresponding `.cmti`. Hence, introducing even more mistakes for now. Now that interfaces are read from `.cmti` instead of `.cmi`, the order in which the files are read is reversed to ensure interfaces (`.cmti`) are read before their corresponding implementation (`.cmt`) --- README.md | 2 +- check/classic/classic.ref | 130 +++---- check/internal/internal.ref | 130 +++---- check/threshold-1/threshold-1.ref | 332 ++++++++--------- check/threshold-3-0.5/threshold-3-0.5.ref | 419 ++++++++++------------ docs/USAGE.md | 14 +- docs/exported_values/HELLO_WORLD.md | 33 +- src/config/config.ml | 2 +- src/deadCode.ml | 62 ++-- src/deadCommon.ml | 2 +- src/state/file_infos.ml | 246 ++++--------- src/state/file_infos.mli | 21 +- src/state/state.ml | 10 +- src/utils.ml | 4 +- src/utils.mli | 2 +- 15 files changed, 594 insertions(+), 815 deletions(-) diff --git a/README.md b/README.md index 4158c892..237c7f09 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Dead-code analyzer for OCaml ## Overview The tool assumes that **.mli** files are compiled with **-keep-locs** and **.ml** -files with **-bin-annot**. Exported values are collected by reading .cmi or .cmt +files with **-bin-annot**. Exported values are collected by reading .cmti or .cmt files (depending on the existence of an explicit .mli interface). References to such values are collected by reading typed trees from .cmt files diff --git a/check/classic/classic.ref b/check/classic/classic.ref index 5c224477..3cef088f 100644 --- a/check/classic/classic.ref +++ b/check/classic/classic.ref @@ -9,13 +9,10 @@ ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:26: Internal_app.unused -./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused -./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused - -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Should not be detected -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement - +./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused: Not detected +./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused: Not detected +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused: Not detected +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement: Not detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:19: M_redef.unused @@ -26,16 +23,11 @@ ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:4: world -./examples/docs/exported_values/limitations/incl_same_name/oo.mli:20: copy: Should not be detected -./examples/docs/exported_values/limitations/incl_same_name/oo.mli:25: id: Should not be detected -./examples/docs/exported_values/limitations/incl_same_name/oo.mli:40: new_method: Should not be detected -./examples/docs/exported_values/limitations/incl_same_name/oo.mli:41: public_method_label: Should not be detected ./examples/docs/exported_values/limitations/sigincl/sigincl_lib.mli:10: I.x: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:1: unused ./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used ./examples/using_dune/preprocessed_lib/preprocessed.mli:38: internally_used_f -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused - +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused: Not detected ./examples/using_dune/reduced_lib/reduced_lib.mli:3: Values.used_by_API ./examples/using_dune/reduced_lib/reduced_lib.mli:4: Values.internally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:10: Values_no_intf.used_by_API @@ -56,13 +48,8 @@ ./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:8: Exported.lib_internal_unused ./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused -./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Should not be detected -./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_unused - +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused: Not detected +./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_unused: Not detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg @@ -77,12 +64,11 @@ ./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int -./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:20: unused_alias_fun -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure - +./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:20: unused_alias_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure: Not detected ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg @@ -97,38 +83,35 @@ ./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int -./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:20: unused_alias_fun -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:25: unused_closure - +./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:20: unused_alias_fun: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:25: unused_closure: Not detected ./examples/using_make/advanced/inc_val.mli:1: x ./examples/using_make/advanced/inc_val.mli:2: y ./examples/using_make/advanced/val.mli:1: x: Should not be detected ./examples/using_make/advanced/val.mli:2: y: Should not be detected -./examples/using_make/bar.ml:1: x -./examples/using_make/bar_fn.ml:3: h +./examples/using_make/bar.ml:1: x: Not detected +./examples/using_make/bar_fn.ml:3: h: Not detected ./examples/using_make/baz.mli:1: z ./examples/using_make/baz.mli:3: u -./examples/using_make/cond_sel.ml:13: h - -./examples/using_make/dir/alias_opt.ml:7: y -./examples/using_make/dir/alias_opt.ml:14: x -./examples/using_make/dir/anon_call.ml:1: f -./examples/using_make/dir/anon_call.ml:5: g -./examples/using_make/dir/anon_call.ml:9: h -./examples/using_make/dir/anon_call2.ml:1: f -./examples/using_make/dir/anon_call2.ml:5: g -./examples/using_make/dir/anon_call2.ml:9: h -./examples/using_make/dir/match_opt.ml:8: l -./examples/using_make/dir/matchopt.ml:5: w +./examples/using_make/cond_sel.ml:13: h: Not detected +./examples/using_make/dir/alias_opt.ml:7: y: Not detected +./examples/using_make/dir/alias_opt.ml:14: x: Not detected +./examples/using_make/dir/anon_call.ml:1: f: Not detected +./examples/using_make/dir/anon_call.ml:5: g: Not detected +./examples/using_make/dir/anon_call.ml:9: h: Not detected +./examples/using_make/dir/anon_call2.ml:1: f: Not detected +./examples/using_make/dir/anon_call2.ml:5: g: Not detected +./examples/using_make/dir/anon_call2.ml:9: h: Not detected +./examples/using_make/dir/match_opt.ml:8: l: Not detected +./examples/using_make/dir/matchopt.ml:5: w: Not detected ./examples/using_make/dir/mod.mli:10: M.f ./examples/using_make/dir/mod.mli:11: M.g ./examples/using_make/dir/refFn.mli:3: x -./examples/using_make/dir/ref_opt.ml:3: no -./examples/using_make/dir/ref_opt.ml:11: x - +./examples/using_make/dir/ref_opt.ml:3: no: Not detected +./examples/using_make/dir/ref_opt.ml:11: x: Not detected ./examples/using_make/exported.mli:6: M1.five ./examples/using_make/exported.mli:10: F.plus_five ./examples/using_make/exported.mli:11: F.times_five @@ -141,9 +124,9 @@ ./examples/using_make/functor.mli:3: M.none ./examples/using_make/functor.mli:7: F.g ./examples/using_make/functor.mli:11: N.g -./examples/using_make/let_in.ml:3: parent -./examples/using_make/let_test.ml:3: g -./examples/using_make/matchopt.ml:5: w +./examples/using_make/let_in.ml:3: parent: Not detected +./examples/using_make/let_test.ml:3: g: Not detected +./examples/using_make/matchopt.ml:5: w: Not detected ./examples/using_make/mod_alias.mli:2: M1.id ./examples/using_make/mod_alias.mli:6: M2.id @@ -152,11 +135,11 @@ ./examples/using_make/obj/inher.mli:11: o ./examples/using_make/obj/inher.mli:13: f -./examples/using_make/opt_in_opt.ml:7: x -./examples/using_make/qux.ml:1: z -./examples/using_make/unused_fn.ml:3: g -./examples/using_make/unused_fn.ml:5: var -./examples/using_make/useless_opt.ml:3: x +./examples/using_make/opt_in_opt.ml:7: x: Not detected +./examples/using_make/qux.ml:1: z: Not detected +./examples/using_make/unused_fn.ml:3: g: Not detected +./examples/using_make/unused_fn.ml:5: var: Not detected +./examples/using_make/useless_opt.ml:3: x: Not detected ./examples/using_make/variant.mli:5: f Nothing else to report in this section @@ -166,8 +149,7 @@ Nothing else to report in this section .> UNUSED METHODS: ================= ./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused - +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused: Not detected ./examples/using_dune/unwrapped_lib/obj/with_class.mli:1: unused#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#never_used_fun ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#never_used_int @@ -198,22 +180,23 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected +./examples/using_make/advanced/mod.mli:4: p#f: Should not be detected ./examples/using_make/obj/class.mli:1: c#h ./examples/using_make/obj/class_type.mli:9: c#h ./examples/using_make/obj/coerce.mli:6: p#f ./examples/using_make/obj/coerce.mli:6: p#h -./examples/using_make/obj/constraint.ml:1: p#g +./examples/using_make/obj/constraint.ml:1: p#g: Not detected ./examples/using_make/obj/fooCl.mli:1: p1#g ./examples/using_make/obj/fooCl.mli:1: p1#h ./examples/using_make/obj/fooCl.mli:7: p2#h -./examples/using_make/obj/fun_class.ml:1: c#m3 -./examples/using_make/obj/fun_obj_param.ml:1: f#n +./examples/using_make/obj/fun_class.ml:1: c#m3: Not detected +./examples/using_make/obj/fun_obj_param.ml:1: f#n: Not detected ./examples/using_make/obj/inher.mli:1: p#h ./examples/using_make/obj/named.mli:10: c#g -./examples/using_make/obj/obj_inher.ml:1: c#g -./examples/using_make/obj/obj_inher.ml:1: c#h -./examples/using_make/obj/obj_inher.ml:19: o3#k -./examples/using_make/obj/object.ml:1: o#h +./examples/using_make/obj/obj_inher.ml:1: c#g: Not detected +./examples/using_make/obj/obj_inher.ml:1: c#h: Not detected +./examples/using_make/obj/obj_inher.ml:19: o3#k: Not detected +./examples/using_make/obj/object.ml:1: o#h: Not detected ./examples/using_make/obj/overr.mli:1: p1#g ./examples/using_make/obj/overr.mli:1: p1#h ./examples/using_make/obj/overr.mli:7: p2#g @@ -228,10 +211,9 @@ Nothing else to report in this section ./examples/using_dune/preprocessed_lib/preprocessed.mli:14: constructors.Unused ./examples/using_dune/preprocessed_lib/preprocessed.mli:19: constr_with_eq.Unused ./examples/using_dune/preprocessed_lib/preprocessed.mli:23: record.unused -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:25: constructors.Unused -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:30: constr_with_eq.Unused -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:39: record.unused - +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:25: constructors.Unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:30: constr_with_eq.Unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:39: record.unused: Not detected ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:1: unused_single_no_param.Unused_single_no_param ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:2: unused_single_unit.Unused_single_unit ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:3: unused_single_param.Unused_single_param @@ -638,7 +620,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 554 -Success: 514 -Failed: 40 -Ratio: 92.7797833935% +Total: 546 +Success: 463 +Failed: 83 +Ratio: 84.7985347985% diff --git a/check/internal/internal.ref b/check/internal/internal.ref index afc8cde8..b57234e5 100644 --- a/check/internal/internal.ref +++ b/check/internal/internal.ref @@ -9,13 +9,10 @@ ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:26: Internal_app.unused -./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused -./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused - -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Should not be detected -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement - +./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused: Not detected +./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused: Not detected +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused: Not detected +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement: Not detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:19: M_redef.unused @@ -25,16 +22,11 @@ ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello: Should not be detected ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye: Should not be detected ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:4: world: Should not be detected -./examples/docs/exported_values/limitations/incl_same_name/oo.mli:20: copy: Should not be detected -./examples/docs/exported_values/limitations/incl_same_name/oo.mli:25: id: Should not be detected -./examples/docs/exported_values/limitations/incl_same_name/oo.mli:40: new_method: Should not be detected -./examples/docs/exported_values/limitations/incl_same_name/oo.mli:41: public_method_label: Should not be detected ./examples/docs/exported_values/limitations/sigincl/sigincl_lib.mli:10: I.x: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:1: unused ./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:38: internally_used_f: Should not be detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused - +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused: Not detected ./examples/using_dune/reduced_lib/reduced_lib.mli:3: Values.used_by_API ./examples/using_dune/reduced_lib/reduced_lib.mli:4: Values.internally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:10: Values_no_intf.used_by_API @@ -55,13 +47,8 @@ ./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:8: Exported.lib_internal_unused ./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused -./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Should not be detected -./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_unused - +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused: Not detected +./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_unused: Not detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected @@ -75,12 +62,11 @@ ./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected -./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:20: unused_alias_fun -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure - +./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:20: unused_alias_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure: Not detected ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected @@ -94,38 +80,35 @@ ./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected -./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:20: unused_alias_fun -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:25: unused_closure - +./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:20: unused_alias_fun: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:25: unused_closure: Not detected ./examples/using_make/advanced/inc_val.mli:1: x ./examples/using_make/advanced/inc_val.mli:2: y ./examples/using_make/advanced/val.mli:1: x: Should not be detected ./examples/using_make/advanced/val.mli:2: y: Should not be detected -./examples/using_make/bar.ml:1: x -./examples/using_make/bar_fn.ml:3: h +./examples/using_make/bar.ml:1: x: Not detected +./examples/using_make/bar_fn.ml:3: h: Not detected ./examples/using_make/baz.mli:1: z ./examples/using_make/baz.mli:3: u -./examples/using_make/cond_sel.ml:13: h - -./examples/using_make/dir/alias_opt.ml:7: y -./examples/using_make/dir/alias_opt.ml:14: x -./examples/using_make/dir/anon_call.ml:1: f -./examples/using_make/dir/anon_call.ml:5: g -./examples/using_make/dir/anon_call.ml:9: h -./examples/using_make/dir/anon_call2.ml:1: f -./examples/using_make/dir/anon_call2.ml:5: g -./examples/using_make/dir/anon_call2.ml:9: h -./examples/using_make/dir/match_opt.ml:8: l -./examples/using_make/dir/matchopt.ml:5: w +./examples/using_make/cond_sel.ml:13: h: Not detected +./examples/using_make/dir/alias_opt.ml:7: y: Not detected +./examples/using_make/dir/alias_opt.ml:14: x: Not detected +./examples/using_make/dir/anon_call.ml:1: f: Not detected +./examples/using_make/dir/anon_call.ml:5: g: Not detected +./examples/using_make/dir/anon_call.ml:9: h: Not detected +./examples/using_make/dir/anon_call2.ml:1: f: Not detected +./examples/using_make/dir/anon_call2.ml:5: g: Not detected +./examples/using_make/dir/anon_call2.ml:9: h: Not detected +./examples/using_make/dir/match_opt.ml:8: l: Not detected +./examples/using_make/dir/matchopt.ml:5: w: Not detected ./examples/using_make/dir/mod.mli:10: M.f: Should not be detected ./examples/using_make/dir/mod.mli:11: M.g ./examples/using_make/dir/refFn.mli:3: x -./examples/using_make/dir/ref_opt.ml:3: no -./examples/using_make/dir/ref_opt.ml:11: x - +./examples/using_make/dir/ref_opt.ml:3: no: Not detected +./examples/using_make/dir/ref_opt.ml:11: x: Not detected ./examples/using_make/exported.mli:6: M1.five: Should not be detected ./examples/using_make/exported.mli:10: F.plus_five: Should not be detected ./examples/using_make/exported.mli:11: F.times_five @@ -138,20 +121,20 @@ ./examples/using_make/functor.mli:3: M.none ./examples/using_make/functor.mli:7: F.g: Should not be detected ./examples/using_make/functor.mli:11: N.g: Should not be detected -./examples/using_make/let_in.ml:3: parent -./examples/using_make/let_test.ml:3: g -./examples/using_make/matchopt.ml:5: w +./examples/using_make/let_in.ml:3: parent: Not detected +./examples/using_make/let_test.ml:3: g: Not detected +./examples/using_make/matchopt.ml:5: w: Not detected ./examples/using_make/mod_alias.mli:2: M1.id: Should not be detected ./examples/using_make/mod_alias.mli:6: M2.id: Should not be detected ./examples/using_make/obj/class.mli:7: o: Should not be detected ./examples/using_make/obj/class.mli:9: f: Should not be detected ./examples/using_make/obj/inher.mli:11: o: Should not be detected ./examples/using_make/obj/inher.mli:13: f: Should not be detected -./examples/using_make/opt_in_opt.ml:7: x -./examples/using_make/qux.ml:1: z -./examples/using_make/unused_fn.ml:3: g -./examples/using_make/unused_fn.ml:5: var -./examples/using_make/useless_opt.ml:3: x +./examples/using_make/opt_in_opt.ml:7: x: Not detected +./examples/using_make/qux.ml:1: z: Not detected +./examples/using_make/unused_fn.ml:3: g: Not detected +./examples/using_make/unused_fn.ml:5: var: Not detected +./examples/using_make/useless_opt.ml:3: x: Not detected ./examples/using_make/variant.mli:5: f: Should not be detected Nothing else to report in this section -------------------------------------------------------------------------------- @@ -160,8 +143,7 @@ Nothing else to report in this section .> UNUSED METHODS: ================= ./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused - +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused: Not detected ./examples/using_dune/unwrapped_lib/obj/with_class.mli:1: unused#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#never_used_fun ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#never_used_int @@ -192,22 +174,23 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected +./examples/using_make/advanced/mod.mli:4: p#f: Should not be detected ./examples/using_make/obj/class.mli:1: c#h ./examples/using_make/obj/class_type.mli:9: c#h ./examples/using_make/obj/coerce.mli:6: p#f ./examples/using_make/obj/coerce.mli:6: p#h -./examples/using_make/obj/constraint.ml:1: p#g +./examples/using_make/obj/constraint.ml:1: p#g: Not detected ./examples/using_make/obj/fooCl.mli:1: p1#g ./examples/using_make/obj/fooCl.mli:1: p1#h ./examples/using_make/obj/fooCl.mli:7: p2#h -./examples/using_make/obj/fun_class.ml:1: c#m3 -./examples/using_make/obj/fun_obj_param.ml:1: f#n +./examples/using_make/obj/fun_class.ml:1: c#m3: Not detected +./examples/using_make/obj/fun_obj_param.ml:1: f#n: Not detected ./examples/using_make/obj/inher.mli:1: p#h ./examples/using_make/obj/named.mli:10: c#g -./examples/using_make/obj/obj_inher.ml:1: c#g -./examples/using_make/obj/obj_inher.ml:1: c#h -./examples/using_make/obj/obj_inher.ml:19: o3#k -./examples/using_make/obj/object.ml:1: o#h +./examples/using_make/obj/obj_inher.ml:1: c#g: Not detected +./examples/using_make/obj/obj_inher.ml:1: c#h: Not detected +./examples/using_make/obj/obj_inher.ml:19: o3#k: Not detected +./examples/using_make/obj/object.ml:1: o#h: Not detected ./examples/using_make/obj/overr.mli:1: p1#g ./examples/using_make/obj/overr.mli:1: p1#h ./examples/using_make/obj/overr.mli:7: p2#g @@ -222,10 +205,9 @@ Nothing else to report in this section ./examples/using_dune/preprocessed_lib/preprocessed.mli:14: constructors.Unused ./examples/using_dune/preprocessed_lib/preprocessed.mli:19: constr_with_eq.Unused ./examples/using_dune/preprocessed_lib/preprocessed.mli:23: record.unused -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:25: constructors.Unused -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:30: constr_with_eq.Unused -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:39: record.unused - +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:25: constructors.Unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:30: constr_with_eq.Unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:39: record.unused: Not detected ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:1: unused_single_no_param.Unused_single_no_param ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:2: unused_single_unit.Unused_single_unit ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:3: unused_single_param.Unused_single_param @@ -632,7 +614,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 554 -Success: 472 -Failed: 82 -Ratio: 85.1985559567% +Total: 546 +Success: 421 +Failed: 125 +Ratio: 77.1062271062% diff --git a/check/threshold-1/threshold-1.ref b/check/threshold-1/threshold-1.ref index c1237269..89cb1828 100644 --- a/check/threshold-1/threshold-1.ref +++ b/check/threshold-1/threshold-1.ref @@ -9,13 +9,10 @@ ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:26: Internal_app.unused -./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused -./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused - -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Should not be detected -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement - +./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused: Not detected +./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused: Not detected +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused: Not detected +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement: Not detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:19: M_redef.unused @@ -25,16 +22,11 @@ ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello: Should not be detected ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye: Should not be detected ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:4: world: Should not be detected -./examples/docs/exported_values/limitations/incl_same_name/oo.mli:20: copy: Should not be detected -./examples/docs/exported_values/limitations/incl_same_name/oo.mli:25: id: Should not be detected -./examples/docs/exported_values/limitations/incl_same_name/oo.mli:40: new_method: Should not be detected -./examples/docs/exported_values/limitations/incl_same_name/oo.mli:41: public_method_label: Should not be detected ./examples/docs/exported_values/limitations/sigincl/sigincl_lib.mli:10: I.x: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:1: unused ./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:38: internally_used_f: Should not be detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused - +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused: Not detected ./examples/using_dune/reduced_lib/reduced_lib.mli:3: Values.used_by_API ./examples/using_dune/reduced_lib/reduced_lib.mli:4: Values.internally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:10: Values_no_intf.used_by_API @@ -55,13 +47,8 @@ ./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:8: Exported.lib_internal_unused ./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused -./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Should not be detected -./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_unused - +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused: Not detected +./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_unused: Not detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected @@ -75,12 +62,11 @@ ./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected -./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:20: unused_alias_fun -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure - +./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:20: unused_alias_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure: Not detected ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected @@ -94,38 +80,35 @@ ./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected -./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:20: unused_alias_fun -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:25: unused_closure - +./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:20: unused_alias_fun: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:25: unused_closure: Not detected ./examples/using_make/advanced/inc_val.mli:1: x ./examples/using_make/advanced/inc_val.mli:2: y ./examples/using_make/advanced/val.mli:1: x: Should not be detected ./examples/using_make/advanced/val.mli:2: y: Should not be detected -./examples/using_make/bar.ml:1: x -./examples/using_make/bar_fn.ml:3: h +./examples/using_make/bar.ml:1: x: Not detected +./examples/using_make/bar_fn.ml:3: h: Not detected ./examples/using_make/baz.mli:1: z ./examples/using_make/baz.mli:3: u -./examples/using_make/cond_sel.ml:13: h - -./examples/using_make/dir/alias_opt.ml:7: y -./examples/using_make/dir/alias_opt.ml:14: x -./examples/using_make/dir/anon_call.ml:1: f -./examples/using_make/dir/anon_call.ml:5: g -./examples/using_make/dir/anon_call.ml:9: h -./examples/using_make/dir/anon_call2.ml:1: f -./examples/using_make/dir/anon_call2.ml:5: g -./examples/using_make/dir/anon_call2.ml:9: h -./examples/using_make/dir/match_opt.ml:8: l -./examples/using_make/dir/matchopt.ml:5: w +./examples/using_make/cond_sel.ml:13: h: Not detected +./examples/using_make/dir/alias_opt.ml:7: y: Not detected +./examples/using_make/dir/alias_opt.ml:14: x: Not detected +./examples/using_make/dir/anon_call.ml:1: f: Not detected +./examples/using_make/dir/anon_call.ml:5: g: Not detected +./examples/using_make/dir/anon_call.ml:9: h: Not detected +./examples/using_make/dir/anon_call2.ml:1: f: Not detected +./examples/using_make/dir/anon_call2.ml:5: g: Not detected +./examples/using_make/dir/anon_call2.ml:9: h: Not detected +./examples/using_make/dir/match_opt.ml:8: l: Not detected +./examples/using_make/dir/matchopt.ml:5: w: Not detected ./examples/using_make/dir/mod.mli:10: M.f: Should not be detected ./examples/using_make/dir/mod.mli:11: M.g ./examples/using_make/dir/refFn.mli:3: x -./examples/using_make/dir/ref_opt.ml:3: no -./examples/using_make/dir/ref_opt.ml:11: x - +./examples/using_make/dir/ref_opt.ml:3: no: Not detected +./examples/using_make/dir/ref_opt.ml:11: x: Not detected ./examples/using_make/exported.mli:6: M1.five: Should not be detected ./examples/using_make/exported.mli:10: F.plus_five: Should not be detected ./examples/using_make/exported.mli:11: F.times_five @@ -138,20 +121,20 @@ ./examples/using_make/functor.mli:3: M.none ./examples/using_make/functor.mli:7: F.g: Should not be detected ./examples/using_make/functor.mli:11: N.g: Should not be detected -./examples/using_make/let_in.ml:3: parent -./examples/using_make/let_test.ml:3: g -./examples/using_make/matchopt.ml:5: w +./examples/using_make/let_in.ml:3: parent: Not detected +./examples/using_make/let_test.ml:3: g: Not detected +./examples/using_make/matchopt.ml:5: w: Not detected ./examples/using_make/mod_alias.mli:2: M1.id: Should not be detected ./examples/using_make/mod_alias.mli:6: M2.id: Should not be detected ./examples/using_make/obj/class.mli:7: o: Should not be detected ./examples/using_make/obj/class.mli:9: f: Should not be detected ./examples/using_make/obj/inher.mli:11: o: Should not be detected ./examples/using_make/obj/inher.mli:13: f: Should not be detected -./examples/using_make/opt_in_opt.ml:7: x -./examples/using_make/qux.ml:1: z -./examples/using_make/unused_fn.ml:3: g -./examples/using_make/unused_fn.ml:5: var -./examples/using_make/useless_opt.ml:3: x +./examples/using_make/opt_in_opt.ml:7: x: Not detected +./examples/using_make/qux.ml:1: z: Not detected +./examples/using_make/unused_fn.ml:3: g: Not detected +./examples/using_make/unused_fn.ml:5: var: Not detected +./examples/using_make/useless_opt.ml:3: x: Not detected ./examples/using_make/variant.mli:5: f: Should not be detected -------- @@ -170,12 +153,11 @@ ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:20: External_param.unused_required ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:24: Internal_app.externally_used ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used: Not detected -./examples/docs/exported_values/code_constructs/include/include_lib.ml:3: Original.used_directly -./examples/docs/exported_values/code_constructs/include/include_lib.ml:4: Original.used_indirectly -./examples/docs/exported_values/code_constructs/include/include_lib.ml:14: Redefine.used_directly - -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:3: Original.used_directly -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:4: Original.used_indirectly +./examples/docs/exported_values/code_constructs/include/include_lib.ml:3: Original.used_directly: Not detected +./examples/docs/exported_values/code_constructs/include/include_lib.ml:4: Original.used_indirectly: Not detected +./examples/docs/exported_values/code_constructs/include/include_lib.ml:14: Redefine.used_directly: Not detected +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:3: Original.used_directly: Not detected +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:4: Original.used_indirectly: Not detected ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Not detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:17: M_redef.externally_used ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used: Not detected @@ -185,9 +167,8 @@ ./examples/docs/exported_values/hello_world/hello_world_lib.mli:3: goodbye ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello: Not detected ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye: Not detected -./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:2: hello -./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:3: goodbye - +./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:2: hello: Not detected +./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:3: goodbye: Not detected ./examples/using_dune/bin/use_preprocessed_lib/use_preprocessed.mli:1: mark_used ./examples/using_dune/bin/use_preprocessed_lib/use_preprocessed_lib.mli:1: mark_used ./examples/using_dune/bin/use_preprocessed_lib/use_preprocessed_no_intf.mli:1: mark_used @@ -234,9 +215,8 @@ ./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:4: externally_used ./examples/using_dune/preprocessed_lib/preprocessed.mli:31: exported_f: Should not be detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:4: internally_used -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:5: externally_used - +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:4: internally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:5: externally_used: Not detected ./examples/using_dune/reduced_lib/reduced_lib.mli:2: Values.used ./examples/using_dune/reduced_lib/reduced_lib.mli:5: Values.externally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:9: Values_no_intf.used @@ -255,19 +235,14 @@ ./examples/using_dune/reduced_lib/values_in_submodules.mli:7: Exported.lib_internal_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used: Not detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:10: Exported.lib_internal_externally_used -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:2: Exported.used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Not detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:4: Exported.internally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Not detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:9: Exported.lib_internal_internally_used -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:10: Exported.lib_internal_externally_used -./examples/using_dune/reduced_lib/values_no_intf.ml:1: used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:9: Exported.lib_internal_internally_used: Not detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:10: Exported.lib_internal_externally_used: Not detected ./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Not detected -./examples/using_dune/reduced_lib/values_no_intf.ml:3: internally_used: Should not be detected ./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Not detected -./examples/using_dune/reduced_lib/values_no_intf.ml:12: lib_internal_internally_used -./examples/using_dune/reduced_lib/values_no_intf.ml:13: lib_internal_externally_used - +./examples/using_dune/reduced_lib/values_no_intf.ml:12: lib_internal_internally_used: Not detected +./examples/using_dune/reduced_lib/values_no_intf.ml:13: lib_internal_externally_used: Not detected ./examples/using_dune/unwrapped_lib/obj/with_class.mli:33: fun_class_factory: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg: Should not be detected @@ -286,8 +261,7 @@ ./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig: Should not be detected -./examples/using_dune/unwrapped_lib/style/style.ml:1: all - +./examples/using_dune/unwrapped_lib/style/style.ml:1: all: Not detected ./examples/using_dune/unwrapped_lib/values/values.mli:1: used_int: Should not be detected ./examples/using_dune/unwrapped_lib/values/values.mli:3: internally_used_int: Not detected ./examples/using_dune/unwrapped_lib/values/values.mli:4: externally_used_int @@ -309,22 +283,21 @@ ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Not detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:5: Exported.externally_used_int -./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int -./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:3: internally_used_int -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:4: externally_used_int -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:5: externally_used_as_parameter_int -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:7: externally_written_bool_ref -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:8: externally_matched_option -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:10: externally_stored_in_ref_bool -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:11: externally_stored_in_option_bool -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:15: internally_used_fun -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:16: externally_used_fun -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:17: externally_used_as_parameter_fun -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:22: externally_used_alias_fun -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:27: internally_used_closure -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:28: externally_used_closure - +./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:3: internally_used_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:4: externally_used_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:5: externally_used_as_parameter_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:7: externally_written_bool_ref: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:8: externally_matched_option: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:10: externally_stored_in_ref_bool: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:11: externally_stored_in_option_bool: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:15: internally_used_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:16: externally_used_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:17: externally_used_as_parameter_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:22: externally_used_alias_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:27: internally_used_closure: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:28: externally_used_closure: Not detected ./examples/using_dune/wrapped_lib/obj/with_class.mli:33: fun_class_factory: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg: Should not be detected @@ -343,8 +316,7 @@ ./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig: Should not be detected -./examples/using_dune/wrapped_lib/style/style.ml:1: all - +./examples/using_dune/wrapped_lib/style/style.ml:1: all: Not detected ./examples/using_dune/wrapped_lib/values/values.mli:1: used_int: Should not be detected ./examples/using_dune/wrapped_lib/values/values.mli:3: internally_used_int: Not detected ./examples/using_dune/wrapped_lib/values/values.mli:4: externally_used_int @@ -366,69 +338,65 @@ ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Should not be detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Not detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:5: Exported.externally_used_int -./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int -./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:3: internally_used_int -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:4: externally_used_int -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:5: externally_used_as_parameter_int -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:7: externally_written_bool_ref -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:8: externally_matched_option -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:10: externally_stored_in_ref_bool -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:11: externally_stored_in_option_bool -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:15: internally_used_fun -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:16: externally_used_fun -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:17: externally_used_as_parameter_fun -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:22: externally_used_alias_fun -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:27: internally_used_closure -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:28: externally_used_closure - -./examples/using_make/advanced/incl.ml:7: f +./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int: Not detected +./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:3: internally_used_int: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:4: externally_used_int: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:5: externally_used_as_parameter_int: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:7: externally_written_bool_ref: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:8: externally_matched_option: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:10: externally_stored_in_ref_bool: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:11: externally_stored_in_option_bool: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:15: internally_used_fun: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:16: externally_used_fun: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:17: externally_used_as_parameter_fun: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:22: externally_used_alias_fun: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:27: internally_used_closure: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:28: externally_used_closure: Not detected +./examples/using_make/advanced/incl.ml:7: f: Not detected ./examples/using_make/advanced/mod.mli:1: f ./examples/using_make/advanced/mod.mli:2: x ./examples/using_make/advanced/val.mli:1: x: Not detected ./examples/using_make/advanced/val.mli:2: y: Not detected ./examples/using_make/baz.mli:2: t -./examples/using_make/cond_sel.ml:9: f -./examples/using_make/cond_sel.ml:11: g - -./examples/using_make/dir/alias_opt.ml:4: baz -./examples/using_make/dir/alias_opt.ml:11: foo -./examples/using_make/dir/alias_opt.ml:12: bar -./examples/using_make/dir/fn_arg.ml:1: f -./examples/using_make/dir/fn_arg.ml:3: g -./examples/using_make/dir/fn_arg.ml:9: i -./examples/using_make/dir/fn_arg.ml:11: j -./examples/using_make/dir/hidden_opt_use.ml:1: f -./examples/using_make/dir/hidden_opt_use.ml:3: apply -./examples/using_make/dir/match_opt.ml:3: m +./examples/using_make/cond_sel.ml:9: f: Not detected +./examples/using_make/cond_sel.ml:11: g: Not detected +./examples/using_make/dir/alias_opt.ml:4: baz: Not detected +./examples/using_make/dir/alias_opt.ml:11: foo: Not detected +./examples/using_make/dir/alias_opt.ml:12: bar: Not detected +./examples/using_make/dir/fn_arg.ml:1: f: Not detected +./examples/using_make/dir/fn_arg.ml:3: g: Not detected +./examples/using_make/dir/fn_arg.ml:9: i: Not detected +./examples/using_make/dir/fn_arg.ml:11: j: Not detected +./examples/using_make/dir/hidden_opt_use.ml:1: f: Not detected +./examples/using_make/dir/hidden_opt_use.ml:3: apply: Not detected +./examples/using_make/dir/match_opt.ml:3: m: Not detected ./examples/using_make/dir/mod.mli:10: M.f: Not detected -./examples/using_make/dir/partial.ml:5: g -./examples/using_make/dir/ref_fn.ml:5: g -./examples/using_make/dir/ref_opt.ml:7: g - +./examples/using_make/dir/partial.ml:5: g: Not detected +./examples/using_make/dir/ref_fn.ml:5: g: Not detected +./examples/using_make/dir/ref_opt.ml:7: g: Not detected ./examples/using_make/foo.mli:1: x ./examples/using_make/fooFn.mli:1: f ./examples/using_make/functor.mli:2: M.f: Not detected -./examples/using_make/if_end.ml:1: f -./examples/using_make/if_end.ml:3: g -./examples/using_make/if_end.ml:5: h +./examples/using_make/if_end.ml:1: f: Not detected +./examples/using_make/if_end.ml:3: g: Not detected +./examples/using_make/if_end.ml:5: h: Not detected ./examples/using_make/letIn.mli:1: f ./examples/using_make/mod_alias.mli:2: M1.id: Not detected ./examples/using_make/mod_alias.mli:6: M2.id: Not detected ./examples/using_make/obj/class.mli:9: f: Not detected -./examples/using_make/obj/fun_class.ml:8: f -./examples/using_make/obj/fun_obj_param.ml:7: app_m +./examples/using_make/obj/fun_class.ml:8: f: Not detected +./examples/using_make/obj/fun_obj_param.ml:7: app_m: Not detected ./examples/using_make/obj/inher.mli:13: f: Not detected -./examples/using_make/obj/obj_inher.ml:7: o -./examples/using_make/obj/obj_inher.ml:12: o4 -./examples/using_make/obj/obj_inher.ml:17: o2 -./examples/using_make/obj/obj_inher.ml:19: o3 -./examples/using_make/obj/obj_inher.ml:24: f -./examples/using_make/obj/object.ml:7: f - -./examples/using_make/opt_in_opt.ml:5: baz -./examples/using_make/partial_opt.ml:1: f -./examples/using_make/useless_opt.ml:1: foo +./examples/using_make/obj/obj_inher.ml:7: o: Not detected +./examples/using_make/obj/obj_inher.ml:12: o4: Not detected +./examples/using_make/obj/obj_inher.ml:17: o2: Not detected +./examples/using_make/obj/obj_inher.ml:19: o3: Not detected +./examples/using_make/obj/obj_inher.ml:24: f: Not detected +./examples/using_make/obj/object.ml:7: f: Not detected +./examples/using_make/opt_in_opt.ml:5: baz: Not detected +./examples/using_make/partial_opt.ml:1: f: Not detected +./examples/using_make/useless_opt.ml:1: foo: Not detected ./examples/using_make/variant.mli:5: f: Not detected Nothing else to report in this section -------------------------------------------------------------------------------- @@ -437,8 +405,7 @@ Nothing else to report in this section .> UNUSED METHODS: ================= ./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused - +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused: Not detected ./examples/using_dune/unwrapped_lib/obj/with_class.mli:1: unused#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#never_used_fun ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#never_used_int @@ -469,22 +436,23 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected +./examples/using_make/advanced/mod.mli:4: p#f: Should not be detected ./examples/using_make/obj/class.mli:1: c#h ./examples/using_make/obj/class_type.mli:9: c#h ./examples/using_make/obj/coerce.mli:6: p#f ./examples/using_make/obj/coerce.mli:6: p#h -./examples/using_make/obj/constraint.ml:1: p#g +./examples/using_make/obj/constraint.ml:1: p#g: Not detected ./examples/using_make/obj/fooCl.mli:1: p1#g ./examples/using_make/obj/fooCl.mli:1: p1#h ./examples/using_make/obj/fooCl.mli:7: p2#h -./examples/using_make/obj/fun_class.ml:1: c#m3 -./examples/using_make/obj/fun_obj_param.ml:1: f#n +./examples/using_make/obj/fun_class.ml:1: c#m3: Not detected +./examples/using_make/obj/fun_obj_param.ml:1: f#n: Not detected ./examples/using_make/obj/inher.mli:1: p#h ./examples/using_make/obj/named.mli:10: c#g -./examples/using_make/obj/obj_inher.ml:1: c#g -./examples/using_make/obj/obj_inher.ml:1: c#h -./examples/using_make/obj/obj_inher.ml:19: o3#k -./examples/using_make/obj/object.ml:1: o#h +./examples/using_make/obj/obj_inher.ml:1: c#g: Not detected +./examples/using_make/obj/obj_inher.ml:1: c#h: Not detected +./examples/using_make/obj/obj_inher.ml:19: o3#k: Not detected +./examples/using_make/obj/object.ml:1: o#h: Not detected ./examples/using_make/obj/overr.mli:1: p1#g ./examples/using_make/obj/overr.mli:1: p1#h ./examples/using_make/obj/overr.mli:7: p2#g @@ -496,9 +464,8 @@ Nothing else to report in this section ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#externally_used: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#internally_used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#externally_used -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#internally_used - +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#externally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#internally_used: Not detected ./examples/using_dune/unwrapped_lib/obj/with_class.mli:35: _self_used#used ./examples/using_dune/unwrapped_lib/obj/with_class.mli:41: _self_used_fun_class#used ./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#externally_used_fun: Not detected @@ -528,29 +495,28 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_fun: Not detected ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_int: Not detected ./examples/using_make/advanced/func.mli:3: M.c#f -./examples/using_make/advanced/mod.mli:4: p#f - +./examples/using_make/advanced/mod.mli:4: p#f: Not detected ./examples/using_make/obj/class.mli:1: c#f ./examples/using_make/obj/class.mli:1: c#g ./examples/using_make/obj/class_type.mli:7: p#f ./examples/using_make/obj/class_type.mli:7: p#h ./examples/using_make/obj/coerce.mli:8: c#h -./examples/using_make/obj/constraint.ml:1: p#f -./examples/using_make/obj/depend.ml:8: M.c#f +./examples/using_make/obj/constraint.ml:1: p#f: Not detected +./examples/using_make/obj/depend.ml:8: M.c#f: Not detected ./examples/using_make/obj/fooCl.mli:1: p1#f ./examples/using_make/obj/fooCl.mli:7: p2#g -./examples/using_make/obj/fun_class.ml:1: c#m1 -./examples/using_make/obj/fun_class.ml:1: c#m2 -./examples/using_make/obj/fun_class.ml:1: c#m4 -./examples/using_make/obj/fun_obj_param.ml:1: f#m -./examples/using_make/obj/fun_obj_param.ml:1: f#x +./examples/using_make/obj/fun_class.ml:1: c#m1: Not detected +./examples/using_make/obj/fun_class.ml:1: c#m2: Not detected +./examples/using_make/obj/fun_class.ml:1: c#m4: Not detected +./examples/using_make/obj/fun_obj_param.ml:1: f#m: Not detected +./examples/using_make/obj/fun_obj_param.ml:1: f#x: Not detected ./examples/using_make/obj/inher.mli:1: p#f ./examples/using_make/obj/inher.mli:1: p#g ./examples/using_make/obj/named.mli:1: p1#g ./examples/using_make/obj/named.mli:6: p2#f ./examples/using_make/obj/named.mli:10: c#f -./examples/using_make/obj/object.ml:1: o#f -./examples/using_make/obj/object.ml:1: o#g +./examples/using_make/obj/object.ml:1: o#f: Not detected +./examples/using_make/obj/object.ml:1: o#g: Not detected ./examples/using_make/obj/overr.mli:1: p1#f ./examples/using_make/obj/overr.mli:12: c#g @@ -563,10 +529,9 @@ Nothing else to report in this section ./examples/using_dune/preprocessed_lib/preprocessed.mli:14: constructors.Unused ./examples/using_dune/preprocessed_lib/preprocessed.mli:19: constr_with_eq.Unused ./examples/using_dune/preprocessed_lib/preprocessed.mli:23: record.unused -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:25: constructors.Unused -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:30: constr_with_eq.Unused -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:39: record.unused - +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:25: constructors.Unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:30: constr_with_eq.Unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:39: record.unused: Not detected ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:1: unused_single_no_param.Unused_single_no_param ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:2: unused_single_unit.Unused_single_unit ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:3: unused_single_param.Unused_single_param @@ -637,12 +602,11 @@ Nothing else to report in this section ./examples/using_dune/preprocessed_lib/preprocessed.mli:25: record.internally_used ./examples/using_dune/preprocessed_lib/preprocessed.mli:26: record.externally_used ./examples/using_dune/preprocessed_lib/preprocessed.mli:29: record_with_eq.implicitly_used -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:27: constructors.Internally_used -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:28: constructors.Externally_used -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:41: record.internally_used -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:42: record.externally_used -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:45: record_with_eq.implicitly_used - +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:27: constructors.Internally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:28: constructors.Externally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:41: record.internally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:42: record.externally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:45: record_with_eq.implicitly_used: Not detected ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:25: internally_used_single_no_param.Internally_used_single_no_param ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:26: internally_used_single_unit.Internally_used_single_unit ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:27: internally_used_single_param.Internally_used_single_param @@ -1047,7 +1011,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 933 -Success: 736 -Failed: 197 -Ratio: 78.8853161844% +Total: 921 +Success: 593 +Failed: 328 +Ratio: 64.3865363735% diff --git a/check/threshold-3-0.5/threshold-3-0.5.ref b/check/threshold-3-0.5/threshold-3-0.5.ref index 8b1f8ddc..01f42920 100644 --- a/check/threshold-3-0.5/threshold-3-0.5.ref +++ b/check/threshold-3-0.5/threshold-3-0.5.ref @@ -9,13 +9,10 @@ ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:26: Internal_app.unused -./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused -./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused - -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Should not be detected -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement - +./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused: Not detected +./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused: Not detected +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused: Not detected +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement: Not detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:19: M_redef.unused @@ -25,16 +22,11 @@ ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello: Should not be detected ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye: Should not be detected ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:4: world: Should not be detected -./examples/docs/exported_values/limitations/incl_same_name/oo.mli:20: copy: Should not be detected -./examples/docs/exported_values/limitations/incl_same_name/oo.mli:25: id: Should not be detected -./examples/docs/exported_values/limitations/incl_same_name/oo.mli:40: new_method: Should not be detected -./examples/docs/exported_values/limitations/incl_same_name/oo.mli:41: public_method_label: Should not be detected ./examples/docs/exported_values/limitations/sigincl/sigincl_lib.mli:10: I.x: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:1: unused ./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:38: internally_used_f: Should not be detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused - +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused: Not detected ./examples/using_dune/reduced_lib/reduced_lib.mli:3: Values.used_by_API ./examples/using_dune/reduced_lib/reduced_lib.mli:4: Values.internally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:10: Values_no_intf.used_by_API @@ -55,13 +47,8 @@ ./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:8: Exported.lib_internal_unused ./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused -./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Should not be detected -./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_unused - +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused: Not detected +./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_unused: Not detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected @@ -75,12 +62,11 @@ ./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected -./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:20: unused_alias_fun -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure - +./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:20: unused_alias_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure: Not detected ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected @@ -94,38 +80,35 @@ ./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected -./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:20: unused_alias_fun -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:25: unused_closure - +./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:20: unused_alias_fun: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:25: unused_closure: Not detected ./examples/using_make/advanced/inc_val.mli:1: x ./examples/using_make/advanced/inc_val.mli:2: y ./examples/using_make/advanced/val.mli:1: x: Should not be detected ./examples/using_make/advanced/val.mli:2: y: Should not be detected -./examples/using_make/bar.ml:1: x -./examples/using_make/bar_fn.ml:3: h +./examples/using_make/bar.ml:1: x: Not detected +./examples/using_make/bar_fn.ml:3: h: Not detected ./examples/using_make/baz.mli:1: z ./examples/using_make/baz.mli:3: u -./examples/using_make/cond_sel.ml:13: h - -./examples/using_make/dir/alias_opt.ml:7: y -./examples/using_make/dir/alias_opt.ml:14: x -./examples/using_make/dir/anon_call.ml:1: f -./examples/using_make/dir/anon_call.ml:5: g -./examples/using_make/dir/anon_call.ml:9: h -./examples/using_make/dir/anon_call2.ml:1: f -./examples/using_make/dir/anon_call2.ml:5: g -./examples/using_make/dir/anon_call2.ml:9: h -./examples/using_make/dir/match_opt.ml:8: l -./examples/using_make/dir/matchopt.ml:5: w +./examples/using_make/cond_sel.ml:13: h: Not detected +./examples/using_make/dir/alias_opt.ml:7: y: Not detected +./examples/using_make/dir/alias_opt.ml:14: x: Not detected +./examples/using_make/dir/anon_call.ml:1: f: Not detected +./examples/using_make/dir/anon_call.ml:5: g: Not detected +./examples/using_make/dir/anon_call.ml:9: h: Not detected +./examples/using_make/dir/anon_call2.ml:1: f: Not detected +./examples/using_make/dir/anon_call2.ml:5: g: Not detected +./examples/using_make/dir/anon_call2.ml:9: h: Not detected +./examples/using_make/dir/match_opt.ml:8: l: Not detected +./examples/using_make/dir/matchopt.ml:5: w: Not detected ./examples/using_make/dir/mod.mli:10: M.f: Should not be detected ./examples/using_make/dir/mod.mli:11: M.g ./examples/using_make/dir/refFn.mli:3: x -./examples/using_make/dir/ref_opt.ml:3: no -./examples/using_make/dir/ref_opt.ml:11: x - +./examples/using_make/dir/ref_opt.ml:3: no: Not detected +./examples/using_make/dir/ref_opt.ml:11: x: Not detected ./examples/using_make/exported.mli:6: M1.five: Should not be detected ./examples/using_make/exported.mli:10: F.plus_five: Should not be detected ./examples/using_make/exported.mli:11: F.times_five @@ -138,20 +121,20 @@ ./examples/using_make/functor.mli:3: M.none ./examples/using_make/functor.mli:7: F.g: Should not be detected ./examples/using_make/functor.mli:11: N.g: Should not be detected -./examples/using_make/let_in.ml:3: parent -./examples/using_make/let_test.ml:3: g -./examples/using_make/matchopt.ml:5: w +./examples/using_make/let_in.ml:3: parent: Not detected +./examples/using_make/let_test.ml:3: g: Not detected +./examples/using_make/matchopt.ml:5: w: Not detected ./examples/using_make/mod_alias.mli:2: M1.id: Should not be detected ./examples/using_make/mod_alias.mli:6: M2.id: Should not be detected ./examples/using_make/obj/class.mli:7: o: Should not be detected ./examples/using_make/obj/class.mli:9: f: Should not be detected ./examples/using_make/obj/inher.mli:11: o: Should not be detected ./examples/using_make/obj/inher.mli:13: f: Should not be detected -./examples/using_make/opt_in_opt.ml:7: x -./examples/using_make/qux.ml:1: z -./examples/using_make/unused_fn.ml:3: g -./examples/using_make/unused_fn.ml:5: var -./examples/using_make/useless_opt.ml:3: x +./examples/using_make/opt_in_opt.ml:7: x: Not detected +./examples/using_make/qux.ml:1: z: Not detected +./examples/using_make/unused_fn.ml:3: g: Not detected +./examples/using_make/unused_fn.ml:5: var: Not detected +./examples/using_make/useless_opt.ml:3: x: Not detected ./examples/using_make/variant.mli:5: f: Should not be detected -------- @@ -170,12 +153,11 @@ ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:20: External_param.unused_required ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:24: Internal_app.externally_used ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used: Not detected -./examples/docs/exported_values/code_constructs/include/include_lib.ml:3: Original.used_directly -./examples/docs/exported_values/code_constructs/include/include_lib.ml:4: Original.used_indirectly -./examples/docs/exported_values/code_constructs/include/include_lib.ml:14: Redefine.used_directly - -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:3: Original.used_directly -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:4: Original.used_indirectly +./examples/docs/exported_values/code_constructs/include/include_lib.ml:3: Original.used_directly: Not detected +./examples/docs/exported_values/code_constructs/include/include_lib.ml:4: Original.used_indirectly: Not detected +./examples/docs/exported_values/code_constructs/include/include_lib.ml:14: Redefine.used_directly: Not detected +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:3: Original.used_directly: Not detected +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:4: Original.used_indirectly: Not detected ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Not detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:17: M_redef.externally_used ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used: Not detected @@ -185,9 +167,8 @@ ./examples/docs/exported_values/hello_world/hello_world_lib.mli:3: goodbye ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello: Not detected ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye: Not detected -./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:2: hello -./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:3: goodbye - +./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:2: hello: Not detected +./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:3: goodbye: Not detected ./examples/using_dune/bin/use_preprocessed_lib/use_preprocessed.mli:1: mark_used ./examples/using_dune/bin/use_preprocessed_lib/use_preprocessed_lib.mli:1: mark_used ./examples/using_dune/bin/use_preprocessed_lib/use_preprocessed_no_intf.mli:1: mark_used @@ -234,9 +215,8 @@ ./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:4: externally_used ./examples/using_dune/preprocessed_lib/preprocessed.mli:31: exported_f: Should not be detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:4: internally_used -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:5: externally_used - +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:4: internally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:5: externally_used: Not detected ./examples/using_dune/reduced_lib/reduced_lib.mli:2: Values.used ./examples/using_dune/reduced_lib/reduced_lib.mli:5: Values.externally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:9: Values_no_intf.used @@ -255,19 +235,14 @@ ./examples/using_dune/reduced_lib/values_in_submodules.mli:7: Exported.lib_internal_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used: Not detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:10: Exported.lib_internal_externally_used -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:2: Exported.used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Not detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:4: Exported.internally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Not detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:9: Exported.lib_internal_internally_used -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:10: Exported.lib_internal_externally_used -./examples/using_dune/reduced_lib/values_no_intf.ml:1: used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:9: Exported.lib_internal_internally_used: Not detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:10: Exported.lib_internal_externally_used: Not detected ./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Not detected -./examples/using_dune/reduced_lib/values_no_intf.ml:3: internally_used: Should not be detected ./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Not detected -./examples/using_dune/reduced_lib/values_no_intf.ml:12: lib_internal_internally_used -./examples/using_dune/reduced_lib/values_no_intf.ml:13: lib_internal_externally_used - +./examples/using_dune/reduced_lib/values_no_intf.ml:12: lib_internal_internally_used: Not detected +./examples/using_dune/reduced_lib/values_no_intf.ml:13: lib_internal_externally_used: Not detected ./examples/using_dune/unwrapped_lib/obj/with_class.mli:33: fun_class_factory: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg: Should not be detected @@ -286,8 +261,7 @@ ./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig: Should not be detected -./examples/using_dune/unwrapped_lib/style/style.ml:1: all - +./examples/using_dune/unwrapped_lib/style/style.ml:1: all: Not detected ./examples/using_dune/unwrapped_lib/values/values.mli:1: used_int: Should not be detected ./examples/using_dune/unwrapped_lib/values/values.mli:3: internally_used_int: Not detected ./examples/using_dune/unwrapped_lib/values/values.mli:4: externally_used_int @@ -309,22 +283,21 @@ ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Not detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:5: Exported.externally_used_int -./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int -./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:3: internally_used_int -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:4: externally_used_int -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:5: externally_used_as_parameter_int -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:7: externally_written_bool_ref -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:8: externally_matched_option -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:10: externally_stored_in_ref_bool -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:11: externally_stored_in_option_bool -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:15: internally_used_fun -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:16: externally_used_fun -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:17: externally_used_as_parameter_fun -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:22: externally_used_alias_fun -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:27: internally_used_closure -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:28: externally_used_closure - +./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:3: internally_used_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:4: externally_used_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:5: externally_used_as_parameter_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:7: externally_written_bool_ref: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:8: externally_matched_option: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:10: externally_stored_in_ref_bool: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:11: externally_stored_in_option_bool: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:15: internally_used_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:16: externally_used_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:17: externally_used_as_parameter_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:22: externally_used_alias_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:27: internally_used_closure: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:28: externally_used_closure: Not detected ./examples/using_dune/wrapped_lib/obj/with_class.mli:33: fun_class_factory: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg: Should not be detected @@ -343,8 +316,7 @@ ./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig: Should not be detected -./examples/using_dune/wrapped_lib/style/style.ml:1: all - +./examples/using_dune/wrapped_lib/style/style.ml:1: all: Not detected ./examples/using_dune/wrapped_lib/values/values.mli:1: used_int: Should not be detected ./examples/using_dune/wrapped_lib/values/values.mli:3: internally_used_int: Not detected ./examples/using_dune/wrapped_lib/values/values.mli:4: externally_used_int @@ -366,69 +338,65 @@ ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Should not be detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Not detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:5: Exported.externally_used_int -./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int -./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:3: internally_used_int -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:4: externally_used_int -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:5: externally_used_as_parameter_int -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:7: externally_written_bool_ref -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:8: externally_matched_option -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:10: externally_stored_in_ref_bool -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:11: externally_stored_in_option_bool -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:15: internally_used_fun -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:16: externally_used_fun -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:17: externally_used_as_parameter_fun -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:22: externally_used_alias_fun -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:27: internally_used_closure -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:28: externally_used_closure - -./examples/using_make/advanced/incl.ml:7: f +./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int: Not detected +./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:3: internally_used_int: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:4: externally_used_int: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:5: externally_used_as_parameter_int: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:7: externally_written_bool_ref: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:8: externally_matched_option: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:10: externally_stored_in_ref_bool: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:11: externally_stored_in_option_bool: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:15: internally_used_fun: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:16: externally_used_fun: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:17: externally_used_as_parameter_fun: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:22: externally_used_alias_fun: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:27: internally_used_closure: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:28: externally_used_closure: Not detected +./examples/using_make/advanced/incl.ml:7: f: Not detected ./examples/using_make/advanced/mod.mli:1: f ./examples/using_make/advanced/mod.mli:2: x ./examples/using_make/advanced/val.mli:1: x: Not detected ./examples/using_make/advanced/val.mli:2: y: Not detected ./examples/using_make/baz.mli:2: t -./examples/using_make/cond_sel.ml:9: f -./examples/using_make/cond_sel.ml:11: g - -./examples/using_make/dir/alias_opt.ml:4: baz -./examples/using_make/dir/alias_opt.ml:11: foo -./examples/using_make/dir/alias_opt.ml:12: bar -./examples/using_make/dir/fn_arg.ml:1: f -./examples/using_make/dir/fn_arg.ml:3: g -./examples/using_make/dir/fn_arg.ml:9: i -./examples/using_make/dir/fn_arg.ml:11: j -./examples/using_make/dir/hidden_opt_use.ml:1: f -./examples/using_make/dir/hidden_opt_use.ml:3: apply -./examples/using_make/dir/match_opt.ml:3: m +./examples/using_make/cond_sel.ml:9: f: Not detected +./examples/using_make/cond_sel.ml:11: g: Not detected +./examples/using_make/dir/alias_opt.ml:4: baz: Not detected +./examples/using_make/dir/alias_opt.ml:11: foo: Not detected +./examples/using_make/dir/alias_opt.ml:12: bar: Not detected +./examples/using_make/dir/fn_arg.ml:1: f: Not detected +./examples/using_make/dir/fn_arg.ml:3: g: Not detected +./examples/using_make/dir/fn_arg.ml:9: i: Not detected +./examples/using_make/dir/fn_arg.ml:11: j: Not detected +./examples/using_make/dir/hidden_opt_use.ml:1: f: Not detected +./examples/using_make/dir/hidden_opt_use.ml:3: apply: Not detected +./examples/using_make/dir/match_opt.ml:3: m: Not detected ./examples/using_make/dir/mod.mli:10: M.f: Not detected -./examples/using_make/dir/partial.ml:5: g -./examples/using_make/dir/ref_fn.ml:5: g -./examples/using_make/dir/ref_opt.ml:7: g - +./examples/using_make/dir/partial.ml:5: g: Not detected +./examples/using_make/dir/ref_fn.ml:5: g: Not detected +./examples/using_make/dir/ref_opt.ml:7: g: Not detected ./examples/using_make/foo.mli:1: x ./examples/using_make/fooFn.mli:1: f ./examples/using_make/functor.mli:2: M.f: Not detected -./examples/using_make/if_end.ml:1: f -./examples/using_make/if_end.ml:3: g -./examples/using_make/if_end.ml:5: h +./examples/using_make/if_end.ml:1: f: Not detected +./examples/using_make/if_end.ml:3: g: Not detected +./examples/using_make/if_end.ml:5: h: Not detected ./examples/using_make/letIn.mli:1: f ./examples/using_make/mod_alias.mli:2: M1.id: Not detected ./examples/using_make/mod_alias.mli:6: M2.id: Not detected ./examples/using_make/obj/class.mli:9: f: Not detected -./examples/using_make/obj/fun_class.ml:8: f -./examples/using_make/obj/fun_obj_param.ml:7: app_m +./examples/using_make/obj/fun_class.ml:8: f: Not detected +./examples/using_make/obj/fun_obj_param.ml:7: app_m: Not detected ./examples/using_make/obj/inher.mli:13: f: Not detected -./examples/using_make/obj/obj_inher.ml:7: o -./examples/using_make/obj/obj_inher.ml:12: o4 -./examples/using_make/obj/obj_inher.ml:17: o2 -./examples/using_make/obj/obj_inher.ml:19: o3 -./examples/using_make/obj/obj_inher.ml:24: f -./examples/using_make/obj/object.ml:7: f - -./examples/using_make/opt_in_opt.ml:5: baz -./examples/using_make/partial_opt.ml:1: f -./examples/using_make/useless_opt.ml:1: foo +./examples/using_make/obj/obj_inher.ml:7: o: Not detected +./examples/using_make/obj/obj_inher.ml:12: o4: Not detected +./examples/using_make/obj/obj_inher.ml:17: o2: Not detected +./examples/using_make/obj/obj_inher.ml:19: o3: Not detected +./examples/using_make/obj/obj_inher.ml:24: f: Not detected +./examples/using_make/obj/object.ml:7: f: Not detected +./examples/using_make/opt_in_opt.ml:5: baz: Not detected +./examples/using_make/partial_opt.ml:1: f: Not detected +./examples/using_make/useless_opt.ml:1: foo: Not detected ./examples/using_make/variant.mli:5: f: Not detected -------- @@ -437,18 +405,16 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./examples/docs/exported_values/hello_world/hello_world_lib.mli:4: world ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:4: world: Not detected -./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:4: world - +./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:4: world: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:2: used: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:31: exported_f: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:38: internally_used_f: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:44: externally_used_f -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:3: used -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:53: f -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:59: internally_used_f -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:64: externally_used_f - +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:3: used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:53: f: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:59: internally_used_f: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:64: externally_used_f: Not detected ./examples/using_dune/reduced_lib/values.mli:1: used: Not detected ./examples/using_dune/reduced_lib/values.mli:3: internally_used: Not detected ./examples/using_dune/reduced_lib/values.mli:6: lib_internal_used: Not detected @@ -457,11 +423,10 @@ ./examples/using_dune/reduced_lib/values_in_submodules.mli:7: Exported.lib_internal_used: Not detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:2: Exported.used: Not detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:4: Exported.internally_used: Not detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:7: Exported.lib_internal_used +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:7: Exported.lib_internal_used: Not detected ./examples/using_dune/reduced_lib/values_no_intf.ml:1: used: Not detected ./examples/using_dune/reduced_lib/values_no_intf.ml:3: internally_used: Not detected -./examples/using_dune/reduced_lib/values_no_intf.ml:10: lib_internal_used - +./examples/using_dune/reduced_lib/values_no_intf.ml:10: lib_internal_used: Not detected ./examples/using_dune/unwrapped_lib/obj/with_class.mli:21: basics_factory: Should not be detected ./examples/using_dune/unwrapped_lib/obj/with_class.mli:33: fun_class_factory: Not detected ./examples/using_dune/unwrapped_lib/opt_args/mixed_args.mli:1: interlaced_mandatory_and_opt: Should not be detected @@ -495,12 +460,11 @@ ./examples/using_dune/unwrapped_lib/values/values.mli:19: used_alias_fun: Not detected ./examples/using_dune/unwrapped_lib/values/values.mli:24: used_closure: Not detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:2: Exported.used_int -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:1: used_int -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:14: used_fun -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:21: used_alias_fun -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:26: used_closure - +./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:2: Exported.used_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:1: used_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:14: used_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:21: used_alias_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:26: used_closure: Not detected ./examples/using_dune/wrapped_lib/obj/with_class.mli:21: basics_factory: Should not be detected ./examples/using_dune/wrapped_lib/obj/with_class.mli:33: fun_class_factory: Not detected ./examples/using_dune/wrapped_lib/opt_args/mixed_args.mli:1: interlaced_mandatory_and_opt: Should not be detected @@ -534,53 +498,45 @@ ./examples/using_dune/wrapped_lib/values/values.mli:19: used_alias_fun: Not detected ./examples/using_dune/wrapped_lib/values/values.mli:24: used_closure: Not detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Not detected -./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:2: Exported.used_int -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:1: used_int -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:14: used_fun -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:21: used_alias_fun -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:26: used_closure - +./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:2: Exported.used_int: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:1: used_int: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:14: used_fun: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:21: used_alias_fun: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:26: used_closure: Not detected ./examples/using_make/dir/anonFn.mli:1: f ./examples/using_make/dir/anonFn.mli:2: g ./examples/using_make/dir/anonFn.mli:3: h -./examples/using_make/dir/fn_arg.ml:7: h -./examples/using_make/dir/partial.ml:1: f -./examples/using_make/dir/ref_opt.ml:1: f -./examples/using_make/dir/ref_opt.ml:5: r - +./examples/using_make/dir/fn_arg.ml:7: h: Not detected +./examples/using_make/dir/partial.ml:1: f: Not detected +./examples/using_make/dir/ref_opt.ml:1: f: Not detected +./examples/using_make/dir/ref_opt.ml:5: r: Not detected ./examples/using_make/exported.mli:6: M1.five: Not detected ./examples/using_make/exported.mli:15: M2.five: Not detected ./examples/using_make/functor.mli:7: F.g: Not detected ./examples/using_make/functor.mli:11: N.g: Not detected ./examples/using_make/obj/class.mli:7: o: Not detected -./examples/using_make/obj/fun_obj_param.ml:1: f +./examples/using_make/obj/fun_obj_param.ml:1: f: Not detected ./examples/using_make/obj/inher.mli:11: o: Not detected -./examples/using_make/obj/object.ml:1: o - -./examples/using_make/opt/sig_struct.ml:6: f: Should not be detected -./examples/using_make/opt_in_opt.ml:1: foo -./examples/using_make/unused_fn.ml:1: f +./examples/using_make/obj/object.ml:1: o: Not detected +./examples/using_make/opt_in_opt.ml:1: foo: Not detected +./examples/using_make/unused_fn.ml:1: f: Not detected -------- .>-> ALMOST UNUSED EXPORTED VALUES: Called 3 time(s): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:24: multiple_sometimes_used_opt_args: Should not be detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:19: aliased_fun - +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:19: aliased_fun: Not detected ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:24: multiple_sometimes_used_opt_args: Should not be detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:19: aliased_fun - +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:19: aliased_fun: Not detected ./examples/using_make/dir/anonFn2.mli:1: f ./examples/using_make/dir/anonFn2.mli:2: g -./examples/using_make/dir/match_opt.ml:1: f +./examples/using_make/dir/match_opt.ml:1: f: Not detected ./examples/using_make/dir/refFn.mli:1: r: Should not be detected -./examples/using_make/dir/ref_fn.ml:1: f - +./examples/using_make/dir/ref_fn.ml:1: f: Not detected ./examples/using_make/exported.mli:10: F.plus_five: Not detected ./examples/using_make/exported.mli:16: M2.plus_five: Not detected -./examples/using_make/let_in.ml:1: complicated - +./examples/using_make/let_in.ml:1: complicated: Not detected ./examples/using_make/opt/sig_struct.ml:6: f: Not detected Nothing else to report in this section -------------------------------------------------------------------------------- @@ -589,8 +545,7 @@ Nothing else to report in this section .> UNUSED METHODS: ================= ./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused - +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused: Not detected ./examples/using_dune/unwrapped_lib/obj/with_class.mli:1: unused#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#never_used_fun ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#never_used_int @@ -621,22 +576,23 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected +./examples/using_make/advanced/mod.mli:4: p#f: Should not be detected ./examples/using_make/obj/class.mli:1: c#h ./examples/using_make/obj/class_type.mli:9: c#h ./examples/using_make/obj/coerce.mli:6: p#f ./examples/using_make/obj/coerce.mli:6: p#h -./examples/using_make/obj/constraint.ml:1: p#g +./examples/using_make/obj/constraint.ml:1: p#g: Not detected ./examples/using_make/obj/fooCl.mli:1: p1#g ./examples/using_make/obj/fooCl.mli:1: p1#h ./examples/using_make/obj/fooCl.mli:7: p2#h -./examples/using_make/obj/fun_class.ml:1: c#m3 -./examples/using_make/obj/fun_obj_param.ml:1: f#n +./examples/using_make/obj/fun_class.ml:1: c#m3: Not detected +./examples/using_make/obj/fun_obj_param.ml:1: f#n: Not detected ./examples/using_make/obj/inher.mli:1: p#h ./examples/using_make/obj/named.mli:10: c#g -./examples/using_make/obj/obj_inher.ml:1: c#g -./examples/using_make/obj/obj_inher.ml:1: c#h -./examples/using_make/obj/obj_inher.ml:19: o3#k -./examples/using_make/obj/object.ml:1: o#h +./examples/using_make/obj/obj_inher.ml:1: c#g: Not detected +./examples/using_make/obj/obj_inher.ml:1: c#h: Not detected +./examples/using_make/obj/obj_inher.ml:19: o3#k: Not detected +./examples/using_make/obj/object.ml:1: o#h: Not detected ./examples/using_make/obj/overr.mli:1: p1#g ./examples/using_make/obj/overr.mli:1: p1#h ./examples/using_make/obj/overr.mli:7: p2#g @@ -648,9 +604,8 @@ Nothing else to report in this section ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#externally_used: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#internally_used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#externally_used -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#internally_used - +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#externally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#internally_used: Not detected ./examples/using_dune/unwrapped_lib/obj/with_class.mli:35: _self_used#used ./examples/using_dune/unwrapped_lib/obj/with_class.mli:41: _self_used_fun_class#used ./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#externally_used_fun: Not detected @@ -680,29 +635,28 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_fun: Not detected ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_int: Not detected ./examples/using_make/advanced/func.mli:3: M.c#f -./examples/using_make/advanced/mod.mli:4: p#f - +./examples/using_make/advanced/mod.mli:4: p#f: Not detected ./examples/using_make/obj/class.mli:1: c#f ./examples/using_make/obj/class.mli:1: c#g ./examples/using_make/obj/class_type.mli:7: p#f ./examples/using_make/obj/class_type.mli:7: p#h ./examples/using_make/obj/coerce.mli:8: c#h -./examples/using_make/obj/constraint.ml:1: p#f -./examples/using_make/obj/depend.ml:8: M.c#f +./examples/using_make/obj/constraint.ml:1: p#f: Not detected +./examples/using_make/obj/depend.ml:8: M.c#f: Not detected ./examples/using_make/obj/fooCl.mli:1: p1#f ./examples/using_make/obj/fooCl.mli:7: p2#g -./examples/using_make/obj/fun_class.ml:1: c#m1 -./examples/using_make/obj/fun_class.ml:1: c#m2 -./examples/using_make/obj/fun_class.ml:1: c#m4 -./examples/using_make/obj/fun_obj_param.ml:1: f#m -./examples/using_make/obj/fun_obj_param.ml:1: f#x +./examples/using_make/obj/fun_class.ml:1: c#m1: Not detected +./examples/using_make/obj/fun_class.ml:1: c#m2: Not detected +./examples/using_make/obj/fun_class.ml:1: c#m4: Not detected +./examples/using_make/obj/fun_obj_param.ml:1: f#m: Not detected +./examples/using_make/obj/fun_obj_param.ml:1: f#x: Not detected ./examples/using_make/obj/inher.mli:1: p#f ./examples/using_make/obj/inher.mli:1: p#g ./examples/using_make/obj/named.mli:1: p1#g ./examples/using_make/obj/named.mli:6: p2#f ./examples/using_make/obj/named.mli:10: c#f -./examples/using_make/obj/object.ml:1: o#f -./examples/using_make/obj/object.ml:1: o#g +./examples/using_make/obj/object.ml:1: o#f: Not detected +./examples/using_make/obj/object.ml:1: o#g: Not detected ./examples/using_make/obj/overr.mli:1: p1#f ./examples/using_make/obj/overr.mli:12: c#g -------- @@ -711,8 +665,7 @@ Nothing else to report in this section .>-> ALMOST UNUSED METHODS: Called 2 time(s): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#used - +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#used: Not detected ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#externally_used_fun ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#externally_used_int ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#internally_used_fun @@ -738,7 +691,7 @@ Nothing else to report in this section ./examples/using_make/obj/class_type.mli:7: p#g ./examples/using_make/obj/coerce.mli:8: c#f ./examples/using_make/obj/named.mli:1: p1#f -./examples/using_make/obj/obj_inher.ml:1: c#f +./examples/using_make/obj/obj_inher.ml:1: c#f: Not detected -------- @@ -752,10 +705,9 @@ Nothing else to report in this section ./examples/using_dune/preprocessed_lib/preprocessed.mli:14: constructors.Unused ./examples/using_dune/preprocessed_lib/preprocessed.mli:19: constr_with_eq.Unused ./examples/using_dune/preprocessed_lib/preprocessed.mli:23: record.unused -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:25: constructors.Unused -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:30: constr_with_eq.Unused -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:39: record.unused - +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:25: constructors.Unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:30: constr_with_eq.Unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:39: record.unused: Not detected ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:1: unused_single_no_param.Unused_single_no_param ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:2: unused_single_unit.Unused_single_unit ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:3: unused_single_param.Unused_single_param @@ -826,12 +778,11 @@ Nothing else to report in this section ./examples/using_dune/preprocessed_lib/preprocessed.mli:25: record.internally_used ./examples/using_dune/preprocessed_lib/preprocessed.mli:26: record.externally_used ./examples/using_dune/preprocessed_lib/preprocessed.mli:29: record_with_eq.implicitly_used -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:27: constructors.Internally_used -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:28: constructors.Externally_used -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:41: record.internally_used -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:42: record.externally_used -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:45: record_with_eq.implicitly_used - +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:27: constructors.Internally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:28: constructors.Externally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:41: record.internally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:42: record.externally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:45: record_with_eq.implicitly_used: Not detected ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:25: internally_used_single_no_param.Internally_used_single_no_param ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:26: internally_used_single_unit.Internally_used_single_unit ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:27: internally_used_single_param.Internally_used_single_param @@ -897,9 +848,8 @@ Nothing else to report in this section ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./examples/using_dune/preprocessed_lib/preprocessed.mli:15: constructors.Used ./examples/using_dune/preprocessed_lib/preprocessed.mli:24: record.used -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:26: constructors.Used -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:40: record.used - +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:26: constructors.Used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:40: record.used: Not detected ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:17: used_single_no_param.Used_single_no_param ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:18: used_single_unit.Used_single_unit ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:19: used_single_param.Used_single_param @@ -1164,13 +1114,11 @@ Nothing else to report in this section ./examples/using_make/dir/anonFn2.mli:2: ?a (2/3 calls) ./examples/using_make/dir/anonFn2.mli:2: ?b (2/3 calls) ./examples/using_make/dir/match_opt.ml:1: ?b (2/3 calls) - ./examples/using_make/dir/matchopt.ml:1: ?x (3/4 calls) - ./examples/using_make/dir/ref_fn.ml:1: ?a (2/3 calls) ./examples/using_make/dir/ref_fn.ml:1: ?b (2/3 calls) - ./examples/using_make/matchopt.ml:1: ?x (3/4 calls) + ./examples/using_make/opt/sig_struct.ml:2: ?x (2/3 calls): Not detected ./examples/using_make/opt_in_opt.ml:1: ?b (1/2 calls) -------- @@ -1364,7 +1312,6 @@ Nothing else to report in this section ./examples/using_make/dir/anonFn.mli:3: ?a (1/2 calls) ./examples/using_make/dir/anonFn.mli:3: ?b (1/2 calls) ./examples/using_make/dir/anonFn2.mli:1: ?b (2/3 calls) - ./examples/using_make/dir/matchopt.ml:1: ?y (3/4 calls) ./examples/using_make/dir/matchopt.ml:1: ?z (3/4 calls) ./examples/using_make/let_in.ml:1: ?b (2/3 calls) @@ -1456,7 +1403,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 1274 -Success: 975 -Failed: 299 -Ratio: 76.5306122449% +Total: 1261 +Success: 798 +Failed: 463 +Ratio: 63.2831086439% diff --git a/docs/USAGE.md b/docs/USAGE.md index 2969ca19..c884e43f 100644 --- a/docs/USAGE.md +++ b/docs/USAGE.md @@ -24,9 +24,9 @@ Calling `dead_code_analyzer --help` provides the following output, describing the main command line aspect, different options available and their effects. -The `` argument is any number of directory, `.cmt` and `.cmi` files. +The `` argument is any number of directory, `.cmt` and `.cmti` files. These files can be produced using the compiler flags `-keep-locs` (on by default) -for `.cmi` and `-bin-annot` for `.cmt`. +for `.cmti` and `-bin-annot` for `.cmt`. The directories are traversed looking for such files. > [!TIP] > If you are using `dune` for your project, the files can be obtained via the @@ -190,15 +190,15 @@ the development. ``` src ├── debug -│   ├── debug.cmi +│   ├── debug.cmti │   ├── debug.cmt │   └── debug.ml -├── foo.cmi +├── foo.cmti ├── foo.cmt ├── foo.ml ├── foo.mli └── lib - ├── lib.cmi + ├── lib.cmti ├── lib.cmt ├── lib.ml └── lib.mli @@ -306,9 +306,9 @@ the file and moves on. - If a file is ignored and it is not obvious why, then opening an issue is welcome. -- If no file is ignored, check that no file is missing. There should be a `.cmi` +- If no file is ignored, check that no file is missing. There should be a `.cmti` and a `.cmt` file for each expected ``. -- If no `.cmi` or `.cmt` file is missing then the false negatives must be due +- If no `.cmti` or `.cmt` file is missing then the false negatives must be due to limitations of the tool and opening an issue is welcome. ## Thresholds diff --git a/docs/exported_values/HELLO_WORLD.md b/docs/exported_values/HELLO_WORLD.md index 22935a56..47e031f7 100644 --- a/docs/exported_values/HELLO_WORLD.md +++ b/docs/exported_values/HELLO_WORLD.md @@ -20,15 +20,14 @@ without any external use. The reference file for this example is [`hello_world_without_intf.ml`](../../examples/docs/exported_values/hello_world/hello_world_without_intf.ml). -The compilation command to produce `hello_world_without_intf.cmi` and -`hello_world_without_intf.cmt` is : +The compilation command to produce `hello_world_without_intf.cmt` is : ``` ocamlopt -bin-annot hello_world_without_intf.ml ``` The analysis command is : ``` -dead_code_analyzer --nothing -E all hello_world_without_intf.cmi hello_world_without_intf.cmt +dead_code_analyzer --nothing -E all hello_world_without_intf.cmt ``` ## First run @@ -62,7 +61,7 @@ reported location: `File "hello_world_without_intf.ml", line 8` Analyze : ``` -$ dead_code_analyzer --nothing -E all hello_world_without_intf.cmi hello_world_without_intf.cmt +$ dead_code_analyzer --nothing -E all hello_world_without_intf.cmt Scanning files... [DONE] @@ -100,7 +99,7 @@ Compile and analyze : ``` $ ocamlopt -bin-annot hello_world_without_intf.ml -$ dead_code_analyzer --nothing -E all hello_world_without_intf.cmi hello_world_without_intf.cmt +$ dead_code_analyzer --nothing -E all hello_world_without_intf.cmt Scanning files... [DONE] @@ -136,7 +135,7 @@ Compile and analyze : ``` $ ocamlopt -bin-annot hello_world_without_intf.ml -$ dead_code_analyzer --nothing -E all hello_world_without_intf.cmi hello_world_without_intf.cmt +$ dead_code_analyzer --nothing -E all hello_world_without_intf.cmt Scanning files... [DONE] @@ -160,14 +159,14 @@ The reference files for this example are [`hello_world_with_intf.mli`](../../examples/docs/exported_values/hello_world/hello_world_with_intf.mli) and [`hello_world_with_intf.ml`](../../examples/docs/exported_values/hello_world/hello_world_with_intf.ml) -The compilation command to produce `hello_world.cmi` and `hello_world.cmt` is : +The compilation command to produce `hello_world.cmti` and `hello_world.cmt` is : ``` ocamlopt -bin-annot hello_world_with_intf.mli hello_world_with_intf.ml ``` The analysis command is : ``` -dead_code_analyzer --nothing -E all hello_world.cmi hello_world.cmt +dead_code_analyzer --nothing -E all hello_world.cmti hello_world.cmt ``` ## First run @@ -199,7 +198,7 @@ File "hello_world_with_intf.ml", line 8, characters 6-19: ^^^^^^^^^^^^^ Warning 26 [unused-var]: unused variable goodbye_world. -$ dead_code_analyzer --nothing -E all hello_world.cmi hello_world.cmt +$ dead_code_analyzer --nothing -E all hello_world.cmti hello_world.cmt Scanning files... [DONE] @@ -246,7 +245,7 @@ let () = Compile and analyze : ``` $ ocamlopt -bin-annot hello_world_with_intf.ml -$ dead_code_analyzer --nothing -E all hello_world.cmi hello_world.cmt +$ dead_code_analyzer --nothing -E all hello_world.cmti hello_world.cmt Scanning files... [DONE] @@ -284,14 +283,14 @@ The reference files for this example are [`hello_world_lib.ml`](../../examples/docs/exported_values/hello_world/hello_world_lib.ml), and [`hello_world_bin.ml`](../../examples/docs/exported_values/hello_world/hello_world_bin.ml) -The compilation command to produce the necessary `.cmi` and `.cmt` files is : +The compilation command to produce the necessary `.cmti` and `.cmt` files is : ``` ocamlopt -bin-annot hello_world_lib.mli hello_world_lib.ml hello_world_bin.ml ``` The analysis command is : ``` -dead_code_analyzer --nothing -E all hello_world_lib.cmi hello_world_lib.cmt hello_world_bin.cmi hello_world_bin.cmt +dead_code_analyzer --nothing -E all hello_world_lib.cmti hello_world_lib.cmt hello_world_bin.cmti hello_world_bin.cmt ``` > [!NOTE] @@ -330,7 +329,7 @@ File "hello_world_bin.ml", line 5, characters 6-19: ^^^^^^^^^^^^^ Warning 26 [unused-var]: unused variable goodbye_world. -$ dead_code_analyzer --nothing -E all hello_world_lib.cmi hello_world_lib.cmt hello_world_bin.cmi hello_world_bin.cmt +$ dead_code_analyzer --nothing -E all hello_world_lib.cmti hello_world_lib.cmt hello_world_bin.cmti hello_world_bin.cmt Scanning files... [DONE] @@ -383,7 +382,7 @@ Compile and analyze : ``` $ ocamlopt -bin-annot hello_world_lib.mli hello_world_lib.ml hello_world_bin.ml -$ dead_code_analyzer --nothing -E all hello_world_lib.cmi hello_world_lib.cmt hello_world_bin.cmi hello_world_bin.cmt +$ dead_code_analyzer --nothing -E all hello_world_lib.cmti hello_world_lib.cmt hello_world_bin.cmti hello_world_bin.cmt Scanning files... [DONE] @@ -425,7 +424,7 @@ Compile and analyze : ``` $ ocamlopt -bin-annot hello_world_lib.mli hello_world_lib.ml hello_world_bin.ml -$ dead_code_analyzer --nothing -E all hello_world_lib.cmi hello_world_lib.cmt hello_world_bin.cmi hello_world_bin.cmt +$ dead_code_analyzer --nothing -E all hello_world_lib.cmti hello_world_lib.cmt hello_world_bin.cmti hello_world_bin.cmt Scanning files... [DONE] @@ -458,7 +457,7 @@ reach a satisfying codebase. The reference files for this example are all those listed previously. -The compilation command to produce the necessary `.cmi` and `.cmt` files, +The compilation command to produce the necessary `.cmti` and `.cmt` files, and the desired warnings is the combination of all the previous ones : ``` ocamlopt -w +32 -bin-annot hello_world_without_intf.ml hello_world_with_intf.mli hello_world_with_intf.ml hello_world_lib.mli hello_world_lib.ml hello_world_bin.ml @@ -476,7 +475,7 @@ dead_code_analyzer --nothing -E all . > [!TIP] > As we can see in the compilation command, there is a large number of files to -> list. Instead of listing all the `.cmi` and `.cmt` files in the command line, +> list. Instead of listing all the `.cmti` and `.cmt` files in the command line, > the analyzer accepts directories as arguments and will analyze all the > relevant files it can find in them. diff --git a/src/config/config.ml b/src/config/config.ml index ce0dd485..6fd45095 100644 --- a/src/config/config.ml +++ b/src/config/config.ml @@ -108,7 +108,7 @@ let normalize_path path = let rec add_filepaths acc path = match Utils.Filepath.kind ~exclude:(fun _ -> false) path with - | Cmi | Cmt -> Utils.StringSet.add path acc + | Cmti | Cmt -> Utils.StringSet.add path acc | Dir -> Sys.readdir path |> Array.fold_left diff --git a/src/deadCode.ml b/src/deadCode.ml index dc75fe6c..c542cac8 100644 --- a/src/deadCode.ml +++ b/src/deadCode.ml @@ -24,7 +24,7 @@ open DeadCommon (******** ATTRIBUTES ********) -let bad_files = ref [] (* unreadable cmi/cmt files *) +let bad_files = ref [] (* unreadable cmti/cmt files *) let main_files = Hashtbl.create 256 (* names -> paths *) @@ -391,28 +391,24 @@ let regabs state = hashtbl_add_unique_to_list main_files (Utils.Filepath.unit fn) () -let read_interface fn cmi_infos state = let open Cmi_format in - try - regabs state; - if Config.must_report_main state.config then - let u = - if State.File_infos.has_sourcepath state.file_infos then - State.File_infos.get_sourceunit state.file_infos - else - Utils.Filepath.unit fn - in - let module_id = - State.File_infos.get_modname state.file_infos - |> Ident.create_persistent - in - let f = - collect_export ~context:Toplevel [module_id] u decs - in - List.iter f cmi_infos.cmi_sign; - last_loc := Lexing.dummy_pos - with Cmi_format.Error (Wrong_version_interface _) -> - (*Printf.eprintf "cannot read cmi file: %s\n%!" fn;*) - bad_files := fn :: !bad_files +let read_interface fn signature state = + regabs state; + if Config.must_report_main state.config then + let u = + if State.File_infos.has_sourcepath state.file_infos then + State.File_infos.get_sourceunit state.file_infos + else + Utils.Filepath.unit fn + in + let module_id = + State.File_infos.get_modname state.file_infos + |> Ident.create_persistent + in + let f = + collect_export ~context:Toplevel [module_id] u decs + in + List.iter f signature.sig_type; + last_loc := Lexing.dummy_pos (* Merge a location's references to another one's *) @@ -489,13 +485,16 @@ let load_file fn state = in let exclude filepath = Config.is_excluded filepath state.State.config in match Utils.Filepath.kind ~exclude fn with - | Cmi when !DeadCommon.declarations -> + | Cmti when !DeadCommon.declarations -> + let open Cmt_format in last_loc := Lexing.dummy_pos; if state.State.config.verbose then Printf.eprintf "Scanning %s\n%!" fn; init_and_continue state fn (fun state -> - match state.file_infos.cmi_infos with - | None -> () (* TODO error handling ? *) - | Some cmi_infos -> read_interface fn cmi_infos state + match state.file_infos.cmti_infos with + | None -> bad_files := fn :: !bad_files + | Some {cmt_annots = Interface signature; _} -> + read_interface fn signature state + | _ -> () ) | Cmt -> @@ -558,7 +557,7 @@ let load_file fn state = | Dir -> (* TODO : better error handling *) failwith ("Internal error : Unexpected directory " - ^ fn ^ ". Only .cmi and .cmt are expected") + ^ fn ^ ". Only .cmti and .cmt are expected") | _ -> state @@ -703,15 +702,16 @@ let report_style () = (* Option parsing and processing *) let run_analysis state = - let process_file filename state = + let process_file state filename = let state = load_file filename state in State.update state; state in Printf.eprintf "Scanning files...\n%!"; - Utils.StringSet.fold + Utils.StringSet.elements state.State.config.paths_to_analyze + |> List.rev + |> List.fold_left process_file - state.State.config.paths_to_analyze state let () = diff --git a/src/deadCommon.ml b/src/deadCommon.ml index 7db05bac..08277c24 100644 --- a/src/deadCommon.ml +++ b/src/deadCommon.ml @@ -388,7 +388,7 @@ let export ?(sep = ".") path u stock id loc = ^ sep ^ (Ident.name id) in - (* a .cmi file can contain locations from other files. + (* a .cmti file can contain locations from other files. For instance: module M : Set.S with type elt = int will create value definitions whose location is in set.mli diff --git a/src/state/file_infos.ml b/src/state/file_infos.ml index 4a3eace1..9f293701 100644 --- a/src/state/file_infos.ml +++ b/src/state/file_infos.ml @@ -1,211 +1,117 @@ type t = { - cmti_file : string; + cm_file : string; sourcepath : string option; - builddir : string option; + builddir : string; modname : string; - cmi_infos : Cmi_format.cmi_infos option; + cmti_infos : Cmt_format.cmt_infos option; cmt_infos : Cmt_format.cmt_infos option; } let empty = { - cmti_file = ""; + cm_file = ""; sourcepath = None; - builddir = None; + builddir = "!!UNKNOWN_BUILDDIR!!"; modname = "!!UNKNOWN_MODNAME!!"; - cmi_infos = None; + cmti_infos = None; cmt_infos = None; } -(** [init_from_cmt_infos cmt_infos cmt_file] creates a [t] with: +(** [init_from_cmt_infos ~orig ~cm_file cmt_infos] creates a [t] with: - information from [cmt_infos]; - - [cmti_file = cmt_file]; - - [cmt_infos = Some cmt_infos]. *) -let init_from_cmt_infos cmt_infos cmt_file = + - [cm_file]; + - [cmt_infos = Some cmt_infos] if [orig = `Cmt] + - [cmti_infos = Some cmt_infos] if [orig = `Cmti] *) + let init_from_cmt_infos ~orig ~cm_file cmt_infos = let builddir = cmt_infos.Cmt_format.cmt_builddir in let sourcepath = Option.map Utils.Filepath.remove_pp cmt_infos.cmt_sourcefile |> Option.map (Filename.concat builddir) in let modname = cmt_infos.cmt_modname in - {empty with cmti_file = cmt_file; - builddir = Some builddir; - sourcepath; - modname; - cmt_infos = Some cmt_infos; - } + let cmt_infos, cmti_infos = + match orig with + | `Cmt -> Some cmt_infos, None + | `Cmti -> None, Some cmt_infos + in + {cm_file; sourcepath; builddir; modname; cmt_infos; cmti_infos} -(** [init_from_cmt cmt_file] returns an [Ok t] with [t] filled using - the [cmt_file] (see [init_from_cmt_infos]). +(** [init_from_cm_file ~orig cm_file] returns an [Ok t] with [t] filled using + the [cm_file] (see [init_from_cmt_infos]). In case the file does not exist or it cannot be read (see [Cmt_format.read_cmt]) then it returns an [Err msg] with msg a string describing the issue. *) -let init_from_cmt cmt_file = - if not (Sys.file_exists cmt_file) then Result.error (cmt_file ^ ": file not found") +let init_from_cm_file ~orig cm_file = + if not (Sys.file_exists cm_file) then Result.error (cm_file ^ ": file not found") else try - let cmt_infos = Cmt_format.read_cmt cmt_file in - init_from_cmt_infos cmt_infos cmt_file + let cmt_infos = Cmt_format.read_cmt cm_file in + init_from_cmt_infos ~orig ~cm_file cmt_infos |> Result.ok - with _ -> Result.error (cmt_file ^ ": cannot read cmt file") - - -let sourcefname_of_cmi_infos cmi_unit cmi_infos = - let candidate_of_fname fname = - let src_unit = Utils.Filepath.unit fname in - if String.equal src_unit cmi_unit then - `Identical fname - else if String.ends_with ~suffix:src_unit cmi_unit then - `Suffix fname - else `Different - in - let fname_of_candidate = function - | `Different -> None - | `Identical fname - | `Suffix fname -> Some fname - in - let get_item_loc (sig_item : Types.signature_item) = - match sig_item with - | Sig_value (_, {val_loc = loc; _}, _) - | Sig_type (_, {type_loc = loc; _}, _, _) - | Sig_typext (_, {ext_loc = loc; _}, _, _) - | Sig_module (_, _, {md_loc = loc; _}, _, _) - | Sig_modtype (_, {mtd_loc = loc; _}, _) - | Sig_class (_, {cty_loc = loc; _}, _, _) - | Sig_class_type (_, {clty_loc = loc; _}, _, _) -> - loc - in - let rec find_sourcename candidate = function - | [] -> fname_of_candidate candidate - | sig_item::items -> - let loc = get_item_loc sig_item in - if loc.Location.loc_ghost then find_sourcename candidate items - else - let fname = loc.Location.loc_start.pos_fname in - match candidate, candidate_of_fname fname with - | (`Identical _ as candidate), _ - | _, (`Identical _ as candidate) -> - (* best candidate found *) - fname_of_candidate candidate - | `Different, candidate - | candidate, `Different - | _, candidate -> - find_sourcename candidate items - in - find_sourcename `Different cmi_infos.Cmi_format.cmi_sign - -(** [init_from_cmi_infos ?with_cmt cmi_infos cmi_file] creates a [t] with: - - information from [cmt_infos]; - - [cmti_file = cmt_file]; - - [cmi_infos = Some cmi_infos]. - Because the [cmi_infos] is not as complete as [cmt_infos] (e.g. it does not - specify the [builddir]), an existing [t] filled using the correpsonding - [cmt_infos] can be passed as argument. In this case, information unavailable - in the [cmi_infos] is read from [with_cmt]. Otherwise, default values are - set for [builddir] and eventually [sourcepath]. *) -let init_from_cmi_infos ?with_cmt cmi_infos cmi_file = - let builddir = Option.bind with_cmt (fun {builddir; _} -> builddir) in - let sourcepath = - let sourcepath = - (* Try to find a sourcepath in the cmi_infos *) - let cmi_unit = Utils.Filepath.unit cmi_file in - let sourcefname = sourcefname_of_cmi_infos cmi_unit cmi_infos in - match sourcefname, builddir with - | Some fname, Some builddir -> Some (Filename.concat builddir fname) - | _, _ -> sourcefname - in - match sourcepath with - | Some _ -> sourcepath - | None -> - (* There is no satisfying sourcepath in the cmi_infos. - Try to retrieve the sourecpath using with_cmt. - *) - let sourcepath_of_cmt cmt_file sourcepath = - (* When producing .cmt files for .ml files, the compiler also produces - .cmti files for .mli files. Hence, if a .cmti exists, we assume the - .mli does. - *) - if Sys.file_exists (cmt_file ^ "i") then sourcepath ^ "i" - else sourcepath + with _ -> + let ext = + match orig with + | `Cmt -> ".cmt" + | `Cmti -> ".cmti" in - Option.bind with_cmt - (fun {sourcepath; cmti_file; _} -> - Option.map (sourcepath_of_cmt cmti_file) sourcepath - ) - + Result.error (Printf.sprintf "%s: cannot read %s file" cm_file ext) + +let init cm_file = + let ( let* ) x f = Result.bind x f in + let* orig = + match Filename.extension cm_file with + | ".cmt" -> Result.ok `Cmt + | ".cmti" -> Result.ok `Cmti + | _ -> Result.error (cm_file ^ ": not a .cmti or .cmt file") in - let modname = cmi_infos.cmi_name in - {empty with cmti_file = cmi_file; - builddir; - sourcepath; - modname; - cmi_infos = Some cmi_infos; - } - -(** [init_from_cmi cmi_file] returns an [Ok t] with [t] filled using - the [cmi_file] (see [init_from_cmi_infos]). - In case the file does not exist or it cannot be read (see - [Cmi_format.read_cmi]) then it returns an [Err msg] with msg a string - describing the issue. *) -let init_from_cmi ?with_cmt cmi_file = - if not (Sys.file_exists cmi_file) then Result.error (cmi_file ^ ": file not found") - else - try - let cmi_infos = Cmi_format.read_cmi cmi_file in - init_from_cmi_infos ?with_cmt cmi_infos cmi_file - |> Result.ok - with _ -> Result.error (cmi_file ^ ": cannot read cmi file") - -let init cmti_file = - let no_ext = Filename.remove_extension cmti_file in - match Filename.extension cmti_file with - | ".cmi" -> - let with_cmt = init_from_cmt (no_ext ^ ".cmt") |> Result.to_option in - init_from_cmi ?with_cmt cmti_file - | ".cmt" -> - let with_cmi_infos with_cmt = - match init_from_cmi ~with_cmt (no_ext ^ ".cmi") with - | Error _ -> with_cmt - | Ok {cmi_infos; _} -> {with_cmt with cmi_infos} - in - init_from_cmt cmti_file |> Result.map with_cmi_infos - | _ -> Result.error (cmti_file ^ ": not a .cmi or .cmt file") - -let change_file file_infos cmti_file = - let no_ext = Filename.remove_extension cmti_file in - assert(no_ext = Filename.remove_extension file_infos.cmti_file); - match Filename.extension cmti_file, file_infos with - | ".cmi", {cmi_infos=Some cmi_infos; _} -> - let res = init_from_cmi_infos ~with_cmt:file_infos cmi_infos cmti_file in - Result.ok res - | ".cmt", {cmt_infos = Some cmt_infos; cmi_infos; _} -> - let res = init_from_cmt_infos cmt_infos cmti_file in - Result.ok {res with cmi_infos} - | _ -> (* corresponding info is None *) - init cmti_file - -let has_builddir file_infos = Option.is_some file_infos.builddir + let* file_infos = init_from_cm_file ~orig cm_file in + let cmt_infos, cmti_infos = + let no_ext = Filename.remove_extension cm_file in + match orig with + | `Cmt -> + let cmti_infos = + init_from_cm_file ~orig:`Cmti (no_ext ^ ".cmti") + |> Result.map (fun {cmti_infos; _} -> cmti_infos) + |> Result.value ~default:file_infos.cmti_infos + in + file_infos.cmt_infos, cmti_infos + | `Cmti -> + let cmt_infos = + init_from_cm_file ~orig:`Cmt (no_ext ^ ".cmt") + |> Result.map (fun {cmt_infos; _} -> cmt_infos) + |> Result.value ~default:file_infos.cmt_infos + in + cmt_infos, file_infos.cmti_infos + in + Result.ok {file_infos with cmt_infos; cmti_infos} + +let change_file file_infos cm_file = + let no_ext = Filename.remove_extension cm_file in + assert(no_ext = Filename.remove_extension file_infos.cm_file); + match Filename.extension cm_file, file_infos with + | ".cmt", {cmt_infos=Some cmt_infos; cmti_infos; _} -> + let res = init_from_cmt_infos ~orig:`Cmt ~cm_file cmt_infos in + Result.ok {res with cmti_infos} + | ".cmti", {cmti_infos=Some cmti_infos; cmt_infos; _} -> + let res = init_from_cmt_infos ~orig:`Cmti ~cm_file cmti_infos in + Result.ok {res with cmt_infos} + | _ -> (* corresponding info is None or invlaid extension *) + init cm_file let has_sourcepath file_infos = Option.is_some file_infos.sourcepath -let get_builddir t = - match t.builddir with - | Some builddir -> builddir - | None -> "!!UNKNOWN_BUILDDIR_FOR<" ^ t.cmti_file ^ ">!!" +let get_builddir t = t.builddir let get_sourcepath t = match t.sourcepath with - | Some sourcepath -> - sourcepath - | None -> match t.builddir with - | Some builddir -> + | Some sourcepath -> sourcepath + | None -> Printf.sprintf "!!UNKNOWN_SOURCEPATH_IN<%s>_FOR_<%s>!!" - builddir - t.cmti_file - | None -> "!!UNKNOWN_SOURCEPATH_FOR<" ^ t.cmti_file ^ ">!!" + t.builddir + t.cm_file let get_sourceunit t = match t.sourcepath with | Some sourcepath -> Utils.Filepath.unit sourcepath - | None -> "!!UNKNOWN_SOURCEUNIT_FOR<" ^ t.cmti_file ^ ">!!" + | None -> "!!UNKNOWN_SOURCEUNIT_FOR<" ^ t.cm_file ^ ">!!" let get_modname t = t.modname diff --git a/src/state/file_infos.mli b/src/state/file_infos.mli index 8e29bb87..bf782cec 100644 --- a/src/state/file_infos.mli +++ b/src/state/file_infos.mli @@ -1,32 +1,31 @@ -(** Information about a analyzable file ([.cmi] or [.cmt] file) *) +(** Information about a analyzable file ([.cmti] or [.cmt] file) *) type t = { - cmti_file : string; (** The filepath currently analyzed *) + cm_file : string; (** The filepath currently analyzed *) sourcepath : string option; (** The path to the associated source file *) - builddir : string option; (** The [cmt_builddir] *) - modname : string; (** Either [cmi_name] or [cmt_modname] *) - cmi_infos : Cmi_format.cmi_infos option; + builddir : string; (** The [cmt_builddir] *) + modname : string; (** Either [cmti_name] or [cmt_modname] *) + cmti_infos : Cmt_format.cmt_infos option; cmt_infos : Cmt_format.cmt_infos option; } val empty : t (** No file info *) val init : string -> (t, string) result -(** [init cmti_file] expects either a [.cmi] or [.cmt] filepath as argument and - returns an [Ok t] with [t] filled using the [cmit_file]. +(** [init cm_file] expects either a [.cmti] or [.cmt] filepath as argument and + returns an [Ok t] with [t] filled using the [cmtit_file]. In case the file does not exist, it cannot be read, or its extension is invalid, then it returns an [Err msg] with msg a string describing the issue. *) val change_file : t -> string -> (t, string) result -(** [change_file t cmti_file] expects either a [.cmi] or a [.cmt] filepath as - argument. [cmti_file] must be the same as [t.cmti_file], ignoring the +(** [change_file t cm_file] expects either a [.cmti] or a [.cmt] filepath as + argument. [cm_file] must be the same as [t.cm_file], ignoring the extension. The returned value is either a simple update of [t] if the necessary - [cmi_infos] or [cmt_infos] is available. Otherwise, it is the result of + [cmti_infos] or [cmt_infos] is available. Otherwise, it is the result of [init t] *) -val has_builddir : t -> bool val has_sourcepath : t -> bool val get_builddir : t -> string diff --git a/src/state/state.ml b/src/state/state.ml index 1418a125..0caa2a0e 100644 --- a/src/state/state.ml +++ b/src/state/state.ml @@ -13,20 +13,20 @@ let init config = let update_config config state = {state with config} -let change_file state cmti_file = +let change_file state cm_file = let file_infos = state.file_infos in let equal_no_ext filename1 filename2 = let no_ext1 = Filename.remove_extension filename1 in let no_ext2 = Filename.remove_extension filename2 in no_ext1 = no_ext2 in - if file_infos.cmti_file = cmti_file then + if file_infos.cm_file = cm_file then Result.ok state - else if equal_no_ext file_infos.cmti_file cmti_file then - let file_infos = File_infos.change_file file_infos cmti_file in + else if equal_no_ext file_infos.cm_file cm_file then + let file_infos = File_infos.change_file file_infos cm_file in Result.map (fun file_infos -> {state with file_infos}) file_infos else - let file_infos = File_infos.init cmti_file in + let file_infos = File_infos.init cm_file in Result.map (fun file_infos -> {state with file_infos}) file_infos (** Analysis' state *) diff --git a/src/utils.ml b/src/utils.ml index 59bbb0a0..5cd89f0d 100644 --- a/src/utils.ml +++ b/src/utils.ml @@ -13,7 +13,7 @@ module Filepath = struct Unit_info.lax_modname_from_source filepath type kind = - | Cmi + | Cmti | Cmt | Dir | Ignore @@ -26,7 +26,7 @@ module Filepath = struct Ignore ) else if Sys.is_directory filepath then Dir - else if Filename.check_suffix filepath ".cmi" then Cmi + else if Filename.check_suffix filepath ".cmti" then Cmti else if Filename.check_suffix filepath ".cmt" then Cmt else Ignore end diff --git a/src/utils.mli b/src/utils.mli index 86407a5d..188d7066 100644 --- a/src/utils.mli +++ b/src/utils.mli @@ -10,7 +10,7 @@ module Filepath : sig (** [unit filepath] estimates the compilation unit of [filepath] *) type kind = - | Cmi (** .cmi file *) + | Cmti (** .cmti file *) | Cmt (** .cmt file *) | Dir (** Directory *) | Ignore (** Irrelevant for the analyzer *) From 77211aac637c5d98844fb9c2e0b974692698bad4 Mon Sep 17 00:00:00 2001 From: Corentin De Souza <9597216+fantazio@users.noreply.github.com> Date: Fri, 5 Dec 2025 23:29:22 +0100 Subject: [PATCH 04/12] [src][input][2/n] read `cmi_infos` from `.cmti` and `.cmt` If a `.ml` has a `.mli` then its interface is available as `cmi_infos` in the `.cmti`. Otherwise, there is no `.cmti` and it is available in the`.cmt`. All FN and FP introduced by the previous commit are fixed. --- check/classic/classic.ref | 130 ++++--- check/internal/internal.ref | 130 ++++--- check/threshold-1/threshold-1.ref | 332 +++++++++-------- check/threshold-3-0.5/threshold-3-0.5.ref | 414 ++++++++++++---------- src/config/config.ml | 2 +- src/deadCode.ml | 143 ++++---- src/state/file_infos.ml | 62 ++-- src/state/file_infos.mli | 3 +- src/utils.ml | 8 +- src/utils.mli | 3 +- 10 files changed, 679 insertions(+), 548 deletions(-) diff --git a/check/classic/classic.ref b/check/classic/classic.ref index 3cef088f..5c224477 100644 --- a/check/classic/classic.ref +++ b/check/classic/classic.ref @@ -9,10 +9,13 @@ ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:26: Internal_app.unused -./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused: Not detected -./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused: Not detected -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused: Not detected -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement: Not detected +./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused +./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused + +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Should not be detected +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement + ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:19: M_redef.unused @@ -23,11 +26,16 @@ ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:4: world +./examples/docs/exported_values/limitations/incl_same_name/oo.mli:20: copy: Should not be detected +./examples/docs/exported_values/limitations/incl_same_name/oo.mli:25: id: Should not be detected +./examples/docs/exported_values/limitations/incl_same_name/oo.mli:40: new_method: Should not be detected +./examples/docs/exported_values/limitations/incl_same_name/oo.mli:41: public_method_label: Should not be detected ./examples/docs/exported_values/limitations/sigincl/sigincl_lib.mli:10: I.x: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:1: unused ./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used ./examples/using_dune/preprocessed_lib/preprocessed.mli:38: internally_used_f -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused + ./examples/using_dune/reduced_lib/reduced_lib.mli:3: Values.used_by_API ./examples/using_dune/reduced_lib/reduced_lib.mli:4: Values.internally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:10: Values_no_intf.used_by_API @@ -48,8 +56,13 @@ ./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:8: Exported.lib_internal_unused ./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused: Not detected -./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_unused: Not detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused +./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Should not be detected +./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_unused + ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg @@ -64,11 +77,12 @@ ./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int -./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:20: unused_alias_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure: Not detected +./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:20: unused_alias_fun +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure + ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg @@ -83,35 +97,38 @@ ./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int -./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:20: unused_alias_fun: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:25: unused_closure: Not detected +./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:20: unused_alias_fun +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:25: unused_closure + ./examples/using_make/advanced/inc_val.mli:1: x ./examples/using_make/advanced/inc_val.mli:2: y ./examples/using_make/advanced/val.mli:1: x: Should not be detected ./examples/using_make/advanced/val.mli:2: y: Should not be detected -./examples/using_make/bar.ml:1: x: Not detected -./examples/using_make/bar_fn.ml:3: h: Not detected +./examples/using_make/bar.ml:1: x +./examples/using_make/bar_fn.ml:3: h ./examples/using_make/baz.mli:1: z ./examples/using_make/baz.mli:3: u -./examples/using_make/cond_sel.ml:13: h: Not detected -./examples/using_make/dir/alias_opt.ml:7: y: Not detected -./examples/using_make/dir/alias_opt.ml:14: x: Not detected -./examples/using_make/dir/anon_call.ml:1: f: Not detected -./examples/using_make/dir/anon_call.ml:5: g: Not detected -./examples/using_make/dir/anon_call.ml:9: h: Not detected -./examples/using_make/dir/anon_call2.ml:1: f: Not detected -./examples/using_make/dir/anon_call2.ml:5: g: Not detected -./examples/using_make/dir/anon_call2.ml:9: h: Not detected -./examples/using_make/dir/match_opt.ml:8: l: Not detected -./examples/using_make/dir/matchopt.ml:5: w: Not detected +./examples/using_make/cond_sel.ml:13: h + +./examples/using_make/dir/alias_opt.ml:7: y +./examples/using_make/dir/alias_opt.ml:14: x +./examples/using_make/dir/anon_call.ml:1: f +./examples/using_make/dir/anon_call.ml:5: g +./examples/using_make/dir/anon_call.ml:9: h +./examples/using_make/dir/anon_call2.ml:1: f +./examples/using_make/dir/anon_call2.ml:5: g +./examples/using_make/dir/anon_call2.ml:9: h +./examples/using_make/dir/match_opt.ml:8: l +./examples/using_make/dir/matchopt.ml:5: w ./examples/using_make/dir/mod.mli:10: M.f ./examples/using_make/dir/mod.mli:11: M.g ./examples/using_make/dir/refFn.mli:3: x -./examples/using_make/dir/ref_opt.ml:3: no: Not detected -./examples/using_make/dir/ref_opt.ml:11: x: Not detected +./examples/using_make/dir/ref_opt.ml:3: no +./examples/using_make/dir/ref_opt.ml:11: x + ./examples/using_make/exported.mli:6: M1.five ./examples/using_make/exported.mli:10: F.plus_five ./examples/using_make/exported.mli:11: F.times_five @@ -124,9 +141,9 @@ ./examples/using_make/functor.mli:3: M.none ./examples/using_make/functor.mli:7: F.g ./examples/using_make/functor.mli:11: N.g -./examples/using_make/let_in.ml:3: parent: Not detected -./examples/using_make/let_test.ml:3: g: Not detected -./examples/using_make/matchopt.ml:5: w: Not detected +./examples/using_make/let_in.ml:3: parent +./examples/using_make/let_test.ml:3: g +./examples/using_make/matchopt.ml:5: w ./examples/using_make/mod_alias.mli:2: M1.id ./examples/using_make/mod_alias.mli:6: M2.id @@ -135,11 +152,11 @@ ./examples/using_make/obj/inher.mli:11: o ./examples/using_make/obj/inher.mli:13: f -./examples/using_make/opt_in_opt.ml:7: x: Not detected -./examples/using_make/qux.ml:1: z: Not detected -./examples/using_make/unused_fn.ml:3: g: Not detected -./examples/using_make/unused_fn.ml:5: var: Not detected -./examples/using_make/useless_opt.ml:3: x: Not detected +./examples/using_make/opt_in_opt.ml:7: x +./examples/using_make/qux.ml:1: z +./examples/using_make/unused_fn.ml:3: g +./examples/using_make/unused_fn.ml:5: var +./examples/using_make/useless_opt.ml:3: x ./examples/using_make/variant.mli:5: f Nothing else to report in this section @@ -149,7 +166,8 @@ Nothing else to report in this section .> UNUSED METHODS: ================= ./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused + ./examples/using_dune/unwrapped_lib/obj/with_class.mli:1: unused#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#never_used_fun ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#never_used_int @@ -180,23 +198,22 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected -./examples/using_make/advanced/mod.mli:4: p#f: Should not be detected ./examples/using_make/obj/class.mli:1: c#h ./examples/using_make/obj/class_type.mli:9: c#h ./examples/using_make/obj/coerce.mli:6: p#f ./examples/using_make/obj/coerce.mli:6: p#h -./examples/using_make/obj/constraint.ml:1: p#g: Not detected +./examples/using_make/obj/constraint.ml:1: p#g ./examples/using_make/obj/fooCl.mli:1: p1#g ./examples/using_make/obj/fooCl.mli:1: p1#h ./examples/using_make/obj/fooCl.mli:7: p2#h -./examples/using_make/obj/fun_class.ml:1: c#m3: Not detected -./examples/using_make/obj/fun_obj_param.ml:1: f#n: Not detected +./examples/using_make/obj/fun_class.ml:1: c#m3 +./examples/using_make/obj/fun_obj_param.ml:1: f#n ./examples/using_make/obj/inher.mli:1: p#h ./examples/using_make/obj/named.mli:10: c#g -./examples/using_make/obj/obj_inher.ml:1: c#g: Not detected -./examples/using_make/obj/obj_inher.ml:1: c#h: Not detected -./examples/using_make/obj/obj_inher.ml:19: o3#k: Not detected -./examples/using_make/obj/object.ml:1: o#h: Not detected +./examples/using_make/obj/obj_inher.ml:1: c#g +./examples/using_make/obj/obj_inher.ml:1: c#h +./examples/using_make/obj/obj_inher.ml:19: o3#k +./examples/using_make/obj/object.ml:1: o#h ./examples/using_make/obj/overr.mli:1: p1#g ./examples/using_make/obj/overr.mli:1: p1#h ./examples/using_make/obj/overr.mli:7: p2#g @@ -211,9 +228,10 @@ Nothing else to report in this section ./examples/using_dune/preprocessed_lib/preprocessed.mli:14: constructors.Unused ./examples/using_dune/preprocessed_lib/preprocessed.mli:19: constr_with_eq.Unused ./examples/using_dune/preprocessed_lib/preprocessed.mli:23: record.unused -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:25: constructors.Unused: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:30: constr_with_eq.Unused: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:39: record.unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:25: constructors.Unused +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:30: constr_with_eq.Unused +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:39: record.unused + ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:1: unused_single_no_param.Unused_single_no_param ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:2: unused_single_unit.Unused_single_unit ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:3: unused_single_param.Unused_single_param @@ -620,7 +638,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 546 -Success: 463 -Failed: 83 -Ratio: 84.7985347985% +Total: 554 +Success: 514 +Failed: 40 +Ratio: 92.7797833935% diff --git a/check/internal/internal.ref b/check/internal/internal.ref index b57234e5..afc8cde8 100644 --- a/check/internal/internal.ref +++ b/check/internal/internal.ref @@ -9,10 +9,13 @@ ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:26: Internal_app.unused -./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused: Not detected -./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused: Not detected -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused: Not detected -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement: Not detected +./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused +./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused + +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Should not be detected +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement + ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:19: M_redef.unused @@ -22,11 +25,16 @@ ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello: Should not be detected ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye: Should not be detected ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:4: world: Should not be detected +./examples/docs/exported_values/limitations/incl_same_name/oo.mli:20: copy: Should not be detected +./examples/docs/exported_values/limitations/incl_same_name/oo.mli:25: id: Should not be detected +./examples/docs/exported_values/limitations/incl_same_name/oo.mli:40: new_method: Should not be detected +./examples/docs/exported_values/limitations/incl_same_name/oo.mli:41: public_method_label: Should not be detected ./examples/docs/exported_values/limitations/sigincl/sigincl_lib.mli:10: I.x: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:1: unused ./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:38: internally_used_f: Should not be detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused + ./examples/using_dune/reduced_lib/reduced_lib.mli:3: Values.used_by_API ./examples/using_dune/reduced_lib/reduced_lib.mli:4: Values.internally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:10: Values_no_intf.used_by_API @@ -47,8 +55,13 @@ ./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:8: Exported.lib_internal_unused ./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused: Not detected -./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_unused: Not detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused +./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Should not be detected +./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_unused + ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected @@ -62,11 +75,12 @@ ./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected -./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:20: unused_alias_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure: Not detected +./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:20: unused_alias_fun +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure + ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected @@ -80,35 +94,38 @@ ./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected -./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:20: unused_alias_fun: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:25: unused_closure: Not detected +./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:20: unused_alias_fun +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:25: unused_closure + ./examples/using_make/advanced/inc_val.mli:1: x ./examples/using_make/advanced/inc_val.mli:2: y ./examples/using_make/advanced/val.mli:1: x: Should not be detected ./examples/using_make/advanced/val.mli:2: y: Should not be detected -./examples/using_make/bar.ml:1: x: Not detected -./examples/using_make/bar_fn.ml:3: h: Not detected +./examples/using_make/bar.ml:1: x +./examples/using_make/bar_fn.ml:3: h ./examples/using_make/baz.mli:1: z ./examples/using_make/baz.mli:3: u -./examples/using_make/cond_sel.ml:13: h: Not detected -./examples/using_make/dir/alias_opt.ml:7: y: Not detected -./examples/using_make/dir/alias_opt.ml:14: x: Not detected -./examples/using_make/dir/anon_call.ml:1: f: Not detected -./examples/using_make/dir/anon_call.ml:5: g: Not detected -./examples/using_make/dir/anon_call.ml:9: h: Not detected -./examples/using_make/dir/anon_call2.ml:1: f: Not detected -./examples/using_make/dir/anon_call2.ml:5: g: Not detected -./examples/using_make/dir/anon_call2.ml:9: h: Not detected -./examples/using_make/dir/match_opt.ml:8: l: Not detected -./examples/using_make/dir/matchopt.ml:5: w: Not detected +./examples/using_make/cond_sel.ml:13: h + +./examples/using_make/dir/alias_opt.ml:7: y +./examples/using_make/dir/alias_opt.ml:14: x +./examples/using_make/dir/anon_call.ml:1: f +./examples/using_make/dir/anon_call.ml:5: g +./examples/using_make/dir/anon_call.ml:9: h +./examples/using_make/dir/anon_call2.ml:1: f +./examples/using_make/dir/anon_call2.ml:5: g +./examples/using_make/dir/anon_call2.ml:9: h +./examples/using_make/dir/match_opt.ml:8: l +./examples/using_make/dir/matchopt.ml:5: w ./examples/using_make/dir/mod.mli:10: M.f: Should not be detected ./examples/using_make/dir/mod.mli:11: M.g ./examples/using_make/dir/refFn.mli:3: x -./examples/using_make/dir/ref_opt.ml:3: no: Not detected -./examples/using_make/dir/ref_opt.ml:11: x: Not detected +./examples/using_make/dir/ref_opt.ml:3: no +./examples/using_make/dir/ref_opt.ml:11: x + ./examples/using_make/exported.mli:6: M1.five: Should not be detected ./examples/using_make/exported.mli:10: F.plus_five: Should not be detected ./examples/using_make/exported.mli:11: F.times_five @@ -121,20 +138,20 @@ ./examples/using_make/functor.mli:3: M.none ./examples/using_make/functor.mli:7: F.g: Should not be detected ./examples/using_make/functor.mli:11: N.g: Should not be detected -./examples/using_make/let_in.ml:3: parent: Not detected -./examples/using_make/let_test.ml:3: g: Not detected -./examples/using_make/matchopt.ml:5: w: Not detected +./examples/using_make/let_in.ml:3: parent +./examples/using_make/let_test.ml:3: g +./examples/using_make/matchopt.ml:5: w ./examples/using_make/mod_alias.mli:2: M1.id: Should not be detected ./examples/using_make/mod_alias.mli:6: M2.id: Should not be detected ./examples/using_make/obj/class.mli:7: o: Should not be detected ./examples/using_make/obj/class.mli:9: f: Should not be detected ./examples/using_make/obj/inher.mli:11: o: Should not be detected ./examples/using_make/obj/inher.mli:13: f: Should not be detected -./examples/using_make/opt_in_opt.ml:7: x: Not detected -./examples/using_make/qux.ml:1: z: Not detected -./examples/using_make/unused_fn.ml:3: g: Not detected -./examples/using_make/unused_fn.ml:5: var: Not detected -./examples/using_make/useless_opt.ml:3: x: Not detected +./examples/using_make/opt_in_opt.ml:7: x +./examples/using_make/qux.ml:1: z +./examples/using_make/unused_fn.ml:3: g +./examples/using_make/unused_fn.ml:5: var +./examples/using_make/useless_opt.ml:3: x ./examples/using_make/variant.mli:5: f: Should not be detected Nothing else to report in this section -------------------------------------------------------------------------------- @@ -143,7 +160,8 @@ Nothing else to report in this section .> UNUSED METHODS: ================= ./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused + ./examples/using_dune/unwrapped_lib/obj/with_class.mli:1: unused#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#never_used_fun ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#never_used_int @@ -174,23 +192,22 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected -./examples/using_make/advanced/mod.mli:4: p#f: Should not be detected ./examples/using_make/obj/class.mli:1: c#h ./examples/using_make/obj/class_type.mli:9: c#h ./examples/using_make/obj/coerce.mli:6: p#f ./examples/using_make/obj/coerce.mli:6: p#h -./examples/using_make/obj/constraint.ml:1: p#g: Not detected +./examples/using_make/obj/constraint.ml:1: p#g ./examples/using_make/obj/fooCl.mli:1: p1#g ./examples/using_make/obj/fooCl.mli:1: p1#h ./examples/using_make/obj/fooCl.mli:7: p2#h -./examples/using_make/obj/fun_class.ml:1: c#m3: Not detected -./examples/using_make/obj/fun_obj_param.ml:1: f#n: Not detected +./examples/using_make/obj/fun_class.ml:1: c#m3 +./examples/using_make/obj/fun_obj_param.ml:1: f#n ./examples/using_make/obj/inher.mli:1: p#h ./examples/using_make/obj/named.mli:10: c#g -./examples/using_make/obj/obj_inher.ml:1: c#g: Not detected -./examples/using_make/obj/obj_inher.ml:1: c#h: Not detected -./examples/using_make/obj/obj_inher.ml:19: o3#k: Not detected -./examples/using_make/obj/object.ml:1: o#h: Not detected +./examples/using_make/obj/obj_inher.ml:1: c#g +./examples/using_make/obj/obj_inher.ml:1: c#h +./examples/using_make/obj/obj_inher.ml:19: o3#k +./examples/using_make/obj/object.ml:1: o#h ./examples/using_make/obj/overr.mli:1: p1#g ./examples/using_make/obj/overr.mli:1: p1#h ./examples/using_make/obj/overr.mli:7: p2#g @@ -205,9 +222,10 @@ Nothing else to report in this section ./examples/using_dune/preprocessed_lib/preprocessed.mli:14: constructors.Unused ./examples/using_dune/preprocessed_lib/preprocessed.mli:19: constr_with_eq.Unused ./examples/using_dune/preprocessed_lib/preprocessed.mli:23: record.unused -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:25: constructors.Unused: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:30: constr_with_eq.Unused: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:39: record.unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:25: constructors.Unused +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:30: constr_with_eq.Unused +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:39: record.unused + ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:1: unused_single_no_param.Unused_single_no_param ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:2: unused_single_unit.Unused_single_unit ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:3: unused_single_param.Unused_single_param @@ -614,7 +632,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 546 -Success: 421 -Failed: 125 -Ratio: 77.1062271062% +Total: 554 +Success: 472 +Failed: 82 +Ratio: 85.1985559567% diff --git a/check/threshold-1/threshold-1.ref b/check/threshold-1/threshold-1.ref index 89cb1828..c1237269 100644 --- a/check/threshold-1/threshold-1.ref +++ b/check/threshold-1/threshold-1.ref @@ -9,10 +9,13 @@ ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:26: Internal_app.unused -./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused: Not detected -./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused: Not detected -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused: Not detected -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement: Not detected +./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused +./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused + +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Should not be detected +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement + ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:19: M_redef.unused @@ -22,11 +25,16 @@ ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello: Should not be detected ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye: Should not be detected ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:4: world: Should not be detected +./examples/docs/exported_values/limitations/incl_same_name/oo.mli:20: copy: Should not be detected +./examples/docs/exported_values/limitations/incl_same_name/oo.mli:25: id: Should not be detected +./examples/docs/exported_values/limitations/incl_same_name/oo.mli:40: new_method: Should not be detected +./examples/docs/exported_values/limitations/incl_same_name/oo.mli:41: public_method_label: Should not be detected ./examples/docs/exported_values/limitations/sigincl/sigincl_lib.mli:10: I.x: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:1: unused ./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:38: internally_used_f: Should not be detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused + ./examples/using_dune/reduced_lib/reduced_lib.mli:3: Values.used_by_API ./examples/using_dune/reduced_lib/reduced_lib.mli:4: Values.internally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:10: Values_no_intf.used_by_API @@ -47,8 +55,13 @@ ./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:8: Exported.lib_internal_unused ./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused: Not detected -./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_unused: Not detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused +./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Should not be detected +./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_unused + ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected @@ -62,11 +75,12 @@ ./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected -./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:20: unused_alias_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure: Not detected +./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:20: unused_alias_fun +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure + ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected @@ -80,35 +94,38 @@ ./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected -./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:20: unused_alias_fun: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:25: unused_closure: Not detected +./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:20: unused_alias_fun +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:25: unused_closure + ./examples/using_make/advanced/inc_val.mli:1: x ./examples/using_make/advanced/inc_val.mli:2: y ./examples/using_make/advanced/val.mli:1: x: Should not be detected ./examples/using_make/advanced/val.mli:2: y: Should not be detected -./examples/using_make/bar.ml:1: x: Not detected -./examples/using_make/bar_fn.ml:3: h: Not detected +./examples/using_make/bar.ml:1: x +./examples/using_make/bar_fn.ml:3: h ./examples/using_make/baz.mli:1: z ./examples/using_make/baz.mli:3: u -./examples/using_make/cond_sel.ml:13: h: Not detected -./examples/using_make/dir/alias_opt.ml:7: y: Not detected -./examples/using_make/dir/alias_opt.ml:14: x: Not detected -./examples/using_make/dir/anon_call.ml:1: f: Not detected -./examples/using_make/dir/anon_call.ml:5: g: Not detected -./examples/using_make/dir/anon_call.ml:9: h: Not detected -./examples/using_make/dir/anon_call2.ml:1: f: Not detected -./examples/using_make/dir/anon_call2.ml:5: g: Not detected -./examples/using_make/dir/anon_call2.ml:9: h: Not detected -./examples/using_make/dir/match_opt.ml:8: l: Not detected -./examples/using_make/dir/matchopt.ml:5: w: Not detected +./examples/using_make/cond_sel.ml:13: h + +./examples/using_make/dir/alias_opt.ml:7: y +./examples/using_make/dir/alias_opt.ml:14: x +./examples/using_make/dir/anon_call.ml:1: f +./examples/using_make/dir/anon_call.ml:5: g +./examples/using_make/dir/anon_call.ml:9: h +./examples/using_make/dir/anon_call2.ml:1: f +./examples/using_make/dir/anon_call2.ml:5: g +./examples/using_make/dir/anon_call2.ml:9: h +./examples/using_make/dir/match_opt.ml:8: l +./examples/using_make/dir/matchopt.ml:5: w ./examples/using_make/dir/mod.mli:10: M.f: Should not be detected ./examples/using_make/dir/mod.mli:11: M.g ./examples/using_make/dir/refFn.mli:3: x -./examples/using_make/dir/ref_opt.ml:3: no: Not detected -./examples/using_make/dir/ref_opt.ml:11: x: Not detected +./examples/using_make/dir/ref_opt.ml:3: no +./examples/using_make/dir/ref_opt.ml:11: x + ./examples/using_make/exported.mli:6: M1.five: Should not be detected ./examples/using_make/exported.mli:10: F.plus_five: Should not be detected ./examples/using_make/exported.mli:11: F.times_five @@ -121,20 +138,20 @@ ./examples/using_make/functor.mli:3: M.none ./examples/using_make/functor.mli:7: F.g: Should not be detected ./examples/using_make/functor.mli:11: N.g: Should not be detected -./examples/using_make/let_in.ml:3: parent: Not detected -./examples/using_make/let_test.ml:3: g: Not detected -./examples/using_make/matchopt.ml:5: w: Not detected +./examples/using_make/let_in.ml:3: parent +./examples/using_make/let_test.ml:3: g +./examples/using_make/matchopt.ml:5: w ./examples/using_make/mod_alias.mli:2: M1.id: Should not be detected ./examples/using_make/mod_alias.mli:6: M2.id: Should not be detected ./examples/using_make/obj/class.mli:7: o: Should not be detected ./examples/using_make/obj/class.mli:9: f: Should not be detected ./examples/using_make/obj/inher.mli:11: o: Should not be detected ./examples/using_make/obj/inher.mli:13: f: Should not be detected -./examples/using_make/opt_in_opt.ml:7: x: Not detected -./examples/using_make/qux.ml:1: z: Not detected -./examples/using_make/unused_fn.ml:3: g: Not detected -./examples/using_make/unused_fn.ml:5: var: Not detected -./examples/using_make/useless_opt.ml:3: x: Not detected +./examples/using_make/opt_in_opt.ml:7: x +./examples/using_make/qux.ml:1: z +./examples/using_make/unused_fn.ml:3: g +./examples/using_make/unused_fn.ml:5: var +./examples/using_make/useless_opt.ml:3: x ./examples/using_make/variant.mli:5: f: Should not be detected -------- @@ -153,11 +170,12 @@ ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:20: External_param.unused_required ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:24: Internal_app.externally_used ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used: Not detected -./examples/docs/exported_values/code_constructs/include/include_lib.ml:3: Original.used_directly: Not detected -./examples/docs/exported_values/code_constructs/include/include_lib.ml:4: Original.used_indirectly: Not detected -./examples/docs/exported_values/code_constructs/include/include_lib.ml:14: Redefine.used_directly: Not detected -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:3: Original.used_directly: Not detected -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:4: Original.used_indirectly: Not detected +./examples/docs/exported_values/code_constructs/include/include_lib.ml:3: Original.used_directly +./examples/docs/exported_values/code_constructs/include/include_lib.ml:4: Original.used_indirectly +./examples/docs/exported_values/code_constructs/include/include_lib.ml:14: Redefine.used_directly + +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:3: Original.used_directly +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:4: Original.used_indirectly ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Not detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:17: M_redef.externally_used ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used: Not detected @@ -167,8 +185,9 @@ ./examples/docs/exported_values/hello_world/hello_world_lib.mli:3: goodbye ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello: Not detected ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye: Not detected -./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:2: hello: Not detected -./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:3: goodbye: Not detected +./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:2: hello +./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:3: goodbye + ./examples/using_dune/bin/use_preprocessed_lib/use_preprocessed.mli:1: mark_used ./examples/using_dune/bin/use_preprocessed_lib/use_preprocessed_lib.mli:1: mark_used ./examples/using_dune/bin/use_preprocessed_lib/use_preprocessed_no_intf.mli:1: mark_used @@ -215,8 +234,9 @@ ./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:4: externally_used ./examples/using_dune/preprocessed_lib/preprocessed.mli:31: exported_f: Should not be detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:4: internally_used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:5: externally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:4: internally_used +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:5: externally_used + ./examples/using_dune/reduced_lib/reduced_lib.mli:2: Values.used ./examples/using_dune/reduced_lib/reduced_lib.mli:5: Values.externally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:9: Values_no_intf.used @@ -235,14 +255,19 @@ ./examples/using_dune/reduced_lib/values_in_submodules.mli:7: Exported.lib_internal_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used: Not detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:10: Exported.lib_internal_externally_used +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:2: Exported.used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Not detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:4: Exported.internally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Not detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:9: Exported.lib_internal_internally_used: Not detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:10: Exported.lib_internal_externally_used: Not detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:9: Exported.lib_internal_internally_used +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:10: Exported.lib_internal_externally_used +./examples/using_dune/reduced_lib/values_no_intf.ml:1: used: Should not be detected ./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Not detected +./examples/using_dune/reduced_lib/values_no_intf.ml:3: internally_used: Should not be detected ./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Not detected -./examples/using_dune/reduced_lib/values_no_intf.ml:12: lib_internal_internally_used: Not detected -./examples/using_dune/reduced_lib/values_no_intf.ml:13: lib_internal_externally_used: Not detected +./examples/using_dune/reduced_lib/values_no_intf.ml:12: lib_internal_internally_used +./examples/using_dune/reduced_lib/values_no_intf.ml:13: lib_internal_externally_used + ./examples/using_dune/unwrapped_lib/obj/with_class.mli:33: fun_class_factory: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg: Should not be detected @@ -261,7 +286,8 @@ ./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig: Should not be detected -./examples/using_dune/unwrapped_lib/style/style.ml:1: all: Not detected +./examples/using_dune/unwrapped_lib/style/style.ml:1: all + ./examples/using_dune/unwrapped_lib/values/values.mli:1: used_int: Should not be detected ./examples/using_dune/unwrapped_lib/values/values.mli:3: internally_used_int: Not detected ./examples/using_dune/unwrapped_lib/values/values.mli:4: externally_used_int @@ -283,21 +309,22 @@ ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Not detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:5: Exported.externally_used_int -./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:3: internally_used_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:4: externally_used_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:5: externally_used_as_parameter_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:7: externally_written_bool_ref: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:8: externally_matched_option: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:10: externally_stored_in_ref_bool: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:11: externally_stored_in_option_bool: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:15: internally_used_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:16: externally_used_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:17: externally_used_as_parameter_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:22: externally_used_alias_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:27: internally_used_closure: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:28: externally_used_closure: Not detected +./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int +./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:3: internally_used_int +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:4: externally_used_int +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:5: externally_used_as_parameter_int +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:7: externally_written_bool_ref +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:8: externally_matched_option +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:10: externally_stored_in_ref_bool +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:11: externally_stored_in_option_bool +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:15: internally_used_fun +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:16: externally_used_fun +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:17: externally_used_as_parameter_fun +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:22: externally_used_alias_fun +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:27: internally_used_closure +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:28: externally_used_closure + ./examples/using_dune/wrapped_lib/obj/with_class.mli:33: fun_class_factory: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg: Should not be detected @@ -316,7 +343,8 @@ ./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig: Should not be detected -./examples/using_dune/wrapped_lib/style/style.ml:1: all: Not detected +./examples/using_dune/wrapped_lib/style/style.ml:1: all + ./examples/using_dune/wrapped_lib/values/values.mli:1: used_int: Should not be detected ./examples/using_dune/wrapped_lib/values/values.mli:3: internally_used_int: Not detected ./examples/using_dune/wrapped_lib/values/values.mli:4: externally_used_int @@ -338,65 +366,69 @@ ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Should not be detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Not detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:5: Exported.externally_used_int -./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int: Not detected -./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:3: internally_used_int: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:4: externally_used_int: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:5: externally_used_as_parameter_int: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:7: externally_written_bool_ref: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:8: externally_matched_option: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:10: externally_stored_in_ref_bool: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:11: externally_stored_in_option_bool: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:15: internally_used_fun: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:16: externally_used_fun: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:17: externally_used_as_parameter_fun: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:22: externally_used_alias_fun: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:27: internally_used_closure: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:28: externally_used_closure: Not detected -./examples/using_make/advanced/incl.ml:7: f: Not detected +./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int +./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:3: internally_used_int +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:4: externally_used_int +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:5: externally_used_as_parameter_int +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:7: externally_written_bool_ref +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:8: externally_matched_option +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:10: externally_stored_in_ref_bool +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:11: externally_stored_in_option_bool +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:15: internally_used_fun +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:16: externally_used_fun +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:17: externally_used_as_parameter_fun +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:22: externally_used_alias_fun +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:27: internally_used_closure +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:28: externally_used_closure + +./examples/using_make/advanced/incl.ml:7: f ./examples/using_make/advanced/mod.mli:1: f ./examples/using_make/advanced/mod.mli:2: x ./examples/using_make/advanced/val.mli:1: x: Not detected ./examples/using_make/advanced/val.mli:2: y: Not detected ./examples/using_make/baz.mli:2: t -./examples/using_make/cond_sel.ml:9: f: Not detected -./examples/using_make/cond_sel.ml:11: g: Not detected -./examples/using_make/dir/alias_opt.ml:4: baz: Not detected -./examples/using_make/dir/alias_opt.ml:11: foo: Not detected -./examples/using_make/dir/alias_opt.ml:12: bar: Not detected -./examples/using_make/dir/fn_arg.ml:1: f: Not detected -./examples/using_make/dir/fn_arg.ml:3: g: Not detected -./examples/using_make/dir/fn_arg.ml:9: i: Not detected -./examples/using_make/dir/fn_arg.ml:11: j: Not detected -./examples/using_make/dir/hidden_opt_use.ml:1: f: Not detected -./examples/using_make/dir/hidden_opt_use.ml:3: apply: Not detected -./examples/using_make/dir/match_opt.ml:3: m: Not detected +./examples/using_make/cond_sel.ml:9: f +./examples/using_make/cond_sel.ml:11: g + +./examples/using_make/dir/alias_opt.ml:4: baz +./examples/using_make/dir/alias_opt.ml:11: foo +./examples/using_make/dir/alias_opt.ml:12: bar +./examples/using_make/dir/fn_arg.ml:1: f +./examples/using_make/dir/fn_arg.ml:3: g +./examples/using_make/dir/fn_arg.ml:9: i +./examples/using_make/dir/fn_arg.ml:11: j +./examples/using_make/dir/hidden_opt_use.ml:1: f +./examples/using_make/dir/hidden_opt_use.ml:3: apply +./examples/using_make/dir/match_opt.ml:3: m ./examples/using_make/dir/mod.mli:10: M.f: Not detected -./examples/using_make/dir/partial.ml:5: g: Not detected -./examples/using_make/dir/ref_fn.ml:5: g: Not detected -./examples/using_make/dir/ref_opt.ml:7: g: Not detected +./examples/using_make/dir/partial.ml:5: g +./examples/using_make/dir/ref_fn.ml:5: g +./examples/using_make/dir/ref_opt.ml:7: g + ./examples/using_make/foo.mli:1: x ./examples/using_make/fooFn.mli:1: f ./examples/using_make/functor.mli:2: M.f: Not detected -./examples/using_make/if_end.ml:1: f: Not detected -./examples/using_make/if_end.ml:3: g: Not detected -./examples/using_make/if_end.ml:5: h: Not detected +./examples/using_make/if_end.ml:1: f +./examples/using_make/if_end.ml:3: g +./examples/using_make/if_end.ml:5: h ./examples/using_make/letIn.mli:1: f ./examples/using_make/mod_alias.mli:2: M1.id: Not detected ./examples/using_make/mod_alias.mli:6: M2.id: Not detected ./examples/using_make/obj/class.mli:9: f: Not detected -./examples/using_make/obj/fun_class.ml:8: f: Not detected -./examples/using_make/obj/fun_obj_param.ml:7: app_m: Not detected +./examples/using_make/obj/fun_class.ml:8: f +./examples/using_make/obj/fun_obj_param.ml:7: app_m ./examples/using_make/obj/inher.mli:13: f: Not detected -./examples/using_make/obj/obj_inher.ml:7: o: Not detected -./examples/using_make/obj/obj_inher.ml:12: o4: Not detected -./examples/using_make/obj/obj_inher.ml:17: o2: Not detected -./examples/using_make/obj/obj_inher.ml:19: o3: Not detected -./examples/using_make/obj/obj_inher.ml:24: f: Not detected -./examples/using_make/obj/object.ml:7: f: Not detected -./examples/using_make/opt_in_opt.ml:5: baz: Not detected -./examples/using_make/partial_opt.ml:1: f: Not detected -./examples/using_make/useless_opt.ml:1: foo: Not detected +./examples/using_make/obj/obj_inher.ml:7: o +./examples/using_make/obj/obj_inher.ml:12: o4 +./examples/using_make/obj/obj_inher.ml:17: o2 +./examples/using_make/obj/obj_inher.ml:19: o3 +./examples/using_make/obj/obj_inher.ml:24: f +./examples/using_make/obj/object.ml:7: f + +./examples/using_make/opt_in_opt.ml:5: baz +./examples/using_make/partial_opt.ml:1: f +./examples/using_make/useless_opt.ml:1: foo ./examples/using_make/variant.mli:5: f: Not detected Nothing else to report in this section -------------------------------------------------------------------------------- @@ -405,7 +437,8 @@ Nothing else to report in this section .> UNUSED METHODS: ================= ./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused + ./examples/using_dune/unwrapped_lib/obj/with_class.mli:1: unused#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#never_used_fun ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#never_used_int @@ -436,23 +469,22 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected -./examples/using_make/advanced/mod.mli:4: p#f: Should not be detected ./examples/using_make/obj/class.mli:1: c#h ./examples/using_make/obj/class_type.mli:9: c#h ./examples/using_make/obj/coerce.mli:6: p#f ./examples/using_make/obj/coerce.mli:6: p#h -./examples/using_make/obj/constraint.ml:1: p#g: Not detected +./examples/using_make/obj/constraint.ml:1: p#g ./examples/using_make/obj/fooCl.mli:1: p1#g ./examples/using_make/obj/fooCl.mli:1: p1#h ./examples/using_make/obj/fooCl.mli:7: p2#h -./examples/using_make/obj/fun_class.ml:1: c#m3: Not detected -./examples/using_make/obj/fun_obj_param.ml:1: f#n: Not detected +./examples/using_make/obj/fun_class.ml:1: c#m3 +./examples/using_make/obj/fun_obj_param.ml:1: f#n ./examples/using_make/obj/inher.mli:1: p#h ./examples/using_make/obj/named.mli:10: c#g -./examples/using_make/obj/obj_inher.ml:1: c#g: Not detected -./examples/using_make/obj/obj_inher.ml:1: c#h: Not detected -./examples/using_make/obj/obj_inher.ml:19: o3#k: Not detected -./examples/using_make/obj/object.ml:1: o#h: Not detected +./examples/using_make/obj/obj_inher.ml:1: c#g +./examples/using_make/obj/obj_inher.ml:1: c#h +./examples/using_make/obj/obj_inher.ml:19: o3#k +./examples/using_make/obj/object.ml:1: o#h ./examples/using_make/obj/overr.mli:1: p1#g ./examples/using_make/obj/overr.mli:1: p1#h ./examples/using_make/obj/overr.mli:7: p2#g @@ -464,8 +496,9 @@ Nothing else to report in this section ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#externally_used: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#internally_used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#externally_used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#internally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#externally_used +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#internally_used + ./examples/using_dune/unwrapped_lib/obj/with_class.mli:35: _self_used#used ./examples/using_dune/unwrapped_lib/obj/with_class.mli:41: _self_used_fun_class#used ./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#externally_used_fun: Not detected @@ -495,28 +528,29 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_fun: Not detected ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_int: Not detected ./examples/using_make/advanced/func.mli:3: M.c#f -./examples/using_make/advanced/mod.mli:4: p#f: Not detected +./examples/using_make/advanced/mod.mli:4: p#f + ./examples/using_make/obj/class.mli:1: c#f ./examples/using_make/obj/class.mli:1: c#g ./examples/using_make/obj/class_type.mli:7: p#f ./examples/using_make/obj/class_type.mli:7: p#h ./examples/using_make/obj/coerce.mli:8: c#h -./examples/using_make/obj/constraint.ml:1: p#f: Not detected -./examples/using_make/obj/depend.ml:8: M.c#f: Not detected +./examples/using_make/obj/constraint.ml:1: p#f +./examples/using_make/obj/depend.ml:8: M.c#f ./examples/using_make/obj/fooCl.mli:1: p1#f ./examples/using_make/obj/fooCl.mli:7: p2#g -./examples/using_make/obj/fun_class.ml:1: c#m1: Not detected -./examples/using_make/obj/fun_class.ml:1: c#m2: Not detected -./examples/using_make/obj/fun_class.ml:1: c#m4: Not detected -./examples/using_make/obj/fun_obj_param.ml:1: f#m: Not detected -./examples/using_make/obj/fun_obj_param.ml:1: f#x: Not detected +./examples/using_make/obj/fun_class.ml:1: c#m1 +./examples/using_make/obj/fun_class.ml:1: c#m2 +./examples/using_make/obj/fun_class.ml:1: c#m4 +./examples/using_make/obj/fun_obj_param.ml:1: f#m +./examples/using_make/obj/fun_obj_param.ml:1: f#x ./examples/using_make/obj/inher.mli:1: p#f ./examples/using_make/obj/inher.mli:1: p#g ./examples/using_make/obj/named.mli:1: p1#g ./examples/using_make/obj/named.mli:6: p2#f ./examples/using_make/obj/named.mli:10: c#f -./examples/using_make/obj/object.ml:1: o#f: Not detected -./examples/using_make/obj/object.ml:1: o#g: Not detected +./examples/using_make/obj/object.ml:1: o#f +./examples/using_make/obj/object.ml:1: o#g ./examples/using_make/obj/overr.mli:1: p1#f ./examples/using_make/obj/overr.mli:12: c#g @@ -529,9 +563,10 @@ Nothing else to report in this section ./examples/using_dune/preprocessed_lib/preprocessed.mli:14: constructors.Unused ./examples/using_dune/preprocessed_lib/preprocessed.mli:19: constr_with_eq.Unused ./examples/using_dune/preprocessed_lib/preprocessed.mli:23: record.unused -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:25: constructors.Unused: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:30: constr_with_eq.Unused: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:39: record.unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:25: constructors.Unused +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:30: constr_with_eq.Unused +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:39: record.unused + ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:1: unused_single_no_param.Unused_single_no_param ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:2: unused_single_unit.Unused_single_unit ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:3: unused_single_param.Unused_single_param @@ -602,11 +637,12 @@ Nothing else to report in this section ./examples/using_dune/preprocessed_lib/preprocessed.mli:25: record.internally_used ./examples/using_dune/preprocessed_lib/preprocessed.mli:26: record.externally_used ./examples/using_dune/preprocessed_lib/preprocessed.mli:29: record_with_eq.implicitly_used -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:27: constructors.Internally_used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:28: constructors.Externally_used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:41: record.internally_used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:42: record.externally_used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:45: record_with_eq.implicitly_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:27: constructors.Internally_used +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:28: constructors.Externally_used +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:41: record.internally_used +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:42: record.externally_used +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:45: record_with_eq.implicitly_used + ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:25: internally_used_single_no_param.Internally_used_single_no_param ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:26: internally_used_single_unit.Internally_used_single_unit ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:27: internally_used_single_param.Internally_used_single_param @@ -1011,7 +1047,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 921 -Success: 593 -Failed: 328 -Ratio: 64.3865363735% +Total: 933 +Success: 736 +Failed: 197 +Ratio: 78.8853161844% diff --git a/check/threshold-3-0.5/threshold-3-0.5.ref b/check/threshold-3-0.5/threshold-3-0.5.ref index 01f42920..9c55984a 100644 --- a/check/threshold-3-0.5/threshold-3-0.5.ref +++ b/check/threshold-3-0.5/threshold-3-0.5.ref @@ -9,10 +9,13 @@ ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:26: Internal_app.unused -./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused: Not detected -./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused: Not detected -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused: Not detected -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement: Not detected +./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused +./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused + +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Should not be detected +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement + ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:19: M_redef.unused @@ -22,11 +25,16 @@ ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello: Should not be detected ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye: Should not be detected ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:4: world: Should not be detected +./examples/docs/exported_values/limitations/incl_same_name/oo.mli:20: copy: Should not be detected +./examples/docs/exported_values/limitations/incl_same_name/oo.mli:25: id: Should not be detected +./examples/docs/exported_values/limitations/incl_same_name/oo.mli:40: new_method: Should not be detected +./examples/docs/exported_values/limitations/incl_same_name/oo.mli:41: public_method_label: Should not be detected ./examples/docs/exported_values/limitations/sigincl/sigincl_lib.mli:10: I.x: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:1: unused ./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:38: internally_used_f: Should not be detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused + ./examples/using_dune/reduced_lib/reduced_lib.mli:3: Values.used_by_API ./examples/using_dune/reduced_lib/reduced_lib.mli:4: Values.internally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:10: Values_no_intf.used_by_API @@ -47,8 +55,13 @@ ./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:8: Exported.lib_internal_unused ./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused: Not detected -./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_unused: Not detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused +./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Should not be detected +./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_unused + ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected @@ -62,11 +75,12 @@ ./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected -./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:20: unused_alias_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure: Not detected +./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:20: unused_alias_fun +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure + ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected @@ -80,35 +94,38 @@ ./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected -./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:20: unused_alias_fun: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:25: unused_closure: Not detected +./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:20: unused_alias_fun +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:25: unused_closure + ./examples/using_make/advanced/inc_val.mli:1: x ./examples/using_make/advanced/inc_val.mli:2: y ./examples/using_make/advanced/val.mli:1: x: Should not be detected ./examples/using_make/advanced/val.mli:2: y: Should not be detected -./examples/using_make/bar.ml:1: x: Not detected -./examples/using_make/bar_fn.ml:3: h: Not detected +./examples/using_make/bar.ml:1: x +./examples/using_make/bar_fn.ml:3: h ./examples/using_make/baz.mli:1: z ./examples/using_make/baz.mli:3: u -./examples/using_make/cond_sel.ml:13: h: Not detected -./examples/using_make/dir/alias_opt.ml:7: y: Not detected -./examples/using_make/dir/alias_opt.ml:14: x: Not detected -./examples/using_make/dir/anon_call.ml:1: f: Not detected -./examples/using_make/dir/anon_call.ml:5: g: Not detected -./examples/using_make/dir/anon_call.ml:9: h: Not detected -./examples/using_make/dir/anon_call2.ml:1: f: Not detected -./examples/using_make/dir/anon_call2.ml:5: g: Not detected -./examples/using_make/dir/anon_call2.ml:9: h: Not detected -./examples/using_make/dir/match_opt.ml:8: l: Not detected -./examples/using_make/dir/matchopt.ml:5: w: Not detected +./examples/using_make/cond_sel.ml:13: h + +./examples/using_make/dir/alias_opt.ml:7: y +./examples/using_make/dir/alias_opt.ml:14: x +./examples/using_make/dir/anon_call.ml:1: f +./examples/using_make/dir/anon_call.ml:5: g +./examples/using_make/dir/anon_call.ml:9: h +./examples/using_make/dir/anon_call2.ml:1: f +./examples/using_make/dir/anon_call2.ml:5: g +./examples/using_make/dir/anon_call2.ml:9: h +./examples/using_make/dir/match_opt.ml:8: l +./examples/using_make/dir/matchopt.ml:5: w ./examples/using_make/dir/mod.mli:10: M.f: Should not be detected ./examples/using_make/dir/mod.mli:11: M.g ./examples/using_make/dir/refFn.mli:3: x -./examples/using_make/dir/ref_opt.ml:3: no: Not detected -./examples/using_make/dir/ref_opt.ml:11: x: Not detected +./examples/using_make/dir/ref_opt.ml:3: no +./examples/using_make/dir/ref_opt.ml:11: x + ./examples/using_make/exported.mli:6: M1.five: Should not be detected ./examples/using_make/exported.mli:10: F.plus_five: Should not be detected ./examples/using_make/exported.mli:11: F.times_five @@ -121,20 +138,20 @@ ./examples/using_make/functor.mli:3: M.none ./examples/using_make/functor.mli:7: F.g: Should not be detected ./examples/using_make/functor.mli:11: N.g: Should not be detected -./examples/using_make/let_in.ml:3: parent: Not detected -./examples/using_make/let_test.ml:3: g: Not detected -./examples/using_make/matchopt.ml:5: w: Not detected +./examples/using_make/let_in.ml:3: parent +./examples/using_make/let_test.ml:3: g +./examples/using_make/matchopt.ml:5: w ./examples/using_make/mod_alias.mli:2: M1.id: Should not be detected ./examples/using_make/mod_alias.mli:6: M2.id: Should not be detected ./examples/using_make/obj/class.mli:7: o: Should not be detected ./examples/using_make/obj/class.mli:9: f: Should not be detected ./examples/using_make/obj/inher.mli:11: o: Should not be detected ./examples/using_make/obj/inher.mli:13: f: Should not be detected -./examples/using_make/opt_in_opt.ml:7: x: Not detected -./examples/using_make/qux.ml:1: z: Not detected -./examples/using_make/unused_fn.ml:3: g: Not detected -./examples/using_make/unused_fn.ml:5: var: Not detected -./examples/using_make/useless_opt.ml:3: x: Not detected +./examples/using_make/opt_in_opt.ml:7: x +./examples/using_make/qux.ml:1: z +./examples/using_make/unused_fn.ml:3: g +./examples/using_make/unused_fn.ml:5: var +./examples/using_make/useless_opt.ml:3: x ./examples/using_make/variant.mli:5: f: Should not be detected -------- @@ -153,11 +170,12 @@ ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:20: External_param.unused_required ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:24: Internal_app.externally_used ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used: Not detected -./examples/docs/exported_values/code_constructs/include/include_lib.ml:3: Original.used_directly: Not detected -./examples/docs/exported_values/code_constructs/include/include_lib.ml:4: Original.used_indirectly: Not detected -./examples/docs/exported_values/code_constructs/include/include_lib.ml:14: Redefine.used_directly: Not detected -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:3: Original.used_directly: Not detected -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:4: Original.used_indirectly: Not detected +./examples/docs/exported_values/code_constructs/include/include_lib.ml:3: Original.used_directly +./examples/docs/exported_values/code_constructs/include/include_lib.ml:4: Original.used_indirectly +./examples/docs/exported_values/code_constructs/include/include_lib.ml:14: Redefine.used_directly + +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:3: Original.used_directly +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:4: Original.used_indirectly ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Not detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:17: M_redef.externally_used ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used: Not detected @@ -167,8 +185,9 @@ ./examples/docs/exported_values/hello_world/hello_world_lib.mli:3: goodbye ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello: Not detected ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye: Not detected -./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:2: hello: Not detected -./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:3: goodbye: Not detected +./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:2: hello +./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:3: goodbye + ./examples/using_dune/bin/use_preprocessed_lib/use_preprocessed.mli:1: mark_used ./examples/using_dune/bin/use_preprocessed_lib/use_preprocessed_lib.mli:1: mark_used ./examples/using_dune/bin/use_preprocessed_lib/use_preprocessed_no_intf.mli:1: mark_used @@ -215,8 +234,9 @@ ./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:4: externally_used ./examples/using_dune/preprocessed_lib/preprocessed.mli:31: exported_f: Should not be detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:4: internally_used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:5: externally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:4: internally_used +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:5: externally_used + ./examples/using_dune/reduced_lib/reduced_lib.mli:2: Values.used ./examples/using_dune/reduced_lib/reduced_lib.mli:5: Values.externally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:9: Values_no_intf.used @@ -235,14 +255,19 @@ ./examples/using_dune/reduced_lib/values_in_submodules.mli:7: Exported.lib_internal_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used: Not detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:10: Exported.lib_internal_externally_used +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:2: Exported.used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Not detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:4: Exported.internally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Not detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:9: Exported.lib_internal_internally_used: Not detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:10: Exported.lib_internal_externally_used: Not detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:9: Exported.lib_internal_internally_used +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:10: Exported.lib_internal_externally_used +./examples/using_dune/reduced_lib/values_no_intf.ml:1: used: Should not be detected ./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Not detected +./examples/using_dune/reduced_lib/values_no_intf.ml:3: internally_used: Should not be detected ./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Not detected -./examples/using_dune/reduced_lib/values_no_intf.ml:12: lib_internal_internally_used: Not detected -./examples/using_dune/reduced_lib/values_no_intf.ml:13: lib_internal_externally_used: Not detected +./examples/using_dune/reduced_lib/values_no_intf.ml:12: lib_internal_internally_used +./examples/using_dune/reduced_lib/values_no_intf.ml:13: lib_internal_externally_used + ./examples/using_dune/unwrapped_lib/obj/with_class.mli:33: fun_class_factory: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg: Should not be detected @@ -261,7 +286,8 @@ ./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig: Should not be detected -./examples/using_dune/unwrapped_lib/style/style.ml:1: all: Not detected +./examples/using_dune/unwrapped_lib/style/style.ml:1: all + ./examples/using_dune/unwrapped_lib/values/values.mli:1: used_int: Should not be detected ./examples/using_dune/unwrapped_lib/values/values.mli:3: internally_used_int: Not detected ./examples/using_dune/unwrapped_lib/values/values.mli:4: externally_used_int @@ -283,21 +309,22 @@ ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Not detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:5: Exported.externally_used_int -./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:3: internally_used_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:4: externally_used_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:5: externally_used_as_parameter_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:7: externally_written_bool_ref: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:8: externally_matched_option: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:10: externally_stored_in_ref_bool: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:11: externally_stored_in_option_bool: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:15: internally_used_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:16: externally_used_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:17: externally_used_as_parameter_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:22: externally_used_alias_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:27: internally_used_closure: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:28: externally_used_closure: Not detected +./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int +./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:3: internally_used_int +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:4: externally_used_int +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:5: externally_used_as_parameter_int +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:7: externally_written_bool_ref +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:8: externally_matched_option +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:10: externally_stored_in_ref_bool +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:11: externally_stored_in_option_bool +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:15: internally_used_fun +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:16: externally_used_fun +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:17: externally_used_as_parameter_fun +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:22: externally_used_alias_fun +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:27: internally_used_closure +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:28: externally_used_closure + ./examples/using_dune/wrapped_lib/obj/with_class.mli:33: fun_class_factory: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg: Should not be detected @@ -316,7 +343,8 @@ ./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig: Should not be detected -./examples/using_dune/wrapped_lib/style/style.ml:1: all: Not detected +./examples/using_dune/wrapped_lib/style/style.ml:1: all + ./examples/using_dune/wrapped_lib/values/values.mli:1: used_int: Should not be detected ./examples/using_dune/wrapped_lib/values/values.mli:3: internally_used_int: Not detected ./examples/using_dune/wrapped_lib/values/values.mli:4: externally_used_int @@ -338,65 +366,69 @@ ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Should not be detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Not detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:5: Exported.externally_used_int -./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int: Not detected -./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:3: internally_used_int: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:4: externally_used_int: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:5: externally_used_as_parameter_int: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:7: externally_written_bool_ref: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:8: externally_matched_option: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:10: externally_stored_in_ref_bool: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:11: externally_stored_in_option_bool: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:15: internally_used_fun: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:16: externally_used_fun: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:17: externally_used_as_parameter_fun: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:22: externally_used_alias_fun: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:27: internally_used_closure: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:28: externally_used_closure: Not detected -./examples/using_make/advanced/incl.ml:7: f: Not detected +./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int +./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:3: internally_used_int +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:4: externally_used_int +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:5: externally_used_as_parameter_int +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:7: externally_written_bool_ref +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:8: externally_matched_option +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:10: externally_stored_in_ref_bool +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:11: externally_stored_in_option_bool +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:15: internally_used_fun +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:16: externally_used_fun +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:17: externally_used_as_parameter_fun +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:22: externally_used_alias_fun +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:27: internally_used_closure +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:28: externally_used_closure + +./examples/using_make/advanced/incl.ml:7: f ./examples/using_make/advanced/mod.mli:1: f ./examples/using_make/advanced/mod.mli:2: x ./examples/using_make/advanced/val.mli:1: x: Not detected ./examples/using_make/advanced/val.mli:2: y: Not detected ./examples/using_make/baz.mli:2: t -./examples/using_make/cond_sel.ml:9: f: Not detected -./examples/using_make/cond_sel.ml:11: g: Not detected -./examples/using_make/dir/alias_opt.ml:4: baz: Not detected -./examples/using_make/dir/alias_opt.ml:11: foo: Not detected -./examples/using_make/dir/alias_opt.ml:12: bar: Not detected -./examples/using_make/dir/fn_arg.ml:1: f: Not detected -./examples/using_make/dir/fn_arg.ml:3: g: Not detected -./examples/using_make/dir/fn_arg.ml:9: i: Not detected -./examples/using_make/dir/fn_arg.ml:11: j: Not detected -./examples/using_make/dir/hidden_opt_use.ml:1: f: Not detected -./examples/using_make/dir/hidden_opt_use.ml:3: apply: Not detected -./examples/using_make/dir/match_opt.ml:3: m: Not detected +./examples/using_make/cond_sel.ml:9: f +./examples/using_make/cond_sel.ml:11: g + +./examples/using_make/dir/alias_opt.ml:4: baz +./examples/using_make/dir/alias_opt.ml:11: foo +./examples/using_make/dir/alias_opt.ml:12: bar +./examples/using_make/dir/fn_arg.ml:1: f +./examples/using_make/dir/fn_arg.ml:3: g +./examples/using_make/dir/fn_arg.ml:9: i +./examples/using_make/dir/fn_arg.ml:11: j +./examples/using_make/dir/hidden_opt_use.ml:1: f +./examples/using_make/dir/hidden_opt_use.ml:3: apply +./examples/using_make/dir/match_opt.ml:3: m ./examples/using_make/dir/mod.mli:10: M.f: Not detected -./examples/using_make/dir/partial.ml:5: g: Not detected -./examples/using_make/dir/ref_fn.ml:5: g: Not detected -./examples/using_make/dir/ref_opt.ml:7: g: Not detected +./examples/using_make/dir/partial.ml:5: g +./examples/using_make/dir/ref_fn.ml:5: g +./examples/using_make/dir/ref_opt.ml:7: g + ./examples/using_make/foo.mli:1: x ./examples/using_make/fooFn.mli:1: f ./examples/using_make/functor.mli:2: M.f: Not detected -./examples/using_make/if_end.ml:1: f: Not detected -./examples/using_make/if_end.ml:3: g: Not detected -./examples/using_make/if_end.ml:5: h: Not detected +./examples/using_make/if_end.ml:1: f +./examples/using_make/if_end.ml:3: g +./examples/using_make/if_end.ml:5: h ./examples/using_make/letIn.mli:1: f ./examples/using_make/mod_alias.mli:2: M1.id: Not detected ./examples/using_make/mod_alias.mli:6: M2.id: Not detected ./examples/using_make/obj/class.mli:9: f: Not detected -./examples/using_make/obj/fun_class.ml:8: f: Not detected -./examples/using_make/obj/fun_obj_param.ml:7: app_m: Not detected +./examples/using_make/obj/fun_class.ml:8: f +./examples/using_make/obj/fun_obj_param.ml:7: app_m ./examples/using_make/obj/inher.mli:13: f: Not detected -./examples/using_make/obj/obj_inher.ml:7: o: Not detected -./examples/using_make/obj/obj_inher.ml:12: o4: Not detected -./examples/using_make/obj/obj_inher.ml:17: o2: Not detected -./examples/using_make/obj/obj_inher.ml:19: o3: Not detected -./examples/using_make/obj/obj_inher.ml:24: f: Not detected -./examples/using_make/obj/object.ml:7: f: Not detected -./examples/using_make/opt_in_opt.ml:5: baz: Not detected -./examples/using_make/partial_opt.ml:1: f: Not detected -./examples/using_make/useless_opt.ml:1: foo: Not detected +./examples/using_make/obj/obj_inher.ml:7: o +./examples/using_make/obj/obj_inher.ml:12: o4 +./examples/using_make/obj/obj_inher.ml:17: o2 +./examples/using_make/obj/obj_inher.ml:19: o3 +./examples/using_make/obj/obj_inher.ml:24: f +./examples/using_make/obj/object.ml:7: f + +./examples/using_make/opt_in_opt.ml:5: baz +./examples/using_make/partial_opt.ml:1: f +./examples/using_make/useless_opt.ml:1: foo ./examples/using_make/variant.mli:5: f: Not detected -------- @@ -405,16 +437,18 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./examples/docs/exported_values/hello_world/hello_world_lib.mli:4: world ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:4: world: Not detected -./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:4: world: Not detected +./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:4: world + ./examples/using_dune/preprocessed_lib/preprocessed.mli:2: used: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:31: exported_f: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:38: internally_used_f: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:44: externally_used_f -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:3: used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:53: f: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:59: internally_used_f: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:64: externally_used_f: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:3: used +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:53: f +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:59: internally_used_f +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:64: externally_used_f + ./examples/using_dune/reduced_lib/values.mli:1: used: Not detected ./examples/using_dune/reduced_lib/values.mli:3: internally_used: Not detected ./examples/using_dune/reduced_lib/values.mli:6: lib_internal_used: Not detected @@ -423,10 +457,11 @@ ./examples/using_dune/reduced_lib/values_in_submodules.mli:7: Exported.lib_internal_used: Not detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:2: Exported.used: Not detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:4: Exported.internally_used: Not detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:7: Exported.lib_internal_used: Not detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:7: Exported.lib_internal_used ./examples/using_dune/reduced_lib/values_no_intf.ml:1: used: Not detected ./examples/using_dune/reduced_lib/values_no_intf.ml:3: internally_used: Not detected -./examples/using_dune/reduced_lib/values_no_intf.ml:10: lib_internal_used: Not detected +./examples/using_dune/reduced_lib/values_no_intf.ml:10: lib_internal_used + ./examples/using_dune/unwrapped_lib/obj/with_class.mli:21: basics_factory: Should not be detected ./examples/using_dune/unwrapped_lib/obj/with_class.mli:33: fun_class_factory: Not detected ./examples/using_dune/unwrapped_lib/opt_args/mixed_args.mli:1: interlaced_mandatory_and_opt: Should not be detected @@ -460,11 +495,12 @@ ./examples/using_dune/unwrapped_lib/values/values.mli:19: used_alias_fun: Not detected ./examples/using_dune/unwrapped_lib/values/values.mli:24: used_closure: Not detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:2: Exported.used_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:1: used_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:14: used_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:21: used_alias_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:26: used_closure: Not detected +./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:2: Exported.used_int +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:1: used_int +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:14: used_fun +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:21: used_alias_fun +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:26: used_closure + ./examples/using_dune/wrapped_lib/obj/with_class.mli:21: basics_factory: Should not be detected ./examples/using_dune/wrapped_lib/obj/with_class.mli:33: fun_class_factory: Not detected ./examples/using_dune/wrapped_lib/opt_args/mixed_args.mli:1: interlaced_mandatory_and_opt: Should not be detected @@ -498,45 +534,53 @@ ./examples/using_dune/wrapped_lib/values/values.mli:19: used_alias_fun: Not detected ./examples/using_dune/wrapped_lib/values/values.mli:24: used_closure: Not detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Not detected -./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:2: Exported.used_int: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:1: used_int: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:14: used_fun: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:21: used_alias_fun: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:26: used_closure: Not detected +./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:2: Exported.used_int +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:1: used_int +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:14: used_fun +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:21: used_alias_fun +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:26: used_closure + ./examples/using_make/dir/anonFn.mli:1: f ./examples/using_make/dir/anonFn.mli:2: g ./examples/using_make/dir/anonFn.mli:3: h -./examples/using_make/dir/fn_arg.ml:7: h: Not detected -./examples/using_make/dir/partial.ml:1: f: Not detected -./examples/using_make/dir/ref_opt.ml:1: f: Not detected -./examples/using_make/dir/ref_opt.ml:5: r: Not detected +./examples/using_make/dir/fn_arg.ml:7: h +./examples/using_make/dir/partial.ml:1: f +./examples/using_make/dir/ref_opt.ml:1: f +./examples/using_make/dir/ref_opt.ml:5: r + ./examples/using_make/exported.mli:6: M1.five: Not detected ./examples/using_make/exported.mli:15: M2.five: Not detected ./examples/using_make/functor.mli:7: F.g: Not detected ./examples/using_make/functor.mli:11: N.g: Not detected ./examples/using_make/obj/class.mli:7: o: Not detected -./examples/using_make/obj/fun_obj_param.ml:1: f: Not detected +./examples/using_make/obj/fun_obj_param.ml:1: f ./examples/using_make/obj/inher.mli:11: o: Not detected -./examples/using_make/obj/object.ml:1: o: Not detected -./examples/using_make/opt_in_opt.ml:1: foo: Not detected -./examples/using_make/unused_fn.ml:1: f: Not detected +./examples/using_make/obj/object.ml:1: o + +./examples/using_make/opt/sig_struct.ml:6: f: Should not be detected +./examples/using_make/opt_in_opt.ml:1: foo +./examples/using_make/unused_fn.ml:1: f -------- .>-> ALMOST UNUSED EXPORTED VALUES: Called 3 time(s): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:24: multiple_sometimes_used_opt_args: Should not be detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:19: aliased_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:19: aliased_fun + ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:24: multiple_sometimes_used_opt_args: Should not be detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:19: aliased_fun: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:19: aliased_fun + ./examples/using_make/dir/anonFn2.mli:1: f ./examples/using_make/dir/anonFn2.mli:2: g -./examples/using_make/dir/match_opt.ml:1: f: Not detected +./examples/using_make/dir/match_opt.ml:1: f ./examples/using_make/dir/refFn.mli:1: r: Should not be detected -./examples/using_make/dir/ref_fn.ml:1: f: Not detected +./examples/using_make/dir/ref_fn.ml:1: f + ./examples/using_make/exported.mli:10: F.plus_five: Not detected ./examples/using_make/exported.mli:16: M2.plus_five: Not detected -./examples/using_make/let_in.ml:1: complicated: Not detected +./examples/using_make/let_in.ml:1: complicated + ./examples/using_make/opt/sig_struct.ml:6: f: Not detected Nothing else to report in this section -------------------------------------------------------------------------------- @@ -545,7 +589,8 @@ Nothing else to report in this section .> UNUSED METHODS: ================= ./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused + ./examples/using_dune/unwrapped_lib/obj/with_class.mli:1: unused#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#never_used_fun ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#never_used_int @@ -576,23 +621,22 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected -./examples/using_make/advanced/mod.mli:4: p#f: Should not be detected ./examples/using_make/obj/class.mli:1: c#h ./examples/using_make/obj/class_type.mli:9: c#h ./examples/using_make/obj/coerce.mli:6: p#f ./examples/using_make/obj/coerce.mli:6: p#h -./examples/using_make/obj/constraint.ml:1: p#g: Not detected +./examples/using_make/obj/constraint.ml:1: p#g ./examples/using_make/obj/fooCl.mli:1: p1#g ./examples/using_make/obj/fooCl.mli:1: p1#h ./examples/using_make/obj/fooCl.mli:7: p2#h -./examples/using_make/obj/fun_class.ml:1: c#m3: Not detected -./examples/using_make/obj/fun_obj_param.ml:1: f#n: Not detected +./examples/using_make/obj/fun_class.ml:1: c#m3 +./examples/using_make/obj/fun_obj_param.ml:1: f#n ./examples/using_make/obj/inher.mli:1: p#h ./examples/using_make/obj/named.mli:10: c#g -./examples/using_make/obj/obj_inher.ml:1: c#g: Not detected -./examples/using_make/obj/obj_inher.ml:1: c#h: Not detected -./examples/using_make/obj/obj_inher.ml:19: o3#k: Not detected -./examples/using_make/obj/object.ml:1: o#h: Not detected +./examples/using_make/obj/obj_inher.ml:1: c#g +./examples/using_make/obj/obj_inher.ml:1: c#h +./examples/using_make/obj/obj_inher.ml:19: o3#k +./examples/using_make/obj/object.ml:1: o#h ./examples/using_make/obj/overr.mli:1: p1#g ./examples/using_make/obj/overr.mli:1: p1#h ./examples/using_make/obj/overr.mli:7: p2#g @@ -604,8 +648,9 @@ Nothing else to report in this section ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#externally_used: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#internally_used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#externally_used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#internally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#externally_used +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#internally_used + ./examples/using_dune/unwrapped_lib/obj/with_class.mli:35: _self_used#used ./examples/using_dune/unwrapped_lib/obj/with_class.mli:41: _self_used_fun_class#used ./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#externally_used_fun: Not detected @@ -635,28 +680,29 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_fun: Not detected ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_int: Not detected ./examples/using_make/advanced/func.mli:3: M.c#f -./examples/using_make/advanced/mod.mli:4: p#f: Not detected +./examples/using_make/advanced/mod.mli:4: p#f + ./examples/using_make/obj/class.mli:1: c#f ./examples/using_make/obj/class.mli:1: c#g ./examples/using_make/obj/class_type.mli:7: p#f ./examples/using_make/obj/class_type.mli:7: p#h ./examples/using_make/obj/coerce.mli:8: c#h -./examples/using_make/obj/constraint.ml:1: p#f: Not detected -./examples/using_make/obj/depend.ml:8: M.c#f: Not detected +./examples/using_make/obj/constraint.ml:1: p#f +./examples/using_make/obj/depend.ml:8: M.c#f ./examples/using_make/obj/fooCl.mli:1: p1#f ./examples/using_make/obj/fooCl.mli:7: p2#g -./examples/using_make/obj/fun_class.ml:1: c#m1: Not detected -./examples/using_make/obj/fun_class.ml:1: c#m2: Not detected -./examples/using_make/obj/fun_class.ml:1: c#m4: Not detected -./examples/using_make/obj/fun_obj_param.ml:1: f#m: Not detected -./examples/using_make/obj/fun_obj_param.ml:1: f#x: Not detected +./examples/using_make/obj/fun_class.ml:1: c#m1 +./examples/using_make/obj/fun_class.ml:1: c#m2 +./examples/using_make/obj/fun_class.ml:1: c#m4 +./examples/using_make/obj/fun_obj_param.ml:1: f#m +./examples/using_make/obj/fun_obj_param.ml:1: f#x ./examples/using_make/obj/inher.mli:1: p#f ./examples/using_make/obj/inher.mli:1: p#g ./examples/using_make/obj/named.mli:1: p1#g ./examples/using_make/obj/named.mli:6: p2#f ./examples/using_make/obj/named.mli:10: c#f -./examples/using_make/obj/object.ml:1: o#f: Not detected -./examples/using_make/obj/object.ml:1: o#g: Not detected +./examples/using_make/obj/object.ml:1: o#f +./examples/using_make/obj/object.ml:1: o#g ./examples/using_make/obj/overr.mli:1: p1#f ./examples/using_make/obj/overr.mli:12: c#g -------- @@ -665,7 +711,8 @@ Nothing else to report in this section .>-> ALMOST UNUSED METHODS: Called 2 time(s): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#used + ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#externally_used_fun ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#externally_used_int ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#internally_used_fun @@ -691,7 +738,7 @@ Nothing else to report in this section ./examples/using_make/obj/class_type.mli:7: p#g ./examples/using_make/obj/coerce.mli:8: c#f ./examples/using_make/obj/named.mli:1: p1#f -./examples/using_make/obj/obj_inher.ml:1: c#f: Not detected +./examples/using_make/obj/obj_inher.ml:1: c#f -------- @@ -705,9 +752,10 @@ Nothing else to report in this section ./examples/using_dune/preprocessed_lib/preprocessed.mli:14: constructors.Unused ./examples/using_dune/preprocessed_lib/preprocessed.mli:19: constr_with_eq.Unused ./examples/using_dune/preprocessed_lib/preprocessed.mli:23: record.unused -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:25: constructors.Unused: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:30: constr_with_eq.Unused: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:39: record.unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:25: constructors.Unused +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:30: constr_with_eq.Unused +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:39: record.unused + ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:1: unused_single_no_param.Unused_single_no_param ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:2: unused_single_unit.Unused_single_unit ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:3: unused_single_param.Unused_single_param @@ -778,11 +826,12 @@ Nothing else to report in this section ./examples/using_dune/preprocessed_lib/preprocessed.mli:25: record.internally_used ./examples/using_dune/preprocessed_lib/preprocessed.mli:26: record.externally_used ./examples/using_dune/preprocessed_lib/preprocessed.mli:29: record_with_eq.implicitly_used -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:27: constructors.Internally_used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:28: constructors.Externally_used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:41: record.internally_used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:42: record.externally_used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:45: record_with_eq.implicitly_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:27: constructors.Internally_used +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:28: constructors.Externally_used +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:41: record.internally_used +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:42: record.externally_used +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:45: record_with_eq.implicitly_used + ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:25: internally_used_single_no_param.Internally_used_single_no_param ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:26: internally_used_single_unit.Internally_used_single_unit ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:27: internally_used_single_param.Internally_used_single_param @@ -848,8 +897,9 @@ Nothing else to report in this section ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./examples/using_dune/preprocessed_lib/preprocessed.mli:15: constructors.Used ./examples/using_dune/preprocessed_lib/preprocessed.mli:24: record.used -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:26: constructors.Used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:40: record.used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:26: constructors.Used +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:40: record.used + ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:17: used_single_no_param.Used_single_no_param ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:18: used_single_unit.Used_single_unit ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:19: used_single_param.Used_single_param @@ -1403,7 +1453,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 1261 -Success: 798 -Failed: 463 -Ratio: 63.2831086439% +Total: 1274 +Success: 975 +Failed: 299 +Ratio: 76.5306122449% diff --git a/src/config/config.ml b/src/config/config.ml index 6fd45095..77855674 100644 --- a/src/config/config.ml +++ b/src/config/config.ml @@ -108,7 +108,7 @@ let normalize_path path = let rec add_filepaths acc path = match Utils.Filepath.kind ~exclude:(fun _ -> false) path with - | Cmti | Cmt -> Utils.StringSet.add path acc + | Cmti | Cmt_without_mli | Cmt_with_mli -> Utils.StringSet.add path acc | Dir -> Sys.readdir path |> Array.fold_left diff --git a/src/deadCode.ml b/src/deadCode.ml index c542cac8..f4e27cec 100644 --- a/src/deadCode.ml +++ b/src/deadCode.ml @@ -407,7 +407,7 @@ let read_interface fn signature state = let f = collect_export ~context:Toplevel [module_id] u decs in - List.iter f signature.sig_type; + List.iter f signature; last_loc := Lexing.dummy_pos @@ -483,82 +483,83 @@ let load_file fn state = (* TODO: stateful computations should take and return the state when possible *) state in - let exclude filepath = Config.is_excluded filepath state.State.config in - match Utils.Filepath.kind ~exclude fn with - | Cmti when !DeadCommon.declarations -> - let open Cmt_format in - last_loc := Lexing.dummy_pos; - if state.State.config.verbose then Printf.eprintf "Scanning %s\n%!" fn; - init_and_continue state fn (fun state -> - match state.file_infos.cmti_infos with - | None -> bad_files := fn :: !bad_files - | Some {cmt_annots = Interface signature; _} -> - read_interface fn signature state - | _ -> () - ) - - | Cmt -> - let open Cmt_format in - last_loc := Lexing.dummy_pos; - if state.config.verbose then Printf.eprintf "Scanning %s\n%!" fn; - init_and_continue state fn (fun state -> - regabs state; - match state.file_infos.cmt_infos with - | None -> bad_files := fn :: !bad_files - | Some ({cmt_annots = Implementation x; _} as cmt_infos) -> - let uid_decl_dep_to_loc_pair (_dep_kind, uid_def, uid_decl) = - let ( let* ) x f = Option.bind x f in - let loc_opt_of_uid uid = - let* decl = - Uid.Tbl.find_opt cmt_infos.cmt_uid_to_decl uid - in - match decl with - | Value {val_loc = {loc_start; loc_ghost = false; _}; _} -> - Some loc_start - | _ -> None + let process_interface fn = + last_loc := Lexing.dummy_pos; + if state.State.config.verbose then + Printf.eprintf "Scanning interface from %s\n%!" fn; + init_and_continue state fn (fun state -> + match state.file_infos.cmi_infos with + | None -> bad_files := fn :: !bad_files + | Some {cmi_sign; _} -> + read_interface fn cmi_sign state + ) + in + let process_implementation fn = + last_loc := Lexing.dummy_pos; + if state.State.config.verbose then + Printf.eprintf "Scanning implementation %s\n%!" fn; + init_and_continue state fn (fun state -> + match state.file_infos.cmt_infos with + | None -> bad_files := fn :: !bad_files + | Some ({cmt_annots = Implementation x; _} as cmt_infos) -> + regabs state; + let uid_decl_dep_to_loc_pair (_dep_kind, uid_def, uid_decl) = + let ( let* ) x f = Option.bind x f in + let loc_opt_of_uid uid = + let* decl = + Uid.Tbl.find_opt cmt_infos.cmt_uid_to_decl uid in - let* def_loc = loc_opt_of_uid uid_def in - let* decl_loc = loc_opt_of_uid uid_decl in - Some (def_loc, decl_loc) + match decl with + | Value {val_loc = {loc_start; loc_ghost = false; _}; _} -> + Some loc_start + | _ -> None in - let value_dep = - cmt_infos.cmt_declaration_dependencies - |> List.filter_map uid_decl_dep_to_loc_pair - in - let prepare (loc1, loc2) = - DeadObj.add_equal loc1 loc2; - VdNode.merge_locs ~force:true loc2 loc1 - in - List.iter prepare value_dep; - - ignore (collect_references.Tast_mapper.structure collect_references x); - - let loc_dep = - if Config.must_report_section state.config.sections.exported_values then - let sourceunit = - State.File_infos.get_sourceunit state.file_infos - in - let in_sourceunit (pos : Lexing.position) = - String.equal (Utils.Filepath.unit pos.pos_fname) sourceunit - in - List.filter_map - (fun (loc1, loc2) -> - if in_sourceunit loc1 || in_sourceunit loc2 then - Some (loc1, loc2) - else None - ) - value_dep - else [] - in - eof loc_dep - | _ -> () (* todo: support partial_implementation? *) - ) - + let* def_loc = loc_opt_of_uid uid_def in + let* decl_loc = loc_opt_of_uid uid_decl in + Some (def_loc, decl_loc) + in + let value_dep = + cmt_infos.cmt_declaration_dependencies + |> List.filter_map uid_decl_dep_to_loc_pair + in + let prepare (loc1, loc2) = + DeadObj.add_equal loc1 loc2; + VdNode.merge_locs ~force:true loc2 loc1 + in + List.iter prepare value_dep; + ignore (collect_references.Tast_mapper.structure collect_references x); + let loc_dep = + if Config.must_report_section state.config.sections.exported_values then + let sourceunit = + State.File_infos.get_sourceunit state.file_infos + in + let in_sourceunit (pos : Lexing.position) = + String.equal (Utils.Filepath.unit pos.pos_fname) sourceunit + in + List.filter_map + (fun (loc1, loc2) -> + if in_sourceunit loc1 || in_sourceunit loc2 then + Some (loc1, loc2) + else None + ) + value_dep + else [] + in + eof loc_dep + | _ -> () (* todo: support partial_implementation? *) + ) + in + let exclude filepath = Config.is_excluded filepath state.State.config in + match Utils.Filepath.kind ~exclude fn with + | Cmti when !DeadCommon.declarations -> process_interface fn + | Cmt_with_mli -> process_implementation fn + | Cmt_without_mli -> + let _state = process_interface fn in + process_implementation fn | Dir -> (* TODO : better error handling *) failwith ("Internal error : Unexpected directory " ^ fn ^ ". Only .cmti and .cmt are expected") - | _ -> state diff --git a/src/state/file_infos.ml b/src/state/file_infos.ml index 9f293701..cacfc55f 100644 --- a/src/state/file_infos.ml +++ b/src/state/file_infos.ml @@ -3,8 +3,9 @@ type t = { sourcepath : string option; builddir : string; modname : string; - cmti_infos : Cmt_format.cmt_infos option; + cmi_infos : Cmi_format.cmi_infos option; cmt_infos : Cmt_format.cmt_infos option; + cmti_infos : Cmt_format.cmt_infos option; } let empty = { @@ -12,16 +13,18 @@ let empty = { sourcepath = None; builddir = "!!UNKNOWN_BUILDDIR!!"; modname = "!!UNKNOWN_MODNAME!!"; - cmti_infos = None; + cmi_infos = None; cmt_infos = None; + cmti_infos = None; } -(** [init_from_cmt_infos ~orig ~cm_file cmt_infos] creates a [t] with: +(** [init_from_all_cm_infos ~orig ~cm_file cmi_infos cmt_infos] creates a [t] with: - information from [cmt_infos]; - [cm_file]; - - [cmt_infos = Some cmt_infos] if [orig = `Cmt] - - [cmti_infos = Some cmt_infos] if [orig = `Cmti] *) - let init_from_cmt_infos ~orig ~cm_file cmt_infos = + - [cmi_infos]; + - [cmt_infos = Some cmt_infos] if [orig = `Cmt]; + - [cmti_infos = Some cmt_infos] if [orig = `Cmti]. *) + let init_from_all_cm_infos ~orig ~cm_file cmi_infos cmt_infos = let builddir = cmt_infos.Cmt_format.cmt_builddir in let sourcepath = Option.map Utils.Filepath.remove_pp cmt_infos.cmt_sourcefile @@ -33,7 +36,7 @@ let empty = { | `Cmt -> Some cmt_infos, None | `Cmti -> None, Some cmt_infos in - {cm_file; sourcepath; builddir; modname; cmt_infos; cmti_infos} + {cm_file; sourcepath; builddir; modname; cmi_infos; cmt_infos; cmti_infos} (** [init_from_cm_file ~orig cm_file] returns an [Ok t] with [t] filled using the [cm_file] (see [init_from_cmt_infos]). @@ -43,17 +46,12 @@ let empty = { let init_from_cm_file ~orig cm_file = if not (Sys.file_exists cm_file) then Result.error (cm_file ^ ": file not found") else - try - let cmt_infos = Cmt_format.read_cmt cm_file in - init_from_cmt_infos ~orig ~cm_file cmt_infos - |> Result.ok - with _ -> - let ext = - match orig with - | `Cmt -> ".cmt" - | `Cmti -> ".cmti" - in - Result.error (Printf.sprintf "%s: cannot read %s file" cm_file ext) + match Cmt_format.read cm_file with + | exception _ -> Result.error (cm_file ^ ": error reading file") + | _, None -> Result.error (cm_file ^ ": cmt_infos not found") + | cmi_infos, Some cmt_infos -> + init_from_all_cm_infos ~orig ~cm_file cmi_infos cmt_infos + |> Result.ok let init cm_file = let ( let* ) x f = Result.bind x f in @@ -64,35 +62,39 @@ let init cm_file = | _ -> Result.error (cm_file ^ ": not a .cmti or .cmt file") in let* file_infos = init_from_cm_file ~orig cm_file in - let cmt_infos, cmti_infos = + let cmi_infos, cmt_infos, cmti_infos = let no_ext = Filename.remove_extension cm_file in match orig with | `Cmt -> - let cmti_infos = + let cmi_infos, cmti_infos = init_from_cm_file ~orig:`Cmti (no_ext ^ ".cmti") - |> Result.map (fun {cmti_infos; _} -> cmti_infos) - |> Result.value ~default:file_infos.cmti_infos + |> Result.map (fun {cmi_infos; cmti_infos; _} -> cmi_infos, cmti_infos) + |> Result.value ~default:(file_infos.cmi_infos, file_infos.cmti_infos) in - file_infos.cmt_infos, cmti_infos + cmi_infos, file_infos.cmt_infos, cmti_infos | `Cmti -> let cmt_infos = init_from_cm_file ~orig:`Cmt (no_ext ^ ".cmt") |> Result.map (fun {cmt_infos; _} -> cmt_infos) |> Result.value ~default:file_infos.cmt_infos in - cmt_infos, file_infos.cmti_infos + file_infos.cmi_infos, cmt_infos, file_infos.cmti_infos in - Result.ok {file_infos with cmt_infos; cmti_infos} + Result.ok {file_infos with cmi_infos; cmt_infos; cmti_infos} let change_file file_infos cm_file = let no_ext = Filename.remove_extension cm_file in assert(no_ext = Filename.remove_extension file_infos.cm_file); match Filename.extension cm_file, file_infos with - | ".cmt", {cmt_infos=Some cmt_infos; cmti_infos; _} -> - let res = init_from_cmt_infos ~orig:`Cmt ~cm_file cmt_infos in - Result.ok {res with cmti_infos} - | ".cmti", {cmti_infos=Some cmti_infos; cmt_infos; _} -> - let res = init_from_cmt_infos ~orig:`Cmti ~cm_file cmti_infos in + | ".cmt", {cmt_infos=Some cmt_infos; cmi_infos; cmti_infos; _} -> + let res = + init_from_all_cm_infos ~orig:`Cmt ~cm_file cmi_infos cmt_infos + in + Result.ok {res with cmi_infos; cmti_infos} + | ".cmti", {cmti_infos=Some cmti_infos; cmi_infos; cmt_infos; _} -> + let res = + init_from_all_cm_infos ~orig:`Cmti ~cm_file cmi_infos cmti_infos + in Result.ok {res with cmt_infos} | _ -> (* corresponding info is None or invlaid extension *) init cm_file diff --git a/src/state/file_infos.mli b/src/state/file_infos.mli index bf782cec..2807c9e7 100644 --- a/src/state/file_infos.mli +++ b/src/state/file_infos.mli @@ -5,8 +5,9 @@ type t = { sourcepath : string option; (** The path to the associated source file *) builddir : string; (** The [cmt_builddir] *) modname : string; (** Either [cmti_name] or [cmt_modname] *) - cmti_infos : Cmt_format.cmt_infos option; + cmi_infos : Cmi_format.cmi_infos option; cmt_infos : Cmt_format.cmt_infos option; + cmti_infos : Cmt_format.cmt_infos option; } val empty : t (** No file info *) diff --git a/src/utils.ml b/src/utils.ml index 5cd89f0d..df300c1c 100644 --- a/src/utils.ml +++ b/src/utils.ml @@ -14,7 +14,8 @@ module Filepath = struct type kind = | Cmti - | Cmt + | Cmt_without_mli + | Cmt_with_mli | Dir | Ignore @@ -27,7 +28,10 @@ module Filepath = struct ) else if Sys.is_directory filepath then Dir else if Filename.check_suffix filepath ".cmti" then Cmti - else if Filename.check_suffix filepath ".cmt" then Cmt + else if Filename.check_suffix filepath ".cmt" then + let cmti = Filename.remove_extension filepath ^ ".cmti" in + if Sys.file_exists cmti then Cmt_with_mli + else Cmt_without_mli else Ignore end diff --git a/src/utils.mli b/src/utils.mli index 188d7066..1d506e9f 100644 --- a/src/utils.mli +++ b/src/utils.mli @@ -11,7 +11,8 @@ module Filepath : sig type kind = | Cmti (** .cmti file *) - | Cmt (** .cmt file *) + | Cmt_without_mli (** .cmt file of .ml only module *) + | Cmt_with_mli (** .cmt file of module with .mli *) | Dir (** Directory *) | Ignore (** Irrelevant for the analyzer *) From c79b44d13539352e9861169bb116f8f90f65e5be Mon Sep 17 00:00:00 2001 From: Corentin De Souza <9597216+fantazio@users.noreply.github.com> Date: Mon, 8 Dec 2025 19:12:40 +0100 Subject: [PATCH 05/12] [src][input][3/n] store uid's loc for values Using information available in the `.cmt`, store locations of uids coming from `include`s in a new state field : `state.signature.uid_to_loc`. Using `.cmt` and `.cmti`, store locations of values' (and patterns in value bindings) uids at the same location for easier lookup. This is done as soon as the files are loaded, before the analysis. The new table tries to be semantically equivalent to the usage of `cmt_value_dependencies` instead of `cmt_declaration_dependencies` before OCaml 5.3. This fixes the FP and FN introduced when moving to OCaml 5.3. --- check/classic/classic.ref | 51 ++- check/internal/internal.ref | 100 ++--- check/threshold-1/threshold-1.ref | 276 +++++--------- check/threshold-3-0.5/threshold-3-0.5.ref | 443 +++++++++------------- src/deadCode.ml | 12 +- src/state/file_infos.ml | 16 +- src/state/signature.ml | 69 ++++ src/state/signature.mli | 15 + src/state/state.ml | 13 +- src/state/state.mli | 3 + 10 files changed, 435 insertions(+), 563 deletions(-) create mode 100644 src/state/signature.ml create mode 100644 src/state/signature.mli diff --git a/check/classic/classic.ref b/check/classic/classic.ref index 5c224477..ed4f9d10 100644 --- a/check/classic/classic.ref +++ b/check/classic/classic.ref @@ -12,7 +12,6 @@ ./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused ./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Should not be detected ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement @@ -105,8 +104,7 @@ ./examples/using_make/advanced/inc_val.mli:1: x ./examples/using_make/advanced/inc_val.mli:2: y -./examples/using_make/advanced/val.mli:1: x: Should not be detected -./examples/using_make/advanced/val.mli:2: y: Should not be detected + ./examples/using_make/bar.ml:1: x ./examples/using_make/bar_fn.ml:3: h ./examples/using_make/baz.mli:1: z @@ -165,7 +163,7 @@ Nothing else to report in this section .> UNUSED METHODS: ================= -./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:1: unused#unused @@ -175,14 +173,15 @@ Nothing else to report in this section ./examples/using_dune/unwrapped_lib/obj/with_class.mli:25: fun_class#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:35: _self_used#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:41: _self_used_fun_class#unused -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int + ./examples/using_dune/wrapped_lib/obj/with_class.mli:1: unused#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#never_used_fun ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#never_used_int @@ -190,14 +189,15 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/with_class.mli:25: fun_class#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:35: _self_used#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:41: _self_used_fun_class#unused -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int + ./examples/using_make/obj/class.mli:1: c#h ./examples/using_make/obj/class_type.mli:9: c#h ./examples/using_make/obj/coerce.mli:6: p#f @@ -431,8 +431,6 @@ Nothing else to report in this section ./examples/using_make/if_end.ml:5: ?b ./examples/using_make/letIn.mli:1: ?a ./examples/using_make/let_in.ml:1: ?a -./examples/using_make/opt/sig_struct.ml:6: ?x: Should not be detected -./examples/using_make/opt/sig_struct.ml:11: ?x: Should not be detected ./examples/using_make/opt_in_opt.ml:1: ?a ./examples/using_make/opt_in_opt.ml:5: ?a ./examples/using_make/partial_opt.ml:1: ?a @@ -552,7 +550,6 @@ Nothing else to report in this section ./examples/using_make/foo.ml:1: ?a ./examples/using_make/letIn.mli:1: ?b ./examples/using_make/let_in.ml:1: ?c -./examples/using_make/opt/sig_struct.ml:2: ?x: Should not be detected ./examples/using_make/opt_in_opt.ml:2: ?a ./examples/using_make/opt_in_opt.ml:2: ?b ./examples/using_make/record.ml:12: ?b @@ -638,7 +635,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 554 -Success: 514 -Failed: 40 -Ratio: 92.7797833935% +Total: 548 +Success: 531 +Failed: 17 +Ratio: 96.897810219% diff --git a/check/internal/internal.ref b/check/internal/internal.ref index afc8cde8..913d3154 100644 --- a/check/internal/internal.ref +++ b/check/internal/internal.ref @@ -2,37 +2,25 @@ ========================= ./examples/docs/exported_values/code_constructs/function/function_lib.mli:7: unused -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:9: F.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:10: F.unused -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:14: Internal_param.used_required: Should not be detected -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:15: Internal_param.unused_required: Should not be detected -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:26: Internal_app.unused ./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused ./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Should not be detected ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement -./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:19: M_redef.unused -./examples/docs/exported_values/code_constructs/module/module_lib.mli:5: M.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/module/module_lib.mli:6: M.unused -./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello: Should not be detected -./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye: Should not be detected -./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:4: world: Should not be detected ./examples/docs/exported_values/limitations/incl_same_name/oo.mli:20: copy: Should not be detected ./examples/docs/exported_values/limitations/incl_same_name/oo.mli:25: id: Should not be detected ./examples/docs/exported_values/limitations/incl_same_name/oo.mli:40: new_method: Should not be detected ./examples/docs/exported_values/limitations/incl_same_name/oo.mli:41: public_method_label: Should not be detected ./examples/docs/exported_values/limitations/sigincl/sigincl_lib.mli:10: I.x: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:1: unused -./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used: Should not be detected -./examples/using_dune/preprocessed_lib/preprocessed.mli:38: internally_used_f: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused ./examples/using_dune/reduced_lib/reduced_lib.mli:3: Values.used_by_API @@ -43,18 +31,12 @@ ./examples/using_dune/reduced_lib/reduced_lib.mli:19: Values_in_submodules.Exported.internally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:27: Values_in_submodules_no_intf.Exported.used_by_API ./examples/using_dune/reduced_lib/reduced_lib.mli:28: Values_in_submodules_no_intf.Exported.internally_used -./examples/using_dune/reduced_lib/values.mli:1: used: Should not be detected ./examples/using_dune/reduced_lib/values.mli:2: used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values.mli:3: internally_used: Should not be detected ./examples/using_dune/reduced_lib/values.mli:4: externally_used: Should not be detected ./examples/using_dune/reduced_lib/values.mli:7: lib_internal_unused -./examples/using_dune/reduced_lib/values.mli:8: lib_internal_internally_used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:2: Exported.used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:3: Exported.used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:4: Exported.internally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:8: Exported.lib_internal_unused -./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused @@ -63,18 +45,12 @@ ./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_unused ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:12: internally_used_fun_with_single_sometimes_used_opt_arg: Should not be detected + ./examples/using_dune/unwrapped_lib/values/values.mli:2: unused_int -./examples/using_dune/unwrapped_lib/values/values.mli:3: internally_used_int: Should not be detected ./examples/using_dune/unwrapped_lib/values/values.mli:14: unused_fun -./examples/using_dune/unwrapped_lib/values/values.mli:15: internally_used_fun: Should not be detected ./examples/using_dune/unwrapped_lib/values/values.mli:20: unused_alias_fun ./examples/using_dune/unwrapped_lib/values/values.mli:25: unused_closure -./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int -./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun @@ -82,18 +58,12 @@ ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:12: internally_used_fun_with_single_sometimes_used_opt_arg: Should not be detected + ./examples/using_dune/wrapped_lib/values/values.mli:2: unused_int -./examples/using_dune/wrapped_lib/values/values.mli:3: internally_used_int: Should not be detected ./examples/using_dune/wrapped_lib/values/values.mli:14: unused_fun -./examples/using_dune/wrapped_lib/values/values.mli:15: internally_used_fun: Should not be detected ./examples/using_dune/wrapped_lib/values/values.mli:20: unused_alias_fun ./examples/using_dune/wrapped_lib/values/values.mli:25: unused_closure -./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int -./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected ./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int ./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int ./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun @@ -102,8 +72,7 @@ ./examples/using_make/advanced/inc_val.mli:1: x ./examples/using_make/advanced/inc_val.mli:2: y -./examples/using_make/advanced/val.mli:1: x: Should not be detected -./examples/using_make/advanced/val.mli:2: y: Should not be detected + ./examples/using_make/bar.ml:1: x ./examples/using_make/bar_fn.ml:3: h ./examples/using_make/baz.mli:1: z @@ -120,46 +89,32 @@ ./examples/using_make/dir/anon_call2.ml:9: h ./examples/using_make/dir/match_opt.ml:8: l ./examples/using_make/dir/matchopt.ml:5: w -./examples/using_make/dir/mod.mli:10: M.f: Should not be detected ./examples/using_make/dir/mod.mli:11: M.g ./examples/using_make/dir/refFn.mli:3: x ./examples/using_make/dir/ref_opt.ml:3: no ./examples/using_make/dir/ref_opt.ml:11: x -./examples/using_make/exported.mli:6: M1.five: Should not be detected -./examples/using_make/exported.mli:10: F.plus_five: Should not be detected ./examples/using_make/exported.mli:11: F.times_five -./examples/using_make/exported.mli:15: M2.five: Should not be detected -./examples/using_make/exported.mli:16: M2.plus_five: Should not be detected ./examples/using_make/exported.mli:17: M2.ten ./examples/using_make/foo.mli:2: y ./examples/using_make/fooFn.mli:2: g -./examples/using_make/functor.mli:2: M.f: Should not be detected ./examples/using_make/functor.mli:3: M.none -./examples/using_make/functor.mli:7: F.g: Should not be detected -./examples/using_make/functor.mli:11: N.g: Should not be detected ./examples/using_make/let_in.ml:3: parent ./examples/using_make/let_test.ml:3: g ./examples/using_make/matchopt.ml:5: w -./examples/using_make/mod_alias.mli:2: M1.id: Should not be detected -./examples/using_make/mod_alias.mli:6: M2.id: Should not be detected -./examples/using_make/obj/class.mli:7: o: Should not be detected -./examples/using_make/obj/class.mli:9: f: Should not be detected -./examples/using_make/obj/inher.mli:11: o: Should not be detected -./examples/using_make/obj/inher.mli:13: f: Should not be detected ./examples/using_make/opt_in_opt.ml:7: x ./examples/using_make/qux.ml:1: z ./examples/using_make/unused_fn.ml:3: g ./examples/using_make/unused_fn.ml:5: var ./examples/using_make/useless_opt.ml:3: x -./examples/using_make/variant.mli:5: f: Should not be detected + Nothing else to report in this section -------------------------------------------------------------------------------- .> UNUSED METHODS: ================= -./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:1: unused#unused @@ -169,14 +124,15 @@ Nothing else to report in this section ./examples/using_dune/unwrapped_lib/obj/with_class.mli:25: fun_class#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:35: _self_used#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:41: _self_used_fun_class#unused -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int + ./examples/using_dune/wrapped_lib/obj/with_class.mli:1: unused#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#never_used_fun ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#never_used_int @@ -184,14 +140,15 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/with_class.mli:25: fun_class#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:35: _self_used#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:41: _self_used_fun_class#unused -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int + ./examples/using_make/obj/class.mli:1: c#h ./examples/using_make/obj/class_type.mli:9: c#h ./examples/using_make/obj/coerce.mli:6: p#f @@ -425,8 +382,6 @@ Nothing else to report in this section ./examples/using_make/if_end.ml:5: ?b ./examples/using_make/letIn.mli:1: ?a ./examples/using_make/let_in.ml:1: ?a -./examples/using_make/opt/sig_struct.ml:6: ?x: Should not be detected -./examples/using_make/opt/sig_struct.ml:11: ?x: Should not be detected ./examples/using_make/opt_in_opt.ml:1: ?a ./examples/using_make/opt_in_opt.ml:5: ?a ./examples/using_make/partial_opt.ml:1: ?a @@ -546,7 +501,6 @@ Nothing else to report in this section ./examples/using_make/foo.ml:1: ?a ./examples/using_make/letIn.mli:1: ?b ./examples/using_make/let_in.ml:1: ?c -./examples/using_make/opt/sig_struct.ml:2: ?x: Should not be detected ./examples/using_make/opt_in_opt.ml:2: ?a ./examples/using_make/opt_in_opt.ml:2: ?b ./examples/using_make/record.ml:12: ?b @@ -632,7 +586,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 554 -Success: 472 -Failed: 82 -Ratio: 85.1985559567% +Total: 502 +Success: 489 +Failed: 13 +Ratio: 97.4103585657% diff --git a/check/threshold-1/threshold-1.ref b/check/threshold-1/threshold-1.ref index c1237269..2847ae80 100644 --- a/check/threshold-1/threshold-1.ref +++ b/check/threshold-1/threshold-1.ref @@ -2,37 +2,25 @@ ========================= ./examples/docs/exported_values/code_constructs/function/function_lib.mli:7: unused -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:9: F.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:10: F.unused -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:14: Internal_param.used_required: Should not be detected -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:15: Internal_param.unused_required: Should not be detected -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:26: Internal_app.unused ./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused ./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Should not be detected ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement -./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:19: M_redef.unused -./examples/docs/exported_values/code_constructs/module/module_lib.mli:5: M.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/module/module_lib.mli:6: M.unused -./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello: Should not be detected -./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye: Should not be detected -./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:4: world: Should not be detected ./examples/docs/exported_values/limitations/incl_same_name/oo.mli:20: copy: Should not be detected ./examples/docs/exported_values/limitations/incl_same_name/oo.mli:25: id: Should not be detected ./examples/docs/exported_values/limitations/incl_same_name/oo.mli:40: new_method: Should not be detected ./examples/docs/exported_values/limitations/incl_same_name/oo.mli:41: public_method_label: Should not be detected ./examples/docs/exported_values/limitations/sigincl/sigincl_lib.mli:10: I.x: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:1: unused -./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used: Should not be detected -./examples/using_dune/preprocessed_lib/preprocessed.mli:38: internally_used_f: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused ./examples/using_dune/reduced_lib/reduced_lib.mli:3: Values.used_by_API @@ -43,18 +31,12 @@ ./examples/using_dune/reduced_lib/reduced_lib.mli:19: Values_in_submodules.Exported.internally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:27: Values_in_submodules_no_intf.Exported.used_by_API ./examples/using_dune/reduced_lib/reduced_lib.mli:28: Values_in_submodules_no_intf.Exported.internally_used -./examples/using_dune/reduced_lib/values.mli:1: used: Should not be detected ./examples/using_dune/reduced_lib/values.mli:2: used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values.mli:3: internally_used: Should not be detected ./examples/using_dune/reduced_lib/values.mli:4: externally_used: Should not be detected ./examples/using_dune/reduced_lib/values.mli:7: lib_internal_unused -./examples/using_dune/reduced_lib/values.mli:8: lib_internal_internally_used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:2: Exported.used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:3: Exported.used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:4: Exported.internally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:8: Exported.lib_internal_unused -./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused @@ -63,18 +45,12 @@ ./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_unused ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:12: internally_used_fun_with_single_sometimes_used_opt_arg: Should not be detected + ./examples/using_dune/unwrapped_lib/values/values.mli:2: unused_int -./examples/using_dune/unwrapped_lib/values/values.mli:3: internally_used_int: Should not be detected ./examples/using_dune/unwrapped_lib/values/values.mli:14: unused_fun -./examples/using_dune/unwrapped_lib/values/values.mli:15: internally_used_fun: Should not be detected ./examples/using_dune/unwrapped_lib/values/values.mli:20: unused_alias_fun ./examples/using_dune/unwrapped_lib/values/values.mli:25: unused_closure -./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int -./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun @@ -82,18 +58,12 @@ ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:12: internally_used_fun_with_single_sometimes_used_opt_arg: Should not be detected + ./examples/using_dune/wrapped_lib/values/values.mli:2: unused_int -./examples/using_dune/wrapped_lib/values/values.mli:3: internally_used_int: Should not be detected ./examples/using_dune/wrapped_lib/values/values.mli:14: unused_fun -./examples/using_dune/wrapped_lib/values/values.mli:15: internally_used_fun: Should not be detected ./examples/using_dune/wrapped_lib/values/values.mli:20: unused_alias_fun ./examples/using_dune/wrapped_lib/values/values.mli:25: unused_closure -./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int -./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected ./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int ./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int ./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun @@ -102,8 +72,7 @@ ./examples/using_make/advanced/inc_val.mli:1: x ./examples/using_make/advanced/inc_val.mli:2: y -./examples/using_make/advanced/val.mli:1: x: Should not be detected -./examples/using_make/advanced/val.mli:2: y: Should not be detected + ./examples/using_make/bar.ml:1: x ./examples/using_make/bar_fn.ml:3: h ./examples/using_make/baz.mli:1: z @@ -120,39 +89,24 @@ ./examples/using_make/dir/anon_call2.ml:9: h ./examples/using_make/dir/match_opt.ml:8: l ./examples/using_make/dir/matchopt.ml:5: w -./examples/using_make/dir/mod.mli:10: M.f: Should not be detected ./examples/using_make/dir/mod.mli:11: M.g ./examples/using_make/dir/refFn.mli:3: x ./examples/using_make/dir/ref_opt.ml:3: no ./examples/using_make/dir/ref_opt.ml:11: x -./examples/using_make/exported.mli:6: M1.five: Should not be detected -./examples/using_make/exported.mli:10: F.plus_five: Should not be detected ./examples/using_make/exported.mli:11: F.times_five -./examples/using_make/exported.mli:15: M2.five: Should not be detected -./examples/using_make/exported.mli:16: M2.plus_five: Should not be detected ./examples/using_make/exported.mli:17: M2.ten ./examples/using_make/foo.mli:2: y ./examples/using_make/fooFn.mli:2: g -./examples/using_make/functor.mli:2: M.f: Should not be detected ./examples/using_make/functor.mli:3: M.none -./examples/using_make/functor.mli:7: F.g: Should not be detected -./examples/using_make/functor.mli:11: N.g: Should not be detected ./examples/using_make/let_in.ml:3: parent ./examples/using_make/let_test.ml:3: g ./examples/using_make/matchopt.ml:5: w -./examples/using_make/mod_alias.mli:2: M1.id: Should not be detected -./examples/using_make/mod_alias.mli:6: M2.id: Should not be detected -./examples/using_make/obj/class.mli:7: o: Should not be detected -./examples/using_make/obj/class.mli:9: f: Should not be detected -./examples/using_make/obj/inher.mli:11: o: Should not be detected -./examples/using_make/obj/inher.mli:13: f: Should not be detected ./examples/using_make/opt_in_opt.ml:7: x ./examples/using_make/qux.ml:1: z ./examples/using_make/unused_fn.ml:3: g ./examples/using_make/unused_fn.ml:5: var ./examples/using_make/useless_opt.ml:3: x -./examples/using_make/variant.mli:5: f: Should not be detected -------- @@ -163,28 +117,32 @@ ./examples/docs/exported_values/code_constructs/function/function_lib.mli:9: do_nothing ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:8: F.externally_used -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:9: F.internally_used: Not detected -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:14: Internal_param.used_required: Not detected -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:15: Internal_param.unused_required: Not detected +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:9: F.internally_used +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:14: Internal_param.used_required +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:15: Internal_param.unused_required ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:19: External_param.used_required ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:20: External_param.unused_required ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:24: Internal_app.externally_used -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used: Not detected +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used + ./examples/docs/exported_values/code_constructs/include/include_lib.ml:3: Original.used_directly ./examples/docs/exported_values/code_constructs/include/include_lib.ml:4: Original.used_indirectly ./examples/docs/exported_values/code_constructs/include/include_lib.ml:14: Redefine.used_directly ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:3: Original.used_directly ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:4: Original.used_indirectly -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Not detected +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement + ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:17: M_redef.externally_used -./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used: Not detected +./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used + ./examples/docs/exported_values/code_constructs/module/module_lib.mli:4: M.externally_used -./examples/docs/exported_values/code_constructs/module/module_lib.mli:5: M.internally_used: Not detected +./examples/docs/exported_values/code_constructs/module/module_lib.mli:5: M.internally_used + ./examples/docs/exported_values/hello_world/hello_world_lib.mli:2: hello ./examples/docs/exported_values/hello_world/hello_world_lib.mli:3: goodbye -./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello: Not detected -./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye: Not detected +./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello +./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye ./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:2: hello ./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:3: goodbye @@ -230,10 +188,8 @@ ./examples/using_dune/bin/use_wrapped_lib/use_without_class.mli:1: mark_used ./examples/using_dune/bin/use_wrapped_lib/use_wrapped_lib.mli:1: mark_used -./examples/using_dune/preprocessed_lib/preprocessed.mli:2: used: Should not be detected -./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used ./examples/using_dune/preprocessed_lib/preprocessed.mli:4: externally_used -./examples/using_dune/preprocessed_lib/preprocessed.mli:31: exported_f: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:4: internally_used ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:5: externally_used @@ -245,15 +201,17 @@ ./examples/using_dune/reduced_lib/reduced_lib.mli:20: Values_in_submodules.Exported.externally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:26: Values_in_submodules_no_intf.Exported.used ./examples/using_dune/reduced_lib/reduced_lib.mli:29: Values_in_submodules_no_intf.Exported.externally_used +./examples/using_dune/reduced_lib/values.mli:1: used: Should not be detected ./examples/using_dune/reduced_lib/values.mli:2: used_by_API: Not detected +./examples/using_dune/reduced_lib/values.mli:3: internally_used: Should not be detected ./examples/using_dune/reduced_lib/values.mli:4: externally_used: Not detected -./examples/using_dune/reduced_lib/values.mli:6: lib_internal_used: Should not be detected -./examples/using_dune/reduced_lib/values.mli:8: lib_internal_internally_used: Not detected +./examples/using_dune/reduced_lib/values.mli:8: lib_internal_internally_used ./examples/using_dune/reduced_lib/values.mli:9: lib_internal_externally_used +./examples/using_dune/reduced_lib/values_in_submodules.mli:2: Exported.used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:3: Exported.used_by_API: Not detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:4: Exported.internally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Not detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:7: Exported.lib_internal_used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used: Not detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used ./examples/using_dune/reduced_lib/values_in_submodules.mli:10: Exported.lib_internal_externally_used ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:2: Exported.used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Not detected @@ -268,46 +226,27 @@ ./examples/using_dune/reduced_lib/values_no_intf.ml:12: lib_internal_internally_used ./examples/using_dune/reduced_lib/values_no_intf.ml:13: lib_internal_externally_used -./examples/using_dune/unwrapped_lib/obj/with_class.mli:33: fun_class_factory: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:5: used_fun_with_single_always_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Not detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Not detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:14: externally_used_fun_with_single_never_used_opt_arg ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:16: externally_used_fun_with_single_always_used_opt_arg -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:20: multiple_never_used_opt_args: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:22: multiple_always_used_opt_args: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:1: partially_applied_with_never_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:3: partially_applied_with_always_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:7: shadowing_never_used_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:8: shadowing_always_used_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:10: expect_fun_with_never_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig: Should not be detected + ./examples/using_dune/unwrapped_lib/style/style.ml:1: all -./examples/using_dune/unwrapped_lib/values/values.mli:1: used_int: Should not be detected -./examples/using_dune/unwrapped_lib/values/values.mli:3: internally_used_int: Not detected +./examples/using_dune/unwrapped_lib/values/values.mli:3: internally_used_int ./examples/using_dune/unwrapped_lib/values/values.mli:4: externally_used_int ./examples/using_dune/unwrapped_lib/values/values.mli:5: externally_used_as_parameter_int ./examples/using_dune/unwrapped_lib/values/values.mli:7: externally_written_bool_ref ./examples/using_dune/unwrapped_lib/values/values.mli:8: externally_matched_option ./examples/using_dune/unwrapped_lib/values/values.mli:10: externally_stored_in_ref_bool ./examples/using_dune/unwrapped_lib/values/values.mli:11: externally_stored_in_option_bool -./examples/using_dune/unwrapped_lib/values/values.mli:13: used_fun: Should not be detected -./examples/using_dune/unwrapped_lib/values/values.mli:15: internally_used_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values.mli:15: internally_used_fun ./examples/using_dune/unwrapped_lib/values/values.mli:16: externally_used_fun ./examples/using_dune/unwrapped_lib/values/values.mli:17: externally_used_as_parameter_fun -./examples/using_dune/unwrapped_lib/values/values.mli:19: used_alias_fun: Should not be detected ./examples/using_dune/unwrapped_lib/values/values.mli:21: externally_used_alias_fun -./examples/using_dune/unwrapped_lib/values/values.mli:23: partially_used_fun: Should not be detected -./examples/using_dune/unwrapped_lib/values/values.mli:24: used_closure: Should not be detected -./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure: Not detected +./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure ./examples/using_dune/unwrapped_lib/values/values.mli:27: externally_used_closure -./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Should not be detected -./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:5: Exported.externally_used_int ./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int ./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int @@ -325,46 +264,27 @@ ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:27: internally_used_closure ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:28: externally_used_closure -./examples/using_dune/wrapped_lib/obj/with_class.mli:33: fun_class_factory: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:5: used_fun_with_single_always_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Not detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Not detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:14: externally_used_fun_with_single_never_used_opt_arg ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:16: externally_used_fun_with_single_always_used_opt_arg -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:20: multiple_never_used_opt_args: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:22: multiple_always_used_opt_args: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:1: partially_applied_with_never_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:3: partially_applied_with_always_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:7: shadowing_never_used_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:8: shadowing_always_used_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:10: expect_fun_with_never_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig: Should not be detected + ./examples/using_dune/wrapped_lib/style/style.ml:1: all -./examples/using_dune/wrapped_lib/values/values.mli:1: used_int: Should not be detected -./examples/using_dune/wrapped_lib/values/values.mli:3: internally_used_int: Not detected +./examples/using_dune/wrapped_lib/values/values.mli:3: internally_used_int ./examples/using_dune/wrapped_lib/values/values.mli:4: externally_used_int ./examples/using_dune/wrapped_lib/values/values.mli:5: externally_used_as_parameter_int ./examples/using_dune/wrapped_lib/values/values.mli:7: externally_written_bool_ref ./examples/using_dune/wrapped_lib/values/values.mli:8: externally_matched_option ./examples/using_dune/wrapped_lib/values/values.mli:10: externally_stored_in_ref_bool ./examples/using_dune/wrapped_lib/values/values.mli:11: externally_stored_in_option_bool -./examples/using_dune/wrapped_lib/values/values.mli:13: used_fun: Should not be detected -./examples/using_dune/wrapped_lib/values/values.mli:15: internally_used_fun: Not detected +./examples/using_dune/wrapped_lib/values/values.mli:15: internally_used_fun ./examples/using_dune/wrapped_lib/values/values.mli:16: externally_used_fun ./examples/using_dune/wrapped_lib/values/values.mli:17: externally_used_as_parameter_fun -./examples/using_dune/wrapped_lib/values/values.mli:19: used_alias_fun: Should not be detected ./examples/using_dune/wrapped_lib/values/values.mli:21: externally_used_alias_fun -./examples/using_dune/wrapped_lib/values/values.mli:23: partially_used_fun: Should not be detected -./examples/using_dune/wrapped_lib/values/values.mli:24: used_closure: Should not be detected -./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure: Not detected +./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure ./examples/using_dune/wrapped_lib/values/values.mli:27: externally_used_closure -./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Should not be detected -./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Not detected +./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:5: Exported.externally_used_int ./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int ./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int @@ -385,8 +305,9 @@ ./examples/using_make/advanced/incl.ml:7: f ./examples/using_make/advanced/mod.mli:1: f ./examples/using_make/advanced/mod.mli:2: x -./examples/using_make/advanced/val.mli:1: x: Not detected -./examples/using_make/advanced/val.mli:2: y: Not detected +./examples/using_make/advanced/val.mli:1: x +./examples/using_make/advanced/val.mli:2: y + ./examples/using_make/baz.mli:2: t ./examples/using_make/cond_sel.ml:9: f ./examples/using_make/cond_sel.ml:11: g @@ -401,24 +322,25 @@ ./examples/using_make/dir/hidden_opt_use.ml:1: f ./examples/using_make/dir/hidden_opt_use.ml:3: apply ./examples/using_make/dir/match_opt.ml:3: m -./examples/using_make/dir/mod.mli:10: M.f: Not detected +./examples/using_make/dir/mod.mli:10: M.f ./examples/using_make/dir/partial.ml:5: g ./examples/using_make/dir/ref_fn.ml:5: g ./examples/using_make/dir/ref_opt.ml:7: g ./examples/using_make/foo.mli:1: x ./examples/using_make/fooFn.mli:1: f -./examples/using_make/functor.mli:2: M.f: Not detected +./examples/using_make/functor.mli:2: M.f ./examples/using_make/if_end.ml:1: f ./examples/using_make/if_end.ml:3: g ./examples/using_make/if_end.ml:5: h ./examples/using_make/letIn.mli:1: f -./examples/using_make/mod_alias.mli:2: M1.id: Not detected -./examples/using_make/mod_alias.mli:6: M2.id: Not detected -./examples/using_make/obj/class.mli:9: f: Not detected +./examples/using_make/mod_alias.mli:2: M1.id +./examples/using_make/mod_alias.mli:6: M2.id + +./examples/using_make/obj/class.mli:9: f ./examples/using_make/obj/fun_class.ml:8: f ./examples/using_make/obj/fun_obj_param.ml:7: app_m -./examples/using_make/obj/inher.mli:13: f: Not detected +./examples/using_make/obj/inher.mli:13: f ./examples/using_make/obj/obj_inher.ml:7: o ./examples/using_make/obj/obj_inher.ml:12: o4 ./examples/using_make/obj/obj_inher.ml:17: o2 @@ -429,14 +351,15 @@ ./examples/using_make/opt_in_opt.ml:5: baz ./examples/using_make/partial_opt.ml:1: f ./examples/using_make/useless_opt.ml:1: foo -./examples/using_make/variant.mli:5: f: Not detected +./examples/using_make/variant.mli:5: f + Nothing else to report in this section -------------------------------------------------------------------------------- .> UNUSED METHODS: ================= -./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:1: unused#unused @@ -446,14 +369,15 @@ Nothing else to report in this section ./examples/using_dune/unwrapped_lib/obj/with_class.mli:25: fun_class#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:35: _self_used#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:41: _self_used_fun_class#unused -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int + ./examples/using_dune/wrapped_lib/obj/with_class.mli:1: unused#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#never_used_fun ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#never_used_int @@ -461,14 +385,15 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/with_class.mli:25: fun_class#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:35: _self_used#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:41: _self_used_fun_class#unused -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int + ./examples/using_make/obj/class.mli:1: c#h ./examples/using_make/obj/class_type.mli:9: c#h ./examples/using_make/obj/coerce.mli:6: p#f @@ -494,39 +419,41 @@ Nothing else to report in this section .>-> ALMOST UNUSED METHODS: Called 1 time(s): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#externally_used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#internally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#externally_used +./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#internally_used ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#externally_used ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#internally_used ./examples/using_dune/unwrapped_lib/obj/with_class.mli:35: _self_used#used ./examples/using_dune/unwrapped_lib/obj/with_class.mli:41: _self_used_fun_class#used -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#externally_used_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#externally_used_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#internally_used_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#internally_used_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#externally_used_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#externally_used_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#internally_used_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#internally_used_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#used_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#used_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#externally_used_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#externally_used_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#internally_used_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#internally_used_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#externally_used_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#externally_used_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#internally_used_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#internally_used_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#used_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#used_int + ./examples/using_dune/wrapped_lib/obj/with_class.mli:35: _self_used#used ./examples/using_dune/wrapped_lib/obj/with_class.mli:41: _self_used_fun_class#used -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#externally_used_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#externally_used_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#internally_used_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#internally_used_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#externally_used_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#externally_used_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#internally_used_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#internally_used_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#externally_used_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#externally_used_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#internally_used_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#internally_used_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#externally_used_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#externally_used_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#internally_used_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#internally_used_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_int + ./examples/using_make/advanced/func.mli:3: M.c#f ./examples/using_make/advanced/mod.mli:4: p#f @@ -840,8 +767,6 @@ Nothing else to report in this section ./examples/using_make/if_end.ml:5: ?b ./examples/using_make/letIn.mli:1: ?a ./examples/using_make/let_in.ml:1: ?a -./examples/using_make/opt/sig_struct.ml:6: ?x: Should not be detected -./examples/using_make/opt/sig_struct.ml:11: ?x: Should not be detected ./examples/using_make/opt_in_opt.ml:1: ?a ./examples/using_make/opt_in_opt.ml:5: ?a ./examples/using_make/partial_opt.ml:1: ?a @@ -961,7 +886,6 @@ Nothing else to report in this section ./examples/using_make/foo.ml:1: ?a ./examples/using_make/letIn.mli:1: ?b ./examples/using_make/let_in.ml:1: ?c -./examples/using_make/opt/sig_struct.ml:2: ?x: Should not be detected ./examples/using_make/opt_in_opt.ml:2: ?a ./examples/using_make/opt_in_opt.ml:2: ?b ./examples/using_make/record.ml:12: ?b @@ -1047,7 +971,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 933 -Success: 736 -Failed: 197 -Ratio: 78.8853161844% +Total: 841 +Success: 812 +Failed: 29 +Ratio: 96.5517241379% diff --git a/check/threshold-3-0.5/threshold-3-0.5.ref b/check/threshold-3-0.5/threshold-3-0.5.ref index 9c55984a..63e4c927 100644 --- a/check/threshold-3-0.5/threshold-3-0.5.ref +++ b/check/threshold-3-0.5/threshold-3-0.5.ref @@ -2,37 +2,25 @@ ========================= ./examples/docs/exported_values/code_constructs/function/function_lib.mli:7: unused -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:9: F.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:10: F.unused -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:14: Internal_param.used_required: Should not be detected -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:15: Internal_param.unused_required: Should not be detected -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:26: Internal_app.unused ./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused ./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Should not be detected ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement -./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:19: M_redef.unused -./examples/docs/exported_values/code_constructs/module/module_lib.mli:5: M.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/module/module_lib.mli:6: M.unused -./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello: Should not be detected -./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye: Should not be detected -./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:4: world: Should not be detected ./examples/docs/exported_values/limitations/incl_same_name/oo.mli:20: copy: Should not be detected ./examples/docs/exported_values/limitations/incl_same_name/oo.mli:25: id: Should not be detected ./examples/docs/exported_values/limitations/incl_same_name/oo.mli:40: new_method: Should not be detected ./examples/docs/exported_values/limitations/incl_same_name/oo.mli:41: public_method_label: Should not be detected ./examples/docs/exported_values/limitations/sigincl/sigincl_lib.mli:10: I.x: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:1: unused -./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used: Should not be detected -./examples/using_dune/preprocessed_lib/preprocessed.mli:38: internally_used_f: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused ./examples/using_dune/reduced_lib/reduced_lib.mli:3: Values.used_by_API @@ -43,18 +31,12 @@ ./examples/using_dune/reduced_lib/reduced_lib.mli:19: Values_in_submodules.Exported.internally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:27: Values_in_submodules_no_intf.Exported.used_by_API ./examples/using_dune/reduced_lib/reduced_lib.mli:28: Values_in_submodules_no_intf.Exported.internally_used -./examples/using_dune/reduced_lib/values.mli:1: used: Should not be detected ./examples/using_dune/reduced_lib/values.mli:2: used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values.mli:3: internally_used: Should not be detected ./examples/using_dune/reduced_lib/values.mli:4: externally_used: Should not be detected ./examples/using_dune/reduced_lib/values.mli:7: lib_internal_unused -./examples/using_dune/reduced_lib/values.mli:8: lib_internal_internally_used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:2: Exported.used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:3: Exported.used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:4: Exported.internally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:8: Exported.lib_internal_unused -./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused @@ -63,18 +45,12 @@ ./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_unused ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:12: internally_used_fun_with_single_sometimes_used_opt_arg: Should not be detected + ./examples/using_dune/unwrapped_lib/values/values.mli:2: unused_int -./examples/using_dune/unwrapped_lib/values/values.mli:3: internally_used_int: Should not be detected ./examples/using_dune/unwrapped_lib/values/values.mli:14: unused_fun -./examples/using_dune/unwrapped_lib/values/values.mli:15: internally_used_fun: Should not be detected ./examples/using_dune/unwrapped_lib/values/values.mli:20: unused_alias_fun ./examples/using_dune/unwrapped_lib/values/values.mli:25: unused_closure -./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int -./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun @@ -82,18 +58,12 @@ ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:12: internally_used_fun_with_single_sometimes_used_opt_arg: Should not be detected + ./examples/using_dune/wrapped_lib/values/values.mli:2: unused_int -./examples/using_dune/wrapped_lib/values/values.mli:3: internally_used_int: Should not be detected ./examples/using_dune/wrapped_lib/values/values.mli:14: unused_fun -./examples/using_dune/wrapped_lib/values/values.mli:15: internally_used_fun: Should not be detected ./examples/using_dune/wrapped_lib/values/values.mli:20: unused_alias_fun ./examples/using_dune/wrapped_lib/values/values.mli:25: unused_closure -./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int -./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected ./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int ./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int ./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun @@ -102,8 +72,7 @@ ./examples/using_make/advanced/inc_val.mli:1: x ./examples/using_make/advanced/inc_val.mli:2: y -./examples/using_make/advanced/val.mli:1: x: Should not be detected -./examples/using_make/advanced/val.mli:2: y: Should not be detected + ./examples/using_make/bar.ml:1: x ./examples/using_make/bar_fn.ml:3: h ./examples/using_make/baz.mli:1: z @@ -120,39 +89,24 @@ ./examples/using_make/dir/anon_call2.ml:9: h ./examples/using_make/dir/match_opt.ml:8: l ./examples/using_make/dir/matchopt.ml:5: w -./examples/using_make/dir/mod.mli:10: M.f: Should not be detected ./examples/using_make/dir/mod.mli:11: M.g ./examples/using_make/dir/refFn.mli:3: x ./examples/using_make/dir/ref_opt.ml:3: no ./examples/using_make/dir/ref_opt.ml:11: x -./examples/using_make/exported.mli:6: M1.five: Should not be detected -./examples/using_make/exported.mli:10: F.plus_five: Should not be detected ./examples/using_make/exported.mli:11: F.times_five -./examples/using_make/exported.mli:15: M2.five: Should not be detected -./examples/using_make/exported.mli:16: M2.plus_five: Should not be detected ./examples/using_make/exported.mli:17: M2.ten ./examples/using_make/foo.mli:2: y ./examples/using_make/fooFn.mli:2: g -./examples/using_make/functor.mli:2: M.f: Should not be detected ./examples/using_make/functor.mli:3: M.none -./examples/using_make/functor.mli:7: F.g: Should not be detected -./examples/using_make/functor.mli:11: N.g: Should not be detected ./examples/using_make/let_in.ml:3: parent ./examples/using_make/let_test.ml:3: g ./examples/using_make/matchopt.ml:5: w -./examples/using_make/mod_alias.mli:2: M1.id: Should not be detected -./examples/using_make/mod_alias.mli:6: M2.id: Should not be detected -./examples/using_make/obj/class.mli:7: o: Should not be detected -./examples/using_make/obj/class.mli:9: f: Should not be detected -./examples/using_make/obj/inher.mli:11: o: Should not be detected -./examples/using_make/obj/inher.mli:13: f: Should not be detected ./examples/using_make/opt_in_opt.ml:7: x ./examples/using_make/qux.ml:1: z ./examples/using_make/unused_fn.ml:3: g ./examples/using_make/unused_fn.ml:5: var ./examples/using_make/useless_opt.ml:3: x -./examples/using_make/variant.mli:5: f: Should not be detected -------- @@ -163,28 +117,32 @@ ./examples/docs/exported_values/code_constructs/function/function_lib.mli:9: do_nothing ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:8: F.externally_used -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:9: F.internally_used: Not detected -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:14: Internal_param.used_required: Not detected -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:15: Internal_param.unused_required: Not detected +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:9: F.internally_used +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:14: Internal_param.used_required +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:15: Internal_param.unused_required ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:19: External_param.used_required ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:20: External_param.unused_required ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:24: Internal_app.externally_used -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used: Not detected +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used + ./examples/docs/exported_values/code_constructs/include/include_lib.ml:3: Original.used_directly ./examples/docs/exported_values/code_constructs/include/include_lib.ml:4: Original.used_indirectly ./examples/docs/exported_values/code_constructs/include/include_lib.ml:14: Redefine.used_directly ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:3: Original.used_directly ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:4: Original.used_indirectly -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Not detected +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement + ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:17: M_redef.externally_used -./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used: Not detected +./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used + ./examples/docs/exported_values/code_constructs/module/module_lib.mli:4: M.externally_used -./examples/docs/exported_values/code_constructs/module/module_lib.mli:5: M.internally_used: Not detected +./examples/docs/exported_values/code_constructs/module/module_lib.mli:5: M.internally_used + ./examples/docs/exported_values/hello_world/hello_world_lib.mli:2: hello ./examples/docs/exported_values/hello_world/hello_world_lib.mli:3: goodbye -./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello: Not detected -./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye: Not detected +./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello +./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye ./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:2: hello ./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:3: goodbye @@ -230,10 +188,8 @@ ./examples/using_dune/bin/use_wrapped_lib/use_without_class.mli:1: mark_used ./examples/using_dune/bin/use_wrapped_lib/use_wrapped_lib.mli:1: mark_used -./examples/using_dune/preprocessed_lib/preprocessed.mli:2: used: Should not be detected -./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used ./examples/using_dune/preprocessed_lib/preprocessed.mli:4: externally_used -./examples/using_dune/preprocessed_lib/preprocessed.mli:31: exported_f: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:4: internally_used ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:5: externally_used @@ -245,15 +201,17 @@ ./examples/using_dune/reduced_lib/reduced_lib.mli:20: Values_in_submodules.Exported.externally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:26: Values_in_submodules_no_intf.Exported.used ./examples/using_dune/reduced_lib/reduced_lib.mli:29: Values_in_submodules_no_intf.Exported.externally_used +./examples/using_dune/reduced_lib/values.mli:1: used: Should not be detected ./examples/using_dune/reduced_lib/values.mli:2: used_by_API: Not detected +./examples/using_dune/reduced_lib/values.mli:3: internally_used: Should not be detected ./examples/using_dune/reduced_lib/values.mli:4: externally_used: Not detected -./examples/using_dune/reduced_lib/values.mli:6: lib_internal_used: Should not be detected -./examples/using_dune/reduced_lib/values.mli:8: lib_internal_internally_used: Not detected +./examples/using_dune/reduced_lib/values.mli:8: lib_internal_internally_used ./examples/using_dune/reduced_lib/values.mli:9: lib_internal_externally_used +./examples/using_dune/reduced_lib/values_in_submodules.mli:2: Exported.used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:3: Exported.used_by_API: Not detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:4: Exported.internally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Not detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:7: Exported.lib_internal_used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used: Not detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used ./examples/using_dune/reduced_lib/values_in_submodules.mli:10: Exported.lib_internal_externally_used ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:2: Exported.used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Not detected @@ -268,46 +226,27 @@ ./examples/using_dune/reduced_lib/values_no_intf.ml:12: lib_internal_internally_used ./examples/using_dune/reduced_lib/values_no_intf.ml:13: lib_internal_externally_used -./examples/using_dune/unwrapped_lib/obj/with_class.mli:33: fun_class_factory: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:5: used_fun_with_single_always_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Not detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Not detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:14: externally_used_fun_with_single_never_used_opt_arg ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:16: externally_used_fun_with_single_always_used_opt_arg -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:20: multiple_never_used_opt_args: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:22: multiple_always_used_opt_args: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:1: partially_applied_with_never_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:3: partially_applied_with_always_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:7: shadowing_never_used_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:8: shadowing_always_used_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:10: expect_fun_with_never_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig: Should not be detected + ./examples/using_dune/unwrapped_lib/style/style.ml:1: all -./examples/using_dune/unwrapped_lib/values/values.mli:1: used_int: Should not be detected -./examples/using_dune/unwrapped_lib/values/values.mli:3: internally_used_int: Not detected +./examples/using_dune/unwrapped_lib/values/values.mli:3: internally_used_int ./examples/using_dune/unwrapped_lib/values/values.mli:4: externally_used_int ./examples/using_dune/unwrapped_lib/values/values.mli:5: externally_used_as_parameter_int ./examples/using_dune/unwrapped_lib/values/values.mli:7: externally_written_bool_ref ./examples/using_dune/unwrapped_lib/values/values.mli:8: externally_matched_option ./examples/using_dune/unwrapped_lib/values/values.mli:10: externally_stored_in_ref_bool ./examples/using_dune/unwrapped_lib/values/values.mli:11: externally_stored_in_option_bool -./examples/using_dune/unwrapped_lib/values/values.mli:13: used_fun: Should not be detected -./examples/using_dune/unwrapped_lib/values/values.mli:15: internally_used_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values.mli:15: internally_used_fun ./examples/using_dune/unwrapped_lib/values/values.mli:16: externally_used_fun ./examples/using_dune/unwrapped_lib/values/values.mli:17: externally_used_as_parameter_fun -./examples/using_dune/unwrapped_lib/values/values.mli:19: used_alias_fun: Should not be detected ./examples/using_dune/unwrapped_lib/values/values.mli:21: externally_used_alias_fun -./examples/using_dune/unwrapped_lib/values/values.mli:23: partially_used_fun: Should not be detected -./examples/using_dune/unwrapped_lib/values/values.mli:24: used_closure: Should not be detected -./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure: Not detected +./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure ./examples/using_dune/unwrapped_lib/values/values.mli:27: externally_used_closure -./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Should not be detected -./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:5: Exported.externally_used_int ./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int ./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int @@ -325,46 +264,27 @@ ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:27: internally_used_closure ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:28: externally_used_closure -./examples/using_dune/wrapped_lib/obj/with_class.mli:33: fun_class_factory: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:5: used_fun_with_single_always_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Not detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Not detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:14: externally_used_fun_with_single_never_used_opt_arg ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:16: externally_used_fun_with_single_always_used_opt_arg -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:20: multiple_never_used_opt_args: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:22: multiple_always_used_opt_args: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:1: partially_applied_with_never_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:3: partially_applied_with_always_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:7: shadowing_never_used_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:8: shadowing_always_used_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:10: expect_fun_with_never_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig: Should not be detected + ./examples/using_dune/wrapped_lib/style/style.ml:1: all -./examples/using_dune/wrapped_lib/values/values.mli:1: used_int: Should not be detected -./examples/using_dune/wrapped_lib/values/values.mli:3: internally_used_int: Not detected +./examples/using_dune/wrapped_lib/values/values.mli:3: internally_used_int ./examples/using_dune/wrapped_lib/values/values.mli:4: externally_used_int ./examples/using_dune/wrapped_lib/values/values.mli:5: externally_used_as_parameter_int ./examples/using_dune/wrapped_lib/values/values.mli:7: externally_written_bool_ref ./examples/using_dune/wrapped_lib/values/values.mli:8: externally_matched_option ./examples/using_dune/wrapped_lib/values/values.mli:10: externally_stored_in_ref_bool ./examples/using_dune/wrapped_lib/values/values.mli:11: externally_stored_in_option_bool -./examples/using_dune/wrapped_lib/values/values.mli:13: used_fun: Should not be detected -./examples/using_dune/wrapped_lib/values/values.mli:15: internally_used_fun: Not detected +./examples/using_dune/wrapped_lib/values/values.mli:15: internally_used_fun ./examples/using_dune/wrapped_lib/values/values.mli:16: externally_used_fun ./examples/using_dune/wrapped_lib/values/values.mli:17: externally_used_as_parameter_fun -./examples/using_dune/wrapped_lib/values/values.mli:19: used_alias_fun: Should not be detected ./examples/using_dune/wrapped_lib/values/values.mli:21: externally_used_alias_fun -./examples/using_dune/wrapped_lib/values/values.mli:23: partially_used_fun: Should not be detected -./examples/using_dune/wrapped_lib/values/values.mli:24: used_closure: Should not be detected -./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure: Not detected +./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure ./examples/using_dune/wrapped_lib/values/values.mli:27: externally_used_closure -./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Should not be detected -./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Not detected +./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:5: Exported.externally_used_int ./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int ./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int @@ -385,8 +305,9 @@ ./examples/using_make/advanced/incl.ml:7: f ./examples/using_make/advanced/mod.mli:1: f ./examples/using_make/advanced/mod.mli:2: x -./examples/using_make/advanced/val.mli:1: x: Not detected -./examples/using_make/advanced/val.mli:2: y: Not detected +./examples/using_make/advanced/val.mli:1: x +./examples/using_make/advanced/val.mli:2: y + ./examples/using_make/baz.mli:2: t ./examples/using_make/cond_sel.ml:9: f ./examples/using_make/cond_sel.ml:11: g @@ -401,24 +322,25 @@ ./examples/using_make/dir/hidden_opt_use.ml:1: f ./examples/using_make/dir/hidden_opt_use.ml:3: apply ./examples/using_make/dir/match_opt.ml:3: m -./examples/using_make/dir/mod.mli:10: M.f: Not detected +./examples/using_make/dir/mod.mli:10: M.f ./examples/using_make/dir/partial.ml:5: g ./examples/using_make/dir/ref_fn.ml:5: g ./examples/using_make/dir/ref_opt.ml:7: g ./examples/using_make/foo.mli:1: x ./examples/using_make/fooFn.mli:1: f -./examples/using_make/functor.mli:2: M.f: Not detected +./examples/using_make/functor.mli:2: M.f ./examples/using_make/if_end.ml:1: f ./examples/using_make/if_end.ml:3: g ./examples/using_make/if_end.ml:5: h ./examples/using_make/letIn.mli:1: f -./examples/using_make/mod_alias.mli:2: M1.id: Not detected -./examples/using_make/mod_alias.mli:6: M2.id: Not detected -./examples/using_make/obj/class.mli:9: f: Not detected +./examples/using_make/mod_alias.mli:2: M1.id +./examples/using_make/mod_alias.mli:6: M2.id + +./examples/using_make/obj/class.mli:9: f ./examples/using_make/obj/fun_class.ml:8: f ./examples/using_make/obj/fun_obj_param.ml:7: app_m -./examples/using_make/obj/inher.mli:13: f: Not detected +./examples/using_make/obj/inher.mli:13: f ./examples/using_make/obj/obj_inher.ml:7: o ./examples/using_make/obj/obj_inher.ml:12: o4 ./examples/using_make/obj/obj_inher.ml:17: o2 @@ -429,20 +351,19 @@ ./examples/using_make/opt_in_opt.ml:5: baz ./examples/using_make/partial_opt.ml:1: f ./examples/using_make/useless_opt.ml:1: foo -./examples/using_make/variant.mli:5: f: Not detected +./examples/using_make/variant.mli:5: f -------- .>-> ALMOST UNUSED EXPORTED VALUES: Called 2 time(s): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./examples/docs/exported_values/hello_world/hello_world_lib.mli:4: world -./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:4: world: Not detected +./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:4: world ./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:4: world -./examples/using_dune/preprocessed_lib/preprocessed.mli:2: used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate: Should not be detected -./examples/using_dune/preprocessed_lib/preprocessed.mli:31: exported_f: Not detected -./examples/using_dune/preprocessed_lib/preprocessed.mli:38: internally_used_f: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:2: used +./examples/using_dune/preprocessed_lib/preprocessed.mli:31: exported_f +./examples/using_dune/preprocessed_lib/preprocessed.mli:38: internally_used_f ./examples/using_dune/preprocessed_lib/preprocessed.mli:44: externally_used_f ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:3: used ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:53: f @@ -451,10 +372,10 @@ ./examples/using_dune/reduced_lib/values.mli:1: used: Not detected ./examples/using_dune/reduced_lib/values.mli:3: internally_used: Not detected -./examples/using_dune/reduced_lib/values.mli:6: lib_internal_used: Not detected +./examples/using_dune/reduced_lib/values.mli:6: lib_internal_used ./examples/using_dune/reduced_lib/values_in_submodules.mli:2: Exported.used: Not detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:4: Exported.internally_used: Not detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:7: Exported.lib_internal_used: Not detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:7: Exported.lib_internal_used ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:2: Exported.used: Not detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:4: Exported.internally_used: Not detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:7: Exported.lib_internal_used @@ -462,78 +383,58 @@ ./examples/using_dune/reduced_lib/values_no_intf.ml:3: internally_used: Not detected ./examples/using_dune/reduced_lib/values_no_intf.ml:10: lib_internal_used -./examples/using_dune/unwrapped_lib/obj/with_class.mli:21: basics_factory: Should not be detected -./examples/using_dune/unwrapped_lib/obj/with_class.mli:33: fun_class_factory: Not detected -./examples/using_dune/unwrapped_lib/opt_args/mixed_args.mli:1: interlaced_mandatory_and_opt: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/mixed_args.mli:3: interlaced_labeled_and_opt: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/mixed_args.mli:7: interlaced_mandatory_labeled_and_opt: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg: Not detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg: Not detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:5: used_fun_with_single_always_used_opt_arg: Not detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:6: used_fun_with_single_sometimes_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:12: internally_used_fun_with_single_sometimes_used_opt_arg: Not detected +./examples/using_dune/unwrapped_lib/obj/with_class.mli:33: fun_class_factory + +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:5: used_fun_with_single_always_used_opt_arg +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:12: internally_used_fun_with_single_sometimes_used_opt_arg ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:18: externally_used_fun_with_single_sometimes_used_opt_arg -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:20: multiple_never_used_opt_args: Not detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:22: multiple_always_used_opt_args: Not detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:26: multiple_nas_used_opt_args: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:28: multiple_ans_used_opt_args: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:30: multiple_sna_used_opt_args: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:32: multiple_san_used_opt_args: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:34: multiple_nsa_used_opt_args: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:36: multiple_asn_used_opt_args: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:1: partially_applied_with_never_used_opt_arg: Not detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:3: partially_applied_with_always_used_opt_arg: Not detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:5: partially_applied_with_sometimes_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:7: shadowing_never_used_arg: Not detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:8: shadowing_always_used_arg: Not detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:10: expect_fun_with_never_used_opt_arg: Not detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg: Not detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig: Not detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig: Not detected -./examples/using_dune/unwrapped_lib/values/values.mli:1: used_int: Not detected -./examples/using_dune/unwrapped_lib/values/values.mli:13: used_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values.mli:19: used_alias_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values.mli:24: used_closure: Not detected -./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Not detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:20: multiple_never_used_opt_args +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:22: multiple_always_used_opt_args +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:1: partially_applied_with_never_used_opt_arg +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:3: partially_applied_with_always_used_opt_arg +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:7: shadowing_never_used_arg +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:8: shadowing_always_used_arg +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:10: expect_fun_with_never_used_opt_arg +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig + +./examples/using_dune/unwrapped_lib/values/values.mli:1: used_int +./examples/using_dune/unwrapped_lib/values/values.mli:13: used_fun +./examples/using_dune/unwrapped_lib/values/values.mli:19: used_alias_fun +./examples/using_dune/unwrapped_lib/values/values.mli:24: used_closure +./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:2: Exported.used_int ./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:2: Exported.used_int ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:1: used_int ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:14: used_fun ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:21: used_alias_fun ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:26: used_closure -./examples/using_dune/wrapped_lib/obj/with_class.mli:21: basics_factory: Should not be detected -./examples/using_dune/wrapped_lib/obj/with_class.mli:33: fun_class_factory: Not detected -./examples/using_dune/wrapped_lib/opt_args/mixed_args.mli:1: interlaced_mandatory_and_opt: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/mixed_args.mli:3: interlaced_labeled_and_opt: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/mixed_args.mli:7: interlaced_mandatory_labeled_and_opt: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg: Not detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg: Not detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:5: used_fun_with_single_always_used_opt_arg: Not detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:6: used_fun_with_single_sometimes_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:12: internally_used_fun_with_single_sometimes_used_opt_arg: Not detected +./examples/using_dune/wrapped_lib/obj/with_class.mli:33: fun_class_factory + +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:5: used_fun_with_single_always_used_opt_arg +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:12: internally_used_fun_with_single_sometimes_used_opt_arg ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:18: externally_used_fun_with_single_sometimes_used_opt_arg -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:20: multiple_never_used_opt_args: Not detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:22: multiple_always_used_opt_args: Not detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:26: multiple_nas_used_opt_args: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:28: multiple_ans_used_opt_args: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:30: multiple_sna_used_opt_args: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:32: multiple_san_used_opt_args: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:34: multiple_nsa_used_opt_args: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:36: multiple_asn_used_opt_args: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:1: partially_applied_with_never_used_opt_arg: Not detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:3: partially_applied_with_always_used_opt_arg: Not detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:5: partially_applied_with_sometimes_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:7: shadowing_never_used_arg: Not detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:8: shadowing_always_used_arg: Not detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:10: expect_fun_with_never_used_opt_arg: Not detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg: Not detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig: Not detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig: Not detected -./examples/using_dune/wrapped_lib/values/values.mli:1: used_int: Not detected -./examples/using_dune/wrapped_lib/values/values.mli:13: used_fun: Not detected -./examples/using_dune/wrapped_lib/values/values.mli:19: used_alias_fun: Not detected -./examples/using_dune/wrapped_lib/values/values.mli:24: used_closure: Not detected -./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Not detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:20: multiple_never_used_opt_args +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:22: multiple_always_used_opt_args +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:1: partially_applied_with_never_used_opt_arg +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:3: partially_applied_with_always_used_opt_arg +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:7: shadowing_never_used_arg +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:8: shadowing_always_used_arg +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:10: expect_fun_with_never_used_opt_arg +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig + +./examples/using_dune/wrapped_lib/values/values.mli:1: used_int +./examples/using_dune/wrapped_lib/values/values.mli:13: used_fun +./examples/using_dune/wrapped_lib/values/values.mli:19: used_alias_fun +./examples/using_dune/wrapped_lib/values/values.mli:24: used_closure +./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:2: Exported.used_int ./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:2: Exported.used_int ./examples/using_dune/wrapped_lib/values/values_no_intf.ml:1: used_int ./examples/using_dune/wrapped_lib/values/values_no_intf.ml:14: used_fun @@ -548,16 +449,16 @@ ./examples/using_make/dir/ref_opt.ml:1: f ./examples/using_make/dir/ref_opt.ml:5: r -./examples/using_make/exported.mli:6: M1.five: Not detected -./examples/using_make/exported.mli:15: M2.five: Not detected -./examples/using_make/functor.mli:7: F.g: Not detected -./examples/using_make/functor.mli:11: N.g: Not detected -./examples/using_make/obj/class.mli:7: o: Not detected +./examples/using_make/exported.mli:6: M1.five +./examples/using_make/exported.mli:15: M2.five +./examples/using_make/functor.mli:7: F.g +./examples/using_make/functor.mli:11: N.g + +./examples/using_make/obj/class.mli:7: o ./examples/using_make/obj/fun_obj_param.ml:1: f -./examples/using_make/obj/inher.mli:11: o: Not detected +./examples/using_make/obj/inher.mli:11: o ./examples/using_make/obj/object.ml:1: o -./examples/using_make/opt/sig_struct.ml:6: f: Should not be detected ./examples/using_make/opt_in_opt.ml:1: foo ./examples/using_make/unused_fn.ml:1: f -------- @@ -565,30 +466,28 @@ .>-> ALMOST UNUSED EXPORTED VALUES: Called 3 time(s): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:24: multiple_sometimes_used_opt_args: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:19: aliased_fun -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:24: multiple_sometimes_used_opt_args: Should not be detected ./examples/using_dune/wrapped_lib/values/values_no_intf.ml:19: aliased_fun ./examples/using_make/dir/anonFn2.mli:1: f ./examples/using_make/dir/anonFn2.mli:2: g ./examples/using_make/dir/match_opt.ml:1: f -./examples/using_make/dir/refFn.mli:1: r: Should not be detected ./examples/using_make/dir/ref_fn.ml:1: f -./examples/using_make/exported.mli:10: F.plus_five: Not detected -./examples/using_make/exported.mli:16: M2.plus_five: Not detected +./examples/using_make/exported.mli:10: F.plus_five +./examples/using_make/exported.mli:16: M2.plus_five ./examples/using_make/let_in.ml:1: complicated -./examples/using_make/opt/sig_struct.ml:6: f: Not detected +./examples/using_make/opt/sig_struct.ml:6: f + Nothing else to report in this section -------------------------------------------------------------------------------- .> UNUSED METHODS: ================= -./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:1: unused#unused @@ -598,14 +497,15 @@ Nothing else to report in this section ./examples/using_dune/unwrapped_lib/obj/with_class.mli:25: fun_class#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:35: _self_used#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:41: _self_used_fun_class#unused -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int + ./examples/using_dune/wrapped_lib/obj/with_class.mli:1: unused#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#never_used_fun ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#never_used_int @@ -613,14 +513,15 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/with_class.mli:25: fun_class#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:35: _self_used#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:41: _self_used_fun_class#unused -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int + ./examples/using_make/obj/class.mli:1: c#h ./examples/using_make/obj/class_type.mli:9: c#h ./examples/using_make/obj/coerce.mli:6: p#f @@ -646,39 +547,41 @@ Nothing else to report in this section .>-> ALMOST UNUSED METHODS: Called 1 time(s): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#externally_used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#internally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#externally_used +./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#internally_used ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#externally_used ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#internally_used ./examples/using_dune/unwrapped_lib/obj/with_class.mli:35: _self_used#used ./examples/using_dune/unwrapped_lib/obj/with_class.mli:41: _self_used_fun_class#used -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#externally_used_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#externally_used_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#internally_used_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#internally_used_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#externally_used_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#externally_used_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#internally_used_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#internally_used_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#used_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#used_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#externally_used_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#externally_used_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#internally_used_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#internally_used_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#externally_used_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#externally_used_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#internally_used_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#internally_used_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#used_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#used_int + ./examples/using_dune/wrapped_lib/obj/with_class.mli:35: _self_used#used ./examples/using_dune/wrapped_lib/obj/with_class.mli:41: _self_used_fun_class#used -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#externally_used_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#externally_used_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#internally_used_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#internally_used_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#externally_used_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#externally_used_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#internally_used_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#internally_used_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#externally_used_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#externally_used_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#internally_used_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#internally_used_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#externally_used_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#externally_used_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#internally_used_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#internally_used_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_int + ./examples/using_make/advanced/func.mli:3: M.c#f ./examples/using_make/advanced/mod.mli:4: p#f @@ -710,7 +613,7 @@ Nothing else to report in this section .>-> ALMOST UNUSED METHODS: Called 2 time(s): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#used ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#used ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#externally_used_fun @@ -720,10 +623,11 @@ Nothing else to report in this section ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#sometimes_used_fun ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#sometimes_used_int ./examples/using_dune/unwrapped_lib/obj/with_class.mli:25: fun_class#used -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#used_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#used_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#used_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#used_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#used_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#used_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#used_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#used_int + ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#externally_used_fun ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#externally_used_int ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#internally_used_fun @@ -731,10 +635,11 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#sometimes_used_fun ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#sometimes_used_int ./examples/using_dune/wrapped_lib/obj/with_class.mli:25: fun_class#used -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#used_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#used_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#used_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#used_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#used_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#used_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#used_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#used_int + ./examples/using_make/obj/class_type.mli:7: p#g ./examples/using_make/obj/coerce.mli:8: c#f ./examples/using_make/obj/named.mli:1: p1#f @@ -1072,8 +977,6 @@ Nothing else to report in this section ./examples/using_make/if_end.ml:5: ?b ./examples/using_make/letIn.mli:1: ?a ./examples/using_make/let_in.ml:1: ?a -./examples/using_make/opt/sig_struct.ml:6: ?x: Should not be detected -./examples/using_make/opt/sig_struct.ml:11: ?x: Should not be detected ./examples/using_make/opt_in_opt.ml:1: ?a ./examples/using_make/opt_in_opt.ml:5: ?a ./examples/using_make/partial_opt.ml:1: ?a @@ -1169,7 +1072,8 @@ Nothing else to report in this section ./examples/using_make/dir/ref_fn.ml:1: ?b (2/3 calls) ./examples/using_make/matchopt.ml:1: ?x (3/4 calls) -./examples/using_make/opt/sig_struct.ml:2: ?x (2/3 calls): Not detected +./examples/using_make/opt/sig_struct.ml:2: ?x (2/3 calls) + ./examples/using_make/opt_in_opt.ml:1: ?b (1/2 calls) -------- @@ -1287,7 +1191,6 @@ Nothing else to report in this section ./examples/using_make/foo.ml:1: ?a ./examples/using_make/letIn.mli:1: ?b ./examples/using_make/let_in.ml:1: ?c -./examples/using_make/opt/sig_struct.ml:2: ?x: Should not be detected ./examples/using_make/opt_in_opt.ml:2: ?a ./examples/using_make/opt_in_opt.ml:2: ?b ./examples/using_make/record.ml:12: ?b @@ -1453,7 +1356,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 1274 -Success: 975 -Failed: 299 -Ratio: 76.5306122449% +Total: 1153 +Success: 1116 +Failed: 37 +Ratio: 96.790980052% diff --git a/src/deadCode.ml b/src/deadCode.ml index f4e27cec..62acbc45 100644 --- a/src/deadCode.ml +++ b/src/deadCode.ml @@ -496,8 +496,8 @@ let load_file fn state = in let process_implementation fn = last_loc := Lexing.dummy_pos; - if state.State.config.verbose then - Printf.eprintf "Scanning implementation %s\n%!" fn; + if state.State.config.verbose then + Printf.eprintf "Scanning implementation from %s\n%!" fn; init_and_continue state fn (fun state -> match state.file_infos.cmt_infos with | None -> bad_files := fn :: !bad_files @@ -506,13 +506,7 @@ let load_file fn state = let uid_decl_dep_to_loc_pair (_dep_kind, uid_def, uid_decl) = let ( let* ) x f = Option.bind x f in let loc_opt_of_uid uid = - let* decl = - Uid.Tbl.find_opt cmt_infos.cmt_uid_to_decl uid - in - match decl with - | Value {val_loc = {loc_start; loc_ghost = false; _}; _} -> - Some loc_start - | _ -> None + Uid.Tbl.find_opt state.signature.uid_to_loc uid in let* def_loc = loc_opt_of_uid uid_def in let* decl_loc = loc_opt_of_uid uid_decl in diff --git a/src/state/file_infos.ml b/src/state/file_infos.ml index cacfc55f..fbc610bd 100644 --- a/src/state/file_infos.ml +++ b/src/state/file_infos.ml @@ -53,8 +53,9 @@ let init_from_cm_file ~orig cm_file = init_from_all_cm_infos ~orig ~cm_file cmi_infos cmt_infos |> Result.ok +let ( let* ) x f = Result.bind x f + let init cm_file = - let ( let* ) x f = Result.bind x f in let* orig = match Filename.extension cm_file with | ".cmt" -> Result.ok `Cmt @@ -89,15 +90,22 @@ let change_file file_infos cm_file = | ".cmt", {cmt_infos=Some cmt_infos; cmi_infos; cmti_infos; _} -> let res = init_from_all_cm_infos ~orig:`Cmt ~cm_file cmi_infos cmt_infos - in + in Result.ok {res with cmi_infos; cmti_infos} | ".cmti", {cmti_infos=Some cmti_infos; cmi_infos; cmt_infos; _} -> let res = init_from_all_cm_infos ~orig:`Cmti ~cm_file cmi_infos cmti_infos in Result.ok {res with cmt_infos} - | _ -> (* corresponding info is None or invlaid extension *) - init cm_file + | _, {cmi_infos; cmt_infos; cmti_infos; _} -> (* corresponding info is None or invalid extension *) + let* res = init cm_file in + let choose opt1 opt2 = + if Option.is_some opt1 then opt1 else opt2 + in + let cmi_infos = choose res.cmi_infos cmi_infos in + let cmt_infos = choose res.cmt_infos cmt_infos in + let cmti_infos = choose res.cmti_infos cmti_infos in + Result.ok {res with cmi_infos; cmt_infos; cmti_infos} let has_sourcepath file_infos = Option.is_some file_infos.sourcepath diff --git a/src/state/signature.ml b/src/state/signature.ml new file mode 100644 index 00000000..efd295e8 --- /dev/null +++ b/src/state/signature.ml @@ -0,0 +1,69 @@ +module UidTbl = Shape.Uid.Tbl + +type t = { + uid_to_loc : Lexing.position Shape.Uid.Tbl.t; +} + +let empty () = + let uid_to_loc = + (* TODO: 512 is completely arbitrary. Evaluate a generally good size ? *) + UidTbl.create 512 + in + {uid_to_loc} + +let fill_from_structure t (structure : Typedtree.structure) = + let open Types in + let rec fill_from_signature_item = function + | Sig_value (_, {val_loc; val_uid; _}, _) -> + UidTbl.replace t.uid_to_loc val_uid val_loc.loc_start + | Sig_module (_, _, {md_type = modtype; _}, _, _) + | Sig_modtype (_, {mtd_type = Some modtype; _}, _) -> + Utils.signature_of_modtype modtype + |> fill_from_signature + | _ -> () + and fill_from_signature s = + List.iter fill_from_signature_item s + in + let iterator = + let super = Tast_iterator.default_iterator in + let structure_item self struct_item = + let open Typedtree in + begin match struct_item.str_desc with + | Tstr_include {incl_type; _} -> fill_from_signature incl_type + | _ -> () + end; + super.Tast_iterator.structure_item self struct_item + in + {super with structure_item} + in + iterator.structure iterator structure; + t + +let fill_from_cmt_infos t cmt_infos = + let open Typedtree in + let loc_of_item_decl = function + | Value {val_loc = loc; _} + | Value_binding {vb_pat = {pat_loc = loc; _}; _} -> + Some loc.loc_start + | _ -> None + in + let add_uid_loc uid item_decl = + let loc = loc_of_item_decl item_decl in + Option.iter (UidTbl.replace t.uid_to_loc uid) loc + in + Uid.Tbl.iter add_uid_loc cmt_infos.Cmt_format.cmt_uid_to_decl; + t + +let init file_infos = + match file_infos.File_infos.cmt_infos with + | None -> Result.error "No cmt_infos available" + | Some ({cmt_annots = Implementation structure; _} as cmt_infos) -> ( + let res = fill_from_structure (empty ()) structure in + let res = fill_from_cmt_infos res cmt_infos in + match file_infos.cmti_infos with + | None -> Result.ok res + | Some cmti_infos -> + fill_from_cmt_infos res cmti_infos + |> Result.ok + ) + | Some _ -> Result.error "No implementation found in cmt_infos" diff --git a/src/state/signature.mli b/src/state/signature.mli new file mode 100644 index 00000000..2a3738f4 --- /dev/null +++ b/src/state/signature.mli @@ -0,0 +1,15 @@ +type t = { + uid_to_loc : Lexing.position Shape.Uid.Tbl.t; + (** Maps from uids found in the [cmt]'s structure and the + [cmt_uid_decl_to_dep] fields in [.cmt] and [.cmti] to their locations + in source files. *) +} + +val empty : unit -> t (** No signature read *) + +val init : File_infos.t -> (t, string) result +(** [init file_infos] expects [file_infos] to be properly [Filen_infos.init]'ed. + It reads the [cmt_infos] to fill out the [uid_to_loc] table. + It returns an [Ok t] with [t] on success. + In case the [cmt_infos] is missing, it returns an [Err msg] with msg a string + describing the issue. *) diff --git a/src/state/state.ml b/src/state/state.ml index 0caa2a0e..2d39559b 100644 --- a/src/state/state.ml +++ b/src/state/state.ml @@ -3,11 +3,13 @@ module File_infos = File_infos type t = { config : Config.t ; file_infos : File_infos.t + ; signature : Signature.t } let init config = { config ; file_infos = File_infos.empty + ; signature = Signature.empty () } let update_config config state = @@ -18,21 +20,24 @@ let change_file state cm_file = let equal_no_ext filename1 filename2 = let no_ext1 = Filename.remove_extension filename1 in let no_ext2 = Filename.remove_extension filename2 in - no_ext1 = no_ext2 + String.equal no_ext1 no_ext2 in - if file_infos.cm_file = cm_file then + if String.equal file_infos.cm_file cm_file then Result.ok state else if equal_no_ext file_infos.cm_file cm_file then let file_infos = File_infos.change_file file_infos cm_file in Result.map (fun file_infos -> {state with file_infos}) file_infos else - let file_infos = File_infos.init cm_file in - Result.map (fun file_infos -> {state with file_infos}) file_infos + let ( let* ) x f = Result.bind x f in + let* file_infos = File_infos.init cm_file in + let* signature = Signature.init file_infos in + Result.ok {state with file_infos; signature} (** Analysis' state *) let current = ref { config = Config.default_config ; file_infos = File_infos.empty + ; signature = Signature.empty () } let get_current () = !current diff --git a/src/state/state.mli b/src/state/state.mli index f9c0bd28..da5405d7 100644 --- a/src/state/state.mli +++ b/src/state/state.mli @@ -5,6 +5,9 @@ module File_infos = File_infos type t = { config : Config.t (** Configuration of the analysis *) ; file_infos : File_infos.t (** Info about the file being analyzed *) + ; signature : Signature.t + (** Data extracted or built using the current compialtion unit's + signature *) } val init : Config.t -> t From ba2ead77928cc8ffa045a3f6d2e33f5b13b6e425 Mon Sep 17 00:00:00 2001 From: Corentin De Souza <9597216+fantazio@users.noreply.github.com> Date: Thu, 11 Dec 2025 11:59:48 +0100 Subject: [PATCH 06/12] [src][state] expose `location_dependencies` through `state.file_infos` Rather than adding a `signature` field to the state to hold a `uid_to_loc` table to then use in `DeadCode.load_file` to convert uids into locations, to then convert `cmt_declaration_dependencies` into a list of pairs of locations, directly construct that list and store along with the `file_infos`. This move is more consistent with the nature, usage and provenance of the information : it is created using info in `cmt_infos` and `cmti_infos` to replace the `cmt_value_dependencies` field that existed prior to OCaml 5.3, and should only live as long the corresponding `cmt_infos` live. --- src/deadCode.ml | 19 ++----- src/state/file_infos.ml | 38 ++++++++++---- src/state/file_infos.mli | 8 +-- src/state/location_dependencies.ml | 79 +++++++++++++++++++++++++++++ src/state/location_dependencies.mli | 12 +++++ src/state/signature.ml | 69 ------------------------- src/state/signature.mli | 15 ------ src/state/state.ml | 10 ++-- src/state/state.mli | 3 -- 9 files changed, 131 insertions(+), 122 deletions(-) create mode 100644 src/state/location_dependencies.ml create mode 100644 src/state/location_dependencies.mli delete mode 100644 src/state/signature.ml delete mode 100644 src/state/signature.mli diff --git a/src/deadCode.ml b/src/deadCode.ml index 62acbc45..b6150420 100644 --- a/src/deadCode.ml +++ b/src/deadCode.ml @@ -501,26 +501,13 @@ let load_file fn state = init_and_continue state fn (fun state -> match state.file_infos.cmt_infos with | None -> bad_files := fn :: !bad_files - | Some ({cmt_annots = Implementation x; _} as cmt_infos) -> + | Some {cmt_annots = Implementation x; _} -> regabs state; - let uid_decl_dep_to_loc_pair (_dep_kind, uid_def, uid_decl) = - let ( let* ) x f = Option.bind x f in - let loc_opt_of_uid uid = - Uid.Tbl.find_opt state.signature.uid_to_loc uid - in - let* def_loc = loc_opt_of_uid uid_def in - let* decl_loc = loc_opt_of_uid uid_decl in - Some (def_loc, decl_loc) - in - let value_dep = - cmt_infos.cmt_declaration_dependencies - |> List.filter_map uid_decl_dep_to_loc_pair - in let prepare (loc1, loc2) = DeadObj.add_equal loc1 loc2; VdNode.merge_locs ~force:true loc2 loc1 in - List.iter prepare value_dep; + List.iter prepare state.file_infos.location_dependencies; ignore (collect_references.Tast_mapper.structure collect_references x); let loc_dep = if Config.must_report_section state.config.sections.exported_values then @@ -536,7 +523,7 @@ let load_file fn state = Some (loc1, loc2) else None ) - value_dep + state.file_infos.location_dependencies else [] in eof loc_dep diff --git a/src/state/file_infos.ml b/src/state/file_infos.ml index fbc610bd..d68ecfac 100644 --- a/src/state/file_infos.ml +++ b/src/state/file_infos.ml @@ -1,21 +1,23 @@ type t = { - cm_file : string; - sourcepath : string option; builddir : string; - modname : string; + cm_file : string; cmi_infos : Cmi_format.cmi_infos option; cmt_infos : Cmt_format.cmt_infos option; cmti_infos : Cmt_format.cmt_infos option; + location_dependencies : Location_dependencies.t; + modname : string; + sourcepath : string option; } let empty = { - cm_file = ""; - sourcepath = None; builddir = "!!UNKNOWN_BUILDDIR!!"; - modname = "!!UNKNOWN_MODNAME!!"; + cm_file = ""; cmi_infos = None; cmt_infos = None; cmti_infos = None; + location_dependencies = Location_dependencies.empty; + modname = "!!UNKNOWN_MODNAME!!"; + sourcepath = None; } (** [init_from_all_cm_infos ~orig ~cm_file cmi_infos cmt_infos] creates a [t] with: @@ -36,7 +38,13 @@ let empty = { | `Cmt -> Some cmt_infos, None | `Cmti -> None, Some cmt_infos in - {cm_file; sourcepath; builddir; modname; cmi_infos; cmt_infos; cmti_infos} + {empty with builddir; + cm_file; + cmi_infos; + cmt_infos; + cmti_infos; + modname; + sourcepath} (** [init_from_cm_file ~orig cm_file] returns an [Ok t] with [t] filled using the [cm_file] (see [init_from_cmt_infos]). @@ -81,7 +89,15 @@ let init cm_file = in file_infos.cmi_infos, cmt_infos, file_infos.cmti_infos in - Result.ok {file_infos with cmi_infos; cmt_infos; cmti_infos} + let* location_dependencies = + match orig with + | `Cmt -> Location_dependencies.init cmt_infos cmti_infos + | `Cmti -> Result.ok Location_dependencies.empty + in + Result.ok {file_infos with cmi_infos; + cmt_infos; + cmti_infos; + location_dependencies} let change_file file_infos cm_file = let no_ext = Filename.remove_extension cm_file in @@ -91,7 +107,11 @@ let change_file file_infos cm_file = let res = init_from_all_cm_infos ~orig:`Cmt ~cm_file cmi_infos cmt_infos in - Result.ok {res with cmi_infos; cmti_infos} + let res = {res with cmi_infos; cmti_infos} in + let* location_dependencies = + Location_dependencies.init res.cmt_infos res.cmti_infos + in + Result.ok {res with location_dependencies} | ".cmti", {cmti_infos=Some cmti_infos; cmi_infos; cmt_infos; _} -> let res = init_from_all_cm_infos ~orig:`Cmti ~cm_file cmi_infos cmti_infos diff --git a/src/state/file_infos.mli b/src/state/file_infos.mli index 2807c9e7..9ec37d51 100644 --- a/src/state/file_infos.mli +++ b/src/state/file_infos.mli @@ -1,13 +1,15 @@ (** Information about a analyzable file ([.cmti] or [.cmt] file) *) type t = { - cm_file : string; (** The filepath currently analyzed *) - sourcepath : string option; (** The path to the associated source file *) builddir : string; (** The [cmt_builddir] *) - modname : string; (** Either [cmti_name] or [cmt_modname] *) + cm_file : string; (** The filepath currently analyzed *) cmi_infos : Cmi_format.cmi_infos option; cmt_infos : Cmt_format.cmt_infos option; cmti_infos : Cmt_format.cmt_infos option; + location_dependencies : Location_dependencies.t; + (** Dependencies similar to [cmt_infos.cmt_value_dependencies] in OCaml 5.2 *) + modname : string; (** Either [cmti_name] or [cmt_modname] *) + sourcepath : string option; (** The path to the associated source file *) } val empty : t (** No file info *) diff --git a/src/state/location_dependencies.ml b/src/state/location_dependencies.ml new file mode 100644 index 00000000..44ca015f --- /dev/null +++ b/src/state/location_dependencies.ml @@ -0,0 +1,79 @@ +type t = (Lexing.position * Lexing.position) list + +let empty = [] + +module UidTbl = Shape.Uid.Tbl + +let fill_from_structure (structure : Typedtree.structure) res_uid_to_loc = + let open Types in + let rec fill_from_signature_item = function + | Sig_value (_, {val_loc; val_uid; _}, _) -> + UidTbl.replace res_uid_to_loc val_uid val_loc.loc_start + | Sig_module (_, _, {md_type = modtype; _}, _, _) + | Sig_modtype (_, {mtd_type = Some modtype; _}, _) -> + Utils.signature_of_modtype modtype + |> fill_from_signature + | _ -> () + and fill_from_signature s = + List.iter fill_from_signature_item s + in + let iterator = + let super = Tast_iterator.default_iterator in + let structure_item self struct_item = + let open Typedtree in + begin match struct_item.str_desc with + | Tstr_include {incl_type; _} -> fill_from_signature incl_type + | _ -> () + end; + super.Tast_iterator.structure_item self struct_item + in + {super with structure_item} + in + iterator.structure iterator structure; + res_uid_to_loc + +let fill_from_cmt_infos cmt_infos res_uid_to_loc = + let open Typedtree in + let loc_of_item_decl = function + | Value {val_loc = loc; _} + | Value_binding {vb_pat = {pat_loc = loc; _}; _} -> + Some loc.loc_start + | _ -> None + in + let add_uid_loc uid item_decl = + let loc = loc_of_item_decl item_decl in + Option.iter (UidTbl.replace res_uid_to_loc uid) loc + in + UidTbl.iter add_uid_loc cmt_infos.Cmt_format.cmt_uid_to_decl; + res_uid_to_loc + +let cmt_decl_dep_to_loc_dep cmt_decl_dep uid_to_loc = + let convert_pair (_dep_kind, uid_def, uid_decl) = + let ( let* ) x f = Option.bind x f in + let loc_opt_of_uid uid = + UidTbl.find_opt uid_to_loc uid + in + let* def_loc = loc_opt_of_uid uid_def in + let* decl_loc = loc_opt_of_uid uid_decl in + Some (def_loc, decl_loc) + in + List.filter_map convert_pair cmt_decl_dep + +let init cmt_infos cmti_infos = + match cmt_infos with + | None -> Result.error "No cmt_infos available" + | Some (Cmt_format.{cmt_annots = Implementation structure; _} as cmt_infos) -> ( + let fill_from_cmti_infos tbl = + match cmti_infos with + | None -> tbl + | Some cmti_infos -> fill_from_cmt_infos cmti_infos tbl + in + (* TODO: Evaluate a generally good size for the tbl ? *) + UidTbl.create 512 + |> fill_from_structure structure + |> fill_from_cmt_infos cmt_infos + |> fill_from_cmti_infos + |> cmt_decl_dep_to_loc_dep cmt_infos.cmt_declaration_dependencies + |> Result.ok + ) + | Some _ -> Result.error "No implementation found in cmt_infos" diff --git a/src/state/location_dependencies.mli b/src/state/location_dependencies.mli new file mode 100644 index 00000000..1b142b5b --- /dev/null +++ b/src/state/location_dependencies.mli @@ -0,0 +1,12 @@ +type t = (Lexing.position * Lexing.position) list + (** Dependencies similar to [cmt_infos.cmt_value_dependencies] in OCaml 5.2 *) + +val empty : t (** No signature read *) + +val init : Cmt_format.cmt_infos option -> Cmt_format.cmt_infos option -> (t, string) result +(** [init cmt_infos cmti_infos] expects [cmt_infos = Some _]. + It reads the [cmt_infos] and the |cmti_infos] to retrieve their + [cmt_declaration_dependencies] and convert them into a single [t]. + It returns an [Ok t] with [t] on success. + In case the [cmt_infos] is missing or does not contain an implementation, + it returns an [Err msg] with msg a string describing the issue. *) diff --git a/src/state/signature.ml b/src/state/signature.ml deleted file mode 100644 index efd295e8..00000000 --- a/src/state/signature.ml +++ /dev/null @@ -1,69 +0,0 @@ -module UidTbl = Shape.Uid.Tbl - -type t = { - uid_to_loc : Lexing.position Shape.Uid.Tbl.t; -} - -let empty () = - let uid_to_loc = - (* TODO: 512 is completely arbitrary. Evaluate a generally good size ? *) - UidTbl.create 512 - in - {uid_to_loc} - -let fill_from_structure t (structure : Typedtree.structure) = - let open Types in - let rec fill_from_signature_item = function - | Sig_value (_, {val_loc; val_uid; _}, _) -> - UidTbl.replace t.uid_to_loc val_uid val_loc.loc_start - | Sig_module (_, _, {md_type = modtype; _}, _, _) - | Sig_modtype (_, {mtd_type = Some modtype; _}, _) -> - Utils.signature_of_modtype modtype - |> fill_from_signature - | _ -> () - and fill_from_signature s = - List.iter fill_from_signature_item s - in - let iterator = - let super = Tast_iterator.default_iterator in - let structure_item self struct_item = - let open Typedtree in - begin match struct_item.str_desc with - | Tstr_include {incl_type; _} -> fill_from_signature incl_type - | _ -> () - end; - super.Tast_iterator.structure_item self struct_item - in - {super with structure_item} - in - iterator.structure iterator structure; - t - -let fill_from_cmt_infos t cmt_infos = - let open Typedtree in - let loc_of_item_decl = function - | Value {val_loc = loc; _} - | Value_binding {vb_pat = {pat_loc = loc; _}; _} -> - Some loc.loc_start - | _ -> None - in - let add_uid_loc uid item_decl = - let loc = loc_of_item_decl item_decl in - Option.iter (UidTbl.replace t.uid_to_loc uid) loc - in - Uid.Tbl.iter add_uid_loc cmt_infos.Cmt_format.cmt_uid_to_decl; - t - -let init file_infos = - match file_infos.File_infos.cmt_infos with - | None -> Result.error "No cmt_infos available" - | Some ({cmt_annots = Implementation structure; _} as cmt_infos) -> ( - let res = fill_from_structure (empty ()) structure in - let res = fill_from_cmt_infos res cmt_infos in - match file_infos.cmti_infos with - | None -> Result.ok res - | Some cmti_infos -> - fill_from_cmt_infos res cmti_infos - |> Result.ok - ) - | Some _ -> Result.error "No implementation found in cmt_infos" diff --git a/src/state/signature.mli b/src/state/signature.mli deleted file mode 100644 index 2a3738f4..00000000 --- a/src/state/signature.mli +++ /dev/null @@ -1,15 +0,0 @@ -type t = { - uid_to_loc : Lexing.position Shape.Uid.Tbl.t; - (** Maps from uids found in the [cmt]'s structure and the - [cmt_uid_decl_to_dep] fields in [.cmt] and [.cmti] to their locations - in source files. *) -} - -val empty : unit -> t (** No signature read *) - -val init : File_infos.t -> (t, string) result -(** [init file_infos] expects [file_infos] to be properly [Filen_infos.init]'ed. - It reads the [cmt_infos] to fill out the [uid_to_loc] table. - It returns an [Ok t] with [t] on success. - In case the [cmt_infos] is missing, it returns an [Err msg] with msg a string - describing the issue. *) diff --git a/src/state/state.ml b/src/state/state.ml index 2d39559b..645131ee 100644 --- a/src/state/state.ml +++ b/src/state/state.ml @@ -3,18 +3,17 @@ module File_infos = File_infos type t = { config : Config.t ; file_infos : File_infos.t - ; signature : Signature.t } let init config = { config ; file_infos = File_infos.empty - ; signature = Signature.empty () } let update_config config state = {state with config} + let change_file state cm_file = let file_infos = state.file_infos in let equal_no_ext filename1 filename2 = @@ -28,16 +27,13 @@ let change_file state cm_file = let file_infos = File_infos.change_file file_infos cm_file in Result.map (fun file_infos -> {state with file_infos}) file_infos else - let ( let* ) x f = Result.bind x f in - let* file_infos = File_infos.init cm_file in - let* signature = Signature.init file_infos in - Result.ok {state with file_infos; signature} + let file_infos = File_infos.init cm_file in + Result.map (fun file_infos -> {state with file_infos}) file_infos (** Analysis' state *) let current = ref { config = Config.default_config ; file_infos = File_infos.empty - ; signature = Signature.empty () } let get_current () = !current diff --git a/src/state/state.mli b/src/state/state.mli index da5405d7..f9c0bd28 100644 --- a/src/state/state.mli +++ b/src/state/state.mli @@ -5,9 +5,6 @@ module File_infos = File_infos type t = { config : Config.t (** Configuration of the analysis *) ; file_infos : File_infos.t (** Info about the file being analyzed *) - ; signature : Signature.t - (** Data extracted or built using the current compialtion unit's - signature *) } val init : Config.t -> t From aebe3078b5275ebe1b8a8f0706185beb5a7712c3 Mon Sep 17 00:00:00 2001 From: Corentin De Souza <9597216+fantazio@users.noreply.github.com> Date: Thu, 11 Dec 2025 16:03:49 +0100 Subject: [PATCH 07/12] [src][state][file_infos] update to more precise fields Only keep useful information from the cm*_infos rather than the whole structure. This makes clearer what is actually used from those and reduces the error surface. --- src/deadCode.ml | 12 +- src/state/file_infos.ml | 164 ++++++++++++++-------------- src/state/file_infos.mli | 8 +- src/state/location_dependencies.ml | 41 +++---- src/state/location_dependencies.mli | 15 ++- 5 files changed, 126 insertions(+), 114 deletions(-) diff --git a/src/deadCode.ml b/src/deadCode.ml index b6150420..3907822f 100644 --- a/src/deadCode.ml +++ b/src/deadCode.ml @@ -488,9 +488,9 @@ let load_file fn state = if state.State.config.verbose then Printf.eprintf "Scanning interface from %s\n%!" fn; init_and_continue state fn (fun state -> - match state.file_infos.cmi_infos with + match state.file_infos.cmi_sign with | None -> bad_files := fn :: !bad_files - | Some {cmi_sign; _} -> + | Some cmi_sign -> read_interface fn cmi_sign state ) in @@ -499,16 +499,17 @@ let load_file fn state = if state.State.config.verbose then Printf.eprintf "Scanning implementation from %s\n%!" fn; init_and_continue state fn (fun state -> - match state.file_infos.cmt_infos with + match state.file_infos.cmt_struct with | None -> bad_files := fn :: !bad_files - | Some {cmt_annots = Implementation x; _} -> + | Some structure -> regabs state; let prepare (loc1, loc2) = DeadObj.add_equal loc1 loc2; VdNode.merge_locs ~force:true loc2 loc1 in List.iter prepare state.file_infos.location_dependencies; - ignore (collect_references.Tast_mapper.structure collect_references x); + collect_references.Tast_mapper.structure collect_references structure + |> ignore; let loc_dep = if Config.must_report_section state.config.sections.exported_values then let sourceunit = @@ -527,7 +528,6 @@ let load_file fn state = else [] in eof loc_dep - | _ -> () (* todo: support partial_implementation? *) ) in let exclude filepath = Config.is_excluded filepath state.State.config in diff --git a/src/state/file_infos.ml b/src/state/file_infos.ml index d68ecfac..b013b3ca 100644 --- a/src/state/file_infos.ml +++ b/src/state/file_infos.ml @@ -1,9 +1,9 @@ type t = { builddir : string; cm_file : string; - cmi_infos : Cmi_format.cmi_infos option; - cmt_infos : Cmt_format.cmt_infos option; - cmti_infos : Cmt_format.cmt_infos option; + cmi_sign : Types.signature option; + cmt_struct : Typedtree.structure option; + cmti_uid_to_decl : Location_dependencies.uid_to_decl option; location_dependencies : Location_dependencies.t; modname : string; sourcepath : string option; @@ -12,120 +12,126 @@ type t = { let empty = { builddir = "!!UNKNOWN_BUILDDIR!!"; cm_file = ""; - cmi_infos = None; - cmt_infos = None; - cmti_infos = None; + cmi_sign = None; + cmt_struct = None; + cmti_uid_to_decl = None; location_dependencies = Location_dependencies.empty; modname = "!!UNKNOWN_MODNAME!!"; sourcepath = None; } -(** [init_from_all_cm_infos ~orig ~cm_file cmi_infos cmt_infos] creates a [t] with: - - information from [cmt_infos]; +(** [init_from_all_cm_infos ~cm_file ~cmi_infos cmt_infos] creates a [t] with: + - information from [cmt_infos] : [builddir], [modname], [sourcepath]; - [cm_file]; - - [cmi_infos]; - - [cmt_infos = Some cmt_infos] if [orig = `Cmt]; - - [cmti_infos = Some cmt_infos] if [orig = `Cmti]. *) - let init_from_all_cm_infos ~orig ~cm_file cmi_infos cmt_infos = + - [cmi_sign = Some cm_infos.cmi_sign] if [cmi_infos = Some _]; *) + let init_from_all_cm_infos ~cm_file ~cmi_infos cmt_infos = let builddir = cmt_infos.Cmt_format.cmt_builddir in let sourcepath = Option.map Utils.Filepath.remove_pp cmt_infos.cmt_sourcefile |> Option.map (Filename.concat builddir) in let modname = cmt_infos.cmt_modname in - let cmt_infos, cmti_infos = - match orig with - | `Cmt -> Some cmt_infos, None - | `Cmti -> None, Some cmt_infos - in + let cmi_sign = Option.map (fun Cmi_format.{cmi_sign; _} -> cmi_sign) cmi_infos in {empty with builddir; cm_file; - cmi_infos; - cmt_infos; - cmti_infos; + cmi_sign; modname; sourcepath} -(** [init_from_cm_file ~orig cm_file] returns an [Ok t] with [t] filled using - the [cm_file] (see [init_from_cmt_infos]). +(** [init_from_cm_file cm_file] returns an [Ok t] with [t] filled with general + info expected for both cmt and cmti files, using the [cm_file] (see + [init_from_all_cm_infos]). In case the file does not exist or it cannot be read (see [Cmt_format.read_cmt]) then it returns an [Err msg] with msg a string describing the issue. *) -let init_from_cm_file ~orig cm_file = +let init_from_cm_file cm_file = if not (Sys.file_exists cm_file) then Result.error (cm_file ^ ": file not found") else match Cmt_format.read cm_file with | exception _ -> Result.error (cm_file ^ ": error reading file") | _, None -> Result.error (cm_file ^ ": cmt_infos not found") | cmi_infos, Some cmt_infos -> - init_from_all_cm_infos ~orig ~cm_file cmi_infos cmt_infos - |> Result.ok + let file_infos = + init_from_all_cm_infos ~cm_file ~cmi_infos cmt_infos + in + Result.ok (file_infos, cmt_infos) let ( let* ) x f = Result.bind x f +let ( let+ ) x f = Result.map f x -let init cm_file = - let* orig = - match Filename.extension cm_file with - | ".cmt" -> Result.ok `Cmt - | ".cmti" -> Result.ok `Cmti - | _ -> Result.error (cm_file ^ ": not a .cmti or .cmt file") +let init_from_cmti_file cmti_file = + let+ file_infos, cmt_infos = init_from_cm_file cmti_file in + let cmti_uid_to_decl = Some cmt_infos.cmt_uid_to_decl in + {file_infos with cmti_uid_to_decl} + +let init_from_cmt_file cmt_file = + let* file_infos, cmt_infos = init_from_cm_file cmt_file in + let* cmt_struct = + match cmt_infos.cmt_annots with + | Implementation structure -> Result.ok structure + | _ -> Result.error (cmt_file ^ ": does not contain an implementation") in - let* file_infos = init_from_cm_file ~orig cm_file in - let cmi_infos, cmt_infos, cmti_infos = - let no_ext = Filename.remove_extension cm_file in - match orig with - | `Cmt -> - let cmi_infos, cmti_infos = - init_from_cm_file ~orig:`Cmti (no_ext ^ ".cmti") - |> Result.map (fun {cmi_infos; cmti_infos; _} -> cmi_infos, cmti_infos) - |> Result.value ~default:(file_infos.cmi_infos, file_infos.cmti_infos) - in - cmi_infos, file_infos.cmt_infos, cmti_infos - | `Cmti -> - let cmt_infos = - init_from_cm_file ~orig:`Cmt (no_ext ^ ".cmt") - |> Result.map (fun {cmt_infos; _} -> cmt_infos) - |> Result.value ~default:file_infos.cmt_infos - in - file_infos.cmi_infos, cmt_infos, file_infos.cmti_infos + let cmt_struct = Some cmt_struct in + (* Read the cmti if it exists. We always want to do it in case a user + specified the cmt before the cmti to ensure the location_dependencies + are idempotent. *) + let cmti_uid_to_decl = + let cmti_file = Filename.remove_extension cmt_file ^ ".cmti" in + match init_from_cmti_file cmti_file with + | Error _ -> None + | Ok file_infos -> file_infos.cmti_uid_to_decl + in + let+ location_dependencies = + Location_dependencies.init cmt_infos cmti_uid_to_decl in - let* location_dependencies = - match orig with - | `Cmt -> Location_dependencies.init cmt_infos cmti_infos - | `Cmti -> Result.ok Location_dependencies.empty + let file_infos = + {file_infos with cmt_struct; cmti_uid_to_decl; location_dependencies} in - Result.ok {file_infos with cmi_infos; - cmt_infos; - cmti_infos; - location_dependencies} + file_infos, cmt_infos + +let init cm_file = + match Filename.extension cm_file with + | ".cmt" -> + let+ file_infos, _ = init_from_cmt_file cm_file in + file_infos + | ".cmti" -> ( + (* Using cmt_infos is not critical. The intent is to mirror the behavior + on cmt files, where both cmt and cmti are read. *) + let filled_with_cmt_infos = + let cmt_file = Filename.remove_extension cm_file ^ ".cmt" in + let* file_infos, cmt_infos = init_from_cmt_file cmt_file in + let+ location_dependencies = + Location_dependencies.init cmt_infos file_infos.cmti_uid_to_decl + in + {file_infos with location_dependencies} + in + match filled_with_cmt_infos with + | Ok {cmt_struct; cmti_uid_to_decl; location_dependencies; _} -> + let+ res, _ = init_from_cm_file cm_file in + {res with cmt_struct; cmti_uid_to_decl; location_dependencies} + | Error _ -> init_from_cmti_file cm_file + ) + | _ -> Result.error (cm_file ^ ": not a .cmti or .cmt file") let change_file file_infos cm_file = let no_ext = Filename.remove_extension cm_file in assert(no_ext = Filename.remove_extension file_infos.cm_file); match Filename.extension cm_file, file_infos with - | ".cmt", {cmt_infos=Some cmt_infos; cmi_infos; cmti_infos; _} -> - let res = - init_from_all_cm_infos ~orig:`Cmt ~cm_file cmi_infos cmt_infos - in - let res = {res with cmi_infos; cmti_infos} in - let* location_dependencies = - Location_dependencies.init res.cmt_infos res.cmti_infos - in - Result.ok {res with location_dependencies} - | ".cmti", {cmti_infos=Some cmti_infos; cmi_infos; cmt_infos; _} -> - let res = - init_from_all_cm_infos ~orig:`Cmti ~cm_file cmi_infos cmti_infos - in - Result.ok {res with cmt_infos} - | _, {cmi_infos; cmt_infos; cmti_infos; _} -> (* corresponding info is None or invalid extension *) - let* res = init cm_file in - let choose opt1 opt2 = - if Option.is_some opt1 then opt1 else opt2 + | ".cmt", {cmt_struct = (Some _ as cs); cmi_sign; cmti_uid_to_decl; _} -> + let* res, cmt_infos = init_from_cm_file cm_file in + let+ location_dependencies = + match file_infos.location_dependencies with + | [] -> Location_dependencies.init cmt_infos cmti_uid_to_decl + | loc_dep -> (* They have already been computed *) + Result.ok loc_dep in - let cmi_infos = choose res.cmi_infos cmi_infos in - let cmt_infos = choose res.cmt_infos cmt_infos in - let cmti_infos = choose res.cmti_infos cmti_infos in - Result.ok {res with cmi_infos; cmt_infos; cmti_infos} + {res with cmt_struct = cs; cmi_sign; cmti_uid_to_decl; location_dependencies} + | ".cmti", {cmti_uid_to_decl = (Some _ as cutd); cmt_struct; location_dependencies; _} -> + let+ res, _ = init_from_cm_file cm_file in + {res with cmti_uid_to_decl = cutd; cmt_struct; location_dependencies} + | _ -> + (* invalid extension or the corresponding info is None *) + init cm_file let has_sourcepath file_infos = Option.is_some file_infos.sourcepath diff --git a/src/state/file_infos.mli b/src/state/file_infos.mli index 9ec37d51..9e381336 100644 --- a/src/state/file_infos.mli +++ b/src/state/file_infos.mli @@ -3,9 +3,11 @@ type t = { builddir : string; (** The [cmt_builddir] *) cm_file : string; (** The filepath currently analyzed *) - cmi_infos : Cmi_format.cmi_infos option; - cmt_infos : Cmt_format.cmt_infos option; - cmti_infos : Cmt_format.cmt_infos option; + cmi_sign : Types.signature option; (** Extracted from [cmi_infos] *) + cmt_struct : Typedtree.structure option; + (** Extracted from a cmt's [cmt_infos.cmt_annots] *) + cmti_uid_to_decl : Location_dependencies.uid_to_decl option; + (** Extracted from a cmti's [cmt_infos] *) location_dependencies : Location_dependencies.t; (** Dependencies similar to [cmt_infos.cmt_value_dependencies] in OCaml 5.2 *) modname : string; (** Either [cmti_name] or [cmt_modname] *) diff --git a/src/state/location_dependencies.ml b/src/state/location_dependencies.ml index 44ca015f..2ade7ffc 100644 --- a/src/state/location_dependencies.ml +++ b/src/state/location_dependencies.ml @@ -4,6 +4,8 @@ let empty = [] module UidTbl = Shape.Uid.Tbl +type uid_to_decl = Typedtree.item_declaration UidTbl.t + let fill_from_structure (structure : Typedtree.structure) res_uid_to_loc = let open Types in let rec fill_from_signature_item = function @@ -32,7 +34,7 @@ let fill_from_structure (structure : Typedtree.structure) res_uid_to_loc = iterator.structure iterator structure; res_uid_to_loc -let fill_from_cmt_infos cmt_infos res_uid_to_loc = +let fill_from_cmt_tbl uid_to_decl res_uid_to_loc = let open Typedtree in let loc_of_item_decl = function | Value {val_loc = loc; _} @@ -44,7 +46,7 @@ let fill_from_cmt_infos cmt_infos res_uid_to_loc = let loc = loc_of_item_decl item_decl in Option.iter (UidTbl.replace res_uid_to_loc uid) loc in - UidTbl.iter add_uid_loc cmt_infos.Cmt_format.cmt_uid_to_decl; + UidTbl.iter add_uid_loc uid_to_decl; res_uid_to_loc let cmt_decl_dep_to_loc_dep cmt_decl_dep uid_to_loc = @@ -59,21 +61,20 @@ let cmt_decl_dep_to_loc_dep cmt_decl_dep uid_to_loc = in List.filter_map convert_pair cmt_decl_dep -let init cmt_infos cmti_infos = - match cmt_infos with - | None -> Result.error "No cmt_infos available" - | Some (Cmt_format.{cmt_annots = Implementation structure; _} as cmt_infos) -> ( - let fill_from_cmti_infos tbl = - match cmti_infos with - | None -> tbl - | Some cmti_infos -> fill_from_cmt_infos cmti_infos tbl - in - (* TODO: Evaluate a generally good size for the tbl ? *) - UidTbl.create 512 - |> fill_from_structure structure - |> fill_from_cmt_infos cmt_infos - |> fill_from_cmti_infos - |> cmt_decl_dep_to_loc_dep cmt_infos.cmt_declaration_dependencies - |> Result.ok - ) - | Some _ -> Result.error "No implementation found in cmt_infos" +let init cmt_infos cmti_uid_to_decl = + match cmt_infos.Cmt_format.cmt_annots with + | Implementation structure -> + let fill_from_cmti_tbl tbl = + match cmti_uid_to_decl with + | None -> tbl + | Some cmti_uid_to_decl -> + fill_from_cmt_tbl cmti_uid_to_decl tbl + in + (* TODO: Evaluate a generally good size for the tbl ? *) + UidTbl.create 512 + |> fill_from_structure structure + |> fill_from_cmt_tbl cmt_infos.cmt_uid_to_decl + |> fill_from_cmti_tbl + |> cmt_decl_dep_to_loc_dep cmt_infos.cmt_declaration_dependencies + |> Result.ok + | _ -> Result.error "No implementation found in cmt_infos" diff --git a/src/state/location_dependencies.mli b/src/state/location_dependencies.mli index 1b142b5b..c6dc3fbc 100644 --- a/src/state/location_dependencies.mli +++ b/src/state/location_dependencies.mli @@ -3,10 +3,13 @@ type t = (Lexing.position * Lexing.position) list val empty : t (** No signature read *) -val init : Cmt_format.cmt_infos option -> Cmt_format.cmt_infos option -> (t, string) result -(** [init cmt_infos cmti_infos] expects [cmt_infos = Some _]. - It reads the [cmt_infos] and the |cmti_infos] to retrieve their - [cmt_declaration_dependencies] and convert them into a single [t]. +type uid_to_decl = Typedtree.item_declaration Shape.Uid.Tbl.t + +val init : Cmt_format.cmt_infos -> uid_to_decl option -> (t, string) result +(** [init cmt_infos cmti_infos cmti_uid_to_decl] expects + [cmt_infos.cmt_annots = Implementation _]. + It reads the [cmt_infos] and the [cmti_uid_to_decl] to retrieve their + and converts [cmt_infos.cmt_declaration_dependencies] into a single [t]. It returns an [Ok t] with [t] on success. - In case the [cmt_infos] is missing or does not contain an implementation, - it returns an [Err msg] with msg a string describing the issue. *) + In case the [cmt_infos] does not contain an implementation, it returns an + [Err msg] with msg a string describing the issue. *) From 15a9405d8a82a15161c9f1195668acc4bc8440b9 Mon Sep 17 00:00:00 2001 From: Corentin De Souza <9597216+fantazio@users.noreply.github.com> Date: Wed, 17 Dec 2025 15:22:17 +0100 Subject: [PATCH 08/12] [src][verbose] print error on missing cmi_infos and cmt_struct --- src/deadCode.ml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/deadCode.ml b/src/deadCode.ml index 3907822f..f8a29882 100644 --- a/src/deadCode.ml +++ b/src/deadCode.ml @@ -483,13 +483,18 @@ let load_file fn state = (* TODO: stateful computations should take and return the state when possible *) state in + let add_bad_file err fn = + if state.State.config.verbose then + Printf.eprintf "%s\n%!" err; + bad_files := fn :: !bad_files + in let process_interface fn = last_loc := Lexing.dummy_pos; if state.State.config.verbose then Printf.eprintf "Scanning interface from %s\n%!" fn; init_and_continue state fn (fun state -> match state.file_infos.cmi_sign with - | None -> bad_files := fn :: !bad_files + | None -> add_bad_file "Missing cmi_sign" fn | Some cmi_sign -> read_interface fn cmi_sign state ) @@ -500,7 +505,7 @@ let load_file fn state = Printf.eprintf "Scanning implementation from %s\n%!" fn; init_and_continue state fn (fun state -> match state.file_infos.cmt_struct with - | None -> bad_files := fn :: !bad_files + | None -> add_bad_file "Missing cmt_struct" fn | Some structure -> regabs state; let prepare (loc1, loc2) = From d266d341d502cb4501e22a0956ad0190589ed163 Mon Sep 17 00:00:00 2001 From: Corentin De Souza <9597216+fantazio@users.noreply.github.com> Date: Sun, 8 Feb 2026 17:48:57 +0100 Subject: [PATCH 09/12] [src][state][loc_dep][1/n] read external cm files if needed This fixes the remaining FP/FN --- check/classic/classic.ref | 18 ++------ check/internal/internal.ref | 14 ++---- check/threshold-1/threshold-1.ref | 40 +++++----------- check/threshold-3-0.5/threshold-3-0.5.ref | 56 ++++++++--------------- src/state/file_infos.ml | 18 ++++---- src/state/file_infos.mli | 10 ++-- src/state/location_dependencies.ml | 38 ++++++++++----- src/state/location_dependencies.mli | 11 +++-- src/state/state.ml | 5 +- 9 files changed, 90 insertions(+), 120 deletions(-) diff --git a/check/classic/classic.ref b/check/classic/classic.ref index ed4f9d10..ba7997bf 100644 --- a/check/classic/classic.ref +++ b/check/classic/classic.ref @@ -43,23 +43,11 @@ ./examples/using_dune/reduced_lib/reduced_lib.mli:19: Values_in_submodules.Exported.internally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:27: Values_in_submodules_no_intf.Exported.used_by_API ./examples/using_dune/reduced_lib/reduced_lib.mli:28: Values_in_submodules_no_intf.Exported.internally_used -./examples/using_dune/reduced_lib/values.mli:1: used: Should not be detected -./examples/using_dune/reduced_lib/values.mli:2: used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values.mli:3: internally_used: Should not be detected -./examples/using_dune/reduced_lib/values.mli:4: externally_used: Should not be detected ./examples/using_dune/reduced_lib/values.mli:7: lib_internal_unused ./examples/using_dune/reduced_lib/values.mli:8: lib_internal_internally_used -./examples/using_dune/reduced_lib/values_in_submodules.mli:2: Exported.used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:3: Exported.used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:4: Exported.internally_used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:8: Exported.lib_internal_unused ./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused -./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_unused ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg @@ -635,7 +623,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 548 +Total: 536 Success: 531 -Failed: 17 -Ratio: 96.897810219% +Failed: 5 +Ratio: 99.0671641791% diff --git a/check/internal/internal.ref b/check/internal/internal.ref index 913d3154..9c869823 100644 --- a/check/internal/internal.ref +++ b/check/internal/internal.ref @@ -31,17 +31,9 @@ ./examples/using_dune/reduced_lib/reduced_lib.mli:19: Values_in_submodules.Exported.internally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:27: Values_in_submodules_no_intf.Exported.used_by_API ./examples/using_dune/reduced_lib/reduced_lib.mli:28: Values_in_submodules_no_intf.Exported.internally_used -./examples/using_dune/reduced_lib/values.mli:2: used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values.mli:4: externally_used: Should not be detected ./examples/using_dune/reduced_lib/values.mli:7: lib_internal_unused -./examples/using_dune/reduced_lib/values_in_submodules.mli:3: Exported.used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:8: Exported.lib_internal_unused -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused -./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_unused ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg @@ -586,7 +578,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 502 +Total: 494 Success: 489 -Failed: 13 -Ratio: 97.4103585657% +Failed: 5 +Ratio: 98.987854251% diff --git a/check/threshold-1/threshold-1.ref b/check/threshold-1/threshold-1.ref index 2847ae80..0f3a3f17 100644 --- a/check/threshold-1/threshold-1.ref +++ b/check/threshold-1/threshold-1.ref @@ -31,17 +31,9 @@ ./examples/using_dune/reduced_lib/reduced_lib.mli:19: Values_in_submodules.Exported.internally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:27: Values_in_submodules_no_intf.Exported.used_by_API ./examples/using_dune/reduced_lib/reduced_lib.mli:28: Values_in_submodules_no_intf.Exported.internally_used -./examples/using_dune/reduced_lib/values.mli:2: used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values.mli:4: externally_used: Should not be detected ./examples/using_dune/reduced_lib/values.mli:7: lib_internal_unused -./examples/using_dune/reduced_lib/values_in_submodules.mli:3: Exported.used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:8: Exported.lib_internal_unused -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused -./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_unused ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg @@ -201,28 +193,20 @@ ./examples/using_dune/reduced_lib/reduced_lib.mli:20: Values_in_submodules.Exported.externally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:26: Values_in_submodules_no_intf.Exported.used ./examples/using_dune/reduced_lib/reduced_lib.mli:29: Values_in_submodules_no_intf.Exported.externally_used -./examples/using_dune/reduced_lib/values.mli:1: used: Should not be detected -./examples/using_dune/reduced_lib/values.mli:2: used_by_API: Not detected -./examples/using_dune/reduced_lib/values.mli:3: internally_used: Should not be detected -./examples/using_dune/reduced_lib/values.mli:4: externally_used: Not detected +./examples/using_dune/reduced_lib/values.mli:2: used_by_API +./examples/using_dune/reduced_lib/values.mli:4: externally_used ./examples/using_dune/reduced_lib/values.mli:8: lib_internal_internally_used ./examples/using_dune/reduced_lib/values.mli:9: lib_internal_externally_used -./examples/using_dune/reduced_lib/values_in_submodules.mli:2: Exported.used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:3: Exported.used_by_API: Not detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:4: Exported.internally_used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Not detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:3: Exported.used_by_API +./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used ./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used ./examples/using_dune/reduced_lib/values_in_submodules.mli:10: Exported.lib_internal_externally_used -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:2: Exported.used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Not detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:4: Exported.internally_used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Not detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:9: Exported.lib_internal_internally_used ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:10: Exported.lib_internal_externally_used -./examples/using_dune/reduced_lib/values_no_intf.ml:1: used: Should not be detected -./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Not detected -./examples/using_dune/reduced_lib/values_no_intf.ml:3: internally_used: Should not be detected -./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Not detected +./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API +./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used ./examples/using_dune/reduced_lib/values_no_intf.ml:12: lib_internal_internally_used ./examples/using_dune/reduced_lib/values_no_intf.ml:13: lib_internal_externally_used @@ -971,7 +955,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 841 -Success: 812 -Failed: 29 -Ratio: 96.5517241379% +Total: 825 +Success: 820 +Failed: 5 +Ratio: 99.3939393939% diff --git a/check/threshold-3-0.5/threshold-3-0.5.ref b/check/threshold-3-0.5/threshold-3-0.5.ref index 63e4c927..c7ac50fd 100644 --- a/check/threshold-3-0.5/threshold-3-0.5.ref +++ b/check/threshold-3-0.5/threshold-3-0.5.ref @@ -31,17 +31,9 @@ ./examples/using_dune/reduced_lib/reduced_lib.mli:19: Values_in_submodules.Exported.internally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:27: Values_in_submodules_no_intf.Exported.used_by_API ./examples/using_dune/reduced_lib/reduced_lib.mli:28: Values_in_submodules_no_intf.Exported.internally_used -./examples/using_dune/reduced_lib/values.mli:2: used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values.mli:4: externally_used: Should not be detected ./examples/using_dune/reduced_lib/values.mli:7: lib_internal_unused -./examples/using_dune/reduced_lib/values_in_submodules.mli:3: Exported.used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:8: Exported.lib_internal_unused -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused -./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_unused ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg @@ -201,28 +193,20 @@ ./examples/using_dune/reduced_lib/reduced_lib.mli:20: Values_in_submodules.Exported.externally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:26: Values_in_submodules_no_intf.Exported.used ./examples/using_dune/reduced_lib/reduced_lib.mli:29: Values_in_submodules_no_intf.Exported.externally_used -./examples/using_dune/reduced_lib/values.mli:1: used: Should not be detected -./examples/using_dune/reduced_lib/values.mli:2: used_by_API: Not detected -./examples/using_dune/reduced_lib/values.mli:3: internally_used: Should not be detected -./examples/using_dune/reduced_lib/values.mli:4: externally_used: Not detected +./examples/using_dune/reduced_lib/values.mli:2: used_by_API +./examples/using_dune/reduced_lib/values.mli:4: externally_used ./examples/using_dune/reduced_lib/values.mli:8: lib_internal_internally_used ./examples/using_dune/reduced_lib/values.mli:9: lib_internal_externally_used -./examples/using_dune/reduced_lib/values_in_submodules.mli:2: Exported.used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:3: Exported.used_by_API: Not detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:4: Exported.internally_used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Not detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:3: Exported.used_by_API +./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used ./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used ./examples/using_dune/reduced_lib/values_in_submodules.mli:10: Exported.lib_internal_externally_used -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:2: Exported.used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Not detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:4: Exported.internally_used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Not detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:9: Exported.lib_internal_internally_used ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:10: Exported.lib_internal_externally_used -./examples/using_dune/reduced_lib/values_no_intf.ml:1: used: Should not be detected -./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Not detected -./examples/using_dune/reduced_lib/values_no_intf.ml:3: internally_used: Should not be detected -./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Not detected +./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API +./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used ./examples/using_dune/reduced_lib/values_no_intf.ml:12: lib_internal_internally_used ./examples/using_dune/reduced_lib/values_no_intf.ml:13: lib_internal_externally_used @@ -370,17 +354,17 @@ ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:59: internally_used_f ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:64: externally_used_f -./examples/using_dune/reduced_lib/values.mli:1: used: Not detected -./examples/using_dune/reduced_lib/values.mli:3: internally_used: Not detected +./examples/using_dune/reduced_lib/values.mli:1: used +./examples/using_dune/reduced_lib/values.mli:3: internally_used ./examples/using_dune/reduced_lib/values.mli:6: lib_internal_used -./examples/using_dune/reduced_lib/values_in_submodules.mli:2: Exported.used: Not detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:4: Exported.internally_used: Not detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:2: Exported.used +./examples/using_dune/reduced_lib/values_in_submodules.mli:4: Exported.internally_used ./examples/using_dune/reduced_lib/values_in_submodules.mli:7: Exported.lib_internal_used -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:2: Exported.used: Not detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:4: Exported.internally_used: Not detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:2: Exported.used +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:4: Exported.internally_used ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:7: Exported.lib_internal_used -./examples/using_dune/reduced_lib/values_no_intf.ml:1: used: Not detected -./examples/using_dune/reduced_lib/values_no_intf.ml:3: internally_used: Not detected +./examples/using_dune/reduced_lib/values_no_intf.ml:1: used +./examples/using_dune/reduced_lib/values_no_intf.ml:3: internally_used ./examples/using_dune/reduced_lib/values_no_intf.ml:10: lib_internal_used ./examples/using_dune/unwrapped_lib/obj/with_class.mli:33: fun_class_factory @@ -1356,7 +1340,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 1153 -Success: 1116 -Failed: 37 -Ratio: 96.790980052% +Total: 1137 +Success: 1132 +Failed: 5 +Ratio: 99.5602462621% diff --git a/src/state/file_infos.ml b/src/state/file_infos.ml index b013b3ca..772d6c77 100644 --- a/src/state/file_infos.ml +++ b/src/state/file_infos.ml @@ -64,7 +64,7 @@ let init_from_cmti_file cmti_file = let cmti_uid_to_decl = Some cmt_infos.cmt_uid_to_decl in {file_infos with cmti_uid_to_decl} -let init_from_cmt_file cmt_file = +let init_from_cmt_file ~cm_paths cmt_file = let* file_infos, cmt_infos = init_from_cm_file cmt_file in let* cmt_struct = match cmt_infos.cmt_annots with @@ -82,26 +82,26 @@ let init_from_cmt_file cmt_file = | Ok file_infos -> file_infos.cmti_uid_to_decl in let+ location_dependencies = - Location_dependencies.init cmt_infos cmti_uid_to_decl + Location_dependencies.init ~cm_paths cmt_infos cmti_uid_to_decl in let file_infos = {file_infos with cmt_struct; cmti_uid_to_decl; location_dependencies} in file_infos, cmt_infos -let init cm_file = +let init ~cm_paths cm_file = match Filename.extension cm_file with | ".cmt" -> - let+ file_infos, _ = init_from_cmt_file cm_file in + let+ file_infos, _ = init_from_cmt_file ~cm_paths cm_file in file_infos | ".cmti" -> ( (* Using cmt_infos is not critical. The intent is to mirror the behavior on cmt files, where both cmt and cmti are read. *) let filled_with_cmt_infos = let cmt_file = Filename.remove_extension cm_file ^ ".cmt" in - let* file_infos, cmt_infos = init_from_cmt_file cmt_file in + let* file_infos, cmt_infos = init_from_cmt_file ~cm_paths cmt_file in let+ location_dependencies = - Location_dependencies.init cmt_infos file_infos.cmti_uid_to_decl + Location_dependencies.init ~cm_paths cmt_infos file_infos.cmti_uid_to_decl in {file_infos with location_dependencies} in @@ -113,7 +113,7 @@ let init cm_file = ) | _ -> Result.error (cm_file ^ ": not a .cmti or .cmt file") -let change_file file_infos cm_file = +let change_file ~cm_paths file_infos cm_file = let no_ext = Filename.remove_extension cm_file in assert(no_ext = Filename.remove_extension file_infos.cm_file); match Filename.extension cm_file, file_infos with @@ -121,7 +121,7 @@ let change_file file_infos cm_file = let* res, cmt_infos = init_from_cm_file cm_file in let+ location_dependencies = match file_infos.location_dependencies with - | [] -> Location_dependencies.init cmt_infos cmti_uid_to_decl + | [] -> Location_dependencies.init ~cm_paths cmt_infos cmti_uid_to_decl | loc_dep -> (* They have already been computed *) Result.ok loc_dep in @@ -131,7 +131,7 @@ let change_file file_infos cm_file = {res with cmti_uid_to_decl = cutd; cmt_struct; location_dependencies} | _ -> (* invalid extension or the corresponding info is None *) - init cm_file + init ~cm_paths cm_file let has_sourcepath file_infos = Option.is_some file_infos.sourcepath diff --git a/src/state/file_infos.mli b/src/state/file_infos.mli index 9e381336..209dcddc 100644 --- a/src/state/file_infos.mli +++ b/src/state/file_infos.mli @@ -16,20 +16,22 @@ type t = { val empty : t (** No file info *) -val init : string -> (t, string) result +val init : cm_paths: Utils.StringSet.t -> string -> (t, string) result (** [init cm_file] expects either a [.cmti] or [.cmt] filepath as argument and returns an [Ok t] with [t] filled using the [cmtit_file]. In case the file does not exist, it cannot be read, or its extension is invalid, then it returns an [Err msg] with msg a string - describing the issue. *) + describing the issue. + [cm_paths] is used to load external cm files if necessary. *) -val change_file : t -> string -> (t, string) result +val change_file : cm_paths: Utils.StringSet.t -> t -> string -> (t, string) result (** [change_file t cm_file] expects either a [.cmti] or a [.cmt] filepath as argument. [cm_file] must be the same as [t.cm_file], ignoring the extension. The returned value is either a simple update of [t] if the necessary [cmti_infos] or [cmt_infos] is available. Otherwise, it is the result of - [init t] *) + [init t]. + [cm_paths] is used to load external cm files if necessary. *) val has_sourcepath : t -> bool diff --git a/src/state/location_dependencies.ml b/src/state/location_dependencies.ml index 2ade7ffc..75e75fe9 100644 --- a/src/state/location_dependencies.ml +++ b/src/state/location_dependencies.ml @@ -34,26 +34,40 @@ let fill_from_structure (structure : Typedtree.structure) res_uid_to_loc = iterator.structure iterator structure; res_uid_to_loc +let loc_opt_of_item_decl = function + | Typedtree.Value {val_loc = loc; _} + | Typedtree.Value_binding {vb_pat = {pat_loc = loc; _}; _} -> + Some loc.loc_start + | _ -> None + let fill_from_cmt_tbl uid_to_decl res_uid_to_loc = - let open Typedtree in - let loc_of_item_decl = function - | Value {val_loc = loc; _} - | Value_binding {vb_pat = {pat_loc = loc; _}; _} -> - Some loc.loc_start - | _ -> None - in let add_uid_loc uid item_decl = - let loc = loc_of_item_decl item_decl in + let loc = loc_opt_of_item_decl item_decl in Option.iter (UidTbl.replace res_uid_to_loc uid) loc in UidTbl.iter add_uid_loc uid_to_decl; res_uid_to_loc -let cmt_decl_dep_to_loc_dep cmt_decl_dep uid_to_loc = +let find_opt_external_uid_loc ~cm_paths = function + | Shape.Uid.(Compilation_unit _ | Internal | Predef _) -> None + | Item {comp_unit; _} as uid -> + let ( let* ) x f = Option.bind x f in + let* cm_path = + Utils.StringSet.elements cm_paths + |> List.rev + |> List.find_opt (fun path -> Utils.Filepath.unit path = comp_unit) + in + let* cmt_infos = Cmt_format.read cm_path |> snd in + let* item_decl = UidTbl.find_opt cmt_infos.cmt_uid_to_decl uid in + loc_opt_of_item_decl item_decl + +let cmt_decl_dep_to_loc_dep ~cm_paths cmt_decl_dep uid_to_loc = let convert_pair (_dep_kind, uid_def, uid_decl) = let ( let* ) x f = Option.bind x f in let loc_opt_of_uid uid = - UidTbl.find_opt uid_to_loc uid + match UidTbl.find_opt uid_to_loc uid with + | Some _ as loc -> loc + | None -> find_opt_external_uid_loc ~cm_paths uid in let* def_loc = loc_opt_of_uid uid_def in let* decl_loc = loc_opt_of_uid uid_decl in @@ -61,7 +75,7 @@ let cmt_decl_dep_to_loc_dep cmt_decl_dep uid_to_loc = in List.filter_map convert_pair cmt_decl_dep -let init cmt_infos cmti_uid_to_decl = +let init ~cm_paths cmt_infos cmti_uid_to_decl = match cmt_infos.Cmt_format.cmt_annots with | Implementation structure -> let fill_from_cmti_tbl tbl = @@ -75,6 +89,6 @@ let init cmt_infos cmti_uid_to_decl = |> fill_from_structure structure |> fill_from_cmt_tbl cmt_infos.cmt_uid_to_decl |> fill_from_cmti_tbl - |> cmt_decl_dep_to_loc_dep cmt_infos.cmt_declaration_dependencies + |> cmt_decl_dep_to_loc_dep ~cm_paths cmt_infos.cmt_declaration_dependencies |> Result.ok | _ -> Result.error "No implementation found in cmt_infos" diff --git a/src/state/location_dependencies.mli b/src/state/location_dependencies.mli index c6dc3fbc..80046876 100644 --- a/src/state/location_dependencies.mli +++ b/src/state/location_dependencies.mli @@ -5,11 +5,16 @@ val empty : t (** No signature read *) type uid_to_decl = Typedtree.item_declaration Shape.Uid.Tbl.t -val init : Cmt_format.cmt_infos -> uid_to_decl option -> (t, string) result -(** [init cmt_infos cmti_infos cmti_uid_to_decl] expects +val init : + cm_paths: Utils.StringSet.t + -> Cmt_format.cmt_infos + -> uid_to_decl option + -> (t, string) result +(** [init ~cm_paths cmt_infos cmti_infos cmti_uid_to_decl] expects [cmt_infos.cmt_annots = Implementation _]. It reads the [cmt_infos] and the [cmti_uid_to_decl] to retrieve their and converts [cmt_infos.cmt_declaration_dependencies] into a single [t]. It returns an [Ok t] with [t] on success. In case the [cmt_infos] does not contain an implementation, it returns an - [Err msg] with msg a string describing the issue. *) + [Err msg] with msg a string describing the issue. + [cm_paths] is used to load external cm files if necessary. *) diff --git a/src/state/state.ml b/src/state/state.ml index 645131ee..8b71b2bd 100644 --- a/src/state/state.ml +++ b/src/state/state.ml @@ -21,13 +21,14 @@ let change_file state cm_file = let no_ext2 = Filename.remove_extension filename2 in String.equal no_ext1 no_ext2 in + let cm_paths = state.config.paths_to_analyze in if String.equal file_infos.cm_file cm_file then Result.ok state else if equal_no_ext file_infos.cm_file cm_file then - let file_infos = File_infos.change_file file_infos cm_file in + let file_infos = File_infos.change_file ~cm_paths file_infos cm_file in Result.map (fun file_infos -> {state with file_infos}) file_infos else - let file_infos = File_infos.init cm_file in + let file_infos = File_infos.init ~cm_paths cm_file in Result.map (fun file_infos -> {state with file_infos}) file_infos (** Analysis' state *) From ae5b41daf8a95ea93c28e87e5fbb09913dc4dfbc Mon Sep 17 00:00:00 2001 From: Corentin De Souza <9597216+fantazio@users.noreply.github.com> Date: Sun, 8 Feb 2026 18:34:25 +0100 Subject: [PATCH 10/12] [src][state][loc_dep][2/n] add cache for external uids This significantly improves the performances (compared to the previous commit) measured on Frama-C : -84% time, same memory. This is still however noticeably less performant than the OCaml 5.2 -compatible version : +246% time, +39% memory. --- src/state/location_dependencies.ml | 41 ++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/src/state/location_dependencies.ml b/src/state/location_dependencies.ml index 75e75fe9..52dcb844 100644 --- a/src/state/location_dependencies.ml +++ b/src/state/location_dependencies.ml @@ -48,18 +48,31 @@ let fill_from_cmt_tbl uid_to_decl res_uid_to_loc = UidTbl.iter add_uid_loc uid_to_decl; res_uid_to_loc -let find_opt_external_uid_loc ~cm_paths = function - | Shape.Uid.(Compilation_unit _ | Internal | Predef _) -> None - | Item {comp_unit; _} as uid -> - let ( let* ) x f = Option.bind x f in - let* cm_path = - Utils.StringSet.elements cm_paths - |> List.rev - |> List.find_opt (fun path -> Utils.Filepath.unit path = comp_unit) - in - let* cmt_infos = Cmt_format.read cm_path |> snd in - let* item_decl = UidTbl.find_opt cmt_infos.cmt_uid_to_decl uid in - loc_opt_of_item_decl item_decl +let find_opt_external_uid_loc, clear_external_cache = + let cache = Hashtbl.create 16 in + let clear_external_cache () = Hashtbl.reset cache in + let find_opt_external_uid_loc ~cm_paths = function + | Shape.Uid.(Compilation_unit _ | Internal | Predef _) -> None + | Item {comp_unit; _} as uid -> + let ( let* ) x f = Option.bind x f in + let* cmt_uid_to_decl = + match Hashtbl.find_opt cache comp_unit with + | Some _ as cmt_uid_to_decl -> cmt_uid_to_decl + | None -> + let* cm_path = + Utils.StringSet.elements cm_paths + |> List.rev + |> List.find_opt (fun path -> Utils.Filepath.unit path = comp_unit) + in + let* cmt_infos = Cmt_format.read cm_path |> snd in + let cmt_uid_to_decl = cmt_infos.cmt_uid_to_decl in + Hashtbl.add cache comp_unit cmt_uid_to_decl; + Some cmt_uid_to_decl + in + let* item_decl = UidTbl.find_opt cmt_uid_to_decl uid in + loc_opt_of_item_decl item_decl + in + find_opt_external_uid_loc, clear_external_cache let cmt_decl_dep_to_loc_dep ~cm_paths cmt_decl_dep uid_to_loc = let convert_pair (_dep_kind, uid_def, uid_decl) = @@ -73,7 +86,9 @@ let cmt_decl_dep_to_loc_dep ~cm_paths cmt_decl_dep uid_to_loc = let* decl_loc = loc_opt_of_uid uid_decl in Some (def_loc, decl_loc) in - List.filter_map convert_pair cmt_decl_dep + let res = List.filter_map convert_pair cmt_decl_dep in + clear_external_cache (); + res let init ~cm_paths cmt_infos cmti_uid_to_decl = match cmt_infos.Cmt_format.cmt_annots with From 379cfeb82ce6a35c963a02c5b694e4d2744886a0 Mon Sep 17 00:00:00 2001 From: Corentin De Souza <9597216+fantazio@users.noreply.github.com> Date: Sun, 8 Feb 2026 18:39:18 +0100 Subject: [PATCH 11/12] [src][state][loc_dep][3/n] stop exploring includes --- src/state/location_dependencies.ml | 31 +----------------------------- 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/src/state/location_dependencies.ml b/src/state/location_dependencies.ml index 52dcb844..dc1e4a2a 100644 --- a/src/state/location_dependencies.ml +++ b/src/state/location_dependencies.ml @@ -6,34 +6,6 @@ module UidTbl = Shape.Uid.Tbl type uid_to_decl = Typedtree.item_declaration UidTbl.t -let fill_from_structure (structure : Typedtree.structure) res_uid_to_loc = - let open Types in - let rec fill_from_signature_item = function - | Sig_value (_, {val_loc; val_uid; _}, _) -> - UidTbl.replace res_uid_to_loc val_uid val_loc.loc_start - | Sig_module (_, _, {md_type = modtype; _}, _, _) - | Sig_modtype (_, {mtd_type = Some modtype; _}, _) -> - Utils.signature_of_modtype modtype - |> fill_from_signature - | _ -> () - and fill_from_signature s = - List.iter fill_from_signature_item s - in - let iterator = - let super = Tast_iterator.default_iterator in - let structure_item self struct_item = - let open Typedtree in - begin match struct_item.str_desc with - | Tstr_include {incl_type; _} -> fill_from_signature incl_type - | _ -> () - end; - super.Tast_iterator.structure_item self struct_item - in - {super with structure_item} - in - iterator.structure iterator structure; - res_uid_to_loc - let loc_opt_of_item_decl = function | Typedtree.Value {val_loc = loc; _} | Typedtree.Value_binding {vb_pat = {pat_loc = loc; _}; _} -> @@ -92,7 +64,7 @@ let cmt_decl_dep_to_loc_dep ~cm_paths cmt_decl_dep uid_to_loc = let init ~cm_paths cmt_infos cmti_uid_to_decl = match cmt_infos.Cmt_format.cmt_annots with - | Implementation structure -> + | Implementation _ -> let fill_from_cmti_tbl tbl = match cmti_uid_to_decl with | None -> tbl @@ -101,7 +73,6 @@ let init ~cm_paths cmt_infos cmti_uid_to_decl = in (* TODO: Evaluate a generally good size for the tbl ? *) UidTbl.create 512 - |> fill_from_structure structure |> fill_from_cmt_tbl cmt_infos.cmt_uid_to_decl |> fill_from_cmti_tbl |> cmt_decl_dep_to_loc_dep ~cm_paths cmt_infos.cmt_declaration_dependencies From b1d3dbb4e1de0564e4811d992680724d9224916b Mon Sep 17 00:00:00 2001 From: Corentin De Souza <9597216+fantazio@users.noreply.github.com> Date: Wed, 25 Mar 2026 19:26:39 +0100 Subject: [PATCH 12/12] [src][state][cmt] add caching This replaces the previous local cache in location dependencies computation. This improves the performance measured on Frama-C : -56% time, +10% memory. Compared to the OCaml 5.2 -compatible version :+51% time, +52% memory. --- src/state/cmt.ml | 66 ++++++++++++++++++++++++++++++ src/state/cmt.mli | 9 ++++ src/state/file_infos.ml | 7 ++-- src/state/location_dependencies.ml | 44 ++++++++++---------- 4 files changed, 100 insertions(+), 26 deletions(-) create mode 100644 src/state/cmt.ml create mode 100644 src/state/cmt.mli diff --git a/src/state/cmt.ml b/src/state/cmt.ml new file mode 100644 index 00000000..cf67e257 --- /dev/null +++ b/src/state/cmt.ml @@ -0,0 +1,66 @@ +module Cache = struct + (** O(1) addition and retrieval *) + + type ('k, 'v) t = + { store : ('k, 'v) Hashtbl.t + (** filepath -> cmi_cmt_infos *) + ; capacity : int (** n <= capacity *) + ; mutable hit : int + ; mutable miss : int + } + + let create capacity = + { store = Hashtbl.create capacity + ; capacity + ; hit = 0 + ; miss = 0 + } + + let find_opt (cache : ('k, 'v) t) (key : 'k) : 'v option = + let res = Hashtbl.find_opt cache.store key in + if Option.is_some res then cache.hit <- cache.hit + 1 + else (cache.miss <- cache.miss + 1); + res + + let add cache key value = + if Hashtbl.length cache.store = cache.capacity then + Hashtbl.reset cache.store; + Hashtbl.replace cache.store key value + +end + +let read_no_cache filepath = + match Cmt_format.read filepath with + | exception _ -> Result.error (filepath ^ ": error reading file") + | _, None -> Result.error (filepath ^ ": cmt_infos not found") + | cmi_infos, Some cmt_infos -> + Result.ok (cmi_infos, cmt_infos) + +type cmi_cmt_infos = Cmi_format.cmi_infos option * Cmt_format.cmt_infos + +let cache_cmt : ((string * string), (string * cmi_cmt_infos)) Cache.t = Cache.create 64 + +let read filepath = + let comp_unit = Utils.Filepath.unit filepath in + let ext = Filename.extension filepath in + match Cache.find_opt cache_cmt (ext, comp_unit) with + | Some (fp, res) when String.equal fp filepath -> Result.ok res + | _ -> + read_no_cache filepath + |> Result.map (fun cmi_cmt_infos -> + Cache.add cache_cmt (ext, comp_unit) (filepath, cmi_cmt_infos); + cmi_cmt_infos) + +let find_cached_from_comp_unit comp_unit ext = + Cache.find_opt cache_cmt (ext, comp_unit) + |> Option.map snd + +let cached_cmti comp_unit = + find_cached_from_comp_unit comp_unit ".cmti" + +let cached_cmt comp_unit = + find_cached_from_comp_unit comp_unit ".cmt" + +let print_cache_stats () = + print_endline (Printf.sprintf "CMT CACHE : hit = %i ; miss = %i" + cache_cmt.hit cache_cmt.miss) diff --git a/src/state/cmt.mli b/src/state/cmt.mli new file mode 100644 index 00000000..97996a7a --- /dev/null +++ b/src/state/cmt.mli @@ -0,0 +1,9 @@ +type cmi_cmt_infos = Cmi_format.cmi_infos option * Cmt_format.cmt_infos + +val read : string -> (cmi_cmt_infos, string) Result.t + +val cached_cmti : string -> cmi_cmt_infos option + +val cached_cmt : string -> cmi_cmt_infos option + +val print_cache_stats : unit -> unit diff --git a/src/state/file_infos.ml b/src/state/file_infos.ml index 772d6c77..b0efac82 100644 --- a/src/state/file_infos.ml +++ b/src/state/file_infos.ml @@ -47,10 +47,9 @@ let empty = { let init_from_cm_file cm_file = if not (Sys.file_exists cm_file) then Result.error (cm_file ^ ": file not found") else - match Cmt_format.read cm_file with - | exception _ -> Result.error (cm_file ^ ": error reading file") - | _, None -> Result.error (cm_file ^ ": cmt_infos not found") - | cmi_infos, Some cmt_infos -> + match Cmt.read cm_file with + | Error _ as err -> err + | Ok (cmi_infos, cmt_infos) -> let file_infos = init_from_all_cm_infos ~cm_file ~cmi_infos cmt_infos in diff --git a/src/state/location_dependencies.ml b/src/state/location_dependencies.ml index dc1e4a2a..b69f9033 100644 --- a/src/state/location_dependencies.ml +++ b/src/state/location_dependencies.ml @@ -20,31 +20,32 @@ let fill_from_cmt_tbl uid_to_decl res_uid_to_loc = UidTbl.iter add_uid_loc uid_to_decl; res_uid_to_loc -let find_opt_external_uid_loc, clear_external_cache = - let cache = Hashtbl.create 16 in - let clear_external_cache () = Hashtbl.reset cache in - let find_opt_external_uid_loc ~cm_paths = function - | Shape.Uid.(Compilation_unit _ | Internal | Predef _) -> None - | Item {comp_unit; _} as uid -> +let find_opt_external_uid_loc ~cm_paths = function + | Shape.Uid.(Compilation_unit _ | Internal | Predef _) -> None + | Item {comp_unit; from; _} as uid -> let ( let* ) x f = Option.bind x f in - let* cmt_uid_to_decl = - match Hashtbl.find_opt cache comp_unit with - | Some _ as cmt_uid_to_decl -> cmt_uid_to_decl - | None -> - let* cm_path = - Utils.StringSet.elements cm_paths - |> List.rev - |> List.find_opt (fun path -> Utils.Filepath.unit path = comp_unit) - in - let* cmt_infos = Cmt_format.read cm_path |> snd in - let cmt_uid_to_decl = cmt_infos.cmt_uid_to_decl in - Hashtbl.add cache comp_unit cmt_uid_to_decl; - Some cmt_uid_to_decl + let cached = + match from with + | Unit_info.Intf -> Cmt.cached_cmti comp_unit + | Unit_info.Impl -> Cmt.cached_cmt comp_unit in + let read_from_path () = + let* cm_path = + Utils.StringSet.elements cm_paths + |> List.rev + |> List.find_opt (fun path -> Utils.Filepath.unit path = comp_unit) + in + Cmt.read cm_path |> Result.to_option + in + let* cmi_cmt_infos = + match cached with + | Some _ as some -> some + | None -> read_from_path () + in + let cmt_infos = snd cmi_cmt_infos in + let cmt_uid_to_decl = cmt_infos.cmt_uid_to_decl in let* item_decl = UidTbl.find_opt cmt_uid_to_decl uid in loc_opt_of_item_decl item_decl - in - find_opt_external_uid_loc, clear_external_cache let cmt_decl_dep_to_loc_dep ~cm_paths cmt_decl_dep uid_to_loc = let convert_pair (_dep_kind, uid_def, uid_decl) = @@ -59,7 +60,6 @@ let cmt_decl_dep_to_loc_dep ~cm_paths cmt_decl_dep uid_to_loc = Some (def_loc, decl_loc) in let res = List.filter_map convert_pair cmt_decl_dep in - clear_external_cache (); res let init ~cm_paths cmt_infos cmti_uid_to_decl =