This fix suppresses dead_code warnings from code generated by regex! when
the result of regex! is unused. Correct behavior should be a single
unused variable warning.
Regression tests are included for both `let` and `static` bound regex!
values.
An empty regex is a valid regex that always matches. This behavior
is consistent with at least Go and Python.
A couple regression tests are included.
I'd just assume that an empty regex is an invalid regex and that an error should be returned (I can't think of any reason to use an empty regex?), but it's probably better to be consistent with other regex libraries.
Example URL in CrateId documentation is:
`gihub.com/mozilla/rust`
Instead of:
`github.com/mozilla/rust`
Also update libsyntax/crateid.rs licensing header for 2014.
As part of removing `pub use` glob, two extra import globs were
injected to make `quote_expr!` work. However the globs caused
`unused_import` warning in some places.
Quasiquoter needed the globs since it generated idents (e.g. `TyU`)
rather than absolute paths (`::syntax::ast::TyU`).
This patch removes the extra globs and makes quasiquoter use absolute
paths.
Fixes#14618
cc @sfackler
As part of removing `pub use` glob, two extra import globs were
injected to make `quote_expr!` work. However the globs caused
`unused_import` warning in some places.
Quasiquoter needed the globs since it generated idents (e.g. `TyU`)
rather than absolute paths (`::syntax::ast::TyU`).
This patch removes the extra globs and makes quasiquoter use absolute
paths.
Fixes#14618
Now that rustdoc understands proper language tags
as the code not being Rust, we can tag everything
properly. `norust` as a negative statement is a bad
tag.
This change tags examples in other languages by
their language. Plain notations are marked as `text`.
Console examples are marked as `console`.
Also fix markdown.rs to not highlight non-rust code.
Amends the documentation to reflect the new
behaviour.
Now that rustdoc understands proper language tags
as the code not being Rust, we can tag everything
properly.
This change tags examples in other languages by
their language. Plain notations are marked as `text`.
Console examples are marked as `console`.
Also fix markdown.rs to not highlight non-rust code.
This changes the parsing of the language string
in code examples so that unrecognized examples
are not considered Rust code. This was, for example,
the case when a code example was marked `sh` for shell
code.
This relieves authors of having to mark those samples
as `notrust`.
Also adds recognition of the positive marker `rust`.
By default, unmarked examples are still considered rust.
This changes the parsing of the language string
in code examples so that unrecognized examples
are not considered Rust code. This was, for example,
the case when a code example was marked `sh` for shell
code.
This relieves authors of having to mark those samples
as `notrust`.
Also adds recognition of the positive marker `rust`.
By default, unmarked examples are still considered rust.
If any rust-specific tags are seen, code is considered
rust unless marked as "notrust".
Adds test cases for the detection logic.
This completes the last stage of the renaming of the comparison hierarchy of
traits. This change renames TotalEq to Eq and TotalOrd to Ord.
In the future the new Eq/Ord will be filled out with their appropriate methods,
but for now this change is purely a renaming change.
This continues the work of #12517, continuing the work in #14534. This patch accomplishes the final rename of `TotalEq` to `TotalOrd`. I wanted to get this patch landed ASAP so we don't have to deal much with "where did `Eq` and `Ord` go?"
I have yet to do another pruning pass over the compiler to change all usage of `PartialEq` to `Eq` where appropriate. I will do this soon as well.
This completes the last stage of the renaming of the comparison hierarchy of
traits. This change renames TotalEq to Eq and TotalOrd to Ord.
In the future the new Eq/Ord will be filled out with their appropriate methods,
but for now this change is purely a renaming change.
[breaking-change]
Cross crate links can target items which are not rendered in the documentation.
If the item is reexported at a higher level, the destination of the link (a
concatenation of the fully qualified name) may actually lead to nowhere. This
fixes this problem by altering rustdoc to emit pages which redirect to the local
copy of the reexported structure.
cc #14515Closes#14137