Skip to content

Commit

Permalink
Auto merge of #12169 - ehuss:semver-repr, r=joshtriplett
Browse files Browse the repository at this point in the history
Document layout SemVer compatibility.

This adds some documentation about whether or not alignment, layout, or size changes are SemVer-compatible.
  • Loading branch information
bors committed Aug 18, 2023
2 parents 2b1f87c + 5dc86dc commit 5633e2a
Show file tree
Hide file tree
Showing 2 changed files with 759 additions and 1 deletion.
13 changes: 12 additions & 1 deletion crates/semver-check/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
//! An example with the word "MINOR" at the top is expected to successfully
//! build against the before and after. Otherwise it should fail. A comment of
//! "// Error:" will check that the given message appears in the error output.
//!
//! The code block can also include the annotations:
//! - `run-fail`: The test should fail at runtime, not compiletime.
//! - `dont-deny`: By default tests have a `#![deny(warnings)]`. This option
//! avoids this attribute. Note that `#![allow(unused)]` is always added.

use std::error::Error;
use std::fs;
Expand Down Expand Up @@ -57,7 +62,13 @@ fn doit() -> Result<(), Box<dyn Error>> {
if line.trim() == "```" {
break;
}
block.push(line);
// Support rustdoc/mdbook hidden lines.
let line = line.strip_prefix("# ").unwrap_or(line);
if line == "#" {
block.push("");
} else {
block.push(line);
}
}
None => {
return Err(format!(
Expand Down

0 comments on commit 5633e2a

Please sign in to comment.