Skip to content

Commit c2bbe33

Browse files
committed
Const items have by default a static lifetime, there's no need to annotate it. (clippy::redundant_static_lifetimes)
1 parent edd3e17 commit c2bbe33

File tree

8 files changed

+14
-14
lines changed

8 files changed

+14
-14
lines changed

src/librustc/mir/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1198,7 +1198,7 @@ impl<'tcx> TerminatorKind<'tcx> {
11981198
t: BasicBlock,
11991199
f: BasicBlock,
12001200
) -> TerminatorKind<'tcx> {
1201-
static BOOL_SWITCH_FALSE: &'static [u128] = &[0];
1201+
static BOOL_SWITCH_FALSE: &[u128] = &[0];
12021202
TerminatorKind::SwitchInt {
12031203
discr: cond,
12041204
switch_ty: tcx.types.bool,

src/librustc_mir/dataflow/generic/graphviz.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -604,8 +604,8 @@ fn write_diff<A: Analysis<'tcx>>(
604604
Ok(())
605605
}
606606

607-
const BR_LEFT: &'static str = r#"<br align="left"/>"#;
608-
const BR_LEFT_SPACE: &'static str = r#"<br align="left"/> "#;
607+
const BR_LEFT: &str = r#"<br align="left"/>"#;
608+
const BR_LEFT_SPACE: &str = r#"<br align="left"/> "#;
609609

610610
/// Line break policy that breaks at 40 characters and starts the next line with a single space.
611611
const LIMIT_30_ALIGN_1: Option<LineBreak> = Some(LineBreak { sequence: BR_LEFT_SPACE, limit: 30 });

src/librustc_parse/parser/diagnostics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use rustc_span::{MultiSpan, Span, SpanSnippetError, DUMMY_SP};
1919
use log::{debug, trace};
2020
use std::mem;
2121

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

2424
/// Creates a placeholder argument.
2525
pub(super) fn dummy_arg(ident: Ident) -> Param {

src/librustdoc/clean/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ pub use self::types::Type::*;
5050
pub use self::types::Visibility::{Inherited, Public};
5151
pub use self::types::*;
5252

53-
const FN_OUTPUT_NAME: &'static str = "Output";
53+
const FN_OUTPUT_NAME: &str = "Output";
5454

5555
pub trait Clean<T> {
5656
fn clean(&self, cx: &DocContext<'_>) -> T;

src/librustdoc/html/item_type.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ impl fmt::Display for ItemType {
194194
}
195195
}
196196

197-
pub const NAMESPACE_TYPE: &'static str = "t";
198-
pub const NAMESPACE_VALUE: &'static str = "v";
199-
pub const NAMESPACE_MACRO: &'static str = "m";
200-
pub const NAMESPACE_KEYWORD: &'static str = "k";
197+
pub const NAMESPACE_TYPE: &str = "t";
198+
pub const NAMESPACE_VALUE: &str = "v";
199+
pub const NAMESPACE_MACRO: &str = "m";
200+
pub const NAMESPACE_KEYWORD: &str = "k";

src/librustdoc/html/render.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3150,7 +3150,7 @@ fn render_attribute(attr: &ast::MetaItem) -> Option<String> {
31503150
}
31513151
}
31523152

3153-
const ATTRIBUTE_WHITELIST: &'static [Symbol] = &[
3153+
const ATTRIBUTE_WHITELIST: &[Symbol] = &[
31543154
sym::export_name,
31553155
sym::lang,
31563156
sym::link_section,
@@ -4610,7 +4610,7 @@ fn item_keyword(w: &mut Buffer, cx: &Context, it: &clean::Item) {
46104610
document(w, cx, it)
46114611
}
46124612

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

46154615
fn make_item_keywords(it: &clean::Item) -> String {
46164616
format!("{}, {}", BASIC_KEYWORDS, it.name.as_ref().unwrap())

src/libstd/sys/unix/process/process_common.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ cfg_if::cfg_if! {
1919
if #[cfg(target_os = "fuchsia")] {
2020
// fuchsia doesn't have /dev/null
2121
} else if #[cfg(target_os = "redox")] {
22-
const DEV_NULL: &'static str = "null:\0";
22+
const DEV_NULL: &str = "null:\0";
2323
} else {
24-
const DEV_NULL: &'static str = "/dev/null\0";
24+
const DEV_NULL: &str = "/dev/null\0";
2525
}
2626
}
2727

src/libtest/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ use time::TestExecTime;
9696
// Process exit code to be used to indicate test failures.
9797
const ERROR_EXIT_CODE: i32 = 101;
9898

99-
const SECONDARY_TEST_INVOKER_VAR: &'static str = "__RUST_TEST_INVOKE";
99+
const SECONDARY_TEST_INVOKER_VAR: &str = "__RUST_TEST_INVOKE";
100100

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

0 commit comments

Comments
 (0)