rust/compiler/rustc_mir_build/src
bors f41927f309 Auto merge of #108820 - cjgillot:ensure-on-disk, r=oli-obk
Ensure value is on the on-disk cache before returning from `ensure()`.

The current logic for `ensure()` a query just checks that the node is green in the dependency graph.
However, a lot of places use `ensure()` to prevent the query from being called later. This is the case before stealing a query result.

If the query is actually green but the value is not available in the on-disk cache, `ensure` would return, but a subsequent call to the full query would run the code, and attempt to read from a stolen value.

This PR conforms the query system to the usage by checking whether the queried value is loadable from disk before returning.

Sadly, I can't manage to craft a proper test...

Should fix all instances of "attempted to read from stolen value".
2023-03-12 14:00:28 +00:00
..
build Auto merge of #108820 - cjgillot:ensure-on-disk, r=oli-obk 2023-03-12 14:00:28 +00:00
thir Auto merge of #108351 - petrochenkov:rmdit, r=cjgillot 2023-03-05 10:37:02 +00:00
check_unsafety.rs Don't trim path for unsafe_op_in_unsafe_fn lints 2023-01-03 00:28:54 +01:00
errors.rs Restrict #[rustc_box] to Box::new calls 2023-03-02 02:42:19 +00:00
lib.rs Simplify message paths 2023-03-11 22:51:57 +01:00
lints.rs Remove DropAndReplace terminator 2023-03-07 14:25:22 +01:00