diff --git a/src/modules_partitioner.ml b/src/modules_partitioner.ml index 72dc7810..f66d4210 100644 --- a/src/modules_partitioner.ml +++ b/src/modules_partitioner.ml @@ -37,11 +37,14 @@ let emit_warnings t = Loc.warn loc "Module %S is used in several stanzas:@\n\ @[%a@]@\n\ - This will become an error in the future.@.\ - To fix this error, you must specify an explicit modules field in \ - every library, executable, and executables stanzas in this jbuild \ - file. Note that each module cannot appear in more than one modules \ - field - it must belong to a single library or executable" + @[%a@]@\n\ + This warning will become an error in the future." name (Fmt.list (Fmt.prefix (Fmt.string "- ") Loc.pp_file_colon_line)) - locs) + locs + Format.pp_print_text + "To remove this warning, you must specify an explicit \"modules\" \ + field in every library, executable, and executables stanzas in \ + this jbuild file. Note that each module cannot appear in more \ + than one \"modules\" field - it must belong to a single library \ + or executable.") diff --git a/test/blackbox-tests/test-cases/ocamldep-multi-stanzas/run.t b/test/blackbox-tests/test-cases/ocamldep-multi-stanzas/run.t index 8df918f8..34e57bbc 100644 --- a/test/blackbox-tests/test-cases/ocamldep-multi-stanzas/run.t +++ b/test/blackbox-tests/test-cases/ocamldep-multi-stanzas/run.t @@ -3,8 +3,11 @@ Warning: Module "Lib" is used in several stanzas: - jbuild:8 - jbuild:4 - This will become an error in the future. - To fix this error, you must specify an explicit modules field in every library, executable, and executables stanzas in this jbuild file. Note that each module cannot appear in more than one modules field - it must belong to a single library or executable + To remove this warning, you must specify an explicit "modules" field in every + library, executable, and executables stanzas in this jbuild file. Note that + each module cannot appear in more than one "modules" field - it must belong + to a single library or executable. + This warning will become an error in the future. Multiple rules generated for _build/default/lib.o: - - @@ -15,8 +18,11 @@ Warning: Module "X" is used in several stanzas: - src/jbuild:4 - src/jbuild:3 - This will become an error in the future. - To fix this error, you must specify an explicit modules field in every library, executable, and executables stanzas in this jbuild file. Note that each module cannot appear in more than one modules field - it must belong to a single library or executable + To remove this warning, you must specify an explicit "modules" field in every + library, executable, and executables stanzas in this jbuild file. Note that + each module cannot appear in more than one "modules" field - it must belong + to a single library or executable. + This warning will become an error in the future. ocamldep src/x.ml.d ocamlc src/.a.objs/a.{cmi,cmo,cmt} ocamlc src/.a.objs/a__X.{cmi,cmo,cmt}