Skip to content

Commit

Permalink
Const items have by default a static lifetime, there's no need to ann…
Browse files Browse the repository at this point in the history
…otate it. (clippy::redundant_static_lifetimes)
  • Loading branch information
matthiaskrgr committed Mar 5, 2020
1 parent edd3e17 commit c2bbe33
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/librustc/mir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,7 @@ impl<'tcx> TerminatorKind<'tcx> {
t: BasicBlock,
f: BasicBlock,
) -> TerminatorKind<'tcx> {
static BOOL_SWITCH_FALSE: &'static [u128] = &[0];
static BOOL_SWITCH_FALSE: &[u128] = &[0];
TerminatorKind::SwitchInt {
discr: cond,
switch_ty: tcx.types.bool,
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_mir/dataflow/generic/graphviz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -604,8 +604,8 @@ fn write_diff<A: Analysis<'tcx>>(
Ok(())
}

const BR_LEFT: &'static str = r#"<br align="left"/>"#;
const BR_LEFT_SPACE: &'static str = r#"<br align="left"/> "#;
const BR_LEFT: &str = r#"<br align="left"/>"#;
const BR_LEFT_SPACE: &str = r#"<br align="left"/> "#;

/// Line break policy that breaks at 40 characters and starts the next line with a single space.
const LIMIT_30_ALIGN_1: Option<LineBreak> = Some(LineBreak { sequence: BR_LEFT_SPACE, limit: 30 });
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_parse/parser/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use rustc_span::{MultiSpan, Span, SpanSnippetError, DUMMY_SP};
use log::{debug, trace};
use std::mem;

const TURBOFISH: &'static str = "use `::<...>` instead of `<...>` to specify type arguments";
const TURBOFISH: &str = "use `::<...>` instead of `<...>` to specify type arguments";

/// Creates a placeholder argument.
pub(super) fn dummy_arg(ident: Ident) -> Param {
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/clean/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub use self::types::Type::*;
pub use self::types::Visibility::{Inherited, Public};
pub use self::types::*;

const FN_OUTPUT_NAME: &'static str = "Output";
const FN_OUTPUT_NAME: &str = "Output";

pub trait Clean<T> {
fn clean(&self, cx: &DocContext<'_>) -> T;
Expand Down
8 changes: 4 additions & 4 deletions src/librustdoc/html/item_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ impl fmt::Display for ItemType {
}
}

pub const NAMESPACE_TYPE: &'static str = "t";
pub const NAMESPACE_VALUE: &'static str = "v";
pub const NAMESPACE_MACRO: &'static str = "m";
pub const NAMESPACE_KEYWORD: &'static str = "k";
pub const NAMESPACE_TYPE: &str = "t";
pub const NAMESPACE_VALUE: &str = "v";
pub const NAMESPACE_MACRO: &str = "m";
pub const NAMESPACE_KEYWORD: &str = "k";
4 changes: 2 additions & 2 deletions src/librustdoc/html/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3150,7 +3150,7 @@ fn render_attribute(attr: &ast::MetaItem) -> Option<String> {
}
}

const ATTRIBUTE_WHITELIST: &'static [Symbol] = &[
const ATTRIBUTE_WHITELIST: &[Symbol] = &[
sym::export_name,
sym::lang,
sym::link_section,
Expand Down Expand Up @@ -4610,7 +4610,7 @@ fn item_keyword(w: &mut Buffer, cx: &Context, it: &clean::Item) {
document(w, cx, it)
}

crate const BASIC_KEYWORDS: &'static str = "rust, rustlang, rust-lang";
crate const BASIC_KEYWORDS: &str = "rust, rustlang, rust-lang";

fn make_item_keywords(it: &clean::Item) -> String {
format!("{}, {}", BASIC_KEYWORDS, it.name.as_ref().unwrap())
Expand Down
4 changes: 2 additions & 2 deletions src/libstd/sys/unix/process/process_common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ cfg_if::cfg_if! {
if #[cfg(target_os = "fuchsia")] {
// fuchsia doesn't have /dev/null
} else if #[cfg(target_os = "redox")] {
const DEV_NULL: &'static str = "null:\0";
const DEV_NULL: &str = "null:\0";
} else {
const DEV_NULL: &'static str = "/dev/null\0";
const DEV_NULL: &str = "/dev/null\0";
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/libtest/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ use time::TestExecTime;
// Process exit code to be used to indicate test failures.
const ERROR_EXIT_CODE: i32 = 101;

const SECONDARY_TEST_INVOKER_VAR: &'static str = "__RUST_TEST_INVOKE";
const SECONDARY_TEST_INVOKER_VAR: &str = "__RUST_TEST_INVOKE";

// The default console test runner. It accepts the command line
// arguments and a vector of test_descs.
Expand Down

0 comments on commit c2bbe33

Please sign in to comment.