Skip to content

Commit d5de4c6

Browse files
committed
Revert "Add from docs for tools"
This reverts commit df90691.
1 parent 8de849e commit d5de4c6

File tree

23 files changed

+8
-93
lines changed

23 files changed

+8
-93
lines changed

src/tools/clippy/clippy_lints/src/attrs/mixed_attributes_style.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ enum SimpleAttrKind {
1515
}
1616

1717
impl From<&AttrKind> for SimpleAttrKind {
18-
/// Convert an `AttrKind` to a `SimpleAttrKind`, if it's a `DocComment` then `Doc` is returned with no conversion.
18+
/// Convert an `AttrKind` to a `SimpleAttrKind`,
19+
/// if it's a `DocComment` then `Doc` is returned with no conversion.
1920
///
2021
/// ## Cost
2122
/// If `AttrKind` is `DocComment` it's free, however if it's `Normal` their is heep allocation

src/tools/miri/src/concurrency/thread.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ impl Idx for ThreadId {
8080
}
8181

8282
impl From<ThreadId> for u64 {
83-
/// Return inner `u32` converted to `u64`
83+
/// Return inner `u32` converted to `u64`.
8484
fn from(t: ThreadId) -> Self {
8585
t.0.into()
8686
}

src/tools/miri/src/concurrency/vector_clock.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ impl Idx for VectorIdx {
3434
}
3535

3636
impl From<u32> for VectorIdx {
37-
/// Create new `VectorIdx` with `u32` as inner
37+
/// Create new `VectorIdx` with `u32` as inner.
3838
#[inline]
3939
fn from(id: u32) -> Self {
4040
Self(id)

src/tools/miri/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ extern crate rustc_middle;
7474
extern crate rustc_session;
7575
extern crate rustc_span;
7676
extern crate rustc_target;
77-
// Linking `rustc_driver` pulls in the required object code as the rest of the rustc crates are
77+
// Linking `rustc_driver` pulls in the required object code as the rest of the rustc crates are
7878
// shipped only as rmeta files.
7979
#[allow(unused_extern_crates)]
8080
extern crate rustc_driver;

src/tools/miri/src/shims/io_error.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,21 @@ pub enum IoError {
1414
pub use self::IoError::*;
1515

1616
impl From<io::Error> for IoError {
17-
/// Wrap `io::Error` in `HostError`
17+
/// Wrap `io::Error` in `HostError`.
1818
fn from(value: io::Error) -> Self {
1919
IoError::HostError(value)
2020
}
2121
}
2222

2323
impl From<io::ErrorKind> for IoError {
24-
/// Convert a `io::ErrorKind` to a `io::Error` then wrap in `HostError`
24+
/// Convert a `io::ErrorKind` to a `io::Error` then wrap in `HostError`.
2525
fn from(value: io::ErrorKind) -> Self {
2626
IoError::HostError(value.into())
2727
}
2828
}
2929

3030
impl From<Scalar> for IoError {
31-
/// Wrap `Scalar` in `Raw`
31+
/// Wrap `Scalar` in `Raw`.
3232
fn from(value: Scalar) -> Self {
3333
IoError::Raw(value)
3434
}

src/tools/rust-analyzer/crates/base-db/src/input.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,6 @@ pub enum LangCrateOrigin {
173173
}
174174

175175
impl From<&str> for LangCrateOrigin {
176-
/// Match a string slice for "alloc", "core", "proc-macro", "proc_macro", "std", "test",
177-
/// mapping them to variants of the same name; if none match then it's `Other`
178176
fn from(s: &str) -> Self {
179177
match s {
180178
"alloc" => LangCrateOrigin::Alloc,
@@ -219,10 +217,6 @@ impl CrateDisplayName {
219217
}
220218

221219
impl From<CrateName> for CrateDisplayName {
222-
/// Creates a `CrateDisplayName` from `crate_name` and `crate_name.0`(inner)
223-
///
224-
/// ## Cost
225-
/// This clones `CrateName`
226220
fn from(crate_name: CrateName) -> CrateDisplayName {
227221
let canonical_name = crate_name.0.clone();
228222
CrateDisplayName { crate_name, canonical_name }
@@ -640,10 +634,6 @@ impl Env {
640634
}
641635

642636
impl From<Env> for Vec<(String, String)> {
643-
/// Iterates the hash map entries collects them in to a `Vec` then sorts it.
644-
///
645-
/// ## Cost
646-
/// This is expensive as it `collect`s and `sort`s env
647637
fn from(env: Env) -> Vec<(String, String)> {
648638
let mut entries: Vec<_> = env.entries.into_iter().collect();
649639
entries.sort();

src/tools/rust-analyzer/crates/cfg/src/cfg_expr.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ pub enum CfgExpr {
3838
}
3939

4040
impl From<CfgAtom> for CfgExpr {
41-
/// Wrap `CfgAtom` in `CfgExpr::Atom`
4241
fn from(atom: CfgAtom) -> Self {
4342
CfgExpr::Atom(atom)
4443
}

src/tools/rust-analyzer/crates/hir-def/src/attr.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,6 @@ pub enum DocExpr {
245245
}
246246

247247
impl From<DocAtom> for DocExpr {
248-
/// Creates `Atom` with `DocAtom`
249248
fn from(atom: DocAtom) -> Self {
250249
DocExpr::Atom(atom)
251250
}

src/tools/rust-analyzer/crates/hir-def/src/hir.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ impl Literal {
146146
}
147147

148148
impl From<ast::LiteralKind> for Literal {
149-
/// Create a `Literal` by matching `LiteralKind`
150149
fn from(ast_lit_kind: ast::LiteralKind) -> Self {
151150
use ast::LiteralKind;
152151
match ast_lit_kind {

src/tools/rust-analyzer/crates/hir-def/src/hir/type_ref.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -637,8 +637,6 @@ impl LiteralConstRef {
637637
}
638638

639639
impl From<Literal> for LiteralConstRef {
640-
/// Make a `LiteralConstRef` from `Literal`
641-
/// - Note: `Char`, `Bool`, `Int`, `Uint` match, other types are not const and return a `Unknown`
642640
fn from(literal: Literal) -> Self {
643641
match literal {
644642
Literal::Char(c) => Self::Char(c),

0 commit comments

Comments
 (0)