rust/compiler
bors 6d3acf5129 Auto merge of #76928 - lcnr:opaque-types-cache, r=tmandry
cache types during normalization

partially fixes #75992

reduces the following test from 14 to 3 seconds locally.

cc `@Mark-Simulacrum` would it make sense to add that test to `perf`?
```rust
#![recursion_limit="2048"]
#![type_length_limit="112457564"]

pub async fn h0(v: &String, x: &u64) { println!("{} {}", v, x) }
pub async fn h1(v: &String, x: &u64) { h0(v, x).await }
pub async fn h2(v: &String, x: &u64) { h1(v, x).await }
pub async fn h3(v: &String, x: &u64) { h2(v, x).await }
pub async fn h4(v: &String, x: &u64) { h3(v, x).await }
pub async fn h5(v: &String, x: &u64) { h4(v, x).await }
pub async fn h6(v: &String, x: &u64) { h5(v, x).await }
pub async fn h7(v: &String, x: &u64) { h6(v, x).await }
pub async fn h8(v: &String, x: &u64) { h7(v, x).await }
pub async fn h9(v: &String, x: &u64) { h8(v, x).await }

pub async fn h10(v: &String, x: &u64) { h9(v, x).await }
pub async fn h11(v: &String, x: &u64) { h10(v, x).await }
pub async fn h12(v: &String, x: &u64) { h11(v, x).await }
pub async fn h13(v: &String, x: &u64) { h12(v, x).await }
pub async fn h14(v: &String, x: &u64) { h13(v, x).await }
pub async fn h15(v: &String, x: &u64) { h14(v, x).await }
pub async fn h16(v: &String, x: &u64) { h15(v, x).await }
pub async fn h17(v: &String, x: &u64) { h16(v, x).await }
pub async fn h18(v: &String, x: &u64) { h17(v, x).await }
pub async fn h19(v: &String, x: &u64) { h18(v, x).await }

macro_rules! async_recursive {
    (29, $inner:expr) => { async { async_recursive!(28, $inner) }.await };
    (28, $inner:expr) => { async { async_recursive!(27, $inner) }.await };
    (27, $inner:expr) => { async { async_recursive!(26, $inner) }.await };
    (26, $inner:expr) => { async { async_recursive!(25, $inner) }.await };
    (25, $inner:expr) => { async { async_recursive!(24, $inner) }.await };
    (24, $inner:expr) => { async { async_recursive!(23, $inner) }.await };
    (23, $inner:expr) => { async { async_recursive!(22, $inner) }.await };
    (22, $inner:expr) => { async { async_recursive!(21, $inner) }.await };
    (21, $inner:expr) => { async { async_recursive!(20, $inner) }.await };
    (20, $inner:expr) => { async { async_recursive!(19, $inner) }.await };

    (19, $inner:expr) => { async { async_recursive!(18, $inner) }.await };
    (18, $inner:expr) => { async { async_recursive!(17, $inner) }.await };
    (17, $inner:expr) => { async { async_recursive!(16, $inner) }.await };
    (16, $inner:expr) => { async { async_recursive!(15, $inner) }.await };
    (15, $inner:expr) => { async { async_recursive!(14, $inner) }.await };
    (14, $inner:expr) => { async { async_recursive!(13, $inner) }.await };
    (13, $inner:expr) => { async { async_recursive!(12, $inner) }.await };
    (12, $inner:expr) => { async { async_recursive!(11, $inner) }.await };
    (11, $inner:expr) => { async { async_recursive!(10, $inner) }.await };
    (10, $inner:expr) => { async { async_recursive!(9, $inner) }.await };

    (9, $inner:expr) => { async { async_recursive!(8, $inner) }.await };
    (8, $inner:expr) => { async { async_recursive!(7, $inner) }.await };
    (7, $inner:expr) => { async { async_recursive!(6, $inner) }.await };
    (6, $inner:expr) => { async { async_recursive!(5, $inner) }.await };
    (5, $inner:expr) => { async { async_recursive!(4, $inner) }.await };
    (4, $inner:expr) => { async { async_recursive!(3, $inner) }.await };
    (3, $inner:expr) => { async { async_recursive!(2, $inner) }.await };
    (2, $inner:expr) => { async { async_recursive!(1, $inner) }.await };
    (1, $inner:expr) => { async { async_recursive!(0, $inner) }.await };
    (0, $inner:expr) => { async { h19(&String::from("owo"), &0).await; $inner }.await };
}

async fn f() {
    async_recursive!(14, println!("hello"));
}

fn main() {
    let _ = f();
}
```
r? `@eddyb` requires a perf run.
2020-09-22 22:52:07 +00:00
..
rustc
rustc_apfloat
rustc_arena Rollup merge of #76821 - est31:remove_redundant_nightly_features, r=oli-obk,Mark-Simulacrum 2020-09-20 12:08:22 +02:00
rustc_ast Rollup merge of #76890 - matthiaskrgr:matches_simpl, r=lcnr 2020-09-20 15:52:01 +02:00
rustc_ast_lowering
rustc_ast_passes use matches!() macro for simple if let conditions 2020-09-18 20:28:35 +02:00
rustc_ast_pretty
rustc_attr use matches!() macro for simple if let conditions 2020-09-18 20:28:35 +02:00
rustc_builtin_macros use matches!() macro for simple if let conditions 2020-09-18 20:28:35 +02:00
rustc_codegen_llvm Rollup merge of #76962 - est31:const_cstr, r=oli-obk 2020-09-21 10:40:45 +02:00
rustc_codegen_ssa Rollup merge of #76872 - khyperia:remove_declare_methods, r=eddyb 2020-09-21 10:40:35 +02:00
rustc_data_structures Auto merge of #76928 - lcnr:opaque-types-cache, r=tmandry 2020-09-22 22:52:07 +00:00
rustc_driver use strip_prefix over starts_with and manual slicing based on pattern length (clippy::manual_strip) 2020-09-17 10:13:16 +02:00
rustc_error_codes Add explanation for E0756 2020-09-21 21:04:56 +02:00
rustc_errors Rollup merge of #76846 - botika:master, r=davidtwco 2020-09-21 10:40:30 +02:00
rustc_expand Remove redundant #![feature(...)] 's from compiler/ 2020-09-17 07:58:45 +02:00
rustc_feature Remove MMX from Rust 2020-09-20 15:13:11 +02:00
rustc_fs_util
rustc_graphviz
rustc_hir
rustc_hir_pretty
rustc_incremental
rustc_index cache types during normalization 2020-09-19 17:27:13 +02:00
rustc_infer Auto merge of #76928 - lcnr:opaque-types-cache, r=tmandry 2020-09-22 22:52:07 +00:00
rustc_interface PR feedback 2020-09-17 12:18:09 +02:00
rustc_lexer Fix typo in rustc_lexer docs 2020-09-21 05:43:39 +02:00
rustc_lint Rollup merge of #77032 - lcnr:visit-all-the-item-likes, r=davidtwco 2020-09-21 20:41:01 -07:00
rustc_llvm Update cc crate to understand aarch64-apple-darwin with clang 2020-09-18 09:22:07 -04:00
rustc_macros
rustc_metadata support const_evaluatable_checked across crate boundaries 2020-09-18 17:11:34 +02:00
rustc_middle Rollup merge of #76914 - lcnr:path-no-more, r=ecstatic-morse 2020-09-21 20:40:57 -07:00
rustc_mir Rollup merge of #76888 - matthiaskrgr:clippy_single_match_2, r=Dylan-DPC 2020-09-21 20:40:55 -07:00
rustc_mir_build Rollup merge of #76890 - matthiaskrgr:matches_simpl, r=lcnr 2020-09-20 15:52:01 +02:00
rustc_parse Rollup merge of #76888 - matthiaskrgr:clippy_single_match_2, r=Dylan-DPC 2020-09-21 20:40:55 -07:00
rustc_parse_format Rollup merge of #76888 - matthiaskrgr:clippy_single_match_2, r=Dylan-DPC 2020-09-21 20:40:55 -07:00
rustc_passes transmute: use diagnostic item 2020-09-19 11:33:11 +02:00
rustc_plugin_impl
rustc_privacy Rollup merge of #76821 - est31:remove_redundant_nightly_features, r=oli-obk,Mark-Simulacrum 2020-09-20 12:08:22 +02:00
rustc_query_system
rustc_resolve Rollup merge of #76888 - matthiaskrgr:clippy_single_match_2, r=Dylan-DPC 2020-09-21 20:40:55 -07:00
rustc_save_analysis
rustc_serialize
rustc_session Rollup merge of #76832 - khyperia:backend_target_override, r=eddyb 2020-09-20 15:51:48 +02:00
rustc_span Remove cast to usize for BytePos and CharPos 2020-09-21 19:42:43 +01:00
rustc_symbol_mangling use if let instead of single match arm expressions to compact code and reduce nesting (clippy::single_match) 2020-09-20 11:42:52 +02:00
rustc_target
rustc_trait_selection Auto merge of #76928 - lcnr:opaque-types-cache, r=tmandry 2020-09-22 22:52:07 +00:00
rustc_traits Remove redundant #![feature(...)] 's from compiler/ 2020-09-17 07:58:45 +02:00
rustc_ty Remove redundant #![feature(...)] 's from compiler/ 2020-09-17 07:58:45 +02:00
rustc_typeck Auto merge of #76906 - Nicholas-Baron:shorten_typeck_check, r=oli-obk 2020-09-22 08:11:07 +00:00