Skip to content

Commit 5ef91c2

Browse files
Unchecked code fixes (RustPython#7786)
* Clippy lints fixes * Update crates/stdlib/src/tkinter.rs Co-authored-by: fanninpm <27117322+fanninpm@users.noreply.github.com> * Update crates/stdlib/src/openssl.rs Co-authored-by: fanninpm <27117322+fanninpm@users.noreply.github.com> * Update crates/stdlib/src/ssl/compat.rs Co-authored-by: fanninpm <27117322+fanninpm@users.noreply.github.com> * Update crates/stdlib/src/ssl/compat.rs Co-authored-by: fanninpm <27117322+fanninpm@users.noreply.github.com> * Revert "Update crates/stdlib/src/ssl/compat.rs" This reverts commit b34228f. --------- Co-authored-by: fanninpm <27117322+fanninpm@users.noreply.github.com>
1 parent 79395de commit 5ef91c2

10 files changed

Lines changed: 131 additions & 78 deletions

File tree

crates/stdlib/src/lib.rs

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#[macro_use]
77
extern crate rustpython_derive;
8+
89
extern crate alloc;
910

1011
#[macro_use]
@@ -20,8 +21,10 @@ mod cmath;
2021
mod compression; // internal module
2122
mod contextvars;
2223
mod csv;
24+
2325
#[cfg(not(any(target_os = "android", target_arch = "wasm32")))]
2426
mod lzma;
27+
2528
mod zlib;
2629

2730
mod blake2;
@@ -41,59 +44,77 @@ mod json;
4144
mod locale;
4245

4346
mod _opcode;
47+
4448
#[path = "_tokenize.rs"]
4549
mod _tokenize;
50+
4651
mod math;
52+
4753
#[cfg(all(feature = "host_env", any(unix, windows)))]
4854
mod mmap;
55+
4956
mod pyexpat;
5057
mod pystruct;
5158
mod random;
5259
mod statistics;
5360
mod suggestions;
61+
5462
// TODO: maybe make this an extension module, if we ever get those
5563
// mod re;
5664
#[cfg(all(feature = "host_env", not(target_arch = "wasm32")))]
5765
pub mod socket;
66+
5867
#[cfg(all(feature = "host_env", unix, not(target_os = "redox")))]
5968
mod syslog;
69+
6070
mod unicodedata;
6171

6272
#[cfg(feature = "host_env")]
6373
mod faulthandler;
74+
6475
#[cfg(all(feature = "host_env", any(unix, target_os = "wasi")))]
6576
mod fcntl;
77+
6678
#[cfg(all(feature = "host_env", not(target_arch = "wasm32")))]
6779
mod multiprocessing;
80+
6881
#[cfg(all(
6982
feature = "host_env",
7083
unix,
7184
not(target_os = "redox"),
7285
not(target_os = "android")
7386
))]
7487
mod posixshmem;
88+
7589
#[cfg(all(feature = "host_env", unix))]
7690
mod posixsubprocess;
91+
7792
// libc is missing constants on redox
7893
#[cfg(all(
7994
feature = "sqlite",
8095
not(any(target_os = "android", target_arch = "wasm32"))
8196
))]
8297
mod _sqlite3;
98+
8399
#[cfg(all(feature = "host_env", windows))]
84100
mod _testconsole;
101+
85102
#[cfg(all(
86103
feature = "host_env",
87104
unix,
88105
not(any(target_os = "android", target_os = "redox"))
89106
))]
90107
mod grp;
108+
91109
#[cfg(all(feature = "host_env", windows))]
92110
mod overlapped;
111+
93112
#[cfg(all(feature = "host_env", unix, not(target_os = "redox")))]
94113
mod resource;
114+
95115
#[cfg(all(feature = "host_env", target_os = "macos"))]
96116
mod scproxy;
117+
97118
#[cfg(all(feature = "host_env", any(unix, windows, target_os = "wasi")))]
98119
mod select;
99120

@@ -103,14 +124,16 @@ mod select;
103124
feature = "ssl-openssl"
104125
))]
105126
mod openssl;
127+
106128
#[cfg(all(
107129
feature = "host_env",
108130
not(target_arch = "wasm32"),
109131
feature = "ssl-rustls"
110132
))]
111133
mod ssl;
112-
#[cfg(all(feature = "ssl-openssl", feature = "ssl-rustls"))]
113-
compile_error!("features \"ssl-openssl\" and \"ssl-rustls\" are mutually exclusive");
134+
135+
#[cfg(all(feature = "ssl-openssl", feature = "ssl-rustls", not(clippy)))]
136+
compile_error!(r#"features "ssl-openssl" and "ssl-rustls" are mutually exclusive"#);
114137

115138
#[cfg(all(
116139
feature = "host_env",
@@ -119,6 +142,7 @@ compile_error!("features \"ssl-openssl\" and \"ssl-rustls\" are mutually exclusi
119142
not(target_os = "ios")
120143
))]
121144
mod termios;
145+
122146
#[cfg(all(
123147
feature = "host_env",
124148
not(any(

0 commit comments

Comments
 (0)