Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
  • Loading branch information
RalfJung and Centril committed Jul 24, 2019
1 parent 18551e7 commit ff18786
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/librustc/mir/interpret/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,13 @@ pub struct InterpErrorInfo<'tcx> {
}


impl<'tcx> fmt::Display for InterpErrorInfo<'tcx> {
impl fmt::Display for InterpErrorInfo<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", self.kind)
}
}

impl<'tcx> InterpErrorInfo<'tcx> {
impl InterpErrorInfo<'_> {
pub fn print_backtrace(&mut self) {
if let Some(ref mut backtrace) = self.backtrace {
print_backtrace(&mut *backtrace);
Expand Down Expand Up @@ -390,14 +390,14 @@ pub enum InterpError<'tcx> {

pub type InterpResult<'tcx, T = ()> = Result<T, InterpErrorInfo<'tcx>>;

impl<'tcx> fmt::Display for InterpError<'tcx> {
impl fmt::Display for InterpError<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
// Forward `Display` to `Debug`
write!(f, "{:?}", self)
}
}

impl<'tcx> fmt::Debug for InterpError<'tcx> {
impl fmt::Debug for InterpError<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
use InterpError::*;
match *self {
Expand Down

0 comments on commit ff18786

Please sign in to comment.