Skip to content

Remove redundant 'static #78075

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 18, 2020
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
2 changes: 1 addition & 1 deletion compiler/rustc_feature/src/builtin_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ pub fn is_builtin_attr_name(name: Symbol) -> bool {
BUILTIN_ATTRIBUTE_MAP.get(&name).is_some()
}

pub static BUILTIN_ATTRIBUTE_MAP: SyncLazy<FxHashMap<Symbol, &'static BuiltinAttribute>> =
pub static BUILTIN_ATTRIBUTE_MAP: SyncLazy<FxHashMap<Symbol, &BuiltinAttribute>> =
SyncLazy::new(|| {
let mut map = FxHashMap::default();
for attr in BUILTIN_ATTRIBUTES.iter() {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_parse/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use std::str;

use tracing::{debug, info};

pub const MACRO_ARGUMENTS: Option<&'static str> = Some("macro arguments");
pub const MACRO_ARGUMENTS: Option<&str> = Some("macro arguments");

#[macro_use]
pub mod parser;
Expand Down
6 changes: 3 additions & 3 deletions library/core/benches/ascii.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,9 @@ macro_rules! repeat {
};
}

const SHORT: &'static str = "Alice's";
const MEDIUM: &'static str = "Alice's Adventures in Wonderland";
const LONG: &'static str = repeat!(
const SHORT: &str = "Alice's";
const MEDIUM: &str = "Alice's Adventures in Wonderland";
const LONG: &str = repeat!(
r#"
La Guida di Bragia, a Ballad Opera for the Marionette Theatre (around 1850)
Alice's Adventures in Wonderland (1865)
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/net/addr/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ fn bind_udp_socket_bad() {
// returns its own address, it is still an error to bind a UDP socket to
// a non-local address, and so we still get an error here in that case.

const INPUT_23076: &'static str = "1200::AB00:1234::2552:7777:1313:34300";
const INPUT_23076: &str = "1200::AB00:1234::2552:7777:1313:34300";

assert!(crate::net::UdpSocket::bind(INPUT_23076).is_err())
}
Expand Down
14 changes: 7 additions & 7 deletions library/std/src/sys/sgx/env.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
pub mod os {
pub const FAMILY: &'static str = "";
pub const OS: &'static str = "";
pub const DLL_PREFIX: &'static str = "";
pub const DLL_SUFFIX: &'static str = ".sgxs";
pub const DLL_EXTENSION: &'static str = "sgxs";
pub const EXE_SUFFIX: &'static str = ".sgxs";
pub const EXE_EXTENSION: &'static str = "sgxs";
pub const FAMILY: &str = "";
pub const OS: &str = "";
pub const DLL_PREFIX: &str = "";
pub const DLL_SUFFIX: &str = ".sgxs";
pub const DLL_EXTENSION: &str = "sgxs";
pub const EXE_SUFFIX: &str = ".sgxs";
pub const EXE_EXTENSION: &str = "sgxs";
}
2 changes: 1 addition & 1 deletion library/std/src/sys/sgx/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ pub fn parse_prefix(_: &OsStr) -> Option<Prefix<'_>> {
None
}

pub const MAIN_SEP_STR: &'static str = "/";
pub const MAIN_SEP_STR: &str = "/";
pub const MAIN_SEP: char = '/';