Description
When running rustdoc, cargo currently doesn't know which files are used for each cargo target. Because of this, cargo conservatively assumes that a modification to any file in the project will require rebuilding the documentation for all targets. When running rustc
, cargo uses the dep-info file to know which files each target is built from, so that it can know to only track for changes in those files. It would be helpful if rustdoc had a similar ability so that cargo could more precisely track the files.
Since we probably don't want to pollute the output directory with this dep-info file, it would be good to ensure that it supports the --emit dep-info=PATH
syntax that rustc
has so that cargo could squirrel away the file somewhere else in the target directory.
It might be nice if this also included paths passed to CLI options like --extend-css
, though that is a stretch goal.
Ideally it would be essentially the same as rustc
, supporting the # env-dep:
comments as well to track environment variables that were used.