-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathCargo.toml
More file actions
98 lines (88 loc) · 3.03 KB
/
Cargo.toml
File metadata and controls
98 lines (88 loc) · 3.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# Vectorizer Cargo workspace.
#
# Sub-phase 1 of phase4_split-vectorizer-workspace ships the
# skeleton: the existing monolithic crate moved under
# `crates/vectorizer/` with no module-boundary refactor. Sub-phases
# 2-5 extract `vectorizer-protocol`, `vectorizer-core`,
# `vectorizer-server`, and `vectorizer-cli` from there. Sub-phase 6
# wires `sdks/rust` as a workspace member.
[workspace]
resolver = "2"
members = ["crates/*", "sdks/rust"]
# Centralised lint policy. Per-crate `Cargo.toml` opts in via
# `[lints] workspace = true`. Mirrors the policy that lived under
# `[lints.*]` on the monolithic crate before the split.
[workspace.lints.clippy]
cast_lossless = "warn"
doc_link_with_quotes = "warn"
enum_glob_use = "warn"
explicit_into_iter_loop = "warn"
filter_map_next = "warn"
flat_map_option = "warn"
from_iter_instead_of_collect = "warn"
implicit_clone = "warn"
inconsistent_struct_constructor = "warn"
inefficient_to_string = "warn"
manual_is_variant_and = "warn"
manual_let_else = "warn"
needless_continue = "warn"
needless_raw_string_hashes = "warn"
ptr_as_ptr = "warn"
ref_option_ref = "warn"
uninlined_format_args = "warn"
unnecessary_wraps = "warn"
unused_self = "warn"
used_underscore_binding = "warn"
match_wildcard_for_single_variants = "warn"
needless_pass_by_ref_mut = "warn"
# Every `unsafe {}` block must carry a `// SAFETY:` comment explaining why
# the invariants hold. Documented in `/.rulebook/specs/RUST.md`.
undocumented_unsafe_blocks = "deny"
# `unwrap()` / `expect()` are forbidden in production code under
# phase4_enforce-no-unwrap-policy. Test modules opt out with
# `#[allow(clippy::unwrap_used, clippy::expect_used)]` (idiomatic in tests);
# genuinely-safe call sites carry a `// SAFE:` rationale plus a function /
# block-scoped `#[allow]`. Documented in `/.rulebook/specs/RUST.md`.
unwrap_used = "deny"
expect_used = "deny"
[workspace.lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tokio_unstable)'] }
[workspace.lints.rustdoc]
private_intra_doc_links = "allow"
# Workspace-wide build profiles. Per-crate `Cargo.toml` files don't
# need to redeclare these; Cargo applies them across every member.
[profile.release]
# Optimized for faster builds while maintaining good performance
lto = "thin" # Thin LTO is much faster than "fat" with minimal performance loss
codegen-units = 4 # More units = faster compilation (was 1, very slow)
opt-level = 3
incremental = true # Enable incremental for faster rebuilds
strip = true # Strip symbols to reduce binary size
# Optimize dependencies in release builds
[profile.release.package."*"]
opt-level = 3
# Faster builds for CI
[profile.ci]
inherits = "release"
debug-assertions = true
lto = false
opt-level = 0
incremental = true
codegen-units = 16
# Fast release build (for development/testing)
[profile.release-fast]
inherits = "release"
lto = false
codegen-units = 16
opt-level = 2
incremental = true
# Performance testing profile
[profile.perf]
inherits = "release"
lto = false
opt-level = 3
codegen-units = 256
[profile.dev]
debug = "line-tables-only"
opt-level = 0
incremental = true