Skip to content

Commit 8a3e60d

Browse files
committed
Cargo.toml: warn on unnameable types
Such types should not appear anywhere - except for sealed traits. Previous commits removed all occurrences of such types, so now we can enable the lint. The one legit occurrence - a sealed trait - is marked with `#[allow]`.
1 parent ef2bba2 commit 8a3e60d

File tree

4 files changed

+7
-0
lines changed

4 files changed

+7
-0
lines changed

scylla-cql/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,5 @@ full-serialization = [
5555
]
5656

5757
[lints.rust]
58+
unnameable_types = "warn"
5859
unreachable_pub = "warn"

scylla-macros/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ quote = "1.0"
1818
proc-macro2 = "1.0"
1919

2020
[lints.rust]
21+
unnameable_types = "warn"
2122
unreachable_pub = "warn"

scylla/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,5 +95,6 @@ name = "benchmark"
9595
harness = false
9696

9797
[lints.rust]
98+
unnameable_types = "warn"
9899
unreachable_pub = "warn"
99100
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(scylla_cloud_tests)'] }

scylla/src/transport/session_builder.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ use openssl::ssl::SslContext;
2929
use tracing::warn;
3030

3131
mod sealed {
32+
// This is a sealed trait - its whole purpose is to be unnameable.
33+
// This means we need to disable the check.
34+
#[allow(unknown_lints)] // Rust 1.66 doesn't know this lint
35+
#[allow(unnameable_types)]
3236
pub trait Sealed {}
3337
}
3438
pub trait SessionBuilderKind: sealed::Sealed + Clone {}

0 commit comments

Comments
 (0)