Skip to content

Commit d3d68a0

Browse files
cargo feature internal_use_frontend_linted
1 parent 96b0d1a commit d3d68a0

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,9 @@ homepage = "https://github.com/prudent-rs/prudent"
2222

2323
[lints.rust]
2424
unexpected_cfgs = { level = "forbid"}
25+
26+
[features]
27+
# NOT for any builds (not even for debugging). Only for "activating" src/frontend_linted.rs in your
28+
# rust-analyzer/IDE, so you get better editing.
29+
internal_use_frontend_linted = []
30+
#default = ["internal_use_frontend_linted"]

src/frontend_linted.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#[allow(unused)]
1313
pub const PRUDENT_INTERNAL_LINTED_VERSION: &str = "0.0.3-beta";
1414

15+
#[cfg(not(feature = "internal_use_frontend_linted"))]
1516
const _VERIFY_MODULE_PATH: () = {
1617
let path = core::module_path!().as_bytes();
1718
if matches!(

src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,16 @@ macro_rules! internal_coverage_positive {
122122

123123
pub mod backend;
124124

125+
#[cfg(feature = "internal_use_frontend_linted")]
126+
compile_error!("Use feature internal_use_frontend_linted only for easier editing.");
127+
125128
/// Frontend macros.
129+
#[cfg(not(feature = "internal_use_frontend_linted"))]
126130
#[path = "frontend_unlinted.rs"]
127131
mod frontend_untested;
132+
#[cfg(feature = "internal_use_frontend_linted")]
133+
#[path = "frontend_linted.rs"]
134+
mod frontend_untested;
128135

129136
#[path = "frontend_with_compile_fail_tests.rs"]
130137
#[doc(hidden)]

0 commit comments

Comments
 (0)