rust/compiler/rustc_middle/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
..
dep_graph Pass DepContext and QueryContext by value when practical 2023-02-14 17:21:18 +01:00
hir Only compute the crate hash when necessary. 2023-03-08 09:30:22 +11:00
infer Auto merge of #108121 - aliemjay:resolve-var-region, r=lcnr 2023-03-08 12:33:21 +00:00
middle rustc_middle: Remove trait DefIdTree 2023-03-02 23:46:44 +04:00
mir Address the new odd backticks tidy lint in compiler/ 2023-03-11 20:40:18 +01:00
query Auto merge of #108700 - spastorino:new-rpitit-impl-side-2, r=compiler-errors 2023-03-12 00:49:35 +00:00
thir Move THIR printing to rustc_mir_build. 2023-02-26 14:31:15 +00:00
traits Move some solver stuff to middle 2023-03-10 23:46:38 +00:00
ty Auto merge of #108820 - cjgillot:ensure-on-disk, r=oli-obk 2023-03-12 14:00:28 +00:00
util Add some docs to bug, span_bug and delay_span_bug 2022-12-30 16:47:56 +01:00
arena.rs Rollup merge of #108806 - cjgillot:query-lints, r=davidtwco 2023-03-11 15:43:15 +01:00
error.rs Match crate and slug names 2022-11-21 15:24:50 +01:00
lib.rs Simplify message paths 2023-03-11 22:51:57 +01:00
lint.rs create helper function for rustc_lint_defs::Level and remove it's duplicated code r=ozkanonur 2023-01-10 10:56:17 +03:00
macros.rs Remove type-traversal trait aliases 2023-02-22 17:04:58 +00:00
metadata.rs rustc: Parameterize ty::Visibility over used ID 2022-09-07 13:35:41 +04:00
tests.rs
thir.rs Make ExprKind the first field in thir::Expr 2023-03-02 18:21:44 +00:00
values.rs rustc_middle: Remove trait DefIdTree 2023-03-02 23:46:44 +04:00