Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions library/proc_macro/src/bridge/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,7 @@ impl Symbol {

// Mimics the behavior of `Symbol::can_be_raw` from `rustc_span`
fn can_be_raw(string: &str) -> bool {
match string {
"_" | "super" | "self" | "Self" | "crate" | "$crate" => false,
_ => true,
}
!matches!(string, "_" | "super" | "self" | "Self" | "crate" | "$crate")
}
}

Expand Down
3 changes: 1 addition & 2 deletions library/proc_macro/src/escape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ pub(crate) fn escape_bytes(bytes: &[u8], opt: EscapeOptions) -> String {
escape_single_byte(byte, opt, &mut repr);
}
} else {
let mut chunks = bytes.utf8_chunks();
while let Some(chunk) = chunks.next() {
for chunk in bytes.utf8_chunks() {
for ch in chunk.valid().chars() {
escape_single_char(ch, opt, &mut repr);
}
Expand Down
9 changes: 3 additions & 6 deletions library/proc_macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! This library, provided by the standard distribution, provides the types
//! consumed in the interfaces of procedurally defined macro definitions such as
//! function-like macros `#[proc_macro]`, macro attributes `#[proc_macro_attribute]` and
//! custom derive attributes`#[proc_macro_derive]`.
//! custom derive attributes `#[proc_macro_derive]`.
//!
//! See [the book] for more.
//!
Expand Down Expand Up @@ -210,7 +210,6 @@ impl FromStr for TokenStream {
/// `TokenTree::Punct`, or `TokenTree::Literal`.
#[stable(feature = "proc_macro_lib", since = "1.15.0")]
impl fmt::Display for TokenStream {
#[allow(clippy::recursive_format_impl)] // clippy doesn't see the specialization
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match &self.0 {
Some(ts) => write!(f, "{}", ts.to_string()),
Expand All @@ -219,7 +218,7 @@ impl fmt::Display for TokenStream {
}
}

/// Prints token in a form convenient for debugging.
/// Prints tokens in a form convenient for debugging.
#[stable(feature = "proc_macro_lib", since = "1.15.0")]
impl fmt::Debug for TokenStream {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
Expand Down Expand Up @@ -571,7 +570,7 @@ impl Span {
/// This path should not be embedded in the output of the macro; prefer `file()` instead.
#[stable(feature = "proc_macro_span_file", since = "1.88.0")]
pub fn local_file(&self) -> Option<PathBuf> {
self.0.local_file().map(|s| PathBuf::from(s))
self.0.local_file().map(PathBuf::from)
}

/// Creates a new span encompassing `self` and `other`.
Expand Down Expand Up @@ -750,7 +749,6 @@ impl From<Literal> for TokenTree {
/// `TokenTree::Punct`, or `TokenTree::Literal`.
#[stable(feature = "proc_macro_lib2", since = "1.29.0")]
impl fmt::Display for TokenTree {
#[allow(clippy::recursive_format_impl)] // clippy doesn't see the specialization
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
TokenTree::Group(t) => write!(f, "{t}"),
Expand Down Expand Up @@ -888,7 +886,6 @@ impl Group {
/// with `Delimiter::None` delimiters.
#[stable(feature = "proc_macro_lib2", since = "1.29.0")]
impl fmt::Display for Group {
#[allow(clippy::recursive_format_impl)] // clippy doesn't see the specialization
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", TokenStream::from(TokenTree::from(self.clone())))
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/html/static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1669,7 +1669,7 @@ function preLoadCss(cssUrl) {
restrict the search to a given item kind.",
"Accepted kinds are: <code>fn</code>, <code>mod</code>, <code>struct</code>, \
<code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, \
and <code>const</code>.",
and <code>constant</code>.",
"Search functions by type signature (e.g., <code>vec -&gt; usize</code> or \
<code>-&gt; vec</code> or <code>String, enum:Cow -&gt; bool</code>)",
"You can look for items with an exact name by putting double quotes around \
Expand Down
2 changes: 1 addition & 1 deletion src/tools/rust-installer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ To combine installers.

# Future work

* Make install.sh not have to be customized, pull it's data from a
* Make install.sh not have to be customized, pull its data from a
config file.
* Be more resilient to installation failures, particularly if the disk
is full.
Expand Down
2 changes: 1 addition & 1 deletion src/tools/test-float-parse/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ For each test case, the following is done:
representation with infinite precision.
- The rational value then gets checked that it is within the float's
representable values (absolute value greater than the smallest number to round
to zero, but less less than the first value to round to infinity). If these
to zero, but less than the first value to round to infinity). If these
limits are exceeded, check that the parsed float reflects that.
- For real nonzero numbers, the parsed float is converted into a rational using
`significand * 2^exponent`. It is then checked against the actual rational
Expand Down
6 changes: 3 additions & 3 deletions tests/ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ Tests for crate resolution and loading behavior, including `extern crate` declar

## `tests/ui/cross/`: Various tests related to the concept of "cross"

**FIXME**: The unifying topic of these tests appears to be that their filenames begin with the word "cross". The similarities end there - one test is about "cross-borrowing" a `Box<T>` into `&T`, while another is about a global trait used "across" files. Some of these terminology are really outdated and does not match the current terminology. Additionally, "cross" is also way too generic, it's easy to confuse with cross-compile.
**FIXME**: The unifying topic of these tests appears to be that their filenames begin with the word "cross". The similarities end there - one test is about "cross-borrowing" a `Box<T>` into `&T`, while another is about a global trait used "across" files. Some of this terminology is really outdated and does not match the current terminology. Additionally, "cross" is also way too generic, it's easy to confuse with cross-compile.

## `tests/ui/cross-crate/`: Cross-Crate Interaction

Expand Down Expand Up @@ -911,7 +911,7 @@ Something is missing which could be added to fix (e.g. suggestions).

Tests for checking missing trait bounds, and their diagnostics.

**FIMXE**: Maybe a subdirectory of `ui/trait-bounds` would be more appropriate.
**FIXME**: Maybe a subdirectory of `ui/trait-bounds` would be more appropriate.

## `tests/ui/modules/`

Expand Down Expand Up @@ -957,7 +957,7 @@ Despite the size of the directory, this is a single test, spawning a sprawling `

A very similar principle as `non_modrs_mods`, but with an added inline `mod` statement inside another `mod`'s code block.

**FXIME**: Consider merge with `tests/ui/modules/`, keeping the directory structure.
**FIXME**: Consider merge with `tests/ui/modules/`, keeping the directory structure.

## `tests/ui/no_std/`

Expand Down
Loading