| Age | Commit message (Collapse) | Author | Lines |
|
- added full urlencoding to properly check urlencoded anchor links against non-urlencoded heading IDs
- added tests
urlecoding provided by https://crates.io/crates/urlencoding
|
|
|
|
|
|
|
|
This is to unblock cargo from servo/html5ever#623
|
|
|
|
see https://github.com/servo/html5ever/pull/548
|
|
The Deref brings in the documentation from slice, so it has the same
issue as slice.
|
|
|
|
SUMMARY.md for mdBooks
|
|
|
|
The previous commit updated `rustfmt.toml` appropriately. This commit is
the outcome of running `x fmt --all` with the new formatting options.
|
|
This includes a `From<legacy::RangeInclusive> for RangeInclusive` impl for convenience, instead of the `TryFrom` impl from the RFC.
Having `From` is highly convenient and the assertion is unlikely to be a problem in practice.
This includes re-exports of all existing `Range` types under `core::range`, plus the range-related traits (`RangeBounds`, `Step`, `OneSidedRange`) and the `Bound` enum.
Currently the iterators are just wrappers around the old range types,
and most other trait impls delegate to the old rage types as well.
Also includes an `.iter()` shorthand for `.clone().into_iter()`
|
|
|
|
|
|
The functionality of all three crates is now available in the standard library.
|
|
The existing regex-based HTML parsing was just too primitive to
correctly handle HTML content. Some books have legitimate `href="…"`
text which should not be validated because it is part of the text, not
actual HTML.
|
|
|
|
It was added by 77971 but the adder proposed in that PR that the added
code is a good fallback to have in case rustdoc gets buggy, and I agree.
So remove the FIXME.
|
|
A warning about an unnecessary drop used to appear when running the
linkchecker. Also some clippy warnings
|
|
Since rust-lang/cargo#11851, Cargo became a Cargo workspace of
itself. However, since `src/tools/linkchecker` cannot run inside
a workspace, Cargo needs a workaround that excludes `src/doc`
from workspace member probing.
To remove this hack, this PR adds a new optional argument `--path`
for `linkchecker.sh`. With this new argument, `linkchecker.sh` can
be run from a directory separate from the book. This also benefits
other projects using linkchecker, as they can run it under target
directory or any other directory, reducing leftover.
|
|
|
|
|
|
|
|
|
|
|
|
In Debian and Ubuntu, there are some patches that change the rustc/fonts
directory to a symlink to the system fonts. This triggers a latent bug
in linkchecker, as the DirEntry filetype isn't a dir but later on the
file itself, when opened, is one, triggering an unreachable!() clause.
This patch fixes the situation by using std::fs::metadata, which goes
through symlinks.
I'd have added a test case but `tidy` doesn't seem to like symlinks, and
moreover I'm not sure how Git deals with symlinks on Windows.
Signed-off-by: Simon Chopin <simon.chopin@canonical.com>
|
|
My change to use `Type::def_id()` (formerly `Type::def_id_full()`) in
more places caused some docs to show up that used to be missed by
rustdoc. Those docs contained unescaped square brackets, which triggered
linkcheck errors. This commit escapes the square brackets and adds this
particular instance to the linkcheck exception list.
|
|
|
|
Most of these are because alloc uses `#[lang_item]` to define methods,
but core documents primitives before those methods are available.
- Fix rustdoc-js-std test
For some reason this change made CStr not show up in the results for
`str,u8`. Since it still shows up for str, and since it wasn't a great
match for that query anyway, I think this is ok to let slide.
- Add test that all primitives can be linked to
- Enable `doc(primitive)` in `core` as well
- Add linkcheck exception specifically for Windows
Ideally this would be done automatically by the linkchecker by
replacing `\\` with forward slashes, but this PR is already a ton of
work ...
- Don't forcibly fail linkchecking if there's a broken intra-doc link on Windows
Previously, it would exit with a hard error if a missing file had `::`
in it. This changes it to report a missing file instead, which allows
adding an exception.
|
|
I was reading through source code to try to learn more about the language and how to make the most of it when I ran into a small typo, so I figured I'd offer up a fix! I'm pretty new now, but hopefully I can offer up more substantial changes later. :D
|
|
Since RFC 3052 soft deprecated the authors field anyway, hiding it from
crates.io, docs.rs, and making Cargo not add it by default, and it is
not generally up to date/useful information, we should remove it from
crates in this repo.
|
|
|
|
|
|
These were changed in #84703.
|
|
|
|
|
|
|
|
|
|
This should improve performance 2-3x depending on the system.
|
|
Moves all the state into a struct so it doesn't need to be passed around
as much.
Also adds a report showing how long it took and what it found.
This includes a minor change: a failure to load a file is now an error,
instead of being ignored. This should only happen if there is a
permission error or some other shenanigans going on.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Since rustdoc isn't warning about these links, check for them manually.
|
|
Apply suggestions from code review
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
|
|
Add `slice::check_range`
This method is useful for [`RangeBounds`] parameters. It's even been [rewritten](https://github.com/rust-lang/rust/blob/22ee68dc586440f96b76b32fbd6087507c6afdb9/src/librustc_data_structures/sorted_map.rs#L214) [many](https://github.com/rust-lang/rust/blob/22ee68dc586440f96b76b32fbd6087507c6afdb9/library/alloc/src/vec.rs#L1299) [times](https://github.com/rust-lang/rust/blob/22ee68dc586440f96b76b32fbd6087507c6afdb9/library/core/src/slice/mod.rs#L2441) in the standard library, sometimes assuming that the bounds won't be [`usize::MAX`].
For example, [`Vec::drain`] creates an empty iterator when [`usize::MAX`] is used as an inclusive end bound:
```rust
assert!(vec![1].drain(..=usize::max_value()).eq(iter::empty()));
```
If this PR is merged, I'll create another to use it for those methods.
[`RangeBounds`]: https://doc.rust-lang.org/std/ops/trait.RangeBounds.html
[`usize::MAX`]: https://doc.rust-lang.org/std/primitive.usize.html#associatedconstant.MAX
[`Vec::drain`]: https://doc.rust-lang.org/std/vec/struct.Vec.html#method.drain
|