-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support renaming re-exports, glob re-exports, and type aliases used a…
…s renames. (#34) * Implement `pub use` and glob re-exports. * Reasonably handle import paths with cycles rather than crashing. * Handle `pub type` uses equivalent to `pub use` as mere re-exports. * Switch tests to nightly since that's where rustdoc v24 is.
- Loading branch information
1 parent
1ed7be7
commit d6246de
Showing
50 changed files
with
1,726 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
# Generated by Cargo | ||
# will have compiled files and executables | ||
/target/ | ||
**/target/ | ||
|
||
# Local configuration for the project. | ||
.cargo/ | ||
|
||
# These are backup files generated by rustfmt | ||
**/*.rs.bk | ||
|
||
# local-only data | ||
localdata/ | ||
|
||
# lockfiles of test crates | ||
test_crates/**/Cargo.lock |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Fail on first error, on undefined variables, and on failures in pipelines. | ||
set -euo pipefail | ||
|
||
export CARGO_TARGET_DIR=/tmp/test_crates | ||
RUSTDOC_OUTPUT_DIR="$CARGO_TARGET_DIR/doc" | ||
TOPLEVEL="$(git rev-parse --show-toplevel)" | ||
TARGET_DIR="$TOPLEVEL/localdata/test_data" | ||
|
||
# Allow setting an explicit toolchain, like +nightly or +beta. | ||
set +u | ||
TOOLCHAIN="$1" | ||
set -u | ||
echo "Generating rustdoc with: $(cargo $TOOLCHAIN --version)" | ||
RUSTDOC_CMD="cargo $TOOLCHAIN rustdoc" | ||
|
||
# Run rustdoc on test_crates/*/ | ||
for crate_path in $(find "$TOPLEVEL/test_crates/" -maxdepth 1 -mindepth 1 -type d); do | ||
# Removing path prefix, leaving only the directory name without forward slashes | ||
crate=${crate_path#"$TOPLEVEL/test_crates/"} | ||
|
||
if [[ -f "$TOPLEVEL/test_crates/$crate/Cargo.toml" ]]; then | ||
echo "Generating: $crate" | ||
|
||
pushd "$TOPLEVEL/test_crates/$crate" | ||
RUSTC_BOOTSTRAP=1 $RUSTDOC_CMD -- -Zunstable-options --document-private-items --document-hidden-items --output-format=json | ||
mkdir -p "$TARGET_DIR/$crate" | ||
mv "$RUSTDOC_OUTPUT_DIR/$crate.json" "$TARGET_DIR/$crate/rustdoc.json" | ||
popd | ||
fi | ||
done | ||
|
||
unset CARGO_TARGET_DIR |
Oops, something went wrong.