Skip to content

Commit 5633e2a

Browse files
committed
Auto merge of #12169 - ehuss:semver-repr, r=joshtriplett
Document layout SemVer compatibility. This adds some documentation about whether or not alignment, layout, or size changes are SemVer-compatible.
2 parents 2b1f87c + 5dc86dc commit 5633e2a

File tree

2 files changed

+759
-1
lines changed

2 files changed

+759
-1
lines changed

crates/semver-check/src/main.rs

+12-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
//! An example with the word "MINOR" at the top is expected to successfully
88
//! build against the before and after. Otherwise it should fail. A comment of
99
//! "// Error:" will check that the given message appears in the error output.
10+
//!
11+
//! The code block can also include the annotations:
12+
//! - `run-fail`: The test should fail at runtime, not compiletime.
13+
//! - `dont-deny`: By default tests have a `#![deny(warnings)]`. This option
14+
//! avoids this attribute. Note that `#![allow(unused)]` is always added.
1015
1116
use std::error::Error;
1217
use std::fs;
@@ -57,7 +62,13 @@ fn doit() -> Result<(), Box<dyn Error>> {
5762
if line.trim() == "```" {
5863
break;
5964
}
60-
block.push(line);
65+
// Support rustdoc/mdbook hidden lines.
66+
let line = line.strip_prefix("# ").unwrap_or(line);
67+
if line == "#" {
68+
block.push("");
69+
} else {
70+
block.push(line);
71+
}
6172
}
6273
None => {
6374
return Err(format!(

0 commit comments

Comments
 (0)