Skip to content

Conversation

IsaacWoods
Copy link
Member

This updates the old lang item to the new #[panic_implementation] attribute, fixing the bootloader on new nightlies

Copy link
Member

@phil-opp phil-opp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Just one small nit.

src/main.rs Outdated
write!(printer::Printer, "PANIC: {} in {}:{}", info.message().unwrap(), location.file(), location.line()).unwrap();
} else {
write!(printer::Printer, "PANIC: {} at ???", info.message().unwrap()).unwrap();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PanicInfo implements Display, so I think we can just do println!("PANIC: {}", info) or even println!("{}", info). We also wouldn't need #![feature(panic_info_message)] then. Or is there some advantage in printing explicitly?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, I just missed that PanicInfo implemented Display. Thanks for the review; fixed!

@phil-opp phil-opp merged commit 5bf74c5 into rust-osdev:master Jul 11, 2018
@phil-opp
Copy link
Member

Thanks!

@phil-opp
Copy link
Member

Published as v0.2.0-alpha-005

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants