rename ExperimentalUb → StackedBorrowsUb
This commit is contained in:
parent
069d8fdb71
commit
c3b8509654
@ -16,10 +16,9 @@ pub enum TerminationInfo {
|
|||||||
Exit(i64),
|
Exit(i64),
|
||||||
Abort(String),
|
Abort(String),
|
||||||
UnsupportedInIsolation(String),
|
UnsupportedInIsolation(String),
|
||||||
ExperimentalUb {
|
StackedBorrowsUb {
|
||||||
msg: String,
|
msg: String,
|
||||||
help: Option<String>,
|
help: Option<String>,
|
||||||
url: String,
|
|
||||||
history: Option<TagHistory>,
|
history: Option<TagHistory>,
|
||||||
},
|
},
|
||||||
Deadlock,
|
Deadlock,
|
||||||
@ -43,7 +42,7 @@ impl fmt::Display for TerminationInfo {
|
|||||||
Exit(code) => write!(f, "the evaluated program completed with exit code {}", code),
|
Exit(code) => write!(f, "the evaluated program completed with exit code {}", code),
|
||||||
Abort(msg) => write!(f, "{}", msg),
|
Abort(msg) => write!(f, "{}", msg),
|
||||||
UnsupportedInIsolation(msg) => write!(f, "{}", msg),
|
UnsupportedInIsolation(msg) => write!(f, "{}", msg),
|
||||||
ExperimentalUb { msg, .. } => write!(f, "{}", msg),
|
StackedBorrowsUb { msg, .. } => write!(f, "{}", msg),
|
||||||
Deadlock => write!(f, "the evaluated program deadlocked"),
|
Deadlock => write!(f, "the evaluated program deadlocked"),
|
||||||
MultipleSymbolDefinitions { link_name, .. } =>
|
MultipleSymbolDefinitions { link_name, .. } =>
|
||||||
write!(f, "multiple definitions of symbol `{}`", link_name),
|
write!(f, "multiple definitions of symbol `{}`", link_name),
|
||||||
@ -146,7 +145,7 @@ pub fn report_error<'tcx, 'mir>(
|
|||||||
Exit(code) => return Some(*code),
|
Exit(code) => return Some(*code),
|
||||||
Abort(_) => Some("abnormal termination"),
|
Abort(_) => Some("abnormal termination"),
|
||||||
UnsupportedInIsolation(_) => Some("unsupported operation"),
|
UnsupportedInIsolation(_) => Some("unsupported operation"),
|
||||||
ExperimentalUb { .. } => Some("Undefined Behavior"),
|
StackedBorrowsUb { .. } => Some("Undefined Behavior"),
|
||||||
Deadlock => Some("deadlock"),
|
Deadlock => Some("deadlock"),
|
||||||
MultipleSymbolDefinitions { .. } | SymbolShimClashing { .. } => None,
|
MultipleSymbolDefinitions { .. } | SymbolShimClashing { .. } => None,
|
||||||
};
|
};
|
||||||
@ -157,11 +156,12 @@ pub fn report_error<'tcx, 'mir>(
|
|||||||
(None, format!("pass the flag `-Zmiri-disable-isolation` to disable isolation;")),
|
(None, format!("pass the flag `-Zmiri-disable-isolation` to disable isolation;")),
|
||||||
(None, format!("or pass `-Zmiri-isolation-error=warn` to configure Miri to return an error code from isolated operations (if supported for that operation) and continue with a warning")),
|
(None, format!("or pass `-Zmiri-isolation-error=warn` to configure Miri to return an error code from isolated operations (if supported for that operation) and continue with a warning")),
|
||||||
],
|
],
|
||||||
ExperimentalUb { url, help, history, .. } => {
|
StackedBorrowsUb { help, history, .. } => {
|
||||||
|
let url = "https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md";
|
||||||
msg.extend(help.clone());
|
msg.extend(help.clone());
|
||||||
let mut helps = vec![
|
let mut helps = vec![
|
||||||
(None, format!("this indicates a potential bug in the program: it performed an invalid operation, but the rules it violated are still experimental")),
|
(None, format!("this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental")),
|
||||||
(None, format!("see {} for further information", url)),
|
(None, format!("see {url} for further information")),
|
||||||
];
|
];
|
||||||
match history {
|
match history {
|
||||||
Some(TagHistory::Tagged {tag, created: (created_range, created_span), invalidated, protected }) => {
|
Some(TagHistory::Tagged {tag, created: (created_range, created_span), invalidated, protected }) => {
|
||||||
|
@ -250,14 +250,7 @@ pub fn err_sb_ub<'tcx>(
|
|||||||
help: Option<String>,
|
help: Option<String>,
|
||||||
history: Option<TagHistory>,
|
history: Option<TagHistory>,
|
||||||
) -> InterpError<'tcx> {
|
) -> InterpError<'tcx> {
|
||||||
err_machine_stop!(TerminationInfo::ExperimentalUb {
|
err_machine_stop!(TerminationInfo::StackedBorrowsUb { msg, help, history })
|
||||||
msg,
|
|
||||||
help,
|
|
||||||
url: format!(
|
|
||||||
"https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md"
|
|
||||||
),
|
|
||||||
history
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// # Stacked Borrows Core Begin
|
// # Stacked Borrows Core Begin
|
||||||
|
Loading…
x
Reference in New Issue
Block a user