Skip to content

Commit

Permalink
Extend linkchecker with anchor checking
Browse files Browse the repository at this point in the history
This adds checks to ensure that:
* link anchors refer to existing id's on the target page
* id's are unique within an html document
* page redirects are valid
  • Loading branch information
mitaa committed Mar 26, 2016
1 parent d0f74b6 commit 6a76872
Show file tree
Hide file tree
Showing 7 changed files with 215 additions and 62 deletions.
5 changes: 2 additions & 3 deletions src/doc/style/features/traits/generics.md
Expand Up @@ -27,8 +27,7 @@ explicitly implement to be used by this generic function.
* _Inference_. Since the type parameters to generic functions can usually be
inferred, generic functions can help cut down on verbosity in code where
explicit conversions or other method calls would usually be necessary. See the
[overloading/implicits use case](#use-case-limited-overloading-andor-implicit-conversions)
below.
overloading/implicits use case below.
* _Precise types_. Because generics give a _name_ to the specific type
implementing a trait, it is possible to be precise about places where that
exact type is required or produced. For example, a function
Expand All @@ -51,7 +50,7 @@ explicitly implement to be used by this generic function.
a `Vec<T>` contains elements of a single concrete type (and, indeed, the
vector representation is specialized to lay these out in line). Sometimes
heterogeneous collections are useful; see
[trait objects](#use-case-trait-objects) below.
trait objects below.
* _Signature verbosity_. Heavy use of generics can bloat function signatures.
**[Ed. note]** This problem may be mitigated by some language improvements; stay tuned.

Expand Down
4 changes: 2 additions & 2 deletions src/libcore/iter.rs
Expand Up @@ -434,7 +434,7 @@ pub trait Iterator {
/// `None`. Once `None` is encountered, `count()` returns the number of
/// times it called [`next()`].
///
/// [`next()`]: #method.next
/// [`next()`]: #tymethod.next
///
/// # Overflow Behavior
///
Expand Down Expand Up @@ -497,7 +497,7 @@ pub trait Iterator {
/// This method will evaluate the iterator `n` times, discarding those elements.
/// After it does so, it will call [`next()`] and return its value.
///
/// [`next()`]: #method.next
/// [`next()`]: #tymethod.next
///
/// Like most indexing operations, the count starts from zero, so `nth(0)`
/// returns the first value, `nth(1)` the second, and so on.
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/io/mod.rs
Expand Up @@ -1254,7 +1254,7 @@ pub trait BufRead: Read {
/// longer be returned. As such, this function may do odd things if
/// `fill_buf` isn't called before calling it.
///
/// [fillbuf]: #tymethod.fill_buff
/// [fillbuf]: #tymethod.fill_buf
///
/// The `amt` must be `<=` the number of bytes in the buffer returned by
/// `fill_buf`.
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/lib.rs
Expand Up @@ -190,7 +190,7 @@
//! [`thread`]: thread/index.html
//! [`use std::env`]: env/index.html
//! [`use`]: ../book/crates-and-modules.html#importing-modules-with-use
//! [crate root]: ../book/crates-and-modules.html#basic-terminology:-crates-and-modules
//! [crate root]: ../book/crates-and-modules.html#basic-terminology-crates-and-modules
//! [crates.io]: https://crates.io
//! [deref coercions]: ../book/deref-coercions.html
//! [files]: fs/struct.File.html
Expand Down
10 changes: 5 additions & 5 deletions src/libstd/net/tcp.rs
Expand Up @@ -196,7 +196,7 @@ impl TcpStream {
///
/// For more information about this option, see [`set_nodelay`][link].
///
/// [link]: #tymethod.set_nodelay
/// [link]: #method.set_nodelay
#[stable(feature = "net2_mutators", since = "1.9.0")]
pub fn nodelay(&self) -> io::Result<bool> {
self.0.nodelay()
Expand All @@ -215,7 +215,7 @@ impl TcpStream {
///
/// For more information about this option, see [`set_ttl`][link].
///
/// [link]: #tymethod.set_ttl
/// [link]: #method.set_ttl
#[stable(feature = "net2_mutators", since = "1.9.0")]
pub fn ttl(&self) -> io::Result<u32> {
self.0.ttl()
Expand All @@ -238,7 +238,7 @@ impl TcpStream {
///
/// For more information about this option, see [`set_only_v6`][link].
///
/// [link]: #tymethod.set_only_v6
/// [link]: #method.set_only_v6
#[stable(feature = "net2_mutators", since = "1.9.0")]
pub fn only_v6(&self) -> io::Result<bool> {
self.0.only_v6()
Expand Down Expand Up @@ -374,7 +374,7 @@ impl TcpListener {
///
/// For more information about this option, see [`set_ttl`][link].
///
/// [link]: #tymethod.set_ttl
/// [link]: #method.set_ttl
#[stable(feature = "net2_mutators", since = "1.9.0")]
pub fn ttl(&self) -> io::Result<u32> {
self.0.ttl()
Expand All @@ -397,7 +397,7 @@ impl TcpListener {
///
/// For more information about this option, see [`set_only_v6`][link].
///
/// [link]: #tymethod.set_only_v6
/// [link]: #method.set_only_v6
#[stable(feature = "net2_mutators", since = "1.9.0")]
pub fn only_v6(&self) -> io::Result<bool> {
self.0.only_v6()
Expand Down
16 changes: 8 additions & 8 deletions src/libstd/net/udp.rs
Expand Up @@ -155,7 +155,7 @@ impl UdpSocket {
/// For more information about this option, see
/// [`set_broadcast`][link].
///
/// [link]: #tymethod.set_broadcast
/// [link]: #method.set_broadcast
#[stable(feature = "net2_mutators", since = "1.9.0")]
pub fn broadcast(&self) -> io::Result<bool> {
self.0.broadcast()
Expand All @@ -175,7 +175,7 @@ impl UdpSocket {
/// For more information about this option, see
/// [`set_multicast_loop_v4`][link].
///
/// [link]: #tymethod.set_multicast_loop_v4
/// [link]: #method.set_multicast_loop_v4
#[stable(feature = "net2_mutators", since = "1.9.0")]
pub fn multicast_loop_v4(&self) -> io::Result<bool> {
self.0.multicast_loop_v4()
Expand All @@ -198,7 +198,7 @@ impl UdpSocket {
/// For more information about this option, see
/// [`set_multicast_ttl_v4`][link].
///
/// [link]: #tymethod.set_multicast_ttl_v4
/// [link]: #method.set_multicast_ttl_v4
#[stable(feature = "net2_mutators", since = "1.9.0")]
pub fn multicast_ttl_v4(&self) -> io::Result<u32> {
self.0.multicast_ttl_v4()
Expand All @@ -218,7 +218,7 @@ impl UdpSocket {
/// For more information about this option, see
/// [`set_multicast_loop_v6`][link].
///
/// [link]: #tymethod.set_multicast_loop_v6
/// [link]: #method.set_multicast_loop_v6
#[stable(feature = "net2_mutators", since = "1.9.0")]
pub fn multicast_loop_v6(&self) -> io::Result<bool> {
self.0.multicast_loop_v6()
Expand All @@ -237,7 +237,7 @@ impl UdpSocket {
///
/// For more information about this option, see [`set_ttl`][link].
///
/// [link]: #tymethod.set_ttl
/// [link]: #method.set_ttl
#[stable(feature = "net2_mutators", since = "1.9.0")]
pub fn ttl(&self) -> io::Result<u32> {
self.0.ttl()
Expand All @@ -260,7 +260,7 @@ impl UdpSocket {
///
/// For more information about this option, see [`set_only_v6`][link].
///
/// [link]: #tymethod.set_only_v6
/// [link]: #method.set_only_v6
#[stable(feature = "net2_mutators", since = "1.9.0")]
pub fn only_v6(&self) -> io::Result<bool> {
self.0.only_v6()
Expand Down Expand Up @@ -293,7 +293,7 @@ impl UdpSocket {
/// For more information about this option, see
/// [`join_multicast_v4`][link].
///
/// [link]: #tymethod.join_multicast_v4
/// [link]: #method.join_multicast_v4
#[stable(feature = "net2_mutators", since = "1.9.0")]
pub fn leave_multicast_v4(&self, multiaddr: &Ipv4Addr, interface: &Ipv4Addr) -> io::Result<()> {
self.0.leave_multicast_v4(multiaddr, interface)
Expand All @@ -304,7 +304,7 @@ impl UdpSocket {
/// For more information about this option, see
/// [`join_multicast_v6`][link].
///
/// [link]: #tymethod.join_multicast_v6
/// [link]: #method.join_multicast_v6
#[stable(feature = "net2_mutators", since = "1.9.0")]
pub fn leave_multicast_v6(&self, multiaddr: &Ipv6Addr, interface: u32) -> io::Result<()> {
self.0.leave_multicast_v6(multiaddr, interface)
Expand Down

0 comments on commit 6a76872

Please sign in to comment.