diff --git a/Cargo.lock b/Cargo.lock index 3359fe488f16b..bc56af05c16fa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,15 +2,15 @@ # It is not intended for manual editing. [[package]] name = "adler32" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e522997b529f05601e05166c07ed17789691f562762c7f3b987263d2dedee5c" +checksum = "5d2e7343e7fc9de883d1b0341e0b13970f764c14101234857d2ddafa1cb1cac2" [[package]] name = "aho-corasick" -version = "0.7.3" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6f484ae0c99fec2e858eb6134949117399f222608d84cadb3f58c1f97c2364c" +checksum = "58fb5e95d83b38284460a5fda7d6470aa0b8844d283a0b614b8535e880800d2d" dependencies = [ "memchr", ] @@ -21,7 +21,7 @@ version = "0.0.0" dependencies = [ "compiler_builtins", "core", - "rand 0.7.0", + "rand 0.7.3", "rand_xorshift 0.2.0", ] @@ -32,11 +32,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e266e1f4be5ffa05309f650e2586fe1d3ae6034eb24025a7ae1dfecc330823a" dependencies = [ "html5ever", - "lazy_static 1.3.0", + "lazy_static 1.4.0", "maplit", "matches", "tendril", - "url 2.1.0", + "url 2.1.1", ] [[package]] @@ -74,7 +74,7 @@ name = "arena" version = "0.0.0" dependencies = [ "rustc_data_structures", - "smallvec 1.0.0", + "smallvec 1.1.0", ] [[package]] @@ -104,26 +104,32 @@ dependencies = [ [[package]] name = "atty" -version = "0.2.11" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ + "hermit-abi", "libc", - "termion", "winapi 0.3.8", ] [[package]] name = "autocfg" -version = "0.1.6" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" + +[[package]] +name = "autocfg" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b671c8fb71b457dd4ae18c4ba1e59aa81793daacc361d82fcd410cef0d491875" +checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" [[package]] name = "backtrace" -version = "0.3.40" +version = "0.3.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "924c76597f0d9ca25d762c25a4d369d51267536465dc5064bdf0eb073ed477ea" +checksum = "a4ed64ae6d9ebfd9893193c4b2532b1292ec97bd8271c9d7d0fa90cd78a34cba" dependencies = [ "backtrace-sys", "cfg-if", @@ -199,7 +205,7 @@ dependencies = [ "filetime", "getopts", "ignore", - "lazy_static 1.3.0", + "lazy_static 1.4.0", "libc", "num_cpus", "pretty_assertions", @@ -212,9 +218,9 @@ dependencies = [ [[package]] name = "bstr" -version = "0.1.3" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "853b090ce0f45d0265902666bf88039ea3da825e33796716c511a1ec9c170036" +checksum = "3ede750122d9d1f87919570cb2cccee38c84fbc8c5599b25c289af40625b7030" dependencies = [ "memchr", ] @@ -272,11 +278,10 @@ checksum = "716960a18f978640f25101b5cbf1c6f6b0d3192fab36a2d98ca96f0ecbe41010" [[package]] name = "c2-chacha" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d64d04786e0f528460fc884753cf8dddcc466be308f6026f8e355c41a0e4101" +checksum = "214238caa1bf3a496ec3392968969cab8549f96ff30652c9e56885329315f6bb" dependencies = [ - "lazy_static 1.3.0", "ppv-lite86", ] @@ -311,7 +316,7 @@ dependencies = [ "ignore", "im-rc", "jobserver", - "lazy_static 1.3.0", + "lazy_static 1.4.0", "lazycell", "libc", "libgit2-sys", @@ -338,7 +343,7 @@ dependencies = [ "termcolor", "toml", "unicode-width", - "url 2.1.0", + "url 2.1.1", "walkdir", "winapi 0.3.8", ] @@ -364,11 +369,11 @@ dependencies = [ "flate2", "git2", "glob", - "lazy_static 1.3.0", + "lazy_static 1.4.0", "remove_dir_all", "serde_json", "tar", - "url 2.1.0", + "url 2.1.1", ] [[package]] @@ -402,19 +407,18 @@ version = "0.1.0" [[package]] name = "cc" -version = "1.0.49" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e450b8da92aa6f274e7c6437692f9f2ce6d701fb73bacfcf87897b3f89a4c20e" +checksum = "95e28fa049fda1c330bcf9d723be7663a899c4679724b34c81e9f5a326aab8cd" dependencies = [ "jobserver", - "num_cpus", ] [[package]] name = "cfg-if" -version = "0.1.8" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89431bba4e6b7092fb5fcd00a6f6ca596c55cc26b2f1e6dcdd08a1f4933f66b2" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" dependencies = [ "compiler_builtins", "rustc-std-workspace-core", @@ -441,9 +445,9 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.6" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45912881121cb26fad7c38c17ba7daa18764771836b34fab7d3fbd93ed633878" +checksum = "31850b4a4d6bae316f7a09e691c944c28299298837edc0a03f755618c23cbc01" dependencies = [ "num-integer", "num-traits", @@ -476,7 +480,7 @@ dependencies = [ "compiletest_rs", "derive-new", "git2", - "lazy_static 1.3.0", + "lazy_static 1.4.0", "regex", "rustc-workspace-hack", "rustc_tools_util 0.2.0", @@ -497,17 +501,17 @@ dependencies = [ "cargo_metadata 0.9.0", "if_chain", "itertools 0.8.0", - "lazy_static 1.3.0", + "lazy_static 1.4.0", "matches", "pulldown-cmark 0.6.1", "quine-mc_cluskey", "regex-syntax", "semver", "serde", - "smallvec 1.0.0", + "smallvec 1.1.0", "toml", "unicode-normalization", - "url 2.1.0", + "url 2.1.1", ] [[package]] @@ -592,7 +596,7 @@ dependencies = [ "diff", "env_logger 0.7.1", "getopts", - "lazy_static 1.3.0", + "lazy_static 1.4.0", "libc", "log", "miow 0.3.3", @@ -664,7 +668,7 @@ dependencies = [ name = "core" version = "0.0.0" dependencies = [ - "rand 0.7.0", + "rand 0.7.3", ] [[package]] @@ -709,26 +713,34 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "url 2.1.0", + "url 2.1.1", ] [[package]] name = "crc32fast" -version = "1.1.2" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91d5240c6975ef33aeb5f148f35275c25eda8e8a5f95abe421978b05b8bf192" +checksum = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" dependencies = [ "cfg-if", ] [[package]] name = "crossbeam-channel" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f0ed1a4de2235cabda8558ff5840bffb97fcb64c97827f354a451307df5f72b" +checksum = "c8ec7fcd21571dc78f96cc96243cab8d8f035247c3efd16c687be154c3fa9efa" dependencies = [ "crossbeam-utils 0.6.5", - "smallvec 0.6.10", +] + +[[package]] +name = "crossbeam-channel" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acec9a3b0b3559f15aee4f90746c4e5e293b701c0f7d3925d24e01645267b68c" +dependencies = [ + "crossbeam-utils 0.7.0", ] [[package]] @@ -750,7 +762,7 @@ dependencies = [ "arrayvec", "cfg-if", "crossbeam-utils 0.6.5", - "lazy_static 1.3.0", + "lazy_static 1.4.0", "memoffset", "scopeguard", ] @@ -771,7 +783,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8306fcef4a7b563b76b7dd949ca48f52bc1141aa067d2ea09565f3e2652aa5c" dependencies = [ "cfg-if", - "lazy_static 1.3.0", + "lazy_static 1.4.0", ] [[package]] @@ -780,16 +792,16 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce446db02cdc3165b94ae73111e570793400d0794e46125cc4056c81cbb039f4" dependencies = [ - "autocfg", + "autocfg 0.1.7", "cfg-if", - "lazy_static 1.3.0", + "lazy_static 1.4.0", ] [[package]] name = "crypto-hash" -version = "0.3.1" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09de9ee0fc255ace04c7fa0763c9395a945c37c8292bb554f8d48361d1dcf1b4" +checksum = "8a77162240fd97248d19a564a565eb563a3f592b386e4136fb300909e67dddca" dependencies = [ "commoncrypto", "hex 0.3.2", @@ -799,9 +811,9 @@ dependencies = [ [[package]] name = "curl" -version = "0.4.24" +version = "0.4.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d08ad3cb89d076a36b0ce5749eec2c9964f70c0c58480ab6b75a91ec4fc206d8" +checksum = "06aa71e9208a54def20792d877bc663d6aae0732b9852e612c4a933177c31283" dependencies = [ "curl-sys", "libc", @@ -814,9 +826,9 @@ dependencies = [ [[package]] name = "curl-sys" -version = "0.4.22" +version = "0.4.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e9a9a4e417722876332136a00cacf92c2ceb331fab4b52b6a1ad16c6cd79255" +checksum = "0c38ca47d60b86d0cc9d42caa90a0885669c2abc9791f871c81f58cdf39e979b" dependencies = [ "cc", "libc", @@ -847,8 +859,8 @@ dependencies = [ "fnv", "ident_case", "proc-macro2 0.4.30", - "quote 0.6.12", - "syn 0.15.35", + "quote 0.6.13", + "syn 0.15.44", ] [[package]] @@ -858,8 +870,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "244e8987bd4e174385240cde20a3657f607fb0797563c28255c353b5819a07b1" dependencies = [ "darling_core", - "quote 0.6.12", - "syn 0.15.35", + "quote 0.6.13", + "syn 0.15.44", ] [[package]] @@ -875,8 +887,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ca414e896ae072546f4d789f452daaecf60ddee4c9df5dc6d5936d769e3d87c" dependencies = [ "proc-macro2 0.4.30", - "quote 0.6.12", - "syn 0.15.35", + "quote 0.6.13", + "syn 0.15.44", ] [[package]] @@ -886,9 +898,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f57d78cf3bd45270dad4e70c21ec77a960b36c7a841ff9db76aaa775a8fb871" dependencies = [ "proc-macro2 0.4.30", - "quote 0.6.12", + "quote 0.6.13", "rustc_version", - "syn 0.15.35", + "syn 0.15.44", ] [[package]] @@ -979,7 +991,7 @@ version = "2.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a99a310cd1f9770e7bf8e48810c7bcbb0e078c8fb23a8c7bcf0da4c2bf61a455" dependencies = [ - "lazy_static 1.3.0", + "lazy_static 1.4.0", "regex", "serde", "serde_derive", @@ -1051,9 +1063,9 @@ dependencies = [ [[package]] name = "failure" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "795bd83d3abeb9220f257e597aa0080a508b27533824adf336529648f6abf7e2" +checksum = "f8273f13c977665c5db7eb2b99ae520952fe5ac831ae4cd09d80c4c7042b5ed9" dependencies = [ "backtrace", "failure_derive", @@ -1061,14 +1073,14 @@ dependencies = [ [[package]] name = "failure_derive" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea1063915fd7ef4309e222a5a07cf9c319fb9c7836b1f89b85458672dbb127e1" +checksum = "0bc225b78e0391e4b8683440bf2e63c2deeeb2ce5189eab46e2b68c6d3725d08" dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.12", - "syn 0.15.35", - "synstructure 0.10.2", + "proc-macro2 1.0.7", + "quote 1.0.2", + "syn 1.0.13", + "synstructure", ] [[package]] @@ -1079,20 +1091,21 @@ checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" [[package]] name = "filetime" -version = "0.2.4" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2df5c1a8c4be27e7707789dc42ae65976e60b394afd293d1419ab915833e646" +checksum = "1ff6d4dab0aa0c8e6346d46052e93b13a16cf847b54ed357087c35011048cc7d" dependencies = [ "cfg-if", "libc", "redox_syscall", + "winapi 0.3.8", ] [[package]] name = "flate2" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad3c5233c9a940c8719031b423d7e6c16af66e031cb0420b0896f5245bf181d3" +checksum = "6bd6d6f4752952feb71363cffc9ebac9411b75b87c6ab6058c40c8900cf43c0f" dependencies = [ "cfg-if", "crc32fast", @@ -1132,9 +1145,9 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "fortanix-sgx-abi" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f8cbee5e872cf7db61a999a041f9bc4706ca7bf7df4cb914f53fabb1c1bc550" +checksum = "c56c422ef86062869b2d57ae87270608dc5929969dd130a6e248979cf4fb6ca6" dependencies = [ "compiler_builtins", "rustc-std-workspace-core", @@ -1215,9 +1228,9 @@ dependencies = [ [[package]] name = "fwdansi" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34dd4c507af68d37ffef962063dfa1944ce0dd4d5b82043dbab1dabe088610c3" +checksum = "08c1f5787fe85505d1f7777268db5103d80a7a374d2316a7ce262e57baf8f208" dependencies = [ "memchr", "termcolor", @@ -1245,13 +1258,13 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.1.12" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "473a1265acc8ff1e808cd0a1af8cee3c2ee5200916058a2ca113c29f2d903571" +checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" dependencies = [ "cfg-if", "libc", - "wasi 0.7.0", + "wasi", ] [[package]] @@ -1266,7 +1279,7 @@ dependencies = [ "log", "openssl-probe", "openssl-sys", - "url 2.1.0", + "url 2.1.1", ] [[package]] @@ -1278,7 +1291,7 @@ dependencies = [ "curl", "git2", "log", - "url 2.1.0", + "url 2.1.1", ] [[package]] @@ -1289,9 +1302,9 @@ checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" [[package]] name = "globset" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef4feaabe24a0a658fd9cf4a9acf6ed284f045c77df0f49020ba3245cfb7b454" +checksum = "925aa2cac82d8834e2b2a4415b6f6879757fb5c0928fc445ae76461a12eed8f2" dependencies = [ "aho-corasick", "bstr", @@ -1329,7 +1342,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df044dd42cdb7e32f28557b661406fc0f2494be75199779998810dbc35030e0d" dependencies = [ "hashbrown 0.5.0", - "lazy_static 1.3.0", + "lazy_static 1.4.0", "log", "pest", "pest_derive", @@ -1350,11 +1363,11 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cd9867f119b19fecb08cd5c326ad4488d7a1da4bf75b4d95d71db742525aaab" +checksum = "8e6073d0ca812575946eb5f35ff68dbe519907b25c42530389ff946dc84c6ead" dependencies = [ - "autocfg", + "autocfg 0.1.7", "compiler_builtins", "rustc-std-workspace-alloc", "rustc-std-workspace-core", @@ -1371,9 +1384,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.1.1" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f22b8f315b98f415780ddbe9163c7dbbc5a07225b6d102ace1d8aeef85775140" +checksum = "eff2656d88f158ce120947499e971d743c05dbcbed62e5bd2f38f1698bbc3772" dependencies = [ "compiler_builtins", "libc", @@ -1394,11 +1407,10 @@ checksum = "023b39be39e3a2da62a94feb433e91e8bcd37676fbc8bea371daf52b7a769a3e" [[package]] name = "home" -version = "0.5.1" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3753954f7bd71f0e671afb8b5a992d1724cf43b7f95a563cd4a0bde94659ca8" +checksum = "2456aef2e6b6a9784192ae780c0f15bc57df0e918585282325e8c8ac27737654" dependencies = [ - "scopeguard", "winapi 0.3.8", ] @@ -1411,9 +1423,9 @@ dependencies = [ "log", "mac", "markup5ever", - "proc-macro2 1.0.3", + "proc-macro2 1.0.7", "quote 1.0.2", - "syn 1.0.11", + "syn 1.0.13", ] [[package]] @@ -1533,13 +1545,13 @@ checksum = "c3360c7b59e5ffa2653671fb74b4741a5d343c03f331c0a4aeda42b5c2b0ec7d" [[package]] name = "ignore" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ec16832258409d571aaef8273f3c3cc5b060d784e159d1a0f3b0017308f84a7" +checksum = "522daefc3b69036f80c7d2990b28ff9e0471c683bad05ca258e0a01dd22c5a1e" dependencies = [ - "crossbeam-channel", + "crossbeam-channel 0.4.0", "globset", - "lazy_static 1.3.0", + "lazy_static 1.4.0", "log", "memchr", "regex", @@ -1551,9 +1563,9 @@ dependencies = [ [[package]] name = "im-rc" -version = "14.0.0" +version = "14.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9ad726dce25993be6352b0bff048e4d2647440c0a673d32257c4fac49356d18" +checksum = "ed5135086ffe74654d797c02fd673c4046cdb7f552c98f1b1aa6851d6572f84f" dependencies = [ "bitmaps", "rand_core 0.5.1", @@ -1576,7 +1588,7 @@ dependencies = [ "clap", "failure", "flate2", - "lazy_static 1.3.0", + "lazy_static 1.4.0", "num_cpus", "rayon", "remove_dir_all", @@ -1638,13 +1650,11 @@ dependencies = [ [[package]] name = "jobserver" -version = "0.1.16" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f74e73053eaf95399bf926e48fc7a2a3ce50bd0eaaa2357d391e95b2dcdd4f10" +checksum = "67b06c1b455f1cf4269a8cfc320ab930a810e2375a42af5075eb8a8b36405ce0" dependencies = [ "libc", - "log", - "rand 0.7.0", ] [[package]] @@ -1702,8 +1712,8 @@ checksum = "29f9149f785deaae92a4c834a9a1a83a4313b8cfedccf15362cd4cf039a64501" dependencies = [ "proc-macro-crate", "proc-macro2 0.4.30", - "quote 0.6.12", - "syn 0.15.35", + "quote 0.6.13", + "syn 0.15.44", ] [[package]] @@ -1741,7 +1751,7 @@ dependencies = [ "bytes", "globset", "jsonrpc-core", - "lazy_static 1.3.0", + "lazy_static 1.4.0", "log", "num_cpus", "tokio", @@ -1767,9 +1777,9 @@ checksum = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73" [[package]] name = "lazy_static" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5729f27f159ddd61f4df6228e827e86643d4d3e7c32183cb30a1c08f604a14" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "lazycell" @@ -1802,9 +1812,9 @@ dependencies = [ [[package]] name = "libnghttp2-sys" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75d7966bda4730b722d1eab8e668df445368a24394bae9fc1e8dc0ab3dbe4f4" +checksum = "02254d44f4435dd79e695f2c2b83cd06a47919adea30216ceaf0c57ca0a72463" dependencies = [ "cc", "libc", @@ -1864,7 +1874,7 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19af41f0565d7c19b2058153ad0b42d4d5ce89ec4dbf06ed6741114a8b63e7cd" dependencies = [ - "lazy_static 1.3.0", + "lazy_static 1.4.0", ] [[package]] @@ -1888,7 +1898,7 @@ dependencies = [ "serde", "serde_json", "serde_repr", - "url 2.1.0", + "url 2.1.1", ] [[package]] @@ -1943,6 +1953,12 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" +[[package]] +name = "maybe-uninit" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" + [[package]] name = "mdbook" version = "0.3.5" @@ -1957,7 +1973,7 @@ dependencies = [ "error-chain", "handlebars", "itertools 0.8.0", - "lazy_static 1.3.0", + "lazy_static 1.4.0", "log", "memchr", "open", @@ -2013,9 +2029,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2efc7bc57c883d4a4d6e3246905283d8dae951bb3bd32f49d6ef297f546e1c39" +checksum = "3197e20c7edb283f87c071ddfc7a2cca8f8e0b888c242959846a6fce03c72223" [[package]] name = "memmap" @@ -2151,7 +2167,7 @@ dependencies = [ "hex 0.4.0", "log", "num-traits", - "rand 0.7.0", + "rand 0.7.3", "rustc-workspace-hack", "rustc_version", "serde", @@ -2165,7 +2181,7 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b2df1a4c22fd44a62147fd8f13dd0f95c9d8ca7b2610299b2a2f9cf8964274e" dependencies = [ - "lazy_static 1.3.0", + "lazy_static 1.4.0", "libc", "log", "openssl", @@ -2202,25 +2218,30 @@ checksum = "9a2228dca57108069a5262f2ed8bd2e82496d2e074a06d1ccc7ce1687b6ae0a2" [[package]] name = "num-integer" -version = "0.1.39" +version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e83d528d2677f0518c570baf2b7abdcf0cd2d248860b68507bdcb3e91d4c0cea" +checksum = "3f6ea62e9d81a77cd3ee9a2a5b9b609447857f3d358704331e4ef39eb247fcba" dependencies = [ + "autocfg 1.0.0", "num-traits", ] [[package]] name = "num-traits" -version = "0.2.6" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b3a5d7cc97d6d30d8b9bc8fa19bf45349ffe46241e8816f50f62f6d6aaabee1" +checksum = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096" +dependencies = [ + "autocfg 1.0.0", +] [[package]] name = "num_cpus" -version = "1.10.1" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcef43580c035376c0705c42792c294b66974abbfd2789b511784023f71f3273" +checksum = "76dac5ed2a876980778b8b85f75a71b6cbf0db0b1232ee12f826bccb00d09d72" dependencies = [ + "hermit-abi", "libc", ] @@ -2238,23 +2259,23 @@ checksum = "c281318d992e4432cfa799969467003d05921582a7489a8325e37f8a450d5113" [[package]] name = "opener" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "998c59e83d9474c01127a96e023b7a04bb061dd286bf8bb939d31dc8d31a7448" +checksum = "13117407ca9d0caf3a0e74f97b490a7e64c0ae3aa90a8b7085544d0c37b6f3ae" dependencies = [ "winapi 0.3.8", ] [[package]] name = "openssl" -version = "0.10.25" +version = "0.10.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f372b2b53ce10fb823a337aaa674e3a7d072b957c6264d0f4ff0bd86e657449" +checksum = "3a3cc5799d98e1088141b8e01ff760112bbd9f19d850c124500566ca6901a585" dependencies = [ "bitflags", "cfg-if", "foreign-types", - "lazy_static 1.3.0", + "lazy_static 1.4.0", "libc", "openssl-sys", ] @@ -2267,20 +2288,20 @@ checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" [[package]] name = "openssl-src" -version = "111.6.0+1.1.1d" +version = "111.6.1+1.1.1d" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9c2da1de8a7a3f860919c01540b03a6db16de042405a8a07a5e9d0b4b825d9c" +checksum = "c91b04cb43c1a8a90e934e0cd612e2a5715d976d2d6cff4490278a0cddf35005" dependencies = [ "cc", ] [[package]] name = "openssl-sys" -version = "0.9.52" +version = "0.9.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c977d08e1312e2f7e4b86f9ebaa0ed3b19d1daff75fae88bbb88108afbd801fc" +checksum = "465d16ae7fc0e313318f7de5cecf57b2fbe7511fd213978b457e1c96ff46736f" dependencies = [ - "autocfg", + "autocfg 0.1.7", "cc", "libc", "openssl-src", @@ -2335,7 +2356,7 @@ dependencies = [ "log", "mio-named-pipes", "miow 0.3.3", - "rand 0.7.0", + "rand 0.7.3", "tokio", "tokio-named-pipes", "tokio-uds", @@ -2364,7 +2385,7 @@ dependencies = [ "libc", "redox_syscall", "rustc_version", - "smallvec 0.6.10", + "smallvec 0.6.13", "winapi 0.3.8", ] @@ -2408,8 +2429,8 @@ dependencies = [ "pest", "pest_meta", "proc-macro2 0.4.30", - "quote 0.6.12", - "syn 0.15.35", + "quote 0.6.13", + "syn 0.15.44", ] [[package]] @@ -2463,9 +2484,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.14" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "676e8eb2b1b4c9043511a9b7bea0915320d7e502b0a079fb03f9635a5252b18c" +checksum = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677" [[package]] name = "polonius-engine" @@ -2480,9 +2501,9 @@ dependencies = [ [[package]] name = "ppv-lite86" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3cbf9f658cdb5000fcf6f362b8ea2ba154b9f146a61c7a20d647034c6b6561b" +checksum = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b" [[package]] name = "precomputed-hash" @@ -2502,9 +2523,9 @@ dependencies = [ [[package]] name = "pretty_env_logger" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df8b3f4e0475def7d9c2e5de8e5a1306949849761e107b360d03e98eafaffd61" +checksum = "717ee476b1690853d222af4634056d830b5197ffd747726a9a1eee6da9f49074" dependencies = [ "chrono", "env_logger 0.6.2", @@ -2526,9 +2547,9 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aeccfe4d5d8ea175d5f0e4a2ad0637e0f4121d63bd99d356fb1f39ab2e7c6097" dependencies = [ - "proc-macro2 1.0.3", + "proc-macro2 1.0.7", "quote 1.0.2", - "syn 1.0.11", + "syn 1.0.13", ] [[package]] @@ -2542,9 +2563,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.3" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e98a83a9f9b331f54b924e68a66acb1bb35cb01fb0a23645139967abefb697e8" +checksum = "0319972dcae462681daf4da1adeeaa066e3ebd29c69be96c6abb1259d2ee2bcc" dependencies = [ "unicode-xid 0.2.0", ] @@ -2573,9 +2594,9 @@ checksum = "9bf259a81de2b2eb9850ec990ec78e6a25319715584fd7652b9b26f96fcb1510" dependencies = [ "error-chain", "idna 0.2.0", - "lazy_static 1.3.0", + "lazy_static 1.4.0", "regex", - "url 2.1.0", + "url 2.1.1", ] [[package]] @@ -2609,9 +2630,9 @@ checksum = "6ddd112cca70a4d30883b2d21568a1d376ff8be4758649f64f973c6845128ad3" [[package]] name = "quick-error" -version = "1.2.2" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quine-mc_cluskey" @@ -2621,9 +2642,9 @@ checksum = "07589615d719a60c8dd8a4622e7946465dfef20d1a428f969e3443e7386d5f45" [[package]] name = "quote" -version = "0.6.12" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faf4799c5d274f3868a4aae320a0a182cbd2baee377b378f080e16a23e9d80db" +checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" dependencies = [ "proc-macro2 0.4.30", ] @@ -2634,7 +2655,7 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" dependencies = [ - "proc-macro2 1.0.3", + "proc-macro2 1.0.7", ] [[package]] @@ -2648,7 +2669,7 @@ dependencies = [ "derive_more", "env_logger 0.6.2", "humantime", - "lazy_static 1.3.0", + "lazy_static 1.4.0", "log", "rls-span", "rustc-ap-syntax", @@ -2675,9 +2696,9 @@ dependencies = [ [[package]] name = "rand" -version = "0.7.0" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d47eab0e83d9693d40f825f86948aa16eff6750ead4bdffc4ab95b8b3a7f052c" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ "getrandom", "libc", @@ -2825,7 +2846,7 @@ dependencies = [ "crossbeam-deque", "crossbeam-queue", "crossbeam-utils 0.6.5", - "lazy_static 1.3.0", + "lazy_static 1.4.0", "num_cpus", ] @@ -2840,18 +2861,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.1.43" +version = "0.1.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "679da7508e9a6390aeaf7fbd02a800fdc64b73fe2204dd2c8ae66d22d9d5ad5d" - -[[package]] -name = "redox_termios" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" -dependencies = [ - "redox_syscall", -] +checksum = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" [[package]] name = "redox_users" @@ -2867,25 +2879,21 @@ dependencies = [ [[package]] name = "regex" -version = "1.1.6" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f0a0bcab2fd7d1d7c54fa9eae6f43eddeb9ce2e7352f8518a814a4f65d60c58" +checksum = "b5508c1941e4e7cb19965abef075d35a9a8b5cdf0846f30b4050e9b55dc55e87" dependencies = [ "aho-corasick", "memchr", "regex-syntax", "thread_local", - "utf8-ranges", ] [[package]] name = "regex-syntax" -version = "0.6.6" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcfd8681eebe297b81d98498869d4aae052137651ad7b96822f09ceb690d0a96" -dependencies = [ - "ucd-util", -] +checksum = "e734e891f5b408a29efbf8309e656876276f49ab6a6ac208600b4419bd893d90" [[package]] name = "remote-test-client" @@ -2946,7 +2954,7 @@ dependencies = [ "cargo", "cargo_metadata 0.8.0", "clippy_lints", - "crossbeam-channel", + "crossbeam-channel 0.3.9", "difference", "env_logger 0.7.1", "futures", @@ -2954,14 +2962,14 @@ dependencies = [ "home", "itertools 0.8.0", "jsonrpc-core", - "lazy_static 1.3.0", + "lazy_static 1.4.0", "log", "lsp-codec", "lsp-types", "num_cpus", "ordslice", "racer", - "rand 0.7.0", + "rand 0.7.3", "rayon", "regex", "rls-analysis", @@ -2982,7 +2990,7 @@ dependencies = [ "tokio-process", "tokio-timer", "toml", - "url 2.1.0", + "url 2.1.1", "walkdir", ] @@ -3034,7 +3042,7 @@ dependencies = [ "failure", "futures", "log", - "rand 0.7.0", + "rand 0.7.3", "rls-data", "rls-ipc", "serde", @@ -3103,7 +3111,7 @@ dependencies = [ "rustc_target", "scoped-tls", "serialize", - "smallvec 1.0.0", + "smallvec 1.1.0", "syntax", ] @@ -3114,7 +3122,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7475f4c707269b56eb7144c53591e3cd6369a5aa1d66434829ea11df96d5e7e3" dependencies = [ "rustc-ap-rustc_data_structures", - "smallvec 0.6.10", + "smallvec 0.6.13", ] [[package]] @@ -3134,7 +3142,7 @@ dependencies = [ "ena", "indexmap", "jobserver", - "lazy_static 1.3.0", + "lazy_static 1.4.0", "log", "parking_lot", "rustc-ap-graphviz", @@ -3143,7 +3151,7 @@ dependencies = [ "rustc-hash", "rustc-rayon", "rustc-rayon-core", - "smallvec 0.6.10", + "smallvec 0.6.13", "stable_deref_trait", ] @@ -3171,7 +3179,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a395509dcb90a92c1479c085639594624e06b4ab3fc7c1b795b46a61f2d4f65" dependencies = [ "rustc-ap-serialize", - "smallvec 0.6.10", + "smallvec 0.6.13", ] [[package]] @@ -3190,10 +3198,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f99795e8be4877e9e05d59f201e1740c1cf673364655def5848606d9e25b75af" dependencies = [ "itertools 0.8.0", - "proc-macro2 1.0.3", + "proc-macro2 1.0.7", "quote 1.0.2", - "syn 1.0.11", - "synstructure 0.12.1", + "syn 1.0.13", + "synstructure", ] [[package]] @@ -3217,7 +3225,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb1cd6ef5135408d62559866e79986ca261f4c1333253d500e5e66fe66d1432e" dependencies = [ "indexmap", - "smallvec 0.6.10", + "smallvec 0.6.13", ] [[package]] @@ -3227,7 +3235,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61fc1c901d2cbd24cae95d7bc5a58aa7661ec3dc5320c78c32830a52a685c33c" dependencies = [ "bitflags", - "lazy_static 1.3.0", + "lazy_static 1.4.0", "log", "rustc-ap-rustc_data_structures", "rustc-ap-rustc_errors", @@ -3237,7 +3245,7 @@ dependencies = [ "rustc-ap-serialize", "rustc-ap-syntax_pos", "scoped-tls", - "smallvec 0.6.10", + "smallvec 0.6.13", ] [[package]] @@ -3304,7 +3312,7 @@ dependencies = [ "crossbeam-deque", "crossbeam-queue", "crossbeam-utils 0.6.5", - "lazy_static 1.3.0", + "lazy_static 1.4.0", "num_cpus", ] @@ -3334,12 +3342,14 @@ name = "rustc-workspace-hack" version = "1.0.0" dependencies = [ "crossbeam-utils 0.6.5", + "proc-macro2 0.4.30", + "quote 0.6.13", "serde", "serde_json", - "smallvec 0.6.10", - "smallvec 1.0.0", - "syn 0.15.35", - "url 2.1.0", + "smallvec 0.6.13", + "smallvec 1.1.0", + "syn 0.15.44", + "url 2.1.1", "winapi 0.3.8", ] @@ -3348,7 +3358,7 @@ name = "rustc_apfloat" version = "0.0.0" dependencies = [ "bitflags", - "smallvec 1.0.0", + "smallvec 1.1.0", ] [[package]] @@ -3365,7 +3375,7 @@ dependencies = [ "rustc_session", "rustc_span", "rustc_target", - "smallvec 1.0.0", + "smallvec 1.1.0", "syntax", ] @@ -3399,7 +3409,7 @@ dependencies = [ "rustc_session", "rustc_span", "rustc_target", - "smallvec 1.0.0", + "smallvec 1.1.0", "syntax", ] @@ -3426,7 +3436,7 @@ dependencies = [ "rustc_session", "rustc_span", "rustc_target", - "smallvec 1.0.0", + "smallvec 1.1.0", "syntax", ] @@ -3486,7 +3496,7 @@ dependencies = [ "graphviz", "indexmap", "jobserver", - "lazy_static 1.3.0", + "lazy_static 1.4.0", "log", "measureme", "parking_lot", @@ -3495,7 +3505,7 @@ dependencies = [ "rustc-rayon-core", "rustc_index", "serialize", - "smallvec 1.0.0", + "smallvec 1.1.0", "stable_deref_trait", "winapi 0.3.8", ] @@ -3505,7 +3515,7 @@ name = "rustc_driver" version = "0.0.0" dependencies = [ "env_logger 0.7.1", - "lazy_static 1.3.0", + "lazy_static 1.4.0", "log", "rustc", "rustc_codegen_utils", @@ -3562,7 +3572,7 @@ dependencies = [ "rustc_session", "rustc_span", "serialize", - "smallvec 1.0.0", + "smallvec 1.1.0", "syntax", ] @@ -3570,7 +3580,7 @@ dependencies = [ name = "rustc_feature" version = "0.0.0" dependencies = [ - "lazy_static 1.3.0", + "lazy_static 1.4.0", "rustc_data_structures", "rustc_span", ] @@ -3591,7 +3601,7 @@ dependencies = [ "rustc_span", "rustc_target", "serialize", - "smallvec 1.0.0", + "smallvec 1.1.0", "syntax", ] @@ -3601,7 +3611,7 @@ version = "0.0.0" dependencies = [ "graphviz", "log", - "rand 0.7.0", + "rand 0.7.3", "rustc", "rustc_data_structures", "rustc_fs_util", @@ -3617,7 +3627,7 @@ name = "rustc_index" version = "0.0.0" dependencies = [ "serialize", - "smallvec 1.0.0", + "smallvec 1.1.0", ] [[package]] @@ -3652,9 +3662,10 @@ dependencies = [ "rustc_span", "rustc_target", "rustc_traits", + "rustc_ty", "rustc_typeck", "serialize", - "smallvec 1.0.0", + "smallvec 1.1.0", "syntax", "tempfile", "winapi 0.3.8", @@ -3700,10 +3711,10 @@ name = "rustc_macros" version = "0.1.0" dependencies = [ "itertools 0.8.0", - "proc-macro2 1.0.3", + "proc-macro2 1.0.7", "quote 1.0.2", - "syn 1.0.11", - "synstructure 0.12.1", + "syn 1.0.13", + "synstructure", ] [[package]] @@ -3724,7 +3735,7 @@ dependencies = [ "rustc_span", "rustc_target", "serialize", - "smallvec 1.0.0", + "smallvec 1.1.0", "stable_deref_trait", "syntax", "winapi 0.3.8", @@ -3752,7 +3763,7 @@ dependencies = [ "rustc_span", "rustc_target", "serialize", - "smallvec 1.0.0", + "smallvec 1.1.0", "syntax", ] @@ -3774,7 +3785,7 @@ dependencies = [ "rustc_span", "rustc_target", "serialize", - "smallvec 1.0.0", + "smallvec 1.1.0", "syntax", ] @@ -3791,7 +3802,7 @@ dependencies = [ "rustc_lexer", "rustc_session", "rustc_span", - "smallvec 1.0.0", + "smallvec 1.1.0", "syntax", "unicode-normalization", ] @@ -3861,7 +3872,7 @@ dependencies = [ "rustc_metadata", "rustc_session", "rustc_span", - "smallvec 1.0.0", + "smallvec 1.1.0", "syntax", ] @@ -3949,10 +3960,21 @@ dependencies = [ "rustc_macros", "rustc_span", "rustc_target", - "smallvec 1.0.0", + "smallvec 1.1.0", "syntax", ] +[[package]] +name = "rustc_ty" +version = "0.0.0" +dependencies = [ + "log", + "rustc", + "rustc_data_structures", + "rustc_hir", + "rustc_span", +] + [[package]] name = "rustc_typeck" version = "0.0.0" @@ -3967,7 +3989,7 @@ dependencies = [ "rustc_index", "rustc_span", "rustc_target", - "smallvec 1.0.0", + "smallvec 1.1.0", "syntax", ] @@ -4032,10 +4054,10 @@ dependencies = [ name = "rustfmt-config_proc_macro" version = "0.2.0" dependencies = [ - "proc-macro2 1.0.3", + "proc-macro2 1.0.7", "quote 1.0.2", "serde", - "syn 1.0.11", + "syn 1.0.13", ] [[package]] @@ -4053,7 +4075,7 @@ dependencies = [ "getopts", "ignore", "itertools 0.8.0", - "lazy_static 1.3.0", + "lazy_static 1.4.0", "log", "regex", "rustc-ap-rustc_target", @@ -4073,26 +4095,26 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c92464b447c0ee8c4fb3824ecc8383b81717b9f1e74ba2e72540aef7b9f82997" +checksum = "bfa8506c1de11c9c4e4c38863ccbe02a305c8188e85a05a784c9e11e1c3910c8" [[package]] name = "same-file" -version = "1.0.4" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f20c4be53a8a1ff4c1f1b2bd14570d2f634628709752f0702ecdd2b3f9a5267" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" dependencies = [ "winapi-util", ] [[package]] name = "schannel" -version = "0.1.14" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e1a231dc10abf6749cfa5d7767f25888d484201accbd919b66ab5413c502d56" +checksum = "87f550b06b6cba9c8b8be3ee73f391990116bf527450d2556e9b9ce263b9a021" dependencies = [ - "lazy_static 1.3.0", + "lazy_static 1.4.0", "winapi 0.3.8", ] @@ -4153,38 +4175,38 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.99" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fec2851eb56d010dc9a21b89ca53ee75e6528bab60c11e89d38390904982da9f" +checksum = "414115f25f818d7dfccec8ee535d76949ae78584fc4f79a6f45a904bf8ab4449" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.81" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "477b13b646f5b5b56fc95bedfc3b550d12141ce84f466f6c44b9a17589923885" +checksum = "128f9e303a5a29922045a830221b8f78ec74a5f544944f3d5984f8ec3895ef64" dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.12", - "syn 0.15.35", + "proc-macro2 1.0.7", + "quote 1.0.2", + "syn 1.0.13", ] [[package]] name = "serde_ignored" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c24bbb8f4b81834f618cd3e28698235c2fba06ddf7f4fbe30519dd081364e59" +checksum = "7248fdcbd17d3f2604fc2a02d0ecc844d9a7bf52bf95fc196d9f0a38f6da6a0e" dependencies = [ "serde", ] [[package]] name = "serde_json" -version = "1.0.40" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "051c49229f282f7c6f3813f8286cc1e3323e8051823fce42c7ea80fe13521704" +checksum = "48c575e0cc52bdd09b47f330f646cf59afc586e9c4e3ccd6fc1f625b8ea1dad7" dependencies = [ "itoa", "ryu", @@ -4197,9 +4219,9 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd02c7587ec314570041b2754829f84d873ced14a96d1fd1823531e11db40573" dependencies = [ - "proc-macro2 1.0.3", + "proc-macro2 1.0.7", "quote 1.0.2", - "syn 1.0.11", + "syn 1.0.13", ] [[package]] @@ -4219,7 +4241,7 @@ name = "serialize" version = "0.0.0" dependencies = [ "indexmap", - "smallvec 1.0.0", + "smallvec 1.1.0", ] [[package]] @@ -4264,9 +4286,9 @@ checksum = "0df90a788073e8d0235a67e50441d47db7c8ad9debd91cbf43736a2a92d36537" [[package]] name = "sized-chunks" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62db64dd92b3b54314b1e216c274634ca2b3fe8da8b3873be670cb1ac4dad30f" +checksum = "6f59f81ec9833a580d2448e958d16bd872637798f3ab300b693c48f136fb76ff" dependencies = [ "bitmaps", "typenum", @@ -4280,21 +4302,24 @@ checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" [[package]] name = "smallvec" -version = "0.6.10" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab606a9c5e214920bb66c458cd7be8ef094f813f20fe77a54cc7dbfff220d4b7" +checksum = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6" +dependencies = [ + "maybe-uninit", +] [[package]] name = "smallvec" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ecf3b85f68e8abaa7555aa5abdb1153079387e60b718283d732f03897fcfc86" +checksum = "44e59e0c9fa00817912ae6e4e6e3c4fe04455e75699d06eedc7d85917ed8e8f4" [[package]] name = "socket2" -version = "0.3.8" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4d11a52082057d87cb5caa31ad812f4504b97ab44732cd8359df2e9ff9f48e7" +checksum = "e8b74de517221a2cb01a53349cf54182acdc31a074727d3079068448c0676d85" dependencies = [ "cfg-if", "libc", @@ -4319,15 +4344,15 @@ dependencies = [ "core", "dlmalloc", "fortanix-sgx-abi", - "hashbrown 0.6.2", + "hashbrown 0.6.3", "hermit-abi", "libc", "panic_abort", "panic_unwind", "profiler_builtins", - "rand 0.7.0", + "rand 0.7.3", "unwind", - "wasi 0.9.0+wasi-snapshot-preview1", + "wasi", ] [[package]] @@ -4345,7 +4370,7 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25d70109977172b127fe834e5449e5ab1740b9ba49fa18a2020f509174f25423" dependencies = [ - "lazy_static 1.3.0", + "lazy_static 1.4.0", "new_debug_unreachable", "phf_shared", "precomputed-hash", @@ -4363,7 +4388,7 @@ dependencies = [ "phf_generator", "phf_shared", "proc-macro2 0.4.30", - "quote 0.6.12", + "quote 0.6.13", "string_cache_shared", ] @@ -4406,9 +4431,9 @@ checksum = "2ae9e5165d463a0dea76967d021f8d0f9316057bf5163aa2a4843790e842ff37" dependencies = [ "heck", "proc-macro-error", - "proc-macro2 1.0.3", + "proc-macro2 1.0.7", "quote 1.0.2", - "syn 1.0.11", + "syn 1.0.13", ] [[package]] @@ -4425,53 +4450,41 @@ checksum = "8baacebd7b7c9b864d83a6ba7a246232983e277b86fa5cdec77f565715a4b136" dependencies = [ "heck", "proc-macro2 0.4.30", - "quote 0.6.12", - "syn 0.15.35", + "quote 0.6.13", + "syn 0.15.44", ] [[package]] name = "syn" -version = "0.15.35" +version = "0.15.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "641e117d55514d6d918490e47102f7e08d096fdde360247e4a10f7a91a8478d3" +checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" dependencies = [ "proc-macro2 0.4.30", - "quote 0.6.12", + "quote 0.6.13", "unicode-xid 0.1.0", ] [[package]] name = "syn" -version = "1.0.11" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff0acdb207ae2fe6d5976617f887eb1e35a2ba52c13c7234c790960cdad9238" +checksum = "1e4ff033220a41d1a57d8125eab57bf5263783dfdcc18688b1dacc6ce9651ef8" dependencies = [ - "proc-macro2 1.0.3", + "proc-macro2 1.0.7", "quote 1.0.2", "unicode-xid 0.2.0", ] -[[package]] -name = "synstructure" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02353edf96d6e4dc81aea2d8490a7e9db177bf8acb0e951c24940bf866cb313f" -dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.12", - "syn 0.15.35", - "unicode-xid 0.1.0", -] - [[package]] name = "synstructure" version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f085a5855930c0441ca1288cf044ea4aecf4f43a91668abdb870b4ba546a203" dependencies = [ - "proc-macro2 1.0.3", + "proc-macro2 1.0.7", "quote 1.0.2", - "syn 1.0.11", + "syn 1.0.13", "unicode-xid 0.2.0", ] @@ -4491,14 +4504,14 @@ dependencies = [ "rustc_span", "scoped-tls", "serialize", - "smallvec 1.0.0", + "smallvec 1.1.0", ] [[package]] name = "tar" -version = "0.4.20" +version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a303ba60a099fcd2aaa646b14d2724591a96a75283e4b7ed3d1a1658909d9ae2" +checksum = "b3196bfbffbba3e57481b6ea32249fbaf590396a52505a2615adbb79d9d826d3" dependencies = [ "filetime", "libc", @@ -4514,7 +4527,7 @@ checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" dependencies = [ "cfg-if", "libc", - "rand 0.7.0", + "rand 0.7.3", "redox_syscall", "remove_dir_all", "winapi 0.3.8", @@ -4563,22 +4576,11 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4096add70612622289f2fdcdbd5086dc81c1e2675e6ae58d6c4f62a16c6d7f2f" -dependencies = [ - "wincolor", -] - -[[package]] -name = "termion" -version = "1.5.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096" +checksum = "bb6bfa289a4d7c5766392812c0a1f4c1ba45afa1ad47803c11e1f407d846d75f" dependencies = [ - "libc", - "redox_syscall", - "redox_termios", + "winapi-util", ] [[package]] @@ -4617,18 +4619,18 @@ dependencies = [ [[package]] name = "thread_local" -version = "0.3.6" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" +checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" dependencies = [ - "lazy_static 1.3.0", + "lazy_static 1.4.0", ] [[package]] name = "tidy" version = "0.1.0" dependencies = [ - "lazy_static 1.3.0", + "lazy_static 1.4.0", "regex", "serde", "serde_json", @@ -4755,7 +4757,7 @@ checksum = "afbd6ef1b8cc2bd2c2b580d882774d443ebb1c6ceefe35ba9ea4ab586c89dbe8" dependencies = [ "crossbeam-queue", "futures", - "lazy_static 1.3.0", + "lazy_static 1.4.0", "libc", "log", "mio", @@ -4774,7 +4776,7 @@ checksum = "6732fe6b53c8d11178dcb77ac6d9682af27fc6d4cb87789449152e5377377146" dependencies = [ "crossbeam-utils 0.6.5", "futures", - "lazy_static 1.3.0", + "lazy_static 1.4.0", "log", "mio", "num_cpus", @@ -4845,7 +4847,7 @@ dependencies = [ "crossbeam-queue", "crossbeam-utils 0.6.5", "futures", - "lazy_static 1.3.0", + "lazy_static 1.4.0", "log", "num_cpus", "slab", @@ -4899,9 +4901,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.5.3" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7aabe75941d914b72bf3e5d3932ed92ce0664d49d8432305a8b547c37227724" +checksum = "01d1404644c8b12b16bfcffa4322403a91a451584daaaa7c28d3152e6cbc98cf" dependencies = [ "serde", ] @@ -4915,7 +4917,7 @@ dependencies = [ "failure", "failure_derive", "is-match", - "lazy_static 1.3.0", + "lazy_static 1.4.0", "regex", "toml", "toml-query_derive", @@ -4928,8 +4930,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c99ca245ec273c7e75c8ee58f47b882d0146f3c2c8495158082c6671e8b5335" dependencies = [ "darling", - "quote 0.6.12", - "syn 0.15.35", + "quote 0.6.13", + "syn 0.15.44", ] [[package]] @@ -4949,9 +4951,9 @@ dependencies = [ [[package]] name = "typenum" -version = "1.10.0" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "612d636f949607bdf9b123b4a6f6d966dedf3ff669f7f045890d3a4a73948169" +checksum = "6d2783fe2d6b8c1101136184eb41be8b1ad379e4657050b8aaff0c79ee7575f9" [[package]] name = "ucd-parse" @@ -4969,12 +4971,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71a9c5b1fe77426cf144cc30e49e955270f5086e31a6441dfa8b32efc09b9d77" -[[package]] -name = "ucd-util" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "535c204ee4d8434478593480b8f86ab45ec9aae0e83c568ca81abf0fd0e88f86" - [[package]] name = "unicase" version = "2.5.1" @@ -5006,7 +5002,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b561e267b2326bb4cebfc0ef9e68355c7abe6c6f522aeac2f5bf95d56c59bdcf" dependencies = [ - "smallvec 1.0.0", + "smallvec 1.1.0", ] [[package]] @@ -5032,9 +5028,9 @@ checksum = "e83e153d1053cbb5a118eeff7fd5be06ed99153f00dbcd8ae310c5fb2b22edc0" [[package]] name = "unicode-width" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7007dbd421b92cc6e28410fe7362e2e0a2503394908f417b68ec8d1c364c4e20" +checksum = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479" dependencies = [ "compiler_builtins", "rustc-std-workspace-core", @@ -5091,9 +5087,9 @@ dependencies = [ [[package]] name = "url" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75b414f6c464c879d7f9babf951f23bc3743fb7313c081b2e6ca719067ea9d61" +checksum = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" dependencies = [ "idna 0.2.0", "matches", @@ -5107,12 +5103,6 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1262dfab4c30d5cb7c07026be00ee343a6cf5027fdc0104a9160f354e5db75c" -[[package]] -name = "utf8-ranges" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "796f7e48bef87609f7ade7e06495a87d5cd06c7866e6a5cbfceffc558a243737" - [[package]] name = "utf8parse" version = "0.1.1" @@ -5130,9 +5120,9 @@ dependencies = [ [[package]] name = "vcpkg" -version = "0.2.6" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "def296d3eb3b12371b2c7d0e83bfe1403e4db2d7a0bba324a12b21c4ee13143d" +checksum = "3fc439f2794e98976c88a2a2dafce96b930fe8010b0a256b3c2199a773933168" [[package]] name = "vec_map" @@ -5174,9 +5164,9 @@ dependencies = [ [[package]] name = "walkdir" -version = "2.2.7" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d9d7ed3431229a144296213105a390676cc49c9b6a72bd19f3176c98e129fa1" +checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" dependencies = [ "same-file", "winapi 0.3.8", @@ -5194,12 +5184,6 @@ dependencies = [ "try-lock", ] -[[package]] -name = "wasi" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b89c3ce4ce14bdc6fb6beaf9ec7928ca331de5df7e5ea278375642a2f478570d" - [[package]] name = "wasi" version = "0.9.0+wasi-snapshot-preview1" @@ -5241,9 +5225,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7168bab6e1daee33b4557efd0e95d5ca70a03706d39fa5f3fe7a236f584b03c9" +checksum = "4ccfbf554c6ad11084fb7517daca16cfdcaccbdadba4fc336f032a8b12c2ad80" dependencies = [ "winapi 0.3.8", ] @@ -5254,16 +5238,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "wincolor" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "561ed901ae465d6185fa7864d63fbd5720d0ef718366c9a4dc83cf6170d7e9ba" -dependencies = [ - "winapi 0.3.8", - "winapi-util", -] - [[package]] name = "winreg" version = "0.6.2" diff --git a/src/doc/unstable-book/src/language-features/infer-static-outlives-requirements.md b/src/doc/unstable-book/src/language-features/infer-static-outlives-requirements.md index 6187f395b0498..53e01091f754e 100644 --- a/src/doc/unstable-book/src/language-features/infer-static-outlives-requirements.md +++ b/src/doc/unstable-book/src/language-features/infer-static-outlives-requirements.md @@ -1,8 +1,8 @@ # `infer_static_outlives_requirements` -The tracking issue for this feature is: [#44493] +The tracking issue for this feature is: [#54185] -[#44493]: https://github.com/rust-lang/rust/issues/44493 +[#54185]: https://github.com/rust-lang/rust/issues/54185 ------------------------ The `infer_static_outlives_requirements` feature indicates that certain diff --git a/src/doc/unstable-book/src/language-features/member-constraints.md b/src/doc/unstable-book/src/language-features/member-constraints.md index 0d11c31aca6e9..3ba4a3e6b1f02 100644 --- a/src/doc/unstable-book/src/language-features/member-constraints.md +++ b/src/doc/unstable-book/src/language-features/member-constraints.md @@ -1,8 +1,8 @@ # `member_constraints` -The tracking issue for this feature is: [#61977] +The tracking issue for this feature is: [#61997] -[#61977]: https://github.com/rust-lang/rust/issues/61977 +[#61997]: https://github.com/rust-lang/rust/issues/61997 ------------------------ diff --git a/src/doc/unstable-book/src/language-features/repr128.md b/src/doc/unstable-book/src/language-features/repr128.md index 0858988952c10..146f50ee67b50 100644 --- a/src/doc/unstable-book/src/language-features/repr128.md +++ b/src/doc/unstable-book/src/language-features/repr128.md @@ -1,8 +1,8 @@ # `repr128` -The tracking issue for this feature is: [#35118] +The tracking issue for this feature is: [#56071] -[#35118]: https://github.com/rust-lang/rust/issues/35118 +[#56071]: https://github.com/rust-lang/rust/issues/56071 ------------------------ diff --git a/src/librustc/ty/mod.rs b/src/librustc/ty/mod.rs index d1e37a4ea1151..e6acb6b74dc63 100644 --- a/src/librustc/ty/mod.rs +++ b/src/librustc/ty/mod.rs @@ -18,7 +18,6 @@ use crate::middle::resolve_lifetime::ObjectLifetimeDefault; use crate::mir::interpret::ErrorHandled; use crate::mir::GeneratorLayout; use crate::mir::ReadOnlyBodyAndCache; -use crate::session::CrateDisambiguator; use crate::session::DataTypeKind; use crate::traits::{self, Reveal}; use crate::ty; @@ -31,7 +30,6 @@ use rustc_data_structures::captures::Captures; use rustc_data_structures::fx::FxHashMap; use rustc_data_structures::fx::FxIndexMap; use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; -use rustc_data_structures::svh::Svh; use rustc_data_structures::sync::{self, par_iter, Lrc, ParallelIterator}; use rustc_hir as hir; use rustc_hir::def::{CtorKind, CtorOf, DefKind, Res}; @@ -2423,70 +2421,6 @@ impl<'tcx> AdtDef { pub fn sized_constraint(&self, tcx: TyCtxt<'tcx>) -> &'tcx [Ty<'tcx>] { tcx.adt_sized_constraint(self.did).0 } - - fn sized_constraint_for_ty(&self, tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> Vec> { - let result = match ty.kind { - Bool | Char | Int(..) | Uint(..) | Float(..) | RawPtr(..) | Ref(..) | FnDef(..) - | FnPtr(_) | Array(..) | Closure(..) | Generator(..) | Never => vec![], - - Str | Dynamic(..) | Slice(_) | Foreign(..) | Error | GeneratorWitness(..) => { - // these are never sized - return the target type - vec![ty] - } - - Tuple(ref tys) => match tys.last() { - None => vec![], - Some(ty) => self.sized_constraint_for_ty(tcx, ty.expect_ty()), - }, - - Adt(adt, substs) => { - // recursive case - let adt_tys = adt.sized_constraint(tcx); - debug!("sized_constraint_for_ty({:?}) intermediate = {:?}", ty, adt_tys); - adt_tys - .iter() - .map(|ty| ty.subst(tcx, substs)) - .flat_map(|ty| self.sized_constraint_for_ty(tcx, ty)) - .collect() - } - - Projection(..) | Opaque(..) => { - // must calculate explicitly. - // FIXME: consider special-casing always-Sized projections - vec![ty] - } - - UnnormalizedProjection(..) => bug!("only used with chalk-engine"), - - Param(..) => { - // perf hack: if there is a `T: Sized` bound, then - // we know that `T` is Sized and do not need to check - // it on the impl. - - let sized_trait = match tcx.lang_items().sized_trait() { - Some(x) => x, - _ => return vec![ty], - }; - let sized_predicate = Binder::dummy(TraitRef { - def_id: sized_trait, - substs: tcx.mk_substs_trait(ty, &[]), - }) - .to_predicate(); - let predicates = tcx.predicates_of(self.did).predicates; - if predicates.iter().any(|(p, _)| *p == sized_predicate) { - vec![] - } else { - vec![ty] - } - } - - Placeholder(..) | Bound(..) | Infer(..) => { - bug!("unexpected type `{:?}` in sized_constraint_for_ty", ty) - } - }; - debug!("sized_constraint_for_ty({:?}) = {:?}", ty, result); - result - } } impl<'tcx> FieldDef { @@ -2742,57 +2676,6 @@ impl<'tcx> TyCtxt<'tcx> { is_associated_item.then(|| self.associated_item(def_id)) } - fn associated_item_from_trait_item_ref( - self, - parent_def_id: DefId, - parent_vis: &hir::Visibility<'_>, - trait_item_ref: &hir::TraitItemRef, - ) -> AssocItem { - let def_id = self.hir().local_def_id(trait_item_ref.id.hir_id); - let (kind, has_self) = match trait_item_ref.kind { - hir::AssocItemKind::Const => (ty::AssocKind::Const, false), - hir::AssocItemKind::Method { has_self } => (ty::AssocKind::Method, has_self), - hir::AssocItemKind::Type => (ty::AssocKind::Type, false), - hir::AssocItemKind::OpaqueTy => bug!("only impls can have opaque types"), - }; - - AssocItem { - ident: trait_item_ref.ident, - kind, - // Visibility of trait items is inherited from their traits. - vis: Visibility::from_hir(parent_vis, trait_item_ref.id.hir_id, self), - defaultness: trait_item_ref.defaultness, - def_id, - container: TraitContainer(parent_def_id), - method_has_self_argument: has_self, - } - } - - fn associated_item_from_impl_item_ref( - self, - parent_def_id: DefId, - impl_item_ref: &hir::ImplItemRef<'_>, - ) -> AssocItem { - let def_id = self.hir().local_def_id(impl_item_ref.id.hir_id); - let (kind, has_self) = match impl_item_ref.kind { - hir::AssocItemKind::Const => (ty::AssocKind::Const, false), - hir::AssocItemKind::Method { has_self } => (ty::AssocKind::Method, has_self), - hir::AssocItemKind::Type => (ty::AssocKind::Type, false), - hir::AssocItemKind::OpaqueTy => (ty::AssocKind::OpaqueTy, false), - }; - - AssocItem { - ident: impl_item_ref.ident, - kind, - // Visibility of trait impl items doesn't matter. - vis: ty::Visibility::from_hir(&impl_item_ref.vis, impl_item_ref.id.hir_id, self), - defaultness: impl_item_ref.defaultness, - def_id, - container: ImplContainer(parent_def_id), - method_has_self_argument: has_self, - } - } - pub fn field_index(self, hir_id: hir::HirId, tables: &TypeckTables<'_>) -> usize { tables.field_indices().get(hir_id).cloned().expect("no index for a field") } @@ -3070,105 +2953,9 @@ impl Iterator for AssocItemsIterator<'_> { } } -fn associated_item(tcx: TyCtxt<'_>, def_id: DefId) -> AssocItem { - let id = tcx.hir().as_local_hir_id(def_id).unwrap(); - let parent_id = tcx.hir().get_parent_item(id); - let parent_def_id = tcx.hir().local_def_id(parent_id); - let parent_item = tcx.hir().expect_item(parent_id); - match parent_item.kind { - hir::ItemKind::Impl(.., ref impl_item_refs) => { - if let Some(impl_item_ref) = impl_item_refs.iter().find(|i| i.id.hir_id == id) { - let assoc_item = - tcx.associated_item_from_impl_item_ref(parent_def_id, impl_item_ref); - debug_assert_eq!(assoc_item.def_id, def_id); - return assoc_item; - } - } - - hir::ItemKind::Trait(.., ref trait_item_refs) => { - if let Some(trait_item_ref) = trait_item_refs.iter().find(|i| i.id.hir_id == id) { - let assoc_item = tcx.associated_item_from_trait_item_ref( - parent_def_id, - &parent_item.vis, - trait_item_ref, - ); - debug_assert_eq!(assoc_item.def_id, def_id); - return assoc_item; - } - } - - _ => {} - } - - span_bug!( - parent_item.span, - "unexpected parent of trait or impl item or item not found: {:?}", - parent_item.kind - ) -} - #[derive(Clone, HashStable)] pub struct AdtSizedConstraint<'tcx>(pub &'tcx [Ty<'tcx>]); -/// Calculates the `Sized` constraint. -/// -/// In fact, there are only a few options for the types in the constraint: -/// - an obviously-unsized type -/// - a type parameter or projection whose Sizedness can't be known -/// - a tuple of type parameters or projections, if there are multiple -/// such. -/// - a Error, if a type contained itself. The representability -/// check should catch this case. -fn adt_sized_constraint(tcx: TyCtxt<'_>, def_id: DefId) -> AdtSizedConstraint<'_> { - let def = tcx.adt_def(def_id); - - let result = tcx.mk_type_list( - def.variants - .iter() - .flat_map(|v| v.fields.last()) - .flat_map(|f| def.sized_constraint_for_ty(tcx, tcx.type_of(f.did))), - ); - - debug!("adt_sized_constraint: {:?} => {:?}", def, result); - - AdtSizedConstraint(result) -} - -fn associated_item_def_ids(tcx: TyCtxt<'_>, def_id: DefId) -> &[DefId] { - let id = tcx.hir().as_local_hir_id(def_id).unwrap(); - let item = tcx.hir().expect_item(id); - match item.kind { - hir::ItemKind::Trait(.., ref trait_item_refs) => tcx.arena.alloc_from_iter( - trait_item_refs - .iter() - .map(|trait_item_ref| trait_item_ref.id) - .map(|id| tcx.hir().local_def_id(id.hir_id)), - ), - hir::ItemKind::Impl(.., ref impl_item_refs) => tcx.arena.alloc_from_iter( - impl_item_refs - .iter() - .map(|impl_item_ref| impl_item_ref.id) - .map(|id| tcx.hir().local_def_id(id.hir_id)), - ), - hir::ItemKind::TraitAlias(..) => &[], - _ => span_bug!(item.span, "associated_item_def_ids: not impl or trait"), - } -} - -fn def_span(tcx: TyCtxt<'_>, def_id: DefId) -> Span { - tcx.hir().span_if_local(def_id).unwrap() -} - -/// If the given `DefId` describes an item belonging to a trait, -/// returns the `DefId` of the trait that the trait item belongs to; -/// otherwise, returns `None`. -fn trait_of_item(tcx: TyCtxt<'_>, def_id: DefId) -> Option { - tcx.opt_associated_item(def_id).and_then(|associated_item| match associated_item.container { - TraitContainer(def_id) => Some(def_id), - ImplContainer(_) => None, - }) -} - /// Yields the parent function's `DefId` if `def_id` is an `impl Trait` definition. pub fn is_impl_trait_defn(tcx: TyCtxt<'_>, def_id: DefId) -> Option { if let Some(hir_id) = tcx.hir().as_local_hir_id(def_id) { @@ -3181,151 +2968,12 @@ pub fn is_impl_trait_defn(tcx: TyCtxt<'_>, def_id: DefId) -> Option { None } -/// See `ParamEnv` struct definition for details. -fn param_env(tcx: TyCtxt<'_>, def_id: DefId) -> ParamEnv<'_> { - // The param_env of an impl Trait type is its defining function's param_env - if let Some(parent) = is_impl_trait_defn(tcx, def_id) { - return param_env(tcx, parent); - } - // Compute the bounds on Self and the type parameters. - - let InstantiatedPredicates { predicates } = tcx.predicates_of(def_id).instantiate_identity(tcx); - - // Finally, we have to normalize the bounds in the environment, in - // case they contain any associated type projections. This process - // can yield errors if the put in illegal associated types, like - // `::Bar` where `i32` does not implement `Foo`. We - // report these errors right here; this doesn't actually feel - // right to me, because constructing the environment feels like a - // kind of a "idempotent" action, but I'm not sure where would be - // a better place. In practice, we construct environments for - // every fn once during type checking, and we'll abort if there - // are any errors at that point, so after type checking you can be - // sure that this will succeed without errors anyway. - - let unnormalized_env = ty::ParamEnv::new( - tcx.intern_predicates(&predicates), - traits::Reveal::UserFacing, - tcx.sess.opts.debugging_opts.chalk.then_some(def_id), - ); - - let body_id = tcx.hir().as_local_hir_id(def_id).map_or(hir::DUMMY_HIR_ID, |id| { - tcx.hir().maybe_body_owned_by(id).map_or(id, |body| body.hir_id) - }); - let cause = traits::ObligationCause::misc(tcx.def_span(def_id), body_id); - traits::normalize_param_env_or_error(tcx, def_id, unnormalized_env, cause) -} - -fn crate_disambiguator(tcx: TyCtxt<'_>, crate_num: CrateNum) -> CrateDisambiguator { - assert_eq!(crate_num, LOCAL_CRATE); - tcx.sess.local_crate_disambiguator() -} - -fn original_crate_name(tcx: TyCtxt<'_>, crate_num: CrateNum) -> Symbol { - assert_eq!(crate_num, LOCAL_CRATE); - tcx.crate_name.clone() -} - -fn crate_hash(tcx: TyCtxt<'_>, crate_num: CrateNum) -> Svh { - assert_eq!(crate_num, LOCAL_CRATE); - tcx.hir().crate_hash -} - -fn instance_def_size_estimate<'tcx>(tcx: TyCtxt<'tcx>, instance_def: InstanceDef<'tcx>) -> usize { - match instance_def { - InstanceDef::Item(..) | InstanceDef::DropGlue(..) => { - let mir = tcx.instance_mir(instance_def); - mir.basic_blocks().iter().map(|bb| bb.statements.len()).sum() - } - // Estimate the size of other compiler-generated shims to be 1. - _ => 1, - } -} - -/// If `def_id` is an issue 33140 hack impl, returns its self type; otherwise, returns `None`. -/// -/// See [`ImplOverlapKind::Issue33140`] for more details. -fn issue33140_self_ty(tcx: TyCtxt<'_>, def_id: DefId) -> Option> { - debug!("issue33140_self_ty({:?})", def_id); - - let trait_ref = tcx - .impl_trait_ref(def_id) - .unwrap_or_else(|| bug!("issue33140_self_ty called on inherent impl {:?}", def_id)); - - debug!("issue33140_self_ty({:?}), trait-ref={:?}", def_id, trait_ref); - - let is_marker_like = tcx.impl_polarity(def_id) == ty::ImplPolarity::Positive - && tcx.associated_item_def_ids(trait_ref.def_id).is_empty(); - - // Check whether these impls would be ok for a marker trait. - if !is_marker_like { - debug!("issue33140_self_ty - not marker-like!"); - return None; - } - - // impl must be `impl Trait for dyn Marker1 + Marker2 + ...` - if trait_ref.substs.len() != 1 { - debug!("issue33140_self_ty - impl has substs!"); - return None; - } - - let predicates = tcx.predicates_of(def_id); - if predicates.parent.is_some() || !predicates.predicates.is_empty() { - debug!("issue33140_self_ty - impl has predicates {:?}!", predicates); - return None; - } - - let self_ty = trait_ref.self_ty(); - let self_ty_matches = match self_ty.kind { - ty::Dynamic(ref data, ty::ReStatic) => data.principal().is_none(), - _ => false, - }; - - if self_ty_matches { - debug!("issue33140_self_ty - MATCHES!"); - Some(self_ty) - } else { - debug!("issue33140_self_ty - non-matching self type"); - None - } -} - -/// Check if a function is async. -fn asyncness(tcx: TyCtxt<'_>, def_id: DefId) -> hir::IsAsync { - let hir_id = tcx - .hir() - .as_local_hir_id(def_id) - .unwrap_or_else(|| bug!("asyncness: expected local `DefId`, got `{:?}`", def_id)); - - let node = tcx.hir().get(hir_id); - - let fn_like = hir_map::blocks::FnLikeNode::from_node(node).unwrap_or_else(|| { - bug!("asyncness: expected fn-like node but got `{:?}`", def_id); - }); - - fn_like.asyncness() -} - pub fn provide(providers: &mut ty::query::Providers<'_>) { context::provide(providers); erase_regions::provide(providers); layout::provide(providers); - *providers = ty::query::Providers { - asyncness, - associated_item, - associated_item_def_ids, - adt_sized_constraint, - def_span, - param_env, - trait_of_item, - crate_disambiguator, - original_crate_name, - crate_hash, - trait_impls_of: trait_def::trait_impls_of_provider, - instance_def_size_estimate, - issue33140_self_ty, - ..*providers - }; + *providers = + ty::query::Providers { trait_impls_of: trait_def::trait_impls_of_provider, ..*providers }; } /// A map for the local crate mapping each type to a vector of its diff --git a/src/librustc_feature/active.rs b/src/librustc_feature/active.rs index 319cd88f24586..4c8c47a567113 100644 --- a/src/librustc_feature/active.rs +++ b/src/librustc_feature/active.rs @@ -333,7 +333,7 @@ declare_features! ( (active, abi_ptx, "1.15.0", Some(38788), None), /// Allows the `#[repr(i128)]` attribute for enums. - (active, repr128, "1.16.0", Some(35118), None), + (active, repr128, "1.16.0", Some(56071), None), /// Allows `#[link(kind="static-nobundle"...)]`. (active, static_nobundle, "1.16.0", Some(37403), None), @@ -481,7 +481,7 @@ declare_features! ( (active, arbitrary_enum_discriminant, "1.37.0", Some(60553), None), /// Allows `impl Trait` with multiple unrelated lifetimes. - (active, member_constraints, "1.37.0", Some(61977), None), + (active, member_constraints, "1.37.0", Some(61997), None), /// Allows `async || body` closures. (active, async_closure, "1.37.0", Some(62290), None), diff --git a/src/librustc_interface/Cargo.toml b/src/librustc_interface/Cargo.toml index 7baae90beabb5..1fe5248dbf4ce 100644 --- a/src/librustc_interface/Cargo.toml +++ b/src/librustc_interface/Cargo.toml @@ -40,6 +40,7 @@ rustc_errors = { path = "../librustc_errors" } rustc_plugin_impl = { path = "../librustc_plugin_impl" } rustc_privacy = { path = "../librustc_privacy" } rustc_resolve = { path = "../librustc_resolve" } +rustc_ty = { path = "../librustc_ty" } tempfile = "3.0.5" once_cell = "1" diff --git a/src/librustc_interface/passes.rs b/src/librustc_interface/passes.rs index 5f0d9ed5bdf0d..c4444fbaa2fc7 100644 --- a/src/librustc_interface/passes.rs +++ b/src/librustc_interface/passes.rs @@ -680,6 +680,7 @@ pub fn default_provide(providers: &mut ty::query::Providers<'_>) { rustc_passes::provide(providers); rustc_resolve::provide(providers); rustc_traits::provide(providers); + rustc_ty::provide(providers); rustc_metadata::provide(providers); rustc_lint::provide(providers); rustc_codegen_utils::provide(providers); diff --git a/src/librustc_resolve/diagnostics.rs b/src/librustc_resolve/diagnostics.rs index 9742067975499..a433ae8ed676a 100644 --- a/src/librustc_resolve/diagnostics.rs +++ b/src/librustc_resolve/diagnostics.rs @@ -8,7 +8,7 @@ use rustc_data_structures::fx::FxHashSet; use rustc_errors::{struct_span_err, Applicability, DiagnosticBuilder}; use rustc_feature::BUILTIN_ATTRIBUTES; use rustc_hir::def::Namespace::{self, *}; -use rustc_hir::def::{self, DefKind, NonMacroAttrKind}; +use rustc_hir::def::{self, CtorKind, CtorOf, DefKind, NonMacroAttrKind}; use rustc_hir::def_id::{DefId, CRATE_DEF_INDEX, LOCAL_CRATE}; use rustc_span::hygiene::MacroKind; use rustc_span::source_map::SourceMap; @@ -20,8 +20,9 @@ use syntax::util::lev_distance::find_best_match_for_name; use crate::imports::{ImportDirective, ImportDirectiveSubclass, ImportResolver}; use crate::path_names_to_string; -use crate::VisResolutionError; +use crate::{AmbiguityError, AmbiguityErrorMisc, AmbiguityKind}; use crate::{BindingError, CrateLint, HasGenericParams, LegacyScope, Module, ModuleOrUniformRoot}; +use crate::{NameBinding, NameBindingKind, PrivacyError, VisResolutionError}; use crate::{ParentScope, PathResult, ResolutionError, Resolver, Scope, ScopeSet, Segment}; use rustc_error_codes::*; @@ -802,6 +803,163 @@ impl<'a> Resolver<'a> { } false } + + fn binding_description(&self, b: &NameBinding<'_>, ident: Ident, from_prelude: bool) -> String { + let res = b.res(); + if b.span.is_dummy() { + let add_built_in = match b.res() { + // These already contain the "built-in" prefix or look bad with it. + Res::NonMacroAttr(..) | Res::PrimTy(..) | Res::ToolMod => false, + _ => true, + }; + let (built_in, from) = if from_prelude { + ("", " from prelude") + } else if b.is_extern_crate() + && !b.is_import() + && self.session.opts.externs.get(&ident.as_str()).is_some() + { + ("", " passed with `--extern`") + } else if add_built_in { + (" built-in", "") + } else { + ("", "") + }; + + let article = if built_in.is_empty() { res.article() } else { "a" }; + format!( + "{a}{built_in} {thing}{from}", + a = article, + thing = res.descr(), + built_in = built_in, + from = from + ) + } else { + let introduced = if b.is_import() { "imported" } else { "defined" }; + format!("the {thing} {introduced} here", thing = res.descr(), introduced = introduced) + } + } + + crate fn report_ambiguity_error(&self, ambiguity_error: &AmbiguityError<'_>) { + let AmbiguityError { kind, ident, b1, b2, misc1, misc2 } = *ambiguity_error; + let (b1, b2, misc1, misc2, swapped) = if b2.span.is_dummy() && !b1.span.is_dummy() { + // We have to print the span-less alternative first, otherwise formatting looks bad. + (b2, b1, misc2, misc1, true) + } else { + (b1, b2, misc1, misc2, false) + }; + + let mut err = struct_span_err!( + self.session, + ident.span, + E0659, + "`{ident}` is ambiguous ({why})", + ident = ident, + why = kind.descr() + ); + err.span_label(ident.span, "ambiguous name"); + + let mut could_refer_to = |b: &NameBinding<'_>, misc: AmbiguityErrorMisc, also: &str| { + let what = self.binding_description(b, ident, misc == AmbiguityErrorMisc::FromPrelude); + let note_msg = format!( + "`{ident}` could{also} refer to {what}", + ident = ident, + also = also, + what = what + ); + + let thing = b.res().descr(); + let mut help_msgs = Vec::new(); + if b.is_glob_import() + && (kind == AmbiguityKind::GlobVsGlob + || kind == AmbiguityKind::GlobVsExpanded + || kind == AmbiguityKind::GlobVsOuter && swapped != also.is_empty()) + { + help_msgs.push(format!( + "consider adding an explicit import of \ + `{ident}` to disambiguate", + ident = ident + )) + } + if b.is_extern_crate() && ident.span.rust_2018() { + help_msgs.push(format!( + "use `::{ident}` to refer to this {thing} unambiguously", + ident = ident, + thing = thing, + )) + } + if misc == AmbiguityErrorMisc::SuggestCrate { + help_msgs.push(format!( + "use `crate::{ident}` to refer to this {thing} unambiguously", + ident = ident, + thing = thing, + )) + } else if misc == AmbiguityErrorMisc::SuggestSelf { + help_msgs.push(format!( + "use `self::{ident}` to refer to this {thing} unambiguously", + ident = ident, + thing = thing, + )) + } + + err.span_note(b.span, ¬e_msg); + for (i, help_msg) in help_msgs.iter().enumerate() { + let or = if i == 0 { "" } else { "or " }; + err.help(&format!("{}{}", or, help_msg)); + } + }; + + could_refer_to(b1, misc1, ""); + could_refer_to(b2, misc2, " also"); + err.emit(); + } + + crate fn report_privacy_error(&self, privacy_error: &PrivacyError<'_>) { + let PrivacyError { ident, binding, .. } = *privacy_error; + let session = &self.session; + let mk_struct_span_error = |is_constructor| { + let mut descr = binding.res().descr().to_string(); + if is_constructor { + descr += " constructor"; + } + if binding.is_import() { + descr += " import"; + } + + let mut err = + struct_span_err!(session, ident.span, E0603, "{} `{}` is private", descr, ident); + + err.span_label(ident.span, &format!("this {} is private", descr)); + err.span_note( + session.source_map().def_span(binding.span), + &format!("the {} `{}` is defined here", descr, ident), + ); + + err + }; + + let mut err = if let NameBindingKind::Res( + Res::Def(DefKind::Ctor(CtorOf::Struct, CtorKind::Fn), ctor_def_id), + _, + ) = binding.kind + { + let def_id = (&*self).parent(ctor_def_id).expect("no parent for a constructor"); + if let Some(fields) = self.field_names.get(&def_id) { + let mut err = mk_struct_span_error(true); + let first_field = fields.first().expect("empty field list in the map"); + err.span_label( + fields.iter().fold(first_field.span, |acc, field| acc.to(field.span)), + "a constructor is private if any of the fields is private", + ); + err + } else { + mk_struct_span_error(false) + } + } else { + mk_struct_span_error(false) + }; + + err.emit(); + } } impl<'a, 'b> ImportResolver<'a, 'b> { diff --git a/src/librustc_resolve/imports.rs b/src/librustc_resolve/imports.rs index 5bd10303162b2..9f459834175c1 100644 --- a/src/librustc_resolve/imports.rs +++ b/src/librustc_resolve/imports.rs @@ -319,7 +319,11 @@ impl<'a> Resolver<'a> { // Remove this together with `PUB_USE_OF_PRIVATE_EXTERN_CRATE` !(self.last_import_segment && binding.is_extern_crate()) { - self.privacy_errors.push(PrivacyError(path_span, ident, binding)); + self.privacy_errors.push(PrivacyError { + ident, + binding, + dedup_span: path_span, + }); } Ok(binding) diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index 8e4630cf7d696..c9fda90808d67 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -2,12 +2,9 @@ //! //! Module structure of the crate is built here. //! Paths in macros, imports, expressions, types, patterns are resolved here. -//! Label names are resolved here as well. +//! Label and lifetime names are resolved here as well. //! //! Type-relative name resolution (methods, fields, associated items) happens in `librustc_typeck`. -//! Lifetime names are resolved in `librustc/middle/resolve_lifetime.rs`. - -// ignore-tidy-filelength #![doc(html_root_url = "https://doc.rust-lang.org/nightly/")] #![feature(bool_to_option)] @@ -33,7 +30,7 @@ use rustc_data_structures::sync::Lrc; use rustc_errors::{struct_span_err, Applicability, DiagnosticBuilder}; use rustc_expand::base::SyntaxExtension; use rustc_hir::def::Namespace::*; -use rustc_hir::def::{self, CtorKind, CtorOf, DefKind, NonMacroAttrKind, PartialRes}; +use rustc_hir::def::{self, CtorOf, DefKind, NonMacroAttrKind, PartialRes}; use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, CRATE_DEF_INDEX, LOCAL_CRATE}; use rustc_hir::PrimTy::{self, Bool, Char, Float, Int, Str, Uint}; use rustc_hir::{GlobMap, TraitMap}; @@ -604,7 +601,11 @@ impl<'a> NameBindingKind<'a> { } } -struct PrivacyError<'a>(Span, Ident, &'a NameBinding<'a>); +struct PrivacyError<'a> { + ident: Ident, + binding: &'a NameBinding<'a>, + dedup_span: Span, +} struct UseError<'a> { err: DiagnosticBuilder<'a>, @@ -2446,115 +2447,6 @@ impl<'a> Resolver<'a> { } } - fn binding_description(&self, b: &NameBinding<'_>, ident: Ident, from_prelude: bool) -> String { - let res = b.res(); - if b.span.is_dummy() { - let add_built_in = match b.res() { - // These already contain the "built-in" prefix or look bad with it. - Res::NonMacroAttr(..) | Res::PrimTy(..) | Res::ToolMod => false, - _ => true, - }; - let (built_in, from) = if from_prelude { - ("", " from prelude") - } else if b.is_extern_crate() - && !b.is_import() - && self.session.opts.externs.get(&ident.as_str()).is_some() - { - ("", " passed with `--extern`") - } else if add_built_in { - (" built-in", "") - } else { - ("", "") - }; - - let article = if built_in.is_empty() { res.article() } else { "a" }; - format!( - "{a}{built_in} {thing}{from}", - a = article, - thing = res.descr(), - built_in = built_in, - from = from - ) - } else { - let introduced = if b.is_import() { "imported" } else { "defined" }; - format!("the {thing} {introduced} here", thing = res.descr(), introduced = introduced) - } - } - - fn report_ambiguity_error(&self, ambiguity_error: &AmbiguityError<'_>) { - let AmbiguityError { kind, ident, b1, b2, misc1, misc2 } = *ambiguity_error; - let (b1, b2, misc1, misc2, swapped) = if b2.span.is_dummy() && !b1.span.is_dummy() { - // We have to print the span-less alternative first, otherwise formatting looks bad. - (b2, b1, misc2, misc1, true) - } else { - (b1, b2, misc1, misc2, false) - }; - - let mut err = struct_span_err!( - self.session, - ident.span, - E0659, - "`{ident}` is ambiguous ({why})", - ident = ident, - why = kind.descr() - ); - err.span_label(ident.span, "ambiguous name"); - - let mut could_refer_to = |b: &NameBinding<'_>, misc: AmbiguityErrorMisc, also: &str| { - let what = self.binding_description(b, ident, misc == AmbiguityErrorMisc::FromPrelude); - let note_msg = format!( - "`{ident}` could{also} refer to {what}", - ident = ident, - also = also, - what = what - ); - - let thing = b.res().descr(); - let mut help_msgs = Vec::new(); - if b.is_glob_import() - && (kind == AmbiguityKind::GlobVsGlob - || kind == AmbiguityKind::GlobVsExpanded - || kind == AmbiguityKind::GlobVsOuter && swapped != also.is_empty()) - { - help_msgs.push(format!( - "consider adding an explicit import of \ - `{ident}` to disambiguate", - ident = ident - )) - } - if b.is_extern_crate() && ident.span.rust_2018() { - help_msgs.push(format!( - "use `::{ident}` to refer to this {thing} unambiguously", - ident = ident, - thing = thing, - )) - } - if misc == AmbiguityErrorMisc::SuggestCrate { - help_msgs.push(format!( - "use `crate::{ident}` to refer to this {thing} unambiguously", - ident = ident, - thing = thing, - )) - } else if misc == AmbiguityErrorMisc::SuggestSelf { - help_msgs.push(format!( - "use `self::{ident}` to refer to this {thing} unambiguously", - ident = ident, - thing = thing, - )) - } - - err.span_note(b.span, ¬e_msg); - for (i, help_msg) in help_msgs.iter().enumerate() { - let or = if i == 0 { "" } else { "or " }; - err.help(&format!("{}{}", or, help_msg)); - } - }; - - could_refer_to(b1, misc1, ""); - could_refer_to(b2, misc2, " also"); - err.emit(); - } - fn report_errors(&mut self, krate: &Crate) { self.report_with_use_injections(krate); @@ -2575,43 +2467,9 @@ impl<'a> Resolver<'a> { } let mut reported_spans = FxHashSet::default(); - for &PrivacyError(dedup_span, ident, binding) in &self.privacy_errors { - if reported_spans.insert(dedup_span) { - let session = &self.session; - let mk_struct_span_error = |is_constructor| { - struct_span_err!( - session, - ident.span, - E0603, - "{}{} `{}` is private", - binding.res().descr(), - if is_constructor { " constructor" } else { "" }, - ident.name, - ) - }; - - let mut err = if let NameBindingKind::Res( - Res::Def(DefKind::Ctor(CtorOf::Struct, CtorKind::Fn), ctor_def_id), - _, - ) = binding.kind - { - let def_id = (&*self).parent(ctor_def_id).expect("no parent for a constructor"); - if let Some(fields) = self.field_names.get(&def_id) { - let mut err = mk_struct_span_error(true); - let first_field = fields.first().expect("empty field list in the map"); - err.span_label( - fields.iter().fold(first_field.span, |acc, field| acc.to(field.span)), - "a constructor is private if any of the fields is private", - ); - err - } else { - mk_struct_span_error(false) - } - } else { - mk_struct_span_error(false) - }; - - err.emit(); + for error in &self.privacy_errors { + if reported_spans.insert(error.dedup_span) { + self.report_privacy_error(error); } } } diff --git a/src/librustc_ty/Cargo.toml b/src/librustc_ty/Cargo.toml new file mode 100644 index 0000000000000..fb0d93fe5ebb6 --- /dev/null +++ b/src/librustc_ty/Cargo.toml @@ -0,0 +1,16 @@ +[package] +authors = ["The Rust Project Developers"] +name = "rustc_ty" +version = "0.0.0" +edition = "2018" + +[lib] +name = "rustc_ty" +path = "lib.rs" + +[dependencies] +log = "0.4" +rustc = { path = "../librustc" } +rustc_data_structures = { path = "../librustc_data_structures" } +rustc_hir = { path = "../librustc_hir" } +rustc_span = { path = "../librustc_span" } diff --git a/src/librustc_ty/lib.rs b/src/librustc_ty/lib.rs new file mode 100644 index 0000000000000..2548d2cff9766 --- /dev/null +++ b/src/librustc_ty/lib.rs @@ -0,0 +1,25 @@ +//! Various checks +//! +//! # Note +//! +//! This API is completely unstable and subject to change. + +#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")] +#![feature(bool_to_option)] +#![feature(in_band_lifetimes)] +#![feature(nll)] +#![feature(slice_patterns)] +#![recursion_limit = "256"] + +#[macro_use] +extern crate rustc; +#[macro_use] +extern crate log; + +use rustc::ty::query::Providers; + +mod ty; + +pub fn provide(providers: &mut Providers<'_>) { + ty::provide(providers); +} diff --git a/src/librustc_ty/ty.rs b/src/librustc_ty/ty.rs new file mode 100644 index 0000000000000..fc8beb67e4ada --- /dev/null +++ b/src/librustc_ty/ty.rs @@ -0,0 +1,369 @@ +use rustc::hir::map as hir_map; +use rustc::session::CrateDisambiguator; +use rustc::traits::{self}; +use rustc::ty::subst::Subst; +use rustc::ty::{self, ToPredicate, Ty, TyCtxt}; +use rustc_data_structures::svh::Svh; +use rustc_hir as hir; +use rustc_hir::def_id::{CrateNum, DefId, LOCAL_CRATE}; +use rustc_span::symbol::Symbol; +use rustc_span::Span; + +fn sized_constraint_for_ty(tcx: TyCtxt<'tcx>, adtdef: &ty::AdtDef, ty: Ty<'tcx>) -> Vec> { + use ty::TyKind::*; + + let result = match ty.kind { + Bool | Char | Int(..) | Uint(..) | Float(..) | RawPtr(..) | Ref(..) | FnDef(..) + | FnPtr(_) | Array(..) | Closure(..) | Generator(..) | Never => vec![], + + Str | Dynamic(..) | Slice(_) | Foreign(..) | Error | GeneratorWitness(..) => { + // these are never sized - return the target type + vec![ty] + } + + Tuple(ref tys) => match tys.last() { + None => vec![], + Some(ty) => sized_constraint_for_ty(tcx, adtdef, ty.expect_ty()), + }, + + Adt(adt, substs) => { + // recursive case + let adt_tys = adt.sized_constraint(tcx); + debug!("sized_constraint_for_ty({:?}) intermediate = {:?}", ty, adt_tys); + adt_tys + .iter() + .map(|ty| ty.subst(tcx, substs)) + .flat_map(|ty| sized_constraint_for_ty(tcx, adtdef, ty)) + .collect() + } + + Projection(..) | Opaque(..) => { + // must calculate explicitly. + // FIXME: consider special-casing always-Sized projections + vec![ty] + } + + UnnormalizedProjection(..) => bug!("only used with chalk-engine"), + + Param(..) => { + // perf hack: if there is a `T: Sized` bound, then + // we know that `T` is Sized and do not need to check + // it on the impl. + + let sized_trait = match tcx.lang_items().sized_trait() { + Some(x) => x, + _ => return vec![ty], + }; + let sized_predicate = ty::Binder::dummy(ty::TraitRef { + def_id: sized_trait, + substs: tcx.mk_substs_trait(ty, &[]), + }) + .to_predicate(); + let predicates = tcx.predicates_of(adtdef.did).predicates; + if predicates.iter().any(|(p, _)| *p == sized_predicate) { vec![] } else { vec![ty] } + } + + Placeholder(..) | Bound(..) | Infer(..) => { + bug!("unexpected type `{:?}` in sized_constraint_for_ty", ty) + } + }; + debug!("sized_constraint_for_ty({:?}) = {:?}", ty, result); + result +} + +fn associated_item_from_trait_item_ref( + tcx: TyCtxt<'_>, + parent_def_id: DefId, + parent_vis: &hir::Visibility<'_>, + trait_item_ref: &hir::TraitItemRef, +) -> ty::AssocItem { + let def_id = tcx.hir().local_def_id(trait_item_ref.id.hir_id); + let (kind, has_self) = match trait_item_ref.kind { + hir::AssocItemKind::Const => (ty::AssocKind::Const, false), + hir::AssocItemKind::Method { has_self } => (ty::AssocKind::Method, has_self), + hir::AssocItemKind::Type => (ty::AssocKind::Type, false), + hir::AssocItemKind::OpaqueTy => bug!("only impls can have opaque types"), + }; + + ty::AssocItem { + ident: trait_item_ref.ident, + kind, + // Visibility of trait items is inherited from their traits. + vis: ty::Visibility::from_hir(parent_vis, trait_item_ref.id.hir_id, tcx), + defaultness: trait_item_ref.defaultness, + def_id, + container: ty::TraitContainer(parent_def_id), + method_has_self_argument: has_self, + } +} + +fn associated_item_from_impl_item_ref( + tcx: TyCtxt<'_>, + parent_def_id: DefId, + impl_item_ref: &hir::ImplItemRef<'_>, +) -> ty::AssocItem { + let def_id = tcx.hir().local_def_id(impl_item_ref.id.hir_id); + let (kind, has_self) = match impl_item_ref.kind { + hir::AssocItemKind::Const => (ty::AssocKind::Const, false), + hir::AssocItemKind::Method { has_self } => (ty::AssocKind::Method, has_self), + hir::AssocItemKind::Type => (ty::AssocKind::Type, false), + hir::AssocItemKind::OpaqueTy => (ty::AssocKind::OpaqueTy, false), + }; + + ty::AssocItem { + ident: impl_item_ref.ident, + kind, + // Visibility of trait impl items doesn't matter. + vis: ty::Visibility::from_hir(&impl_item_ref.vis, impl_item_ref.id.hir_id, tcx), + defaultness: impl_item_ref.defaultness, + def_id, + container: ty::ImplContainer(parent_def_id), + method_has_self_argument: has_self, + } +} + +fn associated_item(tcx: TyCtxt<'_>, def_id: DefId) -> ty::AssocItem { + let id = tcx.hir().as_local_hir_id(def_id).unwrap(); + let parent_id = tcx.hir().get_parent_item(id); + let parent_def_id = tcx.hir().local_def_id(parent_id); + let parent_item = tcx.hir().expect_item(parent_id); + match parent_item.kind { + hir::ItemKind::Impl(.., ref impl_item_refs) => { + if let Some(impl_item_ref) = impl_item_refs.iter().find(|i| i.id.hir_id == id) { + let assoc_item = + associated_item_from_impl_item_ref(tcx, parent_def_id, impl_item_ref); + debug_assert_eq!(assoc_item.def_id, def_id); + return assoc_item; + } + } + + hir::ItemKind::Trait(.., ref trait_item_refs) => { + if let Some(trait_item_ref) = trait_item_refs.iter().find(|i| i.id.hir_id == id) { + let assoc_item = associated_item_from_trait_item_ref( + tcx, + parent_def_id, + &parent_item.vis, + trait_item_ref, + ); + debug_assert_eq!(assoc_item.def_id, def_id); + return assoc_item; + } + } + + _ => {} + } + + span_bug!( + parent_item.span, + "unexpected parent of trait or impl item or item not found: {:?}", + parent_item.kind + ) +} + +/// Calculates the `Sized` constraint. +/// +/// In fact, there are only a few options for the types in the constraint: +/// - an obviously-unsized type +/// - a type parameter or projection whose Sizedness can't be known +/// - a tuple of type parameters or projections, if there are multiple +/// such. +/// - a Error, if a type contained itself. The representability +/// check should catch this case. +fn adt_sized_constraint(tcx: TyCtxt<'_>, def_id: DefId) -> ty::AdtSizedConstraint<'_> { + let def = tcx.adt_def(def_id); + + let result = tcx.mk_type_list( + def.variants + .iter() + .flat_map(|v| v.fields.last()) + .flat_map(|f| sized_constraint_for_ty(tcx, def, tcx.type_of(f.did))), + ); + + debug!("adt_sized_constraint: {:?} => {:?}", def, result); + + ty::AdtSizedConstraint(result) +} + +fn associated_item_def_ids(tcx: TyCtxt<'_>, def_id: DefId) -> &[DefId] { + let id = tcx.hir().as_local_hir_id(def_id).unwrap(); + let item = tcx.hir().expect_item(id); + match item.kind { + hir::ItemKind::Trait(.., ref trait_item_refs) => tcx.arena.alloc_from_iter( + trait_item_refs + .iter() + .map(|trait_item_ref| trait_item_ref.id) + .map(|id| tcx.hir().local_def_id(id.hir_id)), + ), + hir::ItemKind::Impl(.., ref impl_item_refs) => tcx.arena.alloc_from_iter( + impl_item_refs + .iter() + .map(|impl_item_ref| impl_item_ref.id) + .map(|id| tcx.hir().local_def_id(id.hir_id)), + ), + hir::ItemKind::TraitAlias(..) => &[], + _ => span_bug!(item.span, "associated_item_def_ids: not impl or trait"), + } +} + +fn def_span(tcx: TyCtxt<'_>, def_id: DefId) -> Span { + tcx.hir().span_if_local(def_id).unwrap() +} + +/// If the given `DefId` describes an item belonging to a trait, +/// returns the `DefId` of the trait that the trait item belongs to; +/// otherwise, returns `None`. +fn trait_of_item(tcx: TyCtxt<'_>, def_id: DefId) -> Option { + tcx.opt_associated_item(def_id).and_then(|associated_item| match associated_item.container { + ty::TraitContainer(def_id) => Some(def_id), + ty::ImplContainer(_) => None, + }) +} + +/// See `ParamEnv` struct definition for details. +fn param_env(tcx: TyCtxt<'_>, def_id: DefId) -> ty::ParamEnv<'_> { + // The param_env of an impl Trait type is its defining function's param_env + if let Some(parent) = ty::is_impl_trait_defn(tcx, def_id) { + return param_env(tcx, parent); + } + // Compute the bounds on Self and the type parameters. + + let ty::InstantiatedPredicates { predicates } = + tcx.predicates_of(def_id).instantiate_identity(tcx); + + // Finally, we have to normalize the bounds in the environment, in + // case they contain any associated type projections. This process + // can yield errors if the put in illegal associated types, like + // `::Bar` where `i32` does not implement `Foo`. We + // report these errors right here; this doesn't actually feel + // right to me, because constructing the environment feels like a + // kind of a "idempotent" action, but I'm not sure where would be + // a better place. In practice, we construct environments for + // every fn once during type checking, and we'll abort if there + // are any errors at that point, so after type checking you can be + // sure that this will succeed without errors anyway. + + let unnormalized_env = ty::ParamEnv::new( + tcx.intern_predicates(&predicates), + traits::Reveal::UserFacing, + tcx.sess.opts.debugging_opts.chalk.then_some(def_id), + ); + + let body_id = tcx.hir().as_local_hir_id(def_id).map_or(hir::DUMMY_HIR_ID, |id| { + tcx.hir().maybe_body_owned_by(id).map_or(id, |body| body.hir_id) + }); + let cause = traits::ObligationCause::misc(tcx.def_span(def_id), body_id); + traits::normalize_param_env_or_error(tcx, def_id, unnormalized_env, cause) +} + +fn crate_disambiguator(tcx: TyCtxt<'_>, crate_num: CrateNum) -> CrateDisambiguator { + assert_eq!(crate_num, LOCAL_CRATE); + tcx.sess.local_crate_disambiguator() +} + +fn original_crate_name(tcx: TyCtxt<'_>, crate_num: CrateNum) -> Symbol { + assert_eq!(crate_num, LOCAL_CRATE); + tcx.crate_name.clone() +} + +fn crate_hash(tcx: TyCtxt<'_>, crate_num: CrateNum) -> Svh { + assert_eq!(crate_num, LOCAL_CRATE); + tcx.hir().crate_hash +} + +fn instance_def_size_estimate<'tcx>( + tcx: TyCtxt<'tcx>, + instance_def: ty::InstanceDef<'tcx>, +) -> usize { + use ty::InstanceDef; + + match instance_def { + InstanceDef::Item(..) | InstanceDef::DropGlue(..) => { + let mir = tcx.instance_mir(instance_def); + mir.basic_blocks().iter().map(|bb| bb.statements.len()).sum() + } + // Estimate the size of other compiler-generated shims to be 1. + _ => 1, + } +} + +/// If `def_id` is an issue 33140 hack impl, returns its self type; otherwise, returns `None`. +/// +/// See [`ImplOverlapKind::Issue33140`] for more details. +fn issue33140_self_ty(tcx: TyCtxt<'_>, def_id: DefId) -> Option> { + debug!("issue33140_self_ty({:?})", def_id); + + let trait_ref = tcx + .impl_trait_ref(def_id) + .unwrap_or_else(|| bug!("issue33140_self_ty called on inherent impl {:?}", def_id)); + + debug!("issue33140_self_ty({:?}), trait-ref={:?}", def_id, trait_ref); + + let is_marker_like = tcx.impl_polarity(def_id) == ty::ImplPolarity::Positive + && tcx.associated_item_def_ids(trait_ref.def_id).is_empty(); + + // Check whether these impls would be ok for a marker trait. + if !is_marker_like { + debug!("issue33140_self_ty - not marker-like!"); + return None; + } + + // impl must be `impl Trait for dyn Marker1 + Marker2 + ...` + if trait_ref.substs.len() != 1 { + debug!("issue33140_self_ty - impl has substs!"); + return None; + } + + let predicates = tcx.predicates_of(def_id); + if predicates.parent.is_some() || !predicates.predicates.is_empty() { + debug!("issue33140_self_ty - impl has predicates {:?}!", predicates); + return None; + } + + let self_ty = trait_ref.self_ty(); + let self_ty_matches = match self_ty.kind { + ty::Dynamic(ref data, ty::ReStatic) => data.principal().is_none(), + _ => false, + }; + + if self_ty_matches { + debug!("issue33140_self_ty - MATCHES!"); + Some(self_ty) + } else { + debug!("issue33140_self_ty - non-matching self type"); + None + } +} + +/// Check if a function is async. +fn asyncness(tcx: TyCtxt<'_>, def_id: DefId) -> hir::IsAsync { + let hir_id = tcx + .hir() + .as_local_hir_id(def_id) + .unwrap_or_else(|| bug!("asyncness: expected local `DefId`, got `{:?}`", def_id)); + + let node = tcx.hir().get(hir_id); + + let fn_like = hir_map::blocks::FnLikeNode::from_node(node).unwrap_or_else(|| { + bug!("asyncness: expected fn-like node but got `{:?}`", def_id); + }); + + fn_like.asyncness() +} + +pub fn provide(providers: &mut ty::query::Providers<'_>) { + *providers = ty::query::Providers { + asyncness, + associated_item, + associated_item_def_ids, + adt_sized_constraint, + def_span, + param_env, + trait_of_item, + crate_disambiguator, + original_crate_name, + crate_hash, + instance_def_size_estimate, + issue33140_self_ty, + ..*providers + }; +} diff --git a/src/libstd/f32.rs b/src/libstd/f32.rs index 267d7013b1e42..c57bce95073ee 100644 --- a/src/libstd/f32.rs +++ b/src/libstd/f32.rs @@ -131,10 +131,10 @@ impl f32 { /// ``` /// use std::f32; /// - /// let x = 3.5_f32; - /// let y = -3.5_f32; - /// let abs_difference_x = (x.fract() - 0.5).abs(); - /// let abs_difference_y = (y.fract() - (-0.5)).abs(); + /// let x = 3.6_f32; + /// let y = -3.6_f32; + /// let abs_difference_x = (x.fract() - 0.6).abs(); + /// let abs_difference_y = (y.fract() - (-0.6)).abs(); /// /// assert!(abs_difference_x <= f32::EPSILON); /// assert!(abs_difference_y <= f32::EPSILON); @@ -355,7 +355,7 @@ impl f32 { return unsafe { intrinsics::powf32(self, n) }; } - /// Takes the square root of a number. + /// Returns the square root of a number. /// /// Returns NaN if `self` is a negative number. /// @@ -564,7 +564,7 @@ impl f32 { unsafe { cmath::fdimf(self, other) } } - /// Takes the cubic root of a number. + /// Returns the cubic root of a number. /// /// # Examples /// diff --git a/src/libstd/f64.rs b/src/libstd/f64.rs index 61ce7b29e26fc..d89b38e1a0035 100644 --- a/src/libstd/f64.rs +++ b/src/libstd/f64.rs @@ -109,10 +109,10 @@ impl f64 { /// # Examples /// /// ``` - /// let x = 3.5_f64; - /// let y = -3.5_f64; - /// let abs_difference_x = (x.fract() - 0.5).abs(); - /// let abs_difference_y = (y.fract() - (-0.5)).abs(); + /// let x = 3.6_f64; + /// let y = -3.6_f64; + /// let abs_difference_x = (x.fract() - 0.6).abs(); + /// let abs_difference_y = (y.fract() - (-0.6)).abs(); /// /// assert!(abs_difference_x < 1e-10); /// assert!(abs_difference_y < 1e-10); @@ -323,7 +323,7 @@ impl f64 { unsafe { intrinsics::powf64(self, n) } } - /// Takes the square root of a number. + /// Returns the square root of a number. /// /// Returns NaN if `self` is a negative number. /// @@ -506,7 +506,7 @@ impl f64 { unsafe { cmath::fdim(self, other) } } - /// Takes the cubic root of a number. + /// Returns the cubic root of a number. /// /// # Examples /// diff --git a/src/test/ui/error-codes/E0603.stderr b/src/test/ui/error-codes/E0603.stderr index 444005e086f1b..724d04954a3c7 100644 --- a/src/test/ui/error-codes/E0603.stderr +++ b/src/test/ui/error-codes/E0603.stderr @@ -2,7 +2,13 @@ error[E0603]: constant `PRIVATE` is private --> $DIR/E0603.rs:6:17 | LL | SomeModule::PRIVATE; - | ^^^^^^^ + | ^^^^^^^ this constant is private + | +note: the constant `PRIVATE` is defined here + --> $DIR/E0603.rs:2:5 + | +LL | const PRIVATE: u32 = 0x_a_bad_1dea_u32; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/error-codes/E0658.stderr b/src/test/ui/error-codes/E0658.stderr index 071dbccd80ba0..1cb81c8d778ec 100644 --- a/src/test/ui/error-codes/E0658.stderr +++ b/src/test/ui/error-codes/E0658.stderr @@ -6,7 +6,7 @@ LL | | Bar(u64), LL | | } | |_^ | - = note: for more information, see https://github.com/rust-lang/rust/issues/35118 + = note: for more information, see https://github.com/rust-lang/rust/issues/56071 = help: add `#![feature(repr128)]` to the crate attributes to enable error: aborting due to previous error diff --git a/src/test/ui/error-festival.stderr b/src/test/ui/error-festival.stderr index 6b80d99b3afe9..9b69b3733642b 100644 --- a/src/test/ui/error-festival.stderr +++ b/src/test/ui/error-festival.stderr @@ -8,7 +8,13 @@ error[E0603]: constant `FOO` is private --> $DIR/error-festival.rs:22:10 | LL | foo::FOO; - | ^^^ + | ^^^ this constant is private + | +note: the constant `FOO` is defined here + --> $DIR/error-festival.rs:7:5 + | +LL | const FOO: u32 = 0; + | ^^^^^^^^^^^^^^^^^^^ error[E0368]: binary assignment operation `+=` cannot be applied to type `&str` --> $DIR/error-festival.rs:12:5 diff --git a/src/test/ui/export-import.stderr b/src/test/ui/export-import.stderr index e02952e0fe092..8160775ab589e 100644 --- a/src/test/ui/export-import.stderr +++ b/src/test/ui/export-import.stderr @@ -2,7 +2,13 @@ error[E0603]: function `unexported` is private --> $DIR/export-import.rs:1:8 | LL | use m::unexported; - | ^^^^^^^^^^ + | ^^^^^^^^^^ this function is private + | +note: the function `unexported` is defined here + --> $DIR/export-import.rs:7:5 + | +LL | fn unexported() { } + | ^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/export-tag-variant.stderr b/src/test/ui/export-tag-variant.stderr index b5a2c12c436d0..f4537a2fb6fae 100644 --- a/src/test/ui/export-tag-variant.stderr +++ b/src/test/ui/export-tag-variant.stderr @@ -2,7 +2,13 @@ error[E0603]: enum `Y` is private --> $DIR/export-tag-variant.rs:7:26 | LL | fn main() { let z = foo::Y::Y1; } - | ^ + | ^ this enum is private + | +note: the enum `Y` is defined here + --> $DIR/export-tag-variant.rs:4:5 + | +LL | enum Y { Y1 } + | ^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/export.stderr b/src/test/ui/export.stderr index a3668a502cdd4..107f531c09a3a 100644 --- a/src/test/ui/export.stderr +++ b/src/test/ui/export.stderr @@ -26,7 +26,13 @@ error[E0603]: function `z` is private --> $DIR/export.rs:10:18 | LL | fn main() { foo::z(10); } - | ^ + | ^ this function is private + | +note: the function `z` is defined here + --> $DIR/export.rs:5:5 + | +LL | fn z(y: isize) { log(debug, y); } + | ^^^^^^^^^^^^^^ error: aborting due to 5 previous errors diff --git a/src/test/ui/extern/extern-crate-visibility.rs b/src/test/ui/extern/extern-crate-visibility.rs index e0a5cd5e98f4b..cda1227cc8e92 100644 --- a/src/test/ui/extern/extern-crate-visibility.rs +++ b/src/test/ui/extern/extern-crate-visibility.rs @@ -3,10 +3,10 @@ mod foo { } // Check that private crates can be used from outside their modules, albeit with warnings -use foo::core::cell; //~ ERROR crate `core` is private +use foo::core::cell; //~ ERROR crate import `core` is private fn f() { - foo::core::cell::Cell::new(0); //~ ERROR crate `core` is private + foo::core::cell::Cell::new(0); //~ ERROR crate import `core` is private use foo::*; mod core {} // Check that private crates are not glob imported diff --git a/src/test/ui/extern/extern-crate-visibility.stderr b/src/test/ui/extern/extern-crate-visibility.stderr index 38c791ab83237..d0c073d67a4ee 100644 --- a/src/test/ui/extern/extern-crate-visibility.stderr +++ b/src/test/ui/extern/extern-crate-visibility.stderr @@ -1,14 +1,26 @@ -error[E0603]: crate `core` is private +error[E0603]: crate import `core` is private --> $DIR/extern-crate-visibility.rs:6:10 | LL | use foo::core::cell; - | ^^^^ + | ^^^^ this crate import is private + | +note: the crate import `core` is defined here + --> $DIR/extern-crate-visibility.rs:2:5 + | +LL | extern crate core; + | ^^^^^^^^^^^^^^^^^^ -error[E0603]: crate `core` is private +error[E0603]: crate import `core` is private --> $DIR/extern-crate-visibility.rs:9:10 | LL | foo::core::cell::Cell::new(0); - | ^^^^ + | ^^^^ this crate import is private + | +note: the crate import `core` is defined here + --> $DIR/extern-crate-visibility.rs:2:5 + | +LL | extern crate core; + | ^^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/feature-gates/feature-gate-repr128.stderr b/src/test/ui/feature-gates/feature-gate-repr128.stderr index 2139a5da600df..e108d74e9c6cc 100644 --- a/src/test/ui/feature-gates/feature-gate-repr128.stderr +++ b/src/test/ui/feature-gates/feature-gate-repr128.stderr @@ -6,7 +6,7 @@ LL | | A(u64) LL | | } | |_^ | - = note: for more information, see https://github.com/rust-lang/rust/issues/35118 + = note: for more information, see https://github.com/rust-lang/rust/issues/56071 = help: add `#![feature(repr128)]` to the crate attributes to enable error: aborting due to previous error diff --git a/src/test/ui/hygiene/privacy.stderr b/src/test/ui/hygiene/privacy.stderr index 80fb4dd0f314a..0649dc0ec5836 100644 --- a/src/test/ui/hygiene/privacy.stderr +++ b/src/test/ui/hygiene/privacy.stderr @@ -2,7 +2,13 @@ error[E0603]: function `f` is private --> $DIR/privacy.rs:16:14 | LL | foo::f() - | ^ + | ^ this function is private + | +note: the function `f` is defined here + --> $DIR/privacy.rs:4:5 + | +LL | fn f() {} + | ^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/import.stderr b/src/test/ui/import.stderr index 6b320b198a0b1..5219ffacd15c0 100644 --- a/src/test/ui/import.stderr +++ b/src/test/ui/import.stderr @@ -13,11 +13,17 @@ error[E0432]: unresolved import `foo` LL | use foo; | ^^^ no `foo` in the root -error[E0603]: unresolved item `foo` is private +error[E0603]: unresolved item import `foo` is private --> $DIR/import.rs:15:10 | LL | zed::foo(); - | ^^^ + | ^^^ this unresolved item import is private + | +note: the unresolved item import `foo` is defined here + --> $DIR/import.rs:10:9 + | +LL | use foo; + | ^^^ error: aborting due to 3 previous errors diff --git a/src/test/ui/imports/issue-55884-2.rs b/src/test/ui/imports/issue-55884-2.rs index 1b4f652c9fc2f..75bb4206f97d6 100644 --- a/src/test/ui/imports/issue-55884-2.rs +++ b/src/test/ui/imports/issue-55884-2.rs @@ -9,6 +9,6 @@ mod parser { use ParseOptions; } -pub use parser::ParseOptions; //~ ERROR struct `ParseOptions` is private +pub use parser::ParseOptions; //~ ERROR struct import `ParseOptions` is private fn main() {} diff --git a/src/test/ui/imports/issue-55884-2.stderr b/src/test/ui/imports/issue-55884-2.stderr index d3b43783ee9c8..f16d2adb3656e 100644 --- a/src/test/ui/imports/issue-55884-2.stderr +++ b/src/test/ui/imports/issue-55884-2.stderr @@ -1,8 +1,14 @@ -error[E0603]: struct `ParseOptions` is private +error[E0603]: struct import `ParseOptions` is private --> $DIR/issue-55884-2.rs:12:17 | LL | pub use parser::ParseOptions; - | ^^^^^^^^^^^^ + | ^^^^^^^^^^^^ this struct import is private + | +note: the struct import `ParseOptions` is defined here + --> $DIR/issue-55884-2.rs:9:9 + | +LL | use ParseOptions; + | ^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/imports/reexports.stderr b/src/test/ui/imports/reexports.stderr index 4388e2c276b8e..b173884080f80 100644 --- a/src/test/ui/imports/reexports.stderr +++ b/src/test/ui/imports/reexports.stderr @@ -10,17 +10,29 @@ note: consider marking `foo` as `pub` in the imported module LL | pub use super::foo; | ^^^^^^^^^^ -error[E0603]: module `foo` is private +error[E0603]: module import `foo` is private --> $DIR/reexports.rs:33:15 | LL | use b::a::foo::S; - | ^^^ + | ^^^ this module import is private + | +note: the module import `foo` is defined here + --> $DIR/reexports.rs:21:17 + | +LL | pub use super::foo; // This is OK since the value `foo` is visible enough. + | ^^^^^^^^^^ -error[E0603]: module `foo` is private +error[E0603]: module import `foo` is private --> $DIR/reexports.rs:34:15 | LL | use b::b::foo::S as T; - | ^^^ + | ^^^ this module import is private + | +note: the module import `foo` is defined here + --> $DIR/reexports.rs:26:17 + | +LL | pub use super::*; // This is also OK since the value `foo` is visible enough. + | ^^^^^^^^ warning: glob import doesn't reexport anything because no candidate is public enough --> $DIR/reexports.rs:9:17 diff --git a/src/test/ui/imports/unresolved-imports-used.stderr b/src/test/ui/imports/unresolved-imports-used.stderr index b341e8e059288..d7280d2583a76 100644 --- a/src/test/ui/imports/unresolved-imports-used.stderr +++ b/src/test/ui/imports/unresolved-imports-used.stderr @@ -38,7 +38,13 @@ error[E0603]: function `quz` is private --> $DIR/unresolved-imports-used.rs:9:10 | LL | use qux::quz; - | ^^^ + | ^^^ this function is private + | +note: the function `quz` is defined here + --> $DIR/unresolved-imports-used.rs:5:4 + | +LL | fn quz() {} + | ^^^^^^^^ error: unused import: `qux::quy` --> $DIR/unresolved-imports-used.rs:16:5 diff --git a/src/test/ui/issues/issue-10545.stderr b/src/test/ui/issues/issue-10545.stderr index 59d4fedcd2b40..4ed7028c0a06b 100644 --- a/src/test/ui/issues/issue-10545.stderr +++ b/src/test/ui/issues/issue-10545.stderr @@ -2,7 +2,13 @@ error[E0603]: struct `S` is private --> $DIR/issue-10545.rs:6:14 | LL | fn foo(_: a::S) { - | ^ + | ^ this struct is private + | +note: the struct `S` is defined here + --> $DIR/issue-10545.rs:2:5 + | +LL | struct S; + | ^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/issues/issue-11593.stderr b/src/test/ui/issues/issue-11593.stderr index c3e4412b042d7..bfb4d31323b13 100644 --- a/src/test/ui/issues/issue-11593.stderr +++ b/src/test/ui/issues/issue-11593.stderr @@ -2,7 +2,13 @@ error[E0603]: trait `Foo` is private --> $DIR/issue-11593.rs:7:24 | LL | impl private_trait_xc::Foo for Bar {} - | ^^^ + | ^^^ this trait is private + | +note: the trait `Foo` is defined here + --> $DIR/auxiliary/private-trait-xc.rs:1:1 + | +LL | trait Foo {} + | ^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/issues/issue-11680.stderr b/src/test/ui/issues/issue-11680.stderr index 35cb2476992ac..898ac10f7d9a9 100644 --- a/src/test/ui/issues/issue-11680.stderr +++ b/src/test/ui/issues/issue-11680.stderr @@ -2,13 +2,25 @@ error[E0603]: enum `Foo` is private --> $DIR/issue-11680.rs:6:21 | LL | let _b = other::Foo::Bar(1); - | ^^^ + | ^^^ this enum is private + | +note: the enum `Foo` is defined here + --> $DIR/auxiliary/issue-11680.rs:1:1 + | +LL | enum Foo { + | ^^^^^^^^ error[E0603]: enum `Foo` is private --> $DIR/issue-11680.rs:9:27 | LL | let _b = other::test::Foo::Bar(1); - | ^^^ + | ^^^ this enum is private + | +note: the enum `Foo` is defined here + --> $DIR/auxiliary/issue-11680.rs:6:5 + | +LL | enum Foo { + | ^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-13407.stderr b/src/test/ui/issues/issue-13407.stderr index b280de3158fed..f211d623ab12b 100644 --- a/src/test/ui/issues/issue-13407.stderr +++ b/src/test/ui/issues/issue-13407.stderr @@ -2,7 +2,13 @@ error[E0603]: unit struct `C` is private --> $DIR/issue-13407.rs:6:8 | LL | A::C = 1; - | ^ + | ^ this unit struct is private + | +note: the unit struct `C` is defined here + --> $DIR/issue-13407.rs:2:5 + | +LL | struct C; + | ^^^^^^^^^ error[E0308]: mismatched types --> $DIR/issue-13407.rs:6:12 diff --git a/src/test/ui/issues/issue-13641.stderr b/src/test/ui/issues/issue-13641.stderr index 8e5001e3b694d..f90cb18b6fc9d 100644 --- a/src/test/ui/issues/issue-13641.stderr +++ b/src/test/ui/issues/issue-13641.stderr @@ -2,13 +2,25 @@ error[E0603]: struct `Foo` is private --> $DIR/issue-13641.rs:9:8 | LL | a::Foo::new(); - | ^^^ + | ^^^ this struct is private + | +note: the struct `Foo` is defined here + --> $DIR/issue-13641.rs:2:5 + | +LL | struct Foo; + | ^^^^^^^^^^^ error[E0603]: enum `Bar` is private --> $DIR/issue-13641.rs:11:8 | LL | a::Bar::new(); - | ^^^ + | ^^^ this enum is private + | +note: the enum `Bar` is defined here + --> $DIR/issue-13641.rs:4:5 + | +LL | enum Bar {} + | ^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-16725.stderr b/src/test/ui/issues/issue-16725.stderr index 562ad940423c2..e0a1ca8a5ac31 100644 --- a/src/test/ui/issues/issue-16725.stderr +++ b/src/test/ui/issues/issue-16725.stderr @@ -2,7 +2,13 @@ error[E0603]: function `bar` is private --> $DIR/issue-16725.rs:6:19 | LL | unsafe { foo::bar(); } - | ^^^ + | ^^^ this function is private + | +note: the function `bar` is defined here + --> $DIR/auxiliary/issue-16725.rs:2:5 + | +LL | fn bar(); + | ^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/issues/issue-17718-const-privacy.stderr b/src/test/ui/issues/issue-17718-const-privacy.stderr index 0b0de8a52590b..07d825ba9cb3b 100644 --- a/src/test/ui/issues/issue-17718-const-privacy.stderr +++ b/src/test/ui/issues/issue-17718-const-privacy.stderr @@ -2,13 +2,25 @@ error[E0603]: constant `B` is private --> $DIR/issue-17718-const-privacy.rs:5:8 | LL | use a::B; - | ^ + | ^ this constant is private + | +note: the constant `B` is defined here + --> $DIR/issue-17718-const-privacy.rs:13:5 + | +LL | const B: usize = 3; + | ^^^^^^^^^^^^^^^^^^^ error[E0603]: constant `BAR` is private --> $DIR/issue-17718-const-privacy.rs:8:5 | LL | BAR, - | ^^^ + | ^^^ this constant is private + | +note: the constant `BAR` is defined here + --> $DIR/auxiliary/issue-17718-const-privacy.rs:4:1 + | +LL | const BAR: usize = 3; + | ^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-28388-2.stderr b/src/test/ui/issues/issue-28388-2.stderr index 7bbe0bc5ff154..58bd775f295fc 100644 --- a/src/test/ui/issues/issue-28388-2.stderr +++ b/src/test/ui/issues/issue-28388-2.stderr @@ -2,7 +2,13 @@ error[E0603]: module `n` is private --> $DIR/issue-28388-2.rs:7:8 | LL | use m::n::{}; - | ^ + | ^ this module is private + | +note: the module `n` is defined here + --> $DIR/issue-28388-2.rs:4:5 + | +LL | mod n {} + | ^^^^^ error: aborting due to previous error diff --git a/src/test/ui/issues/issue-29161.stderr b/src/test/ui/issues/issue-29161.stderr index d30fd28a4a351..1bfa211ef7962 100644 --- a/src/test/ui/issues/issue-29161.stderr +++ b/src/test/ui/issues/issue-29161.stderr @@ -8,7 +8,13 @@ error[E0603]: struct `A` is private --> $DIR/issue-29161.rs:13:8 | LL | a::A::default(); - | ^ + | ^ this struct is private + | +note: the struct `A` is defined here + --> $DIR/issue-29161.rs:2:5 + | +LL | struct A; + | ^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-38857.stderr b/src/test/ui/issues/issue-38857.stderr index 5762e3d6ac00a..dd7970e014fdb 100644 --- a/src/test/ui/issues/issue-38857.stderr +++ b/src/test/ui/issues/issue-38857.stderr @@ -8,7 +8,13 @@ error[E0603]: module `sys` is private --> $DIR/issue-38857.rs:2:18 | LL | let a = std::sys::imp::process::process_common::StdioPipes { ..panic!() }; - | ^^^ + | ^^^ this module is private + | +note: the module `sys` is defined here + --> $SRC_DIR/libstd/lib.rs:LL:COL + | +LL | mod sys; + | ^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-3993.stderr b/src/test/ui/issues/issue-3993.stderr index ce594a3f9bb27..3fa8ed4af28fa 100644 --- a/src/test/ui/issues/issue-3993.stderr +++ b/src/test/ui/issues/issue-3993.stderr @@ -2,7 +2,13 @@ error[E0603]: function `fly` is private --> $DIR/issue-3993.rs:1:10 | LL | use zoo::fly; - | ^^^ + | ^^^ this function is private + | +note: the function `fly` is defined here + --> $DIR/issue-3993.rs:4:5 + | +LL | fn fly() {} + | ^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/macros/macro-local-data-key-priv.stderr b/src/test/ui/macros/macro-local-data-key-priv.stderr index 9b44421808e88..72994d1652cd0 100644 --- a/src/test/ui/macros/macro-local-data-key-priv.stderr +++ b/src/test/ui/macros/macro-local-data-key-priv.stderr @@ -2,7 +2,14 @@ error[E0603]: constant `baz` is private --> $DIR/macro-local-data-key-priv.rs:8:10 | LL | bar::baz.with(|_| ()); - | ^^^ + | ^^^ this constant is private + | +note: the constant `baz` is defined here + --> $DIR/macro-local-data-key-priv.rs:4:5 + | +LL | thread_local!(static baz: f64 = 0.0); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/parser/macro/pub-item-macro.stderr b/src/test/ui/parser/macro/pub-item-macro.stderr index fa25161ab50b2..ae981ac4cbee3 100644 --- a/src/test/ui/parser/macro/pub-item-macro.stderr +++ b/src/test/ui/parser/macro/pub-item-macro.stderr @@ -13,7 +13,16 @@ error[E0603]: static `x` is private --> $DIR/pub-item-macro.rs:17:23 | LL | let y: u32 = foo::x; - | ^ + | ^ this static is private + | +note: the static `x` is defined here + --> $DIR/pub-item-macro.rs:4:5 + | +LL | static x: u32 = 0; + | ^^^^^^^^^^^^^^^^^^ +... +LL | pub_x!(); + | --------- in this macro invocation error: aborting due to 2 previous errors diff --git a/src/test/ui/privacy/decl-macro.stderr b/src/test/ui/privacy/decl-macro.stderr index 230cf95de6206..ae2e1b4b644a3 100644 --- a/src/test/ui/privacy/decl-macro.stderr +++ b/src/test/ui/privacy/decl-macro.stderr @@ -2,7 +2,13 @@ error[E0603]: macro `mac` is private --> $DIR/decl-macro.rs:8:8 | LL | m::mac!(); - | ^^^ + | ^^^ this macro is private + | +note: the macro `mac` is defined here + --> $DIR/decl-macro.rs:4:5 + | +LL | macro mac() {} + | ^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/privacy/privacy-in-paths.stderr b/src/test/ui/privacy/privacy-in-paths.stderr index 4b9faca045709..8860d8f15f748 100644 --- a/src/test/ui/privacy/privacy-in-paths.stderr +++ b/src/test/ui/privacy/privacy-in-paths.stderr @@ -2,19 +2,37 @@ error[E0603]: module `bar` is private --> $DIR/privacy-in-paths.rs:24:16 | LL | ::foo::bar::baz::f(); - | ^^^ + | ^^^ this module is private + | +note: the module `bar` is defined here + --> $DIR/privacy-in-paths.rs:3:5 + | +LL | mod bar { + | ^^^^^^^ error[E0603]: module `bar` is private --> $DIR/privacy-in-paths.rs:25:16 | LL | ::foo::bar::S::f(); - | ^^^ + | ^^^ this module is private + | +note: the module `bar` is defined here + --> $DIR/privacy-in-paths.rs:3:5 + | +LL | mod bar { + | ^^^^^^^ error[E0603]: trait `T` is private --> $DIR/privacy-in-paths.rs:26:23 | LL | <() as ::foo::T>::Assoc::f(); - | ^ + | ^ this trait is private + | +note: the trait `T` is defined here + --> $DIR/privacy-in-paths.rs:8:5 + | +LL | trait T { + | ^^^^^^^ error: aborting due to 3 previous errors diff --git a/src/test/ui/privacy/privacy-ns2.stderr b/src/test/ui/privacy/privacy-ns2.stderr index 2871573130a60..8b12109b37307 100644 --- a/src/test/ui/privacy/privacy-ns2.stderr +++ b/src/test/ui/privacy/privacy-ns2.stderr @@ -58,19 +58,37 @@ error[E0603]: trait `Bar` is private --> $DIR/privacy-ns2.rs:63:15 | LL | use foo3::Bar; - | ^^^ + | ^^^ this trait is private + | +note: the trait `Bar` is defined here + --> $DIR/privacy-ns2.rs:55:5 + | +LL | trait Bar { + | ^^^^^^^^^ error[E0603]: trait `Bar` is private --> $DIR/privacy-ns2.rs:67:15 | LL | use foo3::Bar; - | ^^^ + | ^^^ this trait is private + | +note: the trait `Bar` is defined here + --> $DIR/privacy-ns2.rs:55:5 + | +LL | trait Bar { + | ^^^^^^^^^ error[E0603]: trait `Bar` is private --> $DIR/privacy-ns2.rs:74:16 | LL | use foo3::{Bar,Baz}; - | ^^^ + | ^^^ this trait is private + | +note: the trait `Bar` is defined here + --> $DIR/privacy-ns2.rs:55:5 + | +LL | trait Bar { + | ^^^^^^^^^ error[E0107]: wrong number of const arguments: expected 0, found 1 --> $DIR/privacy-ns2.rs:41:18 diff --git a/src/test/ui/privacy/privacy-ufcs.stderr b/src/test/ui/privacy/privacy-ufcs.stderr index 6be14df89d20a..08640b802a244 100644 --- a/src/test/ui/privacy/privacy-ufcs.stderr +++ b/src/test/ui/privacy/privacy-ufcs.stderr @@ -2,7 +2,13 @@ error[E0603]: trait `Bar` is private --> $DIR/privacy-ufcs.rs:12:20 | LL | ::baz(); - | ^^^ + | ^^^ this trait is private + | +note: the trait `Bar` is defined here + --> $DIR/privacy-ufcs.rs:4:5 + | +LL | trait Bar { + | ^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/privacy/privacy1.stderr b/src/test/ui/privacy/privacy1.stderr index 29f53cd0e3545..215df0dc75441 100644 --- a/src/test/ui/privacy/privacy1.stderr +++ b/src/test/ui/privacy/privacy1.stderr @@ -2,79 +2,157 @@ error[E0603]: module `baz` is private --> $DIR/privacy1.rs:132:18 | LL | use bar::baz::{foo, bar}; - | ^^^ + | ^^^ this module is private + | +note: the module `baz` is defined here + --> $DIR/privacy1.rs:50:5 + | +LL | mod baz { + | ^^^^^^^ error[E0603]: module `baz` is private --> $DIR/privacy1.rs:132:18 | LL | use bar::baz::{foo, bar}; - | ^^^ + | ^^^ this module is private + | +note: the module `baz` is defined here + --> $DIR/privacy1.rs:50:5 + | +LL | mod baz { + | ^^^^^^^ error[E0603]: module `baz` is private --> $DIR/privacy1.rs:141:18 | LL | use bar::baz; - | ^^^ + | ^^^ this module is private + | +note: the module `baz` is defined here + --> $DIR/privacy1.rs:50:5 + | +LL | mod baz { + | ^^^^^^^ error[E0603]: module `i` is private --> $DIR/privacy1.rs:165:20 | LL | use self::foo::i::A; - | ^ + | ^ this module is private + | +note: the module `i` is defined here + --> $DIR/privacy1.rs:170:9 + | +LL | mod i { + | ^^^^^ error[E0603]: module `baz` is private --> $DIR/privacy1.rs:104:16 | LL | ::bar::baz::A::foo(); - | ^^^ + | ^^^ this module is private + | +note: the module `baz` is defined here + --> $DIR/privacy1.rs:50:5 + | +LL | mod baz { + | ^^^^^^^ error[E0603]: module `baz` is private --> $DIR/privacy1.rs:105:16 | LL | ::bar::baz::A::bar(); - | ^^^ + | ^^^ this module is private + | +note: the module `baz` is defined here + --> $DIR/privacy1.rs:50:5 + | +LL | mod baz { + | ^^^^^^^ error[E0603]: module `baz` is private --> $DIR/privacy1.rs:107:16 | LL | ::bar::baz::A.foo2(); - | ^^^ + | ^^^ this module is private + | +note: the module `baz` is defined here + --> $DIR/privacy1.rs:50:5 + | +LL | mod baz { + | ^^^^^^^ error[E0603]: module `baz` is private --> $DIR/privacy1.rs:108:16 | LL | ::bar::baz::A.bar2(); - | ^^^ + | ^^^ this module is private + | +note: the module `baz` is defined here + --> $DIR/privacy1.rs:50:5 + | +LL | mod baz { + | ^^^^^^^ error[E0603]: trait `B` is private --> $DIR/privacy1.rs:112:16 | LL | ::bar::B::foo(); - | ^ + | ^ this trait is private + | +note: the trait `B` is defined here + --> $DIR/privacy1.rs:40:5 + | +LL | trait B { + | ^^^^^^^ error[E0603]: function `epriv` is private --> $DIR/privacy1.rs:118:20 | LL | ::bar::epriv(); - | ^^^^^ + | ^^^^^ this function is private + | +note: the function `epriv` is defined here + --> $DIR/privacy1.rs:65:9 + | +LL | fn epriv(); + | ^^^^^^^^^^^ error[E0603]: module `baz` is private --> $DIR/privacy1.rs:127:16 | LL | ::bar::baz::foo(); - | ^^^ + | ^^^ this module is private + | +note: the module `baz` is defined here + --> $DIR/privacy1.rs:50:5 + | +LL | mod baz { + | ^^^^^^^ error[E0603]: module `baz` is private --> $DIR/privacy1.rs:128:16 | LL | ::bar::baz::bar(); - | ^^^ + | ^^^ this module is private + | +note: the module `baz` is defined here + --> $DIR/privacy1.rs:50:5 + | +LL | mod baz { + | ^^^^^^^ error[E0603]: trait `B` is private --> $DIR/privacy1.rs:157:17 | LL | impl ::bar::B for f32 { fn foo() -> f32 { 1.0 } } - | ^ + | ^ this trait is private + | +note: the trait `B` is defined here + --> $DIR/privacy1.rs:40:5 + | +LL | trait B { + | ^^^^^^^ error[E0624]: method `bar` is private --> $DIR/privacy1.rs:77:9 diff --git a/src/test/ui/privacy/privacy2.stderr b/src/test/ui/privacy/privacy2.stderr index 9f2359657bd7c..719dc27ccf4d6 100644 --- a/src/test/ui/privacy/privacy2.stderr +++ b/src/test/ui/privacy/privacy2.stderr @@ -4,11 +4,17 @@ error[E0432]: unresolved import `bar::foo` LL | use bar::foo; | ^^^^^^^^ no `foo` in `bar` -error[E0603]: function `foo` is private +error[E0603]: function import `foo` is private --> $DIR/privacy2.rs:23:20 | LL | use bar::glob::foo; - | ^^^ + | ^^^ this function import is private + | +note: the function import `foo` is defined here + --> $DIR/privacy2.rs:10:13 + | +LL | use foo; + | ^^^ error: requires `sized` lang_item diff --git a/src/test/ui/privacy/privacy4.stderr b/src/test/ui/privacy/privacy4.stderr index e4a20f920a062..e34b2d5049b9e 100644 --- a/src/test/ui/privacy/privacy4.stderr +++ b/src/test/ui/privacy/privacy4.stderr @@ -2,7 +2,13 @@ error[E0603]: module `glob` is private --> $DIR/privacy4.rs:21:14 | LL | use bar::glob::gpriv; - | ^^^^ + | ^^^^ this module is private + | +note: the module `glob` is defined here + --> $DIR/privacy4.rs:13:5 + | +LL | mod glob { + | ^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/privacy/privacy5.stderr b/src/test/ui/privacy/privacy5.stderr index 2ee83149b695f..197a857cc3dc4 100644 --- a/src/test/ui/privacy/privacy5.stderr +++ b/src/test/ui/privacy/privacy5.stderr @@ -5,7 +5,13 @@ LL | pub struct A(()); | -- a constructor is private if any of the fields is private ... LL | let a = a::A(()); - | ^ + | ^ this tuple struct constructor is private + | +note: the tuple struct constructor `A` is defined here + --> $DIR/privacy5.rs:6:5 + | +LL | pub struct A(()); + | ^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `B` is private --> $DIR/privacy5.rs:52:16 @@ -14,7 +20,13 @@ LL | pub struct B(isize); | ----- a constructor is private if any of the fields is private ... LL | let b = a::B(2); - | ^ + | ^ this tuple struct constructor is private + | +note: the tuple struct constructor `B` is defined here + --> $DIR/privacy5.rs:7:5 + | +LL | pub struct B(isize); + | ^^^^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:53:16 @@ -23,7 +35,13 @@ LL | pub struct C(pub isize, isize); | ---------------- a constructor is private if any of the fields is private ... LL | let c = a::C(2, 3); - | ^ + | ^ this tuple struct constructor is private + | +note: the tuple struct constructor `C` is defined here + --> $DIR/privacy5.rs:8:5 + | +LL | pub struct C(pub isize, isize); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `A` is private --> $DIR/privacy5.rs:56:12 @@ -32,7 +50,13 @@ LL | pub struct A(()); | -- a constructor is private if any of the fields is private ... LL | let a::A(()) = a; - | ^ + | ^ this tuple struct constructor is private + | +note: the tuple struct constructor `A` is defined here + --> $DIR/privacy5.rs:6:5 + | +LL | pub struct A(()); + | ^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `A` is private --> $DIR/privacy5.rs:57:12 @@ -41,7 +65,13 @@ LL | pub struct A(()); | -- a constructor is private if any of the fields is private ... LL | let a::A(_) = a; - | ^ + | ^ this tuple struct constructor is private + | +note: the tuple struct constructor `A` is defined here + --> $DIR/privacy5.rs:6:5 + | +LL | pub struct A(()); + | ^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `A` is private --> $DIR/privacy5.rs:58:18 @@ -50,7 +80,13 @@ LL | pub struct A(()); | -- a constructor is private if any of the fields is private ... LL | match a { a::A(()) => {} } - | ^ + | ^ this tuple struct constructor is private + | +note: the tuple struct constructor `A` is defined here + --> $DIR/privacy5.rs:6:5 + | +LL | pub struct A(()); + | ^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `A` is private --> $DIR/privacy5.rs:59:18 @@ -59,7 +95,13 @@ LL | pub struct A(()); | -- a constructor is private if any of the fields is private ... LL | match a { a::A(_) => {} } - | ^ + | ^ this tuple struct constructor is private + | +note: the tuple struct constructor `A` is defined here + --> $DIR/privacy5.rs:6:5 + | +LL | pub struct A(()); + | ^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `B` is private --> $DIR/privacy5.rs:61:12 @@ -68,7 +110,13 @@ LL | pub struct B(isize); | ----- a constructor is private if any of the fields is private ... LL | let a::B(_) = b; - | ^ + | ^ this tuple struct constructor is private + | +note: the tuple struct constructor `B` is defined here + --> $DIR/privacy5.rs:7:5 + | +LL | pub struct B(isize); + | ^^^^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `B` is private --> $DIR/privacy5.rs:62:12 @@ -77,7 +125,13 @@ LL | pub struct B(isize); | ----- a constructor is private if any of the fields is private ... LL | let a::B(_b) = b; - | ^ + | ^ this tuple struct constructor is private + | +note: the tuple struct constructor `B` is defined here + --> $DIR/privacy5.rs:7:5 + | +LL | pub struct B(isize); + | ^^^^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `B` is private --> $DIR/privacy5.rs:63:18 @@ -86,7 +140,13 @@ LL | pub struct B(isize); | ----- a constructor is private if any of the fields is private ... LL | match b { a::B(_) => {} } - | ^ + | ^ this tuple struct constructor is private + | +note: the tuple struct constructor `B` is defined here + --> $DIR/privacy5.rs:7:5 + | +LL | pub struct B(isize); + | ^^^^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `B` is private --> $DIR/privacy5.rs:64:18 @@ -95,7 +155,13 @@ LL | pub struct B(isize); | ----- a constructor is private if any of the fields is private ... LL | match b { a::B(_b) => {} } - | ^ + | ^ this tuple struct constructor is private + | +note: the tuple struct constructor `B` is defined here + --> $DIR/privacy5.rs:7:5 + | +LL | pub struct B(isize); + | ^^^^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `B` is private --> $DIR/privacy5.rs:65:18 @@ -104,7 +170,13 @@ LL | pub struct B(isize); | ----- a constructor is private if any of the fields is private ... LL | match b { a::B(1) => {} a::B(_) => {} } - | ^ + | ^ this tuple struct constructor is private + | +note: the tuple struct constructor `B` is defined here + --> $DIR/privacy5.rs:7:5 + | +LL | pub struct B(isize); + | ^^^^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `B` is private --> $DIR/privacy5.rs:65:32 @@ -113,7 +185,13 @@ LL | pub struct B(isize); | ----- a constructor is private if any of the fields is private ... LL | match b { a::B(1) => {} a::B(_) => {} } - | ^ + | ^ this tuple struct constructor is private + | +note: the tuple struct constructor `B` is defined here + --> $DIR/privacy5.rs:7:5 + | +LL | pub struct B(isize); + | ^^^^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:68:12 @@ -122,7 +200,13 @@ LL | pub struct C(pub isize, isize); | ---------------- a constructor is private if any of the fields is private ... LL | let a::C(_, _) = c; - | ^ + | ^ this tuple struct constructor is private + | +note: the tuple struct constructor `C` is defined here + --> $DIR/privacy5.rs:8:5 + | +LL | pub struct C(pub isize, isize); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:69:12 @@ -131,7 +215,13 @@ LL | pub struct C(pub isize, isize); | ---------------- a constructor is private if any of the fields is private ... LL | let a::C(_a, _) = c; - | ^ + | ^ this tuple struct constructor is private + | +note: the tuple struct constructor `C` is defined here + --> $DIR/privacy5.rs:8:5 + | +LL | pub struct C(pub isize, isize); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:70:12 @@ -140,7 +230,13 @@ LL | pub struct C(pub isize, isize); | ---------------- a constructor is private if any of the fields is private ... LL | let a::C(_, _b) = c; - | ^ + | ^ this tuple struct constructor is private + | +note: the tuple struct constructor `C` is defined here + --> $DIR/privacy5.rs:8:5 + | +LL | pub struct C(pub isize, isize); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:71:12 @@ -149,7 +245,13 @@ LL | pub struct C(pub isize, isize); | ---------------- a constructor is private if any of the fields is private ... LL | let a::C(_a, _b) = c; - | ^ + | ^ this tuple struct constructor is private + | +note: the tuple struct constructor `C` is defined here + --> $DIR/privacy5.rs:8:5 + | +LL | pub struct C(pub isize, isize); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:72:18 @@ -158,7 +260,13 @@ LL | pub struct C(pub isize, isize); | ---------------- a constructor is private if any of the fields is private ... LL | match c { a::C(_, _) => {} } - | ^ + | ^ this tuple struct constructor is private + | +note: the tuple struct constructor `C` is defined here + --> $DIR/privacy5.rs:8:5 + | +LL | pub struct C(pub isize, isize); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:73:18 @@ -167,7 +275,13 @@ LL | pub struct C(pub isize, isize); | ---------------- a constructor is private if any of the fields is private ... LL | match c { a::C(_a, _) => {} } - | ^ + | ^ this tuple struct constructor is private + | +note: the tuple struct constructor `C` is defined here + --> $DIR/privacy5.rs:8:5 + | +LL | pub struct C(pub isize, isize); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:74:18 @@ -176,7 +290,13 @@ LL | pub struct C(pub isize, isize); | ---------------- a constructor is private if any of the fields is private ... LL | match c { a::C(_, _b) => {} } - | ^ + | ^ this tuple struct constructor is private + | +note: the tuple struct constructor `C` is defined here + --> $DIR/privacy5.rs:8:5 + | +LL | pub struct C(pub isize, isize); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:75:18 @@ -185,7 +305,13 @@ LL | pub struct C(pub isize, isize); | ---------------- a constructor is private if any of the fields is private ... LL | match c { a::C(_a, _b) => {} } - | ^ + | ^ this tuple struct constructor is private + | +note: the tuple struct constructor `C` is defined here + --> $DIR/privacy5.rs:8:5 + | +LL | pub struct C(pub isize, isize); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `A` is private --> $DIR/privacy5.rs:83:17 @@ -194,7 +320,13 @@ LL | pub struct A(()); | -- a constructor is private if any of the fields is private ... LL | let a2 = a::A; - | ^ + | ^ this tuple struct constructor is private + | +note: the tuple struct constructor `A` is defined here + --> $DIR/privacy5.rs:6:5 + | +LL | pub struct A(()); + | ^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `B` is private --> $DIR/privacy5.rs:84:17 @@ -203,7 +335,13 @@ LL | pub struct B(isize); | ----- a constructor is private if any of the fields is private ... LL | let b2 = a::B; - | ^ + | ^ this tuple struct constructor is private + | +note: the tuple struct constructor `B` is defined here + --> $DIR/privacy5.rs:7:5 + | +LL | pub struct B(isize); + | ^^^^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:85:17 @@ -212,271 +350,421 @@ LL | pub struct C(pub isize, isize); | ---------------- a constructor is private if any of the fields is private ... LL | let c2 = a::C; - | ^ + | ^ this tuple struct constructor is private + | +note: the tuple struct constructor `C` is defined here + --> $DIR/privacy5.rs:8:5 + | +LL | pub struct C(pub isize, isize); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `A` is private --> $DIR/privacy5.rs:90:20 | LL | let a = other::A(()); - | ^ + | ^ this tuple struct constructor is private | ::: $DIR/auxiliary/privacy_tuple_struct.rs:1:14 | LL | pub struct A(()); | -- a constructor is private if any of the fields is private + | +note: the tuple struct constructor `A` is defined here + --> $DIR/auxiliary/privacy_tuple_struct.rs:1:1 + | +LL | pub struct A(()); + | ^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `B` is private --> $DIR/privacy5.rs:91:20 | LL | let b = other::B(2); - | ^ + | ^ this tuple struct constructor is private | ::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14 | LL | pub struct B(isize); | ----- a constructor is private if any of the fields is private + | +note: the tuple struct constructor `B` is defined here + --> $DIR/auxiliary/privacy_tuple_struct.rs:2:1 + | +LL | pub struct B(isize); + | ^^^^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:92:20 | LL | let c = other::C(2, 3); - | ^ + | ^ this tuple struct constructor is private | ::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14 | LL | pub struct C(pub isize, isize); | ---------------- a constructor is private if any of the fields is private + | +note: the tuple struct constructor `C` is defined here + --> $DIR/auxiliary/privacy_tuple_struct.rs:3:1 + | +LL | pub struct C(pub isize, isize); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `A` is private --> $DIR/privacy5.rs:95:16 | LL | let other::A(()) = a; - | ^ + | ^ this tuple struct constructor is private | ::: $DIR/auxiliary/privacy_tuple_struct.rs:1:14 | LL | pub struct A(()); | -- a constructor is private if any of the fields is private + | +note: the tuple struct constructor `A` is defined here + --> $DIR/auxiliary/privacy_tuple_struct.rs:1:1 + | +LL | pub struct A(()); + | ^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `A` is private --> $DIR/privacy5.rs:96:16 | LL | let other::A(_) = a; - | ^ + | ^ this tuple struct constructor is private | ::: $DIR/auxiliary/privacy_tuple_struct.rs:1:14 | LL | pub struct A(()); | -- a constructor is private if any of the fields is private + | +note: the tuple struct constructor `A` is defined here + --> $DIR/auxiliary/privacy_tuple_struct.rs:1:1 + | +LL | pub struct A(()); + | ^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `A` is private --> $DIR/privacy5.rs:97:22 | LL | match a { other::A(()) => {} } - | ^ + | ^ this tuple struct constructor is private | ::: $DIR/auxiliary/privacy_tuple_struct.rs:1:14 | LL | pub struct A(()); | -- a constructor is private if any of the fields is private + | +note: the tuple struct constructor `A` is defined here + --> $DIR/auxiliary/privacy_tuple_struct.rs:1:1 + | +LL | pub struct A(()); + | ^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `A` is private --> $DIR/privacy5.rs:98:22 | LL | match a { other::A(_) => {} } - | ^ + | ^ this tuple struct constructor is private | ::: $DIR/auxiliary/privacy_tuple_struct.rs:1:14 | LL | pub struct A(()); | -- a constructor is private if any of the fields is private + | +note: the tuple struct constructor `A` is defined here + --> $DIR/auxiliary/privacy_tuple_struct.rs:1:1 + | +LL | pub struct A(()); + | ^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `B` is private --> $DIR/privacy5.rs:100:16 | LL | let other::B(_) = b; - | ^ + | ^ this tuple struct constructor is private | ::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14 | LL | pub struct B(isize); | ----- a constructor is private if any of the fields is private + | +note: the tuple struct constructor `B` is defined here + --> $DIR/auxiliary/privacy_tuple_struct.rs:2:1 + | +LL | pub struct B(isize); + | ^^^^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `B` is private --> $DIR/privacy5.rs:101:16 | LL | let other::B(_b) = b; - | ^ + | ^ this tuple struct constructor is private | ::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14 | LL | pub struct B(isize); | ----- a constructor is private if any of the fields is private + | +note: the tuple struct constructor `B` is defined here + --> $DIR/auxiliary/privacy_tuple_struct.rs:2:1 + | +LL | pub struct B(isize); + | ^^^^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `B` is private --> $DIR/privacy5.rs:102:22 | LL | match b { other::B(_) => {} } - | ^ + | ^ this tuple struct constructor is private | ::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14 | LL | pub struct B(isize); | ----- a constructor is private if any of the fields is private + | +note: the tuple struct constructor `B` is defined here + --> $DIR/auxiliary/privacy_tuple_struct.rs:2:1 + | +LL | pub struct B(isize); + | ^^^^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `B` is private --> $DIR/privacy5.rs:103:22 | LL | match b { other::B(_b) => {} } - | ^ + | ^ this tuple struct constructor is private | ::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14 | LL | pub struct B(isize); | ----- a constructor is private if any of the fields is private + | +note: the tuple struct constructor `B` is defined here + --> $DIR/auxiliary/privacy_tuple_struct.rs:2:1 + | +LL | pub struct B(isize); + | ^^^^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `B` is private --> $DIR/privacy5.rs:104:22 | LL | match b { other::B(1) => {} - | ^ + | ^ this tuple struct constructor is private | ::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14 | LL | pub struct B(isize); | ----- a constructor is private if any of the fields is private + | +note: the tuple struct constructor `B` is defined here + --> $DIR/auxiliary/privacy_tuple_struct.rs:2:1 + | +LL | pub struct B(isize); + | ^^^^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `B` is private --> $DIR/privacy5.rs:105:16 | LL | other::B(_) => {} } - | ^ + | ^ this tuple struct constructor is private | ::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14 | LL | pub struct B(isize); | ----- a constructor is private if any of the fields is private + | +note: the tuple struct constructor `B` is defined here + --> $DIR/auxiliary/privacy_tuple_struct.rs:2:1 + | +LL | pub struct B(isize); + | ^^^^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:107:16 | LL | let other::C(_, _) = c; - | ^ + | ^ this tuple struct constructor is private | ::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14 | LL | pub struct C(pub isize, isize); | ---------------- a constructor is private if any of the fields is private + | +note: the tuple struct constructor `C` is defined here + --> $DIR/auxiliary/privacy_tuple_struct.rs:3:1 + | +LL | pub struct C(pub isize, isize); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:108:16 | LL | let other::C(_a, _) = c; - | ^ + | ^ this tuple struct constructor is private | ::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14 | LL | pub struct C(pub isize, isize); | ---------------- a constructor is private if any of the fields is private + | +note: the tuple struct constructor `C` is defined here + --> $DIR/auxiliary/privacy_tuple_struct.rs:3:1 + | +LL | pub struct C(pub isize, isize); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:109:16 | LL | let other::C(_, _b) = c; - | ^ + | ^ this tuple struct constructor is private | ::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14 | LL | pub struct C(pub isize, isize); | ---------------- a constructor is private if any of the fields is private + | +note: the tuple struct constructor `C` is defined here + --> $DIR/auxiliary/privacy_tuple_struct.rs:3:1 + | +LL | pub struct C(pub isize, isize); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:110:16 | LL | let other::C(_a, _b) = c; - | ^ + | ^ this tuple struct constructor is private | ::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14 | LL | pub struct C(pub isize, isize); | ---------------- a constructor is private if any of the fields is private + | +note: the tuple struct constructor `C` is defined here + --> $DIR/auxiliary/privacy_tuple_struct.rs:3:1 + | +LL | pub struct C(pub isize, isize); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:111:22 | LL | match c { other::C(_, _) => {} } - | ^ + | ^ this tuple struct constructor is private | ::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14 | LL | pub struct C(pub isize, isize); | ---------------- a constructor is private if any of the fields is private + | +note: the tuple struct constructor `C` is defined here + --> $DIR/auxiliary/privacy_tuple_struct.rs:3:1 + | +LL | pub struct C(pub isize, isize); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:112:22 | LL | match c { other::C(_a, _) => {} } - | ^ + | ^ this tuple struct constructor is private | ::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14 | LL | pub struct C(pub isize, isize); | ---------------- a constructor is private if any of the fields is private + | +note: the tuple struct constructor `C` is defined here + --> $DIR/auxiliary/privacy_tuple_struct.rs:3:1 + | +LL | pub struct C(pub isize, isize); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:113:22 | LL | match c { other::C(_, _b) => {} } - | ^ + | ^ this tuple struct constructor is private | ::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14 | LL | pub struct C(pub isize, isize); | ---------------- a constructor is private if any of the fields is private + | +note: the tuple struct constructor `C` is defined here + --> $DIR/auxiliary/privacy_tuple_struct.rs:3:1 + | +LL | pub struct C(pub isize, isize); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:114:22 | LL | match c { other::C(_a, _b) => {} } - | ^ + | ^ this tuple struct constructor is private | ::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14 | LL | pub struct C(pub isize, isize); | ---------------- a constructor is private if any of the fields is private + | +note: the tuple struct constructor `C` is defined here + --> $DIR/auxiliary/privacy_tuple_struct.rs:3:1 + | +LL | pub struct C(pub isize, isize); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `A` is private --> $DIR/privacy5.rs:122:21 | LL | let a2 = other::A; - | ^ + | ^ this tuple struct constructor is private | ::: $DIR/auxiliary/privacy_tuple_struct.rs:1:14 | LL | pub struct A(()); | -- a constructor is private if any of the fields is private + | +note: the tuple struct constructor `A` is defined here + --> $DIR/auxiliary/privacy_tuple_struct.rs:1:1 + | +LL | pub struct A(()); + | ^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `B` is private --> $DIR/privacy5.rs:123:21 | LL | let b2 = other::B; - | ^ + | ^ this tuple struct constructor is private | ::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14 | LL | pub struct B(isize); | ----- a constructor is private if any of the fields is private + | +note: the tuple struct constructor `B` is defined here + --> $DIR/auxiliary/privacy_tuple_struct.rs:2:1 + | +LL | pub struct B(isize); + | ^^^^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:124:21 | LL | let c2 = other::C; - | ^ + | ^ this tuple struct constructor is private | ::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14 | LL | pub struct C(pub isize, isize); | ---------------- a constructor is private if any of the fields is private + | +note: the tuple struct constructor `C` is defined here + --> $DIR/auxiliary/privacy_tuple_struct.rs:3:1 + | +LL | pub struct C(pub isize, isize); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 48 previous errors diff --git a/src/test/ui/privacy/private-item-simple.stderr b/src/test/ui/privacy/private-item-simple.stderr index 0d5435e1c504b..f51b74f6cb53b 100644 --- a/src/test/ui/privacy/private-item-simple.stderr +++ b/src/test/ui/privacy/private-item-simple.stderr @@ -2,7 +2,13 @@ error[E0603]: function `f` is private --> $DIR/private-item-simple.rs:6:8 | LL | a::f(); - | ^ + | ^ this function is private + | +note: the function `f` is defined here + --> $DIR/private-item-simple.rs:2:5 + | +LL | fn f() {} + | ^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/privacy/restricted/test.stderr b/src/test/ui/privacy/restricted/test.stderr index e6a61fbefb0d8..aac444b8e3c98 100644 --- a/src/test/ui/privacy/restricted/test.stderr +++ b/src/test/ui/privacy/restricted/test.stderr @@ -26,13 +26,25 @@ error[E0603]: struct `Crate` is private --> $DIR/test.rs:38:25 | LL | use pub_restricted::Crate; - | ^^^^^ + | ^^^^^ this struct is private + | +note: the struct `Crate` is defined here + --> $DIR/auxiliary/pub_restricted.rs:3:1 + | +LL | pub(crate) struct Crate; + | ^^^^^^^^^^^^^^^^^^^^^^^^ error[E0603]: function `f` is private --> $DIR/test.rs:30:19 | LL | use foo::bar::f; - | ^ + | ^ this function is private + | +note: the function `f` is defined here + --> $DIR/test.rs:8:9 + | +LL | pub(super) fn f() {} + | ^^^^^^^^^^^^^^^^^ error[E0616]: field `x` of struct `foo::bar::S` is private --> $DIR/test.rs:31:5 diff --git a/src/test/ui/proc-macro/disappearing-resolution.rs b/src/test/ui/proc-macro/disappearing-resolution.rs index a01b8f302cae3..50f04b1eae150 100644 --- a/src/test/ui/proc-macro/disappearing-resolution.rs +++ b/src/test/ui/proc-macro/disappearing-resolution.rs @@ -8,7 +8,7 @@ extern crate test_macros; mod m { use test_macros::Empty; } -use m::Empty; //~ ERROR derive macro `Empty` is private +use m::Empty; //~ ERROR derive macro import `Empty` is private // To resolve `empty_helper` we need to resolve `Empty`. // During initial resolution `use m::Empty` introduces no entries, so we proceed to `macro_use`, diff --git a/src/test/ui/proc-macro/disappearing-resolution.stderr b/src/test/ui/proc-macro/disappearing-resolution.stderr index a3377ef515f91..3beaedf61d73a 100644 --- a/src/test/ui/proc-macro/disappearing-resolution.stderr +++ b/src/test/ui/proc-macro/disappearing-resolution.stderr @@ -4,11 +4,17 @@ error: cannot find attribute `empty_helper` in this scope LL | #[empty_helper] | ^^^^^^^^^^^^ -error[E0603]: derive macro `Empty` is private +error[E0603]: derive macro import `Empty` is private --> $DIR/disappearing-resolution.rs:11:8 | LL | use m::Empty; - | ^^^^^ + | ^^^^^ this derive macro import is private + | +note: the derive macro import `Empty` is defined here + --> $DIR/disappearing-resolution.rs:9:9 + | +LL | use test_macros::Empty; + | ^^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/reachable/unreachable-variant.stderr b/src/test/ui/reachable/unreachable-variant.stderr index 276c77f9b4249..c2e1d774e28ac 100644 --- a/src/test/ui/reachable/unreachable-variant.stderr +++ b/src/test/ui/reachable/unreachable-variant.stderr @@ -2,7 +2,13 @@ error[E0603]: module `super_sekrit` is private --> $DIR/unreachable-variant.rs:6:21 | LL | let _x = other::super_sekrit::sooper_sekrit::baz; - | ^^^^^^^^^^^^ + | ^^^^^^^^^^^^ this module is private + | +note: the module `super_sekrit` is defined here + --> $DIR/auxiliary/unreachable_variant.rs:1:1 + | +LL | mod super_sekrit { + | ^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/resolve/privacy-enum-ctor.stderr b/src/test/ui/resolve/privacy-enum-ctor.stderr index 688720e8cd388..08a1d790197a6 100644 --- a/src/test/ui/resolve/privacy-enum-ctor.stderr +++ b/src/test/ui/resolve/privacy-enum-ctor.stderr @@ -253,25 +253,49 @@ error[E0603]: enum `Z` is private --> $DIR/privacy-enum-ctor.rs:57:22 | LL | let _: Z = m::n::Z; - | ^ + | ^ this enum is private + | +note: the enum `Z` is defined here + --> $DIR/privacy-enum-ctor.rs:11:9 + | +LL | pub(in m) enum Z { + | ^^^^^^^^^^^^^^^^ error[E0603]: enum `Z` is private --> $DIR/privacy-enum-ctor.rs:61:22 | LL | let _: Z = m::n::Z::Fn; - | ^ + | ^ this enum is private + | +note: the enum `Z` is defined here + --> $DIR/privacy-enum-ctor.rs:11:9 + | +LL | pub(in m) enum Z { + | ^^^^^^^^^^^^^^^^ error[E0603]: enum `Z` is private --> $DIR/privacy-enum-ctor.rs:64:22 | LL | let _: Z = m::n::Z::Struct; - | ^ + | ^ this enum is private + | +note: the enum `Z` is defined here + --> $DIR/privacy-enum-ctor.rs:11:9 + | +LL | pub(in m) enum Z { + | ^^^^^^^^^^^^^^^^ error[E0603]: enum `Z` is private --> $DIR/privacy-enum-ctor.rs:68:22 | LL | let _: Z = m::n::Z::Unit {}; - | ^ + | ^ this enum is private + | +note: the enum `Z` is defined here + --> $DIR/privacy-enum-ctor.rs:11:9 + | +LL | pub(in m) enum Z { + | ^^^^^^^^^^^^^^^^ error[E0308]: mismatched types --> $DIR/privacy-enum-ctor.rs:27:20 diff --git a/src/test/ui/resolve/privacy-struct-ctor.stderr b/src/test/ui/resolve/privacy-struct-ctor.stderr index f1a1de4d9c0fd..1673ec46ba488 100644 --- a/src/test/ui/resolve/privacy-struct-ctor.stderr +++ b/src/test/ui/resolve/privacy-struct-ctor.stderr @@ -45,7 +45,13 @@ LL | pub(in m) struct Z(pub(in m::n) u8); | --------------- a constructor is private if any of the fields is private ... LL | n::Z; - | ^ + | ^ this tuple struct constructor is private + | +note: the tuple struct constructor `Z` is defined here + --> $DIR/privacy-struct-ctor.rs:12:9 + | +LL | pub(in m) struct Z(pub(in m::n) u8); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `S` is private --> $DIR/privacy-struct-ctor.rs:29:8 @@ -54,7 +60,13 @@ LL | pub struct S(u8); | -- a constructor is private if any of the fields is private ... LL | m::S; - | ^ + | ^ this tuple struct constructor is private + | +note: the tuple struct constructor `S` is defined here + --> $DIR/privacy-struct-ctor.rs:6:5 + | +LL | pub struct S(u8); + | ^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `S` is private --> $DIR/privacy-struct-ctor.rs:31:19 @@ -63,7 +75,13 @@ LL | pub struct S(u8); | -- a constructor is private if any of the fields is private ... LL | let _: S = m::S(2); - | ^ + | ^ this tuple struct constructor is private + | +note: the tuple struct constructor `S` is defined here + --> $DIR/privacy-struct-ctor.rs:6:5 + | +LL | pub struct S(u8); + | ^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `Z` is private --> $DIR/privacy-struct-ctor.rs:35:11 @@ -72,29 +90,47 @@ LL | pub(in m) struct Z(pub(in m::n) u8); | --------------- a constructor is private if any of the fields is private ... LL | m::n::Z; - | ^ + | ^ this tuple struct constructor is private + | +note: the tuple struct constructor `Z` is defined here + --> $DIR/privacy-struct-ctor.rs:12:9 + | +LL | pub(in m) struct Z(pub(in m::n) u8); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `S` is private --> $DIR/privacy-struct-ctor.rs:41:16 | LL | xcrate::m::S; - | ^ + | ^ this tuple struct constructor is private | ::: $DIR/auxiliary/privacy-struct-ctor.rs:2:18 | LL | pub struct S(u8); | -- a constructor is private if any of the fields is private + | +note: the tuple struct constructor `S` is defined here + --> $DIR/auxiliary/privacy-struct-ctor.rs:2:5 + | +LL | pub struct S(u8); + | ^^^^^^^^^^^^^^^^^ error[E0603]: tuple struct constructor `Z` is private --> $DIR/privacy-struct-ctor.rs:45:19 | LL | xcrate::m::n::Z; - | ^ + | ^ this tuple struct constructor is private | ::: $DIR/auxiliary/privacy-struct-ctor.rs:5:28 | LL | pub(in m) struct Z(pub(in m::n) u8); | --------------- a constructor is private if any of the fields is private + | +note: the tuple struct constructor `Z` is defined here + --> $DIR/auxiliary/privacy-struct-ctor.rs:5:9 + | +LL | pub(in m) struct Z(pub(in m::n) u8); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 10 previous errors diff --git a/src/test/ui/rfc-2008-non-exhaustive/struct.stderr b/src/test/ui/rfc-2008-non-exhaustive/struct.stderr index 944965a15e3d0..f992988c93fcc 100644 --- a/src/test/ui/rfc-2008-non-exhaustive/struct.stderr +++ b/src/test/ui/rfc-2008-non-exhaustive/struct.stderr @@ -14,18 +14,30 @@ error[E0603]: tuple struct constructor `TupleStruct` is private --> $DIR/struct.rs:23:32 | LL | let ts_explicit = structs::TupleStruct(640, 480); - | ^^^^^^^^^^^ + | ^^^^^^^^^^^ this tuple struct constructor is private | ::: $DIR/auxiliary/structs.rs:11:24 | LL | pub struct TupleStruct(pub u16, pub u16); | ---------------- a constructor is private if any of the fields is private + | +note: the tuple struct constructor `TupleStruct` is defined here + --> $DIR/auxiliary/structs.rs:11:1 + | +LL | pub struct TupleStruct(pub u16, pub u16); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0603]: unit struct `UnitStruct` is private --> $DIR/struct.rs:32:32 | LL | let us_explicit = structs::UnitStruct; - | ^^^^^^^^^^ + | ^^^^^^^^^^ this unit struct is private + | +note: the unit struct `UnitStruct` is defined here + --> $DIR/auxiliary/structs.rs:8:1 + | +LL | pub struct UnitStruct; + | ^^^^^^^^^^^^^^^^^^^^^^ error[E0639]: cannot create non-exhaustive struct using struct expression --> $DIR/struct.rs:7:14 diff --git a/src/test/ui/rfc-2008-non-exhaustive/variant.stderr b/src/test/ui/rfc-2008-non-exhaustive/variant.stderr index d9d6ea21b8bd4..2a438753a2c70 100644 --- a/src/test/ui/rfc-2008-non-exhaustive/variant.stderr +++ b/src/test/ui/rfc-2008-non-exhaustive/variant.stderr @@ -2,31 +2,61 @@ error[E0603]: tuple variant `Tuple` is private --> $DIR/variant.rs:11:48 | LL | let variant_tuple = NonExhaustiveVariants::Tuple(640); - | ^^^^^ + | ^^^^^ this tuple variant is private + | +note: the tuple variant `Tuple` is defined here + --> $DIR/auxiliary/variants.rs:5:23 + | +LL | #[non_exhaustive] Tuple(u32), + | ^^^^^^^^^^ error[E0603]: unit variant `Unit` is private --> $DIR/variant.rs:14:47 | LL | let variant_unit = NonExhaustiveVariants::Unit; - | ^^^^ + | ^^^^ this unit variant is private + | +note: the unit variant `Unit` is defined here + --> $DIR/auxiliary/variants.rs:4:23 + | +LL | #[non_exhaustive] Unit, + | ^^^^ error[E0603]: unit variant `Unit` is private --> $DIR/variant.rs:18:32 | LL | NonExhaustiveVariants::Unit => "", - | ^^^^ + | ^^^^ this unit variant is private + | +note: the unit variant `Unit` is defined here + --> $DIR/auxiliary/variants.rs:4:23 + | +LL | #[non_exhaustive] Unit, + | ^^^^ error[E0603]: tuple variant `Tuple` is private --> $DIR/variant.rs:20:32 | LL | NonExhaustiveVariants::Tuple(fe_tpl) => "", - | ^^^^^ + | ^^^^^ this tuple variant is private + | +note: the tuple variant `Tuple` is defined here + --> $DIR/auxiliary/variants.rs:5:23 + | +LL | #[non_exhaustive] Tuple(u32), + | ^^^^^^^^^^ error[E0603]: tuple variant `Tuple` is private --> $DIR/variant.rs:26:35 | LL | if let NonExhaustiveVariants::Tuple(fe_tpl) = variant_struct { - | ^^^^^ + | ^^^^^ this tuple variant is private + | +note: the tuple variant `Tuple` is defined here + --> $DIR/auxiliary/variants.rs:5:23 + | +LL | #[non_exhaustive] Tuple(u32), + | ^^^^^^^^^^ error[E0639]: cannot create non-exhaustive variant using struct expression --> $DIR/variant.rs:8:26 diff --git a/src/test/ui/shadowed/shadowed-use-visibility.rs b/src/test/ui/shadowed/shadowed-use-visibility.rs index 8185e82ee830e..6b801972f4179 100644 --- a/src/test/ui/shadowed/shadowed-use-visibility.rs +++ b/src/test/ui/shadowed/shadowed-use-visibility.rs @@ -6,11 +6,11 @@ mod foo { } mod bar { - use foo::bar::f as g; //~ ERROR module `bar` is private + use foo::bar::f as g; //~ ERROR module import `bar` is private use foo as f; pub use foo::*; } -use bar::f::f; //~ ERROR module `f` is private +use bar::f::f; //~ ERROR module import `f` is private fn main() {} diff --git a/src/test/ui/shadowed/shadowed-use-visibility.stderr b/src/test/ui/shadowed/shadowed-use-visibility.stderr index 7c66fdf60b1d4..cd8ec13794c6f 100644 --- a/src/test/ui/shadowed/shadowed-use-visibility.stderr +++ b/src/test/ui/shadowed/shadowed-use-visibility.stderr @@ -1,14 +1,26 @@ -error[E0603]: module `bar` is private +error[E0603]: module import `bar` is private --> $DIR/shadowed-use-visibility.rs:9:14 | LL | use foo::bar::f as g; - | ^^^ + | ^^^ this module import is private + | +note: the module import `bar` is defined here + --> $DIR/shadowed-use-visibility.rs:4:9 + | +LL | use foo as bar; + | ^^^^^^^^^^ -error[E0603]: module `f` is private +error[E0603]: module import `f` is private --> $DIR/shadowed-use-visibility.rs:15:10 | LL | use bar::f::f; - | ^ + | ^ this module import is private + | +note: the module import `f` is defined here + --> $DIR/shadowed-use-visibility.rs:11:9 + | +LL | use foo as f; + | ^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/stability-in-private-module.stderr b/src/test/ui/stability-in-private-module.stderr index c3edd62a15eda..537a400664aaa 100644 --- a/src/test/ui/stability-in-private-module.stderr +++ b/src/test/ui/stability-in-private-module.stderr @@ -2,7 +2,13 @@ error[E0603]: module `thread_info` is private --> $DIR/stability-in-private-module.rs:2:26 | LL | let _ = std::thread::thread_info::current_thread(); - | ^^^^^^^^^^^ + | ^^^^^^^^^^^ this module is private + | +note: the module `thread_info` is defined here + --> $SRC_DIR/libstd/thread/mod.rs:LL:COL + | +LL | use crate::sys_common::thread_info; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/static/static-priv-by-default2.stderr b/src/test/ui/static/static-priv-by-default2.stderr index 95bcf07633565..f6cd40412dd84 100644 --- a/src/test/ui/static/static-priv-by-default2.stderr +++ b/src/test/ui/static/static-priv-by-default2.stderr @@ -2,13 +2,25 @@ error[E0603]: static `private` is private --> $DIR/static-priv-by-default2.rs:15:30 | LL | use child::childs_child::private; - | ^^^^^^^ + | ^^^^^^^ this static is private + | +note: the static `private` is defined here + --> $DIR/static-priv-by-default2.rs:7:9 + | +LL | static private: isize = 0; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0603]: static `private` is private --> $DIR/static-priv-by-default2.rs:23:33 | LL | use static_priv_by_default::private; - | ^^^^^^^ + | ^^^^^^^ this static is private + | +note: the static `private` is defined here + --> $DIR/auxiliary/static_priv_by_default.rs:3:1 + | +LL | static private: isize = 0; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/structs/struct-variant-privacy-xc.stderr b/src/test/ui/structs/struct-variant-privacy-xc.stderr index 39241b6b3fc1d..0203b7b5242e5 100644 --- a/src/test/ui/structs/struct-variant-privacy-xc.stderr +++ b/src/test/ui/structs/struct-variant-privacy-xc.stderr @@ -2,13 +2,25 @@ error[E0603]: enum `Bar` is private --> $DIR/struct-variant-privacy-xc.rs:4:33 | LL | fn f(b: struct_variant_privacy::Bar) { - | ^^^ + | ^^^ this enum is private + | +note: the enum `Bar` is defined here + --> $DIR/auxiliary/struct_variant_privacy.rs:1:1 + | +LL | enum Bar { + | ^^^^^^^^ error[E0603]: enum `Bar` is private --> $DIR/struct-variant-privacy-xc.rs:6:33 | LL | struct_variant_privacy::Bar::Baz { a: _a } => {} - | ^^^ + | ^^^ this enum is private + | +note: the enum `Bar` is defined here + --> $DIR/auxiliary/struct_variant_privacy.rs:1:1 + | +LL | enum Bar { + | ^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/structs/struct-variant-privacy.stderr b/src/test/ui/structs/struct-variant-privacy.stderr index 127a650104485..d1b603f9d46fc 100644 --- a/src/test/ui/structs/struct-variant-privacy.stderr +++ b/src/test/ui/structs/struct-variant-privacy.stderr @@ -2,13 +2,25 @@ error[E0603]: enum `Bar` is private --> $DIR/struct-variant-privacy.rs:7:14 | LL | fn f(b: foo::Bar) { - | ^^^ + | ^^^ this enum is private + | +note: the enum `Bar` is defined here + --> $DIR/struct-variant-privacy.rs:2:5 + | +LL | enum Bar { + | ^^^^^^^^ error[E0603]: enum `Bar` is private --> $DIR/struct-variant-privacy.rs:9:14 | LL | foo::Bar::Baz { a: _a } => {} - | ^^^ + | ^^^ this enum is private + | +note: the enum `Bar` is defined here + --> $DIR/struct-variant-privacy.rs:2:5 + | +LL | enum Bar { + | ^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/use/use-from-trait-xc.stderr b/src/test/ui/use/use-from-trait-xc.stderr index f7438cce22967..3f38a6cae7b81 100644 --- a/src/test/ui/use/use-from-trait-xc.stderr +++ b/src/test/ui/use/use-from-trait-xc.stderr @@ -44,13 +44,25 @@ error[E0603]: struct `Foo` is private --> $DIR/use-from-trait-xc.rs:14:24 | LL | use use_from_trait_xc::Foo::new; - | ^^^ + | ^^^ this struct is private + | +note: the struct `Foo` is defined here + --> $DIR/auxiliary/use-from-trait-xc.rs:9:1 + | +LL | struct Foo; + | ^^^^^^^^^^^ error[E0603]: struct `Foo` is private --> $DIR/use-from-trait-xc.rs:17:24 | LL | use use_from_trait_xc::Foo::C; - | ^^^ + | ^^^ this struct is private + | +note: the struct `Foo` is defined here + --> $DIR/auxiliary/use-from-trait-xc.rs:9:1 + | +LL | struct Foo; + | ^^^^^^^^^^^ error: aborting due to 9 previous errors diff --git a/src/test/ui/use/use-mod/use-mod-3.stderr b/src/test/ui/use/use-mod/use-mod-3.stderr index 0c800ec35e409..4852759286ae6 100644 --- a/src/test/ui/use/use-mod/use-mod-3.stderr +++ b/src/test/ui/use/use-mod/use-mod-3.stderr @@ -2,13 +2,25 @@ error[E0603]: module `bar` is private --> $DIR/use-mod-3.rs:1:10 | LL | use foo::bar::{ - | ^^^ + | ^^^ this module is private + | +note: the module `bar` is defined here + --> $DIR/use-mod-3.rs:9:5 + | +LL | mod bar { pub type Bar = isize; } + | ^^^^^^^ error[E0603]: module `bar` is private --> $DIR/use-mod-3.rs:4:10 | LL | use foo::bar::{ - | ^^^ + | ^^^ this module is private + | +note: the module `bar` is defined here + --> $DIR/use-mod-3.rs:9:5 + | +LL | mod bar { pub type Bar = isize; } + | ^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/xcrate/xcrate-private-by-default.stderr b/src/test/ui/xcrate/xcrate-private-by-default.stderr index da52b4249e319..842069d6135cb 100644 --- a/src/test/ui/xcrate/xcrate-private-by-default.stderr +++ b/src/test/ui/xcrate/xcrate-private-by-default.stderr @@ -2,61 +2,121 @@ error[E0603]: static `j` is private --> $DIR/xcrate-private-by-default.rs:23:29 | LL | static_priv_by_default::j; - | ^ + | ^ this static is private + | +note: the static `j` is defined here + --> $DIR/auxiliary/static_priv_by_default.rs:47:1 + | +LL | static j: isize = 0; + | ^^^^^^^^^^^^^^^^^^^^ error[E0603]: function `k` is private --> $DIR/xcrate-private-by-default.rs:25:29 | LL | static_priv_by_default::k; - | ^ + | ^ this function is private + | +note: the function `k` is defined here + --> $DIR/auxiliary/static_priv_by_default.rs:48:1 + | +LL | fn k() {} + | ^^^^^^ error[E0603]: unit struct `l` is private --> $DIR/xcrate-private-by-default.rs:27:29 | LL | static_priv_by_default::l; - | ^ + | ^ this unit struct is private + | +note: the unit struct `l` is defined here + --> $DIR/auxiliary/static_priv_by_default.rs:49:1 + | +LL | struct l; + | ^^^^^^^^^ error[E0603]: enum `m` is private --> $DIR/xcrate-private-by-default.rs:29:35 | LL | foo::(); - | ^ + | ^ this enum is private + | +note: the enum `m` is defined here + --> $DIR/auxiliary/static_priv_by_default.rs:50:1 + | +LL | enum m {} + | ^^^^^^ error[E0603]: type alias `n` is private --> $DIR/xcrate-private-by-default.rs:31:35 | LL | foo::(); - | ^ + | ^ this type alias is private + | +note: the type alias `n` is defined here + --> $DIR/auxiliary/static_priv_by_default.rs:51:1 + | +LL | type n = isize; + | ^^^^^^^^^^^^^^^ error[E0603]: module `foo` is private --> $DIR/xcrate-private-by-default.rs:35:29 | LL | static_priv_by_default::foo::a; - | ^^^ + | ^^^ this module is private + | +note: the module `foo` is defined here + --> $DIR/auxiliary/static_priv_by_default.rs:12:1 + | +LL | mod foo { + | ^^^^^^^ error[E0603]: module `foo` is private --> $DIR/xcrate-private-by-default.rs:37:29 | LL | static_priv_by_default::foo::b; - | ^^^ + | ^^^ this module is private + | +note: the module `foo` is defined here + --> $DIR/auxiliary/static_priv_by_default.rs:12:1 + | +LL | mod foo { + | ^^^^^^^ error[E0603]: module `foo` is private --> $DIR/xcrate-private-by-default.rs:39:29 | LL | static_priv_by_default::foo::c; - | ^^^ + | ^^^ this module is private + | +note: the module `foo` is defined here + --> $DIR/auxiliary/static_priv_by_default.rs:12:1 + | +LL | mod foo { + | ^^^^^^^ error[E0603]: module `foo` is private --> $DIR/xcrate-private-by-default.rs:41:35 | LL | foo::(); - | ^^^ + | ^^^ this module is private + | +note: the module `foo` is defined here + --> $DIR/auxiliary/static_priv_by_default.rs:12:1 + | +LL | mod foo { + | ^^^^^^^ error[E0603]: module `foo` is private --> $DIR/xcrate-private-by-default.rs:43:35 | LL | foo::(); - | ^^^ + | ^^^ this module is private + | +note: the module `foo` is defined here + --> $DIR/auxiliary/static_priv_by_default.rs:12:1 + | +LL | mod foo { + | ^^^^^^^ error: aborting due to 10 previous errors diff --git a/src/tools/rustc-workspace-hack/Cargo.toml b/src/tools/rustc-workspace-hack/Cargo.toml index 936e8ae895a74..7bc1d0c9bd191 100644 --- a/src/tools/rustc-workspace-hack/Cargo.toml +++ b/src/tools/rustc-workspace-hack/Cargo.toml @@ -66,6 +66,8 @@ smallvec-0_6 = { package = "smallvec", version = "0.6", features = ['union', 'ma smallvec = { version = "1.0", features = ['union', 'may_dangle'] } url = { version = "2.0", features = ['serde'] } syn = { version = "0.15", features = ['full', 'extra-traits'] } +quote = "0.6" # enable the default feature +proc-macro2 = "0.4" # enable the default feature [target.'cfg(not(windows))'.dependencies] openssl = { version = "0.10.12", optional = true } diff --git a/src/tools/tidy/src/deps.rs b/src/tools/tidy/src/deps.rs index 352c00dbe41bd..29bf2f8ee103c 100644 --- a/src/tools/tidy/src/deps.rs +++ b/src/tools/tidy/src/deps.rs @@ -117,6 +117,7 @@ const WHITELIST: &[Crate<'_>] = &[ Crate("lock_api"), Crate("log"), Crate("log_settings"), + Crate("maybe-uninit"), Crate("measureme"), Crate("memchr"), Crate("memmap"),