Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 81d043b

Browse files
authoredDec 4, 2018
Rollup merge of #56497 - ljedrz:cleanup_libstd_const_lifetimes, r=kennytm
cleanup: remove static lifetimes from consts in libstd
2 parents 5985875 + 8c4129c commit 81d043b

File tree

16 files changed

+173
-173
lines changed

16 files changed

+173
-173
lines changed
 

‎src/libstd/env.rs

+21-21
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,7 @@ pub mod consts {
828828
/// - s390x
829829
/// - sparc64
830830
#[stable(feature = "env", since = "1.0.0")]
831-
pub const ARCH: &'static str = super::arch::ARCH;
831+
pub const ARCH: &str = super::arch::ARCH;
832832

833833
/// The family of the operating system. Example value is `unix`.
834834
///
@@ -837,7 +837,7 @@ pub mod consts {
837837
/// - unix
838838
/// - windows
839839
#[stable(feature = "env", since = "1.0.0")]
840-
pub const FAMILY: &'static str = os::FAMILY;
840+
pub const FAMILY: &str = os::FAMILY;
841841

842842
/// A string describing the specific operating system in use.
843843
/// Example value is `linux`.
@@ -856,7 +856,7 @@ pub mod consts {
856856
/// - android
857857
/// - windows
858858
#[stable(feature = "env", since = "1.0.0")]
859-
pub const OS: &'static str = os::OS;
859+
pub const OS: &str = os::OS;
860860

861861
/// Specifies the filename prefix used for shared libraries on this
862862
/// platform. Example value is `lib`.
@@ -866,7 +866,7 @@ pub mod consts {
866866
/// - lib
867867
/// - `""` (an empty string)
868868
#[stable(feature = "env", since = "1.0.0")]
869-
pub const DLL_PREFIX: &'static str = os::DLL_PREFIX;
869+
pub const DLL_PREFIX: &str = os::DLL_PREFIX;
870870

871871
/// Specifies the filename suffix used for shared libraries on this
872872
/// platform. Example value is `.so`.
@@ -877,7 +877,7 @@ pub mod consts {
877877
/// - .dylib
878878
/// - .dll
879879
#[stable(feature = "env", since = "1.0.0")]
880-
pub const DLL_SUFFIX: &'static str = os::DLL_SUFFIX;
880+
pub const DLL_SUFFIX: &str = os::DLL_SUFFIX;
881881

882882
/// Specifies the file extension used for shared libraries on this
883883
/// platform that goes after the dot. Example value is `so`.
@@ -888,7 +888,7 @@ pub mod consts {
888888
/// - dylib
889889
/// - dll
890890
#[stable(feature = "env", since = "1.0.0")]
891-
pub const DLL_EXTENSION: &'static str = os::DLL_EXTENSION;
891+
pub const DLL_EXTENSION: &str = os::DLL_EXTENSION;
892892

893893
/// Specifies the filename suffix used for executable binaries on this
894894
/// platform. Example value is `.exe`.
@@ -900,7 +900,7 @@ pub mod consts {
900900
/// - .pexe
901901
/// - `""` (an empty string)
902902
#[stable(feature = "env", since = "1.0.0")]
903-
pub const EXE_SUFFIX: &'static str = os::EXE_SUFFIX;
903+
pub const EXE_SUFFIX: &str = os::EXE_SUFFIX;
904904

905905
/// Specifies the file extension, if any, used for executable binaries
906906
/// on this platform. Example value is `exe`.
@@ -910,72 +910,72 @@ pub mod consts {
910910
/// - exe
911911
/// - `""` (an empty string)
912912
#[stable(feature = "env", since = "1.0.0")]
913-
pub const EXE_EXTENSION: &'static str = os::EXE_EXTENSION;
913+
pub const EXE_EXTENSION: &str = os::EXE_EXTENSION;
914914
}
915915

916916
#[cfg(target_arch = "x86")]
917917
mod arch {
918-
pub const ARCH: &'static str = "x86";
918+
pub const ARCH: &str = "x86";
919919
}
920920

921921
#[cfg(target_arch = "x86_64")]
922922
mod arch {
923-
pub const ARCH: &'static str = "x86_64";
923+
pub const ARCH: &str = "x86_64";
924924
}
925925

926926
#[cfg(target_arch = "arm")]
927927
mod arch {
928-
pub const ARCH: &'static str = "arm";
928+
pub const ARCH: &str = "arm";
929929
}
930930

931931
#[cfg(target_arch = "aarch64")]
932932
mod arch {
933-
pub const ARCH: &'static str = "aarch64";
933+
pub const ARCH: &str = "aarch64";
934934
}
935935

936936
#[cfg(target_arch = "mips")]
937937
mod arch {
938-
pub const ARCH: &'static str = "mips";
938+
pub const ARCH: &str = "mips";
939939
}
940940

941941
#[cfg(target_arch = "mips64")]
942942
mod arch {
943-
pub const ARCH: &'static str = "mips64";
943+
pub const ARCH: &str = "mips64";
944944
}
945945

946946
#[cfg(target_arch = "powerpc")]
947947
mod arch {
948-
pub const ARCH: &'static str = "powerpc";
948+
pub const ARCH: &str = "powerpc";
949949
}
950950

951951
#[cfg(target_arch = "powerpc64")]
952952
mod arch {
953-
pub const ARCH: &'static str = "powerpc64";
953+
pub const ARCH: &str = "powerpc64";
954954
}
955955

956956
#[cfg(target_arch = "s390x")]
957957
mod arch {
958-
pub const ARCH: &'static str = "s390x";
958+
pub const ARCH: &str = "s390x";
959959
}
960960

961961
#[cfg(target_arch = "sparc64")]
962962
mod arch {
963-
pub const ARCH: &'static str = "sparc64";
963+
pub const ARCH: &str = "sparc64";
964964
}
965965

966966
#[cfg(target_arch = "le32")]
967967
mod arch {
968-
pub const ARCH: &'static str = "le32";
968+
pub const ARCH: &str = "le32";
969969
}
970970

971971
#[cfg(target_arch = "asmjs")]
972972
mod arch {
973-
pub const ARCH: &'static str = "asmjs";
973+
pub const ARCH: &str = "asmjs";
974974
}
975975

976976
#[cfg(target_arch = "wasm32")]
977977
mod arch {
978-
pub const ARCH: &'static str = "wasm32";
978+
pub const ARCH: &str = "wasm32";
979979
}
980980

981981
#[cfg(test)]

‎src/libstd/ffi/c_str.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ impl fmt::Debug for CStr {
671671
#[stable(feature = "cstr_default", since = "1.10.0")]
672672
impl<'a> Default for &'a CStr {
673673
fn default() -> &'a CStr {
674-
const SLICE: &'static [c_char] = &[0];
674+
const SLICE: &[c_char] = &[0];
675675
unsafe { CStr::from_ptr(SLICE.as_ptr()) }
676676
}
677677
}
@@ -1475,7 +1475,7 @@ mod tests {
14751475

14761476
#[test]
14771477
fn cstr_const_constructor() {
1478-
const CSTR: &'static CStr = unsafe {
1478+
const CSTR: &CStr = unsafe {
14791479
CStr::from_bytes_with_nul_unchecked(b"Hello, world!\0")
14801480
};
14811481

‎src/libstd/keyword_docs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ mod as_keyword { }
6565
/// look like this:
6666
///
6767
/// ```rust
68-
/// const WORDS: &'static str = "hello rust!";
68+
/// const WORDS: &str = "hello rust!";
6969
/// ```
7070
///
7171
/// Thanks to static lifetime elision, you usually don't have to explicitly use 'static:

‎src/libstd/sys/cloudabi/shims/env.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
// except according to those terms.
1010

1111
pub mod os {
12-
pub const FAMILY: &'static str = "cloudabi";
13-
pub const OS: &'static str = "cloudabi";
14-
pub const DLL_PREFIX: &'static str = "lib";
15-
pub const DLL_SUFFIX: &'static str = ".so";
16-
pub const DLL_EXTENSION: &'static str = "so";
17-
pub const EXE_SUFFIX: &'static str = "";
18-
pub const EXE_EXTENSION: &'static str = "";
12+
pub const FAMILY: &str = "cloudabi";
13+
pub const OS: &str = "cloudabi";
14+
pub const DLL_PREFIX: &str = "lib";
15+
pub const DLL_SUFFIX: &str = ".so";
16+
pub const DLL_EXTENSION: &str = "so";
17+
pub const EXE_SUFFIX: &str = "";
18+
pub const EXE_EXTENSION: &str = "";
1919
}

‎src/libstd/sys/redox/env.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
// except according to those terms.
1010

1111
pub mod os {
12-
pub const FAMILY: &'static str = "redox";
13-
pub const OS: &'static str = "redox";
14-
pub const DLL_PREFIX: &'static str = "lib";
15-
pub const DLL_SUFFIX: &'static str = ".so";
16-
pub const DLL_EXTENSION: &'static str = "so";
17-
pub const EXE_SUFFIX: &'static str = "";
18-
pub const EXE_EXTENSION: &'static str = "";
12+
pub const FAMILY: &str = "redox";
13+
pub const OS: &str = "redox";
14+
pub const DLL_PREFIX: &str = "lib";
15+
pub const DLL_SUFFIX: &str = ".so";
16+
pub const DLL_EXTENSION: &str = "so";
17+
pub const EXE_SUFFIX: &str = "";
18+
pub const EXE_EXTENSION: &str = "";
1919
}

‎src/libstd/sys/redox/path.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@ pub fn parse_prefix(path: &OsStr) -> Option<Prefix> {
3535
}
3636
}
3737

38-
pub const MAIN_SEP_STR: &'static str = "/";
38+
pub const MAIN_SEP_STR: &str = "/";
3939
pub const MAIN_SEP: char = '/';

‎src/libstd/sys/redox/process.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ impl Command {
143143

144144
pub fn spawn(&mut self, default: Stdio, needs_stdin: bool)
145145
-> io::Result<(Process, StdioPipes)> {
146-
const CLOEXEC_MSG_FOOTER: &'static [u8] = b"NOEX";
146+
const CLOEXEC_MSG_FOOTER: &[u8] = b"NOEX";
147147

148148
if self.saw_nul {
149149
return Err(io::Error::new(ErrorKind::InvalidInput,

‎src/libstd/sys/unix/env.rs

+112-112
Original file line numberDiff line numberDiff line change
@@ -10,176 +10,176 @@
1010

1111
#[cfg(target_os = "linux")]
1212
pub mod os {
13-
pub const FAMILY: &'static str = "unix";
14-
pub const OS: &'static str = "linux";
15-
pub const DLL_PREFIX: &'static str = "lib";
16-
pub const DLL_SUFFIX: &'static str = ".so";
17-
pub const DLL_EXTENSION: &'static str = "so";
18-
pub const EXE_SUFFIX: &'static str = "";
19-
pub const EXE_EXTENSION: &'static str = "";
13+
pub const FAMILY: &str = "unix";
14+
pub const OS: &str = "linux";
15+
pub const DLL_PREFIX: &str = "lib";
16+
pub const DLL_SUFFIX: &str = ".so";
17+
pub const DLL_EXTENSION: &str = "so";
18+
pub const EXE_SUFFIX: &str = "";
19+
pub const EXE_EXTENSION: &str = "";
2020
}
2121

2222
#[cfg(target_os = "macos")]
2323
pub mod os {
24-
pub const FAMILY: &'static str = "unix";
25-
pub const OS: &'static str = "macos";
26-
pub const DLL_PREFIX: &'static str = "lib";
27-
pub const DLL_SUFFIX: &'static str = ".dylib";
28-
pub const DLL_EXTENSION: &'static str = "dylib";
29-
pub const EXE_SUFFIX: &'static str = "";
30-
pub const EXE_EXTENSION: &'static str = "";
24+
pub const FAMILY: &str = "unix";
25+
pub const OS: &str = "macos";
26+
pub const DLL_PREFIX: &str = "lib";
27+
pub const DLL_SUFFIX: &str = ".dylib";
28+
pub const DLL_EXTENSION: &str = "dylib";
29+
pub const EXE_SUFFIX: &str = "";
30+
pub const EXE_EXTENSION: &str = "";
3131
}
3232

3333
#[cfg(target_os = "ios")]
3434
pub mod os {
35-
pub const FAMILY: &'static str = "unix";
36-
pub const OS: &'static str = "ios";
37-
pub const DLL_PREFIX: &'static str = "lib";
38-
pub const DLL_SUFFIX: &'static str = ".dylib";
39-
pub const DLL_EXTENSION: &'static str = "dylib";
40-
pub const EXE_SUFFIX: &'static str = "";
41-
pub const EXE_EXTENSION: &'static str = "";
35+
pub const FAMILY: &str = "unix";
36+
pub const OS: &str = "ios";
37+
pub const DLL_PREFIX: &str = "lib";
38+
pub const DLL_SUFFIX: &str = ".dylib";
39+
pub const DLL_EXTENSION: &str = "dylib";
40+
pub const EXE_SUFFIX: &str = "";
41+
pub const EXE_EXTENSION: &str = "";
4242
}
4343

4444
#[cfg(target_os = "freebsd")]
4545
pub mod os {
46-
pub const FAMILY: &'static str = "unix";
47-
pub const OS: &'static str = "freebsd";
48-
pub const DLL_PREFIX: &'static str = "lib";
49-
pub const DLL_SUFFIX: &'static str = ".so";
50-
pub const DLL_EXTENSION: &'static str = "so";
51-
pub const EXE_SUFFIX: &'static str = "";
52-
pub const EXE_EXTENSION: &'static str = "";
46+
pub const FAMILY: &str = "unix";
47+
pub const OS: &str = "freebsd";
48+
pub const DLL_PREFIX: &str = "lib";
49+
pub const DLL_SUFFIX: &str = ".so";
50+
pub const DLL_EXTENSION: &str = "so";
51+
pub const EXE_SUFFIX: &str = "";
52+
pub const EXE_EXTENSION: &str = "";
5353
}
5454

5555
#[cfg(target_os = "dragonfly")]
5656
pub mod os {
57-
pub const FAMILY: &'static str = "unix";
58-
pub const OS: &'static str = "dragonfly";
59-
pub const DLL_PREFIX: &'static str = "lib";
60-
pub const DLL_SUFFIX: &'static str = ".so";
61-
pub const DLL_EXTENSION: &'static str = "so";
62-
pub const EXE_SUFFIX: &'static str = "";
63-
pub const EXE_EXTENSION: &'static str = "";
57+
pub const FAMILY: &str = "unix";
58+
pub const OS: &str = "dragonfly";
59+
pub const DLL_PREFIX: &str = "lib";
60+
pub const DLL_SUFFIX: &str = ".so";
61+
pub const DLL_EXTENSION: &str = "so";
62+
pub const EXE_SUFFIX: &str = "";
63+
pub const EXE_EXTENSION: &str = "";
6464
}
6565

6666
#[cfg(target_os = "bitrig")]
6767
pub mod os {
68-
pub const FAMILY: &'static str = "unix";
69-
pub const OS: &'static str = "bitrig";
70-
pub const DLL_PREFIX: &'static str = "lib";
71-
pub const DLL_SUFFIX: &'static str = ".so";
72-
pub const DLL_EXTENSION: &'static str = "so";
73-
pub const EXE_SUFFIX: &'static str = "";
74-
pub const EXE_EXTENSION: &'static str = "";
68+
pub const FAMILY: &str = "unix";
69+
pub const OS: &str = "bitrig";
70+
pub const DLL_PREFIX: &str = "lib";
71+
pub const DLL_SUFFIX: &str = ".so";
72+
pub const DLL_EXTENSION: &str = "so";
73+
pub const EXE_SUFFIX: &str = "";
74+
pub const EXE_EXTENSION: &str = "";
7575
}
7676

7777
#[cfg(target_os = "netbsd")]
7878
pub mod os {
79-
pub const FAMILY: &'static str = "unix";
80-
pub const OS: &'static str = "netbsd";
81-
pub const DLL_PREFIX: &'static str = "lib";
82-
pub const DLL_SUFFIX: &'static str = ".so";
83-
pub const DLL_EXTENSION: &'static str = "so";
84-
pub const EXE_SUFFIX: &'static str = "";
85-
pub const EXE_EXTENSION: &'static str = "";
79+
pub const FAMILY: &str = "unix";
80+
pub const OS: &str = "netbsd";
81+
pub const DLL_PREFIX: &str = "lib";
82+
pub const DLL_SUFFIX: &str = ".so";
83+
pub const DLL_EXTENSION: &str = "so";
84+
pub const EXE_SUFFIX: &str = "";
85+
pub const EXE_EXTENSION: &str = "";
8686
}
8787

8888
#[cfg(target_os = "openbsd")]
8989
pub mod os {
90-
pub const FAMILY: &'static str = "unix";
91-
pub const OS: &'static str = "openbsd";
92-
pub const DLL_PREFIX: &'static str = "lib";
93-
pub const DLL_SUFFIX: &'static str = ".so";
94-
pub const DLL_EXTENSION: &'static str = "so";
95-
pub const EXE_SUFFIX: &'static str = "";
96-
pub const EXE_EXTENSION: &'static str = "";
90+
pub const FAMILY: &str = "unix";
91+
pub const OS: &str = "openbsd";
92+
pub const DLL_PREFIX: &str = "lib";
93+
pub const DLL_SUFFIX: &str = ".so";
94+
pub const DLL_EXTENSION: &str = "so";
95+
pub const EXE_SUFFIX: &str = "";
96+
pub const EXE_EXTENSION: &str = "";
9797
}
9898

9999
#[cfg(target_os = "android")]
100100
pub mod os {
101-
pub const FAMILY: &'static str = "unix";
102-
pub const OS: &'static str = "android";
103-
pub const DLL_PREFIX: &'static str = "lib";
104-
pub const DLL_SUFFIX: &'static str = ".so";
105-
pub const DLL_EXTENSION: &'static str = "so";
106-
pub const EXE_SUFFIX: &'static str = "";
107-
pub const EXE_EXTENSION: &'static str = "";
101+
pub const FAMILY: &str = "unix";
102+
pub const OS: &str = "android";
103+
pub const DLL_PREFIX: &str = "lib";
104+
pub const DLL_SUFFIX: &str = ".so";
105+
pub const DLL_EXTENSION: &str = "so";
106+
pub const EXE_SUFFIX: &str = "";
107+
pub const EXE_EXTENSION: &str = "";
108108
}
109109

110110
#[cfg(target_os = "solaris")]
111111
pub mod os {
112-
pub const FAMILY: &'static str = "unix";
113-
pub const OS: &'static str = "solaris";
114-
pub const DLL_PREFIX: &'static str = "lib";
115-
pub const DLL_SUFFIX: &'static str = ".so";
116-
pub const DLL_EXTENSION: &'static str = "so";
117-
pub const EXE_SUFFIX: &'static str = "";
118-
pub const EXE_EXTENSION: &'static str = "";
112+
pub const FAMILY: &str = "unix";
113+
pub const OS: &str = "solaris";
114+
pub const DLL_PREFIX: &str = "lib";
115+
pub const DLL_SUFFIX: &str = ".so";
116+
pub const DLL_EXTENSION: &str = "so";
117+
pub const EXE_SUFFIX: &str = "";
118+
pub const EXE_EXTENSION: &str = "";
119119
}
120120

121121
#[cfg(target_os = "haiku")]
122122
pub mod os {
123-
pub const FAMILY: &'static str = "unix";
124-
pub const OS: &'static str = "haiku";
125-
pub const DLL_PREFIX: &'static str = "lib";
126-
pub const DLL_SUFFIX: &'static str = ".so";
127-
pub const DLL_EXTENSION: &'static str = "so";
128-
pub const EXE_SUFFIX: &'static str = "";
129-
pub const EXE_EXTENSION: &'static str = "";
123+
pub const FAMILY: &str = "unix";
124+
pub const OS: &str = "haiku";
125+
pub const DLL_PREFIX: &str = "lib";
126+
pub const DLL_SUFFIX: &str = ".so";
127+
pub const DLL_EXTENSION: &str = "so";
128+
pub const EXE_SUFFIX: &str = "";
129+
pub const EXE_EXTENSION: &str = "";
130130
}
131131

132132
#[cfg(all(target_os = "emscripten", target_arch = "asmjs"))]
133133
pub mod os {
134-
pub const FAMILY: &'static str = "unix";
135-
pub const OS: &'static str = "emscripten";
136-
pub const DLL_PREFIX: &'static str = "lib";
137-
pub const DLL_SUFFIX: &'static str = ".so";
138-
pub const DLL_EXTENSION: &'static str = "so";
139-
pub const EXE_SUFFIX: &'static str = ".js";
140-
pub const EXE_EXTENSION: &'static str = "js";
134+
pub const FAMILY: &str = "unix";
135+
pub const OS: &str = "emscripten";
136+
pub const DLL_PREFIX: &str = "lib";
137+
pub const DLL_SUFFIX: &str = ".so";
138+
pub const DLL_EXTENSION: &str = "so";
139+
pub const EXE_SUFFIX: &str = ".js";
140+
pub const EXE_EXTENSION: &str = "js";
141141
}
142142

143143
#[cfg(all(target_os = "emscripten", target_arch = "wasm32"))]
144144
pub mod os {
145-
pub const FAMILY: &'static str = "unix";
146-
pub const OS: &'static str = "emscripten";
147-
pub const DLL_PREFIX: &'static str = "lib";
148-
pub const DLL_SUFFIX: &'static str = ".so";
149-
pub const DLL_EXTENSION: &'static str = "so";
150-
pub const EXE_SUFFIX: &'static str = ".js";
151-
pub const EXE_EXTENSION: &'static str = "js";
145+
pub const FAMILY: &str = "unix";
146+
pub const OS: &str = "emscripten";
147+
pub const DLL_PREFIX: &str = "lib";
148+
pub const DLL_SUFFIX: &str = ".so";
149+
pub const DLL_EXTENSION: &str = "so";
150+
pub const EXE_SUFFIX: &str = ".js";
151+
pub const EXE_EXTENSION: &str = "js";
152152
}
153153

154154
#[cfg(target_os = "fuchsia")]
155155
pub mod os {
156-
pub const FAMILY: &'static str = "unix";
157-
pub const OS: &'static str = "fuchsia";
158-
pub const DLL_PREFIX: &'static str = "lib";
159-
pub const DLL_SUFFIX: &'static str = ".so";
160-
pub const DLL_EXTENSION: &'static str = "so";
161-
pub const EXE_SUFFIX: &'static str = "";
162-
pub const EXE_EXTENSION: &'static str = "";
156+
pub const FAMILY: &str = "unix";
157+
pub const OS: &str = "fuchsia";
158+
pub const DLL_PREFIX: &str = "lib";
159+
pub const DLL_SUFFIX: &str = ".so";
160+
pub const DLL_EXTENSION: &str = "so";
161+
pub const EXE_SUFFIX: &str = "";
162+
pub const EXE_EXTENSION: &str = "";
163163
}
164164

165165
#[cfg(target_os = "l4re")]
166166
pub mod os {
167-
pub const FAMILY: &'static str = "unix";
168-
pub const OS: &'static str = "l4re";
169-
pub const DLL_PREFIX: &'static str = "lib";
170-
pub const DLL_SUFFIX: &'static str = ".so";
171-
pub const DLL_EXTENSION: &'static str = "so";
172-
pub const EXE_SUFFIX: &'static str = "";
173-
pub const EXE_EXTENSION: &'static str = "";
167+
pub const FAMILY: &str = "unix";
168+
pub const OS: &str = "l4re";
169+
pub const DLL_PREFIX: &str = "lib";
170+
pub const DLL_SUFFIX: &str = ".so";
171+
pub const DLL_EXTENSION: &str = "so";
172+
pub const EXE_SUFFIX: &str = "";
173+
pub const EXE_EXTENSION: &str = "";
174174
}
175175

176176
#[cfg(target_os = "hermit")]
177177
pub mod os {
178-
pub const FAMILY: &'static str = "unix";
179-
pub const OS: &'static str = "hermit";
180-
pub const DLL_PREFIX: &'static str = "lib";
181-
pub const DLL_SUFFIX: &'static str = ".so";
182-
pub const DLL_EXTENSION: &'static str = "so";
183-
pub const EXE_SUFFIX: &'static str = "";
184-
pub const EXE_EXTENSION: &'static str = "";
178+
pub const FAMILY: &str = "unix";
179+
pub const OS: &str = "hermit";
180+
pub const DLL_PREFIX: &str = "lib";
181+
pub const DLL_SUFFIX: &str = ".so";
182+
pub const DLL_EXTENSION: &str = "so";
183+
pub const EXE_SUFFIX: &str = "";
184+
pub const EXE_EXTENSION: &str = "";
185185
}

‎src/libstd/sys/unix/path.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ pub fn parse_prefix(_: &OsStr) -> Option<Prefix> {
2525
None
2626
}
2727

28-
pub const MAIN_SEP_STR: &'static str = "/";
28+
pub const MAIN_SEP_STR: &str = "/";
2929
pub const MAIN_SEP: char = '/';

‎src/libstd/sys/unix/process/process_unix.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use sys;
2222
impl Command {
2323
pub fn spawn(&mut self, default: Stdio, needs_stdin: bool)
2424
-> io::Result<(Process, StdioPipes)> {
25-
const CLOEXEC_MSG_FOOTER: &'static [u8] = b"NOEX";
25+
const CLOEXEC_MSG_FOOTER: &[u8] = b"NOEX";
2626

2727
let envp = self.capture_env();
2828

‎src/libstd/sys/wasm/env.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
// except according to those terms.
1010

1111
pub mod os {
12-
pub const FAMILY: &'static str = "";
13-
pub const OS: &'static str = "";
14-
pub const DLL_PREFIX: &'static str = "";
15-
pub const DLL_SUFFIX: &'static str = ".wasm";
16-
pub const DLL_EXTENSION: &'static str = "wasm";
17-
pub const EXE_SUFFIX: &'static str = ".wasm";
18-
pub const EXE_EXTENSION: &'static str = "wasm";
12+
pub const FAMILY: &str = "";
13+
pub const OS: &str = "";
14+
pub const DLL_PREFIX: &str = "";
15+
pub const DLL_SUFFIX: &str = ".wasm";
16+
pub const DLL_EXTENSION: &str = "wasm";
17+
pub const EXE_SUFFIX: &str = ".wasm";
18+
pub const EXE_EXTENSION: &str = "wasm";
1919
}

‎src/libstd/sys/wasm/path.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ pub fn parse_prefix(_: &OsStr) -> Option<Prefix> {
2525
None
2626
}
2727

28-
pub const MAIN_SEP_STR: &'static str = "/";
28+
pub const MAIN_SEP_STR: &str = "/";
2929
pub const MAIN_SEP: char = '/';

‎src/libstd/sys/windows/env.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
// except according to those terms.
1010

1111
pub mod os {
12-
pub const FAMILY: &'static str = "windows";
13-
pub const OS: &'static str = "windows";
14-
pub const DLL_PREFIX: &'static str = "";
15-
pub const DLL_SUFFIX: &'static str = ".dll";
16-
pub const DLL_EXTENSION: &'static str = "dll";
17-
pub const EXE_SUFFIX: &'static str = ".exe";
18-
pub const EXE_EXTENSION: &'static str = "exe";
12+
pub const FAMILY: &str = "windows";
13+
pub const OS: &str = "windows";
14+
pub const DLL_PREFIX: &str = "";
15+
pub const DLL_SUFFIX: &str = ".dll";
16+
pub const DLL_EXTENSION: &str = "dll";
17+
pub const EXE_SUFFIX: &str = ".exe";
18+
pub const EXE_EXTENSION: &str = "exe";
1919
}

‎src/libstd/sys/windows/os.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ pub fn error_string(mut errnum: i32) -> String {
4848
// `[MS-ERREF]`: https://msdn.microsoft.com/en-us/library/cc231198.aspx
4949
if (errnum & c::FACILITY_NT_BIT as i32) != 0 {
5050
// format according to https://support.microsoft.com/en-us/help/259693
51-
const NTDLL_DLL: &'static [u16] = &['N' as _, 'T' as _, 'D' as _, 'L' as _, 'L' as _,
52-
'.' as _, 'D' as _, 'L' as _, 'L' as _, 0];
51+
const NTDLL_DLL: &[u16] = &['N' as _, 'T' as _, 'D' as _, 'L' as _, 'L' as _,
52+
'.' as _, 'D' as _, 'L' as _, 'L' as _, 0];
5353
module = c::GetModuleHandleW(NTDLL_DLL.as_ptr());
5454

5555
if module != ptr::null_mut() {

‎src/libstd/sys/windows/path.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,5 +102,5 @@ pub fn parse_prefix<'a>(path: &'a OsStr) -> Option<Prefix> {
102102
}
103103
}
104104

105-
pub const MAIN_SEP_STR: &'static str = "\\";
105+
pub const MAIN_SEP_STR: &str = "\\";
106106
pub const MAIN_SEP: char = '\\';

‎src/libstd/sys_common/wtf8.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ use str;
4040
use sync::Arc;
4141
use sys_common::AsInner;
4242

43-
const UTF8_REPLACEMENT_CHARACTER: &'static str = "\u{FFFD}";
43+
const UTF8_REPLACEMENT_CHARACTER: &str = "\u{FFFD}";
4444

4545
/// A Unicode code point: from U+0000 to U+10FFFF.
4646
///

0 commit comments

Comments
 (0)
Please sign in to comment.