pub struct UiExpectations {
pub should_errors: Vec<Option<String>>,
pub should_warns: Vec<Option<String>>,
pub should_spanned: Vec<String>,
}Expand description
A subcrate’s UI-test expectations: assertions about the diagnostics rustc
produces for it, from #[subcrate(should_error/should_warn/should_spanned …)].
Any non-empty field makes the subcrate a UI test. Every expectation must hold — they are combined with AND.
Fields§
§should_errors: Vec<Option<String>>One entry per should_error: Some(s) requires an error whose rendered
text contains s, None (bare should_error) only that compilation
fails. A non-empty list makes the subcrate a UI test expected to fail.
should_warns: Vec<Option<String>>One entry per should_warn: Some(s) requires a warning whose rendered
text contains s, None (bare should_warn) only that some warning is
emitted.
should_spanned: Vec<String>Code a diagnostic must underline, compared with whitespace removed.
Implementations§
Source§impl UiExpectations
impl UiExpectations
Sourcepub fn is_ui_test(&self) -> bool
pub fn is_ui_test(&self) -> bool
Whether any expectation is set, so the subcrate is a UI test.
Sourcepub fn expects_error(&self) -> bool
pub fn expects_error(&self) -> bool
Whether the subcrate is expected to fail to compile (any should_error),
so it produces no artifact.