Skip to content

Commit 3bd19ae

Browse files
committed
rename ExperimentalUb → StackedBorrowsUb
1 parent 43dfc19 commit 3bd19ae

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

src/diagnostics.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@ pub enum TerminationInfo {
1616
Exit(i64),
1717
Abort(String),
1818
UnsupportedInIsolation(String),
19-
ExperimentalUb {
19+
StackedBorrowsUb {
2020
msg: String,
2121
help: Option<String>,
22-
url: String,
2322
history: Option<TagHistory>,
2423
},
2524
Deadlock,
@@ -43,7 +42,7 @@ impl fmt::Display for TerminationInfo {
4342
Exit(code) => write!(f, "the evaluated program completed with exit code {}", code),
4443
Abort(msg) => write!(f, "{}", msg),
4544
UnsupportedInIsolation(msg) => write!(f, "{}", msg),
46-
ExperimentalUb { msg, .. } => write!(f, "{}", msg),
45+
StackedBorrowsUb { msg, .. } => write!(f, "{}", msg),
4746
Deadlock => write!(f, "the evaluated program deadlocked"),
4847
MultipleSymbolDefinitions { link_name, .. } =>
4948
write!(f, "multiple definitions of symbol `{}`", link_name),
@@ -146,7 +145,7 @@ pub fn report_error<'tcx, 'mir>(
146145
Exit(code) => return Some(*code),
147146
Abort(_) => Some("abnormal termination"),
148147
UnsupportedInIsolation(_) => Some("unsupported operation"),
149-
ExperimentalUb { .. } => Some("Undefined Behavior"),
148+
StackedBorrowsUb { .. } => Some("Undefined Behavior"),
150149
Deadlock => Some("deadlock"),
151150
MultipleSymbolDefinitions { .. } | SymbolShimClashing { .. } => None,
152151
};
@@ -157,11 +156,12 @@ pub fn report_error<'tcx, 'mir>(
157156
(None, format!("pass the flag `-Zmiri-disable-isolation` to disable isolation;")),
158157
(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")),
159158
],
160-
ExperimentalUb { url, help, history, .. } => {
159+
StackedBorrowsUb { help, history, .. } => {
160+
let url = "https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md";
161161
msg.extend(help.clone());
162162
let mut helps = vec![
163-
(None, format!("this indicates a potential bug in the program: it performed an invalid operation, but the rules it violated are still experimental")),
164-
(None, format!("see {} for further information", url)),
163+
(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")),
164+
(None, format!("see {url} for further information")),
165165
];
166166
match history {
167167
Some(TagHistory::Tagged {tag, created: (created_range, created_span), invalidated, protected }) => {

src/stacked_borrows.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -232,14 +232,7 @@ pub fn err_sb_ub<'tcx>(
232232
help: Option<String>,
233233
history: Option<TagHistory>,
234234
) -> InterpError<'tcx> {
235-
err_machine_stop!(TerminationInfo::ExperimentalUb {
236-
msg,
237-
help,
238-
url: format!(
239-
"https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md"
240-
),
241-
history
242-
})
235+
err_machine_stop!(TerminationInfo::StackedBorrowsUb { msg, help, history })
243236
}
244237

245238
// # Stacked Borrows Core Begin

0 commit comments

Comments
 (0)