mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-20 10:55:14 +00:00
Rollup merge of #105427 - GuillaumeGomez:dont-silently-ignore-rustdoc-errors, r=notriddle
Dont silently ignore rustdoc errors I applied the suggestions from https://github.com/rust-lang/rust/pull/104995 and also checked the rustdoc-ui error but couldn't reproduce it. r? `@notriddle`
This commit is contained in:
commit
4b09861a68
@ -674,7 +674,7 @@ type MainResult = Result<(), ErrorGuaranteed>;
|
||||
|
||||
fn wrap_return(diag: &rustc_errors::Handler, res: Result<(), String>) -> MainResult {
|
||||
match res {
|
||||
Ok(()) => Ok(()),
|
||||
Ok(()) => diag.has_errors().map_or(Ok(()), Err),
|
||||
Err(err) => {
|
||||
let reported = diag.struct_err(&err).emit();
|
||||
Err(reported)
|
||||
@ -689,7 +689,7 @@ fn run_renderer<'tcx, T: formats::FormatRenderer<'tcx>>(
|
||||
tcx: TyCtxt<'tcx>,
|
||||
) -> MainResult {
|
||||
match formats::run_format::<T>(krate, renderopts, cache, tcx) {
|
||||
Ok(_) => Ok(()),
|
||||
Ok(_) => tcx.sess.has_errors().map_or(Ok(()), Err),
|
||||
Err(e) => {
|
||||
let mut msg =
|
||||
tcx.sess.struct_err(&format!("couldn't generate documentation: {}", e.error));
|
||||
|
@ -7,4 +7,5 @@ pub struct S {
|
||||
s: Cell<usize>
|
||||
}
|
||||
|
||||
pub const N: usize = 0 - (mem::size_of::<S>() != 4) as usize;
|
||||
pub const N: usize = 0 - (mem::size_of::<S>() != 400) as usize;
|
||||
//~^ ERROR evaluation of constant value failed
|
9
src/test/rustdoc-ui/const-evalutation-ice.stderr
Normal file
9
src/test/rustdoc-ui/const-evalutation-ice.stderr
Normal file
@ -0,0 +1,9 @@
|
||||
error[E0080]: evaluation of constant value failed
|
||||
--> $DIR/const-evalutation-ice.rs:10:22
|
||||
|
|
||||
LL | pub const N: usize = 0 - (mem::size_of::<S>() != 400) as usize;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `0_usize - 1_usize`, which would overflow
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0080`.
|
Loading…
Reference in New Issue
Block a user