Skip to content

Commit 2a177ee

Browse files
committed
Make a bunch of data structures public
1 parent 10b5d58 commit 2a177ee

File tree

4 files changed

+23
-7
lines changed

4 files changed

+23
-7
lines changed

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ mod error;
3737
pub mod github_actions;
3838
mod mode;
3939
mod parser;
40+
pub mod per_test_config;
4041
mod rustc_stderr;
4142
pub mod status_emitter;
4243
#[cfg(test)]

src/parser.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ mod tests;
2222
/// configuration values. This struct parses them all in one go and then they
2323
/// get processed by their respective use sites.
2424
#[derive(Default, Debug)]
25-
pub(crate) struct Comments {
25+
pub struct Comments {
2626
/// List of revision names to execute. Can only be specified once
2727
pub revisions: Option<Vec<String>>,
2828
/// Comments that are only available under specific revisions.
@@ -94,7 +94,7 @@ impl Comments {
9494

9595
#[derive(Debug)]
9696
/// Comments that can be filtered for specific revisions.
97-
pub(crate) struct Revisioned {
97+
pub struct Revisioned {
9898
/// The character range in which this revisioned item was first added.
9999
/// Used for reporting errors on unknown revisions.
100100
pub span: Span,
@@ -115,16 +115,18 @@ pub(crate) struct Revisioned {
115115
/// Arbitrary patterns to look for in the stderr.
116116
/// The error must be from another file, as errors from the current file must be
117117
/// checked via `error_matches`.
118-
pub error_in_other_files: Vec<Spanned<Pattern>>,
119-
pub error_matches: Vec<ErrorMatch>,
118+
pub(crate) error_in_other_files: Vec<Spanned<Pattern>>,
119+
pub(crate) error_matches: Vec<ErrorMatch>,
120120
/// Ignore diagnostics below this level.
121121
/// `None` means pick the lowest level from the `error_pattern`s.
122122
pub require_annotations_for_level: OptWithLine<Level>,
123+
/// Files that get built and exposed as dependencies to the current test.
123124
pub aux_builds: Vec<Spanned<PathBuf>>,
125+
/// Set the `--edition` flag on the test.
124126
pub edition: OptWithLine<String>,
125127
/// Overwrites the mode from `Config`.
126128
pub mode: OptWithLine<Mode>,
127-
pub needs_asm_support: bool,
129+
pub(crate) needs_asm_support: bool,
128130
/// Don't run [`rustfix`] for this test
129131
pub no_rustfix: OptWithLine<()>,
130132
}
@@ -157,7 +159,7 @@ impl<T> std::ops::DerefMut for CommentParser<T> {
157159

158160
/// The conditions used for "ignore" and "only" filters.
159161
#[derive(Debug)]
160-
pub(crate) enum Condition {
162+
pub enum Condition {
161163
/// The given string must appear in the host triple.
162164
Host(String),
163165
/// The given string must appear in the target triple.

src/per_test_config.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
//! This module allows you to configure the default settings for all
2+
//! tests. All data structures here are normally parsed from `@` comments
3+
//! in the files. These comments still overwrite the defaults, although
4+
//! some boolean settings have no way to disable them.
5+
6+
pub use crate::parser::{Comments, Condition, Revisioned};
7+
pub use crate::rustc_stderr::Level;

src/rustc_stderr.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,17 @@ struct RustcMessage {
1515
}
1616

1717
#[derive(Copy, Clone, Debug, PartialOrd, Ord, PartialEq, Eq)]
18-
pub(crate) enum Level {
18+
/// The different levels of diagnostic messages and their relative ranking.
19+
pub enum Level {
20+
/// internal compiler errors
1921
Ice = 5,
22+
/// ´error´ level messages
2023
Error = 4,
24+
/// ´warn´ level messages
2125
Warn = 3,
26+
/// ´help´ level messages
2227
Help = 2,
28+
/// ´note´ level messages
2329
Note = 1,
2430
/// Only used for "For more information about this error, try `rustc --explain EXXXX`".
2531
FailureNote = 0,

0 commit comments

Comments
 (0)