Skip to content

Commit ef2e8bf

Browse files
authored
Rollup merge of #126717 - nnethercote:rustfmt-use-pre-cleanups, r=jieyouxu
Clean up some comments near `use` declarations #125443 will reformat all `use` declarations in the repository. There are a few edge cases involving comments on `use` declarations that require care. This PR cleans up some clumsy comment cases, taking us a step closer to #125443 being able to merge. r? ``@lqd``
2 parents 7b91d11 + b5a5647 commit ef2e8bf

File tree

75 files changed

+98
-33
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+98
-33
lines changed

compiler/rustc_builtin_macros/src/test.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
//! The expansion from a test function to the appropriate test struct for libtest
2+
//! Ideally, this code would be in libtest but for efficiency and error messages it lives here.
3+
14
use crate::errors;
2-
/// The expansion from a test function to the appropriate test struct for libtest
3-
/// Ideally, this code would be in libtest but for efficiency and error messages it lives here.
45
use crate::util::{check_builtin_macro_attribute, warn_on_duplicate_attribute};
56
use rustc_ast::ptr::P;
67
use rustc_ast::{self as ast, attr, GenericParamKind};

compiler/rustc_codegen_gcc/tests/lang_tests_common.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
//! The common code for `tests/lang_tests_*.rs`
2+
23
use std::{
34
env::{self, current_dir},
45
path::{Path, PathBuf},

compiler/rustc_codegen_ssa/src/mir/locals.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//! Locals are in a private module as updating `LocalRef::Operand` has to
22
//! be careful wrt to subtyping. To deal with this we only allow updates by using
33
//! `FunctionCx::overwrite_local` which handles it automatically.
4+
45
use crate::mir::{FunctionCx, LocalRef};
56
use crate::traits::BuilderMethods;
67
use rustc_index::IndexVec;

compiler/rustc_data_structures/src/base_n.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
/// Converts unsigned integers into a string representation with some base.
2-
/// Bases up to and including 36 can be used for case-insensitive things.
1+
//! Converts unsigned integers into a string representation with some base.
2+
//! Bases up to and including 36 can be used for case-insensitive things.
3+
34
use std::ascii;
45
use std::fmt;
56

compiler/rustc_errors/src/markdown/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//! A simple markdown parser that can write formatted text to the terminal
22
//!
33
//! Entrypoint is `MdStream::parse_str(...)`
4+
45
use std::io;
56

67
use termcolor::{Buffer, BufferWriter, ColorChoice};

compiler/rustc_expand/src/mbe/macro_check.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@
104104
//! Kleene operators under which a meta-variable is repeating is the concatenation of the stacks
105105
//! stored when entering a macro definition starting from the state in which the meta-variable is
106106
//! bound.
107+
107108
use crate::errors;
108109
use crate::mbe::{KleeneToken, TokenTree};
109110

compiler/rustc_fs_util/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
// tidy-alphabetical-start
21
use std::ffi::CString;
32
use std::fs;
43
use std::io;
54
use std::path::{absolute, Path, PathBuf};
6-
// tidy-alphabetical-end
75

86
// Unfortunately, on windows, it looks like msvcrt.dll is silently translating
97
// verbatim paths under the hood to non-verbatim paths! This manifests itself as

compiler/rustc_hir_analysis/src/check/dropck.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// FIXME(@lcnr): Move this module out of `rustc_hir_analysis`.
22
//
33
// We don't do any drop checking during hir typeck.
4+
45
use rustc_data_structures::fx::FxHashSet;
56
use rustc_errors::{codes::*, struct_span_code_err, ErrorGuaranteed};
67
use rustc_infer::infer::outlives::env::OutlivesEnvironment;

compiler/rustc_hir_typeck/src/autoderef.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
//! Some helper functions for `AutoDeref`
1+
//! Some helper functions for `AutoDeref`.
2+
23
use super::method::MethodCallee;
34
use super::{FnCtxt, PlaceOp};
45

compiler/rustc_hir_typeck/src/errors.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
//! Errors emitted by `rustc_hir_typeck`.
2+
23
use std::borrow::Cow;
34

45
use crate::fluent_generated as fluent;

0 commit comments

Comments
 (0)