diff -Nru rustc-1.68.2+dfsg0ubuntu1~bpo1/Cargo.lock rustc-1.69.0+dfsg0ubuntu1~bpo0/Cargo.lock --- rustc-1.68.2+dfsg0ubuntu1~bpo1/Cargo.lock 2023-03-27 07:39:20.000000000 +0000 +++ rustc-1.69.0+dfsg0ubuntu1~bpo0/Cargo.lock 2023-04-16 21:39:50.000000000 +0000 @@ -90,15 +90,6 @@ [[package]] name = "ansi_term" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" -dependencies = [ - "winapi", -] - -[[package]] -name = "ansi_term" version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" @@ -129,6 +120,12 @@ [[package]] name = "arrayvec" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" + +[[package]] +name = "arrayvec" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a2f58b0bb10c380af2b26e57212856b8c9a59e0925b4c20f4a174a49734eaf7" @@ -173,7 +170,7 @@ "quote", "serde", "syn", - "toml", + "toml 0.5.7", ] [[package]] @@ -285,7 +282,7 @@ "serde_json", "sha2", "tar", - "toml", + "toml 0.5.7", ] [[package]] @@ -301,7 +298,7 @@ "indexmap", "serde", "serde_json", - "toml", + "toml 0.5.7", ] [[package]] @@ -342,7 +339,7 @@ [[package]] name = "cargo" -version = "0.69.1" +version = "0.70.0" dependencies = [ "anyhow", "base64", @@ -384,7 +381,6 @@ "os_info", "pasetors", "pathdiff", - "percent-encoding", "pretty_env_logger", "rustc-workspace-hack", "rustfix", @@ -402,12 +398,13 @@ "tempfile", "termcolor", "time 0.3.17", + "toml 0.7.2", "toml_edit", "unicode-width", "unicode-xid", "url", "walkdir", - "winapi", + "windows-sys 0.45.0", ] [[package]] @@ -436,18 +433,18 @@ version = "0.2.0" dependencies = [ "cargo-credential", - "winapi", + "windows-sys 0.45.0", ] [[package]] name = "cargo-miri" version = "0.1.0" dependencies = [ - "cargo_metadata 0.15.0", + "cargo_metadata 0.15.3", "directories", "rustc-build-sysroot", "rustc-workspace-hack", - "rustc_tools_util 0.2.1", + "rustc_tools_util", "rustc_version", "serde", "serde_json", @@ -494,9 +491,9 @@ "tar", "termcolor", "time 0.3.17", - "toml_edit", + "toml 0.7.2", "url", - "winapi", + "windows-sys 0.45.0", ] [[package]] @@ -516,7 +513,7 @@ "shell-escape", "tempfile", "walkdir", - "winapi", + "windows-sys 0.45.0", ] [[package]] @@ -534,15 +531,16 @@ [[package]] name = "cargo_metadata" -version = "0.15.0" +version = "0.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3abb7553d5b9b8421c6de7cb02606ff15e0c6eea7d8eadd75ef013fd636bec36" +checksum = "08a1ec454bc3eead8719cb56e15dbbfecdbc14e4b3a3ae4936cc6e31f5fc0d07" dependencies = [ "camino", "cargo-platform 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "semver", "serde", "serde_json", + "thiserror", ] [[package]] @@ -724,8 +722,9 @@ [[package]] name = "clippy" -version = "0.1.68" +version = "0.1.69" dependencies = [ + "clap 4.1.4", "clippy_lints", "clippy_utils", "compiletest_rs", @@ -739,7 +738,7 @@ "regex", "rustc-semver", "rustc-workspace-hack", - "rustc_tools_util 0.3.0", + "rustc_tools_util", "semver", "serde", "syn", @@ -747,7 +746,7 @@ "termize", "tester", "tokio", - "toml", + "toml 0.5.7", "walkdir", ] @@ -756,7 +755,7 @@ version = "0.0.1" dependencies = [ "aho-corasick", - "clap 3.2.20", + "clap 4.1.4", "indoc", "itertools", "opener", @@ -766,14 +765,14 @@ [[package]] name = "clippy_lints" -version = "0.1.68" +version = "0.1.69" dependencies = [ - "cargo_metadata 0.14.0", + "cargo_metadata 0.15.3", "clippy_utils", "declare_clippy_lint", "if_chain", "itertools", - "pulldown-cmark 0.9.2", + "pulldown-cmark", "quine-mc_cluskey", "regex-syntax", "rustc-semver", @@ -781,7 +780,7 @@ "serde", "serde_json", "tempfile", - "toml", + "toml 0.5.7", "unicode-normalization", "unicode-script", "url", @@ -789,9 +788,9 @@ [[package]] name = "clippy_utils" -version = "0.1.68" +version = "0.1.69" dependencies = [ - "arrayvec", + "arrayvec 0.7.0", "if_chain", "itertools", "rustc-semver", @@ -846,16 +845,6 @@ ] [[package]] -name = "combine" -version = "4.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" -dependencies = [ - "bytes", - "memchr", -] - -[[package]] name = "commoncrypto" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -875,9 +864,9 @@ [[package]] name = "compiler_builtins" -version = "0.1.85" +version = "0.1.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e81c6cd7ab79f51a0c927d22858d61ad12bd0b3865f0b13ece02a4486aeabb" +checksum = "f867ce54c09855ccd135ad4a50c777182a0c7af5ff20a8f537617bd648b10d50" dependencies = [ "cc", "rustc-std-workspace-core", @@ -887,15 +876,16 @@ name = "compiletest" version = "0.0.0" dependencies = [ + "build_helper", "colored", "diff", "getopts", "glob", - "lazy_static", "lazycell", "libc", - "miow 0.3.7", + "miow 0.5.0", "miropt-test-tools", + "once_cell", "regex", "rustfix", "serde", @@ -1007,7 +997,7 @@ [[package]] name = "crates-io" -version = "0.35.1" +version = "0.36.0" dependencies = [ "anyhow", "curl", @@ -1168,7 +1158,7 @@ [[package]] name = "declare_clippy_lint" -version = "0.1.68" +version = "0.1.69" dependencies = [ "itertools", "quote", @@ -1217,12 +1207,6 @@ checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" [[package]] -name = "difference" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" - -[[package]] name = "digest" version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1379,10 +1363,19 @@ ] [[package]] +name = "elsa" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f74077c3c3aedb99a2683919698285596662518ea13e5eedcf8bdd43b0d0453b" +dependencies = [ + "stable_deref_trait", +] + +[[package]] name = "ena" -version = "0.14.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7402b94a93c24e742487327a7cd839dc9d36fec9de9fb25b09f2dae459f36c3" +checksum = "b2e5d13ca2353ab7d0230988629def93914a8c4015f621f9b13ed2955614731d" dependencies = [ "log", ] @@ -1452,6 +1445,7 @@ version = "0.0.0" dependencies = [ "mdbook", + "rustc_error_codes", ] [[package]] @@ -1930,23 +1924,16 @@ [[package]] name = "hermit-abi" -version = "0.2.6" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +checksum = "856b5cb0902c2b6d65d5fd97dfa30f9b70c7538e770b98eab5ed52d8db923e01" dependencies = [ "compiler_builtins", - "libc", "rustc-std-workspace-alloc", "rustc-std-workspace-core", ] [[package]] -name = "hermit-abi" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" - -[[package]] name = "hex" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2033,23 +2020,21 @@ [[package]] name = "icu_list" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c40218275f081c4493f190357c5395647b06734c2dc3dcb41cc099a0f60168b1" +checksum = "01a65ff0cab77c33c7e165c858eaa6e84a09f1e485dd495d9d0ae61083c6f786" dependencies = [ "displaydoc", - "icu_locid", "icu_provider", "regex-automata 0.2.0", "writeable", - "zerovec", ] [[package]] name = "icu_locid" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34b3de5d99a0e275fe6193b9586dbf37364daebc0d39c89b5cf8376a53b789e8" +checksum = "71d7a98ecb812760b5f077e55a4763edeefa7ccc30d6eb5680a70841ede81928" dependencies = [ "displaydoc", "litemap", @@ -2060,9 +2045,9 @@ [[package]] name = "icu_provider" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f911086e3c521a8a824d4f8bfd87769645ced2f07ff913b521c0d793be07100" +checksum = "a86816c97bc4e613086497f9479f63e120315e056763e8c4435604f98d21d82d" dependencies = [ "displaydoc", "icu_locid", @@ -2076,9 +2061,9 @@ [[package]] name = "icu_provider_adapters" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "980c71d8a91b246ebbb97847178a4b816eea39d1d550c70ee566384555bb6545" +checksum = "8e89bf33962b24bb48a4a21330c20c9ff17949338ea376360dd9eda2c209dca1" dependencies = [ "icu_locid", "icu_provider", @@ -2089,9 +2074,9 @@ [[package]] name = "icu_provider_macros" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38cf6f5b65cf81f0b4298da647101acbfe6ae0e25263f92bd7a22597e9d6d606" +checksum = "9ddb07844c2ffc4c28840e799e9e54ff054393cf090740decf25624e9d94b93a" dependencies = [ "proc-macro2", "quote", @@ -2232,7 +2217,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21b6b32576413a8e69b90e952e4a026476040d81017b80445deda5f2d3921857" dependencies = [ - "hermit-abi 0.3.1", + "hermit-abi 0.3.0", "io-lifetimes", "rustix", "windows-sys 0.45.0", @@ -2266,9 +2251,9 @@ [[package]] name = "jobserver" -version = "0.1.24" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa" +checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" dependencies = [ "libc", ] @@ -2321,15 +2306,6 @@ ] [[package]] -name = "kstring" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec3066350882a1cd6d950d055997f379ac37fd39f81cd4d8ed186032eb3c5747" -dependencies = [ - "static_assertions", -] - -[[package]] name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2343,9 +2319,9 @@ [[package]] name = "libc" -version = "0.2.138" +version = "0.2.139" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8" +checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" dependencies = [ "rustc-std-workspace-core", ] @@ -2466,9 +2442,9 @@ [[package]] name = "litemap" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f34a3f4798fac63fb48cf277eefa38f94d3443baff555bb98e4f56bc9092368e" +checksum = "575d8a551c59104b4df91269921e5eab561aa1b77c618dac0414b5d44a4617de" [[package]] name = "lld-wrapper" @@ -2572,13 +2548,13 @@ "memchr", "once_cell", "opener", - "pulldown-cmark 0.9.2", + "pulldown-cmark", "regex", "serde", "serde_json", "shlex", "tempfile", - "toml", + "toml 0.5.7", "topological-sort", ] @@ -2589,7 +2565,7 @@ "anyhow", "handlebars 3.5.5", "pretty_assertions", - "pulldown-cmark 0.7.2", + "pulldown-cmark", "same-file", "serde_json", "url", @@ -2725,6 +2701,15 @@ ] [[package]] +name = "nom8" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae01545c9c7fc4486ab7debaf2aad7003ac19431791868fb2e8066df97fad2f8" +dependencies = [ + "memchr", +] + +[[package]] name = "normalize-line-endings" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3192,14 +3177,14 @@ [[package]] name = "pretty_assertions" -version = "0.6.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f81e1644e1b54f5a68959a29aa86cde704219254669da328ecfdf6a1f09d427" +checksum = "a25e9bcb20aa780fd0bb16b72403a9064d6b3f22f026946029acb941a50af755" dependencies = [ - "ansi_term 0.11.0", "ctor", - "difference", + "diff", "output_vt100", + "yansi", ] [[package]] @@ -3279,17 +3264,6 @@ [[package]] name = "pulldown-cmark" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca36dea94d187597e104a5c8e4b07576a8a45aa5db48a65e12940d3eb7461f55" -dependencies = [ - "bitflags", - "memchr", - "unicase", -] - -[[package]] -name = "pulldown-cmark" version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d9cc634bc78768157b5cbfe988ffcd1dcba95cd2b2f03a88316c08c6d00ed63" @@ -3504,25 +3478,6 @@ ] [[package]] -name = "rls-data" -version = "0.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a58135eb039f3a3279a33779192f0ee78b56f57ae636e25cec83530e41debb99" -dependencies = [ - "rls-span", - "serde", -] - -[[package]] -name = "rls-span" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0eea58478fc06e15f71b03236612173a1b81e9770314edecfa664375e3e4c86" -dependencies = [ - "serde", -] - -[[package]] name = "rust-demangler" version = "0.0.1" dependencies = [ @@ -3573,6 +3528,7 @@ "jemalloc-sys", "rustc_codegen_ssa", "rustc_driver", + "rustc_driver_impl", "rustc_smir", ] @@ -3678,6 +3634,7 @@ version = "0.0.0" dependencies = [ "bitflags", + "memchr", "rustc_data_structures", "rustc_index", "rustc_lexer", @@ -3693,7 +3650,6 @@ name = "rustc_ast_lowering" version = "0.0.0" dependencies = [ - "rustc_arena", "rustc_ast", "rustc_ast_pretty", "rustc_data_structures", @@ -3702,7 +3658,6 @@ "rustc_index", "rustc_macros", "rustc_middle", - "rustc_query_system", "rustc_session", "rustc_span", "rustc_target", @@ -3727,6 +3682,7 @@ "rustc_session", "rustc_span", "rustc_target", + "thin-vec", "tracing", ] @@ -3736,6 +3692,7 @@ dependencies = [ "rustc_ast", "rustc_span", + "thin-vec", ] [[package]] @@ -3762,7 +3719,6 @@ "icu_locid", "icu_provider", "icu_provider_adapters", - "litemap", "zerovec", ] @@ -3841,11 +3797,12 @@ "rustc_metadata", "rustc_middle", "rustc_query_system", - "rustc_serialize", "rustc_session", "rustc_span", "rustc_symbol_mangling", "rustc_target", + "serde", + "serde_json", "smallvec", "tempfile", "tracing", @@ -3867,7 +3824,6 @@ "rustc_arena", "rustc_ast", "rustc_attr", - "rustc_const_eval", "rustc_data_structures", "rustc_errors", "rustc_fs_util", @@ -3908,7 +3864,6 @@ "rustc_macros", "rustc_middle", "rustc_mir_dataflow", - "rustc_query_system", "rustc_session", "rustc_span", "rustc_target", @@ -3921,9 +3876,10 @@ name = "rustc_data_structures" version = "0.0.0" dependencies = [ - "arrayvec", + "arrayvec 0.7.0", "bitflags", "cfg-if", + "elsa", "ena", "indexmap", "jobserver", @@ -3951,29 +3907,56 @@ name = "rustc_driver" version = "0.0.0" dependencies = [ + "rustc_driver_impl", +] + +[[package]] +name = "rustc_driver_impl" +version = "0.0.0" +dependencies = [ "libc", "rustc_ast", + "rustc_ast_lowering", + "rustc_ast_passes", "rustc_ast_pretty", + "rustc_attr", + "rustc_borrowck", + "rustc_builtin_macros", "rustc_codegen_ssa", + "rustc_const_eval", "rustc_data_structures", "rustc_error_codes", + "rustc_error_messages", "rustc_errors", + "rustc_expand", "rustc_feature", "rustc_hir", "rustc_hir_analysis", "rustc_hir_pretty", + "rustc_hir_typeck", + "rustc_incremental", + "rustc_infer", "rustc_interface", "rustc_lint", "rustc_log", "rustc_macros", "rustc_metadata", "rustc_middle", + "rustc_mir_build", + "rustc_mir_dataflow", + "rustc_monomorphize", "rustc_parse", + "rustc_passes", "rustc_plugin_impl", - "rustc_save_analysis", + "rustc_privacy", + "rustc_query_system", + "rustc_resolve", "rustc_session", "rustc_span", + "rustc_symbol_mangling", "rustc_target", + "rustc_trait_selection", + "rustc_ty_utils", "serde_json", "tracing", "winapi", @@ -4000,7 +3983,6 @@ "rustc_span", "tracing", "unic-langid", - "writeable", ] [[package]] @@ -4096,21 +4078,19 @@ "rustc_data_structures", "rustc_errors", "rustc_feature", - "rustc_graphviz", "rustc_hir", - "rustc_hir_pretty", "rustc_index", "rustc_infer", "rustc_lint", "rustc_macros", "rustc_middle", - "rustc_serialize", "rustc_session", "rustc_span", "rustc_target", "rustc_trait_selection", "rustc_type_ir", "smallvec", + "thin-vec", "tracing", ] @@ -4167,6 +4147,7 @@ "rustc_serialize", "rustc_session", "rustc_span", + "thin-vec", "tracing", ] @@ -4174,7 +4155,7 @@ name = "rustc_index" version = "0.0.0" dependencies = [ - "arrayvec", + "arrayvec 0.7.0", "rustc_macros", "rustc_serialize", "smallvec", @@ -4191,7 +4172,6 @@ "rustc_macros", "rustc_middle", "rustc_serialize", - "rustc_session", "rustc_span", "rustc_target", "smallvec", @@ -4221,6 +4201,7 @@ "rustc_hir_analysis", "rustc_hir_typeck", "rustc_incremental", + "rustc_index", "rustc_lint", "rustc_macros", "rustc_metadata", @@ -4234,7 +4215,6 @@ "rustc_privacy", "rustc_query_impl", "rustc_resolve", - "rustc_serialize", "rustc_session", "rustc_span", "rustc_symbol_mangling", @@ -4332,6 +4312,7 @@ name = "rustc_metadata" version = "0.0.0" dependencies = [ + "bitflags", "libloading", "odht", "rustc_ast", @@ -4399,7 +4380,6 @@ "rustc_apfloat", "rustc_arena", "rustc_ast", - "rustc_attr", "rustc_data_structures", "rustc_errors", "rustc_hir", @@ -4431,7 +4411,6 @@ "rustc_macros", "rustc_middle", "rustc_serialize", - "rustc_session", "rustc_span", "rustc_target", "smallvec", @@ -4562,7 +4541,6 @@ "rustc_middle", "rustc_session", "rustc_span", - "rustc_trait_selection", "tracing", ] @@ -4583,7 +4561,6 @@ "rustc_serialize", "rustc_session", "rustc_span", - "rustc_target", "thin-vec", "tracing", ] @@ -4617,6 +4594,7 @@ version = "0.0.0" dependencies = [ "bitflags", + "pulldown-cmark", "rustc_arena", "rustc_ast", "rustc_ast_pretty", @@ -4639,27 +4617,6 @@ ] [[package]] -name = "rustc_save_analysis" -version = "0.0.0" -dependencies = [ - "rls-data", - "rls-span", - "rustc_ast", - "rustc_ast_pretty", - "rustc_data_structures", - "rustc_errors", - "rustc_hir", - "rustc_hir_pretty", - "rustc_lexer", - "rustc_macros", - "rustc_middle", - "rustc_session", - "rustc_span", - "serde_json", - "tracing", -] - -[[package]] name = "rustc_serialize" version = "0.0.0" dependencies = [ @@ -4763,12 +4720,6 @@ [[package]] name = "rustc_tools_util" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "598f48ce2a421542b3e64828aa742b687cc1b91d2f96591cfdb7ac5988cd6366" - -[[package]] -name = "rustc_tools_util" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ba09476327c4b70ccefb6180f046ef588c26a24cf5d269a9feba316eb4f029f" @@ -4777,6 +4728,7 @@ name = "rustc_trait_selection" version = "0.0.0" dependencies = [ + "itertools", "rustc_ast", "rustc_attr", "rustc_data_structures", @@ -4784,7 +4736,6 @@ "rustc_hir", "rustc_index", "rustc_infer", - "rustc_lint_defs", "rustc_macros", "rustc_middle", "rustc_parse_format", @@ -4806,7 +4757,6 @@ "chalk-ir", "chalk-solve", "rustc_ast", - "rustc_attr", "rustc_data_structures", "rustc_hir", "rustc_index", @@ -4878,13 +4828,12 @@ name = "rustdoc" version = "0.0.0" dependencies = [ - "arrayvec", + "arrayvec 0.7.0", "askama", "expect-test", "itertools", "minifier", "once_cell", - "pulldown-cmark 0.9.2", "rayon", "regex", "rustdoc-json-types", @@ -4892,7 +4841,6 @@ "serde_json", "smallvec", "tempfile", - "thin-vec", "tracing", "tracing-subscriber", "tracing-tree", @@ -4931,7 +4879,7 @@ [[package]] name = "rustfmt-config_proc_macro" -version = "0.2.0" +version = "0.3.0" dependencies = [ "proc-macro2", "quote", @@ -4941,7 +4889,7 @@ [[package]] name = "rustfmt-nightly" -version = "1.5.1" +version = "1.5.2" dependencies = [ "annotate-snippets", "anyhow", @@ -4964,7 +4912,7 @@ "serde_json", "term", "thiserror", - "toml", + "toml 0.5.7", "unicode-segmentation", "unicode-width", "unicode_categories", @@ -5131,6 +5079,15 @@ ] [[package]] +name = "serde_spanned" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0efd8caf556a6cebd3b285caf480045fcc1ac04f6bd786b09a6f11af30c4fcf4" +dependencies = [ + "serde", +] + +[[package]] name = "sha1" version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -5219,9 +5176,9 @@ [[package]] name = "snap" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da73c8f77aebc0e40c300b93f0a5f1bece7a248a36eee287d4e095f35c7b7d6e" +checksum = "5e9f0ab6ef7eb7353d9119c170a436d1bf248eea575ac42d19d12f4e34130831" [[package]] name = "snapbox" @@ -5333,7 +5290,7 @@ "dlmalloc", "fortanix-sgx-abi", "hashbrown 0.12.3", - "hermit-abi 0.2.6", + "hermit-abi 0.3.0", "libc", "miniz_oxide", "object 0.29.0", @@ -5387,9 +5344,9 @@ [[package]] name = "strip-ansi-escapes" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d63676e2abafa709460982ddc02a3bb586b6d15a49b75c212e06edd3933acee" +checksum = "011cbb39cf7c1f62871aea3cc46e5817b0937b49e9447370c93cacbe93a766d8" dependencies = [ "vte", ] @@ -5528,10 +5485,8 @@ name = "test" version = "0.0.0" dependencies = [ - "cfg-if", "core", "getopts", - "libc", "panic_abort", "panic_unwind", "proc_macro", @@ -5559,9 +5514,9 @@ [[package]] name = "thin-vec" -version = "0.2.9" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceb05e71730d396f960f8f3901cdb41be2d339b303e9d7d3a07c5ff0536e671b" +checksum = "aac81b6fd6beb5884b0cf3321b8117e6e5d47ecb6fc89f414cfdcca8b2fe2dd8" [[package]] name = "thiserror" @@ -5662,9 +5617,9 @@ [[package]] name = "tinystr" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8aeafdfd935e4a7fe16a91ab711fa52d54df84f9c8f7ca5837a9d1d902ef4c2" +checksum = "7ac3f5b6856e931e15e07b478e98c8045239829a65f9156d4fa7e7788197a5ef" dependencies = [ "displaydoc", "zerovec", @@ -5707,25 +5662,36 @@ ] [[package]] +name = "toml" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7afcae9e3f0fe2c370fd4657108972cbb2fa9db1b9f84849cefd80741b01cb6" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] name = "toml_datetime" -version = "0.5.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808b51e57d0ef8f71115d8f3a01e7d3750d01c79cac4b3eda910f4389fdf92fd" +checksum = "3ab8ed2edee10b50132aed5f331333428b011c99402b5a534154ed15746f9622" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.15.0" +version = "0.19.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1541ba70885967e662f69d31ab3aeca7b1aaecfcd58679590b893e9239c3646" +checksum = "5e6a7712b49e1775fb9a7b998de6635b299237f48b404dde71704f2e0e7f37e5" dependencies = [ - "combine", "indexmap", - "itertools", - "kstring", + "nom8", "serde", + "serde_spanned", "toml_datetime", ] @@ -5795,7 +5761,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "245da694cc7fc4729f3f418b304cb57789f1bed2a78c575407ab8a23f53cb4d3" dependencies = [ - "ansi_term 0.12.1", + "ansi_term", "lazy_static", "matchers", "parking_lot 0.11.2", @@ -5814,7 +5780,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ce989c9962c7f61fe084dd4a230eec784649dfc2392467c790007c3a6e134e7" dependencies = [ - "ansi_term 0.12.1", + "ansi_term", "atty", "tracing-core", "tracing-log", @@ -5870,7 +5836,7 @@ checksum = "54ddb6f31025943e2f9d59237f433711c461a43d9415974c3eb3a4902edc1c1f" dependencies = [ "bstr 1.0.1", - "cargo_metadata 0.15.0", + "cargo_metadata 0.15.3", "color-eyre", "colored", "crossbeam-channel", @@ -6101,9 +6067,9 @@ [[package]] name = "utf8parse" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8772a4ccbb4e89959023bc5b7cb8623a795caa7092d99f3aa9501b9484d4557d" +checksum = "936e4b492acfd135421d8dca4b1aa80a7bfc26e702ef3af710e0752684df5372" [[package]] name = "uuid" @@ -6134,11 +6100,23 @@ [[package]] name = "vte" -version = "0.3.3" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f42f536e22f7fcbb407639765c8fd78707a33109301f834a594758bedd6e8cf" +checksum = "6cbce692ab4ca2f1f3047fcf732430249c0e971bfdd2b234cf2c47ad93af5983" dependencies = [ + "arrayvec 0.5.2", "utf8parse", + "vte_generate_state_changes", +] + +[[package]] +name = "vte_generate_state_changes" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d257817081c7dffcdbab24b9e62d2def62e2ff7d00b1c20062551e6cccc145ff" +dependencies = [ + "proc-macro2", + "quote", ] [[package]] @@ -6331,9 +6309,9 @@ [[package]] name = "writeable" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8e6ab4f5da1b24daf2c590cfac801bacb27b15b4f050e84eb60149ea726f06b" +checksum = "92d74a687e3b9a7a129db0a8c82b4d464eb9c36f5a66ca68572a7e5f1cfdb5bc" [[package]] name = "xattr" @@ -6390,9 +6368,9 @@ [[package]] name = "yoke" -version = "0.6.2" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fe1d55ca72c32d573bfbd5cb2f0ca65a497854c44762957a6d3da96041a5184" +checksum = "222180af14a6b54ef2c33493c1eff77ae95a3687a21b243e752624006fb8f26e" dependencies = [ "serde", "stable_deref_trait", @@ -6402,9 +6380,9 @@ [[package]] name = "yoke-derive" -version = "0.6.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1346e4cd025ae818b88566eac7eb65ab33a994ea55f355c86889af2e7e56b14e" +checksum = "ca800d73d6b7a7ee54f2608205c98b549fca71c9500c1abcb3abdc7708b4a8cb" dependencies = [ "proc-macro2", "quote", @@ -6441,9 +6419,9 @@ [[package]] name = "zerovec" -version = "0.9.0" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9d919a74c17749ccb17beaf6405562e413cd94e98ba52ca1e64bbe7eefbd8b8" +checksum = "154df60c74c4a844bc04a53cef4fc18a909d3ea07e19f5225eaba86209da3aa6" dependencies = [ "yoke", "zerofrom", @@ -6452,9 +6430,9 @@ [[package]] name = "zerovec-derive" -version = "0.9.0" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "490e5f878c2856225e884c35927e7ea6db3c24cdb7229b72542c7526ad7ed49e" +checksum = "2154cb6e2a748163354165e22c6a555effb09ca2d16334767bf66bb404f2206e" dependencies = [ "proc-macro2", "quote", diff -Nru rustc-1.68.2+dfsg0ubuntu1~bpo1/compiler/rustc/Cargo.toml rustc-1.69.0+dfsg0ubuntu1~bpo0/compiler/rustc/Cargo.toml --- rustc-1.68.2+dfsg0ubuntu1~bpo1/compiler/rustc/Cargo.toml 2023-03-27 07:39:20.000000000 +0000 +++ rustc-1.69.0+dfsg0ubuntu1~bpo0/compiler/rustc/Cargo.toml 2023-04-16 21:39:50.000000000 +0000 @@ -5,6 +5,7 @@ [dependencies] rustc_driver = { path = "../rustc_driver" } +rustc_driver_impl = { path = "../rustc_driver_impl" } # Make sure rustc_codegen_ssa ends up in the sysroot, because this # crate is intended to be used by codegen backends, which may not be in-tree. @@ -20,6 +21,6 @@ [features] jemalloc = ['jemalloc-sys'] -llvm = ['rustc_driver/llvm'] -max_level_info = ['rustc_driver/max_level_info'] -rustc_use_parallel_compiler = ['rustc_driver/rustc_use_parallel_compiler'] +llvm = ['rustc_driver_impl/llvm'] +max_level_info = ['rustc_driver_impl/max_level_info'] +rustc_use_parallel_compiler = ['rustc_driver_impl/rustc_use_parallel_compiler'] diff -Nru rustc-1.68.2+dfsg0ubuntu1~bpo1/compiler/rustc_abi/src/layout.rs rustc-1.69.0+dfsg0ubuntu1~bpo0/compiler/rustc_abi/src/layout.rs --- rustc-1.68.2+dfsg0ubuntu1~bpo1/compiler/rustc_abi/src/layout.rs 2023-03-27 07:39:20.000000000 +0000 +++ rustc-1.69.0+dfsg0ubuntu1~bpo0/compiler/rustc_abi/src/layout.rs 2023-04-16 21:39:50.000000000 +0000 @@ -1,11 +1,5 @@ use super::*; -use std::{ - borrow::Borrow, - cmp, - fmt::Debug, - iter, - ops::{Bound, Deref}, -}; +use std::{borrow::Borrow, cmp, iter, ops::Bound}; #[cfg(feature = "randomize")] use rand::{seq::SliceRandom, SeedableRng}; @@ -33,7 +27,7 @@ fn delay_bug(&self, txt: &str); fn current_data_layout(&self) -> Self::TargetDataLayoutRef; - fn scalar_pair(&self, a: Scalar, b: Scalar) -> LayoutS { + fn scalar_pair(&self, a: Scalar, b: Scalar) -> LayoutS { let dl = self.current_data_layout(); let dl = dl.borrow(); let b_align = b.align(dl); @@ -49,7 +43,7 @@ .max_by_key(|niche| niche.available(dl)); LayoutS { - variants: Variants::Single { index: V::new(0) }, + variants: Variants::Single { index: VariantIdx::new(0) }, fields: FieldsShape::Arbitrary { offsets: vec![Size::ZERO, b_offset], memory_index: vec![0, 1], @@ -61,13 +55,13 @@ } } - fn univariant<'a, V: Idx, F: Deref> + Debug>( + fn univariant( &self, dl: &TargetDataLayout, - fields: &[F], + fields: &[Layout<'_>], repr: &ReprOptions, kind: StructKind, - ) -> Option> { + ) -> Option { let pack = repr.pack; let mut align = if pack.is_some() { dl.i8_align } else { dl.aggregate_align }; let mut inverse_memory_index: Vec = (0..fields.len() as u32).collect(); @@ -76,17 +70,17 @@ let end = if let StructKind::MaybeUnsized = kind { fields.len() - 1 } else { fields.len() }; let optimizing = &mut inverse_memory_index[..end]; - let effective_field_align = |f: &F| { + let effective_field_align = |layout: Layout<'_>| { if let Some(pack) = pack { // return the packed alignment in bytes - f.align.abi.min(pack).bytes() + layout.align().abi.min(pack).bytes() } else { // returns log2(effective-align). // This is ok since `pack` applies to all fields equally. // The calculation assumes that size is an integer multiple of align, except for ZSTs. // // group [u8; 4] with align-4 or [u8; 6] with align-2 fields - f.align.abi.bytes().max(f.size.bytes()).trailing_zeros() as u64 + layout.align().abi.bytes().max(layout.size().bytes()).trailing_zeros() as u64 } }; @@ -111,9 +105,9 @@ // Place ZSTs first to avoid "interesting offsets", // especially with only one or two non-ZST fields. // Then place largest alignments first, largest niches within an alignment group last - let f = &fields[x as usize]; - let niche_size = f.largest_niche.map_or(0, |n| n.available(dl)); - (!f.is_zst(), cmp::Reverse(effective_field_align(f)), niche_size) + let f = fields[x as usize]; + let niche_size = f.largest_niche().map_or(0, |n| n.available(dl)); + (!f.0.is_zst(), cmp::Reverse(effective_field_align(f)), niche_size) }); } @@ -123,8 +117,8 @@ // And put the largest niche in an alignment group at the end // so it can be used as discriminant in jagged enums optimizing.sort_by_key(|&x| { - let f = &fields[x as usize]; - let niche_size = f.largest_niche.map_or(0, |n| n.available(dl)); + let f = fields[x as usize]; + let niche_size = f.largest_niche().map_or(0, |n| n.available(dl)); (effective_field_align(f), niche_size) }); } @@ -160,15 +154,15 @@ )); } - if field.is_unsized() { + if field.0.is_unsized() { sized = false; } // Invariant: offset < dl.obj_size_bound() <= 1<<61 let field_align = if let Some(pack) = pack { - field.align.min(AbiAndPrefAlign::new(pack)) + field.align().min(AbiAndPrefAlign::new(pack)) } else { - field.align + field.align() }; offset = offset.align_to(field_align.abi); align = align.max(field_align); @@ -176,7 +170,7 @@ debug!("univariant offset: {:?} field: {:#?}", offset, field); offsets[i as usize] = offset; - if let Some(mut niche) = field.largest_niche { + if let Some(mut niche) = field.largest_niche() { let available = niche.available(dl); if available > largest_niche_available { largest_niche_available = available; @@ -185,7 +179,7 @@ } } - offset = offset.checked_add(field.size, dl)?; + offset = offset.checked_add(field.size(), dl)?; } if let Some(repr_align) = repr.align { align = align.max(AbiAndPrefAlign::new(repr_align)); @@ -205,24 +199,26 @@ // Unpack newtype ABIs and find scalar pairs. if sized && size.bytes() > 0 { // All other fields must be ZSTs. - let mut non_zst_fields = fields.iter().enumerate().filter(|&(_, f)| !f.is_zst()); + let mut non_zst_fields = fields.iter().enumerate().filter(|&(_, f)| !f.0.is_zst()); match (non_zst_fields.next(), non_zst_fields.next(), non_zst_fields.next()) { // We have exactly one non-ZST field. (Some((i, field)), None, None) => { // Field fills the struct and it has a scalar or scalar pair ABI. - if offsets[i].bytes() == 0 && align.abi == field.align.abi && size == field.size + if offsets[i].bytes() == 0 + && align.abi == field.align().abi + && size == field.size() { - match field.abi { + match field.abi() { // For plain scalars, or vectors of them, we can't unpack // newtypes for `#[repr(C)]`, as that affects C ABIs. Abi::Scalar(_) | Abi::Vector { .. } if optimize => { - abi = field.abi; + abi = field.abi(); } // But scalar pairs are Rust-specific and get // treated as aggregates by C ABIs anyway. Abi::ScalarPair(..) => { - abi = field.abi; + abi = field.abi(); } _ => {} } @@ -231,7 +227,7 @@ // Two non-ZST fields, and they're both scalars. (Some((i, a)), Some((j, b)), None) => { - match (a.abi, b.abi) { + match (a.abi(), b.abi()) { (Abi::Scalar(a), Abi::Scalar(b)) => { // Order by the memory placement, not source order. let ((i, a), (j, b)) = if offsets[i] < offsets[j] { @@ -239,7 +235,7 @@ } else { ((j, b), (i, a)) }; - let pair = self.scalar_pair::(a, b); + let pair = self.scalar_pair(a, b); let pair_offsets = match pair.fields { FieldsShape::Arbitrary { ref offsets, ref memory_index } => { assert_eq!(memory_index, &[0, 1]); @@ -264,11 +260,11 @@ _ => {} } } - if fields.iter().any(|f| f.abi.is_uninhabited()) { + if fields.iter().any(|f| f.abi().is_uninhabited()) { abi = Abi::Uninhabited; } Some(LayoutS { - variants: Variants::Single { index: V::new(0) }, + variants: Variants::Single { index: VariantIdx::new(0) }, fields: FieldsShape::Arbitrary { offsets, memory_index }, abi, largest_niche, @@ -277,11 +273,11 @@ }) } - fn layout_of_never_type(&self) -> LayoutS { + fn layout_of_never_type(&self) -> LayoutS { let dl = self.current_data_layout(); let dl = dl.borrow(); LayoutS { - variants: Variants::Single { index: V::new(0) }, + variants: Variants::Single { index: VariantIdx::new(0) }, fields: FieldsShape::Primitive, abi: Abi::Uninhabited, largest_niche: None, @@ -290,18 +286,18 @@ } } - fn layout_of_struct_or_enum<'a, V: Idx, F: Deref> + Debug>( + fn layout_of_struct_or_enum( &self, repr: &ReprOptions, - variants: &IndexVec>, + variants: &IndexVec>>, is_enum: bool, is_unsafe_cell: bool, scalar_valid_range: (Bound, Bound), discr_range_of_repr: impl Fn(i128, i128) -> (Integer, bool), - discriminants: impl Iterator, + discriminants: impl Iterator, niche_optimize_enum: bool, always_sized: bool, - ) -> Option> { + ) -> Option { let dl = self.current_data_layout(); let dl = dl.borrow(); @@ -316,9 +312,9 @@ // but *not* an encoding of the discriminant (e.g., a tag value). // See issue #49298 for more details on the need to leave space // for non-ZST uninhabited data (mostly partial initialization). - let absent = |fields: &[F]| { - let uninhabited = fields.iter().any(|f| f.abi.is_uninhabited()); - let is_zst = fields.iter().all(|f| f.is_zst()); + let absent = |fields: &[Layout<'_>]| { + let uninhabited = fields.iter().any(|f| f.abi().is_uninhabited()); + let is_zst = fields.iter().all(|f| f.0.is_zst()); uninhabited && is_zst }; let (present_first, present_second) = { @@ -335,7 +331,7 @@ } // If it's a struct, still compute a layout so that we can still compute the // field offsets. - None => V::new(0), + None => VariantIdx::new(0), }; let is_struct = !is_enum || @@ -439,12 +435,12 @@ // variant layouts, so we can't store them in the // overall LayoutS. Store the overall LayoutS // and the variant LayoutSs here until then. - struct TmpLayout { - layout: LayoutS, - variants: IndexVec>, + struct TmpLayout { + layout: LayoutS, + variants: IndexVec, } - let calculate_niche_filling_layout = || -> Option> { + let calculate_niche_filling_layout = || -> Option { if niche_optimize_enum { return None; } @@ -464,15 +460,16 @@ Some(st) }) - .collect::>>()?; + .collect::>>()?; let largest_variant_index = variant_layouts .iter_enumerated() .max_by_key(|(_i, layout)| layout.size.bytes()) .map(|(i, _layout)| i)?; - let all_indices = (0..=variants.len() - 1).map(V::new); - let needs_disc = |index: V| index != largest_variant_index && !absent(&variants[index]); + let all_indices = (0..=variants.len() - 1).map(VariantIdx::new); + let needs_disc = + |index: VariantIdx| index != largest_variant_index && !absent(&variants[index]); let niche_variants = all_indices.clone().find(|v| needs_disc(*v)).unwrap().index() ..=all_indices.rev().find(|v| needs_disc(*v)).unwrap().index(); @@ -482,7 +479,7 @@ let (field_index, niche, (niche_start, niche_scalar)) = variants[largest_variant_index] .iter() .enumerate() - .filter_map(|(j, field)| Some((j, field.largest_niche?))) + .filter_map(|(j, field)| Some((j, field.largest_niche()?))) .max_by_key(|(_, niche)| niche.available(dl)) .and_then(|(j, niche)| Some((j, niche, niche.reserve(dl, count)?)))?; let niche_offset = @@ -514,7 +511,7 @@ match layout.fields { FieldsShape::Arbitrary { ref mut offsets, .. } => { for (j, offset) in offsets.iter_mut().enumerate() { - if !variants[i][j].is_zst() { + if !variants[i][j].0.is_zst() { *offset += this_offset; } } @@ -572,8 +569,8 @@ tag: niche_scalar, tag_encoding: TagEncoding::Niche { untagged_variant: largest_variant_index, - niche_variants: (V::new(*niche_variants.start()) - ..=V::new(*niche_variants.end())), + niche_variants: (VariantIdx::new(*niche_variants.start()) + ..=VariantIdx::new(*niche_variants.end())), niche_start, }, tag_field: 0, @@ -598,7 +595,7 @@ let discr_type = repr.discr_type(); let bits = Integer::from_attr(dl, discr_type).size().bits(); for (i, mut val) in discriminants { - if variants[i].iter().any(|f| f.abi.is_uninhabited()) { + if variants[i].iter().any(|f| f.abi().is_uninhabited()) { continue; } if discr_type.is_signed() { @@ -636,7 +633,7 @@ if repr.c() { for fields in variants { for field in fields { - prefix_align = prefix_align.max(field.align.abi); + prefix_align = prefix_align.max(field.align().abi); } } } @@ -655,8 +652,8 @@ // Find the first field we can't move later // to make room for a larger discriminant. for field in st.fields.index_by_increasing_offset().map(|j| &field_layouts[j]) { - if !field.is_zst() || field.align.abi.bytes() != 1 { - start_align = start_align.min(field.align.abi); + if !field.0.is_zst() || field.align().abi.bytes() != 1 { + start_align = start_align.min(field.align().abi); break; } } @@ -664,7 +661,7 @@ align = align.max(st.align); Some(st) }) - .collect::>>()?; + .collect::>>()?; // Align the maximum variant size to the largest alignment. size = size.align_to(align.abi); @@ -759,7 +756,7 @@ let FieldsShape::Arbitrary { ref offsets, .. } = layout_variant.fields else { panic!(); }; - let mut fields = iter::zip(field_layouts, offsets).filter(|p| !p.0.is_zst()); + let mut fields = iter::zip(field_layouts, offsets).filter(|p| !p.0.0.is_zst()); let (field, offset) = match (fields.next(), fields.next()) { (None, None) => { common_prim_initialized_in_all_variants = false; @@ -771,7 +768,7 @@ break; } }; - let prim = match field.abi { + let prim = match field.abi() { Abi::Scalar(scalar) => { common_prim_initialized_in_all_variants &= matches!(scalar, Scalar::Initialized { .. }); @@ -802,7 +799,7 @@ // Common prim might be uninit. Scalar::Union { value: prim } }; - let pair = self.scalar_pair::(tag, prim_scalar); + let pair = self.scalar_pair(tag, prim_scalar); let pair_offsets = match pair.fields { FieldsShape::Arbitrary { ref offsets, ref memory_index } => { assert_eq!(memory_index, &[0, 1]); @@ -862,9 +859,8 @@ // pick the layout with the larger niche; otherwise, // pick tagged as it has simpler codegen. use cmp::Ordering::*; - let niche_size = |tmp_l: &TmpLayout| { - tmp_l.layout.largest_niche.map_or(0, |n| n.available(dl)) - }; + let niche_size = + |tmp_l: &TmpLayout| tmp_l.layout.largest_niche.map_or(0, |n| n.available(dl)); match (tl.layout.size.cmp(&nl.layout.size), niche_size(&tl).cmp(&niche_size(&nl))) { (Greater, _) => nl, (Equal, Less) => nl, @@ -884,11 +880,11 @@ Some(best_layout.layout) } - fn layout_of_union<'a, V: Idx, F: Deref> + Debug>( + fn layout_of_union( &self, repr: &ReprOptions, - variants: &IndexVec>, - ) -> Option> { + variants: &IndexVec>>, + ) -> Option { let dl = self.current_data_layout(); let dl = dl.borrow(); let mut align = if repr.pack.is_some() { dl.i8_align } else { dl.aggregate_align }; @@ -900,15 +896,15 @@ let optimize = !repr.inhibit_union_abi_opt(); let mut size = Size::ZERO; let mut abi = Abi::Aggregate { sized: true }; - let index = V::new(0); + let index = VariantIdx::new(0); for field in &variants[index] { - assert!(field.is_sized()); - align = align.max(field.align); + assert!(field.0.is_sized()); + align = align.max(field.align()); // If all non-ZST fields have the same ABI, forward this ABI - if optimize && !field.is_zst() { + if optimize && !field.0.is_zst() { // Discard valid range information and allow undef - let field_abi = match field.abi { + let field_abi = match field.abi() { Abi::Scalar(x) => Abi::Scalar(x.to_union()), Abi::ScalarPair(x, y) => Abi::ScalarPair(x.to_union(), y.to_union()), Abi::Vector { element: x, count } => { @@ -926,7 +922,7 @@ } } - size = cmp::max(size, field.size); + size = cmp::max(size, field.size()); } if let Some(pack) = repr.pack { diff -Nru rustc-1.68.2+dfsg0ubuntu1~bpo1/compiler/rustc_abi/src/lib.rs rustc-1.69.0+dfsg0ubuntu1~bpo0/compiler/rustc_abi/src/lib.rs --- rustc-1.68.2+dfsg0ubuntu1~bpo1/compiler/rustc_abi/src/lib.rs 2023-03-27 07:39:20.000000000 +0000 +++ rustc-1.69.0+dfsg0ubuntu1~bpo0/compiler/rustc_abi/src/lib.rs 2023-04-16 21:39:50.000000000 +0000 @@ -8,6 +8,7 @@ use std::str::FromStr; use bitflags::bitflags; +use rustc_data_structures::intern::Interned; #[cfg(feature = "nightly")] use rustc_data_structures::stable_hasher::StableOrd; use rustc_index::vec::{Idx, IndexVec}; @@ -170,7 +171,9 @@ pub instruction_address_space: AddressSpace, - /// Minimum size of #[repr(C)] enums (default I32 bits) + /// Minimum size of #[repr(C)] enums (default c_int::BITS, usually 32) + /// Note: This isn't in LLVM's data layout string, it is `short_enum` + /// so the only valid spec for LLVM is c_int::BITS or 8 pub c_enum_min_size: Integer, } @@ -267,6 +270,9 @@ ["a", ref a @ ..] => dl.aggregate_align = align(a, "a")?, ["f32", ref a @ ..] => dl.f32_align = align(a, "f32")?, ["f64", ref a @ ..] => dl.f64_align = align(a, "f64")?, + // FIXME(erikdesjardins): we should be parsing nonzero address spaces + // this will require replacing TargetDataLayout::{pointer_size,pointer_align} + // with e.g. `fn pointer_size_in(AddressSpace)` [p @ "p", s, ref a @ ..] | [p @ "p0", s, ref a @ ..] => { dl.pointer_size = size(s, p)?; dl.pointer_align = align(a, p)?; @@ -861,7 +867,7 @@ Int(Integer, bool), F32, F64, - Pointer, + Pointer(AddressSpace), } impl Primitive { @@ -872,7 +878,10 @@ Int(i, _) => i.size(), F32 => Size::from_bits(32), F64 => Size::from_bits(64), - Pointer => dl.pointer_size, + // FIXME(erikdesjardins): ignoring address space is technically wrong, pointers in + // different address spaces can have different sizes + // (but TargetDataLayout doesn't currently parse that part of the DL string) + Pointer(_) => dl.pointer_size, } } @@ -883,26 +892,12 @@ Int(i, _) => i.align(dl), F32 => dl.f32_align, F64 => dl.f64_align, - Pointer => dl.pointer_align, + // FIXME(erikdesjardins): ignoring address space is technically wrong, pointers in + // different address spaces can have different alignments + // (but TargetDataLayout doesn't currently parse that part of the DL string) + Pointer(_) => dl.pointer_align, } } - - // FIXME(eddyb) remove, it's trivial thanks to `matches!`. - #[inline] - pub fn is_float(self) -> bool { - matches!(self, F32 | F64) - } - - // FIXME(eddyb) remove, it's completely unused. - #[inline] - pub fn is_int(self) -> bool { - matches!(self, Int(..)) - } - - #[inline] - pub fn is_ptr(self) -> bool { - matches!(self, Pointer) - } } /// Inclusive wrap-around range of valid values, that is, if @@ -1188,7 +1183,8 @@ /// An identifier that specifies the address space that some operation /// should operate on. Special address spaces have an effect on code generation, /// depending on the target and the address spaces it implements. -#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[cfg_attr(feature = "nightly", derive(HashStable_Generic))] pub struct AddressSpace(pub u32); impl AddressSpace { @@ -1257,9 +1253,9 @@ #[derive(PartialEq, Eq, Hash, Clone, Debug)] #[cfg_attr(feature = "nightly", derive(HashStable_Generic))] -pub enum Variants { +pub enum Variants { /// Single enum variants, structs/tuples, unions, and all non-ADTs. - Single { index: V }, + Single { index: VariantIdx }, /// Enum-likes with more than one inhabited variant: each variant comes with /// a *discriminant* (usually the same as the variant index but the user can @@ -1269,15 +1265,15 @@ /// For enums, the tag is the sole field of the layout. Multiple { tag: Scalar, - tag_encoding: TagEncoding, + tag_encoding: TagEncoding, tag_field: usize, - variants: IndexVec>, + variants: IndexVec, }, } #[derive(PartialEq, Eq, Hash, Clone, Debug)] #[cfg_attr(feature = "nightly", derive(HashStable_Generic))] -pub enum TagEncoding { +pub enum TagEncoding { /// The tag directly stores the discriminant, but possibly with a smaller layout /// (so converting the tag to the discriminant can require sign extension). Direct, @@ -1292,7 +1288,11 @@ /// For example, `Option<(usize, &T)>` is represented such that /// `None` has a null pointer for the second tuple field, and /// `Some` is the identity function (with a non-null reference). - Niche { untagged_variant: V, niche_variants: RangeInclusive, niche_start: u128 }, + Niche { + untagged_variant: VariantIdx, + niche_variants: RangeInclusive, + niche_start: u128, + }, } #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)] @@ -1379,9 +1379,14 @@ } } +rustc_index::newtype_index! { + #[derive(HashStable_Generic)] + pub struct VariantIdx {} +} + #[derive(PartialEq, Eq, Hash, Clone)] #[cfg_attr(feature = "nightly", derive(HashStable_Generic))] -pub struct LayoutS { +pub struct LayoutS { /// Says where the fields are located within the layout. pub fields: FieldsShape, @@ -1392,7 +1397,7 @@ /// /// To access all fields of this layout, both `fields` and the fields of the active variant /// must be taken into account. - pub variants: Variants, + pub variants: Variants, /// The `abi` defines how this data is passed between functions, and it defines /// value restrictions via `valid_range`. @@ -1411,13 +1416,13 @@ pub size: Size, } -impl LayoutS { +impl LayoutS { pub fn scalar(cx: &C, scalar: Scalar) -> Self { let largest_niche = Niche::from_scalar(cx, Size::ZERO, scalar); let size = scalar.size(cx); let align = scalar.align(cx); LayoutS { - variants: Variants::Single { index: V::new(0) }, + variants: Variants::Single { index: VariantIdx::new(0) }, fields: FieldsShape::Primitive, abi: Abi::Scalar(scalar), largest_niche, @@ -1427,7 +1432,7 @@ } } -impl fmt::Debug for LayoutS { +impl fmt::Debug for LayoutS { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { // This is how `Layout` used to print before it become // `Interned`. We print it like this to avoid having to update @@ -1444,42 +1449,63 @@ } } -#[derive(Copy, Clone, PartialEq, Eq, Debug)] -pub enum PointerKind { - /// Most general case, we know no restrictions to tell LLVM. - SharedMutable, +#[derive(Copy, Clone, PartialEq, Eq, Hash, HashStable_Generic)] +#[rustc_pass_by_value] +pub struct Layout<'a>(pub Interned<'a, LayoutS>); + +impl<'a> fmt::Debug for Layout<'a> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + // See comment on `::fmt` above. + self.0.0.fmt(f) + } +} - /// `&T` where `T` contains no `UnsafeCell`, is `dereferenceable`, `noalias` and `readonly`. - Frozen, +impl<'a> Layout<'a> { + pub fn fields(self) -> &'a FieldsShape { + &self.0.0.fields + } - /// `&mut T` which is `dereferenceable` and `noalias` but not `readonly`. - UniqueBorrowed, + pub fn variants(self) -> &'a Variants { + &self.0.0.variants + } - /// `&mut !Unpin`, which is `dereferenceable` but neither `noalias` nor `readonly`. - UniqueBorrowedPinned, + pub fn abi(self) -> Abi { + self.0.0.abi + } + + pub fn largest_niche(self) -> Option { + self.0.0.largest_niche + } + + pub fn align(self) -> AbiAndPrefAlign { + self.0.0.align + } - /// `Box`, which is `noalias` (even on return types, unlike the above) but neither `readonly` - /// nor `dereferenceable`. - UniqueOwned, + pub fn size(self) -> Size { + self.0.0.size + } +} + +#[derive(Copy, Clone, PartialEq, Eq, Debug)] +pub enum PointerKind { + /// Shared reference. `frozen` indicates the absence of any `UnsafeCell`. + SharedRef { frozen: bool }, + /// Mutable reference. `unpin` indicates the absence of any pinned data. + MutableRef { unpin: bool }, + /// Box. `unpin` indicates the absence of any pinned data. + Box { unpin: bool }, } +/// Note that this information is advisory only, and backends are free to ignore it. +/// It can only be used to encode potential optimizations, but no critical information. #[derive(Copy, Clone, Debug)] pub struct PointeeInfo { pub size: Size, pub align: Align, pub safe: Option, - pub address_space: AddressSpace, -} - -/// Used in `might_permit_raw_init` to indicate the kind of initialisation -/// that is checked to be valid -#[derive(Copy, Clone, Debug, PartialEq, Eq)] -pub enum InitKind { - Zero, - UninitMitigated0x01Fill, } -impl LayoutS { +impl LayoutS { /// Returns `true` if the layout corresponds to an unsized type. pub fn is_unsized(&self) -> bool { self.abi.is_unsized() diff -Nru rustc-1.68.2+dfsg0ubuntu1~bpo1/compiler/rustc_ast/Cargo.toml rustc-1.69.0+dfsg0ubuntu1~bpo0/compiler/rustc_ast/Cargo.toml --- rustc-1.68.2+dfsg0ubuntu1~bpo1/compiler/rustc_ast/Cargo.toml 2023-03-27 07:39:20.000000000 +0000 +++ rustc-1.69.0+dfsg0ubuntu1~bpo0/compiler/rustc_ast/Cargo.toml 2023-04-16 21:39:50.000000000 +0000 @@ -7,6 +7,7 @@ [dependencies] bitflags = "1.2.1" +memchr = "2.5.0" rustc_data_structures = { path = "../rustc_data_structures" } rustc_index = { path = "../rustc_index" } rustc_lexer = { path = "../rustc_lexer" } @@ -14,5 +15,5 @@ rustc_serialize = { path = "../rustc_serialize" } rustc_span = { path = "../rustc_span" } smallvec = { version = "1.8.1", features = ["union", "may_dangle"] } -thin-vec = "0.2.9" +thin-vec = "0.2.12" tracing = "0.1" diff -Nru rustc-1.68.2+dfsg0ubuntu1~bpo1/compiler/rustc_ast/src/ast.rs rustc-1.69.0+dfsg0ubuntu1~bpo0/compiler/rustc_ast/src/ast.rs --- rustc-1.68.2+dfsg0ubuntu1~bpo1/compiler/rustc_ast/src/ast.rs 2023-03-27 07:39:20.000000000 +0000 +++ rustc-1.69.0+dfsg0ubuntu1~bpo0/compiler/rustc_ast/src/ast.rs 2023-04-16 21:39:50.000000000 +0000 @@ -18,6 +18,7 @@ //! - [`Attribute`]: Metadata associated with item. //! - [`UnOp`], [`BinOp`], and [`BinOpKind`]: Unary and binary operators. +pub use crate::format::*; pub use crate::util::parser::ExprPrecedence; pub use GenericArgs::*; pub use UnsafeSource::*; @@ -208,7 +209,7 @@ /// The overall span. pub span: Span, /// The comma separated parts in the `<...>`. - pub args: Vec, + pub args: ThinVec, } /// Either an argument for a parameter e.g., `'a`, `Vec`, `0`, @@ -252,7 +253,7 @@ pub span: Span, /// `(A, B)` - pub inputs: Vec>, + pub inputs: ThinVec>, /// ```text /// Foo(A, B) -> C @@ -383,7 +384,7 @@ /// a function, enum, trait, etc. #[derive(Clone, Encodable, Decodable, Debug)] pub struct Generics { - pub params: Vec, + pub params: ThinVec, pub where_clause: WhereClause, pub span: Span, } @@ -391,7 +392,7 @@ impl Default for Generics { /// Creates an instance of `Generics`. fn default() -> Generics { - Generics { params: Vec::new(), where_clause: Default::default(), span: DUMMY_SP } + Generics { params: ThinVec::new(), where_clause: Default::default(), span: DUMMY_SP } } } @@ -402,13 +403,13 @@ /// if we parsed no predicates (e.g. `struct Foo where {}`). /// This allows us to pretty-print accurately. pub has_where_token: bool, - pub predicates: Vec, + pub predicates: ThinVec, pub span: Span, } impl Default for WhereClause { fn default() -> WhereClause { - WhereClause { has_where_token: false, predicates: Vec::new(), span: DUMMY_SP } + WhereClause { has_where_token: false, predicates: ThinVec::new(), span: DUMMY_SP } } } @@ -440,7 +441,7 @@ pub struct WhereBoundPredicate { pub span: Span, /// Any generics from a `for` binding. - pub bound_generic_params: Vec, + pub bound_generic_params: ThinVec, /// The type being bounded. pub bounded_ty: P, /// Trait and lifetime bounds (`Clone + Send + 'static`). @@ -470,7 +471,7 @@ #[derive(Clone, Encodable, Decodable, Debug)] pub struct Crate { pub attrs: AttrVec, - pub items: Vec>, + pub items: ThinVec>, pub spans: ModSpans, /// Must be equal to `CRATE_NODE_ID` after the crate root is expanded, but may hold /// expansion placeholders or an unassigned value (`DUMMY_NODE_ID`) before that. @@ -502,7 +503,7 @@ /// List meta item. /// /// E.g., `#[derive(..)]`, where the field represents the `..`. - List(Vec), + List(ThinVec), /// Name value meta item. /// @@ -530,7 +531,7 @@ #[derive(Clone, Encodable, Decodable, Debug)] pub struct Block { /// The statements in the block. - pub stmts: Vec, + pub stmts: ThinVec, pub id: NodeId, /// Distinguishes between `unsafe { ... }` and `{ ... }`. pub rules: BlockCheckMode, @@ -580,7 +581,7 @@ // A tuple pattern `(P0, .., Pn)` can be reparsed as `(T0, .., Tn)` // assuming `T0` to `Tn` are all syntactically valid as types. PatKind::Tuple(pats) => { - let mut tys = Vec::with_capacity(pats.len()); + let mut tys = ThinVec::with_capacity(pats.len()); // FIXME(#48994) - could just be collected into an Option for pat in pats { tys.push(pat.to_ty()?); @@ -721,14 +722,14 @@ /// A struct or struct variant pattern (e.g., `Variant {x, y, ..}`). /// The `bool` is `true` in the presence of a `..`. - Struct(Option>, Path, Vec, /* recovered */ bool), + Struct(Option>, Path, ThinVec, /* recovered */ bool), /// A tuple struct/variant pattern (`Variant(x, y, .., z)`). - TupleStruct(Option>, Path, Vec>), + TupleStruct(Option>, Path, ThinVec>), /// An or-pattern `A | B | C`. /// Invariant: `pats.len() >= 2`. - Or(Vec>), + Or(ThinVec>), /// A possibly qualified path pattern. /// Unqualified path patterns `A::B::C` can legally refer to variants, structs, constants @@ -737,7 +738,7 @@ Path(Option>, Path), /// A tuple pattern (`(a, b)`). - Tuple(Vec>), + Tuple(ThinVec>), /// A `box` pattern. Box(P), @@ -752,7 +753,7 @@ Range(Option>, Option>, Spanned), /// A slice pattern `[a, b, c]`. - Slice(Vec>), + Slice(ThinVec>), /// A rest pattern `..`. /// @@ -1168,7 +1169,7 @@ pub fn to_bound(&self) -> Option { match &self.kind { ExprKind::Path(None, path) => Some(GenericBound::Trait( - PolyTraitRef::new(Vec::new(), path.clone(), self.span), + PolyTraitRef::new(ThinVec::new(), path.clone(), self.span), TraitBoundModifier::None, )), _ => None, @@ -1203,7 +1204,7 @@ ExprKind::Array(exprs) if exprs.len() == 1 => exprs[0].to_ty().map(TyKind::Slice)?, ExprKind::Tup(exprs) => { - let tys = exprs.iter().map(|expr| expr.to_ty()).collect::>>()?; + let tys = exprs.iter().map(|expr| expr.to_ty()).collect::>>()?; TyKind::Tup(tys) } @@ -1269,6 +1270,7 @@ ExprKind::Try(..) => ExprPrecedence::Try, ExprKind::Yield(..) => ExprPrecedence::Yield, ExprKind::Yeet(..) => ExprPrecedence::Yeet, + ExprKind::FormatArgs(..) => ExprPrecedence::FormatArgs, ExprKind::Err => ExprPrecedence::Err, } } @@ -1335,7 +1337,7 @@ /// The receiver, e.g. `x`. pub receiver: P, /// The arguments, e.g. `a, b, c`. - pub args: Vec>, + pub args: ThinVec>, /// The span of the function, without the dot and receiver e.g. `foo::(a, b, c)`. pub span: Span, @@ -1355,7 +1357,7 @@ pub struct StructExpr { pub qself: Option>, pub path: Path, - pub fields: Vec, + pub fields: ThinVec, pub rest: StructRest, } @@ -1364,7 +1366,7 @@ /// A `box x` expression. Box(P), /// An array (`[a, b, c, d]`) - Array(Vec>), + Array(ThinVec>), /// Allow anonymous constants from an inline `const` block ConstBlock(AnonConst), /// A function call @@ -1373,11 +1375,11 @@ /// and the second field is the list of arguments. /// This also represents calling the constructor of /// tuple-like ADTs such as tuple structs and enum variants. - Call(P, Vec>), + Call(P, ThinVec>), /// A method call (e.g. `x.foo::(a, b, c)`). MethodCall(Box), /// A tuple (e.g., `(a, b, c, d)`). - Tup(Vec>), + Tup(ThinVec>), /// A binary operation (e.g., `a + b`, `a * b`). Binary(BinOp, P, P), /// A unary operation (e.g., `!x`, `*x`). @@ -1412,7 +1414,7 @@ /// `'label: loop { block }` Loop(P, Option