Repository navigation
Expand file tree
/
Copy pathCargo.toml
More file actions
86 lines (75 loc) · 3.01 KB
/
Copy pathCargo.toml
File metadata and controls
86 lines (75 loc) · 3.01 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
# The root is the workspace and the `safec` package at once: the facade a user
# depends on, the binary, and every test that runs it. See ADR-0058.
[package]
name = "safec"
description = "A small, hackable, safety-oriented C compiler"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
authors.workspace = true
repository.workspace = true
[[bin]]
name = "safec"
path = "src/main.rs"
# A measurement that asserts nothing and prints a table: its own `main`,
# since the built-in bench harness needs a nightly compiler.
[[bench]]
name = "growth"
harness = false
[dependencies]
safec-c = { path = "crates/safec-c" }
safec-ir = { path = "crates/safec-ir" }
safec-llvm = { path = "crates/safec-llvm" }
clap.workspace = true
[lints]
workspace = true
[workspace]
resolver = "3"
members = ["crates/safec-c", "crates/safec-ir", "crates/safec-llvm"]
[workspace.package]
version = "0.1.0"
edition = "2024"
rust-version = "1.85"
license = "MIT OR Apache-2.0"
authors = ["itsakeyfut <itsakey0xff@gmail.com>"]
repository = "https://github.com/itsakeyfut/safec"
[workspace.dependencies]
clap = { version = "4.6.6", features = ["derive"] }
# Upstream is https://codeberg.org/zesterer/ariadne. The GitHub repository that
# crates.io links to is archived and says so in its own description, so a reader
# who followed that link and found it stopped has not found an abandoned crate:
# 0.6.0 is the newest release, and work has continued on Codeberg since.
ariadne = "0.6.0"
# The width `ariadne` measures a character with, so that the renderer can ask
# the same question of the same table. Kept at the version `ariadne` resolves,
# which is what makes it the same table rather than a second opinion.
unicode-width = "0.2.2"
thiserror = "2.0.20"
[profile.release]
lto = "thin"
codegen-units = 1
[profile.dev.package."*"]
opt-level = 2
[workspace.lints.rust]
# The doc comments are the point of a compiler meant to be read; keep them
# mandatory from the start rather than backfilling hundreds of items later.
missing_docs = "warn"
missing_debug_implementations = "warn"
unreachable_pub = "warn"
# This compiler analyses memory safety in someone else's language, so it is
# written in safe Rust itself, and that is a claim worth holding rather than
# remembering.
#
# `forbid` rather than `deny`, because `deny` is turned off by an `allow` in
# whichever file wants one and the point of this is that the reversal is not
# local. Held by the lint rather than by a search over the sources, because a
# search matches text and this matches the language: `unsafe` inside a macro
# expansion, inside a string literal, or split across a line break is a
# difference between the two, and only one of them is right about which is which.
#
# A package takes none of this table unless its manifest says `[lints]` and
# `workspace = true`, so deleting those two lines would be a local reversal of
# all of it. `every_package_in_the_workspace_takes_the_workspace_lints` in
# `tests/lints.rs` is what holds every package to it.
unsafe_code = "forbid"