Skip to content

Commit

Permalink
Rollup merge of rust-lang#61618 - RalfJung:error, r=oli-obk
Browse files Browse the repository at this point in the history
make the backtrace field of EvalError private

This also makes sure people don't contruct these the wrong way (i.e., not through the `From` instance).

r? @oli-obk
  • Loading branch information
Centril committed Jun 7, 2019
2 parents 9bbdc40 + 524f146 commit b9c752b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/librustc/mir/interpret/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,15 @@ pub fn struct_error<'a, 'gcx, 'tcx>(
struct_span_err!(tcx.sess, tcx.span, E0080, "{}", msg)
}

/// Packages the kind of error we got from the const code interpreter
/// up with a Rust-level backtrace of where the error occured.
/// Thsese should always be constructed by calling `.into()` on
/// a `InterpError`. In `librustc_mir::interpret`, we have the `err!`
/// macro for this
#[derive(Debug, Clone)]
pub struct EvalError<'tcx> {
pub kind: InterpError<'tcx, u64>,
pub backtrace: Option<Box<Backtrace>>,
backtrace: Option<Box<Backtrace>>,
}

impl<'tcx> EvalError<'tcx> {
Expand Down

0 comments on commit b9c752b

Please sign in to comment.