rust/compiler/rustc_interface/src
bors 17b60b8738 Auto merge of #83129 - LeSeulArtichaut:thir-unsafeck, r=nikomatsakis
Introduce the beginning of a THIR unsafety checker

This poses the foundations for the THIR unsafety checker, so that it can be implemented incrementally:
- implements a rudimentary `Visitor` for the THIR (which will definitely need some tweaking in the future)
- introduces a new `-Zthir-unsafeck` flag which tells the compiler to use THIR unsafeck instead of MIR unsafeck
- implements detection of unsafe functions
- adds revisions to the UI tests to test THIR unsafeck alongside MIR unsafeck

This uses a very simple query design, where bodies are unsafety-checked on a body per body basis. This however has some big flaws:
- the unsafety-checker builds the THIR itself, which means a lot of work is duplicated with MIR building constructing its own copy of the THIR
- unsafety-checking closures is currently completely wrong: closures should take into account the "safety context" in which they are created, here we are considering that closures are always a safe context

I had intended to fix these problems in follow-up PRs since they are always gated under the `-Zthir-unsafeck` flag (which is explicitely noted to be unsound).

r? `@nikomatsakis`
cc https://github.com/rust-lang/project-thir-unsafeck/issues/3 https://github.com/rust-lang/project-thir-unsafeck/issues/7
2021-05-13 10:49:29 +00:00
..
callbacks.rs Fix outdated crate names in rustc_interface::callbacks 2021-04-07 11:45:27 -05:00
interface.rs Change the .unwrap to .expect with a helpful message 2021-03-15 20:45:45 +08:00
lib.rs Box the biggest ast::ItemKind variants 2021-02-01 09:23:39 +01:00
passes.rs Auto merge of #83129 - LeSeulArtichaut:thir-unsafeck, r=nikomatsakis 2021-05-13 10:49:29 +00:00
proc_macro_decls.rs Remove hir::Item::attrs. 2021-03-09 19:27:50 +01:00
queries.rs Implement RFC 1260 with feature_name imported_main. 2021-04-29 08:35:08 +08:00
tests.rs Auto merge of #83129 - LeSeulArtichaut:thir-unsafeck, r=nikomatsakis 2021-05-13 10:49:29 +00:00
util.rs Adjust target search algorithm for rustlib path 2021-05-10 19:15:19 +03:00