-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathclippy.toml
More file actions
8 lines (7 loc) · 1.32 KB
/
Copy pathclippy.toml
File metadata and controls
8 lines (7 loc) · 1.32 KB
1
2
3
4
5
6
7
8
allow-unwrap-in-tests = true
allow-panic-in-tests = true
allow-expect-in-tests = true
disallowed-methods = [
{ path = "std::time::SystemTime::now", reason = "core is a deterministic marshalling library, and its unit tests, proptests and fuzz targets rely on that. Exactly one wall-clock read is legitimate: `column_value::current_utc_date`, which SQL_TYPE_TIME -> SQL_C_TYPE_TIMESTAMP requires ('the date fields of the timestamp structure are set to the current date'). Each read also makes -Zmiri-disable-isolation mandatory, without which Miri aborts rather than failing an assertion. If the spec forces another one, add #[allow(clippy::disallowed_methods)] with a comment naming the rule that forces it" },
{ path = "std::time::Instant::now", reason = "a duration measurement in a marshalling path is nondeterminism with no caller. To measure per-phase cost set ODBC_PROFILING=1 and read the tracing spans logging.rs already emits, or measure in the driver crate. Note that core is no longer entirely timing-free: query_timer.rs enforces SQL_ATTR_QUERY_TIMEOUT, but it expresses its deadline as a Condvar::wait_timeout rather than by reading a clock, which is what keeps this ban intact. Prefer that shape; if the spec forces an actual clock read, add #[allow(clippy::disallowed_methods)] with a comment naming the rule that forces it" },
]