]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #93348 - spastorino:fix-perf-overlap-mode2, r=nikomatsakis
authorbors <bors@rust-lang.org>
Mon, 31 Jan 2022 17:36:11 +0000 (17:36 +0000)
committerbors <bors@rust-lang.org>
Mon, 31 Jan 2022 17:36:11 +0000 (17:36 +0000)
 Move overlap_mode into trait level attribute

r? `@nikomatsakis`

Should fix some performance regressions noted on https://github.com/rust-lang/rust/pull/93175

257 files changed:
.github/workflows/ci.yml
Cargo.lock
compiler/rustc/Cargo.toml
compiler/rustc_ast_lowering/src/item.rs
compiler/rustc_ast_lowering/src/lib.rs
compiler/rustc_ast_pretty/src/pp.rs
compiler/rustc_ast_pretty/src/pprust/state.rs
compiler/rustc_ast_pretty/src/pprust/state/expr.rs
compiler/rustc_ast_pretty/src/pprust/state/item.rs
compiler/rustc_builtin_macros/src/format.rs
compiler/rustc_codegen_gcc/src/builder.rs
compiler/rustc_codegen_llvm/src/builder.rs
compiler/rustc_codegen_llvm/src/intrinsic.rs
compiler/rustc_codegen_ssa/src/back/link.rs
compiler/rustc_codegen_ssa/src/mir/block.rs
compiler/rustc_codegen_ssa/src/mir/intrinsic.rs
compiler/rustc_codegen_ssa/src/traits/builder.rs
compiler/rustc_const_eval/src/const_eval/eval_queries.rs
compiler/rustc_const_eval/src/const_eval/machine.rs
compiler/rustc_error_codes/src/error_codes.rs
compiler/rustc_error_codes/src/error_codes/E0772.md [new file with mode: 0644]
compiler/rustc_expand/src/lib.rs
compiler/rustc_hir/src/definitions.rs
compiler/rustc_hir/src/hir.rs
compiler/rustc_hir/src/hir_id.rs
compiler/rustc_infer/src/infer/mod.rs
compiler/rustc_infer/src/infer/opaque_types.rs
compiler/rustc_lint/src/builtin.rs
compiler/rustc_lint/src/context.rs
compiler/rustc_lint/src/traits.rs
compiler/rustc_lint_defs/src/builtin.rs
compiler/rustc_middle/src/hir/map/mod.rs
compiler/rustc_middle/src/hir/mod.rs
compiler/rustc_middle/src/mir/mod.rs
compiler/rustc_middle/src/query/mod.rs
compiler/rustc_middle/src/ty/context.rs
compiler/rustc_middle/src/ty/mod.rs
compiler/rustc_middle/src/ty/normalize_erasing_regions.rs
compiler/rustc_middle/src/ty/sty.rs
compiler/rustc_mir_transform/src/coverage/mod.rs
compiler/rustc_mir_transform/src/function_item_references.rs
compiler/rustc_parse/src/parser/diagnostics.rs
compiler/rustc_resolve/src/late/lifetimes.rs
compiler/rustc_save_analysis/src/lib.rs
compiler/rustc_span/src/symbol.rs
compiler/rustc_target/src/asm/mod.rs
compiler/rustc_trait_selection/src/traits/codegen.rs
compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
compiler/rustc_trait_selection/src/traits/mod.rs
compiler/rustc_trait_selection/src/traits/project.rs
compiler/rustc_trait_selection/src/traits/query/normalize.rs
compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs
compiler/rustc_trait_selection/src/traits/select/confirmation.rs
compiler/rustc_trait_selection/src/traits/select/mod.rs
compiler/rustc_ty_utils/src/ty.rs
compiler/rustc_typeck/src/astconv/generics.rs
compiler/rustc_typeck/src/astconv/mod.rs
compiler/rustc_typeck/src/check/expr.rs
compiler/rustc_typeck/src/check/intrinsic.rs
library/alloc/src/lib.rs
library/core/src/cell.rs
library/core/src/char/decode.rs
library/core/src/char/methods.rs
library/core/src/char/mod.rs
library/core/src/cmp.rs
library/core/src/fmt/mod.rs
library/core/src/future/into_future.rs
library/core/src/future/join.rs
library/core/src/intrinsics.rs
library/core/src/iter/traits/iterator.rs
library/core/src/lib.rs
library/core/src/macros/mod.rs
library/core/src/num/f32.rs
library/core/src/num/f64.rs
library/core/src/num/saturating.rs
library/core/src/prelude/v1.rs
library/core/src/ptr/non_null.rs
library/core/src/slice/mod.rs
library/core/src/slice/sort.rs
library/core/tests/char.rs
library/core/tests/cmp.rs
library/core/tests/intrinsics.rs
library/core/tests/lib.rs
library/core/tests/ptr.rs
library/std/Cargo.toml
library/std/src/fs/tests.rs
library/std/src/lib.rs
library/std/src/os/unix/net/addr.rs
library/std/src/os/wasi/fs.rs
library/std/src/os/wasi/net/mod.rs
library/std/src/prelude/v1.rs
library/std/src/sync/mutex.rs
library/std/src/sync/rwlock.rs
library/std/src/sys/itron/thread.rs
library/std/src/sys/solid/abi/sockets.rs
library/std/src/sys/solid/net.rs
library/std/src/sys/unix/fs.rs
library/std/src/sys/wasi/fd.rs
library/std/src/sys/wasi/mod.rs
library/std/src/sys/wasi/net.rs
library/std/src/sys/wasi/stdio.rs
library/std/src/sys/wasi/thread.rs
library/std/src/sys/wasi/time.rs
library/std/src/sys_common/io.rs
library/std/src/time.rs
library/std/tests/run-time-detect.rs
library/stdarch
src/bootstrap/builder.rs
src/bootstrap/util.rs
src/ci/docker/host-x86_64/x86_64-gnu-tools/Dockerfile
src/ci/github-actions/ci.yml
src/doc/rust-by-example
src/doc/rustdoc/src/references.md
src/librustdoc/clean/mod.rs
src/librustdoc/clean/render_macro_matchers.rs [new file with mode: 0644]
src/librustdoc/clean/types.rs
src/librustdoc/clean/utils.rs
src/librustdoc/formats/cache.rs
src/librustdoc/html/render/mod.rs
src/librustdoc/html/render/search_index.rs
src/librustdoc/html/static/css/rustdoc.css
src/librustdoc/html/static/css/themes/ayu.css
src/librustdoc/html/static/css/themes/dark.css
src/librustdoc/html/static/css/themes/light.css
src/librustdoc/html/static/js/main.js
src/librustdoc/html/templates/print_item.html
src/librustdoc/passes/collect_intra_doc_links.rs
src/librustdoc/passes/collect_intra_doc_links/early.rs
src/librustdoc/passes/collect_trait_impls.rs
src/librustdoc/passes/strip_hidden.rs
src/librustdoc/passes/strip_private.rs
src/librustdoc/passes/stripper.rs
src/llvm-project
src/stage0.json
src/test/pretty/ast-stmt-expr-attr.rs
src/test/pretty/block-comment-wchar.pp
src/test/pretty/delimited-token-groups.rs
src/test/pretty/issue-4264.pp
src/test/pretty/issue-68710-field-attr-proc-mac-lost.rs
src/test/pretty/macro_rules.rs
src/test/pretty/match-naked-expr-medium.rs
src/test/pretty/stmt_expr_attributes.rs
src/test/pretty/vec-comments.pp
src/test/run-make-fulldeps/coverage-reports/expected_show_coverage.closure.txt
src/test/run-make-fulldeps/coverage-reports/expected_show_coverage.uses_crate.txt
src/test/run-make-fulldeps/coverage-reports/expected_show_coverage.uses_inline_crate.txt
src/test/rustdoc-gui/mobile.goml
src/test/rustdoc-gui/sidebar-mobile.goml
src/test/rustdoc-gui/theme-change.goml
src/test/rustdoc-gui/theme-in-history.goml [new file with mode: 0644]
src/test/rustdoc-gui/type-declation-overflow.goml
src/test/rustdoc/intra-doc/crate-relative.rs [new file with mode: 0644]
src/test/rustdoc/intra-doc/mod-relative.rs [new file with mode: 0644]
src/test/rustdoc/macro-generated-macro.macro_linebreak_pre.html [new file with mode: 0644]
src/test/rustdoc/macro-generated-macro.macro_morestuff_pre.html [new file with mode: 0644]
src/test/rustdoc/macro-generated-macro.rs
src/test/rustdoc/version-separator-without-source.rs [new file with mode: 0644]
src/test/ui/asm/named-asm-labels.stderr
src/test/ui/async-await/await-keyword/2018-edition-error-in-non-macro-position.stderr
src/test/ui/async-await/await-keyword/2018-edition-error.stderr
src/test/ui/attributes/key-value-expansion.stderr
src/test/ui/closures/issue-84044-drop-non-mut.rs [new file with mode: 0644]
src/test/ui/closures/issue-84044-drop-non-mut.stderr [new file with mode: 0644]
src/test/ui/closures/print/closure-print-generic-trim-off-verbose-2.stderr
src/test/ui/closures/print/closure-print-generic-verbose-2.stderr
src/test/ui/const-generics/defaults/pretty-printing-ast.stdout
src/test/ui/consts/const-eval/heap/alloc_intrinsic_errors.rs
src/test/ui/consts/const-eval/heap/alloc_intrinsic_errors.stderr
src/test/ui/consts/const-eval/heap/alloc_intrinsic_zero_sized.rs [new file with mode: 0644]
src/test/ui/consts/const-eval/heap/dealloc_intrinsic.rs [new file with mode: 0644]
src/test/ui/consts/const-eval/heap/dealloc_intrinsic_dangling.rs [new file with mode: 0644]
src/test/ui/consts/const-eval/heap/dealloc_intrinsic_dangling.stderr [new file with mode: 0644]
src/test/ui/consts/const-eval/heap/dealloc_intrinsic_duplicate.rs [new file with mode: 0644]
src/test/ui/consts/const-eval/heap/dealloc_intrinsic_duplicate.stderr [new file with mode: 0644]
src/test/ui/consts/const-eval/heap/dealloc_intrinsic_incorrect_layout.rs [new file with mode: 0644]
src/test/ui/consts/const-eval/heap/dealloc_intrinsic_incorrect_layout.stderr [new file with mode: 0644]
src/test/ui/consts/const-eval/heap/dealloc_intrinsic_zero_sized.rs [new file with mode: 0644]
src/test/ui/did_you_mean/issue-93210-ignore-doc-hidden.rs [new file with mode: 0644]
src/test/ui/did_you_mean/issue-93210-ignore-doc-hidden.stderr [new file with mode: 0644]
src/test/ui/editions/edition-keywords-2015-2018-expansion.stderr
src/test/ui/editions/edition-keywords-2018-2015-parsing.stderr
src/test/ui/editions/edition-keywords-2018-2018-expansion.stderr
src/test/ui/editions/edition-keywords-2018-2018-parsing.stderr
src/test/ui/fmt/format-with-yield-point.rs [new file with mode: 0644]
src/test/ui/fmt/ifmt-unimpl.stderr
src/test/ui/generic-associated-types/elided-in-expr-position.rs [new file with mode: 0644]
src/test/ui/generic-associated-types/elided-in-expr-position.stderr [new file with mode: 0644]
src/test/ui/generic-associated-types/issue-93340.rs [new file with mode: 0644]
src/test/ui/intrinsics/const-eval-select-bad.stderr
src/test/ui/issues/issue-69455.stderr
src/test/ui/keyword/extern/keyword-extern-as-identifier-pat.stderr
src/test/ui/keyword/extern/keyword-extern-as-identifier-use.stderr
src/test/ui/match/issue-82392.stdout
src/test/ui/parser/bad-value-ident-false.stderr
src/test/ui/parser/bad-value-ident-true.stderr
src/test/ui/parser/issues/issue-15980.stderr
src/test/ui/parser/issues/issue-44406.stderr
src/test/ui/parser/issues/issue-57198.stderr
src/test/ui/parser/issues/issue-81806.stderr
src/test/ui/parser/keyword-abstract.stderr
src/test/ui/parser/keyword-as-as-identifier.stderr
src/test/ui/parser/keyword-break-as-identifier.stderr
src/test/ui/parser/keyword-const-as-identifier.stderr
src/test/ui/parser/keyword-continue-as-identifier.stderr
src/test/ui/parser/keyword-else-as-identifier.stderr
src/test/ui/parser/keyword-enum-as-identifier.stderr
src/test/ui/parser/keyword-final.stderr
src/test/ui/parser/keyword-fn-as-identifier.stderr
src/test/ui/parser/keyword-for-as-identifier.stderr
src/test/ui/parser/keyword-if-as-identifier.stderr
src/test/ui/parser/keyword-impl-as-identifier.stderr
src/test/ui/parser/keyword-let-as-identifier.stderr
src/test/ui/parser/keyword-loop-as-identifier.stderr
src/test/ui/parser/keyword-match-as-identifier.stderr
src/test/ui/parser/keyword-mod-as-identifier.stderr
src/test/ui/parser/keyword-move-as-identifier.stderr
src/test/ui/parser/keyword-override.stderr
src/test/ui/parser/keyword-pub-as-identifier.stderr
src/test/ui/parser/keyword-return-as-identifier.stderr
src/test/ui/parser/keyword-static-as-identifier.stderr
src/test/ui/parser/keyword-struct-as-identifier.stderr
src/test/ui/parser/keyword-trait-as-identifier.stderr
src/test/ui/parser/keyword-try-as-identifier-edition2018.stderr
src/test/ui/parser/keyword-type-as-identifier.stderr
src/test/ui/parser/keyword-typeof.stderr
src/test/ui/parser/keyword-unsafe-as-identifier.stderr
src/test/ui/parser/keyword-use-as-identifier.stderr
src/test/ui/parser/keyword-where-as-identifier.stderr
src/test/ui/parser/keyword-while-as-identifier.stderr
src/test/ui/parser/keyword.stderr
src/test/ui/parser/macro-keyword.stderr
src/test/ui/parser/mut-patterns.stderr
src/test/ui/proc-macro/cfg-eval-inner.stdout
src/test/ui/proc-macro/issue-75930-derive-cfg.stdout
src/test/ui/proc-macro/macro-rules-derive-cfg.stdout
src/test/ui/proc-macro/quote-debug.stdout
src/test/ui/reserved/reserved-become.stderr
src/test/ui/rfc-2565-param-attrs/auxiliary/param-attrs.rs
src/test/ui/rfc-2632-const-trait-impl/assoc-type.stderr
src/test/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst.stderr
src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr
src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.stock.stderr
src/test/ui/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.stderr
src/test/ui/rfc-2632-const-trait-impl/trait-where-clause.stderr
src/test/ui/rust-2018/dyn-trait-compatibility.stderr
src/test/ui/save-analysis/issue-89066.rs [new file with mode: 0644]
src/test/ui/save-analysis/issue-89066.stderr [new file with mode: 0644]
src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.stderr
src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.stderr
src/test/ui/suggestions/private-field.rs [new file with mode: 0644]
src/test/ui/suggestions/private-field.stderr [new file with mode: 0644]
src/test/ui/suggestions/raw-name-use-suggestion.stderr
src/test/ui/traits/issue-91594.rs [new file with mode: 0644]
src/test/ui/traits/issue-91594.stderr [new file with mode: 0644]
src/test/ui/type-alias-impl-trait/issue-60662.stdout
src/tools/clippy/clippy_lints/src/index_refutable_slice.rs
src/tools/clippy/clippy_utils/src/macros.rs

index cf85591ac018e3b0a6366520836f39c1efcd9e01..e97cd29bba5dcfd34208002113d486ad71c80179 100644 (file)
@@ -290,8 +290,8 @@ jobs:
             os: ubuntu-20.04-xl
           - name: dist-x86_64-apple
             env:
-              SCRIPT: "./x.py dist --exclude rust-docs --exclude extended && ./x.py dist --target=x86_64-apple-darwin rust-docs && ./x.py dist extended"
-              RUST_CONFIGURE_ARGS: "--host=x86_64-apple-darwin --target=x86_64-apple-darwin,aarch64-apple-ios,x86_64-apple-ios,aarch64-apple-ios-sim --enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false"
+              SCRIPT: "./x.py dist --host=x86_64-apple-darwin --target=x86_64-apple-darwin"
+              RUST_CONFIGURE_ARGS: "--enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false"
               RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
               MACOSX_DEPLOYMENT_TARGET: 10.7
               NO_LLVM_ASSERTIONS: 1
@@ -299,6 +299,16 @@ jobs:
               NO_OVERFLOW_CHECKS: 1
               DIST_REQUIRE_ALL_TOOLS: 1
             os: macos-latest
+          - name: dist-apple-various
+            env:
+              SCRIPT: "./x.py dist --host='' --target=aarch64-apple-ios,x86_64-apple-ios,aarch64-apple-ios-sim"
+              RUST_CONFIGURE_ARGS: "--enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false"
+              RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
+              MACOSX_DEPLOYMENT_TARGET: 10.7
+              NO_LLVM_ASSERTIONS: 1
+              NO_DEBUG_ASSERTIONS: 1
+              NO_OVERFLOW_CHECKS: 1
+            os: macos-latest
           - name: dist-x86_64-apple-alt
             env:
               SCRIPT: "./x.py dist"
index 738f33d3fa219849304ec95eeec3fabf53bae3b4..dd45d49781a45bd088a1c3bf11997902e6cada63 100644 (file)
@@ -56,9 +56,9 @@ dependencies = [
 
 [[package]]
 name = "ammonia"
-version = "3.1.0"
+version = "3.1.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "89eac85170f4b3fb3dc5e442c1cfb036cb8eecf9dbbd431a161ffad15d90ea3b"
+checksum = "b74b175af97d1aecc1add0878b1cbfcbf3bd4c22d7713eeb6d597da23e29bc0d"
 dependencies = [
  "html5ever",
  "lazy_static",
@@ -1473,7 +1473,7 @@ checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb"
 dependencies = [
  "cfg-if 0.1.10",
  "libc",
- "wasi",
+ "wasi 0.9.0+wasi-snapshot-preview1",
 ]
 
 [[package]]
@@ -1484,7 +1484,7 @@ checksum = "ee8025cf36f917e6a52cce185b7c7177689b838b7ec138364e50cc2277a56cf4"
 dependencies = [
  "cfg-if 0.1.10",
  "libc",
- "wasi",
+ "wasi 0.9.0+wasi-snapshot-preview1",
 ]
 
 [[package]]
@@ -1986,9 +1986,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
 
 [[package]]
 name = "libc"
-version = "0.2.108"
+version = "0.2.116"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8521a1b57e76b1ec69af7599e75e38e7b7fad6610f037db8c79b127201b5d119"
+checksum = "565dbd88872dbe4cc8a46e527f26483c1d1f7afa6b884a3bd6cd893d4f98da74"
 dependencies = [
  "rustc-std-workspace-core",
 ]
@@ -2751,9 +2751,9 @@ dependencies = [
 
 [[package]]
 name = "pin-project-lite"
-version = "0.2.4"
+version = "0.2.8"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "439697af366c49a6d0a010c56a0d97685bc140ce0d377b13a2ea2aa42d64a827"
+checksum = "e280fbe77cc62c91527259e9442153f4688736748d24660126286329742b4c6c"
 
 [[package]]
 name = "pin-utils"
@@ -3319,7 +3319,6 @@ dependencies = [
  "rustc_codegen_ssa",
  "rustc_driver",
  "tikv-jemalloc-sys",
- "tikv-jemallocator",
 ]
 
 [[package]]
@@ -4854,7 +4853,7 @@ dependencies = [
  "rustc-demangle",
  "std_detect",
  "unwind",
- "wasi",
+ "wasi 0.11.0+wasi-snapshot-preview1",
 ]
 
 [[package]]
@@ -5131,11 +5130,11 @@ dependencies = [
 
 [[package]]
 name = "thread_local"
-version = "1.0.1"
+version = "1.1.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14"
+checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180"
 dependencies = [
- "lazy_static",
+ "once_cell",
 ]
 
 [[package]]
@@ -5164,16 +5163,6 @@ dependencies = [
  "libc",
 ]
 
-[[package]]
-name = "tikv-jemallocator"
-version = "0.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3c14a5a604eb8715bc5785018a37d00739b180bcf609916ddf4393d33d49ccdf"
-dependencies = [
- "libc",
- "tikv-jemalloc-sys",
-]
-
 [[package]]
 name = "time"
 version = "0.1.43"
@@ -5192,9 +5181,9 @@ checksum = "238ce071d267c5710f9d31451efec16c5ee22de34df17cc05e56cbc92e967117"
 
 [[package]]
 name = "tokio"
-version = "1.8.2"
+version = "1.8.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c2602b8af3767c285202012822834005f596c811042315fa7e9f5b12b2a43207"
+checksum = "50dae83881bc9b0403dd5b44ea9deed3e939856cc8722d5be37f0d6e5c6d53dd"
 dependencies = [
  "autocfg",
  "bytes",
@@ -5612,6 +5601,12 @@ name = "wasi"
 version = "0.9.0+wasi-snapshot-preview1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
+
+[[package]]
+name = "wasi"
+version = "0.11.0+wasi-snapshot-preview1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
 dependencies = [
  "compiler_builtins",
  "rustc-std-workspace-alloc",
index 277cf0f51d378afa6df85ec3fcbdf4f3a1f16a37..696c003a587ac91b211cd84dd515aa1ebada3a05 100644 (file)
@@ -15,11 +15,7 @@ version = '0.4.0'
 optional = true
 features = ['unprefixed_malloc_on_supported_platforms']
 
-[dependencies.tikv-jemallocator]
-version = '0.4.0'
-optional = true
-
 [features]
-jemalloc = ['tikv-jemalloc-sys', 'tikv-jemallocator']
+jemalloc = ['tikv-jemalloc-sys']
 llvm = ['rustc_driver/llvm']
 max_level_info = ['rustc_driver/max_level_info']
index ed3abbd5b4d3dfce4874811252bc5c2cacfa70e1..8b4a0840df58370e0d655ae089c06d57bc873a25 100644 (file)
@@ -105,12 +105,11 @@ fn with_parent_item_lifetime_defs<T>(
     ) -> T {
         let old_len = self.in_scope_lifetimes.len();
 
-        let parent_generics =
-            match self.owners[parent_hir_id].as_ref().unwrap().node().expect_item().kind {
-                hir::ItemKind::Impl(hir::Impl { ref generics, .. })
-                | hir::ItemKind::Trait(_, _, ref generics, ..) => generics.params,
-                _ => &[],
-            };
+        let parent_generics = match self.owners[parent_hir_id].unwrap().node().expect_item().kind {
+            hir::ItemKind::Impl(hir::Impl { ref generics, .. })
+            | hir::ItemKind::Trait(_, _, ref generics, ..) => generics.params,
+            _ => &[],
+        };
         let lt_def_names = parent_generics.iter().filter_map(|param| match param.kind {
             hir::GenericParamKind::Lifetime { .. } => Some(param.name.normalize_to_macros_2_0()),
             _ => None,
@@ -480,6 +479,12 @@ fn lower_use_tree(
                             .node_id_to_hir_id
                             .insert(new_node_id, hir::HirId::make_owner(new_id));
                         debug_assert!(_old.is_none());
+                        self.owners.ensure_contains_elem(new_id, || hir::MaybeOwner::Phantom);
+                        let _old = std::mem::replace(
+                            &mut self.owners[new_id],
+                            hir::MaybeOwner::NonOwner(hir::HirId::make_owner(new_id)),
+                        );
+                        debug_assert!(matches!(_old, hir::MaybeOwner::Phantom));
                         continue;
                     };
                     let ident = *ident;
index 32cec3a295a4e51aef0c9f4805a9bd6c8587c72e..f21f0b895adb67c012cf6d01cf375d682cbace38 100644 (file)
@@ -98,7 +98,7 @@ struct LoweringContext<'a, 'hir: 'a> {
     arena: &'hir Arena<'hir>,
 
     /// The items being lowered are collected here.
-    owners: IndexVec<LocalDefId, Option<hir::OwnerInfo<'hir>>>,
+    owners: IndexVec<LocalDefId, hir::MaybeOwner<&'hir hir::OwnerInfo<'hir>>>,
     /// Bodies inside the owner being lowered.
     bodies: Vec<(hir::ItemLocalId, &'hir hir::Body<'hir>)>,
     /// Attributes inside the owner being lowered.
@@ -291,7 +291,8 @@ pub fn lower_crate<'a, 'hir>(
 ) -> &'hir hir::Crate<'hir> {
     let _prof_timer = sess.prof.verbose_generic_activity("hir_lowering");
 
-    let owners = IndexVec::from_fn_n(|_| None, resolver.definitions().def_index_count());
+    let owners =
+        IndexVec::from_fn_n(|_| hir::MaybeOwner::Phantom, resolver.definitions().def_index_count());
     LoweringContext {
         sess,
         resolver,
@@ -402,19 +403,6 @@ fn lower_crate(mut self, c: &Crate) -> &'hir hir::Crate<'hir> {
 
         let hir_hash = self.compute_hir_hash();
 
-        let mut def_id_to_hir_id = IndexVec::default();
-
-        for (node_id, hir_id) in self.node_id_to_hir_id.into_iter_enumerated() {
-            if let Some(def_id) = self.resolver.opt_local_def_id(node_id) {
-                if def_id_to_hir_id.len() <= def_id.index() {
-                    def_id_to_hir_id.resize(def_id.index() + 1, None);
-                }
-                def_id_to_hir_id[def_id] = hir_id;
-            }
-        }
-
-        self.resolver.definitions().init_def_id_to_hir_id_mapping(def_id_to_hir_id);
-
         let krate = hir::Crate { owners: self.owners, hir_hash };
         self.arena.alloc(krate)
     }
@@ -427,7 +415,7 @@ fn compute_hir_hash(&mut self) -> Fingerprint {
             .owners
             .iter_enumerated()
             .filter_map(|(def_id, info)| {
-                let info = info.as_ref()?;
+                let info = info.as_owner()?;
                 let def_path_hash = definitions.def_path_hash(def_id);
                 Some((def_path_hash, info))
             })
@@ -469,8 +457,8 @@ fn with_hir_id_owner(
         self.current_hir_id_owner = current_owner;
         self.item_local_id_counter = current_local_counter;
 
-        let _old = self.owners.insert(def_id, info);
-        debug_assert!(_old.is_none());
+        self.owners.ensure_contains_elem(def_id, || hir::MaybeOwner::Phantom);
+        self.owners[def_id] = hir::MaybeOwner::Owner(self.arena.alloc(info));
 
         def_id
     }
@@ -488,6 +476,11 @@ fn make_owner_info(&mut self, node: hir::OwnerNode<'hir>) -> hir::OwnerInfo<'hir
                     None
                 } else {
                     let def_id = self.resolver.opt_local_def_id(node_id)?;
+                    self.owners.ensure_contains_elem(def_id, || hir::MaybeOwner::Phantom);
+                    if let o @ hir::MaybeOwner::Phantom = &mut self.owners[def_id] {
+                        // Do not override a `MaybeOwner::Owner` that may already here.
+                        *o = hir::MaybeOwner::NonOwner(hir_id);
+                    }
                     Some((hir_id.local_id, def_id))
                 }
             })
index 82c40868d18f5c47f14b7364dccb0cda6f850fb8..e1f43cb20dc383672f9cb923cc3739f6e93f7628 100644 (file)
@@ -146,6 +146,22 @@ pub enum Breaks {
     Inconsistent,
 }
 
+#[derive(Clone, Copy)]
+enum IndentStyle {
+    /// Vertically aligned under whatever column this block begins at.
+    ///
+    ///     fn demo(arg1: usize,
+    ///             arg2: usize);
+    Visual,
+    /// Indented relative to the indentation level of the previous line.
+    ///
+    ///     fn demo(
+    ///         arg1: usize,
+    ///         arg2: usize,
+    ///     );
+    Block { offset: isize },
+}
+
 #[derive(Clone, Copy)]
 pub struct BreakToken {
     offset: isize,
@@ -154,7 +170,7 @@ pub struct BreakToken {
 
 #[derive(Clone, Copy)]
 pub struct BeginToken {
-    offset: isize,
+    indent: IndentStyle,
     breaks: Breaks,
 }
 
@@ -178,7 +194,7 @@ pub fn is_hardbreak_tok(&self) -> bool {
 #[derive(Copy, Clone)]
 enum PrintFrame {
     Fits,
-    Broken { offset: isize, breaks: Breaks },
+    Broken { indent: usize, breaks: Breaks },
 }
 
 const SIZE_INFINITY: isize = 0xffff;
@@ -204,6 +220,8 @@ pub struct Printer {
     scan_stack: VecDeque<usize>,
     /// Stack of blocks-in-progress being flushed by print
     print_stack: Vec<PrintFrame>,
+    /// Level of indentation of current line
+    indent: usize,
     /// Buffered indentation to avoid writing trailing whitespace
     pending_indentation: isize,
     /// The token most recently popped from the left boundary of the
@@ -229,6 +247,7 @@ pub fn new() -> Self {
             right_total: 0,
             scan_stack: VecDeque::new(),
             print_stack: Vec::new(),
+            indent: 0,
             pending_indentation: 0,
             last_printed: None,
         }
@@ -368,38 +387,41 @@ fn get_top(&self) -> PrintFrame {
         *self
             .print_stack
             .last()
-            .unwrap_or(&PrintFrame::Broken { offset: 0, breaks: Breaks::Inconsistent })
+            .unwrap_or(&PrintFrame::Broken { indent: 0, breaks: Breaks::Inconsistent })
     }
 
     fn print_begin(&mut self, token: BeginToken, size: isize) {
         if size > self.space {
-            let col = self.margin - self.space + token.offset;
-            self.print_stack.push(PrintFrame::Broken { offset: col, breaks: token.breaks });
+            self.print_stack.push(PrintFrame::Broken { indent: self.indent, breaks: token.breaks });
+            self.indent = match token.indent {
+                IndentStyle::Block { offset } => (self.indent as isize + offset) as usize,
+                IndentStyle::Visual => (self.margin - self.space) as usize,
+            };
         } else {
             self.print_stack.push(PrintFrame::Fits);
         }
     }
 
     fn print_end(&mut self) {
-        self.print_stack.pop().unwrap();
+        if let PrintFrame::Broken { indent, .. } = self.print_stack.pop().unwrap() {
+            self.indent = indent;
+        }
     }
 
     fn print_break(&mut self, token: BreakToken, size: isize) {
-        let break_offset =
-            match self.get_top() {
-                PrintFrame::Fits => None,
-                PrintFrame::Broken { offset, breaks: Breaks::Consistent } => Some(offset),
-                PrintFrame::Broken { offset, breaks: Breaks::Inconsistent } => {
-                    if size > self.space { Some(offset) } else { None }
-                }
-            };
-        if let Some(offset) = break_offset {
-            self.out.push('\n');
-            self.pending_indentation = offset + token.offset;
-            self.space = self.margin - (offset + token.offset);
-        } else {
+        let fits = match self.get_top() {
+            PrintFrame::Fits => true,
+            PrintFrame::Broken { breaks: Breaks::Consistent, .. } => false,
+            PrintFrame::Broken { breaks: Breaks::Inconsistent, .. } => size <= self.space,
+        };
+        if fits {
             self.pending_indentation += token.blank_space;
             self.space -= token.blank_space;
+        } else {
+            self.out.push('\n');
+            let indent = self.indent as isize + token.offset;
+            self.pending_indentation = indent;
+            self.space = self.margin - indent;
         }
     }
 
@@ -422,7 +444,10 @@ fn print_string(&mut self, string: &str) {
 
     /// "raw box"
     pub fn rbox(&mut self, indent: usize, breaks: Breaks) {
-        self.scan_begin(BeginToken { offset: indent as isize, breaks })
+        self.scan_begin(BeginToken {
+            indent: IndentStyle::Block { offset: indent as isize },
+            breaks,
+        })
     }
 
     /// Inconsistent breaking box
@@ -435,6 +460,10 @@ pub fn cbox(&mut self, indent: usize) {
         self.rbox(indent, Breaks::Consistent)
     }
 
+    pub fn visual_align(&mut self) {
+        self.scan_begin(BeginToken { indent: IndentStyle::Visual, breaks: Breaks::Consistent });
+    }
+
     pub fn break_offset(&mut self, n: usize, off: isize) {
         self.scan_break(BreakToken { offset: off, blank_space: n as isize })
     }
@@ -457,7 +486,7 @@ fn spaces(&mut self, n: usize) {
         self.break_offset(n, 0)
     }
 
-    crate fn zerobreak(&mut self) {
+    pub fn zerobreak(&mut self) {
         self.spaces(0)
     }
 
index 96dbd3dca156eaaf7d1c17b1661e6aee152f95a2..b575dc21961337b0976f5ae4c0d06deabc33988b 100644 (file)
@@ -315,7 +315,7 @@ fn print_comment(&mut self, cmnt: &Comment) {
                     self.word(cmnt.lines[0].clone());
                     self.hardbreak()
                 } else {
-                    self.ibox(0);
+                    self.visual_align();
                     for line in &cmnt.lines {
                         if !line.is_empty() {
                             self.word(line.clone());
@@ -655,7 +655,7 @@ fn head<S: Into<Cow<'static, str>>>(&mut self, w: S) {
         // Outer-box is consistent.
         self.cbox(INDENT_UNIT);
         // Head-box is inconsistent.
-        self.ibox(w.len() + 1);
+        self.ibox(0);
         // Keyword that starts the head.
         if !w.is_empty() {
             self.word_nbsp(w);
index 956200d60f5078940b1c7bc2188793ba61580397..6a5bba30b8bca8b1ef0a0ad8faf5703d321a8ec3 100644 (file)
@@ -320,7 +320,9 @@ pub(super) fn print_expr_outer_attr_style(&mut self, expr: &ast::Expr, is_inline
                     self.print_ident(label.ident);
                     self.word_space(":");
                 }
-                self.head("while");
+                self.cbox(0);
+                self.ibox(0);
+                self.word_nbsp("while");
                 self.print_expr_as_cond(test);
                 self.space();
                 self.print_block_with_attrs(blk, attrs);
@@ -330,7 +332,9 @@ pub(super) fn print_expr_outer_attr_style(&mut self, expr: &ast::Expr, is_inline
                     self.print_ident(label.ident);
                     self.word_space(":");
                 }
-                self.head("for");
+                self.cbox(0);
+                self.ibox(0);
+                self.word_nbsp("for");
                 self.print_pat(pat);
                 self.space();
                 self.word_space("in");
@@ -343,12 +347,14 @@ pub(super) fn print_expr_outer_attr_style(&mut self, expr: &ast::Expr, is_inline
                     self.print_ident(label.ident);
                     self.word_space(":");
                 }
-                self.head("loop");
+                self.cbox(0);
+                self.ibox(0);
+                self.word_nbsp("loop");
                 self.print_block_with_attrs(blk, attrs);
             }
             ast::ExprKind::Match(ref expr, ref arms) => {
-                self.cbox(INDENT_UNIT);
-                self.ibox(INDENT_UNIT);
+                self.cbox(0);
+                self.ibox(0);
                 self.word_nbsp("match");
                 self.print_expr_as_cond(expr);
                 self.space();
@@ -388,7 +394,7 @@ pub(super) fn print_expr_outer_attr_style(&mut self, expr: &ast::Expr, is_inline
                     self.word_space(":");
                 }
                 // containing cbox, will be closed by print-block at }
-                self.cbox(INDENT_UNIT);
+                self.cbox(0);
                 // head-box, will be closed by print-block after {
                 self.ibox(0);
                 self.print_block_with_attrs(blk, attrs);
@@ -397,7 +403,7 @@ pub(super) fn print_expr_outer_attr_style(&mut self, expr: &ast::Expr, is_inline
                 self.word_nbsp("async");
                 self.print_capture_clause(capture_clause);
                 // cbox/ibox in analogy to the `ExprKind::Block` arm above
-                self.cbox(INDENT_UNIT);
+                self.cbox(0);
                 self.ibox(0);
                 self.print_block_with_attrs(blk, attrs);
             }
@@ -500,7 +506,9 @@ pub(super) fn print_expr_outer_attr_style(&mut self, expr: &ast::Expr, is_inline
                 self.word("?")
             }
             ast::ExprKind::TryBlock(ref blk) => {
-                self.head("try");
+                self.cbox(0);
+                self.ibox(0);
+                self.word_nbsp("try");
                 self.print_block_with_attrs(blk, attrs)
             }
             ast::ExprKind::Err => {
index e575d6aa7e2fcf446cf2afecb81a0668aa564768..dac84ae9d5fc87fcbf4fda40a9f247d88e29bd5e 100644 (file)
@@ -1,5 +1,5 @@
 use crate::pp::Breaks::Inconsistent;
-use crate::pprust::state::{AnnNode, PrintState, State, INDENT_UNIT};
+use crate::pprust::state::{AnnNode, PrintState, State};
 
 use rustc_ast as ast;
 use rustc_ast::GenericBound;
@@ -377,7 +377,7 @@ fn print_variants(&mut self, variants: &[ast::Variant], span: rustc_span::Span)
             self.space_if_not_bol();
             self.maybe_print_comment(v.span.lo());
             self.print_outer_attributes(&v.attrs);
-            self.ibox(INDENT_UNIT);
+            self.ibox(0);
             self.print_variant(v);
             self.word(",");
             self.end();
index d1393528d1ce8ae94f64db383957351becffdbcc..aaa6580acc6f08543d8895009306d3fc29229f32 100644 (file)
@@ -4,6 +4,7 @@
 use rustc_ast as ast;
 use rustc_ast::ptr::P;
 use rustc_ast::tokenstream::TokenStream;
+use rustc_ast::visit::{self, Visitor};
 use rustc_ast::{token, BlockCheckMode, UnsafeSource};
 use rustc_data_structures::fx::{FxHashMap, FxHashSet};
 use rustc_errors::{pluralize, Applicability, DiagnosticBuilder};
@@ -788,23 +789,37 @@ fn into_expr(self) -> P<ast::Expr> {
         // the order provided to fmt::Arguments. When arguments are repeated, we
         // want the expression evaluated only once.
         //
-        // Thus in the not nicely ordered case we emit the following instead:
+        // Further, if any arg _after the first one_ contains a yield point such
+        // as `await` or `yield`, the above short form is inconvenient for the
+        // caller because it would keep a temporary of type ArgumentV1 alive
+        // across the yield point. ArgumentV1 can't implement Send since it
+        // holds a type-erased arbitrary type.
+        //
+        // Thus in the not nicely ordered case, and in the yielding case, we
+        // emit the following instead:
         //
         //     match (&$arg0, &$arg1, â€¦) {
-        //         _args => [ArgumentV1::new(_args.$i, â€¦), ArgumentV1::new(_args.$j, â€¦), â€¦]
+        //         args => [ArgumentV1::new(args.$i, â€¦), ArgumentV1::new(args.$j, â€¦), â€¦]
         //     }
         //
         // for the sequence of indices $i, $j, â€¦ governed by fmt_arg_index_and_ty.
+        // This more verbose representation ensures that all arguments are
+        // evaluated a single time each, in the order written by the programmer,
+        // and that the surrounding future/generator (if any) is Send whenever
+        // possible.
+        let no_need_for_match =
+            nicely_ordered && !original_args.iter().skip(1).any(|e| may_contain_yield_point(e));
+
         for (arg_index, arg_ty) in fmt_arg_index_and_ty {
             let e = &mut original_args[arg_index];
             let span = e.span;
-            let arg = if nicely_ordered {
+            let arg = if no_need_for_match {
                 let expansion_span = e.span.with_ctxt(self.macsp.ctxt());
                 // The indices are strictly ordered so e has not been taken yet.
                 self.ecx.expr_addr_of(expansion_span, P(e.take()))
             } else {
                 let def_site = self.ecx.with_def_site_ctxt(span);
-                let args_tuple = self.ecx.expr_ident(def_site, Ident::new(sym::_args, def_site));
+                let args_tuple = self.ecx.expr_ident(def_site, Ident::new(sym::args, def_site));
                 let member = Ident::new(sym::integer(arg_index), def_site);
                 self.ecx.expr(def_site, ast::ExprKind::Field(args_tuple, member))
             };
@@ -814,10 +829,10 @@ fn into_expr(self) -> P<ast::Expr> {
         let args_array = self.ecx.expr_vec(self.macsp, fmt_args);
         let args_slice = self.ecx.expr_addr_of(
             self.macsp,
-            if nicely_ordered {
+            if no_need_for_match {
                 args_array
             } else {
-                // In the !nicely_ordered case, none of the exprs were moved
+                // In the !no_need_for_match case, none of the exprs were moved
                 // away in the previous loop.
                 //
                 // This uses the arg span for `&arg` so that borrowck errors
@@ -828,7 +843,7 @@ fn into_expr(self) -> P<ast::Expr> {
                     .map(|e| self.ecx.expr_addr_of(e.span.with_ctxt(self.macsp.ctxt()), e))
                     .collect();
 
-                let pat = self.ecx.pat_ident(self.macsp, Ident::new(sym::_args, self.macsp));
+                let pat = self.ecx.pat_ident(self.macsp, Ident::new(sym::args, self.macsp));
                 let arm = self.ecx.arm(self.macsp, pat, args_array);
                 let head = self.ecx.expr(self.macsp, ast::ExprKind::Tup(heads));
                 self.ecx.expr_match(self.macsp, head, vec![arm])
@@ -877,11 +892,21 @@ fn format_arg(
                 return ecx.expr_call_global(macsp, path, vec![arg]);
             }
         };
+        let new_fn_name = match trait_ {
+            "Display" => "new_display",
+            "Debug" => "new_debug",
+            "LowerExp" => "new_lower_exp",
+            "UpperExp" => "new_upper_exp",
+            "Octal" => "new_octal",
+            "Pointer" => "new_pointer",
+            "Binary" => "new_binary",
+            "LowerHex" => "new_lower_hex",
+            "UpperHex" => "new_upper_hex",
+            _ => unreachable!(),
+        };
 
-        let path = ecx.std_path(&[sym::fmt, Symbol::intern(trait_), sym::fmt]);
-        let format_fn = ecx.path_global(sp, path);
-        let path = ecx.std_path(&[sym::fmt, sym::ArgumentV1, sym::new]);
-        ecx.expr_call_global(macsp, path, vec![arg, ecx.expr_path(format_fn)])
+        let path = ecx.std_path(&[sym::fmt, sym::ArgumentV1, Symbol::intern(new_fn_name)]);
+        ecx.expr_call_global(sp, path, vec![arg])
     }
 }
 
@@ -1216,3 +1241,35 @@ macro_rules! check_foreign {
 
     cx.into_expr()
 }
+
+fn may_contain_yield_point(e: &ast::Expr) -> bool {
+    struct MayContainYieldPoint(bool);
+
+    impl Visitor<'_> for MayContainYieldPoint {
+        fn visit_expr(&mut self, e: &ast::Expr) {
+            if let ast::ExprKind::Await(_) | ast::ExprKind::Yield(_) = e.kind {
+                self.0 = true;
+            } else {
+                visit::walk_expr(self, e);
+            }
+        }
+
+        fn visit_mac_call(&mut self, _: &ast::MacCall) {
+            self.0 = true;
+        }
+
+        fn visit_attribute(&mut self, _: &ast::Attribute) {
+            // Conservatively assume this may be a proc macro attribute in
+            // expression position.
+            self.0 = true;
+        }
+
+        fn visit_item(&mut self, _: &ast::Item) {
+            // Do not recurse into nested items.
+        }
+    }
+
+    let mut visitor = MayContainYieldPoint(false);
+    visitor.visit_expr(e);
+    visitor.0
+}
index 379c88bbd40fac448316953c2f5047c03b46e8f3..ffb77e16a14863c505b199efdf2acdb02e9118a8 100644 (file)
@@ -1256,7 +1256,11 @@ fn insert_value(&mut self, aggregate_value: RValue<'gcc>, value: RValue<'gcc>, i
         aggregate_value
     }
 
-    fn landing_pad(&mut self, _ty: Type<'gcc>, _pers_fn: RValue<'gcc>, _num_clauses: usize) -> RValue<'gcc> {
+    fn set_personality_fn(&mut self, _personality: RValue<'gcc>) {
+        // TODO(antoyo)
+    }
+
+    fn cleanup_landing_pad(&mut self, _ty: Type<'gcc>, _pers_fn: RValue<'gcc>) -> RValue<'gcc> {
         let field1 = self.context.new_field(None, self.u8_type, "landing_pad_field_1");
         let field2 = self.context.new_field(None, self.i32_type, "landing_pad_field_1");
         let struct_type = self.context.new_struct_type(None, "landing_pad", &[field1, field2]);
@@ -1267,11 +1271,7 @@ fn landing_pad(&mut self, _ty: Type<'gcc>, _pers_fn: RValue<'gcc>, _num_clauses:
         // rustc_codegen_ssa now calls the unwinding builder methods even on panic=abort.
     }
 
-    fn set_cleanup(&mut self, _landing_pad: RValue<'gcc>) {
-        // TODO(antoyo)
-    }
-
-    fn resume(&mut self, _exn: RValue<'gcc>) -> RValue<'gcc> {
+    fn resume(&mut self, _exn: RValue<'gcc>) {
         unimplemented!();
     }
 
@@ -1279,7 +1279,7 @@ fn cleanup_pad(&mut self, _parent: Option<RValue<'gcc>>, _args: &[RValue<'gcc>])
         unimplemented!();
     }
 
-    fn cleanup_ret(&mut self, _funclet: &Funclet, _unwind: Option<Block<'gcc>>) -> RValue<'gcc> {
+    fn cleanup_ret(&mut self, _funclet: &Funclet, _unwind: Option<Block<'gcc>>) {
         unimplemented!();
     }
 
@@ -1287,18 +1287,15 @@ fn catch_pad(&mut self, _parent: RValue<'gcc>, _args: &[RValue<'gcc>]) -> Funcle
         unimplemented!();
     }
 
-    fn catch_switch(&mut self, _parent: Option<RValue<'gcc>>, _unwind: Option<Block<'gcc>>, _num_handlers: usize) -> RValue<'gcc> {
+    fn catch_switch(
+        &mut self,
+        _parent: Option<RValue<'gcc>>,
+        _unwind: Option<Block<'gcc>>,
+        _handlers: &[Block<'gcc>],
+    ) -> RValue<'gcc> {
         unimplemented!();
     }
 
-    fn add_handler(&mut self, _catch_switch: RValue<'gcc>, _handler: Block<'gcc>) {
-        unimplemented!();
-    }
-
-    fn set_personality_fn(&mut self, _personality: RValue<'gcc>) {
-        // TODO(antoyo)
-    }
-
     // Atomic Operations
     fn atomic_cmpxchg(&mut self, dst: RValue<'gcc>, cmp: RValue<'gcc>, src: RValue<'gcc>, order: AtomicOrdering, failure_order: AtomicOrdering, weak: bool) -> RValue<'gcc> {
         let expected = self.current_func().new_local(None, cmp.get_type(), "expected");
index 8a9450c20dda4c1727bfa1af201ff190d11344b6..c9a04e6280f4092d4537ffec4e535a12ffafa805 100644 (file)
@@ -956,29 +956,24 @@ fn insert_value(&mut self, agg_val: &'ll Value, elt: &'ll Value, idx: u64) -> &'
         unsafe { llvm::LLVMBuildInsertValue(self.llbuilder, agg_val, elt, idx as c_uint, UNNAMED) }
     }
 
-    fn landing_pad(
-        &mut self,
-        ty: &'ll Type,
-        pers_fn: &'ll Value,
-        num_clauses: usize,
-    ) -> &'ll Value {
-        // Use LLVMSetPersonalityFn to set the personality. It supports arbitrary Consts while,
-        // LLVMBuildLandingPad requires the argument to be a Function (as of LLVM 12). The
-        // personality lives on the parent function anyway.
-        self.set_personality_fn(pers_fn);
+    fn set_personality_fn(&mut self, personality: &'ll Value) {
         unsafe {
-            llvm::LLVMBuildLandingPad(self.llbuilder, ty, None, num_clauses as c_uint, UNNAMED)
+            llvm::LLVMSetPersonalityFn(self.llfn(), personality);
         }
     }
 
-    fn set_cleanup(&mut self, landing_pad: &'ll Value) {
+    fn cleanup_landing_pad(&mut self, ty: &'ll Type, pers_fn: &'ll Value) -> &'ll Value {
+        let landing_pad = self.landing_pad(ty, pers_fn, 1 /* FIXME should this be 0? */);
         unsafe {
             llvm::LLVMSetCleanup(landing_pad, llvm::True);
         }
+        landing_pad
     }
 
-    fn resume(&mut self, exn: &'ll Value) -> &'ll Value {
-        unsafe { llvm::LLVMBuildResume(self.llbuilder, exn) }
+    fn resume(&mut self, exn: &'ll Value) {
+        unsafe {
+            llvm::LLVMBuildResume(self.llbuilder, exn);
+        }
     }
 
     fn cleanup_pad(&mut self, parent: Option<&'ll Value>, args: &[&'ll Value]) -> Funclet<'ll> {
@@ -995,14 +990,11 @@ fn cleanup_pad(&mut self, parent: Option<&'ll Value>, args: &[&'ll Value]) -> Fu
         Funclet::new(ret.expect("LLVM does not have support for cleanuppad"))
     }
 
-    fn cleanup_ret(
-        &mut self,
-        funclet: &Funclet<'ll>,
-        unwind: Option<&'ll BasicBlock>,
-    ) -> &'ll Value {
-        let ret =
-            unsafe { llvm::LLVMRustBuildCleanupRet(self.llbuilder, funclet.cleanuppad(), unwind) };
-        ret.expect("LLVM does not have support for cleanupret")
+    fn cleanup_ret(&mut self, funclet: &Funclet<'ll>, unwind: Option<&'ll BasicBlock>) {
+        unsafe {
+            llvm::LLVMRustBuildCleanupRet(self.llbuilder, funclet.cleanuppad(), unwind)
+                .expect("LLVM does not have support for cleanupret");
+        }
     }
 
     fn catch_pad(&mut self, parent: &'ll Value, args: &[&'ll Value]) -> Funclet<'ll> {
@@ -1023,7 +1015,7 @@ fn catch_switch(
         &mut self,
         parent: Option<&'ll Value>,
         unwind: Option<&'ll BasicBlock>,
-        num_handlers: usize,
+        handlers: &[&'ll BasicBlock],
     ) -> &'ll Value {
         let name = cstr!("catchswitch");
         let ret = unsafe {
@@ -1031,23 +1023,17 @@ fn catch_switch(
                 self.llbuilder,
                 parent,
                 unwind,
-                num_handlers as c_uint,
+                handlers.len() as c_uint,
                 name.as_ptr(),
             )
         };
-        ret.expect("LLVM does not have support for catchswitch")
-    }
-
-    fn add_handler(&mut self, catch_switch: &'ll Value, handler: &'ll BasicBlock) {
-        unsafe {
-            llvm::LLVMRustAddHandler(catch_switch, handler);
-        }
-    }
-
-    fn set_personality_fn(&mut self, personality: &'ll Value) {
-        unsafe {
-            llvm::LLVMSetPersonalityFn(self.llfn(), personality);
+        let ret = ret.expect("LLVM does not have support for catchswitch");
+        for handler in handlers {
+            unsafe {
+                llvm::LLVMRustAddHandler(ret, handler);
+            }
         }
+        ret
     }
 
     // Atomic Operations
@@ -1478,4 +1464,19 @@ fn fptoint_sat(
             None
         }
     }
+
+    pub(crate) fn landing_pad(
+        &mut self,
+        ty: &'ll Type,
+        pers_fn: &'ll Value,
+        num_clauses: usize,
+    ) -> &'ll Value {
+        // Use LLVMSetPersonalityFn to set the personality. It supports arbitrary Consts while,
+        // LLVMBuildLandingPad requires the argument to be a Function (as of LLVM 12). The
+        // personality lives on the parent function anyway.
+        self.set_personality_fn(pers_fn);
+        unsafe {
+            llvm::LLVMBuildLandingPad(self.llbuilder, ty, None, num_clauses as c_uint, UNNAMED)
+        }
+    }
 }
index 5adfa18035a0e2efbd53c159723c9fb52327a39d..f51d014bfb39a97f2af4c07efccff68fe5771af8 100644 (file)
@@ -525,9 +525,8 @@ fn codegen_msvc_try<'ll>(
 
         normal.ret(bx.const_i32(0));
 
-        let cs = catchswitch.catch_switch(None, None, 2);
-        catchswitch.add_handler(cs, catchpad_rust.llbb());
-        catchswitch.add_handler(cs, catchpad_foreign.llbb());
+        let cs =
+            catchswitch.catch_switch(None, None, &[catchpad_rust.llbb(), catchpad_foreign.llbb()]);
 
         // We can't use the TypeDescriptor defined in libpanic_unwind because it
         // might be in another DLL and the SEH encoding only supports specifying
index ec9fc22bc4d053739f942d3da6a96164f4ba38b3..7a13e424f9aca31be604fbbc44f522c2f4b302db 100644 (file)
@@ -932,7 +932,7 @@ fn is_illegal_instruction(_status: &ExitStatus) -> bool {
                      but `link.exe` was not found",
                 );
                 sess.note_without_error(
-                    "please ensure that VS 2013, VS 2015, VS 2017 or VS 2019 \
+                    "please ensure that VS 2013, VS 2015, VS 2017, VS 2019 or VS 2022 \
                      was installed with the Visual C++ option",
                 );
             }
index b1a76b80002db8486ee6a7f3c09d18f8975b750b..4c7a09ca1e94b2ede7ff45f957aaf240552c3a8e 100644 (file)
@@ -1346,8 +1346,7 @@ fn landing_pad_for_uncached(&mut self, bb: mir::BasicBlock) -> Bx::BasicBlock {
                     let mut cp_bx = self.new_block(&format!("cp_funclet{:?}", bb));
                     ret_llbb = cs_bx.llbb();
 
-                    let cs = cs_bx.catch_switch(None, None, 1);
-                    cs_bx.add_handler(cs, cp_bx.llbb());
+                    let cs = cs_bx.catch_switch(None, None, &[cp_bx.llbb()]);
 
                     // The "null" here is actually a RTTI type descriptor for the
                     // C++ personality function, but `catch (...)` has no type so
@@ -1374,8 +1373,7 @@ fn landing_pad_for_uncached(&mut self, bb: mir::BasicBlock) -> Bx::BasicBlock {
 
             let llpersonality = self.cx.eh_personality();
             let llretty = self.landing_pad_type();
-            let lp = bx.landing_pad(llretty, llpersonality, 1);
-            bx.set_cleanup(lp);
+            let lp = bx.cleanup_landing_pad(llretty, llpersonality);
 
             let slot = self.get_personality_slot(&mut bx);
             slot.storage_live(&mut bx);
index 3657f80c2de80072298c508be2ebce7141ac1c70..c654232c10a5755c8bf3aa8383d36509f27e5d9a 100644 (file)
@@ -369,6 +369,16 @@ pub fn codegen_intrinsic_call(
                 }
             }
 
+            sym::const_allocate => {
+                // returns a null pointer at runtime.
+                bx.const_null(bx.type_i8p())
+            }
+
+            sym::const_deallocate => {
+                // nop at runtime.
+                return;
+            }
+
             // This requires that atomic intrinsics follow a specific naming pattern:
             // "atomic_<operation>[_<ordering>]", and no ordering means SeqCst
             name if name_str.starts_with("atomic_") => {
index 5a06fb4610587963b923e46be227a4e85fc61499..53fb21b269a12f46a3696388ff69324d1f773132 100644 (file)
@@ -421,29 +421,22 @@ fn select(
     fn extract_value(&mut self, agg_val: Self::Value, idx: u64) -> Self::Value;
     fn insert_value(&mut self, agg_val: Self::Value, elt: Self::Value, idx: u64) -> Self::Value;
 
-    fn landing_pad(
-        &mut self,
-        ty: Self::Type,
-        pers_fn: Self::Value,
-        num_clauses: usize,
-    ) -> Self::Value;
-    fn set_cleanup(&mut self, landing_pad: Self::Value);
-    fn resume(&mut self, exn: Self::Value) -> Self::Value;
+    fn set_personality_fn(&mut self, personality: Self::Value);
+
+    // These are used by everyone except msvc
+    fn cleanup_landing_pad(&mut self, ty: Self::Type, pers_fn: Self::Value) -> Self::Value;
+    fn resume(&mut self, exn: Self::Value);
+
+    // These are used only by msvc
     fn cleanup_pad(&mut self, parent: Option<Self::Value>, args: &[Self::Value]) -> Self::Funclet;
-    fn cleanup_ret(
-        &mut self,
-        funclet: &Self::Funclet,
-        unwind: Option<Self::BasicBlock>,
-    ) -> Self::Value;
+    fn cleanup_ret(&mut self, funclet: &Self::Funclet, unwind: Option<Self::BasicBlock>);
     fn catch_pad(&mut self, parent: Self::Value, args: &[Self::Value]) -> Self::Funclet;
     fn catch_switch(
         &mut self,
         parent: Option<Self::Value>,
         unwind: Option<Self::BasicBlock>,
-        num_handlers: usize,
+        handlers: &[Self::BasicBlock],
     ) -> Self::Value;
-    fn add_handler(&mut self, catch_switch: Self::Value, handler: Self::BasicBlock);
-    fn set_personality_fn(&mut self, personality: Self::Value);
 
     fn atomic_cmpxchg(
         &mut self,
index 3ec9f3ca3b8c2172277ca75f3758670855df9bd3..9dc34260de76697047c831da46ec30ec24d6ca40 100644 (file)
@@ -7,7 +7,6 @@
 };
 
 use rustc_errors::ErrorReported;
-use rustc_hir as hir;
 use rustc_hir::def::DefKind;
 use rustc_middle::mir;
 use rustc_middle::mir::interpret::ErrorHandled;
@@ -216,7 +215,7 @@ pub fn eval_to_const_value_raw_provider<'tcx>(
     tcx: TyCtxt<'tcx>,
     key: ty::ParamEnvAnd<'tcx, GlobalId<'tcx>>,
 ) -> ::rustc_middle::mir::interpret::EvalToConstValueResult<'tcx> {
-    assert!(key.param_env.constness() == hir::Constness::Const);
+    assert!(key.param_env.is_const());
     // see comment in eval_to_allocation_raw_provider for what we're doing here
     if key.param_env.reveal() == Reveal::All {
         let mut key = key;
@@ -251,7 +250,7 @@ pub fn eval_to_allocation_raw_provider<'tcx>(
     tcx: TyCtxt<'tcx>,
     key: ty::ParamEnvAnd<'tcx, GlobalId<'tcx>>,
 ) -> ::rustc_middle::mir::interpret::EvalToAllocationRawResult<'tcx> {
-    assert!(key.param_env.constness() == hir::Constness::Const);
+    assert!(key.param_env.is_const());
     // Because the constant is computed twice (once per value of `Reveal`), we are at risk of
     // reporting the same error twice here. To resolve this, we check whether we can evaluate the
     // constant in the more restrictive `Reveal::UserFacing`, which most likely already was
index 30e9cbe4403549223410a44981096cc3d875532e..89717b75f12815abea8069f2d36d695b7ff3b205 100644 (file)
@@ -347,6 +347,33 @@ fn call_intrinsic(
                 )?;
                 ecx.write_pointer(ptr, dest)?;
             }
+            sym::const_deallocate => {
+                let ptr = ecx.read_pointer(&args[0])?;
+                let size = ecx.read_scalar(&args[1])?.to_machine_usize(ecx)?;
+                let align = ecx.read_scalar(&args[2])?.to_machine_usize(ecx)?;
+
+                let size = Size::from_bytes(size);
+                let align = match Align::from_bytes(align) {
+                    Ok(a) => a,
+                    Err(err) => throw_ub_format!("align has to be a power of 2, {}", err),
+                };
+
+                // If an allocation is created in an another const,
+                // we don't deallocate it.
+                let (alloc_id, _, _) = ecx.memory.ptr_get_alloc(ptr)?;
+                let is_allocated_in_another_const = matches!(
+                    ecx.tcx.get_global_alloc(alloc_id),
+                    Some(interpret::GlobalAlloc::Memory(_))
+                );
+
+                if !is_allocated_in_another_const {
+                    ecx.memory.deallocate(
+                        ptr,
+                        Some((size, align)),
+                        interpret::MemoryKind::Machine(MemoryKind::Heap),
+                    )?;
+                }
+            }
             _ => {
                 return Err(ConstEvalErrKind::NeedsRfc(format!(
                     "calling intrinsic `{}`",
index d4b12d00f1ff6d8f231bccb6bf819fac9e563683..c401f65eddaedde02a099bc37ac22533871b9e0d 100644 (file)
 E0769: include_str!("./error_codes/E0769.md"),
 E0770: include_str!("./error_codes/E0770.md"),
 E0771: include_str!("./error_codes/E0771.md"),
+E0772: include_str!("./error_codes/E0772.md"),
 E0773: include_str!("./error_codes/E0773.md"),
 E0774: include_str!("./error_codes/E0774.md"),
 E0775: include_str!("./error_codes/E0775.md"),
 //  E0723, // unstable feature in `const` context
     E0726, // non-explicit (not `'_`) elided lifetime in unsupported position
 //  E0738, // Removed; errored on `#[track_caller] fn`s in `extern "Rust" { ... }`.
-    E0772, // `'static' obligation coming from `impl dyn Trait {}` or `impl Foo for dyn Bar {}`.
 }
diff --git a/compiler/rustc_error_codes/src/error_codes/E0772.md b/compiler/rustc_error_codes/src/error_codes/E0772.md
new file mode 100644 (file)
index 0000000..262e523
--- /dev/null
@@ -0,0 +1,89 @@
+A trait object has some specific lifetime `'1`, but it was used in a way that
+requires it to have a `'static` lifetime.
+
+Example of erroneous code:
+
+```compile_fail,E0772
+trait BooleanLike {}
+trait Person {}
+
+impl BooleanLike for bool {}
+
+impl dyn Person {
+    fn is_cool(&self) -> bool {
+        // hey you, you're pretty cool
+        true
+    }
+}
+
+fn get_is_cool<'p>(person: &'p dyn Person) -> impl BooleanLike {
+    // error: `person` has an anonymous lifetime `'p` but calling
+    //        `print_cool_fn` introduces an implicit `'static` lifetime
+    //        requirement
+    person.is_cool()
+}
+```
+
+The trait object `person` in the function `get_is_cool`, while already being
+behind a reference with lifetime `'p`, also has it's own implicit lifetime,
+`'2`.
+
+Lifetime `'2` represents the data the trait object might hold inside, for
+example:
+
+```
+trait MyTrait {}
+
+struct MyStruct<'a>(&'a i32);
+
+impl<'a> MyTrait for MyStruct<'a> {}
+```
+
+With this scenario, if a trait object of `dyn MyTrait + '2` was made from
+`MyStruct<'a>`, `'a` must live as long, if not longer than `'2`. This allows the
+trait object's internal data to be accessed safely from any trait methods. This
+rule also goes for any lifetime any struct made into a trait object may have.
+
+In the implementation for `dyn Person`, the `'2` lifetime representing the
+internal data was ommitted, meaning that the compiler inferred the lifetime
+`'static`. As a result, the implementation's `is_cool` is inferred by the
+compiler to look like this:
+
+```
+# trait Person {}
+#
+# impl dyn Person {
+fn is_cool<'a>(self: &'a (dyn Person + 'static)) -> bool {unimplemented!()}
+# }
+```
+
+While the `get_is_cool` function is inferred to look like this:
+
+```
+# trait Person {}
+# trait BooleanLike {}
+#
+fn get_is_cool<'p, R: BooleanLike>(person: &'p (dyn Person + 'p)) -> R {
+    unimplemented!()
+}
+```
+
+Which brings us to the core of the problem; the assignment of type
+`&'_ (dyn Person + '_)` to type `&'_ (dyn Person + 'static)` is impossible.
+
+Fixing it is as simple as being generic over lifetime `'2`, as to prevent the
+compiler from inferring it as `'static`:
+
+```
+# trait Person {}
+#
+impl<'d> dyn Person + 'd {/* ... */}
+
+// This works too, and is more elegant:
+//impl dyn Person + '_ {/* ... */}
+```
+
+See the [Rust Reference on Trait Object Lifetime Bounds][trait-objects] for
+more information on trait object lifetimes.
+
+[trait-object-lifetime-bounds]: https://doc.rust-lang.org/reference/types/trait-object.html#trait-object-lifetime-bounds
index 5599c1df6d9de3c0011d353075a39d8b4f252412..dfc07da91698285d3343333427387133c81f8151 100644 (file)
@@ -2,7 +2,6 @@
 #![feature(associated_type_defaults)]
 #![feature(crate_visibility_modifier)]
 #![feature(decl_macro)]
-#![cfg_attr(bootstrap, feature(destructuring_assignment))]
 #![feature(if_let_guard)]
 #![feature(let_else)]
 #![feature(proc_macro_diagnostic)]
index 74d6b05ca5fc5bf3963c89cf190ad3556b1ce093..d655f12f5e1d1989ea430226f121b83a18f8214b 100644 (file)
@@ -7,7 +7,6 @@
 pub use crate::def_id::DefPathHash;
 use crate::def_id::{CrateNum, DefIndex, LocalDefId, StableCrateId, CRATE_DEF_INDEX, LOCAL_CRATE};
 use crate::def_path_hash_map::DefPathHashMap;
-use crate::hir;
 
 use rustc_data_structures::fx::FxHashMap;
 use rustc_data_structures::stable_hasher::StableHasher;
@@ -101,13 +100,6 @@ pub fn enumerated_keys_and_path_hashes(
 pub struct Definitions {
     table: DefPathTable,
 
-    /// Only [`LocalDefId`]s for items and item-like are HIR owners.
-    /// The associated `HirId` has a `local_id` of `0`.
-    /// Generic parameters and closures are also assigned a `LocalDefId` but are not HIR owners.
-    /// Their `HirId`s are defined by their position while lowering the enclosing owner.
-    // FIXME(cjgillot) Some `LocalDefId`s from `use` items are dropped during lowering and lack a `HirId`.
-    pub(super) def_id_to_hir_id: IndexVec<LocalDefId, Option<hir::HirId>>,
-
     /// Item with a given `LocalDefId` was defined during macro expansion with ID `ExpnId`.
     expansions_that_defined: FxHashMap<LocalDefId, ExpnId>,
 
@@ -322,12 +314,6 @@ pub fn def_path(&self, id: LocalDefId) -> DefPath {
         })
     }
 
-    #[inline]
-    #[track_caller]
-    pub fn local_def_id_to_hir_id(&self, id: LocalDefId) -> hir::HirId {
-        self.def_id_to_hir_id[id].unwrap()
-    }
-
     /// Adds a root definition (no parent) and a few other reserved definitions.
     pub fn new(stable_crate_id: StableCrateId, crate_span: Span) -> Definitions {
         let key = DefKey {
@@ -354,7 +340,6 @@ pub fn new(stable_crate_id: StableCrateId, crate_span: Span) -> Definitions {
 
         Definitions {
             table,
-            def_id_to_hir_id: Default::default(),
             expansions_that_defined: Default::default(),
             def_id_to_span,
             stable_crate_id,
@@ -406,20 +391,6 @@ pub fn create_def(
         def_id
     }
 
-    /// Initializes the `LocalDefId` to `HirId` mapping once it has been generated during
-    /// AST to HIR lowering.
-    pub fn init_def_id_to_hir_id_mapping(
-        &mut self,
-        mapping: IndexVec<LocalDefId, Option<hir::HirId>>,
-    ) {
-        assert!(
-            self.def_id_to_hir_id.is_empty(),
-            "trying to initialize `LocalDefId` <-> `HirId` mappings twice"
-        );
-
-        self.def_id_to_hir_id = mapping;
-    }
-
     pub fn expansion_that_defined(&self, id: LocalDefId) -> ExpnId {
         self.expansions_that_defined.get(&id).copied().unwrap_or_else(ExpnId::root)
     }
@@ -431,7 +402,7 @@ pub fn def_span(&self, def_id: LocalDefId) -> Span {
     }
 
     pub fn iter_local_def_id(&self) -> impl Iterator<Item = LocalDefId> + '_ {
-        self.def_id_to_hir_id.iter_enumerated().map(|(k, _)| k)
+        self.table.def_path_hashes.indices().map(|local_def_index| LocalDefId { local_def_index })
     }
 
     #[inline(always)]
index a0ed72c9e9e509347045e480a8c2371bb41f08fd..67398c80f360cbd2864a72ac41baff411345323f 100644 (file)
@@ -711,6 +711,15 @@ pub struct OwnerNodes<'tcx> {
     pub local_id_to_def_id: SortedMap<ItemLocalId, LocalDefId>,
 }
 
+impl<'tcx> OwnerNodes<'tcx> {
+    pub fn node(&self) -> OwnerNode<'tcx> {
+        use rustc_index::vec::Idx;
+        let node = self.nodes[ItemLocalId::new(0)].as_ref().unwrap().node;
+        let node = node.as_owner().unwrap(); // Indexing must ensure it is an OwnerNode.
+        node
+    }
+}
+
 /// Full information resulting from lowering an AST node.
 #[derive(Debug, HashStable_Generic)]
 pub struct OwnerInfo<'hir> {
@@ -728,10 +737,39 @@ pub struct OwnerInfo<'hir> {
 impl<'tcx> OwnerInfo<'tcx> {
     #[inline]
     pub fn node(&self) -> OwnerNode<'tcx> {
-        use rustc_index::vec::Idx;
-        let node = self.nodes.nodes[ItemLocalId::new(0)].as_ref().unwrap().node;
-        let node = node.as_owner().unwrap(); // Indexing must ensure it is an OwnerNode.
-        node
+        self.nodes.node()
+    }
+}
+
+#[derive(Copy, Clone, Debug, HashStable_Generic)]
+pub enum MaybeOwner<T> {
+    Owner(T),
+    NonOwner(HirId),
+    /// Used as a placeholder for unused LocalDefId.
+    Phantom,
+}
+
+impl<T> MaybeOwner<T> {
+    pub fn as_owner(self) -> Option<T> {
+        match self {
+            MaybeOwner::Owner(i) => Some(i),
+            MaybeOwner::NonOwner(_) | MaybeOwner::Phantom => None,
+        }
+    }
+
+    pub fn map<U>(self, f: impl FnOnce(T) -> U) -> MaybeOwner<U> {
+        match self {
+            MaybeOwner::Owner(i) => MaybeOwner::Owner(f(i)),
+            MaybeOwner::NonOwner(hir_id) => MaybeOwner::NonOwner(hir_id),
+            MaybeOwner::Phantom => MaybeOwner::Phantom,
+        }
+    }
+
+    pub fn unwrap(self) -> T {
+        match self {
+            MaybeOwner::Owner(i) => i,
+            MaybeOwner::NonOwner(_) | MaybeOwner::Phantom => panic!("Not a HIR owner"),
+        }
     }
 }
 
@@ -743,7 +781,7 @@ pub fn node(&self) -> OwnerNode<'tcx> {
 /// [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/hir.html
 #[derive(Debug)]
 pub struct Crate<'hir> {
-    pub owners: IndexVec<LocalDefId, Option<OwnerInfo<'hir>>>,
+    pub owners: IndexVec<LocalDefId, MaybeOwner<&'hir OwnerInfo<'hir>>>,
     pub hir_hash: Fingerprint,
 }
 
index 5b486819c35e83e55296f187a264c265c2a0c16a..dee391b9cce215cfe9d194fc1048936ce54555b7 100644 (file)
@@ -30,6 +30,11 @@ pub fn as_owner(self) -> Option<LocalDefId> {
         if self.local_id.index() == 0 { Some(self.owner) } else { None }
     }
 
+    #[inline]
+    pub fn is_owner(self) -> bool {
+        self.local_id.index() == 0
+    }
+
     #[inline]
     pub fn make_owner(owner: LocalDefId) -> Self {
         Self { owner, local_id: ItemLocalId::from_u32(0) }
index 266eec08cebf57ec7fed15994cbf0998db03b961..d1b24b332bdcc65b2cef56a189b3f05cdeff0f53 100644 (file)
@@ -195,7 +195,7 @@ pub struct InferCtxtInner<'tcx> {
     // Opaque types found in explicit return types and their
     // associated fresh inference variable. Writeback resolves these
     // variables to get the concrete type, which can be used to
-    // 'de-opaque' OpaqueTypeDecl, after typeck is done with all functions.
+    // 'de-opaque' OpaqueTypeDecl outside of type inference.
     pub opaque_types: OpaqueTypeMap<'tcx>,
 
     /// A map from inference variables created from opaque
index 4851e637d3a62eeb3f440bba63776549497b7107..e7dca94806cb740243e7ab0af2c141a84635e2ce 100644 (file)
@@ -569,13 +569,15 @@ fn fold_opaque_ty(
             let predicate = predicate.fold_with(&mut BottomUpFolder {
                 tcx,
                 ty_op: |ty| match ty.kind() {
-                    ty::Projection(projection_ty) => infcx.infer_projection(
-                        self.param_env,
-                        *projection_ty,
-                        traits::ObligationCause::misc(self.value_span, self.body_id),
-                        0,
-                        &mut self.obligations,
-                    ),
+                    ty::Projection(projection_ty) if !projection_ty.has_escaping_bound_vars() => {
+                        infcx.infer_projection(
+                            self.param_env,
+                            *projection_ty,
+                            traits::ObligationCause::misc(self.value_span, self.body_id),
+                            0,
+                            &mut self.obligations,
+                        )
+                    }
                     _ => ty,
                 },
                 lt_op: |lt| lt,
index 24d295ee9fbf68f4383b6291b2dd9cc049d617b4..9b24f43f7fd32863ee49eb55202815df76ff6d26 100644 (file)
@@ -3158,7 +3158,10 @@ fn is_zero(expr: &hir::Expr<'_>) -> bool {
     /// of this, GNU assembler [local labels] *must* be used instead of labels
     /// with a name. Using named labels might cause assembler or linker errors.
     ///
+    /// See the explanation in [Rust By Example] for more details.
+    ///
     /// [local labels]: https://sourceware.org/binutils/docs/as/Symbol-Names.html#Local-Labels
+    /// [Rust By Example]: https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels
     pub NAMED_ASM_LABELS,
     Deny,
     "named labels in inline assembly",
index 35c0abd73ba86a708d5540802d1cdc75afffe49b..cb08e95258678ce3aa29cb9d9460b2079e76bd4b 100644 (file)
@@ -524,7 +524,7 @@ fn check_tool_name_for_backwards_compat(
     }
 }
 
-/// Context for lint checking after type checking.
+/// Context for lint checking outside of type inference.
 pub struct LateContext<'tcx> {
     /// Type context we're checking in.
     pub tcx: TyCtxt<'tcx>,
@@ -762,6 +762,7 @@ fn lookup_with_diagnostics(
                 }
                 BuiltinLintDiagnostics::NamedAsmLabel(help) => {
                     db.help(&help);
+                    db.note("see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information");
                 }
             }
             // Rewrap `db`, and pass control to the user.
index dafff640b36ef3d1bee3d26eb87e14931807e1ed..4c7f3482776d7ff332b562ad840c1e84043a7178 100644 (file)
@@ -86,7 +86,6 @@
 
 impl<'tcx> LateLintPass<'tcx> for DropTraitConstraints {
     fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::Item<'tcx>) {
-        use rustc_middle::ty;
         use rustc_middle::ty::PredicateKind::*;
 
         let predicates = cx.tcx.explicit_predicates_of(item.def_id);
@@ -94,7 +93,7 @@ fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::Item<'tcx>) {
             let Trait(trait_predicate) = predicate.kind().skip_binder() else {
                 continue
             };
-            if trait_predicate.constness == ty::BoundConstness::ConstIfConst {
+            if trait_predicate.is_const_if_const() {
                 // `~const Drop` definitely have meanings so avoid linting here.
                 continue;
             }
index 4096815c6a42631b0a530c615400cebce0e87862..4af68233f0dd0d34b7fd185d503e3b4ec4dd1f59 100644 (file)
     /// register size, to alert you of possibly using the incorrect width. To
     /// fix this, add the suggested modifier to the template, or cast the
     /// value to the correct size.
+    ///
+    /// See [register template modifiers] in the reference for more details.
+    ///
+    /// [register template modifiers]: https://doc.rust-lang.org/nightly/reference/inline-assembly.html#template-modifiers
     pub ASM_SUB_REGISTER,
     Warn,
     "using only a subset of a register for inline asm inputs",
index 1885df6ac5d9600744011349fa1a5d7ea1abb114..649cb34bd5f3cbd089d4d8f8683ddc30aaf3f7d3 100644 (file)
@@ -162,7 +162,7 @@ pub fn root_module(&self) -> &'hir Mod<'hir> {
 
     pub fn items(&self) -> impl Iterator<Item = &'hir Item<'hir>> + 'hir {
         let krate = self.krate();
-        krate.owners.iter().filter_map(|owner| match owner.as_ref()?.node() {
+        krate.owners.iter().filter_map(|owner| match owner.as_owner()?.node() {
             OwnerNode::Item(item) => Some(item),
             _ => None,
         })
@@ -205,7 +205,8 @@ pub fn opt_local_def_id(&self, hir_id: HirId) -> Option<LocalDefId> {
             Some(hir_id.owner)
         } else {
             self.tcx
-                .hir_owner_nodes(hir_id.owner)?
+                .hir_owner_nodes(hir_id.owner)
+                .as_owner()?
                 .local_id_to_def_id
                 .get(&hir_id.local_id)
                 .copied()
@@ -214,8 +215,7 @@ pub fn opt_local_def_id(&self, hir_id: HirId) -> Option<LocalDefId> {
 
     #[inline]
     pub fn local_def_id_to_hir_id(&self, def_id: LocalDefId) -> HirId {
-        // FIXME(#85914) is this access safe for incr. comp.?
-        self.tcx.untracked_resolutions.definitions.local_def_id_to_hir_id(def_id)
+        self.tcx.local_def_id_to_hir_id(def_id)
     }
 
     pub fn iter_local_def_id(&self) -> impl Iterator<Item = LocalDefId> + '_ {
@@ -321,7 +321,7 @@ pub fn find_parent_node(&self, id: HirId) -> Option<HirId> {
         if id.local_id == ItemLocalId::from_u32(0) {
             Some(self.tcx.hir_owner_parent(id.owner))
         } else {
-            let owner = self.tcx.hir_owner_nodes(id.owner)?;
+            let owner = self.tcx.hir_owner_nodes(id.owner).as_owner()?;
             let node = owner.nodes[id.local_id].as_ref()?;
             let hir_id = HirId { owner: id.owner, local_id: node.parent };
             Some(hir_id)
@@ -338,7 +338,7 @@ pub fn find(&self, id: HirId) -> Option<Node<'hir>> {
             let owner = self.tcx.hir_owner(id.owner)?;
             Some(owner.node.into())
         } else {
-            let owner = self.tcx.hir_owner_nodes(id.owner)?;
+            let owner = self.tcx.hir_owner_nodes(id.owner).as_owner()?;
             let node = owner.nodes[id.local_id].as_ref()?;
             Some(node.node)
         }
@@ -522,7 +522,7 @@ pub fn body_owners(self) -> impl Iterator<Item = LocalDefId> + 'hir {
             .owners
             .iter_enumerated()
             .flat_map(move |(owner, owner_info)| {
-                let bodies = &owner_info.as_ref()?.nodes.bodies;
+                let bodies = &owner_info.as_owner()?.nodes.bodies;
                 Some(bodies.iter().map(move |&(local_id, _)| {
                     let hir_id = HirId { owner, local_id };
                     let body_id = BodyId { hir_id };
@@ -539,7 +539,7 @@ pub fn par_body_owners<F: Fn(LocalDefId) + Sync + Send>(self, f: F) {
 
         par_iter(&self.krate().owners.raw).enumerate().for_each(|(owner, owner_info)| {
             let owner = LocalDefId::new(owner);
-            if let Some(owner_info) = owner_info {
+            if let MaybeOwner::Owner(owner_info) = owner_info {
                 par_iter(owner_info.nodes.bodies.range(..)).for_each(|(local_id, _)| {
                     let hir_id = HirId { owner, local_id: *local_id };
                     let body_id = BodyId { hir_id };
@@ -601,7 +601,7 @@ pub fn walk_toplevel_module(self, visitor: &mut impl Visitor<'hir>) {
     pub fn walk_attributes(self, visitor: &mut impl Visitor<'hir>) {
         let krate = self.krate();
         for (owner, info) in krate.owners.iter_enumerated() {
-            if let Some(info) = info {
+            if let MaybeOwner::Owner(info) = info {
                 for (local_id, attrs) in info.attrs.map.iter() {
                     let id = HirId { owner, local_id: *local_id };
                     for a in *attrs {
@@ -625,7 +625,7 @@ pub fn visit_all_item_likes<V>(&self, visitor: &mut V)
         V: itemlikevisit::ItemLikeVisitor<'hir>,
     {
         let krate = self.krate();
-        for owner in krate.owners.iter().filter_map(Option::as_ref) {
+        for owner in krate.owners.iter().filter_map(|i| i.as_owner()) {
             match owner.node() {
                 OwnerNode::Item(item) => visitor.visit_item(item),
                 OwnerNode::ForeignItem(item) => visitor.visit_foreign_item(item),
@@ -642,12 +642,14 @@ pub fn par_visit_all_item_likes<V>(&self, visitor: &V)
         V: itemlikevisit::ParItemLikeVisitor<'hir> + Sync + Send,
     {
         let krate = self.krate();
-        par_for_each_in(&krate.owners.raw, |owner| match owner.as_ref().map(OwnerInfo::node) {
-            Some(OwnerNode::Item(item)) => visitor.visit_item(item),
-            Some(OwnerNode::ForeignItem(item)) => visitor.visit_foreign_item(item),
-            Some(OwnerNode::ImplItem(item)) => visitor.visit_impl_item(item),
-            Some(OwnerNode::TraitItem(item)) => visitor.visit_trait_item(item),
-            Some(OwnerNode::Crate(_)) | None => {}
+        par_for_each_in(&krate.owners.raw, |owner| match owner.map(OwnerInfo::node) {
+            MaybeOwner::Owner(OwnerNode::Item(item)) => visitor.visit_item(item),
+            MaybeOwner::Owner(OwnerNode::ForeignItem(item)) => visitor.visit_foreign_item(item),
+            MaybeOwner::Owner(OwnerNode::ImplItem(item)) => visitor.visit_impl_item(item),
+            MaybeOwner::Owner(OwnerNode::TraitItem(item)) => visitor.visit_trait_item(item),
+            MaybeOwner::Owner(OwnerNode::Crate(_))
+            | MaybeOwner::NonOwner(_)
+            | MaybeOwner::Phantom => {}
         })
     }
 
@@ -1121,7 +1123,7 @@ pub(super) fn crate_hash(tcx: TyCtxt<'_>, crate_num: CrateNum) -> Svh {
             .owners
             .iter_enumerated()
             .filter_map(|(def_id, info)| {
-                let _ = info.as_ref()?;
+                let _ = info.as_owner()?;
                 let def_path_hash = definitions.def_path_hash(def_id);
                 let span = definitions.def_span(def_id);
                 debug_assert_eq!(span.parent(), None);
index b4c7bb7eba79c82bcbdee45c4ac27a3723f5903d..1053f0cefbeddcc526e204ac9200320ebf242a4c 100644 (file)
@@ -65,20 +65,27 @@ pub fn provide(providers: &mut Providers) {
     providers.crate_hash = map::crate_hash;
     providers.hir_module_items = map::hir_module_items;
     providers.hir_owner = |tcx, id| {
-        let owner = tcx.hir_crate(()).owners.get(id)?.as_ref()?;
+        let owner = tcx.hir_crate(()).owners.get(id)?.as_owner()?;
         let node = owner.node();
         Some(Owner { node, hash_without_bodies: owner.nodes.hash_without_bodies })
     };
-    providers.hir_owner_nodes = |tcx, id| tcx.hir_crate(()).owners[id].as_ref().map(|i| &i.nodes);
+    providers.local_def_id_to_hir_id = |tcx, id| {
+        let owner = tcx.hir_crate(()).owners[id].map(|_| ());
+        match owner {
+            MaybeOwner::Owner(_) => HirId::make_owner(id),
+            MaybeOwner::Phantom => bug!("No HirId for {:?}", id),
+            MaybeOwner::NonOwner(hir_id) => hir_id,
+        }
+    };
+    providers.hir_owner_nodes = |tcx, id| tcx.hir_crate(()).owners[id].map(|i| &i.nodes);
     providers.hir_owner_parent = |tcx, id| {
         // Accessing the def_key is ok since its value is hashed as part of `id`'s DefPathHash.
         let parent = tcx.untracked_resolutions.definitions.def_key(id).parent;
         let parent = parent.map_or(CRATE_HIR_ID, |local_def_index| {
             let def_id = LocalDefId { local_def_index };
-            let mut parent_hir_id =
-                tcx.untracked_resolutions.definitions.local_def_id_to_hir_id(def_id);
+            let mut parent_hir_id = tcx.hir().local_def_id_to_hir_id(def_id);
             if let Some(local_id) =
-                tcx.hir_crate(()).owners[parent_hir_id.owner].as_ref().unwrap().parenting.get(&id)
+                tcx.hir_crate(()).owners[parent_hir_id.owner].unwrap().parenting.get(&id)
             {
                 parent_hir_id.local_id = *local_id;
             }
@@ -87,7 +94,7 @@ pub fn provide(providers: &mut Providers) {
         parent
     };
     providers.hir_attrs =
-        |tcx, id| tcx.hir_crate(()).owners[id].as_ref().map_or(AttributeMap::EMPTY, |o| &o.attrs);
+        |tcx, id| tcx.hir_crate(()).owners[id].as_owner().map_or(AttributeMap::EMPTY, |o| &o.attrs);
     providers.source_span = |tcx, def_id| tcx.resolutions(()).definitions.def_span(def_id);
     providers.def_span = |tcx, def_id| tcx.hir().span_if_local(def_id).unwrap_or(DUMMY_SP);
     providers.fn_arg_names = |tcx, id| {
@@ -111,4 +118,6 @@ pub fn provide(providers: &mut Providers) {
         let id = id.expect_local();
         tcx.resolutions(()).definitions.expansion_that_defined(id)
     };
+    providers.in_scope_traits_map =
+        |tcx, id| tcx.hir_crate(()).owners[id].as_owner().map(|owner_info| &owner_info.trait_map);
 }
index c7b1e25b9938269c95dee39eb163c0e0791248fd..b1ab0f5b533dd95eb47b5ab17c186cbc078f9c0c 100644 (file)
@@ -894,7 +894,7 @@ pub struct LocalDecl<'tcx> {
     /// across a suspension point against the type components of the generator
     /// which type checking knows are live across a suspension point. We need to
     /// flag drop flags to avoid triggering this check as they are introduced
-    /// after typeck.
+    /// outside of type inference.
     ///
     /// This should be sound because the drop flags are fully algebraic, and
     /// therefore don't affect the auto-trait or outlives properties of the
index 715a1fa25a1c60c72f5b9a80935efbcaaae6b2d3..12ece9e6afb6cec3e2534402a2b128add085b320 100644 (file)
         desc { |tcx| "HIR owner of `{}`", tcx.def_path_str(key.to_def_id()) }
     }
 
+    /// Gives access to the HIR ID for the given `LocalDefId` owner `key`.
+    ///
+    /// This can be conveniently accessed by methods on `tcx.hir()`.
+    /// Avoid calling this query directly.
+    query local_def_id_to_hir_id(key: LocalDefId) -> hir::HirId {
+        desc { |tcx| "HIR ID of `{}`", tcx.def_path_str(key.to_def_id()) }
+    }
+
     /// Gives access to the HIR node's parent for the HIR owner `key`.
     ///
     /// This can be conveniently accessed by methods on `tcx.hir()`.
@@ -68,7 +76,7 @@
     ///
     /// This can be conveniently accessed by methods on `tcx.hir()`.
     /// Avoid calling this query directly.
-    query hir_owner_nodes(key: LocalDefId) -> Option<&'tcx hir::OwnerNodes<'tcx>> {
+    query hir_owner_nodes(key: LocalDefId) -> hir::MaybeOwner<&'tcx hir::OwnerNodes<'tcx>> {
         desc { |tcx| "HIR owner items in `{}`", tcx.def_path_str(key.to_def_id()) }
     }
 
         desc { |tcx| "type-checking `{}`", tcx.def_path_str(key.to_def_id()) }
         cache_on_disk_if { true }
         load_cached(tcx, id) {
-            #[cfg(bootstrap)]
-            {
-                match match tcx.on_disk_cache().as_ref() {
-                    Some(c) => c.try_load_query_result(*tcx, id),
-                    None => None,
-                } {
-                    Some(x) => Some(&*tcx.arena.alloc(x)),
-                    None => None,
-                }
-            }
-            #[cfg(not(bootstrap))]
-            {
-                let typeck_results: Option<ty::TypeckResults<'tcx>> = tcx
-                    .on_disk_cache().as_ref()
-                    .and_then(|c| c.try_load_query_result(*tcx, id));
+            let typeck_results: Option<ty::TypeckResults<'tcx>> = tcx
+                .on_disk_cache().as_ref()
+                .and_then(|c| c.try_load_query_result(*tcx, id));
 
-                typeck_results.map(|x| &*tcx.arena.alloc(x))
-            }
+            typeck_results.map(|x| &*tcx.arena.alloc(x))
         }
     }
 
index 6c8573805cb9485f045cb147b3ed8fc39ceead05..5dae4b9e4c9712808aeab34febf4ad5b90ea1abb 100644 (file)
@@ -220,7 +220,7 @@ pub struct CommonLifetimes<'tcx> {
     /// `ReStatic`
     pub re_static: Region<'tcx>,
 
-    /// Erased region, used after type-checking
+    /// Erased region, used outside of type inference.
     pub re_erased: Region<'tcx>,
 }
 
@@ -360,7 +360,7 @@ pub struct TypeckResults<'tcx> {
     field_indices: ItemLocalMap<usize>,
 
     /// Stores the types for various nodes in the AST. Note that this table
-    /// is not guaranteed to be populated until after typeck. See
+    /// is not guaranteed to be populated outside inference. See
     /// typeck::check::fn_ctxt for details.
     node_types: ItemLocalMap<Ty<'tcx>>,
 
@@ -2875,8 +2875,6 @@ fn ptr_eq<T, U>(t: *const T, u: *const U) -> bool {
 }
 
 pub fn provide(providers: &mut ty::query::Providers) {
-    providers.in_scope_traits_map =
-        |tcx, id| tcx.hir_crate(()).owners[id].as_ref().map(|owner_info| &owner_info.trait_map);
     providers.resolutions = |tcx, ()| &tcx.untracked_resolutions;
     providers.module_reexports =
         |tcx, id| tcx.resolutions(()).reexport_map.get(&id).map(|v| &v[..]);
index 6174c922e2d063df5e3fbef6c88ed5b504037310..e7a8e71ce71b008c052604ea79caea4e4e634b12 100644 (file)
@@ -784,6 +784,11 @@ pub fn def_id(self) -> DefId {
     pub fn self_ty(self) -> Ty<'tcx> {
         self.trait_ref.self_ty()
     }
+
+    #[inline]
+    pub fn is_const_if_const(self) -> bool {
+        self.constness == BoundConstness::ConstIfConst
+    }
 }
 
 impl<'tcx> PolyTraitPredicate<'tcx> {
@@ -803,6 +808,11 @@ pub fn remap_constness_diag(&mut self, param_env: ParamEnv<'tcx>) {
             p
         });
     }
+
+    #[inline]
+    pub fn is_const_if_const(self) -> bool {
+        self.skip_binder().is_const_if_const()
+    }
 }
 
 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, TyEncodable, TyDecodable)]
@@ -1388,6 +1398,11 @@ pub fn constness(self) -> hir::Constness {
         self.packed.tag().constness
     }
 
+    #[inline]
+    pub fn is_const(self) -> bool {
+        self.packed.tag().constness == hir::Constness::Const
+    }
+
     /// Construct a trait environment with no where-clauses in scope
     /// where the values of all `impl Trait` and other hidden types
     /// are revealed. This is suitable for monomorphized, post-typeck
@@ -1503,6 +1518,7 @@ pub fn with_constness(self, constness: BoundConstness) -> PolyTraitPredicate<'tc
             polarity: ty::ImplPolarity::Positive,
         })
     }
+
     #[inline]
     pub fn without_const(self) -> PolyTraitPredicate<'tcx> {
         self.with_constness(BoundConstness::NotConst)
index 84ab42a760b933a785b9482949f539c9c7aa6c30..b3b2bb4459f7df376a5aeb6c07b2f8332956e879 100644 (file)
@@ -34,8 +34,8 @@ impl<'tcx> TyCtxt<'tcx> {
     /// Erase the regions in `value` and then fully normalize all the
     /// types found within. The result will also have regions erased.
     ///
-    /// This is appropriate to use only after type-check: it assumes
-    /// that normalization will succeed, for example.
+    /// This should only be used outside of type inference. For example,
+    /// it assumes that normalization will succeed.
     pub fn normalize_erasing_regions<T>(self, param_env: ty::ParamEnv<'tcx>, value: T) -> T
     where
         T: TypeFoldable<'tcx>,
index 20db25f7899ddc3082062efc1b1a6f145d8633cb..7d4af6cfa405257088c8e41bb3c1ed5cc89151b7 100644 (file)
@@ -1464,11 +1464,11 @@ pub enum RegionKind {
     /// Static data that has an "infinite" lifetime. Top in the region lattice.
     ReStatic,
 
-    /// A region variable. Should not exist after typeck.
+    /// A region variable. Should not exist outside of type inference.
     ReVar(RegionVid),
 
     /// A placeholder region -- basically, the higher-ranked version of `ReFree`.
-    /// Should not exist after typeck.
+    /// Should not exist outside of type inference.
     RePlaceholder(ty::PlaceholderRegion),
 
     /// Empty lifetime is for data that is never accessed.  We tag the
@@ -1810,7 +1810,7 @@ pub fn is_simd(&self) -> bool {
     pub fn sequence_element_type(&self, tcx: TyCtxt<'tcx>) -> Ty<'tcx> {
         match self.kind() {
             Array(ty, _) | Slice(ty) => ty,
-            Str => tcx.mk_mach_uint(ty::UintTy::U8),
+            Str => tcx.types.u8,
             _ => bug!("`sequence_element_type` called on non-sequence value: {}", self),
         }
     }
index 82455654a8860c11501e8caf17bcf5cc5abca8fc..2bb9f48f9b7c87c78ca51fba9c5193f9083e7784 100644 (file)
@@ -579,7 +579,7 @@ fn hash_mir_source<'tcx>(tcx: TyCtxt<'tcx>, hir_body: &'tcx rustc_hir::Body<'tcx
     let mut hcx = tcx.create_no_span_stable_hashing_context();
     let mut stable_hasher = StableHasher::new();
     let owner = hir_body.id().hir_id.owner;
-    let bodies = &tcx.hir_owner_nodes(owner).as_ref().unwrap().bodies;
+    let bodies = &tcx.hir_owner_nodes(owner).unwrap().bodies;
     hcx.with_hir_bodies(false, owner, bodies, |hcx| {
         hir_body.value.hash_stable(hcx, &mut stable_hasher)
     });
index 450e0c31e982b9d7a64dcd464203c1289af5bbf5..1b9fddec2bebac93ce774930a7fe28ec3577d9a4 100644 (file)
@@ -43,54 +43,28 @@ fn visit_terminator(&mut self, terminator: &Terminator<'tcx>, location: Location
         } = &terminator.kind
         {
             let source_info = *self.body.source_info(location);
-            // Only handle function calls outside macros
-            if !source_info.span.from_expansion() {
-                let func_ty = func.ty(self.body, self.tcx);
-                if let ty::FnDef(def_id, substs_ref) = *func_ty.kind() {
-                    // Handle calls to `transmute`
-                    if self.tcx.is_diagnostic_item(sym::transmute, def_id) {
-                        let arg_ty = args[0].ty(self.body, self.tcx);
-                        for generic_inner_ty in arg_ty.walk() {
-                            if let GenericArgKind::Type(inner_ty) = generic_inner_ty.unpack() {
-                                if let Some((fn_id, fn_substs)) =
-                                    FunctionItemRefChecker::is_fn_ref(inner_ty)
-                                {
-                                    let span = self.nth_arg_span(&args, 0);
-                                    self.emit_lint(fn_id, fn_substs, source_info, span);
-                                }
+            let func_ty = func.ty(self.body, self.tcx);
+            if let ty::FnDef(def_id, substs_ref) = *func_ty.kind() {
+                // Handle calls to `transmute`
+                if self.tcx.is_diagnostic_item(sym::transmute, def_id) {
+                    let arg_ty = args[0].ty(self.body, self.tcx);
+                    for generic_inner_ty in arg_ty.walk() {
+                        if let GenericArgKind::Type(inner_ty) = generic_inner_ty.unpack() {
+                            if let Some((fn_id, fn_substs)) =
+                                FunctionItemRefChecker::is_fn_ref(inner_ty)
+                            {
+                                let span = self.nth_arg_span(&args, 0);
+                                self.emit_lint(fn_id, fn_substs, source_info, span);
                             }
                         }
-                    } else {
-                        self.check_bound_args(def_id, substs_ref, &args, source_info);
                     }
+                } else {
+                    self.check_bound_args(def_id, substs_ref, &args, source_info);
                 }
             }
         }
         self.super_terminator(terminator, location);
     }
-
-    /// Emits a lint for function references formatted with `fmt::Pointer::fmt` by macros. These
-    /// cases are handled as operands instead of call terminators to avoid any dependence on
-    /// unstable, internal formatting details like whether `fmt` is called directly or not.
-    fn visit_operand(&mut self, operand: &Operand<'tcx>, location: Location) {
-        let source_info = *self.body.source_info(location);
-        if source_info.span.from_expansion() {
-            let op_ty = operand.ty(self.body, self.tcx);
-            if let ty::FnDef(def_id, substs_ref) = *op_ty.kind() {
-                if self.tcx.is_diagnostic_item(sym::pointer_trait_fmt, def_id) {
-                    let param_ty = substs_ref.type_at(0);
-                    if let Some((fn_id, fn_substs)) = FunctionItemRefChecker::is_fn_ref(param_ty) {
-                        // The operand's ctxt wouldn't display the lint since it's inside a macro so
-                        // we have to use the callsite's ctxt.
-                        let callsite_ctxt = source_info.span.source_callsite().ctxt();
-                        let span = source_info.span.with_ctxt(callsite_ctxt);
-                        self.emit_lint(fn_id, fn_substs, source_info, span);
-                    }
-                }
-            }
-        }
-        self.super_operand(operand, location);
-    }
 }
 
 impl<'tcx> FunctionItemRefChecker<'_, 'tcx> {
@@ -120,7 +94,13 @@ fn check_bound_args(
                                 if let Some((fn_id, fn_substs)) =
                                     FunctionItemRefChecker::is_fn_ref(subst_ty)
                                 {
-                                    let span = self.nth_arg_span(args, arg_num);
+                                    let mut span = self.nth_arg_span(args, arg_num);
+                                    if span.from_expansion() {
+                                        // The operand's ctxt wouldn't display the lint since it's inside a macro so
+                                        // we have to use the callsite's ctxt.
+                                        let callsite_ctxt = span.source_callsite().ctxt();
+                                        span = span.with_ctxt(callsite_ctxt);
+                                    }
                                     self.emit_lint(fn_id, fn_substs, source_info, span);
                                 }
                             }
index 17bac362ec81ff75bc7c51346bd3def318897a63..7b74b137d21ae2c0afc6e8d1508fdb037d04aa96 100644 (file)
@@ -192,10 +192,10 @@ pub(super) fn expected_ident_found(&self) -> DiagnosticBuilder<'a> {
                 if ident.is_raw_guess()
                     && self.look_ahead(1, |t| valid_follow.contains(&t.kind)) =>
             {
-                err.span_suggestion(
-                    ident.span,
-                    "you can escape reserved keywords to use them as identifiers",
-                    format!("r#{}", ident.name),
+                err.span_suggestion_verbose(
+                    ident.span.shrink_to_lo(),
+                    &format!("escape `{}` to use it as an identifier", ident.name),
+                    "r#".to_owned(),
                     Applicability::MaybeIncorrect,
                 );
             }
index 4c7bdb33fb87abbb9453f496758fef367fc3582c..6ef85c426be7040839311d9f414902ad076028de 100644 (file)
@@ -1019,15 +1019,7 @@ fn visit_ty(&mut self, ty: &'tcx hir::Ty<'tcx>) {
                     let hir_id = self.tcx.hir().local_def_id_to_hir_id(def_id);
                     // Ensure that the parent of the def is an item, not HRTB
                     let parent_id = self.tcx.hir().get_parent_node(hir_id);
-                    // FIXME(cjgillot) Can this check be replaced by
-                    // `let parent_is_item = parent_id.is_owner();`?
-                    let parent_is_item = if let Some(parent_def_id) = parent_id.as_owner() {
-                        matches!(self.tcx.hir().krate().owners.get(parent_def_id), Some(Some(_)),)
-                    } else {
-                        false
-                    };
-
-                    if !parent_is_item {
+                    if !parent_id.is_owner() {
                         if !self.trait_definition_only {
                             struct_span_err!(
                                 self.tcx.sess,
index b95fe1b0549bd68232e4dc96374d42c49e66dcf7..570fa873a23da287200195edcd7c58e173109372 100644 (file)
@@ -984,7 +984,7 @@ pub fn process_crate<'l, 'tcx, H: SaveHandler>(
         tcx.dep_graph.with_ignore(|| {
             info!("Dumping crate {}", cratename);
 
-            // Privacy checking requires and is done after type checking; use a
+            // Privacy checking must be done outside of type inference; use a
             // fallback in case the access levels couldn't have been correctly computed.
             let access_levels = match tcx.sess.compile_status() {
                 Ok(..) => tcx.privacy_access_levels(()),
index ba8ade088ba33937e390365747f52909d4fba00a..198391cbe9cf7969f830597679f82d2014bdb9cc 100644 (file)
         __H,
         __S,
         __try_var,
-        _args,
         _d,
         _e,
         _task_context,
         append_const_msg,
         arbitrary_enum_discriminant,
         arbitrary_self_types,
+        args,
         arith_offset,
         arm,
         arm_target_feature,
         const_async_blocks,
         const_compare_raw_pointers,
         const_constructor,
+        const_deallocate,
         const_eval_limit,
         const_eval_select,
         const_eval_select_ct,
index 8046267a59da6ca8d5c3471de366b8f4db5eecb1..a84410d0f3c46510a13349bf0e3461a84f3d130f 100644 (file)
@@ -444,7 +444,7 @@ pub fn name(self) -> Symbol {
     }
 
     /// Returns a suggested register class to use for this type. This is called
-    /// after type checking via `supported_types` fails to give a better error
+    /// when `supported_types` fails to give a better error
     /// message to the user.
     pub fn suggest_class(self, arch: InlineAsmArch, ty: InlineAsmType) -> Option<Self> {
         match self {
index 848aba7c912896dead92698357967eca538b9080..759bc696981676162f708c376ee9f0406f649c1f 100644 (file)
@@ -18,7 +18,6 @@
 /// that type check should guarantee to us that all nested
 /// obligations *could be* resolved if we wanted to.
 ///
-/// Assumes that this is run after the entire crate has been successfully type-checked.
 /// This also expects that `trait_ref` is fully normalized.
 pub fn codegen_fulfill_obligation<'tcx>(
     tcx: TyCtxt<'tcx>,
@@ -101,7 +100,7 @@ pub fn codegen_fulfill_obligation<'tcx>(
 /// Finishes processes any obligations that remain in the
 /// fulfillment context, and then returns the result with all type
 /// variables removed and regions erased. Because this is intended
-/// for use after type-check has completed, if any errors occur,
+/// for use outside of type inference, if any errors occur,
 /// it will panic. It is used during normalization and other cases
 /// where processing the obligations in `fulfill_cx` may cause
 /// type inference variables that appear in `result` to be
@@ -124,7 +123,10 @@ fn drain_fulfillment_cx_or_panic<'tcx, T>(
     if !errors.is_empty() {
         infcx.tcx.sess.delay_span_bug(
             rustc_span::DUMMY_SP,
-            &format!("Encountered errors `{:?}` resolving bounds after type-checking", errors),
+            &format!(
+                "Encountered errors `{:?}` resolving bounds outside of type inference",
+                errors
+            ),
         );
     }
 
index 37cf41a0ec2e28066a402a8bd9fd2897266723e0..687bd16ba30f451ba4071a978ce5223b9fb07945 100644 (file)
@@ -439,6 +439,28 @@ fn report_selection_error(
                         } else {
                             err.span_label(span, explanation);
                         }
+
+                        if trait_predicate.is_const_if_const() && obligation.param_env.is_const() {
+                            let non_const_predicate = trait_ref.without_const();
+                            let non_const_obligation = Obligation {
+                                cause: obligation.cause.clone(),
+                                param_env: obligation.param_env.without_const(),
+                                predicate: non_const_predicate.to_predicate(tcx),
+                                recursion_depth: obligation.recursion_depth,
+                            };
+                            if self.predicate_may_hold(&non_const_obligation) {
+                                err.span_note(
+                                    span,
+                                    &format!(
+                                        "the trait `{}` is implemented for `{}`, \
+                                        but that implementation is not `const`",
+                                        non_const_predicate.print_modifiers_and_trait_path(),
+                                        trait_ref.skip_binder().self_ty(),
+                                    ),
+                                );
+                            }
+                        }
+
                         if let Some((msg, span)) = type_def {
                             err.span_label(span, &msg);
                         }
index 23f534858b82a865436661d444580391cdf59fd0..2927e64f705fea57da73753c66ee33a8b4685261 100644 (file)
@@ -291,7 +291,7 @@ pub fn normalize_param_env_or_error<'tcx>(
     //
     // In any case, in practice, typeck constructs all the
     // parameter environments once for every fn as it goes,
-    // and errors will get reported then; so after typeck we
+    // and errors will get reported then; so outside of type inference we
     // can be sure that no errors should occur.
 
     debug!(
index e8b46e88a42285656c2b65850c1ba5ef05fdd3d2..087fc6034d98f9a567ec66f1dd09fd6438424ecf 100644 (file)
@@ -391,7 +391,7 @@ fn fold_ty(&mut self, ty: Ty<'tcx>) -> Ty<'tcx> {
             // severe performance implications for large opaque types with
             // late-bound regions. See `issue-88862` benchmark.
             ty::Opaque(def_id, substs) if !substs.has_escaping_bound_vars() => {
-                // Only normalize `impl Trait` after type-checking, usually in codegen.
+                // Only normalize `impl Trait` outside of type inference, usually in codegen.
                 match self.param_env.reveal() {
                     Reveal::UserFacing => ty.super_fold_with(self),
 
index 81ee22c1de4d93dae3f52dcd22f6c00926f1bc9c..3c9e1bbcef26deffa1783a25ed9f7078065e5901 100644 (file)
@@ -200,7 +200,7 @@ fn try_fold_ty(&mut self, ty: Ty<'tcx>) -> Result<Ty<'tcx>, Self::Error> {
             // severe performance implications for large opaque types with
             // late-bound regions. See `issue-88862` benchmark.
             ty::Opaque(def_id, substs) if !substs.has_escaping_bound_vars() => {
-                // Only normalize `impl Trait` after type-checking, usually in codegen.
+                // Only normalize `impl Trait` outside of type inference, usually in codegen.
                 match self.param_env.reveal() {
                     Reveal::UserFacing => ty.try_super_fold_with(self),
 
index 0099fba92004245912974c0974b5ac2002dc51c6..db86041f6180b5efdc49a71aebda28ba7a8d2020 100644 (file)
@@ -305,7 +305,7 @@ pub(super) fn assemble_candidates<'o>(
             } else if lang_items.unsize_trait() == Some(def_id) {
                 self.assemble_candidates_for_unsizing(obligation, &mut candidates);
             } else if lang_items.drop_trait() == Some(def_id)
-                && obligation.predicate.skip_binder().constness == ty::BoundConstness::ConstIfConst
+                && obligation.predicate.is_const_if_const()
             {
                 self.assemble_const_drop_candidates(obligation, &mut candidates);
             } else {
index 2e20ea34e10ef15693997fc9182c76e129ddc71e..639884844b25d599208805359473fb4742292bbe 100644 (file)
@@ -72,9 +72,7 @@ pub(super) fn confirm_candidate(
         // CheckPredicate(&A: Super)
         // CheckPredicate(A: ~const Super) // <- still const env, failure
         // ```
-        if obligation.param_env.constness() == Constness::Const
-            && obligation.predicate.skip_binder().constness == ty::BoundConstness::NotConst
-        {
+        if obligation.param_env.is_const() && !obligation.predicate.is_const_if_const() {
             new_obligation = TraitObligation {
                 cause: obligation.cause.clone(),
                 param_env: obligation.param_env.without_const(),
index ae5369054837597bac04241bee668339fcd48112..47427395b93b36adff83c8dda2f9034cc12346bf 100644 (file)
@@ -1173,9 +1173,7 @@ fn filter_impls(
                     ImplCandidate(def_id)
                         if tcx.impl_constness(def_id) == hir::Constness::Const => {}
                     // const param
-                    ParamCandidate(trait_pred)
-                        if trait_pred.skip_binder().constness
-                            == ty::BoundConstness::ConstIfConst => {}
+                    ParamCandidate(trait_pred) if trait_pred.is_const_if_const() => {}
                     // auto trait impl
                     AutoImplCandidate(..) => {}
                     // generator, this will raise error in other places
index fef83190468196c32ee0257fb33c36aadd889724..b882a940d40c3609eb82ea6afb5f93296b0ca0ad 100644 (file)
@@ -149,7 +149,7 @@ fn param_env(tcx: TyCtxt<'_>, def_id: DefId) -> ty::ParamEnv<'_> {
     // kind of an "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
+    // are any errors at that point, so outside of type inference you can be
     // sure that this will succeed without errors anyway.
 
     if tcx.sess.opts.debugging_opts.chalk {
index 956696546da8ef9a9298bab17427d54f17c522ca..05ff7f818c75f22549d30a228cd0431e456dc261 100644 (file)
@@ -445,7 +445,7 @@ pub(crate) fn check_generic_arg_count(
         let named_type_param_count =
             param_counts.types - has_self as usize - synth_type_param_count;
         let infer_lifetimes =
-            gen_pos != GenericArgPosition::Type && !gen_args.has_lifetime_params();
+            (gen_pos != GenericArgPosition::Type || infer_args) && !gen_args.has_lifetime_params();
 
         if gen_pos != GenericArgPosition::Type && !gen_args.bindings.is_empty() {
             Self::prohibit_assoc_ty_binding(tcx, gen_args.bindings[0].span);
index 4cf8ddcb8f01ccef9224ae2cf5fd5b38609c2943..16fc9a01a27078f7ef9b31119249ed6ab52e3b28 100644 (file)
@@ -482,7 +482,20 @@ fn inferred_kind(
             ) -> subst::GenericArg<'tcx> {
                 let tcx = self.astconv.tcx();
                 match param.kind {
-                    GenericParamDefKind::Lifetime => tcx.lifetimes.re_static.into(),
+                    GenericParamDefKind::Lifetime => self
+                        .astconv
+                        .re_infer(Some(param), self.span)
+                        .unwrap_or_else(|| {
+                            debug!(?param, "unelided lifetime in signature");
+
+                            // This indicates an illegal lifetime in a non-assoc-trait position
+                            tcx.sess.delay_span_bug(self.span, "unelided lifetime in signature");
+
+                            // Supply some dummy value. We don't have an
+                            // `re_error`, annoyingly, so use `'static`.
+                            tcx.lifetimes.re_static
+                        })
+                        .into(),
                     GenericParamDefKind::Type { has_default, .. } => {
                         if !infer_args && has_default {
                             // No type parameter provided, but a default exists.
index 23cc4b0ffc8140683ee11205c65c0f7a94ea70aa..0e1dbc53806ffe511bf4ae2e7d45cad784d5e72e 100644 (file)
 use rustc_hir::def::{CtorKind, DefKind, Res};
 use rustc_hir::def_id::DefId;
 use rustc_hir::intravisit::Visitor;
-use rustc_hir::{ExprKind, QPath};
+use rustc_hir::{ExprKind, HirId, QPath};
 use rustc_infer::infer;
 use rustc_infer::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
 use rustc_infer::infer::InferOk;
+use rustc_middle::middle::stability;
 use rustc_middle::ty::adjustment::{Adjust, Adjustment, AllowTwoPhase};
 use rustc_middle::ty::error::ExpectedFound;
 use rustc_middle::ty::error::TypeError::{FieldMisMatch, Sorts};
@@ -1720,9 +1721,12 @@ fn report_unknown_field(
             _ => {
                 // prevent all specified fields from being suggested
                 let skip_fields = skip_fields.iter().map(|x| x.ident.name);
-                if let Some(field_name) =
-                    Self::suggest_field_name(variant, field.ident.name, skip_fields.collect())
-                {
+                if let Some(field_name) = self.suggest_field_name(
+                    variant,
+                    field.ident.name,
+                    skip_fields.collect(),
+                    expr_span,
+                ) {
                     err.span_suggestion(
                         field.ident.span,
                         "a field with a similar name exists",
@@ -1743,7 +1747,8 @@ fn report_unknown_field(
                                     format!("`{}` does not have this field", ty),
                                 );
                             }
-                            let available_field_names = self.available_field_names(variant);
+                            let available_field_names =
+                                self.available_field_names(variant, expr_span);
                             if !available_field_names.is_empty() {
                                 err.note(&format!(
                                     "available fields are: {}",
@@ -1759,19 +1764,27 @@ fn report_unknown_field(
         err.emit();
     }
 
-    // Return an hint about the closest match in field names
+    // Return a hint about the closest match in field names
     fn suggest_field_name(
+        &self,
         variant: &'tcx ty::VariantDef,
         field: Symbol,
         skip: Vec<Symbol>,
+        // The span where stability will be checked
+        span: Span,
     ) -> Option<Symbol> {
         let names = variant
             .fields
             .iter()
             .filter_map(|field| {
                 // ignore already set fields and private fields from non-local crates
+                // and unstable fields.
                 if skip.iter().any(|&x| x == field.name)
                     || (!variant.def_id.is_local() && !field.vis.is_public())
+                    || matches!(
+                        self.tcx.eval_stability(field.did, None, span, None),
+                        stability::EvalResult::Deny { .. }
+                    )
                 {
                     None
                 } else {
@@ -1783,7 +1796,11 @@ fn suggest_field_name(
         find_best_match_for_name(&names, field, None)
     }
 
-    fn available_field_names(&self, variant: &'tcx ty::VariantDef) -> Vec<Symbol> {
+    fn available_field_names(
+        &self,
+        variant: &'tcx ty::VariantDef,
+        access_span: Span,
+    ) -> Vec<Symbol> {
         variant
             .fields
             .iter()
@@ -1793,7 +1810,12 @@ fn available_field_names(&self, variant: &'tcx ty::VariantDef) -> Vec<Symbol> {
                     .adjust_ident_and_get_scope(field.ident(self.tcx), variant.def_id, self.body_id)
                     .1;
                 field.vis.is_accessible_from(def_scope, self.tcx)
+                    && !matches!(
+                        self.tcx.eval_stability(field.did, None, access_span, None),
+                        stability::EvalResult::Deny { .. }
+                    )
             })
+            .filter(|field| !self.tcx.is_doc_hidden(field.did))
             .map(|field| field.name)
             .collect()
     }
@@ -1948,7 +1970,7 @@ fn ban_nonexisting_field(
             "ban_nonexisting_field: field={:?}, base={:?}, expr={:?}, expr_ty={:?}",
             field, base, expr, expr_t
         );
-        let mut err = self.no_such_field_err(field, expr_t);
+        let mut err = self.no_such_field_err(field, expr_t, base.hir_id);
 
         match *expr_t.peel_refs().kind() {
             ty::Array(_, len) => {
@@ -1958,7 +1980,7 @@ fn ban_nonexisting_field(
                 self.suggest_first_deref_field(&mut err, expr, base, field);
             }
             ty::Adt(def, _) if !def.is_enum() => {
-                self.suggest_fields_on_recordish(&mut err, def, field);
+                self.suggest_fields_on_recordish(&mut err, def, field, expr.span);
             }
             ty::Param(param_ty) => {
                 self.point_at_param_definition(&mut err, param_ty);
@@ -2121,9 +2143,10 @@ fn suggest_fields_on_recordish(
         err: &mut DiagnosticBuilder<'_>,
         def: &'tcx ty::AdtDef,
         field: Ident,
+        access_span: Span,
     ) {
         if let Some(suggested_field_name) =
-            Self::suggest_field_name(def.non_enum_variant(), field.name, vec![])
+            self.suggest_field_name(def.non_enum_variant(), field.name, vec![], access_span)
         {
             err.span_suggestion(
                 field.span,
@@ -2134,7 +2157,7 @@ fn suggest_fields_on_recordish(
         } else {
             err.span_label(field.span, "unknown field");
             let struct_variant_def = def.non_enum_variant();
-            let field_names = self.available_field_names(struct_variant_def);
+            let field_names = self.available_field_names(struct_variant_def, access_span);
             if !field_names.is_empty() {
                 err.note(&format!(
                     "available fields are: {}",
@@ -2186,6 +2209,7 @@ fn no_such_field_err(
         &self,
         field: Ident,
         expr_t: &'tcx ty::TyS<'tcx>,
+        id: HirId,
     ) -> DiagnosticBuilder<'_> {
         let span = field.span;
         debug!("no_such_field_err(span: {:?}, field: {:?}, expr_t: {:?})", span, field, expr_t);
@@ -2203,9 +2227,14 @@ fn no_such_field_err(
         // try to add a suggestion in case the field is a nested field of a field of the Adt
         if let Some((fields, substs)) = self.get_field_candidates(span, &expr_t) {
             for candidate_field in fields.iter() {
-                if let Some(field_path) =
-                    self.check_for_nested_field(span, field, candidate_field, substs, vec![])
-                {
+                if let Some(field_path) = self.check_for_nested_field(
+                    span,
+                    field,
+                    candidate_field,
+                    substs,
+                    vec![],
+                    self.tcx.parent_module(id).to_def_id(),
+                ) {
                     let field_path_str = field_path
                         .iter()
                         .map(|id| id.name.to_ident_string())
@@ -2257,6 +2286,7 @@ fn check_for_nested_field(
         candidate_field: &ty::FieldDef,
         subst: SubstsRef<'tcx>,
         mut field_path: Vec<Ident>,
+        id: DefId,
     ) -> Option<Vec<Ident>> {
         debug!(
             "check_for_nested_field(span: {:?}, candidate_field: {:?}, field_path: {:?}",
@@ -2276,10 +2306,12 @@ fn check_for_nested_field(
             let field_ty = candidate_field.ty(self.tcx, subst);
             if let Some((nested_fields, subst)) = self.get_field_candidates(span, &field_ty) {
                 for field in nested_fields.iter() {
-                    let ident = field.ident(self.tcx).normalize_to_macros_2_0();
-                    if ident == target_field {
-                        return Some(field_path);
-                    } else {
+                    let accessible = field.vis.is_accessible_from(id, self.tcx);
+                    if accessible {
+                        let ident = field.ident(self.tcx).normalize_to_macros_2_0();
+                        if ident == target_field {
+                            return Some(field_path);
+                        }
                         let field_path = field_path.clone();
                         if let Some(path) = self.check_for_nested_field(
                             span,
@@ -2287,6 +2319,7 @@ fn check_for_nested_field(
                             field,
                             subst,
                             field_path,
+                            id,
                         ) {
                             return Some(path);
                         }
index 4c612ed5be51a06db1c12823db92c6ddf8850a61..74f6f50d41289c83fb359418989117fb98ebe92d 100644 (file)
@@ -297,6 +297,11 @@ pub fn check_intrinsic_type(tcx: TyCtxt<'_>, it: &hir::ForeignItem<'_>) {
             sym::const_allocate => {
                 (0, vec![tcx.types.usize, tcx.types.usize], tcx.mk_mut_ptr(tcx.types.u8))
             }
+            sym::const_deallocate => (
+                0,
+                vec![tcx.mk_mut_ptr(tcx.types.u8), tcx.types.usize, tcx.types.usize],
+                tcx.mk_unit(),
+            ),
 
             sym::ptr_offset_from => {
                 (1, vec![tcx.mk_imm_ptr(param(0)), tcx.mk_imm_ptr(param(0))], tcx.types.isize)
index 1cbc2b65f4dbdad1910c8c5b74d178516f0c5a15..dfd3771c1d04207b92094179fe4fa1595fc8e2a4 100644 (file)
     issue_tracker_base_url = "https://github.com/rust-lang/rust/issues/",
     test(no_crate_inject, attr(allow(unused_variables), deny(warnings)))
 )]
-#![cfg_attr(
-    not(bootstrap),
-    doc(cfg_hide(
-        not(test),
-        not(any(test, bootstrap)),
-        any(not(feature = "miri-test-libstd"), test, doctest),
-        no_global_oom_handling,
-        not(no_global_oom_handling),
-        target_has_atomic = "ptr"
-    ))
-)]
+#![doc(cfg_hide(
+    not(test),
+    not(any(test, bootstrap)),
+    any(not(feature = "miri-test-libstd"), test, doctest),
+    no_global_oom_handling,
+    not(no_global_oom_handling),
+    target_has_atomic = "ptr"
+))]
 #![no_std]
 #![needs_allocator]
 //
 #![feature(const_precise_live_drops)]
 #![feature(const_trait_impl)]
 #![feature(const_try)]
-#![cfg_attr(bootstrap, feature(destructuring_assignment))]
 #![feature(dropck_eyepatch)]
 #![feature(exclusive_range_pattern)]
 #![feature(fundamental)]
index bc3f7167fac3a9dd4dae0c4ca02c8c9122586580..5fd60b759286a3fc6439913ffbd4efa765b5fde6 100644 (file)
@@ -1310,11 +1310,7 @@ fn clone(&self) -> Self {
 ///
 /// See the [module-level documentation](self) for more.
 #[stable(feature = "rust1", since = "1.0.0")]
-#[cfg_attr(
-    not(bootstrap),
-    must_not_suspend = "holding a Ref across suspend \
-                      points can cause BorrowErrors"
-)]
+#[must_not_suspend = "holding a Ref across suspend points can cause BorrowErrors"]
 pub struct Ref<'b, T: ?Sized + 'b> {
     value: &'b T,
     borrow: BorrowRef<'b>,
@@ -1692,11 +1688,7 @@ fn clone(&self) -> BorrowRefMut<'b> {
 ///
 /// See the [module-level documentation](self) for more.
 #[stable(feature = "rust1", since = "1.0.0")]
-#[cfg_attr(
-    not(bootstrap),
-    must_not_suspend = "holding a RefMut across suspend \
-                      points can cause BorrowErrors"
-)]
+#[must_not_suspend = "holding a RefMut across suspend points can cause BorrowErrors"]
 pub struct RefMut<'b, T: ?Sized + 'b> {
     value: &'b mut T,
     borrow: BorrowRefMut<'b>,
index 5dd8c5ef78941835b3619b63636e2214d00c4620..8b9f979b573f70830930452c21fc94a724fbc651 100644 (file)
@@ -120,9 +120,34 @@ fn next(&mut self) -> Option<Result<char, DecodeUtf16Error>> {
     #[inline]
     fn size_hint(&self) -> (usize, Option<usize>) {
         let (low, high) = self.iter.size_hint();
-        // we could be entirely valid surrogates (2 elements per
-        // char), or entirely non-surrogates (1 element per char)
-        (low / 2, high)
+
+        let (low_buf, high_buf) = match self.buf {
+            // buf is empty, no additional elements from it.
+            None => (0, 0),
+            // `u` is a non surrogate, so it's always an additional character.
+            Some(u) if u < 0xD800 || 0xDFFF < u => (1, 1),
+            // `u` is a leading surrogate (it can never be a trailing surrogate and
+            // it's a surrogate due to the previous branch) and `self.iter` is empty.
+            //
+            // `u` can't be paired, since the `self.iter` is empty,
+            // so it will always become an additional element (error).
+            Some(_u) if high == Some(0) => (1, 1),
+            // `u` is a leading surrogate and `iter` may be non-empty.
+            //
+            // `u` can either pair with a trailing surrogate, in which case no additional elements
+            // are produced, or it can become an error, in which case it's an additional character (error).
+            Some(_u) => (0, 1),
+        };
+
+        // `self.iter` could contain entirely valid surrogates (2 elements per
+        // char), or entirely non-surrogates (1 element per char).
+        //
+        // On odd lower bound, at least one element must stay unpaired
+        // (with other elements from `self.iter`), so we round up.
+        let low = low.div_ceil(2) + low_buf;
+        let high = high.and_then(|h| h.checked_add(high_buf));
+
+        (low, high)
     }
 }
 
index 7250dca2adfe45bd1d55b7e27105b6a00c0a6283..c4c0a5a6c78ad5059a882f1198aafa38da8cd7fd 100644 (file)
@@ -9,14 +9,19 @@
 
 #[lang = "char"]
 impl char {
-    /// The highest valid code point a `char` can have.
+    /// The highest valid code point a `char` can have, `'\u{10FFFF}'`.
     ///
-    /// A `char` is a [Unicode Scalar Value], which means that it is a [Code
-    /// Point], but only ones within a certain range. `MAX` is the highest valid
-    /// code point that's a valid [Unicode Scalar Value].
+    /// # Examples
+    ///
+    /// ```
+    /// # fn something_which_returns_char() -> char { 'a' }
+    /// let c: char = something_which_returns_char();
+    /// assert!(c <= char::MAX);
     ///
-    /// [Unicode Scalar Value]: https://www.unicode.org/glossary/#unicode_scalar_value
-    /// [Code Point]: https://www.unicode.org/glossary/#code_point
+    /// let value_at_max = char::MAX as u32;
+    /// assert_eq!(char::from_u32(value_at_max), Some('\u{10FFFF}'));
+    /// assert_eq!(char::from_u32(value_at_max + 1), None);
+    /// ```
     #[stable(feature = "assoc_char_consts", since = "1.52.0")]
     pub const MAX: char = '\u{10ffff}';
 
index f65f84e93aebe6a369fa9c7d27d6d405ba49903e..9364ac4f3ec1fa6c014f29e12d9b2bc68be27347 100644 (file)
     Cn  Unassigned              a reserved unassigned code point or a noncharacter
 */
 
-/// The highest valid code point a `char` can have.
+/// The highest valid code point a `char` can have, `'\u{10FFFF}'`.
 ///
-/// A [`char`] is a [Unicode Scalar Value], which means that it is a [Code
-/// Point], but only ones within a certain range. `MAX` is the highest valid
-/// code point that's a valid [Unicode Scalar Value].
+/// # Examples
 ///
-/// [Unicode Scalar Value]: https://www.unicode.org/glossary/#unicode_scalar_value
-/// [Code Point]: https://www.unicode.org/glossary/#code_point
+/// ```
+/// # fn something_which_returns_char() -> char { 'a' }
+/// let c: char = something_which_returns_char();
+/// assert!(c <= char::MAX);
+///
+/// let value_at_max = char::MAX as u32;
+/// assert_eq!(char::from_u32(value_at_max), Some('\u{10FFFF}'));
+/// assert_eq!(char::from_u32(value_at_max + 1), None);
+/// ```
 #[stable(feature = "rust1", since = "1.0.0")]
 pub const MAX: char = char::MAX;
 
index 1af352d542ac65fcf8dd99780cd9badf773bb217..a3e7747991190acccc0337aecfcb00c9462d7a6c 100644 (file)
@@ -880,7 +880,7 @@ fn partial_cmp(&self, other: &Ordering) -> Option<Ordering> {
     }
 }
 
-/// Trait for values that can be compared for a sort-order.
+/// Trait for types that form a [partial order](https://en.wikipedia.org/wiki/Partial_order).
 ///
 /// The `lt`, `le`, `gt`, and `ge` methods of this trait can be called using
 /// the `<`, `<=`, `>`, and `>=` operators, respectively.
index 8a2a64f8dc97f44e361abfde4d2e00a0c7a2ac44..e1ea98813031aac5b15b675c995e7eb32756f3ac 100644 (file)
@@ -308,9 +308,21 @@ pub unsafe fn new() -> Self {
     loop {}
 };
 
+macro_rules! arg_new {
+    ($f: ident, $t: ident) => {
+        #[doc(hidden)]
+        #[unstable(feature = "fmt_internals", reason = "internal to format_args!", issue = "none")]
+        #[inline]
+        pub fn $f<'b, T: $t>(x: &'b T) -> ArgumentV1<'_> {
+            Self::new(x, $t::fmt)
+        }
+    };
+}
+
 impl<'a> ArgumentV1<'a> {
     #[doc(hidden)]
     #[unstable(feature = "fmt_internals", reason = "internal to format_args!", issue = "none")]
+    #[inline]
     pub fn new<'b, T>(x: &'b T, f: fn(&T, &mut Formatter<'_>) -> Result) -> ArgumentV1<'b> {
         // SAFETY: `mem::transmute(x)` is safe because
         //     1. `&'b T` keeps the lifetime it originated with `'b`
@@ -323,6 +335,16 @@ pub fn new<'b, T>(x: &'b T, f: fn(&T, &mut Formatter<'_>) -> Result) -> Argument
         unsafe { ArgumentV1 { formatter: mem::transmute(f), value: mem::transmute(x) } }
     }
 
+    arg_new!(new_display, Display);
+    arg_new!(new_debug, Debug);
+    arg_new!(new_octal, Octal);
+    arg_new!(new_lower_hex, LowerHex);
+    arg_new!(new_upper_hex, UpperHex);
+    arg_new!(new_pointer, Pointer);
+    arg_new!(new_binary, Binary);
+    arg_new!(new_lower_exp, LowerExp);
+    arg_new!(new_upper_exp, UpperExp);
+
     #[doc(hidden)]
     #[unstable(feature = "fmt_internals", reason = "internal to format_args!", issue = "none")]
     pub fn from_usize(x: &usize) -> ArgumentV1<'_> {
index cac1866188eff1dc0c13386d2c7b6e5db81a6d0c..0912f8675fa84d18467f88806fd4ae83367097e1 100644 (file)
@@ -13,7 +13,7 @@ pub trait IntoFuture {
 
     /// Creates a future from a value.
     #[unstable(feature = "into_future", issue = "67644")]
-    #[cfg_attr(not(bootstrap), lang = "into_future")]
+    #[lang = "into_future"]
     fn into_future(self) -> Self::Future;
 }
 
index a6ffbe07d91b0e6642b62fafce24a03f29efcc51..fa4eb0d2f33eead93f5362d3907d3618d7b217b6 100644 (file)
@@ -9,7 +9,7 @@
 /// Polls multiple futures simultaneously, returning a tuple
 /// of all results once complete.
 ///
-/// While `join!(a, b)` is similar to `(a.await, b.await)`,
+/// While `join!(a, b).await` is similar to `(a.await, b.await)`,
 /// `join!` polls both futures concurrently and is therefore more efficient.
 ///
 /// # Examples
index 9781dc320edde90ab9911d40709d5ec1bb8f0f53..b5228397f0a9990f10cd245c838c307dec120cfe 100644 (file)
@@ -1914,10 +1914,31 @@ pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
     #[rustc_const_unstable(feature = "const_raw_ptr_comparison", issue = "53020")]
     pub fn ptr_guaranteed_ne<T>(ptr: *const T, other: *const T) -> bool;
 
-    /// Allocate at compile time. Should not be called at runtime.
+    /// Allocates a block of memory at compile time.
+    /// At runtime, just returns a null pointer.
+    ///
+    /// # Safety
+    ///
+    /// - The `align` argument must be a power of two.
+    ///    - At compile time, a compile error occurs if this constraint is violated.
+    ///    - At runtime, it is not checked.
     #[rustc_const_unstable(feature = "const_heap", issue = "79597")]
     pub fn const_allocate(size: usize, align: usize) -> *mut u8;
 
+    /// Deallocates a memory which allocated by `intrinsics::const_allocate` at compile time.
+    /// At runtime, does nothing.
+    ///
+    /// # Safety
+    ///
+    /// - The `align` argument must be a power of two.
+    ///    - At compile time, a compile error occurs if this constraint is violated.
+    ///    - At runtime, it is not checked.
+    /// - If the `ptr` is created in an another const, this intrinsic doesn't deallocate it.
+    /// - If the `ptr` is pointing to a local variable, this intrinsic doesn't deallocate it.
+    #[rustc_const_unstable(feature = "const_heap", issue = "79597")]
+    #[cfg(not(bootstrap))]
+    pub fn const_deallocate(ptr: *mut u8, size: usize, align: usize);
+
     /// Determines whether the raw bytes of the two values are equal.
     ///
     /// This is particularly handy for arrays, since it allows things like just
index 65cadcb6c5a4f2aa79392907647875cf7bfb7568..a8fe5f59bae0148794c333f14e48b6588d216b49 100644 (file)
@@ -515,7 +515,7 @@ fn chain<U>(self, other: U) -> Chain<Self, U::IntoIter>
     /// assert_eq!((2, 'o'), zipper[2]);
     /// ```
     ///
-    /// If both iterators have roughly equivalent syntax, it may me more readable to use [`zip`]:
+    /// If both iterators have roughly equivalent syntax, it may be more readable to use [`zip`]:
     ///
     /// ```
     /// use std::iter::zip;
index d8ac816fb15a0309648809330f6452d5fa894ac8..e52d52e954c8fff08f335a4d20ce309c6510d312 100644 (file)
     test(no_crate_inject, attr(deny(warnings))),
     test(attr(allow(dead_code, deprecated, unused_variables, unused_mut)))
 )]
-#![cfg_attr(
-    not(bootstrap),
-    doc(cfg_hide(
-        not(test),
-        any(not(feature = "miri-test-libstd"), test, doctest),
-        no_fp_fmt_parse,
-        target_pointer_width = "16",
-        target_pointer_width = "32",
-        target_pointer_width = "64",
-        target_has_atomic = "8",
-        target_has_atomic = "16",
-        target_has_atomic = "32",
-        target_has_atomic = "64",
-        target_has_atomic = "ptr",
-        target_has_atomic_equal_alignment = "8",
-        target_has_atomic_equal_alignment = "16",
-        target_has_atomic_equal_alignment = "32",
-        target_has_atomic_equal_alignment = "64",
-        target_has_atomic_equal_alignment = "ptr",
-        target_has_atomic_load_store = "8",
-        target_has_atomic_load_store = "16",
-        target_has_atomic_load_store = "32",
-        target_has_atomic_load_store = "64",
-        target_has_atomic_load_store = "ptr",
-    ))
-)]
+#![doc(cfg_hide(
+    not(test),
+    any(not(feature = "miri-test-libstd"), test, doctest),
+    no_fp_fmt_parse,
+    target_pointer_width = "16",
+    target_pointer_width = "32",
+    target_pointer_width = "64",
+    target_has_atomic = "8",
+    target_has_atomic = "16",
+    target_has_atomic = "32",
+    target_has_atomic = "64",
+    target_has_atomic = "ptr",
+    target_has_atomic_equal_alignment = "8",
+    target_has_atomic_equal_alignment = "16",
+    target_has_atomic_equal_alignment = "32",
+    target_has_atomic_equal_alignment = "64",
+    target_has_atomic_equal_alignment = "ptr",
+    target_has_atomic_load_store = "8",
+    target_has_atomic_load_store = "16",
+    target_has_atomic_load_store = "32",
+    target_has_atomic_load_store = "64",
+    target_has_atomic_load_store = "ptr",
+))]
 #![no_core]
 //
 // Lints:
@@ -374,6 +371,12 @@ pub mod arch {
     pub use crate::core_arch::arch::*;
 
     /// Inline assembly.
+    ///
+    /// Refer to [rust by example] for a usage guide and the [reference] for
+    /// detailed information about the syntax and available options.
+    ///
+    /// [rust by example]: https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html
+    /// [reference]: https://doc.rust-lang.org/nightly/reference/inline-assembly.html
     #[stable(feature = "asm", since = "1.59.0")]
     #[rustc_builtin_macro]
     pub macro asm("assembly template", $(operands,)* $(options($(option),*))?) {
@@ -381,6 +384,12 @@ pub mod arch {
     }
 
     /// Module-level inline assembly.
+    ///
+    /// Refer to [rust by example] for a usage guide and the [reference] for
+    /// detailed information about the syntax and available options.
+    ///
+    /// [rust by example]: https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html
+    /// [reference]: https://doc.rust-lang.org/nightly/reference/inline-assembly.html
     #[stable(feature = "global_asm", since = "1.59.0")]
     #[rustc_builtin_macro]
     pub macro global_asm("assembly template", $(operands,)* $(options($(option),*))?) {
index 488bb875c352685a7213d2ae0d739ebe0b603c85..0cc428d6962782b247914d4ccf9afc8bbc91e989 100644 (file)
@@ -1003,7 +1003,6 @@ macro_rules! concat_idents {
     /// assert_eq!(s, b"ABCDEF");
     /// # }
     /// ```
-    #[cfg(not(bootstrap))]
     #[unstable(feature = "concat_bytes", issue = "87555")]
     #[rustc_builtin_macro]
     #[macro_export]
index 0b8ed0cc174b42a4a5dcc792087255b52e09fb51..d8dcfdafa8df9d0af4543eeed547e16677145211 100644 (file)
@@ -1008,29 +1008,37 @@ pub const fn from_bits(v: u32) -> Self {
         Self::from_bits(u32::from_ne_bytes(bytes))
     }
 
-    /// Returns an ordering between self and other values.
+    /// Return the ordering between `self` and `other`.
+    ///
     /// Unlike the standard partial comparison between floating point numbers,
     /// this comparison always produces an ordering in accordance to
-    /// the totalOrder predicate as defined in IEEE 754 (2008 revision)
-    /// floating point standard. The values are ordered in following order:
-    /// - Negative quiet NaN
-    /// - Negative signaling NaN
-    /// - Negative infinity
-    /// - Negative numbers
-    /// - Negative subnormal numbers
-    /// - Negative zero
-    /// - Positive zero
-    /// - Positive subnormal numbers
-    /// - Positive numbers
-    /// - Positive infinity
-    /// - Positive signaling NaN
-    /// - Positive quiet NaN
-    ///
-    /// Note that this function does not always agree with the [`PartialOrd`]
-    /// and [`PartialEq`] implementations of `f32`. In particular, they regard
-    /// negative and positive zero as equal, while `total_cmp` doesn't.
+    /// the `totalOrder` predicate as defined in the IEEE 754 (2008 revision)
+    /// floating point standard. The values are ordered in the following sequence:
+    ///
+    /// - negative quiet NaN
+    /// - negative signaling NaN
+    /// - negative infinity
+    /// - negative numbers
+    /// - negative subnormal numbers
+    /// - negative zero
+    /// - positive zero
+    /// - positive subnormal numbers
+    /// - positive numbers
+    /// - positive infinity
+    /// - positive signaling NaN
+    /// - positive quiet NaN.
+    ///
+    /// The ordering established by this function does not always agree with the
+    /// [`PartialOrd`] and [`PartialEq`] implementations of `f32`. For example,
+    /// they consider negative and positive zero equal, while `total_cmp`
+    /// doesn't.
+    ///
+    /// The interpretation of the signaling NaN bit follows the definition in
+    /// the IEEE 754 standard, which may not match the interpretation by some of
+    /// the older, non-conformant (e.g. MIPS) hardware implementations.
     ///
     /// # Example
+    ///
     /// ```
     /// #![feature(total_cmp)]
     /// struct GoodBoy {
index 5a3cd2a4b92600286983480dd0ea0f9b9ed6544d..7c2f51ff64639db45dad8dce1543c9004b04f5a5 100644 (file)
@@ -1024,29 +1024,37 @@ pub const fn from_bits(v: u64) -> Self {
         Self::from_bits(u64::from_ne_bytes(bytes))
     }
 
-    /// Returns an ordering between self and other values.
+    /// Return the ordering between `self` and `other`.
+    ///
     /// Unlike the standard partial comparison between floating point numbers,
     /// this comparison always produces an ordering in accordance to
-    /// the totalOrder predicate as defined in IEEE 754 (2008 revision)
-    /// floating point standard. The values are ordered in following order:
-    /// - Negative quiet NaN
-    /// - Negative signaling NaN
-    /// - Negative infinity
-    /// - Negative numbers
-    /// - Negative subnormal numbers
-    /// - Negative zero
-    /// - Positive zero
-    /// - Positive subnormal numbers
-    /// - Positive numbers
-    /// - Positive infinity
-    /// - Positive signaling NaN
-    /// - Positive quiet NaN
-    ///
-    /// Note that this function does not always agree with the [`PartialOrd`]
-    /// and [`PartialEq`] implementations of `f64`. In particular, they regard
-    /// negative and positive zero as equal, while `total_cmp` doesn't.
+    /// the `totalOrder` predicate as defined in the IEEE 754 (2008 revision)
+    /// floating point standard. The values are ordered in the following sequence:
+    ///
+    /// - negative quiet NaN
+    /// - negative signaling NaN
+    /// - negative infinity
+    /// - negative numbers
+    /// - negative subnormal numbers
+    /// - negative zero
+    /// - positive zero
+    /// - positive subnormal numbers
+    /// - positive numbers
+    /// - positive infinity
+    /// - positive signaling NaN
+    /// - positive quiet NaN.
+    ///
+    /// The ordering established by this function does not always agree with the
+    /// [`PartialOrd`] and [`PartialEq`] implementations of `f64`. For example,
+    /// they consider negative and positive zero equal, while `total_cmp`
+    /// doesn't.
+    ///
+    /// The interpretation of the signaling NaN bit follows the definition in
+    /// the IEEE 754 standard, which may not match the interpretation by some of
+    /// the older, non-conformant (e.g. MIPS) hardware implementations.
     ///
     /// # Example
+    ///
     /// ```
     /// #![feature(total_cmp)]
     /// struct GoodBoy {
index 317555034756d8be6b9b0825c9ef19c84f056d85..8982473b2dc0378bed4cd2bab60feba7239037c4 100644 (file)
@@ -217,18 +217,6 @@ fn add(self, other: Saturating<$t>) -> Saturating<$t> {
         forward_ref_binop! { impl Add, add for Saturating<$t>, Saturating<$t>,
                 #[unstable(feature = "saturating_int_impl", issue = "87920")] }
 
-        #[unstable(feature = "saturating_int_assign_impl", issue = "92354")]
-        impl Add<$t> for Saturating<$t> {
-            type Output = Saturating<$t>;
-
-            #[inline]
-            fn add(self, other: $t) -> Saturating<$t> {
-                Saturating(self.0.saturating_add(other))
-            }
-        }
-        forward_ref_binop! { impl Add, add for Saturating<$t>, $t,
-                #[unstable(feature = "saturating_int_assign_impl", issue = "92354")] }
-
         #[unstable(feature = "saturating_int_impl", issue = "87920")]
         impl AddAssign for Saturating<$t> {
             #[inline]
@@ -242,7 +230,7 @@ fn add_assign(&mut self, other: Saturating<$t>) {
         impl AddAssign<$t> for Saturating<$t> {
             #[inline]
             fn add_assign(&mut self, other: $t) {
-                *self = *self + other;
+                *self = *self + Saturating(other);
             }
         }
         forward_ref_op_assign! { impl AddAssign, add_assign for Saturating<$t>, $t }
@@ -259,18 +247,6 @@ fn sub(self, other: Saturating<$t>) -> Saturating<$t> {
         forward_ref_binop! { impl Sub, sub for Saturating<$t>, Saturating<$t>,
                 #[unstable(feature = "saturating_int_impl", issue = "87920")] }
 
-        #[unstable(feature = "saturating_int_assign_impl", issue = "92354")]
-        impl Sub<$t> for Saturating<$t> {
-            type Output = Saturating<$t>;
-
-            #[inline]
-            fn sub(self, other: $t) -> Saturating<$t> {
-                Saturating(self.0.saturating_sub(other))
-            }
-        }
-        forward_ref_binop! { impl Sub, sub for Saturating<$t>, $t,
-                #[unstable(feature = "saturating_int_assign_impl", issue = "92354")] }
-
         #[unstable(feature = "saturating_int_impl", issue = "87920")]
         impl SubAssign for Saturating<$t> {
             #[inline]
@@ -284,7 +260,7 @@ fn sub_assign(&mut self, other: Saturating<$t>) {
         impl SubAssign<$t> for Saturating<$t> {
             #[inline]
             fn sub_assign(&mut self, other: $t) {
-                *self = *self - other;
+                *self = *self - Saturating(other);
             }
         }
         forward_ref_op_assign! { impl SubAssign, sub_assign for Saturating<$t>, $t }
@@ -301,18 +277,6 @@ fn mul(self, other: Saturating<$t>) -> Saturating<$t> {
         forward_ref_binop! { impl Mul, mul for Saturating<$t>, Saturating<$t>,
                 #[unstable(feature = "saturating_int_impl", issue = "87920")] }
 
-        #[unstable(feature = "saturating_int_assign_impl", issue = "92354")]
-        impl Mul<$t> for Saturating<$t> {
-            type Output = Saturating<$t>;
-
-            #[inline]
-            fn mul(self, other: $t) -> Saturating<$t> {
-                Saturating(self.0.saturating_mul(other))
-            }
-        }
-        forward_ref_binop! { impl Mul, mul for Saturating<$t>, $t,
-                #[unstable(feature = "saturating_int_assign_impl", issue = "92354")] }
-
         #[unstable(feature = "saturating_int_impl", issue = "87920")]
         impl MulAssign for Saturating<$t> {
             #[inline]
@@ -326,7 +290,7 @@ fn mul_assign(&mut self, other: Saturating<$t>) {
         impl MulAssign<$t> for Saturating<$t> {
             #[inline]
             fn mul_assign(&mut self, other: $t) {
-                *self = *self * other;
+                *self = *self * Saturating(other);
             }
         }
         forward_ref_op_assign! { impl MulAssign, mul_assign for Saturating<$t>, $t }
@@ -362,36 +326,6 @@ fn div(self, other: Saturating<$t>) -> Saturating<$t> {
         forward_ref_binop! { impl Div, div for Saturating<$t>, Saturating<$t>,
                 #[unstable(feature = "saturating_int_impl", issue = "87920")] }
 
-        /// # Examples
-        ///
-        /// Basic usage:
-        ///
-        /// ```
-        /// #![feature(saturating_int_impl, saturating_int_assign_impl)]
-        /// use std::num::Saturating;
-        ///
-        #[doc = concat!("assert_eq!(Saturating(2", stringify!($t), "), Saturating(5", stringify!($t), ") / 2);")]
-        #[doc = concat!("assert_eq!(Saturating(", stringify!($t), "::MAX), Saturating(", stringify!($t), "::MAX) / 1);")]
-        #[doc = concat!("assert_eq!(Saturating(", stringify!($t), "::MIN), Saturating(", stringify!($t), "::MIN) / 1);")]
-        /// ```
-        ///
-        /// ```should_panic
-        /// #![feature(saturating_int_impl, saturating_int_assign_impl)]
-        /// use std::num::Saturating;
-        ///
-        #[doc = concat!("let _ = Saturating(0", stringify!($t), ") / 0;")]
-        /// ```
-        #[unstable(feature = "saturating_int_assign_impl", issue = "92354")]
-        impl Div<$t> for Saturating<$t> {
-            type Output = Saturating<$t>;
-
-            #[inline]
-            fn div(self, other: $t) -> Saturating<$t> {
-                Saturating(self.0.saturating_div(other))
-            }
-        }
-        forward_ref_binop! { impl Div, div for Saturating<$t>, $t,
-                #[unstable(feature = "saturating_int_assign_impl", issue = "92354")] }
 
         #[unstable(feature = "saturating_int_impl", issue = "87920")]
         impl DivAssign for Saturating<$t> {
@@ -406,7 +340,7 @@ fn div_assign(&mut self, other: Saturating<$t>) {
         impl DivAssign<$t> for Saturating<$t> {
             #[inline]
             fn div_assign(&mut self, other: $t) {
-                *self = *self / other;
+                *self = *self / Saturating(other);
             }
         }
         forward_ref_op_assign! { impl DivAssign, div_assign for Saturating<$t>, $t }
@@ -423,18 +357,6 @@ fn rem(self, other: Saturating<$t>) -> Saturating<$t> {
         forward_ref_binop! { impl Rem, rem for Saturating<$t>, Saturating<$t>,
                 #[unstable(feature = "saturating_int_impl", issue = "87920")] }
 
-        #[unstable(feature = "saturating_int_assign_impl", issue = "92354")]
-        impl Rem<$t> for Saturating<$t> {
-            type Output = Saturating<$t>;
-
-            #[inline]
-            fn rem(self, other: $t) -> Saturating<$t> {
-                Saturating(self.0.rem(other))
-            }
-        }
-        forward_ref_binop! { impl Rem, rem for Saturating<$t>, $t,
-                #[unstable(feature = "saturating_int_assign_impl", issue = "92354")] }
-
         #[unstable(feature = "saturating_int_impl", issue = "87920")]
         impl RemAssign for Saturating<$t> {
             #[inline]
@@ -448,7 +370,7 @@ fn rem_assign(&mut self, other: Saturating<$t>) {
         impl RemAssign<$t> for Saturating<$t> {
             #[inline]
             fn rem_assign(&mut self, other: $t) {
-                *self = *self % other;
+                *self = *self % Saturating(other);
             }
         }
         forward_ref_op_assign! { impl RemAssign, rem_assign for Saturating<$t>, $t }
@@ -477,18 +399,6 @@ fn bitxor(self, other: Saturating<$t>) -> Saturating<$t> {
         forward_ref_binop! { impl BitXor, bitxor for Saturating<$t>, Saturating<$t>,
                 #[unstable(feature = "saturating_int_impl", issue = "87920")] }
 
-        #[unstable(feature = "saturating_int_assign_impl", issue = "92354")]
-        impl BitXor<$t> for Saturating<$t> {
-            type Output = Saturating<$t>;
-
-            #[inline]
-            fn bitxor(self, other: $t) -> Saturating<$t> {
-                Saturating(self.0 ^ other)
-            }
-        }
-        forward_ref_binop! { impl BitXor, bitxor for Saturating<$t>, $t,
-                #[unstable(feature = "saturating_int_assign_impl", issue = "92354")] }
-
         #[unstable(feature = "saturating_int_impl", issue = "87920")]
         impl BitXorAssign for Saturating<$t> {
             #[inline]
@@ -502,7 +412,7 @@ fn bitxor_assign(&mut self, other: Saturating<$t>) {
         impl BitXorAssign<$t> for Saturating<$t> {
             #[inline]
             fn bitxor_assign(&mut self, other: $t) {
-                *self = *self ^ other;
+                *self = *self ^ Saturating(other);
             }
         }
         forward_ref_op_assign! { impl BitXorAssign, bitxor_assign for Saturating<$t>, $t }
@@ -519,18 +429,6 @@ fn bitor(self, other: Saturating<$t>) -> Saturating<$t> {
         forward_ref_binop! { impl BitOr, bitor for Saturating<$t>, Saturating<$t>,
                 #[unstable(feature = "saturating_int_impl", issue = "87920")] }
 
-        #[unstable(feature = "saturating_int_assign_impl", issue = "92354")]
-        impl BitOr<$t> for Saturating<$t> {
-            type Output = Saturating<$t>;
-
-            #[inline]
-            fn bitor(self, other: $t) -> Saturating<$t> {
-                Saturating(self.0 | other)
-            }
-        }
-        forward_ref_binop! { impl BitOr, bitor for Saturating<$t>, $t,
-                #[unstable(feature = "saturating_int_assign_impl", issue = "92354")] }
-
         #[unstable(feature = "saturating_int_impl", issue = "87920")]
         impl BitOrAssign for Saturating<$t> {
             #[inline]
@@ -544,7 +442,7 @@ fn bitor_assign(&mut self, other: Saturating<$t>) {
         impl BitOrAssign<$t> for Saturating<$t> {
             #[inline]
             fn bitor_assign(&mut self, other: $t) {
-                *self = *self | other;
+                *self = *self | Saturating(other);
             }
         }
         forward_ref_op_assign! { impl BitOrAssign, bitor_assign for Saturating<$t>, $t }
@@ -561,18 +459,6 @@ fn bitand(self, other: Saturating<$t>) -> Saturating<$t> {
         forward_ref_binop! { impl BitAnd, bitand for Saturating<$t>, Saturating<$t>,
                 #[unstable(feature = "saturating_int_impl", issue = "87920")] }
 
-        #[unstable(feature = "saturating_int_assign_impl", issue = "92354")]
-        impl BitAnd<$t> for Saturating<$t> {
-            type Output = Saturating<$t>;
-
-            #[inline]
-            fn bitand(self, other: $t) -> Saturating<$t> {
-                Saturating(self.0 & other)
-            }
-        }
-        forward_ref_binop! { impl BitAnd, bitand for Saturating<$t>, $t,
-                #[unstable(feature = "saturating_int_assign_impl", issue = "92354")] }
-
         #[unstable(feature = "saturating_int_impl", issue = "87920")]
         impl BitAndAssign for Saturating<$t> {
             #[inline]
@@ -586,7 +472,7 @@ fn bitand_assign(&mut self, other: Saturating<$t>) {
         impl BitAndAssign<$t> for Saturating<$t> {
             #[inline]
             fn bitand_assign(&mut self, other: $t) {
-                *self = *self & other;
+                *self = *self & Saturating(other);
             }
         }
         forward_ref_op_assign! { impl BitAndAssign, bitand_assign for Saturating<$t>, $t }
index d91289fad2009ea64c65b8c68df3de8b9f80d4b0..b566e211cd89defc87a883fd406e15e72470777b 100644 (file)
@@ -65,7 +65,6 @@
     issue = "87555",
     reason = "`concat_bytes` is not stable enough for use and is subject to change"
 )]
-#[cfg(not(bootstrap))]
 #[doc(no_inline)]
 pub use crate::concat_bytes;
 
index 3a7e99faccf23d2ff927bf0f1f78e82aec1a96e3..3f5d3f62c96044b587868088eb7c5bad076a163e 100644 (file)
@@ -211,8 +211,9 @@ impl<T: ?Sized> NonNull<T> {
     /// }
     /// ```
     #[stable(feature = "nonnull", since = "1.25.0")]
+    #[rustc_const_unstable(feature = "const_nonnull_new", issue = "93235")]
     #[inline]
-    pub fn new(ptr: *mut T) -> Option<Self> {
+    pub const fn new(ptr: *mut T) -> Option<Self> {
         if !ptr.is_null() {
             // SAFETY: The pointer is already checked and is not null
             Some(unsafe { Self::new_unchecked(ptr) })
index 0599f2740139410d67f745078e91393c4fbdbaa0..4e22c1d8c6d94e999f5c783d6c140bac9c1eafd1 100644 (file)
@@ -2558,50 +2558,6 @@ pub fn sort_unstable_by_key<K, F>(&mut self, mut f: F)
         sort::quicksort(self, |a, b| f(a).lt(&f(b)));
     }
 
-    /// Reorder the slice such that the element at `index` is at its final sorted position.
-    #[unstable(feature = "slice_partition_at_index", issue = "55300")]
-    #[rustc_deprecated(since = "1.49.0", reason = "use the select_nth_unstable() instead")]
-    #[inline]
-    pub fn partition_at_index(&mut self, index: usize) -> (&mut [T], &mut T, &mut [T])
-    where
-        T: Ord,
-    {
-        self.select_nth_unstable(index)
-    }
-
-    /// Reorder the slice with a comparator function such that the element at `index` is at its
-    /// final sorted position.
-    #[unstable(feature = "slice_partition_at_index", issue = "55300")]
-    #[rustc_deprecated(since = "1.49.0", reason = "use select_nth_unstable_by() instead")]
-    #[inline]
-    pub fn partition_at_index_by<F>(
-        &mut self,
-        index: usize,
-        compare: F,
-    ) -> (&mut [T], &mut T, &mut [T])
-    where
-        F: FnMut(&T, &T) -> Ordering,
-    {
-        self.select_nth_unstable_by(index, compare)
-    }
-
-    /// Reorder the slice with a key extraction function such that the element at `index` is at its
-    /// final sorted position.
-    #[unstable(feature = "slice_partition_at_index", issue = "55300")]
-    #[rustc_deprecated(since = "1.49.0", reason = "use the select_nth_unstable_by_key() instead")]
-    #[inline]
-    pub fn partition_at_index_by_key<K, F>(
-        &mut self,
-        index: usize,
-        f: F,
-    ) -> (&mut [T], &mut T, &mut [T])
-    where
-        F: FnMut(&T) -> K,
-        K: Ord,
-    {
-        self.select_nth_unstable_by_key(index, f)
-    }
-
     /// Reorder the slice such that the element at `index` is at its final sorted position.
     ///
     /// This reordering has the additional property that any value at position `i < index` will be
index 8f58e8897b34bc493ce01a38fbda4d0ad838d0e5..2ba0e5320d7b913a737e28ae147ea9528ff39bd5 100644 (file)
@@ -773,7 +773,7 @@ fn recurse<'a, T, F>(mut v: &'a mut [T], is_less: &mut F, mut pred: Option<&'a T
                 let mid = partition_equal(v, pivot, is_less);
 
                 // Continue sorting elements greater than the pivot.
-                v = &mut { v }[mid..];
+                v = &mut v[mid..];
                 continue;
             }
         }
@@ -784,7 +784,7 @@ fn recurse<'a, T, F>(mut v: &'a mut [T], is_less: &mut F, mut pred: Option<&'a T
         was_partitioned = was_p;
 
         // Split the slice into `left`, `pivot`, and `right`.
-        let (left, right) = { v }.split_at_mut(mid);
+        let (left, right) = v.split_at_mut(mid);
         let (pivot, right) = right.split_at_mut(1);
         let pivot = &pivot[0];
 
@@ -860,7 +860,7 @@ fn partition_at_index_loop<'a, T, F>(
         let (mid, _) = partition(v, pivot, is_less);
 
         // Split the slice into `left`, `pivot`, and `right`.
-        let (left, right) = { v }.split_at_mut(mid);
+        let (left, right) = v.split_at_mut(mid);
         let (pivot, right) = right.split_at_mut(1);
         let pivot = &pivot[0];
 
index 2b857a6591929d1cbf0fa00ed7d73664fa2cfea7..4c899b6eb43d0c5b1e1934b16edffc825d3a8a82 100644 (file)
@@ -308,6 +308,33 @@ fn check(s: &[u16], expected: &[Result<char, u16>]) {
     check(&[0xD800, 0], &[Err(0xD800), Ok('\0')]);
 }
 
+#[test]
+fn test_decode_utf16_size_hint() {
+    fn check(s: &[u16]) {
+        let mut iter = char::decode_utf16(s.iter().cloned());
+
+        loop {
+            let count = iter.clone().count();
+            let (lower, upper) = iter.size_hint();
+
+            assert!(
+                lower <= count && count <= upper.unwrap(),
+                "lower = {lower}, count = {count}, upper = {upper:?}"
+            );
+
+            if let None = iter.next() {
+                break;
+            }
+        }
+    }
+
+    check(&[0xD800, 0xD800, 0xDC00]);
+    check(&[0xD800, 0xD800, 0x0]);
+    check(&[0xD800, 0x41, 0x42]);
+    check(&[0xD800, 0]);
+    check(&[0xD834, 0x006d]);
+}
+
 #[test]
 fn ed_iterator_specializations() {
     // Check counting
index 58fee19ca7490d3e2251fe3e8ad40a101bcac1f0..2b234de6795eb9c59644a697cca5bb0a9bb7994a 100644 (file)
@@ -204,7 +204,6 @@ fn partial_cmp(&self, other: &RevInt) -> Option<Ordering> {
     assert_eq!(Fool(false), Fool(true));
 }
 
-#[cfg(not(bootstrap))]
 mod const_cmp {
     use super::*;
 
index 7a2e4e290655743ce958eafe5eb76c7698d96725..e050e8103752283c4d773f57fd752ddc4b286fb7 100644 (file)
@@ -37,7 +37,6 @@ fn test_assume_can_be_in_const_contexts() {
 }
 
 #[test]
-#[cfg(not(bootstrap))]
 const fn test_write_bytes_in_const_contexts() {
     use core::intrinsics::write_bytes;
 
@@ -80,3 +79,25 @@ fn test_hints_in_const_contexts() {
         assert!(42u32 == core::hint::black_box(42u32));
     }
 }
+
+#[cfg(not(bootstrap))]
+#[test]
+fn test_const_allocate_at_runtime() {
+    use core::intrinsics::const_allocate;
+    unsafe {
+        assert!(const_allocate(4, 4).is_null());
+    }
+}
+
+#[cfg(not(bootstrap))]
+#[test]
+fn test_const_deallocate_at_runtime() {
+    use core::intrinsics::const_deallocate;
+    const X: &u32 = &42u32;
+    let x = &0u32;
+    unsafe {
+        const_deallocate(X as *const _ as *mut u8, 4, 4); // nop
+        const_deallocate(x as *const _ as *mut u8, 4, 4); // nop
+        const_deallocate(core::ptr::null_mut(), 1, 1); // nop
+    }
+}
index 841c114063dc1de7c783a6222dec1452fa512105..ebe1a63a470d32c7c27cc61fd8e4654fe77bef1c 100644 (file)
 #![feature(const_bool_to_option)]
 #![feature(const_cell_into_inner)]
 #![feature(const_convert)]
+#![feature(const_heap)]
 #![feature(const_maybe_uninit_as_mut_ptr)]
 #![feature(const_maybe_uninit_assume_init)]
 #![feature(const_maybe_uninit_assume_init_read)]
+#![feature(const_nonnull_new)]
 #![feature(const_num_from_num)]
+#![feature(const_ptr_as_ref)]
 #![feature(const_ptr_read)]
 #![feature(const_ptr_write)]
 #![feature(const_ptr_offset)]
@@ -43,7 +46,6 @@
 #![feature(is_sorted)]
 #![feature(pattern)]
 #![feature(sort_internals)]
-#![feature(slice_partition_at_index)]
 #![feature(slice_take)]
 #![feature(maybe_uninit_uninit_array)]
 #![feature(maybe_uninit_array_assume_init)]
index b9c0d75b702e5ffb8d284a284fa80a19617659ac..9c65871ac4b4cfc9fa4190b76fbf9e01e8cf9b00 100644 (file)
@@ -251,7 +251,6 @@ fn test_set_memory() {
 }
 
 #[test]
-#[cfg(not(bootstrap))]
 fn test_set_memory_const() {
     const XS: [u8; 20] = {
         let mut xs = [0u8; 20];
@@ -274,6 +273,21 @@ fn test_unsized_nonnull() {
     assert!(ys == zs);
 }
 
+#[test]
+fn test_const_nonnull_new() {
+    const {
+        assert!(NonNull::new(core::ptr::null_mut::<()>()).is_none());
+
+        let value = &mut 0u32;
+        let mut ptr = NonNull::new(value).unwrap();
+        unsafe { *ptr.as_mut() = 42 };
+
+        let reference = unsafe { &*ptr.as_ref() };
+        assert!(*reference == *value);
+        assert!(*reference == 42);
+    };
+}
+
 #[test]
 #[allow(warnings)]
 // Have a symbol for the test below. It doesn’t need to be an actual variadic function, match the
index 165169aedb31571514ffeb30f14bac294232e1d2..83cb119dbf97f1c8470387017b3c5849f11d1b40 100644 (file)
@@ -15,7 +15,7 @@ cfg-if = { version = "0.1.8", features = ['rustc-dep-of-std'] }
 panic_unwind = { path = "../panic_unwind", optional = true }
 panic_abort = { path = "../panic_abort" }
 core = { path = "../core" }
-libc = { version = "0.2.108", default-features = false, features = ['rustc-dep-of-std'] }
+libc = { version = "0.2.116", default-features = false, features = ['rustc-dep-of-std'] }
 compiler_builtins = { version = "0.1.66" }
 profiler_builtins = { path = "../profiler_builtins", optional = true }
 unwind = { path = "../unwind" }
@@ -45,7 +45,7 @@ fortanix-sgx-abi = { version = "0.3.2", features = ['rustc-dep-of-std'] }
 hermit-abi = { version = "0.1.19", features = ['rustc-dep-of-std'] }
 
 [target.wasm32-wasi.dependencies]
-wasi = { version = "0.9.0", features = ['rustc-dep-of-std'], default-features = false }
+wasi = { version = "0.11.0", features = ['rustc-dep-of-std'], default-features = false }
 
 [features]
 backtrace = [
index a62c01ef29b27d59407dec2c1f6410fa657d17d7..16b8bf68242ef5bd1ebf9f781c283caf344162bf 100644 (file)
@@ -1504,3 +1504,19 @@ fn create_dir_long_paths() {
     let path = Path::new("");
     assert_eq!(path.canonicalize().unwrap_err().kind(), crate::io::ErrorKind::NotFound);
 }
+
+/// Ensure ReadDir works on large directories.
+/// Regression test for https://github.com/rust-lang/rust/issues/93384.
+#[test]
+fn read_large_dir() {
+    let tmpdir = tmpdir();
+
+    let count = 32 * 1024;
+    for i in 0..count {
+        check!(fs::File::create(tmpdir.join(&i.to_string())));
+    }
+
+    for entry in fs::read_dir(tmpdir.path()).unwrap() {
+        entry.unwrap();
+    }
+}
index 489d362be427660e6a5e864104128de066ab2a22..3a6b931f53b9d090ade08e2bdff0c0977dc8bc81 100644 (file)
     test(no_crate_inject, attr(deny(warnings))),
     test(attr(allow(dead_code, deprecated, unused_variables, unused_mut)))
 )]
-#![cfg_attr(
-    not(bootstrap),
-    doc(cfg_hide(
-        not(test),
-        not(any(test, bootstrap)),
-        no_global_oom_handling,
-        not(no_global_oom_handling)
-    ))
-)]
+#![doc(cfg_hide(
+    not(test),
+    not(any(test, bootstrap)),
+    no_global_oom_handling,
+    not(no_global_oom_handling)
+))]
 // Don't link to std. We are std.
 #![no_std]
 #![warn(deprecated_in_future)]
 #![feature(cfg_target_thread_local)]
 #![feature(char_error_internals)]
 #![feature(char_internals)]
-#![cfg_attr(not(bootstrap), feature(concat_bytes))]
+#![feature(concat_bytes)]
 #![feature(concat_idents)]
 #![feature(const_fn_floating_point_arithmetic)]
 #![feature(const_fn_fn_ptr_basics)]
 pub use alloc_crate::vec;
 #[stable(feature = "rust1", since = "1.0.0")]
 pub use core::any;
-#[stable(feature = "simd_arch", since = "1.27.0")]
-// The `no_inline`-attribute is required to make the documentation of all
-// targets available.
-// See https://github.com/rust-lang/rust/pull/57808#issuecomment-457390549 for
-// more information.
-#[doc(no_inline)] // Note (#82861): required for correct documentation
-pub use core::arch;
 #[stable(feature = "core_array", since = "1.36.0")]
 pub use core::array;
 #[stable(feature = "rust1", since = "1.0.0")]
@@ -527,6 +517,31 @@ pub mod task {
     pub use alloc::task::*;
 }
 
+#[doc = include_str!("../../stdarch/crates/core_arch/src/core_arch_docs.md")]
+#[stable(feature = "simd_arch", since = "1.27.0")]
+pub mod arch {
+    #[stable(feature = "simd_arch", since = "1.27.0")]
+    // The `no_inline`-attribute is required to make the documentation of all
+    // targets available.
+    // See https://github.com/rust-lang/rust/pull/57808#issuecomment-457390549 for
+    // more information.
+    #[doc(no_inline)] // Note (#82861): required for correct documentation
+    pub use core::arch::*;
+
+    #[stable(feature = "simd_x86", since = "1.27.0")]
+    pub use std_detect::is_x86_feature_detected;
+    #[unstable(feature = "stdsimd", issue = "48556")]
+    pub use std_detect::{
+        is_aarch64_feature_detected, is_arm_feature_detected, is_mips64_feature_detected,
+        is_mips_feature_detected, is_powerpc64_feature_detected, is_powerpc_feature_detected,
+        is_riscv_feature_detected,
+    };
+}
+
+// This was stabilized in the crate root so we have to keep it there.
+#[stable(feature = "simd_x86", since = "1.27.0")]
+pub use std_detect::is_x86_feature_detected;
+
 // The runtime entry point and a few unstable public functions used by the
 // compiler
 #[macro_use]
@@ -545,18 +560,6 @@ pub mod task {
 #[allow(dead_code, unused_attributes)]
 mod backtrace_rs;
 
-#[stable(feature = "simd_x86", since = "1.27.0")]
-pub use std_detect::is_x86_feature_detected;
-#[doc(hidden)]
-#[unstable(feature = "stdsimd", issue = "48556")]
-pub use std_detect::*;
-#[unstable(feature = "stdsimd", issue = "48556")]
-pub use std_detect::{
-    is_aarch64_feature_detected, is_arm_feature_detected, is_mips64_feature_detected,
-    is_mips_feature_detected, is_powerpc64_feature_detected, is_powerpc_feature_detected,
-    is_riscv_feature_detected,
-};
-
 // Re-export macros defined in libcore.
 #[stable(feature = "rust1", since = "1.0.0")]
 #[allow(deprecated, deprecated_in_future)]
@@ -579,7 +582,6 @@ pub mod task {
     issue = "87555",
     reason = "`concat_bytes` is not stable enough for use and is subject to change"
 )]
-#[cfg(not(bootstrap))]
 pub use core::concat_bytes;
 
 #[stable(feature = "core_primitive", since = "1.43.0")]
index f450e41bfea1e539a0c7d0a2e476164b68dba909..9dbd4548bc92d02240e64b20a7bf24b9380ce0e5 100644 (file)
@@ -2,7 +2,7 @@
 use crate::os::unix::ffi::OsStrExt;
 use crate::path::Path;
 use crate::sys::cvt;
-use crate::{ascii, fmt, io, iter, mem};
+use crate::{ascii, fmt, io, mem, ptr};
 
 // FIXME(#43348): Make libc adapt #[doc(cfg(...))] so we don't need these fake definitions here?
 #[cfg(not(unix))]
@@ -22,8 +22,9 @@ fn sun_path_offset(addr: &libc::sockaddr_un) -> usize {
     path - base
 }
 
-pub(super) unsafe fn sockaddr_un(path: &Path) -> io::Result<(libc::sockaddr_un, libc::socklen_t)> {
-    let mut addr: libc::sockaddr_un = mem::zeroed();
+pub(super) fn sockaddr_un(path: &Path) -> io::Result<(libc::sockaddr_un, libc::socklen_t)> {
+    // SAFETY: All zeros is a valid representation for `sockaddr_un`.
+    let mut addr: libc::sockaddr_un = unsafe { mem::zeroed() };
     addr.sun_family = libc::AF_UNIX as libc::sa_family_t;
 
     let bytes = path.as_os_str().as_bytes();
@@ -41,11 +42,13 @@ pub(super) unsafe fn sockaddr_un(path: &Path) -> io::Result<(libc::sockaddr_un,
             &"path must be shorter than SUN_LEN",
         ));
     }
-    for (dst, src) in iter::zip(&mut addr.sun_path, bytes) {
-        *dst = *src as libc::c_char;
-    }
-    // null byte for pathname addresses is already there because we zeroed the
-    // struct
+    // SAFETY: `bytes` and `addr.sun_path` are not overlapping and
+    // both point to valid memory.
+    // NOTE: We zeroed the memory above, so the path is already null
+    // terminated.
+    unsafe {
+        ptr::copy_nonoverlapping(bytes.as_ptr(), addr.sun_path.as_mut_ptr().cast(), bytes.len())
+    };
 
     let mut len = sun_path_offset(&addr) + bytes.len();
     match bytes.get(0) {
@@ -127,6 +130,43 @@ pub(super) fn from_parts(
         Ok(SocketAddr { addr, len })
     }
 
+    /// Constructs a `SockAddr` with the family `AF_UNIX` and the provided path.
+    ///
+    /// # Errors
+    ///
+    /// Returns an error if the path is longer than `SUN_LEN` or if it contains
+    /// NULL bytes.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// #![feature(unix_socket_creation)]
+    /// use std::os::unix::net::SocketAddr;
+    /// use std::path::Path;
+    ///
+    /// # fn main() -> std::io::Result<()> {
+    /// let address = SocketAddr::from_path("/path/to/socket")?;
+    /// assert_eq!(address.as_pathname(), Some(Path::new("/path/to/socket")));
+    /// # Ok(())
+    /// # }
+    /// ```
+    ///
+    /// Creating a `SocketAddr` with a NULL byte results in an error.
+    ///
+    /// ```
+    /// #![feature(unix_socket_creation)]
+    /// use std::os::unix::net::SocketAddr;
+    ///
+    /// assert!(SocketAddr::from_path("/path/with/\0/bytes").is_err());
+    /// ```
+    #[unstable(feature = "unix_socket_creation", issue = "93423")]
+    pub fn from_path<P>(path: P) -> io::Result<SocketAddr>
+    where
+        P: AsRef<Path>,
+    {
+        sockaddr_un(path.as_ref()).map(|(addr, len)| SocketAddr { addr, len })
+    }
+
     /// Returns `true` if the address is unnamed.
     ///
     /// # Examples
index 5c62679f552d659d06e8e0f810fa93700dd62141..37126069f942b218d0f1f8bef319d8bab01f7b34 100644 (file)
@@ -250,6 +250,21 @@ fn fdstat_set_rights(&self, rights: u64, inheriting: u64) -> io::Result<()> {
     }
 
     fn advise(&self, offset: u64, len: u64, advice: u8) -> io::Result<()> {
+        let advice = match advice {
+            a if a == wasi::ADVICE_NORMAL.raw() => wasi::ADVICE_NORMAL,
+            a if a == wasi::ADVICE_SEQUENTIAL.raw() => wasi::ADVICE_SEQUENTIAL,
+            a if a == wasi::ADVICE_RANDOM.raw() => wasi::ADVICE_RANDOM,
+            a if a == wasi::ADVICE_WILLNEED.raw() => wasi::ADVICE_WILLNEED,
+            a if a == wasi::ADVICE_DONTNEED.raw() => wasi::ADVICE_DONTNEED,
+            a if a == wasi::ADVICE_NOREUSE.raw() => wasi::ADVICE_NOREUSE,
+            _ => {
+                return Err(io::Error::new_const(
+                    io::ErrorKind::InvalidInput,
+                    &"invalid parameter 'advice'",
+                ));
+            }
+        };
+
         self.as_inner().as_inner().advise(offset, len, advice)
     }
 
index e6bcf87887f036c1c99b47a2209b55369a4abfac..73c097d4a50abbe647490dc29c4072802f909156 100644 (file)
@@ -1,3 +1,23 @@
 //! WASI-specific networking functionality
 
 #![unstable(feature = "wasi_ext", issue = "71213")]
+
+use crate::io;
+use crate::net;
+use crate::sys_common::AsInner;
+
+/// WASI-specific extensions to [`std::net::TcpListener`].
+///
+/// [`std::net::TcpListener`]: crate::net::TcpListener
+pub trait TcpListenerExt {
+    /// Accept a socket.
+    ///
+    /// This corresponds to the `sock_accept` syscall.
+    fn sock_accept(&self, flags: u16) -> io::Result<u32>;
+}
+
+impl TcpListenerExt for net::TcpListener {
+    fn sock_accept(&self, flags: u16) -> io::Result<u32> {
+        self.as_inner().as_inner().as_inner().sock_accept(flags)
+    }
+}
index 53124daa3a683a0fafa0f17766462d428b3b9f90..0226c4d7a2581b5dea306b604d1faedf48a1b15c 100644 (file)
@@ -49,7 +49,6 @@
     issue = "87555",
     reason = "`concat_bytes` is not stable enough for use and is subject to change"
 )]
-#[cfg(not(bootstrap))]
 #[doc(no_inline)]
 pub use core::prelude::v1::concat_bytes;
 
index 57f1dcca30e0a8166d58d2b9152d2d3584b7c285..3ea0a6c3937605261762f0e9d87845742f44fd09 100644 (file)
@@ -188,12 +188,9 @@ unsafe impl<T: ?Sized + Send> Sync for Mutex<T> {}
 /// [`lock`]: Mutex::lock
 /// [`try_lock`]: Mutex::try_lock
 #[must_use = "if unused the Mutex will immediately unlock"]
-#[cfg_attr(
-    not(bootstrap),
-    must_not_suspend = "holding a MutexGuard across suspend \
+#[must_not_suspend = "holding a MutexGuard across suspend \
                       points can cause deadlocks, delays, \
-                      and cause Futures to not implement `Send`"
-)]
+                      and cause Futures to not implement `Send`"]
 #[stable(feature = "rust1", since = "1.0.0")]
 pub struct MutexGuard<'a, T: ?Sized + 'a> {
     lock: &'a Mutex<T>,
index 2f4395ceefd134ac41d8c68c1cb56e554be9d911..2e72a9ef54e5f78c61fef025537b3594fe279cf0 100644 (file)
@@ -95,12 +95,9 @@ unsafe impl<T: ?Sized + Send + Sync> Sync for RwLock<T> {}
 /// [`read`]: RwLock::read
 /// [`try_read`]: RwLock::try_read
 #[must_use = "if unused the RwLock will immediately unlock"]
-#[cfg_attr(
-    not(bootstrap),
-    must_not_suspend = "holding a RwLockReadGuard across suspend \
+#[must_not_suspend = "holding a RwLockReadGuard across suspend \
                       points can cause deadlocks, delays, \
-                      and cause Futures to not implement `Send`"
-)]
+                      and cause Futures to not implement `Send`"]
 #[stable(feature = "rust1", since = "1.0.0")]
 pub struct RwLockReadGuard<'a, T: ?Sized + 'a> {
     lock: &'a RwLock<T>,
@@ -121,12 +118,9 @@ unsafe impl<T: ?Sized + Sync> Sync for RwLockReadGuard<'_, T> {}
 /// [`write`]: RwLock::write
 /// [`try_write`]: RwLock::try_write
 #[must_use = "if unused the RwLock will immediately unlock"]
-#[cfg_attr(
-    not(bootstrap),
-    must_not_suspend = "holding a RwLockWriteGuard across suspend \
+#[must_not_suspend = "holding a RwLockWriteGuard across suspend \
                       points can cause deadlocks, delays, \
-                      and cause Future's to not implement `Send`"
-)]
+                      and cause Future's to not implement `Send`"]
 #[stable(feature = "rust1", since = "1.0.0")]
 pub struct RwLockWriteGuard<'a, T: ?Sized + 'a> {
     lock: &'a RwLock<T>,
index ebcc9ab26e088c27a42b7711c705dc14b7cf4e32..a8ecc1ada4ad4736e7927765fdce225116a02f3b 100644 (file)
@@ -84,10 +84,6 @@ impl Thread {
     ///
     /// See `thread::Builder::spawn_unchecked` for safety requirements.
     pub unsafe fn new(stack: usize, p: Box<dyn FnOnce()>) -> io::Result<Thread> {
-        // Inherit the current task's priority
-        let current_task = task::try_current_task_id().map_err(|e| e.as_io_error())?;
-        let priority = task::try_task_priority(current_task).map_err(|e| e.as_io_error())?;
-
         let inner = Box::new(ThreadInner {
             start: UnsafeCell::new(ManuallyDrop::new(p)),
             lifecycle: AtomicUsize::new(LIFECYCLE_INIT),
@@ -175,7 +171,8 @@ pub unsafe fn new(stack: usize, p: Box<dyn FnOnce()>) -> io::Result<Thread> {
                 exinf: inner_ptr as abi::EXINF,
                 // The entry point
                 task: Some(trampoline),
-                itskpri: priority,
+                // Inherit the calling task's base priority
+                itskpri: abi::TPRI_SELF,
                 stksz: stack,
                 // Let the kernel allocate the stack,
                 stk: crate::ptr::null_mut(),
index 7c21d0dd25e030eda97c308a3c9fcf8f39aaae3d..eb06a6dd927e6c2274c296d37fcf450b247a771f 100644 (file)
@@ -175,6 +175,9 @@ pub struct fd_set {
     #[link_name = "SOLID_NET_Close"]
     pub fn close(s: c_int) -> c_int;
 
+    #[link_name = "SOLID_NET_Dup"]
+    pub fn dup(s: c_int) -> c_int;
+
     #[link_name = "SOLID_NET_GetPeerName"]
     pub fn getpeername(s: c_int, name: *mut sockaddr, namelen: *mut socklen_t) -> c_int;
 
index 63ba6341c796cd776bd53faea212a1b21769504c..c91ecce4d728b70acd91b977c8084643ba8910d1 100644 (file)
@@ -107,7 +107,7 @@ fn is_write_vectored(&self) -> bool {
     }
 
     fn duplicate(&self) -> io::Result<FileDesc> {
-        super::unsupported()
+        cvt(unsafe { netc::dup(self.fd) }).map(Self::new)
     }
 }
 
index 3bb80b458485c796c14169807f45e5c0f493ef45..878796065c8f17b906c6e3fb4f2db996e1440cd5 100644 (file)
@@ -489,10 +489,18 @@ fn next(&mut self) -> Option<io::Result<DirEntry>> {
                     };
                 }
 
+                // Only d_reclen bytes of *entry_ptr are valid, so we can't just copy the
+                // whole thing (#93384).  Instead, copy everything except the name.
+                let entry_bytes = entry_ptr as *const u8;
+                let entry_name = ptr::addr_of!((*entry_ptr).d_name) as *const u8;
+                let name_offset = entry_name.offset_from(entry_bytes) as usize;
+                let mut entry: dirent64 = mem::zeroed();
+                ptr::copy_nonoverlapping(entry_bytes, &mut entry as *mut _ as *mut u8, name_offset);
+
                 let ret = DirEntry {
-                    entry: *entry_ptr,
+                    entry,
                     // d_name is guaranteed to be null-terminated.
-                    name: CStr::from_ptr((*entry_ptr).d_name.as_ptr()).to_owned(),
+                    name: CStr::from_ptr(entry_name as *const _).to_owned(),
                     dir: Arc::clone(&self.inner),
                 };
                 if ret.name_bytes() != b"." && ret.name_bytes() != b".." {
@@ -590,7 +598,7 @@ pub fn metadata(&self) -> io::Result<FileAttr> {
         target_os = "vxworks"
     ))]
     pub fn file_type(&self) -> io::Result<FileType> {
-        lstat(&self.path()).map(|m| m.file_type())
+        self.metadata().map(|m| m.file_type())
     }
 
     #[cfg(not(any(
@@ -608,7 +616,7 @@ pub fn file_type(&self) -> io::Result<FileType> {
             libc::DT_SOCK => Ok(FileType { mode: libc::S_IFSOCK }),
             libc::DT_DIR => Ok(FileType { mode: libc::S_IFDIR }),
             libc::DT_BLK => Ok(FileType { mode: libc::S_IFBLK }),
-            _ => lstat(&self.path()).map(|m| m.file_type()),
+            _ => self.metadata().map(|m| m.file_type()),
         }
     }
 
@@ -1653,7 +1661,6 @@ fn fdreaddir(dir_fd: OwnedFd) -> io::Result<(ReadDir, RawFd)> {
         target_os = "illumos",
         target_os = "haiku",
         target_os = "vxworks",
-        target_os = "fuchsia"
     ))]
     fn is_dir(_ent: &DirEntry) -> Option<bool> {
         None
@@ -1664,7 +1671,6 @@ fn is_dir(_ent: &DirEntry) -> Option<bool> {
         target_os = "illumos",
         target_os = "haiku",
         target_os = "vxworks",
-        target_os = "fuchsia"
     )))]
     fn is_dir(ent: &DirEntry) -> Option<bool> {
         match ent.entry.d_type {
index e4f4456611cd043e615ffa347919231404670031..0b9c8e61db84c4ec76c3017bd6d0b3b804148637 100644 (file)
@@ -228,6 +228,10 @@ pub fn remove_directory(&self, path: &str) -> io::Result<()> {
         unsafe { wasi::path_remove_directory(self.as_raw_fd() as wasi::Fd, path).map_err(err2io) }
     }
 
+    pub fn sock_accept(&self, flags: wasi::Fdflags) -> io::Result<wasi::Fd> {
+        unsafe { wasi::sock_accept(self.as_raw_fd() as wasi::Fd, flags).map_err(err2io) }
+    }
+
     pub fn sock_recv(
         &self,
         ri_data: &mut [IoSliceMut<'_>],
index 8d62335aae5eb9d5aff765bc37545359a278a164..f878941939ce8915f60a760bb8f5eaf493f7ef6e 100644 (file)
@@ -61,23 +61,26 @@ pub fn decode_error_kind(errno: i32) -> std_io::ErrorKind {
     if errno > u16::MAX as i32 || errno < 0 {
         return Uncategorized;
     }
-    match errno as u16 {
-        wasi::ERRNO_CONNREFUSED => ConnectionRefused,
-        wasi::ERRNO_CONNRESET => ConnectionReset,
-        wasi::ERRNO_PERM | wasi::ERRNO_ACCES => PermissionDenied,
-        wasi::ERRNO_PIPE => BrokenPipe,
-        wasi::ERRNO_NOTCONN => NotConnected,
-        wasi::ERRNO_CONNABORTED => ConnectionAborted,
-        wasi::ERRNO_ADDRNOTAVAIL => AddrNotAvailable,
-        wasi::ERRNO_ADDRINUSE => AddrInUse,
-        wasi::ERRNO_NOENT => NotFound,
-        wasi::ERRNO_INTR => Interrupted,
-        wasi::ERRNO_INVAL => InvalidInput,
-        wasi::ERRNO_TIMEDOUT => TimedOut,
-        wasi::ERRNO_EXIST => AlreadyExists,
-        wasi::ERRNO_AGAIN => WouldBlock,
-        wasi::ERRNO_NOSYS => Unsupported,
-        wasi::ERRNO_NOMEM => OutOfMemory,
+
+    match errno {
+        e if e == wasi::ERRNO_CONNREFUSED.raw().into() => ConnectionRefused,
+        e if e == wasi::ERRNO_CONNRESET.raw().into() => ConnectionReset,
+        e if e == wasi::ERRNO_PERM.raw().into() || e == wasi::ERRNO_ACCES.raw().into() => {
+            PermissionDenied
+        }
+        e if e == wasi::ERRNO_PIPE.raw().into() => BrokenPipe,
+        e if e == wasi::ERRNO_NOTCONN.raw().into() => NotConnected,
+        e if e == wasi::ERRNO_CONNABORTED.raw().into() => ConnectionAborted,
+        e if e == wasi::ERRNO_ADDRNOTAVAIL.raw().into() => AddrNotAvailable,
+        e if e == wasi::ERRNO_ADDRINUSE.raw().into() => AddrInUse,
+        e if e == wasi::ERRNO_NOENT.raw().into() => NotFound,
+        e if e == wasi::ERRNO_INTR.raw().into() => Interrupted,
+        e if e == wasi::ERRNO_INVAL.raw().into() => InvalidInput,
+        e if e == wasi::ERRNO_TIMEDOUT.raw().into() => TimedOut,
+        e if e == wasi::ERRNO_EXIST.raw().into() => AlreadyExists,
+        e if e == wasi::ERRNO_AGAIN.raw().into() => WouldBlock,
+        e if e == wasi::ERRNO_NOSYS.raw().into() => Unsupported,
+        e if e == wasi::ERRNO_NOMEM.raw().into() => OutOfMemory,
         _ => Uncategorized,
     }
 }
@@ -96,6 +99,6 @@ pub fn hashmap_random_keys() -> (u64, u64) {
     return ret;
 }
 
-fn err2io(err: wasi::Error) -> std_io::Error {
-    std_io::Error::from_raw_os_error(err.raw_error().into())
+fn err2io(err: wasi::Errno) -> std_io::Error {
+    std_io::Error::from_raw_os_error(err.raw().into())
 }
index a4dbb225376eee1d7e0b0c63fcf65ae80cd6450e..c66e0e4d328ad09a3401fa7517419090d9be5604 100644 (file)
@@ -1,5 +1,6 @@
 #![deny(unsafe_op_in_unsafe_fn)]
 
+use super::err2io;
 use super::fd::WasiFd;
 use crate::convert::TryFrom;
 use crate::fmt;
@@ -87,24 +88,24 @@ pub fn peek(&self, _: &mut [u8]) -> io::Result<usize> {
         unsupported()
     }
 
-    pub fn read(&self, _: &mut [u8]) -> io::Result<usize> {
-        unsupported()
+    pub fn read(&self, buf: &mut [u8]) -> io::Result<usize> {
+        self.read_vectored(&mut [IoSliceMut::new(buf)])
     }
 
-    pub fn read_vectored(&self, _: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
-        unsupported()
+    pub fn read_vectored(&self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
+        self.socket().as_inner().read(bufs)
     }
 
     pub fn is_read_vectored(&self) -> bool {
         true
     }
 
-    pub fn write(&self, _: &[u8]) -> io::Result<usize> {
-        unsupported()
+    pub fn write(&self, buf: &[u8]) -> io::Result<usize> {
+        self.write_vectored(&[IoSlice::new(buf)])
     }
 
-    pub fn write_vectored(&self, _: &[IoSlice<'_>]) -> io::Result<usize> {
-        unsupported()
+    pub fn write_vectored(&self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
+        self.socket().as_inner().write(bufs)
     }
 
     pub fn is_write_vectored(&self) -> bool {
@@ -155,8 +156,23 @@ pub fn take_error(&self) -> io::Result<Option<io::Error>> {
         unsupported()
     }
 
-    pub fn set_nonblocking(&self, _: bool) -> io::Result<()> {
-        unsupported()
+    pub fn set_nonblocking(&self, state: bool) -> io::Result<()> {
+        let fdstat = unsafe {
+            wasi::fd_fdstat_get(self.socket().as_inner().as_raw_fd() as wasi::Fd).map_err(err2io)?
+        };
+
+        let mut flags = fdstat.fs_flags;
+
+        if state {
+            flags |= wasi::FDFLAGS_NONBLOCK;
+        } else {
+            flags &= !wasi::FDFLAGS_NONBLOCK;
+        }
+
+        unsafe {
+            wasi::fd_fdstat_set_flags(self.socket().as_inner().as_raw_fd() as wasi::Fd, flags)
+                .map_err(err2io)
+        }
     }
 
     pub fn socket(&self) -> &Socket {
@@ -194,7 +210,16 @@ pub fn socket_addr(&self) -> io::Result<SocketAddr> {
     }
 
     pub fn accept(&self) -> io::Result<(TcpStream, SocketAddr)> {
-        unsupported()
+        let fd = unsafe {
+            wasi::sock_accept(self.as_inner().as_inner().as_raw_fd() as _, 0).map_err(err2io)?
+        };
+
+        Ok((
+            TcpStream::from_inner(unsafe { Socket::from_raw_fd(fd as _) }),
+            // WASI has no concept of SocketAddr yet
+            // return an unspecified IPv4Addr
+            SocketAddr::new(Ipv4Addr::UNSPECIFIED.into(), 0),
+        ))
     }
 
     pub fn duplicate(&self) -> io::Result<TcpListener> {
@@ -221,8 +246,23 @@ pub fn take_error(&self) -> io::Result<Option<io::Error>> {
         unsupported()
     }
 
-    pub fn set_nonblocking(&self, _: bool) -> io::Result<()> {
-        unsupported()
+    pub fn set_nonblocking(&self, state: bool) -> io::Result<()> {
+        let fdstat = unsafe {
+            wasi::fd_fdstat_get(self.socket().as_inner().as_raw_fd() as wasi::Fd).map_err(err2io)?
+        };
+
+        let mut flags = fdstat.fs_flags;
+
+        if state {
+            flags |= wasi::FDFLAGS_NONBLOCK;
+        } else {
+            flags &= !wasi::FDFLAGS_NONBLOCK;
+        }
+
+        unsafe {
+            wasi::fd_fdstat_set_flags(self.socket().as_inner().as_raw_fd() as wasi::Fd, flags)
+                .map_err(err2io)
+        }
     }
 
     pub fn socket(&self) -> &Socket {
index 2c8f394cd47b05244944b87664539c2ce4e493ed..4cc0e4ed5a45a775f2a9879153fcd31b4e2b526d 100644 (file)
@@ -104,7 +104,7 @@ fn flush(&mut self) -> io::Result<()> {
 pub const STDIN_BUF_SIZE: usize = crate::sys_common::io::DEFAULT_BUF_SIZE;
 
 pub fn is_ebadf(err: &io::Error) -> bool {
-    err.raw_os_error() == Some(wasi::ERRNO_BADF.into())
+    err.raw_os_error() == Some(wasi::ERRNO_BADF.raw().into())
 }
 
 pub fn panic_output() -> Option<impl io::Write> {
index 2e4e474c4492c55a5b4c4e1c1373cd2ed898bdac..e7a6ab4be826f5053982bed385347424b06fe66c 100644 (file)
@@ -41,8 +41,7 @@ pub fn sleep(dur: Duration) {
 
         let in_ = wasi::Subscription {
             userdata: USERDATA,
-            r#type: wasi::EVENTTYPE_CLOCK,
-            u: wasi::SubscriptionU { clock },
+            u: wasi::SubscriptionU { tag: 0, u: wasi::SubscriptionUU { clock } },
         };
         unsafe {
             let mut event: wasi::Event = mem::zeroed();
@@ -51,7 +50,10 @@ pub fn sleep(dur: Duration) {
                 (
                     Ok(1),
                     wasi::Event {
-                        userdata: USERDATA, error: 0, r#type: wasi::EVENTTYPE_CLOCK, ..
+                        userdata: USERDATA,
+                        error: wasi::ERRNO_SUCCESS,
+                        type_: wasi::EVENTTYPE_CLOCK,
+                        ..
                     },
                 ) => {}
                 _ => panic!("thread::sleep(): unexpected result of poll_oneoff"),
index 2e720d11603a7239fa410276c8e2464cd0a6c16b..db0ddecf0c62942e30304e99d2445d9f98cb8b5d 100644 (file)
@@ -10,7 +10,7 @@
 
 pub const UNIX_EPOCH: SystemTime = SystemTime(Duration::from_secs(0));
 
-fn current_time(clock: u32) -> Duration {
+fn current_time(clock: wasi::Clockid) -> Duration {
     let ts = unsafe {
         wasi::clock_time_get(
             clock, 1, // precision... seems ignored though?
index ea9108f17133af8491544944727c7fc2a4f46a72..d1e9fed41fc930093b85b900ab5fb9e2735fcc3d 100644 (file)
@@ -8,6 +8,7 @@ pub mod test {
     use crate::env;
     use crate::fs;
     use crate::path::{Path, PathBuf};
+    use crate::thread;
     use rand::RngCore;
 
     pub struct TempDir(PathBuf);
@@ -29,7 +30,12 @@ fn drop(&mut self) {
             // Gee, seeing how we're testing the fs module I sure hope that we
             // at least implement this correctly!
             let TempDir(ref p) = *self;
-            fs::remove_dir_all(p).unwrap();
+            let result = fs::remove_dir_all(p);
+            // Avoid panicking while panicking as this causes the process to
+            // immediately abort, without displaying test results.
+            if !thread::panicking() {
+                result.unwrap();
+            }
         }
     }
 
index b4f9d8ea28d7b99cff2e2a5f6cc865663e05874a..2d2b96c8bcec74df42b633a76cdf42a187c422e1 100644 (file)
 /// }
 /// ```
 ///
-/// # Underlying System calls
+/// # Platform-specific behavior
+///
+/// The precision of `SystemTime` can depend on the underlying OS-specific time format.
+/// For example, on Windows the time is represented in 100 nanosecond intervals whereas Linux
+/// can represent nanosecond intervals.
+///
 /// Currently, the following system calls are being used to get the current time using `now()`:
 ///
 /// |  Platform |               System call                                            |
index 079f00a5753f1d7617b8d55407631b5390594d32..14a9e3acca499e89ceaa3ca54e25702e855b0388 100644 (file)
@@ -14,6 +14,7 @@
 #[test]
 #[cfg(all(target_arch = "arm", any(target_os = "linux", target_os = "android")))]
 fn arm_linux() {
+    use std::arch::is_arm_feature_detected;
     println!("neon: {}", is_arm_feature_detected!("neon"));
     println!("pmull: {}", is_arm_feature_detected!("pmull"));
     println!("crypto: {}", is_arm_feature_detected!("crypto"));
@@ -25,6 +26,7 @@ fn arm_linux() {
 #[test]
 #[cfg(all(target_arch = "aarch64", any(target_os = "linux", target_os = "android")))]
 fn aarch64_linux() {
+    use std::arch::is_aarch64_feature_detected;
     println!("neon: {}", is_aarch64_feature_detected!("neon"));
     println!("asimd: {}", is_aarch64_feature_detected!("asimd"));
     println!("pmull: {}", is_aarch64_feature_detected!("pmull"));
@@ -71,6 +73,7 @@ fn aarch64_linux() {
 #[test]
 #[cfg(all(target_arch = "powerpc", target_os = "linux"))]
 fn powerpc_linux() {
+    use std::arch::is_powerpc_feature_detected;
     println!("altivec: {}", is_powerpc_feature_detected!("altivec"));
     println!("vsx: {}", is_powerpc_feature_detected!("vsx"));
     println!("power8: {}", is_powerpc_feature_detected!("power8"));
@@ -79,6 +82,7 @@ fn powerpc_linux() {
 #[test]
 #[cfg(all(target_arch = "powerpc64", target_os = "linux"))]
 fn powerpc64_linux() {
+    use std::arch::is_powerpc64_feature_detected;
     println!("altivec: {}", is_powerpc64_feature_detected!("altivec"));
     println!("vsx: {}", is_powerpc64_feature_detected!("vsx"));
     println!("power8: {}", is_powerpc64_feature_detected!("power8"));
@@ -87,6 +91,8 @@ fn powerpc64_linux() {
 #[test]
 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
 fn x86_all() {
+    use std::arch::is_x86_feature_detected;
+
     // the below is the set of features we can test at runtime, but don't actually
     // use to gate anything and are thus not part of the X86_ALLOWED_FEATURES list
 
index 11c98f6eb9c4ba48b2362ad4960343b312d056b8..eaee02ffdf5d820729ccdf2f95fa08b08c7d24d2 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 11c98f6eb9c4ba48b2362ad4960343b312d056b8
+Subproject commit eaee02ffdf5d820729ccdf2f95fa08b08c7d24d2
index 4fe69cefe12e05fbfb233b7ed74882daaef3ae2b..4f88b5854b69293b73c1eead19264e184487992a 100644 (file)
@@ -1088,20 +1088,11 @@ pub fn cargo(
             }
         };
 
-        // cfg(bootstrap) -- drop the compiler.stage == 0 branch.
-        if compiler.stage == 0 {
-            if use_new_symbol_mangling {
-                rustflags.arg("-Zsymbol-mangling-version=v0");
-            } else {
-                rustflags.arg("-Zsymbol-mangling-version=legacy");
-            }
+        if use_new_symbol_mangling {
+            rustflags.arg("-Csymbol-mangling-version=v0");
         } else {
-            if use_new_symbol_mangling {
-                rustflags.arg("-Csymbol-mangling-version=v0");
-            } else {
-                rustflags.arg("-Csymbol-mangling-version=legacy");
-                rustflags.arg("-Zunstable-options");
-            }
+            rustflags.arg("-Csymbol-mangling-version=legacy");
+            rustflags.arg("-Zunstable-options");
         }
 
         // FIXME: It might be better to use the same value for both `RUSTFLAGS` and `RUSTDOCFLAGS`,
index ee58bedcc8735104091947eead2b8b5af2dcd833..2c78ceb1e5bec5b21386ecc70ee8d2d96310634a 100644 (file)
@@ -282,9 +282,10 @@ pub fn is_valid_test_suite_arg<'a, P: AsRef<Path>>(
     if !path.starts_with(suite_path) {
         return None;
     }
-    let exists = path.is_dir() || path.is_file();
+    let abs_path = builder.src.join(path);
+    let exists = abs_path.is_dir() || abs_path.is_file();
     if !exists {
-        if let Some(p) = path.to_str() {
+        if let Some(p) = abs_path.to_str() {
             builder.info(&format!("Warning: Skipping \"{}\": not a regular file or directory", p));
         }
         return None;
index d4701a25614cdfb90956423798ed480cb224a3d6..c547e12f5b6cec21a683c8af94cf23b52c671186 100644 (file)
@@ -72,7 +72,7 @@ ENV PATH="/node-v14.4.0-linux-x64/bin:${PATH}"
 # https://github.com/puppeteer/puppeteer/issues/375
 #
 # We also specify the version in case we need to update it to go around cache limitations.
-RUN npm install -g browser-ui-test@0.5.3 --unsafe-perm=true
+RUN npm install -g browser-ui-test@0.5.8 --unsafe-perm=true
 
 ENV RUST_CONFIGURE_ARGS \
   --build=x86_64-unknown-linux-gnu \
index 8034846897634885ae4d93fdf5931c6ea1cee5d6..1a1472ea861f94e10a3fe8894bfd8a00e1ec9836 100644 (file)
@@ -452,12 +452,10 @@ jobs:
           #  macOS Builders  #
           ####################
 
-          # Only generate documentation for x86_64-apple-darwin, not other
-          # tier 2 targets produced by this builder.
           - name: dist-x86_64-apple
             env:
-              SCRIPT: ./x.py dist --exclude rust-docs --exclude extended && ./x.py dist --target=x86_64-apple-darwin rust-docs && ./x.py dist extended
-              RUST_CONFIGURE_ARGS: --host=x86_64-apple-darwin --target=x86_64-apple-darwin,aarch64-apple-ios,x86_64-apple-ios,aarch64-apple-ios-sim --enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false
+              SCRIPT: ./x.py dist --host=x86_64-apple-darwin --target=x86_64-apple-darwin
+              RUST_CONFIGURE_ARGS: --enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false
               RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
               MACOSX_DEPLOYMENT_TARGET: 10.7
               NO_LLVM_ASSERTIONS: 1
@@ -466,6 +464,17 @@ jobs:
               DIST_REQUIRE_ALL_TOOLS: 1
             <<: *job-macos-xl
 
+          - name: dist-apple-various
+            env:
+              SCRIPT: ./x.py dist --host='' --target=aarch64-apple-ios,x86_64-apple-ios,aarch64-apple-ios-sim
+              RUST_CONFIGURE_ARGS: --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false
+              RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
+              MACOSX_DEPLOYMENT_TARGET: 10.7
+              NO_LLVM_ASSERTIONS: 1
+              NO_DEBUG_ASSERTIONS: 1
+              NO_OVERFLOW_CHECKS: 1
+            <<: *job-macos-xl
+
           - name: dist-x86_64-apple-alt
             env:
               SCRIPT: ./x.py dist
index 1ca6a7bd1d73edc4a3e6c7d6a40f5d4b66c1e517..18c0055b8aea49391e8f758a4400097999c9cf1e 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 1ca6a7bd1d73edc4a3e6c7d6a40f5d4b66c1e517
+Subproject commit 18c0055b8aea49391e8f758a4400097999c9cf1e
index b0e2437392c955fc6fe62670dd9ff576c2550100..45cf4e88eef6b9b34b72d877faeb56749376fa53 100644 (file)
@@ -16,13 +16,13 @@ If you know of other great resources, please submit a pull request!
 - [Github tagged RFCs]
 - [Github tagged issues]
 - [RFC (stalled) front page styleguide]
-- [Guide on how to write documenation for a Rust crate]
+- [Guide on how to write documentation for a Rust crate]
 
 
 [API Guidelines]: https://rust-lang.github.io/api-guidelines/documentation.html
 [Github tagged RFCs]: https://github.com/rust-lang/rfcs/issues?q=label%3AT-rustdoc
 [Github tagged issues]: https://github.com/rust-lang/rust/issues?q=is%3Aissue+is%3Aopen+label%3AT-rustdoc
-[Guide on how to write documenation for a Rust crate]: https://blog.guillaume-gomez.fr/articles/2020-03-12+Guide+on+how+to+write+documentation+for+a+Rust+crate
+[Guide on how to write documentation for a Rust crate]: https://blog.guillaume-gomez.fr/articles/2020-03-12+Guide+on+how+to+write+documentation+for+a+Rust+crate
 [Learn Rust]: https://doc.rust-lang.org/book/ch14-02-publishing-to-crates-io.html#making-useful-documentation-comments
 [RFC 1574: More API Documentation Conventions]: https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html
 [RFC 1946: Intra Rustdoc Links]: https://rust-lang.github.io/rfcs/1946-intra-rustdoc-links.html
index 33612c80654776a2f515566795fb4c608de17495..7d209accec9b50a24a41ea044baacc588b52ed6e 100644 (file)
@@ -5,6 +5,7 @@
 mod blanket_impl;
 crate mod cfg;
 crate mod inline;
+mod render_macro_matchers;
 mod simplify;
 crate mod types;
 crate mod utils;
diff --git a/src/librustdoc/clean/render_macro_matchers.rs b/src/librustdoc/clean/render_macro_matchers.rs
new file mode 100644 (file)
index 0000000..dff370a
--- /dev/null
@@ -0,0 +1,240 @@
+use rustc_ast::token::{self, BinOpToken, DelimToken};
+use rustc_ast::tokenstream::{TokenStream, TokenTree};
+use rustc_ast_pretty::pprust::state::State as Printer;
+use rustc_ast_pretty::pprust::PrintState;
+use rustc_middle::ty::TyCtxt;
+use rustc_session::parse::ParseSess;
+use rustc_span::source_map::FilePathMapping;
+use rustc_span::symbol::{kw, Ident, Symbol};
+use rustc_span::Span;
+
+/// Render a macro matcher in a format suitable for displaying to the user
+/// as part of an item declaration.
+pub(super) fn render_macro_matcher(tcx: TyCtxt<'_>, matcher: &TokenTree) -> String {
+    if let Some(snippet) = snippet_equal_to_token(tcx, matcher) {
+        // If the original source code is known, we display the matcher exactly
+        // as present in the source code.
+        return snippet;
+    }
+
+    // If the matcher is macro-generated or some other reason the source code
+    // snippet is not available, we attempt to nicely render the token tree.
+    let mut printer = Printer::new();
+
+    // If the inner ibox fits on one line, we get:
+    //
+    //     macro_rules! macroname {
+    //         (the matcher) => {...};
+    //     }
+    //
+    // If the inner ibox gets wrapped, the cbox will break and get indented:
+    //
+    //     macro_rules! macroname {
+    //         (
+    //             the matcher ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+    //             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!
+    //         ) => {...};
+    //     }
+    printer.cbox(8);
+    printer.word("(");
+    printer.zerobreak();
+    printer.ibox(0);
+    match matcher {
+        TokenTree::Delimited(_span, _delim, tts) => print_tts(&mut printer, tts),
+        // Matcher which is not a Delimited is unexpected and should've failed
+        // to compile, but we render whatever it is wrapped in parens.
+        TokenTree::Token(_) => print_tt(&mut printer, matcher),
+    }
+    printer.end();
+    printer.break_offset_if_not_bol(0, -4);
+    printer.word(")");
+    printer.end();
+    printer.s.eof()
+}
+
+/// Find the source snippet for this token's Span, reparse it, and return the
+/// snippet if the reparsed TokenTree matches the argument TokenTree.
+fn snippet_equal_to_token(tcx: TyCtxt<'_>, matcher: &TokenTree) -> Option<String> {
+    // Find what rustc thinks is the source snippet.
+    // This may not actually be anything meaningful if this matcher was itself
+    // generated by a macro.
+    let source_map = tcx.sess.source_map();
+    let span = matcher.span();
+    let snippet = source_map.span_to_snippet(span).ok()?;
+
+    // Create a Parser.
+    let sess = ParseSess::new(FilePathMapping::empty());
+    let file_name = source_map.span_to_filename(span);
+    let mut parser =
+        match rustc_parse::maybe_new_parser_from_source_str(&sess, file_name, snippet.clone()) {
+            Ok(parser) => parser,
+            Err(diagnostics) => {
+                for mut diagnostic in diagnostics {
+                    diagnostic.cancel();
+                }
+                return None;
+            }
+        };
+
+    // Reparse a single token tree.
+    let mut reparsed_trees = match parser.parse_all_token_trees() {
+        Ok(reparsed_trees) => reparsed_trees,
+        Err(mut diagnostic) => {
+            diagnostic.cancel();
+            return None;
+        }
+    };
+    if reparsed_trees.len() != 1 {
+        return None;
+    }
+    let reparsed_tree = reparsed_trees.pop().unwrap();
+
+    // Compare against the original tree.
+    if reparsed_tree.eq_unspanned(matcher) { Some(snippet) } else { None }
+}
+
+fn print_tt(printer: &mut Printer<'_>, tt: &TokenTree) {
+    match tt {
+        TokenTree::Token(token) => {
+            let token_str = printer.token_to_string(token);
+            printer.word(token_str);
+            if let token::DocComment(..) = token.kind {
+                printer.hardbreak()
+            }
+        }
+        TokenTree::Delimited(_span, delim, tts) => {
+            let open_delim = printer.token_kind_to_string(&token::OpenDelim(*delim));
+            printer.word(open_delim);
+            if !tts.is_empty() {
+                if *delim == DelimToken::Brace {
+                    printer.space();
+                }
+                print_tts(printer, tts);
+                if *delim == DelimToken::Brace {
+                    printer.space();
+                }
+            }
+            let close_delim = printer.token_kind_to_string(&token::CloseDelim(*delim));
+            printer.word(close_delim);
+        }
+    }
+}
+
+fn print_tts(printer: &mut Printer<'_>, tts: &TokenStream) {
+    #[derive(Copy, Clone, PartialEq)]
+    enum State {
+        Start,
+        Dollar,
+        DollarIdent,
+        DollarIdentColon,
+        DollarParen,
+        DollarParenSep,
+        Pound,
+        PoundBang,
+        Ident,
+        Other,
+    }
+
+    use State::*;
+
+    let mut state = Start;
+    for tt in tts.trees() {
+        let (needs_space, next_state) = match &tt {
+            TokenTree::Token(tt) => match (state, &tt.kind) {
+                (Dollar, token::Ident(..)) => (false, DollarIdent),
+                (DollarIdent, token::Colon) => (false, DollarIdentColon),
+                (DollarIdentColon, token::Ident(..)) => (false, Other),
+                (
+                    DollarParen,
+                    token::BinOp(BinOpToken::Plus | BinOpToken::Star) | token::Question,
+                ) => (false, Other),
+                (DollarParen, _) => (false, DollarParenSep),
+                (DollarParenSep, token::BinOp(BinOpToken::Plus | BinOpToken::Star)) => {
+                    (false, Other)
+                }
+                (Pound, token::Not) => (false, PoundBang),
+                (_, token::Ident(symbol, /* is_raw */ false))
+                    if !usually_needs_space_between_keyword_and_open_delim(*symbol, tt.span) =>
+                {
+                    (true, Ident)
+                }
+                (_, token::Comma | token::Semi) => (false, Other),
+                (_, token::Dollar) => (true, Dollar),
+                (_, token::Pound) => (true, Pound),
+                (_, _) => (true, Other),
+            },
+            TokenTree::Delimited(_, delim, _) => match (state, delim) {
+                (Dollar, DelimToken::Paren) => (false, DollarParen),
+                (Pound | PoundBang, DelimToken::Bracket) => (false, Other),
+                (Ident, DelimToken::Paren | DelimToken::Bracket) => (false, Other),
+                (_, _) => (true, Other),
+            },
+        };
+        if state != Start && needs_space {
+            printer.space();
+        }
+        print_tt(printer, &tt);
+        state = next_state;
+    }
+}
+
+fn usually_needs_space_between_keyword_and_open_delim(symbol: Symbol, span: Span) -> bool {
+    let ident = Ident { name: symbol, span };
+    let is_keyword = ident.is_used_keyword() || ident.is_unused_keyword();
+    if !is_keyword {
+        // An identifier that is not a keyword usually does not need a space
+        // before an open delim. For example: `f(0)` or `f[0]`.
+        return false;
+    }
+
+    match symbol {
+        // No space after keywords that are syntactically an expression. For
+        // example: a tuple struct created with `let _ = Self(0, 0)`, or if
+        // someone has `impl Index<MyStruct> for bool` then `true[MyStruct]`.
+        kw::False | kw::SelfLower | kw::SelfUpper | kw::True => false,
+
+        // No space, as in `let _: fn();`
+        kw::Fn => false,
+
+        // No space, as in `pub(crate) type T;`
+        kw::Pub => false,
+
+        // No space for keywords that can end an expression, as in `fut.await()`
+        // where fut's Output type is `fn()`.
+        kw::Await => false,
+
+        // Otherwise space after keyword. Some examples:
+        //
+        // `expr as [T; 2]`
+        //         ^
+        // `box (tuple,)`
+        //     ^
+        // `break (tuple,)`
+        //       ^
+        // `type T = dyn (Fn() -> dyn Trait) + Send;`
+        //              ^
+        // `for (tuple,) in iter {}`
+        //     ^
+        // `if (tuple,) == v {}`
+        //    ^
+        // `impl [T] {}`
+        //      ^
+        // `for x in [..] {}`
+        //          ^
+        // `let () = unit;`
+        //     ^
+        // `match [x, y] {...}`
+        //       ^
+        // `&mut (x as T)`
+        //      ^
+        // `return [];`
+        //        ^
+        // `fn f<T>() where (): Into<T>`
+        //                 ^
+        // `while (a + b).what() {}`
+        //       ^
+        // `yield [];`
+        //       ^
+        _ => true,
+    }
+}
index d34c2dba0b0ddd1c2c7a955fcfdc9d31c5243b53..02633698273608e52684b8ef846f01f939e36c2a 100644 (file)
@@ -338,6 +338,7 @@ fn to_remote(url: impl ToString) -> ExternalLocation {
 }
 
 /// Indicates where an external crate can be found.
+#[derive(Debug)]
 crate enum ExternalLocation {
     /// Remote URL root of the external crate
     Remote(String),
@@ -1539,23 +1540,10 @@ fn inner_def_id(&self, cache: Option<&Cache>) -> Option<DefId> {
 
     /// Use this method to get the [DefId] of a [clean] AST node, including [PrimitiveType]s.
     ///
-    /// See [`Self::def_id_no_primitives`] for more.
-    ///
     /// [clean]: crate::clean
     crate fn def_id(&self, cache: &Cache) -> Option<DefId> {
         self.inner_def_id(Some(cache))
     }
-
-    /// Use this method to get the [`DefId`] of a [`clean`] AST node.
-    /// This will return [`None`] when called on a primitive [`clean::Type`].
-    /// Use [`Self::def_id`] if you want to include primitives.
-    ///
-    /// [`clean`]: crate::clean
-    /// [`clean::Type`]: crate::clean::Type
-    // FIXME: get rid of this function and always use `def_id`
-    crate fn def_id_no_primitives(&self) -> Option<DefId> {
-        self.inner_def_id(None)
-    }
 }
 
 /// A primitive (aka, builtin) type.
index 38da9a4635db888d1df7862dff479c193ea4e098..dabf1e878c9fb38d3f5aaaf04f128a2cd7cd7c30 100644 (file)
@@ -1,5 +1,6 @@
 use crate::clean::auto_trait::AutoTraitFinder;
 use crate::clean::blanket_impl::BlanketImplFinder;
+use crate::clean::render_macro_matchers::render_macro_matcher;
 use crate::clean::{
     inline, Clean, Crate, ExternalCrate, Generic, GenericArg, GenericArgs, ImportSource, Item,
     ItemKind, Lifetime, Path, PathSegment, Primitive, PrimitiveType, Type, TypeBinding, Visibility,
@@ -17,8 +18,6 @@
 use rustc_middle::mir::interpret::ConstValue;
 use rustc_middle::ty::subst::{GenericArgKind, SubstsRef};
 use rustc_middle::ty::{self, DefIdTree, TyCtxt};
-use rustc_session::parse::ParseSess;
-use rustc_span::source_map::FilePathMapping;
 use rustc_span::symbol::{kw, sym, Symbol};
 use std::fmt::Write as _;
 use std::mem;
@@ -500,57 +499,6 @@ pub(super) fn render_macro_arms<'a>(
     out
 }
 
-/// Render a macro matcher in a format suitable for displaying to the user
-/// as part of an item declaration.
-pub(super) fn render_macro_matcher(tcx: TyCtxt<'_>, matcher: &TokenTree) -> String {
-    if let Some(snippet) = snippet_equal_to_token(tcx, matcher) {
-        snippet
-    } else {
-        rustc_ast_pretty::pprust::tt_to_string(matcher)
-    }
-}
-
-/// Find the source snippet for this token's Span, reparse it, and return the
-/// snippet if the reparsed TokenTree matches the argument TokenTree.
-fn snippet_equal_to_token(tcx: TyCtxt<'_>, matcher: &TokenTree) -> Option<String> {
-    // Find what rustc thinks is the source snippet.
-    // This may not actually be anything meaningful if this matcher was itself
-    // generated by a macro.
-    let source_map = tcx.sess.source_map();
-    let span = matcher.span();
-    let snippet = source_map.span_to_snippet(span).ok()?;
-
-    // Create a Parser.
-    let sess = ParseSess::new(FilePathMapping::empty());
-    let file_name = source_map.span_to_filename(span);
-    let mut parser =
-        match rustc_parse::maybe_new_parser_from_source_str(&sess, file_name, snippet.clone()) {
-            Ok(parser) => parser,
-            Err(diagnostics) => {
-                for mut diagnostic in diagnostics {
-                    diagnostic.cancel();
-                }
-                return None;
-            }
-        };
-
-    // Reparse a single token tree.
-    let mut reparsed_trees = match parser.parse_all_token_trees() {
-        Ok(reparsed_trees) => reparsed_trees,
-        Err(mut diagnostic) => {
-            diagnostic.cancel();
-            return None;
-        }
-    };
-    if reparsed_trees.len() != 1 {
-        return None;
-    }
-    let reparsed_tree = reparsed_trees.pop().unwrap();
-
-    // Compare against the original tree.
-    if reparsed_tree.eq_unspanned(matcher) { Some(snippet) } else { None }
-}
-
 pub(super) fn display_macro_source(
     cx: &mut DocContext<'_>,
     name: Symbol,
index a8fef4a317802c7fd39ca71513d559977c69ed94..53159709586c6826987c39284ba1d4756ed43cc1 100644 (file)
@@ -303,7 +303,7 @@ fn fold_item(&mut self, item: clean::Item) -> Option<clean::Item> {
                             desc,
                             parent,
                             parent_idx: None,
-                            search_type: get_function_type_for_search(&item, self.tcx),
+                            search_type: get_function_type_for_search(&item, self.tcx, self.cache),
                             aliases: item.attrs.get_doc_aliases(),
                         });
                     }
index 32e4a82918421cb83d34d43dd0c497ab50f7cf6e..cc12b7ba05ba38d130ffe36177adeafbd7a81e35 100644 (file)
@@ -182,7 +182,7 @@ impl StylePath {
 
 fn write_srclink(cx: &Context<'_>, item: &clean::Item, buf: &mut Buffer) {
     if let Some(l) = cx.src_href(item) {
-        write!(buf, "<a class=\"srclink\" href=\"{}\" title=\"goto source code\">source</a>", l)
+        write!(buf, "<a class=\"srclink\" href=\"{}\">source</a>", l)
     }
 }
 
@@ -1676,11 +1676,12 @@ fn render_rightside(
         containing_item.stable_since(tcx),
         const_stable_since,
     );
-    if has_stability {
+    let mut tmp_buf = Buffer::empty_from(w);
+    write_srclink(cx, item, &mut tmp_buf);
+    if has_stability && !tmp_buf.is_empty() {
         w.write_str(" Â· ");
     }
-
-    write_srclink(cx, item, w);
+    w.push_buffer(tmp_buf);
     w.write_str("</div>");
 }
 
index 87138b9571c2a0e36515203263dfe060e730a508..0ee67467c383beb9ff7c9cb7f152bdae2f7e02d9 100644 (file)
@@ -3,7 +3,7 @@
 
 use rustc_data_structures::fx::FxHashMap;
 use rustc_middle::ty::TyCtxt;
-use rustc_span::symbol::Symbol;
+use rustc_span::symbol::{kw, Symbol};
 use serde::ser::{Serialize, SerializeStruct, Serializer};
 
 use crate::clean;
@@ -33,7 +33,7 @@
                 desc,
                 parent: Some(did),
                 parent_idx: None,
-                search_type: get_function_type_for_search(item, tcx),
+                search_type: get_function_type_for_search(item, tcx, &cache),
                 aliases: item.attrs.get_doc_aliases(),
             });
         }
@@ -188,11 +188,12 @@ fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
 crate fn get_function_type_for_search<'tcx>(
     item: &clean::Item,
     tcx: TyCtxt<'tcx>,
+    cache: &Cache,
 ) -> Option<IndexItemFunctionType> {
     let (mut inputs, mut output) = match *item.kind {
-        clean::FunctionItem(ref f) => get_fn_inputs_and_outputs(f, tcx),
-        clean::MethodItem(ref m, _) => get_fn_inputs_and_outputs(m, tcx),
-        clean::TyMethodItem(ref m) => get_fn_inputs_and_outputs(m, tcx),
+        clean::FunctionItem(ref f) => get_fn_inputs_and_outputs(f, tcx, cache),
+        clean::MethodItem(ref m, _) => get_fn_inputs_and_outputs(m, tcx, cache),
+        clean::TyMethodItem(ref m) => get_fn_inputs_and_outputs(m, tcx, cache),
         _ => return None,
     };
 
@@ -219,7 +220,8 @@ fn get_index_type_name(clean_type: &clean::Type) -> Option<Symbol> {
             let path = &bounds[0].trait_;
             Some(path.segments.last().unwrap().name)
         }
-        clean::Generic(s) => Some(s),
+        // We return an empty name because we don't care about the generic name itself.
+        clean::Generic(_) => Some(kw::Empty),
         clean::Primitive(ref p) => Some(p.as_sym()),
         clean::BorrowedRef { ref type_, .. } => get_index_type_name(type_),
         clean::BareFunction(_)
@@ -240,24 +242,27 @@ fn get_index_type_name(clean_type: &clean::Type) -> Option<Symbol> {
 ///
 /// Important note: It goes through generics recursively. So if you have
 /// `T: Option<Result<(), ()>>`, it'll go into `Option` and then into `Result`.
-#[instrument(level = "trace", skip(tcx, res))]
+#[instrument(level = "trace", skip(tcx, res, cache))]
 fn add_generics_and_bounds_as_types<'tcx>(
     generics: &Generics,
     arg: &Type,
     tcx: TyCtxt<'tcx>,
     recurse: usize,
     res: &mut Vec<TypeWithKind>,
+    cache: &Cache,
 ) {
     fn insert_ty(
         res: &mut Vec<TypeWithKind>,
         tcx: TyCtxt<'_>,
         ty: Type,
         mut generics: Vec<TypeWithKind>,
+        cache: &Cache,
     ) {
         let is_full_generic = ty.is_full_generic();
+        let generics_empty = generics.is_empty();
 
         if is_full_generic {
-            if generics.is_empty() {
+            if generics_empty {
                 // This is a type parameter with no trait bounds (for example: `T` in
                 // `fn f<T>(p: T)`, so not useful for the rustdoc search because we would end up
                 // with an empty type with an empty name. Let's just discard it.
@@ -304,14 +309,14 @@ fn insert_ty(
             }
         }
         let mut index_ty = get_index_type(&ty, generics);
-        if index_ty.name.as_ref().map(|s| s.is_empty()).unwrap_or(true) {
+        if index_ty.name.as_ref().map(|s| s.is_empty() && generics_empty).unwrap_or(true) {
             return;
         }
         if is_full_generic {
             // We remove the name of the full generic because we have no use for it.
             index_ty.name = Some(String::new());
             res.push(TypeWithKind::from((index_ty, ItemType::Generic)));
-        } else if let Some(kind) = ty.def_id_no_primitives().map(|did| tcx.def_kind(did).into()) {
+        } else if let Some(kind) = ty.def_id(cache).map(|did| tcx.def_kind(did).into()) {
             res.push(TypeWithKind::from((index_ty, kind)));
         } else if ty.is_primitive() {
             // This is a primitive, let's store it as such.
@@ -330,9 +335,7 @@ fn insert_ty(
     if let Type::Generic(arg_s) = *arg {
         // First we check if the bounds are in a `where` predicate...
         if let Some(where_pred) = generics.where_predicates.iter().find(|g| match g {
-            WherePredicate::BoundPredicate { ty, .. } => {
-                ty.def_id_no_primitives() == arg.def_id_no_primitives()
-            }
+            WherePredicate::BoundPredicate { ty, .. } => ty.def_id(cache) == arg.def_id(cache),
             _ => false,
         }) {
             let mut ty_generics = Vec::new();
@@ -348,6 +351,7 @@ fn insert_ty(
                                     tcx,
                                     recurse + 1,
                                     &mut ty_generics,
+                                    cache,
                                 )
                             }
                             _ => {}
@@ -355,7 +359,7 @@ fn insert_ty(
                     }
                 }
             }
-            insert_ty(res, tcx, arg.clone(), ty_generics);
+            insert_ty(res, tcx, arg.clone(), ty_generics, cache);
         }
         // Otherwise we check if the trait bounds are "inlined" like `T: Option<u32>`...
         if let Some(bound) = generics.params.iter().find(|g| g.is_type() && g.name == arg_s) {
@@ -369,10 +373,11 @@ fn insert_ty(
                         tcx,
                         recurse + 1,
                         &mut ty_generics,
+                        cache,
                     );
                 }
             }
-            insert_ty(res, tcx, arg.clone(), ty_generics);
+            insert_ty(res, tcx, arg.clone(), ty_generics, cache);
         }
     } else {
         // This is not a type parameter. So for example if we have `T, U: Option<T>`, and we're
@@ -383,10 +388,17 @@ fn insert_ty(
         let mut ty_generics = Vec::new();
         if let Some(arg_generics) = arg.generics() {
             for gen in arg_generics.iter() {
-                add_generics_and_bounds_as_types(generics, gen, tcx, recurse + 1, &mut ty_generics);
+                add_generics_and_bounds_as_types(
+                    generics,
+                    gen,
+                    tcx,
+                    recurse + 1,
+                    &mut ty_generics,
+                    cache,
+                );
             }
         }
-        insert_ty(res, tcx, arg.clone(), ty_generics);
+        insert_ty(res, tcx, arg.clone(), ty_generics, cache);
     }
 }
 
@@ -397,6 +409,7 @@ fn insert_ty(
 fn get_fn_inputs_and_outputs<'tcx>(
     func: &Function,
     tcx: TyCtxt<'tcx>,
+    cache: &Cache,
 ) -> (Vec<TypeWithKind>, Vec<TypeWithKind>) {
     let decl = &func.decl;
     let generics = &func.generics;
@@ -407,12 +420,11 @@ fn get_fn_inputs_and_outputs<'tcx>(
             continue;
         }
         let mut args = Vec::new();
-        add_generics_and_bounds_as_types(generics, &arg.type_, tcx, 0, &mut args);
+        add_generics_and_bounds_as_types(generics, &arg.type_, tcx, 0, &mut args, cache);
         if !args.is_empty() {
             all_types.extend(args);
         } else {
-            if let Some(kind) = arg.type_.def_id_no_primitives().map(|did| tcx.def_kind(did).into())
-            {
+            if let Some(kind) = arg.type_.def_id(cache).map(|did| tcx.def_kind(did).into()) {
                 all_types.push(TypeWithKind::from((get_index_type(&arg.type_, vec![]), kind)));
             }
         }
@@ -421,11 +433,9 @@ fn get_fn_inputs_and_outputs<'tcx>(
     let mut ret_types = Vec::new();
     match decl.output {
         FnRetTy::Return(ref return_type) => {
-            add_generics_and_bounds_as_types(generics, return_type, tcx, 0, &mut ret_types);
+            add_generics_and_bounds_as_types(generics, return_type, tcx, 0, &mut ret_types, cache);
             if ret_types.is_empty() {
-                if let Some(kind) =
-                    return_type.def_id_no_primitives().map(|did| tcx.def_kind(did).into())
-                {
+                if let Some(kind) = return_type.def_id(cache).map(|did| tcx.def_kind(did).into()) {
                     ret_types.push(TypeWithKind::from((get_index_type(return_type, vec![]), kind)));
                 }
             }
index 4c79218f62a4dd0e58045b68a7aea7c6e4d36845..76913a5c1c5b5e077c763701e76ffb515dd172e0 100644 (file)
@@ -1502,7 +1502,6 @@ kbd {
        vertical-align: middle;
        border: solid 1px;
        border-radius: 3px;
-       box-shadow: inset 0 -1px 0;
        cursor: default;
 }
 
@@ -1799,8 +1798,9 @@ details.rustdoc-toggle[open] > summary.hideme::after {
                background-color: rgba(0,0,0,0);
                margin: 0;
                padding: 0;
-               padding-left: 15px;
                z-index: 11;
+               /* Reduce height slightly to account for mobile topbar. */
+               height: calc(100vh - 45px);
        }
 
        /* The source view uses a different design for the sidebar toggle, and doesn't have a topbar,
@@ -1831,7 +1831,13 @@ details.rustdoc-toggle[open] > summary.hideme::after {
                padding: 0.3em;
                padding-right: 0.6em;
                text-overflow: ellipsis;
-               overflow-x: hidden;
+               overflow: hidden;
+               white-space: nowrap;
+               /* Rare exception to specifying font sizes in rem. Since the topbar
+                  height is specified in pixels, this also has to be specified in
+                  pixels to avoid overflowing the topbar when the user sets a bigger
+                  font size. */
+               font-size: 22.4px;
        }
 
        .mobile-topbar .logo-container {
@@ -1864,6 +1870,9 @@ details.rustdoc-toggle[open] > summary.hideme::after {
 
        .sidebar-menu-toggle {
                width: 45px;
+               /* Rare exception to specifying font sizes in rem. Since this is acting
+                  as an icon, it's okay to specify its sizes in pixels. */
+               font-size: 32px;
                border: none;
        }
 
index 5d60aca6f27cd32ec429c251334796e660d97ca3..0aaf4f78c34ef1ae18ce79f1c1669749558199a9 100644 (file)
@@ -216,6 +216,7 @@ a.anchor,
 pre.rust a,
 .sidebar h2 a,
 .sidebar h3 a,
+.mobile-topbar h2 a,
 .in-band a {
        color: #c5c5c5;
 }
@@ -531,7 +532,7 @@ kbd {
        background-color: #314559;
        border-color: #5c6773;
        border-bottom-color: #5c6773;
-       box-shadow-color: #c6cbd1;
+       box-shadow: inset 0 -1px 0 #5c6773;
 }
 
 #theme-picker, #settings-menu, #help-button {
@@ -630,5 +631,5 @@ input:checked + .slider {
        background: #616161;
 }
 .toggle-line:hover .toggle-line-inner {
-       background: ##898989;
+       background: #898989;
 }
index 96588af54e8fb5b015b38430c50920f30a19938c..4fad2359ff0eb66bbc5aa883fa2df8ecbbe5a8d3 100644 (file)
@@ -192,6 +192,7 @@ a.anchor,
 pre.rust a,
 .sidebar h2 a,
 .sidebar h3 a,
+.mobile-topbar h2 a,
 .in-band a {
        color: #ddd;
 }
@@ -407,7 +408,7 @@ kbd {
        background-color: #fafbfc;
        border-color: #d1d5da;
        border-bottom-color: #c6cbd1;
-       box-shadow-color: #c6cbd1;
+       box-shadow: inset 0 -1px 0 #c6cbd1;
 }
 
 #theme-picker, #settings-menu, #help-button {
@@ -496,5 +497,5 @@ div.files > .selected {
        background: #616161;
 }
 .toggle-line:hover .toggle-line-inner {
-       background: ##898989;
+       background: #898989;
 }
index edb346c23b48c7ea05b2cb6678c37f9cee4974c3..16a777b7e672a58ef807ccbd5cc2ed0833e042c2 100644 (file)
@@ -44,7 +44,9 @@ pre, .rustdoc.source .example-wrap {
 }
 
 .rust-logo {
-       /* No need for a border in here! */
+       /* This rule exists to force other themes to explicitly style the logo.
+        * Rustdoc has a custom linter for this purpose.
+        */
 }
 
 /* Improve the scrollbar display on webkit-based browsers */
@@ -189,6 +191,7 @@ a.anchor,
 pre.rust a,
 .sidebar h2 a,
 .sidebar h3 a,
+.mobile-topbar h2 a,
 .in-band a {
        color: #000;
 }
@@ -391,7 +394,7 @@ kbd {
        background-color: #fafbfc;
        border-color: #d1d5da;
        border-bottom-color: #c6cbd1;
-       box-shadow-color: #c6cbd1;
+       box-shadow: inset 0 -1px 0 #c6cbd1;
 }
 
 #theme-picker, #settings-menu, #help-button {
index 161b95d99930e761de21ae49be2b8e41df3377ba..3c21a96cef02a4b812815bfd6db9f42de60e1e56 100644 (file)
@@ -72,7 +72,7 @@ function resourcePath(basename, extension) {
         var mobileLocationTitle = document.querySelector(".mobile-topbar h2.location");
         var locationTitle = document.querySelector(".sidebar h2.location");
         if (mobileLocationTitle && locationTitle) {
-            mobileLocationTitle.innerText = locationTitle.innerText;
+            mobileLocationTitle.innerHTML = locationTitle.innerHTML;
         }
     }
 }());
index 1fa84e1c31f7010c5972e8c108b7baa654a958c6..62b1b7ca7292a25aafd556d53085262427c8115e 100644 (file)
@@ -20,7 +20,7 @@
         {% endif %}
         {%- match src_href -%}
             {%- when Some with (href) -%}
-                <a class="srclink" href="{{href|safe}}" title="goto source code">source</a> Â· {# -#}
+                <a class="srclink" href="{{href|safe}}">source</a> Â· {# -#}
             {%- else -%}
         {%- endmatch -%}
         <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> {#- -#}
index e1747f3e392650e7a3987aa6460fb956904980bb..86662ebaaca215505d5baaddb3de1bd8b7a45306 100644 (file)
@@ -920,6 +920,7 @@ fn trait_assoc_to_impl_assoc_item<'tcx>(
 ///
 /// NOTE: this cannot be a query because more traits could be available when more crates are compiled!
 /// So it is not stable to serialize cross-crate.
+#[instrument(level = "debug", skip(cx))]
 fn trait_impls_for<'a>(
     cx: &mut DocContext<'a>,
     ty: Ty<'a>,
index 34aae4b6e39906cf0c6cb5a3f587708dd4f1793e..edd4e9da66d99043010da3582f9a6163278b457d 100644 (file)
         all_trait_impls: Default::default(),
     };
 
+    // Because of the `crate::` prefix, any doc comment can reference
+    // the crate root's set of in-scope traits. This line makes sure
+    // it's available.
+    loader.add_traits_in_scope(CRATE_DEF_ID.to_def_id());
+
     // Overridden `visit_item` below doesn't apply to the crate root,
     // so we have to visit its attributes and reexports separately.
     loader.load_links_in_attrs(&krate.attrs, krate.span);
@@ -180,6 +185,11 @@ fn visit_item(&mut self, item: &ast::Item) {
         if let ItemKind::Mod(..) = item.kind {
             let old_mod = mem::replace(&mut self.current_mod, self.resolver.local_def_id(item.id));
 
+            // A module written with a outline doc comments will resolve traits relative
+            // to the parent module. Make sure the parent module's traits-in-scope are
+            // loaded, even if the module itself has no doc comments.
+            self.add_traits_in_parent_scope(self.current_mod.to_def_id());
+
             self.load_links_in_attrs(&item.attrs, item.span);
             self.process_module_children_or_reexports(self.current_mod.to_def_id());
             visit::walk_item(self, item);
index 66ac612ea37c40d0011d8ca00598fb31c6f300c0..53280b3df138b39a03724cd22fd00fe63938d411 100644 (file)
@@ -4,6 +4,7 @@
 use super::Pass;
 use crate::clean::*;
 use crate::core::DocContext;
+use crate::formats::cache::Cache;
 use crate::visit::DocVisitor;
 
 use rustc_data_structures::fx::{FxHashMap, FxHashSet};
         }
     });
 
-    let mut cleaner = BadImplStripper { prims, items: crate_items };
+    let mut cleaner = BadImplStripper { prims, items: crate_items, cache: &cx.cache };
     let mut type_did_to_deref_target: FxHashMap<DefId, &Type> = FxHashMap::default();
 
     // Follow all `Deref` targets of included items and recursively add them as valid
     fn add_deref_target(
         cx: &DocContext<'_>,
         map: &FxHashMap<DefId, &Type>,
-        cleaner: &mut BadImplStripper,
+        cleaner: &mut BadImplStripper<'_>,
         type_did: DefId,
     ) {
         if let Some(target) = map.get(&type_did) {
@@ -102,7 +103,7 @@ fn add_deref_target(
                 } else if let Some(did) = target.def_id(&cx.cache) {
                     cleaner.items.insert(did.into());
                 }
-                if let Some(for_did) = for_.def_id_no_primitives() {
+                if let Some(for_did) = for_.def_id(&cx.cache) {
                     if type_did_to_deref_target.insert(for_did, target).is_none() {
                         // Since only the `DefId` portion of the `Type` instances is known to be same for both the
                         // `Deref` target type and the impl for type positions, this map of types is keyed by
@@ -204,19 +205,20 @@ fn visit_item(&mut self, i: &Item) {
     }
 }
 
-struct BadImplStripper {
+struct BadImplStripper<'a> {
     prims: FxHashSet<PrimitiveType>,
     items: FxHashSet<ItemId>,
+    cache: &'a Cache,
 }
 
-impl BadImplStripper {
+impl<'a> BadImplStripper<'a> {
     fn keep_impl(&self, ty: &Type, is_deref: bool) -> bool {
         if let Generic(_) = ty {
             // keep impls made on generics
             true
         } else if let Some(prim) = ty.primitive_type() {
             self.prims.contains(&prim)
-        } else if let Some(did) = ty.def_id_no_primitives() {
+        } else if let Some(did) = ty.def_id(self.cache) {
             is_deref || self.keep_impl_with_def_id(did.into())
         } else {
             false
index e63534659add7836950c26917203fb312289a7e2..e7a99ee7bfd840fb24f724150c13d6b6a405dd93 100644 (file)
@@ -15,7 +15,7 @@
 };
 
 /// Strip items marked `#[doc(hidden)]`
-crate fn strip_hidden(krate: clean::Crate, _: &mut DocContext<'_>) -> clean::Crate {
+crate fn strip_hidden(krate: clean::Crate, cx: &mut DocContext<'_>) -> clean::Crate {
     let mut retained = ItemIdSet::default();
 
     // strip all #[doc(hidden)] items
@@ -25,7 +25,7 @@
     };
 
     // strip all impls referencing stripped items
-    let mut stripper = ImplStripper { retained: &retained };
+    let mut stripper = ImplStripper { retained: &retained, cache: &cx.cache };
     stripper.fold_crate(krate)
 }
 
index c6b5bec4692dc3b4fbafb94bee7830d266c4289a..ef7e768a5114922abbd178e9560d9ec919341c33 100644 (file)
@@ -29,6 +29,6 @@
     }
 
     // strip all impls referencing private items
-    let mut stripper = ImplStripper { retained: &retained };
+    let mut stripper = ImplStripper { retained: &retained, cache: &cx.cache };
     stripper.fold_crate(krate)
 }
index 7b07974ae01c67a54cb59905ecc12e26148ff3cd..717dc078b343cf3fd46176df79c8b54d74de2c74 100644 (file)
@@ -5,6 +5,7 @@
 
 use crate::clean::{self, Item, ItemIdSet};
 use crate::fold::{strip_item, DocFolder};
+use crate::formats::cache::Cache;
 
 crate struct Stripper<'a> {
     crate retained: &'a mut ItemIdSet,
@@ -118,6 +119,7 @@ fn fold_item(&mut self, i: Item) -> Option<Item> {
 /// This stripper discards all impls which reference stripped items
 crate struct ImplStripper<'a> {
     crate retained: &'a ItemIdSet,
+    crate cache: &'a Cache,
 }
 
 impl<'a> DocFolder for ImplStripper<'a> {
@@ -127,7 +129,7 @@ fn fold_item(&mut self, i: Item) -> Option<Item> {
             if imp.trait_.is_none() && imp.items.is_empty() {
                 return None;
             }
-            if let Some(did) = imp.for_.def_id_no_primitives() {
+            if let Some(did) = imp.for_.def_id(self.cache) {
                 if did.is_local() && !imp.for_.is_assoc_ty() && !self.retained.contains(&did.into())
                 {
                     debug!("ImplStripper: impl item for stripped type; removing");
@@ -142,7 +144,7 @@ fn fold_item(&mut self, i: Item) -> Option<Item> {
             }
             if let Some(generics) = imp.trait_.as_ref().and_then(|t| t.generics()) {
                 for typaram in generics {
-                    if let Some(did) = typaram.def_id_no_primitives() {
+                    if let Some(did) = typaram.def_id(self.cache) {
                         if did.is_local() && !self.retained.contains(&did.into()) {
                             debug!(
                                 "ImplStripper: stripped item in trait's generics; removing impl"
index 221a195b62f4373a8893f4d022e4ce981b09a857..b6b46f596a7d2523ee1acd1c00e699615849da60 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 221a195b62f4373a8893f4d022e4ce981b09a857
+Subproject commit b6b46f596a7d2523ee1acd1c00e699615849da60
index 6c1b95b4145793c917e923f2b22a38cada152878..525902be8524cfcfb2bcab7432fc0f765e04c8f9 100644 (file)
   "__comment": "Generated by `./x.py run src/tools/bump-stage0`. Run that command again to update the bootstrap compiler.",
   "dist_server": "https://static.rust-lang.org",
   "compiler": {
-    "date": "2021-11-30",
+    "date": "2022-01-28",
     "version": "beta"
   },
   "rustfmt": {
-    "date": "2021-11-30",
+    "date": "2022-01-28",
     "version": "nightly"
   },
   "checksums_sha256": {
-    "dist/2021-11-30/cargo-beta-aarch64-apple-darwin.tar.gz": "f7dadcadc22aab3ed9ddd737a9c2af05f42ffe48b431bbad5d43128130480279",
-    "dist/2021-11-30/cargo-beta-aarch64-apple-darwin.tar.xz": "0ee7c052bb1fd3f3655d9ff74b3f38ebb256d3f523750dbde1be9bceb207cda9",
-    "dist/2021-11-30/cargo-beta-aarch64-pc-windows-msvc.tar.gz": "68d914f773b122bd1ceae13a55d3c8365753d09d4371e3962401b9a48945cf20",
-    "dist/2021-11-30/cargo-beta-aarch64-pc-windows-msvc.tar.xz": "b0204e516f0c22b956f227555be5665df96c4e0f60281592b00678b4ea8ad4e9",
-    "dist/2021-11-30/cargo-beta-aarch64-unknown-linux-gnu.tar.gz": "77b771198aaf78c039df9c08493a9af5d1eb02e6b88bd4fc3b42269cdbf582d0",
-    "dist/2021-11-30/cargo-beta-aarch64-unknown-linux-gnu.tar.xz": "6f6465db2c726cc3d2db73150377ed17cbe164297f8cbffc51c8194494cb0384",
-    "dist/2021-11-30/cargo-beta-aarch64-unknown-linux-musl.tar.gz": "76a8001adffd5d7a607459f1726f3d68c95e6eb4925eac9ccb77b213c37d2385",
-    "dist/2021-11-30/cargo-beta-aarch64-unknown-linux-musl.tar.xz": "07dac7cfe68cb6b0a1872728c1dfb3fde0f9fa27a08933494faaf58a5e35865a",
-    "dist/2021-11-30/cargo-beta-arm-unknown-linux-gnueabi.tar.gz": "d2d6d2b56cbcc8bb5b2139818770fc155146d6b4469678de8a1e8249f15137d7",
-    "dist/2021-11-30/cargo-beta-arm-unknown-linux-gnueabi.tar.xz": "5f97d1449b9c4461be47615ab49ec408d8f1981b7a1bc0d7b7cce606c14cd5ed",
-    "dist/2021-11-30/cargo-beta-arm-unknown-linux-gnueabihf.tar.gz": "097d346e828a37ae5be077f0896796ab6238194846f8ae279cd9e2f510645625",
-    "dist/2021-11-30/cargo-beta-arm-unknown-linux-gnueabihf.tar.xz": "71a7906aea42e1048fc43828ece3da720eea4f9d4ff59e970e273f0fe9191e12",
-    "dist/2021-11-30/cargo-beta-armv7-unknown-linux-gnueabihf.tar.gz": "20e49a6995503dd8215dc9f56ffb87dc9f07fe85a1b0d2f409313836dc0dda3f",
-    "dist/2021-11-30/cargo-beta-armv7-unknown-linux-gnueabihf.tar.xz": "b9388524cec65e789bb5eaf22cfd63ce837b9a98d1b769901597c6f061f1b93d",
-    "dist/2021-11-30/cargo-beta-i686-pc-windows-gnu.tar.gz": "7b0bf29bc67904a64560402891d60506a29b7cd64007d7c1f4e168a574009a9c",
-    "dist/2021-11-30/cargo-beta-i686-pc-windows-gnu.tar.xz": "c580c17566e36cbb91945e0fb9e592ac7578d32da948c70aabb90de80000f5c8",
-    "dist/2021-11-30/cargo-beta-i686-pc-windows-msvc.tar.gz": "e34436449fb69b8ca696b4bcba8e18a612fee189ad8069d765813d39c708ad58",
-    "dist/2021-11-30/cargo-beta-i686-pc-windows-msvc.tar.xz": "322836c74da2b221426782e4b5e174571d1da1935d478b4b8b948608a28a20e8",
-    "dist/2021-11-30/cargo-beta-i686-unknown-linux-gnu.tar.gz": "ab2361cb4cbe44331e34a50728dd56a3db220e08f1b29452f781ee075b236c33",
-    "dist/2021-11-30/cargo-beta-i686-unknown-linux-gnu.tar.xz": "6375ef38e8e6270d6d932d176a7e62014daf153e873667f6d4a5335fa15f8bf3",
-    "dist/2021-11-30/cargo-beta-mips-unknown-linux-gnu.tar.gz": "3e80c94aef4511090e6a83f64b304b835ae2a8e769d3beec96e3f08c0faca01c",
-    "dist/2021-11-30/cargo-beta-mips-unknown-linux-gnu.tar.xz": "af954c96c823d711b372c94a2f2bab32536a4e39bcdd0351674252837096f8b4",
-    "dist/2021-11-30/cargo-beta-mips64-unknown-linux-gnuabi64.tar.gz": "92464fb6d0691a591637cf342842b42b940f8a84525f1e1f51493734f2ad7b1b",
-    "dist/2021-11-30/cargo-beta-mips64-unknown-linux-gnuabi64.tar.xz": "5ddeb87b53749bc532322ee8435fd442adbfaa5e80f3b614b7153c40f46d63d1",
-    "dist/2021-11-30/cargo-beta-mips64el-unknown-linux-gnuabi64.tar.gz": "1c60eccc658664853232131fb48dc5d2c66340bb95d242084c211c59407fa667",
-    "dist/2021-11-30/cargo-beta-mips64el-unknown-linux-gnuabi64.tar.xz": "257aab89cd0d5d9af408fc346aeccb8d51e1eba5dc0db074db1f4b57a8d4aab2",
-    "dist/2021-11-30/cargo-beta-mipsel-unknown-linux-gnu.tar.gz": "20b1fa2138a547f5f6644acfbca9e73f8d228578a600c7710cb2fc34a20eb058",
-    "dist/2021-11-30/cargo-beta-mipsel-unknown-linux-gnu.tar.xz": "134dde13eb7dedb8fc608acae62d715937c168a9fe5a449262e9ac9b3f042396",
-    "dist/2021-11-30/cargo-beta-powerpc-unknown-linux-gnu.tar.gz": "4ffca03462b91b9cbb02a022546aa0e16118eb1950a8f040929e5bfceee2b9f7",
-    "dist/2021-11-30/cargo-beta-powerpc-unknown-linux-gnu.tar.xz": "14bfd567241f969de712240f78d83d21dab0bd11ac42da38a2b02da7a59a9dc9",
-    "dist/2021-11-30/cargo-beta-powerpc64-unknown-linux-gnu.tar.gz": "f44113175429958961148bef66d0ec1b52850c19c035ac83b0d20139e1116d97",
-    "dist/2021-11-30/cargo-beta-powerpc64-unknown-linux-gnu.tar.xz": "3e5f05f0f5aa2fb8b2e63eed7b29ce67831158648f64c2892b477b318a86e300",
-    "dist/2021-11-30/cargo-beta-powerpc64le-unknown-linux-gnu.tar.gz": "76258605464ea434a2c28c2fd05f1947b2165fa10a2810958397d8352e20215d",
-    "dist/2021-11-30/cargo-beta-powerpc64le-unknown-linux-gnu.tar.xz": "c4f2e0756f8571ed7b1bd82702d91b32cc40af58e0697c2f307feeb5755f93ae",
-    "dist/2021-11-30/cargo-beta-riscv64gc-unknown-linux-gnu.tar.gz": "c466a280084c164ca4a120b184eab6403c80db962c0d2d1f2cb5b662746ec4da",
-    "dist/2021-11-30/cargo-beta-riscv64gc-unknown-linux-gnu.tar.xz": "b6f97111eeab0403c67965d57f9bee2ecdf5f39eb44941070d3cd06745f235a3",
-    "dist/2021-11-30/cargo-beta-s390x-unknown-linux-gnu.tar.gz": "2ab5f013205446852a06f27b326f6454a5b3fb958413a7e00e1d8402413155b5",
-    "dist/2021-11-30/cargo-beta-s390x-unknown-linux-gnu.tar.xz": "49dd5e7e3b8091546ef932f359fc4260e3f0b7ec851f43dd10f471c6fe50a5cd",
-    "dist/2021-11-30/cargo-beta-x86_64-apple-darwin.tar.gz": "ac20e50e745914c8431a5c6993b9dbb6bf7b745e4b45283b230207e7be1bb167",
-    "dist/2021-11-30/cargo-beta-x86_64-apple-darwin.tar.xz": "dec91c3f6eda827d3976b96da8def71ad3cc0b71fbe1b4e5387a464a8bbd85c3",
-    "dist/2021-11-30/cargo-beta-x86_64-pc-windows-gnu.tar.gz": "e11e26ad4fde6109808f4cd752c2a810c8ca81b890b0c09902be981a72c43723",
-    "dist/2021-11-30/cargo-beta-x86_64-pc-windows-gnu.tar.xz": "fb49db7bce2376335f4fda11cc454b3d762bd7f95c5dba85596100bd0c1e148a",
-    "dist/2021-11-30/cargo-beta-x86_64-pc-windows-msvc.tar.gz": "7703eb725703aeffb57d6a2c0c95c44b6e4eed09b4a99b37346ea895a1d51088",
-    "dist/2021-11-30/cargo-beta-x86_64-pc-windows-msvc.tar.xz": "65e0f34d9b4af3b270d8d4752c94b58e54895d180fddc3f4b535406e16b8a356",
-    "dist/2021-11-30/cargo-beta-x86_64-unknown-freebsd.tar.gz": "4624bd8e93bc1c36bccd15b44f484059f485df1c0cd1b8bcf21c4855c85b7ea4",
-    "dist/2021-11-30/cargo-beta-x86_64-unknown-freebsd.tar.xz": "a277a3fccfba30db2942c8303db16e5112d72c7721fe7a777cf24a301b68ad2c",
-    "dist/2021-11-30/cargo-beta-x86_64-unknown-illumos.tar.gz": "37e034e5c83bab47ac5cd502d4f6385af270040fb7eb59221bc02cdbcf949d0b",
-    "dist/2021-11-30/cargo-beta-x86_64-unknown-illumos.tar.xz": "d26eda6fd5533defbf3983f2bb9c07c0cba00abf4c346443080059c4810ef1b6",
-    "dist/2021-11-30/cargo-beta-x86_64-unknown-linux-gnu.tar.gz": "909f8bc8dce0276695f1e88994bd21ba2ad4a3ff66b8172e566b7907d9f2531c",
-    "dist/2021-11-30/cargo-beta-x86_64-unknown-linux-gnu.tar.xz": "52807fac650c03c9d398ce6e5987ecfd5e8e30b5c4e94c320ebc2a6fd665740c",
-    "dist/2021-11-30/cargo-beta-x86_64-unknown-linux-musl.tar.gz": "3158dcde7e05e9871572dd7044b3c8466687d8afadbbffa4021a443f4973a4ac",
-    "dist/2021-11-30/cargo-beta-x86_64-unknown-linux-musl.tar.xz": "551ef92e71c001fe48804587e8532b5032d419bd139b2f59cbd8c2e308e3c2ae",
-    "dist/2021-11-30/cargo-beta-x86_64-unknown-netbsd.tar.gz": "9dd630b19f6c9ce26d2ed6a1f46c383d6bc3eecf1efb80f15a651ef4408197c0",
-    "dist/2021-11-30/cargo-beta-x86_64-unknown-netbsd.tar.xz": "1f128e4e8f9e98839caf64e68fbd163de1d5323abf40f718643a815081f898ac",
-    "dist/2021-11-30/rust-std-beta-aarch64-apple-darwin.tar.gz": "3aecc61fe4e056326182db5942cd472039f95788d165940df8b53742f70fb051",
-    "dist/2021-11-30/rust-std-beta-aarch64-apple-darwin.tar.xz": "db3cdaf50925184df6a79914cd1c0df0c9782f96829d23428b1a0ebc814fb468",
-    "dist/2021-11-30/rust-std-beta-aarch64-apple-ios-sim.tar.gz": "61df5ab32d3e11243bc2b8506c65af9d8a84a2bc93fc1315d046e20eb048c62e",
-    "dist/2021-11-30/rust-std-beta-aarch64-apple-ios-sim.tar.xz": "42603c786c02ce754b4c756ac0fe4d88574231f5a8d31b6f9a1192680f8eb180",
-    "dist/2021-11-30/rust-std-beta-aarch64-apple-ios.tar.gz": "49e5d2df9b1019e21c14a1b7f8e69515c16d810dc354ddbe2429857214b3c33e",
-    "dist/2021-11-30/rust-std-beta-aarch64-apple-ios.tar.xz": "5323762166729cc7c3c5045b484ea2f50ec0dbdca15d8c7e82f0c29e1247f8e2",
-    "dist/2021-11-30/rust-std-beta-aarch64-fuchsia.tar.gz": "7510b5b538c735362ec6b12beaa9d3c8720c4ea1f686c643fcc40c5dabca5435",
-    "dist/2021-11-30/rust-std-beta-aarch64-fuchsia.tar.xz": "19b4d188923a820bc8424fed062bab64a56d33f8f00d9ba6792331f06eb0cbc0",
-    "dist/2021-11-30/rust-std-beta-aarch64-linux-android.tar.gz": "77a5e84c97f83ea8263fd147e5f5781a61bb5bdbf1cc40a3a8a72becc8dd486d",
-    "dist/2021-11-30/rust-std-beta-aarch64-linux-android.tar.xz": "c17f843d951d9fa72760e3a071557635da83c0dc279887648979277bcef66aff",
-    "dist/2021-11-30/rust-std-beta-aarch64-pc-windows-msvc.tar.gz": "6e86b78826f5e3d18b2f2aa4f274a5d7bacadbde8d7cfc72cc89dbcb0455fec3",
-    "dist/2021-11-30/rust-std-beta-aarch64-pc-windows-msvc.tar.xz": "e1b1e9eb09e851c8125319432b9fb52a6aa815b7f5bc82efbba7e375aab44764",
-    "dist/2021-11-30/rust-std-beta-aarch64-unknown-linux-gnu.tar.gz": "a6589e628f03fc7c39345cfa23827be6cf26391848bc576a66c7701f18a01669",
-    "dist/2021-11-30/rust-std-beta-aarch64-unknown-linux-gnu.tar.xz": "a0cb9706216575748a953b6e36b59875c6bf9b9410d4a8085974e324c0cbb7e0",
-    "dist/2021-11-30/rust-std-beta-aarch64-unknown-linux-musl.tar.gz": "c803cfd7c803de2b210d5e9800d44f3365a0b4ae581d987b415fdfb990de1a30",
-    "dist/2021-11-30/rust-std-beta-aarch64-unknown-linux-musl.tar.xz": "a93310d2102699602c348901186992c1305a1a20fd0a2e5d8985a4f32e61eb28",
-    "dist/2021-11-30/rust-std-beta-aarch64-unknown-none-softfloat.tar.gz": "2ce3460b436c8c44e074ce1cb8c81bb2cd37ec8ea8fde1b766f113b39412d71c",
-    "dist/2021-11-30/rust-std-beta-aarch64-unknown-none-softfloat.tar.xz": "5e65f8409d2a8eb366f29fe994469f257b18e70ad0707be2ca9c144a0b6f9a78",
-    "dist/2021-11-30/rust-std-beta-aarch64-unknown-none.tar.gz": "a4b73dfbf9df497883b2f5ea3053c256838e1e706f312ee02e1b018b9a7f6099",
-    "dist/2021-11-30/rust-std-beta-aarch64-unknown-none.tar.xz": "a70bd19ae1fa41a3413f0a0b6b2beff569c1b16829cd675967a6d1cd92d8dd54",
-    "dist/2021-11-30/rust-std-beta-arm-linux-androideabi.tar.gz": "46eabf68836f62fe8dfb39c54ee63e9fe211ab84443ff17c46b5240e0d08e723",
-    "dist/2021-11-30/rust-std-beta-arm-linux-androideabi.tar.xz": "9a4e53e3e867e9e18959cba32078c4f7d588247b74e156cc68345808d7b7ecc4",
-    "dist/2021-11-30/rust-std-beta-arm-unknown-linux-gnueabi.tar.gz": "66d9e4de284d7a221f66a2c615d6ec0805dc8f1a91a184cc96701cf98116be60",
-    "dist/2021-11-30/rust-std-beta-arm-unknown-linux-gnueabi.tar.xz": "1af2fd7a16d51e2f4bd6e1840b935e2cdc7a8f3b3b1144d22b42cea52b9bd185",
-    "dist/2021-11-30/rust-std-beta-arm-unknown-linux-gnueabihf.tar.gz": "cb479e676240ef682d3ad27390bc2498f80a421d321e9423cb923b972ea86675",
-    "dist/2021-11-30/rust-std-beta-arm-unknown-linux-gnueabihf.tar.xz": "0011ba4db5a8310199011d37818818867703bf6fbbcd7e1a7bead621eda1e5f2",
-    "dist/2021-11-30/rust-std-beta-arm-unknown-linux-musleabi.tar.gz": "8b192e6f0263d925aac1436887f67b24fa02f31c0fc708c30827f0363f032ceb",
-    "dist/2021-11-30/rust-std-beta-arm-unknown-linux-musleabi.tar.xz": "688755d433c1227db1125ee52e7aa643f27f922b21fbe3a5fcaf70467d159a79",
-    "dist/2021-11-30/rust-std-beta-arm-unknown-linux-musleabihf.tar.gz": "b336cef0e11136ccf5c41669869426a376d570042d3c99eed6c448cfe165818e",
-    "dist/2021-11-30/rust-std-beta-arm-unknown-linux-musleabihf.tar.xz": "1be7d7f0de2ae63b9dd282efc24531f1146fbc7831b84d9c0cd2c8cbdff32fe3",
-    "dist/2021-11-30/rust-std-beta-armebv7r-none-eabi.tar.gz": "33d49bd069b9fdbae8a6868e2cce6fcea26cfd0248372d3d3c977828b3fc51cd",
-    "dist/2021-11-30/rust-std-beta-armebv7r-none-eabi.tar.xz": "e204295b8b17388d8b4cfc04de5690b4b6a377da12df7c24f930c064da787200",
-    "dist/2021-11-30/rust-std-beta-armebv7r-none-eabihf.tar.gz": "07584d1a4f4979ff86aa8b8be820810366c4fdbda4e5dec93c0a5883804a2103",
-    "dist/2021-11-30/rust-std-beta-armebv7r-none-eabihf.tar.xz": "4f73d8af677409960ac480c254f25547752ffe08b80785dceb6b6f1fdc0b6646",
-    "dist/2021-11-30/rust-std-beta-armv5te-unknown-linux-gnueabi.tar.gz": "fb998ae84f383f1ee93fb946f396545a60d4a58f1f0107653f3dcf97e2cfb4f7",
-    "dist/2021-11-30/rust-std-beta-armv5te-unknown-linux-gnueabi.tar.xz": "8d8fdc9404422d0519328d6a622262833c5465b1cba62a59951a05f59d6cb15a",
-    "dist/2021-11-30/rust-std-beta-armv5te-unknown-linux-musleabi.tar.gz": "c8abc1c472326419065caed5567bffc4bcfac2af45fafb7f1327b468f26a0112",
-    "dist/2021-11-30/rust-std-beta-armv5te-unknown-linux-musleabi.tar.xz": "d905b6339363b2538bc39607c0fc58dae2b8023b1c3c1f745654a839ec178988",
-    "dist/2021-11-30/rust-std-beta-armv7-linux-androideabi.tar.gz": "69dbb3e17dcdfa9e6acc465fae4427a2596e8bfc024cc18d30201f41bcdd1be2",
-    "dist/2021-11-30/rust-std-beta-armv7-linux-androideabi.tar.xz": "f012832da820d59a791bf39c25e282c2b92bee75377e4fca7e9520162be62b83",
-    "dist/2021-11-30/rust-std-beta-armv7-unknown-linux-gnueabi.tar.gz": "bb742536d0d7b664ac7277bc5e45f40d64001da0ff1f9e088edc5240e1b35dcf",
-    "dist/2021-11-30/rust-std-beta-armv7-unknown-linux-gnueabi.tar.xz": "6d4c050229400ef1f2e384a4a360569309d1a0828ff07f97c73ca294ef114ca1",
-    "dist/2021-11-30/rust-std-beta-armv7-unknown-linux-gnueabihf.tar.gz": "c7c354d1bd4071ef69e8d91ee5c020c9aac613ddb2565c9a3a01fa41903e3715",
-    "dist/2021-11-30/rust-std-beta-armv7-unknown-linux-gnueabihf.tar.xz": "1bfe9acf4bc7f1e58f1e5a721172df69be65e049894046561bc94ed6ed67c24c",
-    "dist/2021-11-30/rust-std-beta-armv7-unknown-linux-musleabi.tar.gz": "96fe9952332d7aee42e61445226793af32995d0f21fde7ebfe751ef2f9acfd90",
-    "dist/2021-11-30/rust-std-beta-armv7-unknown-linux-musleabi.tar.xz": "2f85ea745f03f779306f78ddff9389f4417d826258a90740a76b37bd14b8fca6",
-    "dist/2021-11-30/rust-std-beta-armv7-unknown-linux-musleabihf.tar.gz": "434b6eaffa2a4c798b4a6f00997d65c55d9fad24d176bbc54dc045339e654432",
-    "dist/2021-11-30/rust-std-beta-armv7-unknown-linux-musleabihf.tar.xz": "955fd83cc57de91fea9aea3f563c4cb5a2611e6dd24406845f7e8be5b7f25f3c",
-    "dist/2021-11-30/rust-std-beta-armv7a-none-eabi.tar.gz": "45a4818cc22f80252264309263994270b2e15ec8db7ced500cef838f09260fa5",
-    "dist/2021-11-30/rust-std-beta-armv7a-none-eabi.tar.xz": "8748379556a312b31788b5458b74d5d7fb2fa61f29e5528e449d216c21f4e9ed",
-    "dist/2021-11-30/rust-std-beta-armv7r-none-eabi.tar.gz": "928a6b77d3e6e8030c6ee454d648c5f6eb0b79a8beda3d11fc3578cc4556ac45",
-    "dist/2021-11-30/rust-std-beta-armv7r-none-eabi.tar.xz": "428526e30a28a9dba01943800a179b7ba144866f36dd69171a4fd1804345b75f",
-    "dist/2021-11-30/rust-std-beta-armv7r-none-eabihf.tar.gz": "e1e43b61b7826fe4f8063d89896e7b86a13e41ed3a17ef2684d1bded5252b7b6",
-    "dist/2021-11-30/rust-std-beta-armv7r-none-eabihf.tar.xz": "5f6478a196f1eabd6d4b58ebacf89c3635a9488f4b2f145283e9352cff5da7b8",
-    "dist/2021-11-30/rust-std-beta-asmjs-unknown-emscripten.tar.gz": "65b23ab952ed313cc9de94eae473a28eb9b7d9ca8aa432f4d3a08c30484e30c7",
-    "dist/2021-11-30/rust-std-beta-asmjs-unknown-emscripten.tar.xz": "949e3b832f70c3effa2b78363b42caf0720ede57722c360b710773bd7f3e1502",
-    "dist/2021-11-30/rust-std-beta-i586-pc-windows-msvc.tar.gz": "06667714b168e2e0d6e0f3e81cc3fb68940f77aa3cd3495d91ce9ff15502ab9f",
-    "dist/2021-11-30/rust-std-beta-i586-pc-windows-msvc.tar.xz": "9794592856633299de53e697579c75bcf6009c6f05c7bfcadf8c63dfa383b3f9",
-    "dist/2021-11-30/rust-std-beta-i586-unknown-linux-gnu.tar.gz": "ffb8b8ec98f9732602edcf3e4e628327f8ef80712c59ebaab5392503ed04460c",
-    "dist/2021-11-30/rust-std-beta-i586-unknown-linux-gnu.tar.xz": "7f60c2798023bdf3993b443783d3d6dd350abfa3bbdce58ada3e9b3d3c4391f0",
-    "dist/2021-11-30/rust-std-beta-i586-unknown-linux-musl.tar.gz": "f086f349faf5f44b0fbd060f3c40b553aa5a6309a02c08e8a45d27cb3a820926",
-    "dist/2021-11-30/rust-std-beta-i586-unknown-linux-musl.tar.xz": "05ebd51df4b17c22569d69a65d9542b5010beea023e545859a23bb244162b537",
-    "dist/2021-11-30/rust-std-beta-i686-linux-android.tar.gz": "0f2a192b970209d10f2ffb4f88dcb6637e1ed822e47fef8e0d3daf4ca8b250d9",
-    "dist/2021-11-30/rust-std-beta-i686-linux-android.tar.xz": "3aee7e88fbcc0290219a8d980efb1c6d8a1642a1576393fe3b5d400a68b17f8b",
-    "dist/2021-11-30/rust-std-beta-i686-pc-windows-gnu.tar.gz": "251780731ee8c996dc1adb59148d7a0307642e11f3bf767c0caaf5f37b70b395",
-    "dist/2021-11-30/rust-std-beta-i686-pc-windows-gnu.tar.xz": "76c8cd535a4ab4f9c0ccca19986f483de63e7c6c0708e37de653acb80621bce0",
-    "dist/2021-11-30/rust-std-beta-i686-pc-windows-msvc.tar.gz": "ce1b7c98f381f207a26ca3fa5937f5e276eb8f91ef6ae2e0e082370e9ca1c21e",
-    "dist/2021-11-30/rust-std-beta-i686-pc-windows-msvc.tar.xz": "106f655c10d182b6581e87cff881bf081efe9404b52885b6efed4eb0f09a3a04",
-    "dist/2021-11-30/rust-std-beta-i686-unknown-freebsd.tar.gz": "2cac777f7178954e5c19e266d57927ddf68b74aa5a0161e35e096569d0a6946c",
-    "dist/2021-11-30/rust-std-beta-i686-unknown-freebsd.tar.xz": "abd915c242fdd2e8f7d53291b2d84d269f9c6f4c4059c725770c3e47e50c4758",
-    "dist/2021-11-30/rust-std-beta-i686-unknown-linux-gnu.tar.gz": "f680956e937e421c7868a22ec3ac2a6de7bc8203fae17937793914f4a9fd1657",
-    "dist/2021-11-30/rust-std-beta-i686-unknown-linux-gnu.tar.xz": "15c71b8a2e8604a49240f5d6d0da65c40c8c207f1ebec943cb8c50cd7a51d879",
-    "dist/2021-11-30/rust-std-beta-i686-unknown-linux-musl.tar.gz": "71c15bbabb5bcadb603513c73e40a96026fc8f6d5c82e9ea9b6569fcc22d5af2",
-    "dist/2021-11-30/rust-std-beta-i686-unknown-linux-musl.tar.xz": "4a9af011d4a2b63a0357c6367210fbf4b6e116b5388ed3a62b758a4bad1fa77f",
-    "dist/2021-11-30/rust-std-beta-mips-unknown-linux-gnu.tar.gz": "c44531c5467c1e01739f3796db1f59c4b6d6483f4bb8c398c751dbc30ed550ed",
-    "dist/2021-11-30/rust-std-beta-mips-unknown-linux-gnu.tar.xz": "0ec54d445e3c24bf7aa8ecdca45f49abfc2e4013c7af682d7134a5e52e752d23",
-    "dist/2021-11-30/rust-std-beta-mips-unknown-linux-musl.tar.gz": "3ea1a25b04112d83771e7b713ff8d33418bd18a7adcaaf6cce68f537cb27fefb",
-    "dist/2021-11-30/rust-std-beta-mips-unknown-linux-musl.tar.xz": "c904834d0fa015d24ba0e929e900ad06bfe773bc4a439f9bbcd8862a5065171c",
-    "dist/2021-11-30/rust-std-beta-mips64-unknown-linux-gnuabi64.tar.gz": "498cda7a23e81ed7563650deb320361c8cffdc10de13ce143175e77f720600ed",
-    "dist/2021-11-30/rust-std-beta-mips64-unknown-linux-gnuabi64.tar.xz": "bb0e95d7fad089cc84e826adffc416757df4480ffdfd09547625950b13b9e934",
-    "dist/2021-11-30/rust-std-beta-mips64-unknown-linux-muslabi64.tar.gz": "87ae1f563963370eeaa3f46d568339d5589e4fd509d21087db43ca2f1d6a1daf",
-    "dist/2021-11-30/rust-std-beta-mips64-unknown-linux-muslabi64.tar.xz": "da6268585d69c9c71c92dadb658bc7c055b5ce4c87abc52b5451d1111c1675dd",
-    "dist/2021-11-30/rust-std-beta-mips64el-unknown-linux-gnuabi64.tar.gz": "93c67427050266f49dc367a1f8e694989424664f740ae3911f78f1cc53faf35c",
-    "dist/2021-11-30/rust-std-beta-mips64el-unknown-linux-gnuabi64.tar.xz": "03f9a6e921555954b33fd7f446e9093ad4b631c86d001303e4c47078d0e1d385",
-    "dist/2021-11-30/rust-std-beta-mips64el-unknown-linux-muslabi64.tar.gz": "6c96a53e86f71965f1922585469501504b79c3347d09409033f871b1c9cdc856",
-    "dist/2021-11-30/rust-std-beta-mips64el-unknown-linux-muslabi64.tar.xz": "000e43f7e40abecd402242455f8a3d60692043ddb80bd15dd6f52acd1c5af096",
-    "dist/2021-11-30/rust-std-beta-mipsel-unknown-linux-gnu.tar.gz": "7ee55e1f5a63b52d7b87882fa4131fe848d18dba819d46e16ea2435889d84722",
-    "dist/2021-11-30/rust-std-beta-mipsel-unknown-linux-gnu.tar.xz": "b8fc28ffd7d97e76913755bedc2f9e7cec7150e036d13fcf7e50dc5a2422d1dd",
-    "dist/2021-11-30/rust-std-beta-mipsel-unknown-linux-musl.tar.gz": "af81aaa9bd624f57168762dfbae39853ada92043809bff953e108e97169e5732",
-    "dist/2021-11-30/rust-std-beta-mipsel-unknown-linux-musl.tar.xz": "37357e40af421ca5b4d2b95f19eca41ce016404ffcce8abea45e08721664f0e3",
-    "dist/2021-11-30/rust-std-beta-nvptx64-nvidia-cuda.tar.gz": "cbbd98fd3ee6bdd3c01e590c2f10367ec38d799e02ddbc1b0e31027684a356f6",
-    "dist/2021-11-30/rust-std-beta-nvptx64-nvidia-cuda.tar.xz": "defda4e2ef2f3baf8c7d2a9159d17ca439004687f0b6714826408b94d4f0aed0",
-    "dist/2021-11-30/rust-std-beta-powerpc-unknown-linux-gnu.tar.gz": "201c5bdc1dba11e039bea9257e17ddd2f50b29448b070fc0edb4a7a9f4e45f45",
-    "dist/2021-11-30/rust-std-beta-powerpc-unknown-linux-gnu.tar.xz": "0319b07244f443e254e10a04e75633b293faffc5896ade44c05dde0739356f38",
-    "dist/2021-11-30/rust-std-beta-powerpc64-unknown-linux-gnu.tar.gz": "54e7cb5a1534ecdbd484ef304f608eb48464ae2c2330958b65b8101f81291319",
-    "dist/2021-11-30/rust-std-beta-powerpc64-unknown-linux-gnu.tar.xz": "aecedf5ca4d91e98ba3c4faba64699d79b3fd4877f880840d492b4872ccb924a",
-    "dist/2021-11-30/rust-std-beta-powerpc64le-unknown-linux-gnu.tar.gz": "a4cf3bde61d46484e36fd41386840250e0c031414ee422bbb3d37f7ac7489ca3",
-    "dist/2021-11-30/rust-std-beta-powerpc64le-unknown-linux-gnu.tar.xz": "d93e2a290aea3075cd61b950ded4c3756611acc6a59ba7efb9ce2e4dbac76c59",
-    "dist/2021-11-30/rust-std-beta-riscv32i-unknown-none-elf.tar.gz": "69c9f09416b788d93f54734a953ed8dead2a31e1dacd6e67a6550529385b338f",
-    "dist/2021-11-30/rust-std-beta-riscv32i-unknown-none-elf.tar.xz": "808a02952a31ae3a171849dc217763f5cd142622e92ae2b383014bbe37e9b551",
-    "dist/2021-11-30/rust-std-beta-riscv32imac-unknown-none-elf.tar.gz": "67e6b61d822cfc9f95a2808917601cf3d2560d636b12a19ee29a790cc06e8235",
-    "dist/2021-11-30/rust-std-beta-riscv32imac-unknown-none-elf.tar.xz": "7310493bc6f184b401650fb399015be29a8df009e55fa1cbfbcf9d9608fe61e2",
-    "dist/2021-11-30/rust-std-beta-riscv32imc-unknown-none-elf.tar.gz": "fd4db925d7eb598f210ab2d96f692cbdb627acbd6a8976259411a4d2356b8728",
-    "dist/2021-11-30/rust-std-beta-riscv32imc-unknown-none-elf.tar.xz": "b5b0394ef612188fd094e355892aafe4530758fe38dc8859ba917cb2febe028e",
-    "dist/2021-11-30/rust-std-beta-riscv64gc-unknown-linux-gnu.tar.gz": "3b7c3ad97393bc702dbd71bc819c0e5f6164cf471171c7c48cfffdf5477b35b6",
-    "dist/2021-11-30/rust-std-beta-riscv64gc-unknown-linux-gnu.tar.xz": "21e6f247a6663918c6e38782e43211224d50d4de22a9162be0c5f6d6d0a9afea",
-    "dist/2021-11-30/rust-std-beta-riscv64gc-unknown-none-elf.tar.gz": "d0c9bd56dcac12d7174e11f2acdb16fba41ffb3aba71b6b1b4b49ce7fa115f6e",
-    "dist/2021-11-30/rust-std-beta-riscv64gc-unknown-none-elf.tar.xz": "c89adc1cbdb7bfa27f5bfdac38b5ff084eafe081b27548dc243bbff378ec7118",
-    "dist/2021-11-30/rust-std-beta-riscv64imac-unknown-none-elf.tar.gz": "3e6f8a86901c1350c54bd89e156af029978f4a25f578ea26f49a1f3332da2187",
-    "dist/2021-11-30/rust-std-beta-riscv64imac-unknown-none-elf.tar.xz": "43e74dbeb89547be1b3ad1b532bef97b577530a8b19b825342efb72d91d4b0bd",
-    "dist/2021-11-30/rust-std-beta-s390x-unknown-linux-gnu.tar.gz": "c8c7a22e63353e7c7766e254c3fc0b0277bc8265f1123a38705bf319a7d99a19",
-    "dist/2021-11-30/rust-std-beta-s390x-unknown-linux-gnu.tar.xz": "1759ca2de0ff890918a0f634782557ae2b3181e543790878093f303ede45e215",
-    "dist/2021-11-30/rust-std-beta-sparc64-unknown-linux-gnu.tar.gz": "a9ac36f2b4e88ce2f2789e9df46ae679879c111594cfe82b538e4067adad2b5e",
-    "dist/2021-11-30/rust-std-beta-sparc64-unknown-linux-gnu.tar.xz": "6260f0616828d79898165bf42875881dc5253143d940ac951b7f295553afb8c9",
-    "dist/2021-11-30/rust-std-beta-sparcv9-sun-solaris.tar.gz": "42d3e5acf2475d732ce5afe3c2ebea6d332c137d061aa256df75b7ce54c16b16",
-    "dist/2021-11-30/rust-std-beta-sparcv9-sun-solaris.tar.xz": "7f84ff29dc36a224961e87d40cd6e531c9309bdafaec5de2b043aa89af511552",
-    "dist/2021-11-30/rust-std-beta-thumbv6m-none-eabi.tar.gz": "6bfdf4e59ac3f9dbde2fa46797bd9bb9cbda232c0d507f04bafd937e88945cb7",
-    "dist/2021-11-30/rust-std-beta-thumbv6m-none-eabi.tar.xz": "d12901a4efc8395df3c1ac137f86c3da07477277fad138edb49d5c4382a3a114",
-    "dist/2021-11-30/rust-std-beta-thumbv7em-none-eabi.tar.gz": "38718b50fa2acacc0fac98931a5714df38feb8370fccf8d7a955de3b2c117dd0",
-    "dist/2021-11-30/rust-std-beta-thumbv7em-none-eabi.tar.xz": "9753c00de1117a5fb9bff4ce2a4434ac6d3d06a1b4b3d0cc44ddb590739b9a0b",
-    "dist/2021-11-30/rust-std-beta-thumbv7em-none-eabihf.tar.gz": "c1eb35c914ad1a762cf550d54b7ec80cb3a8ab6ab39f5c89709f88e04eeba46f",
-    "dist/2021-11-30/rust-std-beta-thumbv7em-none-eabihf.tar.xz": "3c092ac130633f327a0afc8bdf8ba252f05d9b0050383122d7ba31cc3f5ddfc5",
-    "dist/2021-11-30/rust-std-beta-thumbv7m-none-eabi.tar.gz": "fb391d1199eab0854228323d08dd8b27709175697532e4b47e9dab6f26f24a8f",
-    "dist/2021-11-30/rust-std-beta-thumbv7m-none-eabi.tar.xz": "82347d3a0a123c430a526486dbd8c424732181eede038e2f91f1504d510a755b",
-    "dist/2021-11-30/rust-std-beta-thumbv7neon-linux-androideabi.tar.gz": "0cb559fff7f8dc35e5279217ef6fe7c2b5fa3d68f5ca82f258b6885f42e8d144",
-    "dist/2021-11-30/rust-std-beta-thumbv7neon-linux-androideabi.tar.xz": "ee1fe1dc9fe620743022939cdeac3ab34135e61897f0707c3b1a0a1b7d730360",
-    "dist/2021-11-30/rust-std-beta-thumbv7neon-unknown-linux-gnueabihf.tar.gz": "bb8de6fe10aa624fdd63484403e228a5c592b94d4aac95e2b2401cd8b9472f0a",
-    "dist/2021-11-30/rust-std-beta-thumbv7neon-unknown-linux-gnueabihf.tar.xz": "1bb7f7ac88e250534d89f0b0dc74f13ca563bad53956be74418d2aef28d250a5",
-    "dist/2021-11-30/rust-std-beta-thumbv8m.base-none-eabi.tar.gz": "0aea9f5cddb136591d105ebd3607a2e1f402f1c707cf33f21fb5cf1d30101ee0",
-    "dist/2021-11-30/rust-std-beta-thumbv8m.base-none-eabi.tar.xz": "f547622b8f052c6290c530d506d8ee314f90c81ace562a0a533b6ad2ba00b987",
-    "dist/2021-11-30/rust-std-beta-thumbv8m.main-none-eabi.tar.gz": "80f8f7c613c7ff2097f5c346b3ac4a5cf750167277f28655e0263b05a231668d",
-    "dist/2021-11-30/rust-std-beta-thumbv8m.main-none-eabi.tar.xz": "a57b4489a1d46ad3fc303a3b2dd478df66407a3e2dfeb9c12860a543ae5210eb",
-    "dist/2021-11-30/rust-std-beta-thumbv8m.main-none-eabihf.tar.gz": "6c4264b2bcecc951c39626fc1cf8de36f1eadbda31a552e14274f728978e16a5",
-    "dist/2021-11-30/rust-std-beta-thumbv8m.main-none-eabihf.tar.xz": "ec72f8e861eed6b5e2518b46cd8008d3bd2b6f2a7a42784a2dc8a6184d3ecc62",
-    "dist/2021-11-30/rust-std-beta-wasm32-unknown-emscripten.tar.gz": "0fc209babd43546d04b3fdd27ce77c96d75aa5eb6595f00586a19a17e4530b59",
-    "dist/2021-11-30/rust-std-beta-wasm32-unknown-emscripten.tar.xz": "ecdb8152992b4a9779aeda2b4cc638163ac24faf45c484f27316a6b3ff0eb297",
-    "dist/2021-11-30/rust-std-beta-wasm32-unknown-unknown.tar.gz": "52bbea99f2405f35f58d5448c353c605c2a87e7546e95b86d8baa39b4fc7a9a2",
-    "dist/2021-11-30/rust-std-beta-wasm32-unknown-unknown.tar.xz": "47ea301d79eada8898907af226b39b4c73ac1fe974963139aee78c3567ee53e4",
-    "dist/2021-11-30/rust-std-beta-wasm32-wasi.tar.gz": "dc9ccfa3e46e4f3b0e11de8a83885695ab154a2211fa89a20670db116d63a4c2",
-    "dist/2021-11-30/rust-std-beta-wasm32-wasi.tar.xz": "52d890b402c7e7bb7c0f9b34f2e216f0937453ab42e7c4ce205739bd64ba7dc7",
-    "dist/2021-11-30/rust-std-beta-x86_64-apple-darwin.tar.gz": "0ccbff8a582047cd6d2a6b30387ea73cfce7e0c61eddf516126836b9f9ca86ff",
-    "dist/2021-11-30/rust-std-beta-x86_64-apple-darwin.tar.xz": "cab55f71575d58aa7213a7dc4cfb0704ca7faec7203c545aeaff178eebe40436",
-    "dist/2021-11-30/rust-std-beta-x86_64-apple-ios.tar.gz": "6863523669b65464bd52e1a47f6decf868cc93d2111ffc222bb4a032a0095e3f",
-    "dist/2021-11-30/rust-std-beta-x86_64-apple-ios.tar.xz": "d5c6e65a656621891f387861c8259116dd9a8ab14e13ea10e93b78834e1d334a",
-    "dist/2021-11-30/rust-std-beta-x86_64-fortanix-unknown-sgx.tar.gz": "ec7130bfff74b7226fb5d0f311dd399f7628cb59ce06b4bc9a9f394067855eda",
-    "dist/2021-11-30/rust-std-beta-x86_64-fortanix-unknown-sgx.tar.xz": "0f52f00f03126aed0260cbfdd9790a62f9f4ceb24e2a3a6d80e8a15a1b4a09c2",
-    "dist/2021-11-30/rust-std-beta-x86_64-fuchsia.tar.gz": "1a3f4c6c1528050820b85e07aa96af6588c7d61935108cb5110d1e0c964142e8",
-    "dist/2021-11-30/rust-std-beta-x86_64-fuchsia.tar.xz": "fe9488c3476e931440ad487a4cf265fdd3c01e18c9e43b33f51b9eb078821282",
-    "dist/2021-11-30/rust-std-beta-x86_64-linux-android.tar.gz": "c7205b1cdcdff00d91a3991b1f40674b075c34dc0877de4786da5ab85e3b6cfa",
-    "dist/2021-11-30/rust-std-beta-x86_64-linux-android.tar.xz": "87a3cfe8992ad615d5522d97ace91dcc86057d060d82b581df206f2802225a0e",
-    "dist/2021-11-30/rust-std-beta-x86_64-pc-solaris.tar.gz": "cd9eeb26fe909e38d8d8129829d19b4d04d96014496cc7f2f4ae077b94f2aae3",
-    "dist/2021-11-30/rust-std-beta-x86_64-pc-solaris.tar.xz": "b6e59180ff89f7e460fcbc246802e6441c71600774ae5cb2d9af464365a642cb",
-    "dist/2021-11-30/rust-std-beta-x86_64-pc-windows-gnu.tar.gz": "45e07be14211ec7c9f3c1ad0eb9f7a9b422b10c842d5d0e8b0b498751ab7ae0f",
-    "dist/2021-11-30/rust-std-beta-x86_64-pc-windows-gnu.tar.xz": "593f70209f3b5b4e126d57ece0b1adefb4bc1055cfd168779d854369985b2b2e",
-    "dist/2021-11-30/rust-std-beta-x86_64-pc-windows-msvc.tar.gz": "6e14f3431da08f63d82e5b1e2c56fdf13f93ea7b6660dc64b1c855d00c008257",
-    "dist/2021-11-30/rust-std-beta-x86_64-pc-windows-msvc.tar.xz": "6e6355686d22213d27f5dbec0b7ded38532e79ac904bae978a8eb5fc880916cf",
-    "dist/2021-11-30/rust-std-beta-x86_64-sun-solaris.tar.gz": "39bdaa250d8f17914602a2185c51014f7fbfb1e30991816a432c3897338b52a1",
-    "dist/2021-11-30/rust-std-beta-x86_64-sun-solaris.tar.xz": "ebab0e4b13e0b3bdbe0ac858d5a4ca28bb813854aea1d8ec86d8e220c68b3442",
-    "dist/2021-11-30/rust-std-beta-x86_64-unknown-freebsd.tar.gz": "a700f1736b96c4e7237305dc98a79163b07127f0aac1f436415c233b8495a5af",
-    "dist/2021-11-30/rust-std-beta-x86_64-unknown-freebsd.tar.xz": "e94ecf7d1c9a5144577fdb14b7232b11dff0ebbfa8aae8cb4884d4ed9c5bae77",
-    "dist/2021-11-30/rust-std-beta-x86_64-unknown-illumos.tar.gz": "209dc9917790c2be8777c597e19a9f43301aaaaac3c9731e9d0512e6918334b9",
-    "dist/2021-11-30/rust-std-beta-x86_64-unknown-illumos.tar.xz": "6e4810c7484c231f0edb15ae5acea822ed5d868eaf041438afea4b6ba38be35e",
-    "dist/2021-11-30/rust-std-beta-x86_64-unknown-linux-gnu.tar.gz": "df952ee1385da9457c4e95dc08ab59ca915f5f211738982f8db3684cf80967fc",
-    "dist/2021-11-30/rust-std-beta-x86_64-unknown-linux-gnu.tar.xz": "62d7383ee21b0a7d072b15a9877a922f8dbcea42d910c2cb3c4129152b26ea9a",
-    "dist/2021-11-30/rust-std-beta-x86_64-unknown-linux-gnux32.tar.gz": "be28225516fa38edd34e1af5f051d7c8ab5f433cc5814df199bc451285d95e0c",
-    "dist/2021-11-30/rust-std-beta-x86_64-unknown-linux-gnux32.tar.xz": "1a6fdfac24feb34744daced6c6545c844ff13d5e5f14620520d5ed4b85be8742",
-    "dist/2021-11-30/rust-std-beta-x86_64-unknown-linux-musl.tar.gz": "c0f098faa0c9de6a8e82b80dfe44bfa9d4482e118259c33452ef025885ceab6e",
-    "dist/2021-11-30/rust-std-beta-x86_64-unknown-linux-musl.tar.xz": "1d1ed7cf8fc16efab3faab9ef5abadac9ab98d3b60522fde0612ac0b256de528",
-    "dist/2021-11-30/rust-std-beta-x86_64-unknown-netbsd.tar.gz": "1ed41e8019480cd151a9ddd0f080afc56ed0afe47cfb7c6b5a6a2473ff6e7e81",
-    "dist/2021-11-30/rust-std-beta-x86_64-unknown-netbsd.tar.xz": "849c04115660abdf1d4460aef2d87021c6ad52423c83dfed3c2cec8e380ae6fe",
-    "dist/2021-11-30/rust-std-beta-x86_64-unknown-redox.tar.gz": "e3a35d33b3282fd156482c85e19817f78dcd964de8b712a6e46b965dc60d5204",
-    "dist/2021-11-30/rust-std-beta-x86_64-unknown-redox.tar.xz": "d5bfbb1415a62547b9e2a24b770a3c6e4d531101cfb2360b7a7de34d0bf18974",
-    "dist/2021-11-30/rustc-beta-aarch64-apple-darwin.tar.gz": "28beba0ff958b93f85618e49f13f4062cefacc82f6b5911d42f00515f99c5abe",
-    "dist/2021-11-30/rustc-beta-aarch64-apple-darwin.tar.xz": "07c6a43130112c93745e729c91669243cd28b73fafc7d9b32b4f22650db7bcad",
-    "dist/2021-11-30/rustc-beta-aarch64-pc-windows-msvc.tar.gz": "9e70dc74c4428438716d14861797380ce7f6617bc93b83c74fc1a6f8aca99392",
-    "dist/2021-11-30/rustc-beta-aarch64-pc-windows-msvc.tar.xz": "8f61ec8129b7b0bcc6b329337e5e0323054a438e999615687a18fdc42a8d0692",
-    "dist/2021-11-30/rustc-beta-aarch64-unknown-linux-gnu.tar.gz": "bba3cbfdd2842cdf8f2698b709401db6a641227d1742595e3959f1f0ace37c5f",
-    "dist/2021-11-30/rustc-beta-aarch64-unknown-linux-gnu.tar.xz": "fe74ad76a2cffdff0a2fb953f31b73d80a0bce75402bf65f01d250fcae6ff779",
-    "dist/2021-11-30/rustc-beta-aarch64-unknown-linux-musl.tar.gz": "cde952fb3c38a969c0743d2f9d90e256db8613c463a4b23d6119656570978eb5",
-    "dist/2021-11-30/rustc-beta-aarch64-unknown-linux-musl.tar.xz": "f2dd88f1b4ec97aaaebb601d20751d50536e85b2cac36740abbc03fa8a4d0d06",
-    "dist/2021-11-30/rustc-beta-arm-unknown-linux-gnueabi.tar.gz": "1a4414987e4da2c8086590fe4ad531f78862443eede3bc9069efb424900746d2",
-    "dist/2021-11-30/rustc-beta-arm-unknown-linux-gnueabi.tar.xz": "1682f8bde2562d4b9183fa512bc1e54d2a821fd9f63208a51489f21deeb7fcfd",
-    "dist/2021-11-30/rustc-beta-arm-unknown-linux-gnueabihf.tar.gz": "ca40f3c5e8fd8bd6d89d3c0a3ad4d767353c1b4138e2720371a275c9c52c9117",
-    "dist/2021-11-30/rustc-beta-arm-unknown-linux-gnueabihf.tar.xz": "c7afe4eba5cdb02a2e8ae224a0970c8aa36ef429ac298b0f98ff41a0d911aad1",
-    "dist/2021-11-30/rustc-beta-armv7-unknown-linux-gnueabihf.tar.gz": "6acd677fda38aea2b960f2af6438b30c3b6bd759bb3e56228a1096445ddd100f",
-    "dist/2021-11-30/rustc-beta-armv7-unknown-linux-gnueabihf.tar.xz": "451a2e139771f39ec09a7cefd48885ec30f732668d50c750d42e6c58c250f8fe",
-    "dist/2021-11-30/rustc-beta-i686-pc-windows-gnu.tar.gz": "a1df7d105231d4941a55a9f850d39acc201a99dd408d523935799b70fec30c6a",
-    "dist/2021-11-30/rustc-beta-i686-pc-windows-gnu.tar.xz": "3005718736a2a0fa3a4f1be10239cfb467e9cabe6ce366f9909826bd3c06a990",
-    "dist/2021-11-30/rustc-beta-i686-pc-windows-msvc.tar.gz": "695039c6737fb3bfd325fbebdab61aeef80ec427ae3d40d8b82e8b317e147fc8",
-    "dist/2021-11-30/rustc-beta-i686-pc-windows-msvc.tar.xz": "7a5038b7299de71d3677042647fca501984d1f2a52c1d84052956ff7854622b3",
-    "dist/2021-11-30/rustc-beta-i686-unknown-linux-gnu.tar.gz": "d21dd4c98d38186544aee9b22b439d67d77c0a740357dfad7fea3c4a9b8d1332",
-    "dist/2021-11-30/rustc-beta-i686-unknown-linux-gnu.tar.xz": "e62a7c9809de668343323eb9fa1a1f6cc302a6e161e64826e9d31bd202f2f472",
-    "dist/2021-11-30/rustc-beta-mips-unknown-linux-gnu.tar.gz": "b85eb1bff16384b4f6ad268a01bdcec539b9ea412abb6d64618521cb0e63985d",
-    "dist/2021-11-30/rustc-beta-mips-unknown-linux-gnu.tar.xz": "ce79b36723a65419e03ec77ea14680791d683e5e04332eebdf59550bdaaa164d",
-    "dist/2021-11-30/rustc-beta-mips64-unknown-linux-gnuabi64.tar.gz": "e778edd911e09c5c3b46aeccbabcd8ead78dd38086206d03406fc8dce52806e7",
-    "dist/2021-11-30/rustc-beta-mips64-unknown-linux-gnuabi64.tar.xz": "10afe035ca7d3a967b467875b1345dde8bdcd3f8c4af1e917bfa2c676e0fec70",
-    "dist/2021-11-30/rustc-beta-mips64el-unknown-linux-gnuabi64.tar.gz": "6b6c3386ebec138ff07a21d3f5631263219c226ca146bf97fe0a7bb9fee9d0c5",
-    "dist/2021-11-30/rustc-beta-mips64el-unknown-linux-gnuabi64.tar.xz": "5ff6430623d0f3aa14748f371e34072aba126a16429928f8f99172190f369fee",
-    "dist/2021-11-30/rustc-beta-mipsel-unknown-linux-gnu.tar.gz": "369ad16e85e4f2956e400105e6d8374ff64c473c3c3b61ae4d916214d5f922da",
-    "dist/2021-11-30/rustc-beta-mipsel-unknown-linux-gnu.tar.xz": "1c8adfb22f724fa98f30f23378a28729e144f6ab9bba54adf13111ca4648ed78",
-    "dist/2021-11-30/rustc-beta-powerpc-unknown-linux-gnu.tar.gz": "b3e270c6272420c31ee7bed8ed36c113c879a384fa5b85af0deb7d43a355ca2c",
-    "dist/2021-11-30/rustc-beta-powerpc-unknown-linux-gnu.tar.xz": "a21cdd8d182cc64ceaa83e522299860c2710dee780e8f49ff107a73fbd73c3ca",
-    "dist/2021-11-30/rustc-beta-powerpc64-unknown-linux-gnu.tar.gz": "1a81076b8e49647b61761a38ed283a9a71b326dc321920f7be453e0e15ae2465",
-    "dist/2021-11-30/rustc-beta-powerpc64-unknown-linux-gnu.tar.xz": "3f8ce23f81623a00de63ce7e82e448eec0901a92f908e6aff362807bae14ff84",
-    "dist/2021-11-30/rustc-beta-powerpc64le-unknown-linux-gnu.tar.gz": "eaa3b365bd91a5770db85e8541ee28c99988635521c0f2dfea05218172f11a55",
-    "dist/2021-11-30/rustc-beta-powerpc64le-unknown-linux-gnu.tar.xz": "3f856ae24c4737bf1928025a10712b6d856788d988fb5018631c525d13b68e29",
-    "dist/2021-11-30/rustc-beta-riscv64gc-unknown-linux-gnu.tar.gz": "c672cbf2caef81f7ab923ff7c6a05f1865057278180a686f810ddc71dacc49d0",
-    "dist/2021-11-30/rustc-beta-riscv64gc-unknown-linux-gnu.tar.xz": "bda5d2234aebdc175c87da3b77d050c56bced21a794c416bb9090c0ae3374be2",
-    "dist/2021-11-30/rustc-beta-s390x-unknown-linux-gnu.tar.gz": "59e01371664f8d39c7a06c205af0f5ab9aabdb3942be4f493d05ab71047619e8",
-    "dist/2021-11-30/rustc-beta-s390x-unknown-linux-gnu.tar.xz": "de956b5275e38e0b4223819973e85f5f65c409addd786f7ac2d525a79c3f0c92",
-    "dist/2021-11-30/rustc-beta-x86_64-apple-darwin.tar.gz": "4f78d90362488a866ea7b1cccbc61f925d94034b46dfa775dea75223e67d755a",
-    "dist/2021-11-30/rustc-beta-x86_64-apple-darwin.tar.xz": "3520d028e9370087cfa57eb7225dd76c008cb08ffb01c8101aaa86104f427f12",
-    "dist/2021-11-30/rustc-beta-x86_64-pc-windows-gnu.tar.gz": "f954349daa7dfd819ec0a7335a47b1d3b2ed0138eae31c56288d9c523cdf56b2",
-    "dist/2021-11-30/rustc-beta-x86_64-pc-windows-gnu.tar.xz": "ca046d8fca5fa48117c61c70a21176d9220a3c62af9fdc9b899c157bb196a5b5",
-    "dist/2021-11-30/rustc-beta-x86_64-pc-windows-msvc.tar.gz": "61ae4421bdf798a5ca1a8bc8c8521dfb29a707e40d382dbd2e155f134956ac33",
-    "dist/2021-11-30/rustc-beta-x86_64-pc-windows-msvc.tar.xz": "495076dfc2fa0b8d96613e34f867de9d43483984a8bd6839bf273c2be38039b6",
-    "dist/2021-11-30/rustc-beta-x86_64-unknown-freebsd.tar.gz": "828526bc23ad8802071bf4f2984faf3549139eb4ce8ebb9ba8711c196d2bf437",
-    "dist/2021-11-30/rustc-beta-x86_64-unknown-freebsd.tar.xz": "fa2464350b2ac29bec6751c551cc45b7af92c25d2cf1109397e724802d4859cf",
-    "dist/2021-11-30/rustc-beta-x86_64-unknown-illumos.tar.gz": "a1d9719668ea1887d6202c25b9dd2b7d40bdd240f3f753af77ac93f126c84c38",
-    "dist/2021-11-30/rustc-beta-x86_64-unknown-illumos.tar.xz": "4b36f5d448bf022f90e284c22a44e0b87ef8518ec93a297ceb703eb612ef80d8",
-    "dist/2021-11-30/rustc-beta-x86_64-unknown-linux-gnu.tar.gz": "63e654f5e8707a0536381025bdbb43d498c70a29a5ada0ecdb12e23844cc9a9f",
-    "dist/2021-11-30/rustc-beta-x86_64-unknown-linux-gnu.tar.xz": "6b5b74abdcb1cae42620cabc142a119b58823e9f2ac0c3151e087a76323c5cae",
-    "dist/2021-11-30/rustc-beta-x86_64-unknown-linux-musl.tar.gz": "f3aa2d52ce5da066c59de609ebd5df60ac908c7e0db23ac4afe69b927ef2a974",
-    "dist/2021-11-30/rustc-beta-x86_64-unknown-linux-musl.tar.xz": "6e8858dbaf50a8211516e5afa83e4133d878e0d4b19ba4a3e4c3e51cb80210b7",
-    "dist/2021-11-30/rustc-beta-x86_64-unknown-netbsd.tar.gz": "9028dd44728092ccaec86f415abdb3733f3ea58ab7c3d736e96e27540cc66a2d",
-    "dist/2021-11-30/rustc-beta-x86_64-unknown-netbsd.tar.xz": "c6720fd231b54a04e1ba3ed3fe333b1d8ef5b771ce341b4c112169a293bf713a",
-    "dist/2021-11-30/rustfmt-nightly-aarch64-apple-darwin.tar.gz": "d987783ba5117529b325bcf6f5e7abd9eee42b5ea86ce5109a4fd3f450af8062",
-    "dist/2021-11-30/rustfmt-nightly-aarch64-apple-darwin.tar.xz": "5d5838733dc64e302991465c1f371fde855ee410d42d1713ddc1c471b469e1a8",
-    "dist/2021-11-30/rustfmt-nightly-aarch64-pc-windows-msvc.tar.gz": "8593ab35bb800312d6fe4c4a4d151feb26187c6db0d0d5ca5e3e98a007f8a4ff",
-    "dist/2021-11-30/rustfmt-nightly-aarch64-pc-windows-msvc.tar.xz": "a2ded0420cc1d98df255c7ef93247b9a6d3d9ec22e42c477305dc15ef35fd329",
-    "dist/2021-11-30/rustfmt-nightly-aarch64-unknown-linux-gnu.tar.gz": "652275e77d73f122c12eb952338661562a48fc76164d6549158abc14fb4e4a4a",
-    "dist/2021-11-30/rustfmt-nightly-aarch64-unknown-linux-gnu.tar.xz": "fbb49b56bb11348e07124d8216b8f8b6e26d8697abb05afec0ddb07a456b29e5",
-    "dist/2021-11-30/rustfmt-nightly-aarch64-unknown-linux-musl.tar.gz": "817c7ed90ab8cdec1dcfc8571391a714002b49fd20da0ae32135f57d233ffbfb",
-    "dist/2021-11-30/rustfmt-nightly-aarch64-unknown-linux-musl.tar.xz": "cbd8674c65babce944bab6a6f013d44a2c7d6829434a6b97edb1f1e1df1c076f",
-    "dist/2021-11-30/rustfmt-nightly-arm-unknown-linux-gnueabi.tar.gz": "66b13ffad073bc624ebdef219e61f8972fc6be354aaf1f8ede58a3acc01314c3",
-    "dist/2021-11-30/rustfmt-nightly-arm-unknown-linux-gnueabi.tar.xz": "11ecfef218376fd2232ad552526b39173c5269130f02e408a7492762cde87a6a",
-    "dist/2021-11-30/rustfmt-nightly-arm-unknown-linux-gnueabihf.tar.gz": "07ad99e019141843f5d6f8c302b9d20c7453ebead79e9711af33c9c8081b9e22",
-    "dist/2021-11-30/rustfmt-nightly-arm-unknown-linux-gnueabihf.tar.xz": "6656be84a9b5a63083d63e3a87bc928b424109efff48e3a6770e026c6ea7c2e8",
-    "dist/2021-11-30/rustfmt-nightly-armv7-unknown-linux-gnueabihf.tar.gz": "155422628d41ce9730f4503bffa12e396b58692c906828acf15f0dd39b3d491e",
-    "dist/2021-11-30/rustfmt-nightly-armv7-unknown-linux-gnueabihf.tar.xz": "fc75c3836489bda30d340132d0d5ab8ee7f7c67617e4dc66a9eae559bbdb0421",
-    "dist/2021-11-30/rustfmt-nightly-i686-pc-windows-gnu.tar.gz": "181d557c8f73c8f22ed63a8f98e53f6d88871fd694173aea70c53d42c0c55ae2",
-    "dist/2021-11-30/rustfmt-nightly-i686-pc-windows-gnu.tar.xz": "5defc562a2f0ced4539006692cc969cf89756637f5f5c62be0276dfedd6f3db6",
-    "dist/2021-11-30/rustfmt-nightly-i686-pc-windows-msvc.tar.gz": "f28b3fdf5425e7b782d0f78ca95613efd87b2b0d14d44c4490f17d4eb452f183",
-    "dist/2021-11-30/rustfmt-nightly-i686-pc-windows-msvc.tar.xz": "b6cebd5a23bcc504d05c8dd79654baf2ab45b162c59b7b843e24efb7e2344011",
-    "dist/2021-11-30/rustfmt-nightly-i686-unknown-linux-gnu.tar.gz": "c59850b28fcfb1608c7e91890b8628ac201b87b4d9af7e9fd019e3e4a137c033",
-    "dist/2021-11-30/rustfmt-nightly-i686-unknown-linux-gnu.tar.xz": "ad808569083691ba31b0e10222f9dd01822ade91689bcb060544f28b99f2a299",
-    "dist/2021-11-30/rustfmt-nightly-mips-unknown-linux-gnu.tar.gz": "8fca357226b91cc712b888c0a62f9e52b121ab6d9815ea5f53bbfd243b895b69",
-    "dist/2021-11-30/rustfmt-nightly-mips-unknown-linux-gnu.tar.xz": "7f5451fe6946c16a7ba404c8bab33816d58d478b1dc0ea1ce6b85befe26ddf77",
-    "dist/2021-11-30/rustfmt-nightly-mips64-unknown-linux-gnuabi64.tar.gz": "7cc76ce31cf59f1cbeca87a46c996e905f048acfc70d438eae2a32bb67fc60c1",
-    "dist/2021-11-30/rustfmt-nightly-mips64-unknown-linux-gnuabi64.tar.xz": "429bacebe2a9f1478a00b1573fe4e1b071c6348d800182993c8b5d8ba54d9615",
-    "dist/2021-11-30/rustfmt-nightly-mips64el-unknown-linux-gnuabi64.tar.gz": "701a12b5a4a689e6b2ef260e35ed2d22c00452cde5e18ce0d886ace37e81964f",
-    "dist/2021-11-30/rustfmt-nightly-mips64el-unknown-linux-gnuabi64.tar.xz": "0ef78c91a3220226619f20b28bf67947a56ff31f369d5ea7bfc2aef356060e42",
-    "dist/2021-11-30/rustfmt-nightly-mipsel-unknown-linux-gnu.tar.gz": "0765a3b65315bbb1381927eaf6f65f16fd09dddab41d7398e483bf001ee7bc3e",
-    "dist/2021-11-30/rustfmt-nightly-mipsel-unknown-linux-gnu.tar.xz": "c74b0833f995ffad5c812ba130f423485bd8297eca0c4eae227852a88ece8521",
-    "dist/2021-11-30/rustfmt-nightly-powerpc-unknown-linux-gnu.tar.gz": "3c9d5a35ef1e459ded4dcdcad40bc5e3bcd5b2821cf4f46dbaf2c2c3259fa3ff",
-    "dist/2021-11-30/rustfmt-nightly-powerpc-unknown-linux-gnu.tar.xz": "0aa8975a6dbd103a4764ad643de6094bd6911bd3a90d46e24ad1eafcea2870e7",
-    "dist/2021-11-30/rustfmt-nightly-powerpc64-unknown-linux-gnu.tar.gz": "a0ee2ec59ed07ba9c9e48076c954f5c6e4d39809d9e4923337db2627ea279c6f",
-    "dist/2021-11-30/rustfmt-nightly-powerpc64-unknown-linux-gnu.tar.xz": "e712fa72a41dedcd50c6531433220904b9627fa78bfa15cdd96d97161981cb77",
-    "dist/2021-11-30/rustfmt-nightly-powerpc64le-unknown-linux-gnu.tar.gz": "fc7809520a4a41ccb0ffb303c7bbc96443308387890ebdb65a25c3697a5c3eb4",
-    "dist/2021-11-30/rustfmt-nightly-powerpc64le-unknown-linux-gnu.tar.xz": "84a8fa7468b9e59465f85607f84960e11faf0f37bd766d55b6be985db89d0d17",
-    "dist/2021-11-30/rustfmt-nightly-riscv64gc-unknown-linux-gnu.tar.gz": "2703dff8cb1c0ca08787f1c7715885c5b09919c040783ba98bd74f8fe3af704d",
-    "dist/2021-11-30/rustfmt-nightly-riscv64gc-unknown-linux-gnu.tar.xz": "a3e25cc857e990b467c804f41e23bfbe8ef02630b48703fc1c7fae692e16eb80",
-    "dist/2021-11-30/rustfmt-nightly-s390x-unknown-linux-gnu.tar.gz": "659a9ca0e1296f817cd9f90fed9ccd7d3c7c3e7eea7e9c437bbeb2d951a2669c",
-    "dist/2021-11-30/rustfmt-nightly-s390x-unknown-linux-gnu.tar.xz": "21e83ac3b148f0f690cb9a39b385fb0d5a82d6eea9ec46d4d4445b5a660c6d7c",
-    "dist/2021-11-30/rustfmt-nightly-x86_64-apple-darwin.tar.gz": "c8e3300a426cc4a80ba4f1cf0c6822d9b883f24c486b991f2056938be778d43f",
-    "dist/2021-11-30/rustfmt-nightly-x86_64-apple-darwin.tar.xz": "55f1f7d84828b3cc5d13b10e549a74f2f1df11057ed48e75fbafc0d3538daf03",
-    "dist/2021-11-30/rustfmt-nightly-x86_64-pc-windows-gnu.tar.gz": "99bf70cee39b2ce73dbe5827fe3d93e45241faea284acb3f8004cf7e700e1704",
-    "dist/2021-11-30/rustfmt-nightly-x86_64-pc-windows-gnu.tar.xz": "dfc569d57211eae74a2cde5db180d2f2f44bca04f811655ef1f8d8c2154b97ef",
-    "dist/2021-11-30/rustfmt-nightly-x86_64-pc-windows-msvc.tar.gz": "679d69ba6a4b460f9672f1ec1c2939ac41ee7f911a2a74eaf6db477aa088e6e3",
-    "dist/2021-11-30/rustfmt-nightly-x86_64-pc-windows-msvc.tar.xz": "3b9a899fcf40db84be8bd14e7c767c572c7d8c7c85f90997b8278fe8726413ae",
-    "dist/2021-11-30/rustfmt-nightly-x86_64-unknown-freebsd.tar.gz": "19be469ab711dcee7a7243e865efc5addf8b2cdbdf15150a2c367692c45b9f94",
-    "dist/2021-11-30/rustfmt-nightly-x86_64-unknown-freebsd.tar.xz": "789c7129e235b65860a514fdb38f01ac195af610d4ac6a296d272a6f36d72344",
-    "dist/2021-11-30/rustfmt-nightly-x86_64-unknown-illumos.tar.gz": "18657363783d0967d871ee1ed8905b3db0c3b761910fb06ea10980ec6b5ca082",
-    "dist/2021-11-30/rustfmt-nightly-x86_64-unknown-illumos.tar.xz": "8b272546a9eb8b23724fbec5577fc0c917a23e994befc38ebfa797957df03b9d",
-    "dist/2021-11-30/rustfmt-nightly-x86_64-unknown-linux-gnu.tar.gz": "4e1de312f07fb98845a881b44c2a76ec9abf61e5aba46e8e384de1cd297957a3",
-    "dist/2021-11-30/rustfmt-nightly-x86_64-unknown-linux-gnu.tar.xz": "a13ad29e2d06c9df233882d009ba8354d92d2fb29239cadaf858b9abc8b477d9",
-    "dist/2021-11-30/rustfmt-nightly-x86_64-unknown-linux-musl.tar.gz": "aae38bbf1eb7e0da50eb7f226897dc85e88b5e008ef901a93dadb0550f4055ac",
-    "dist/2021-11-30/rustfmt-nightly-x86_64-unknown-linux-musl.tar.xz": "757564eaa1a339d37b59da304bbc7a846bb883a73c62b78df39dacd947606ec9",
-    "dist/2021-11-30/rustfmt-nightly-x86_64-unknown-netbsd.tar.gz": "5f3a83079cb1fd7d8b9be44d0df7b57c6dc79da8e1762eace67c122cffc2d4ca",
-    "dist/2021-11-30/rustfmt-nightly-x86_64-unknown-netbsd.tar.xz": "e47ee14a1e679ee5f23936ba7d7de13dcba082c7f32e366be7a990503c91f6ad"
+    "dist/2022-01-28/cargo-beta-aarch64-apple-darwin.tar.gz": "8c62238c1d0a6ce177f59f5fb92f535433bd4be45d146def6527d0cdadd35422",
+    "dist/2022-01-28/cargo-beta-aarch64-apple-darwin.tar.xz": "bc6b381296fc6c882af149f39f2a3b9de35fa4c89ce95f41a2ce1aee2fba051c",
+    "dist/2022-01-28/cargo-beta-aarch64-pc-windows-msvc.tar.gz": "ca2ae341b04e558315d74b62d63ea860aaaec633d5fa604a0af73cf197e540fd",
+    "dist/2022-01-28/cargo-beta-aarch64-pc-windows-msvc.tar.xz": "f570b2a8902931e49374ca326a2fdb3294d688dcbd053e767e3b01e2fe749dd5",
+    "dist/2022-01-28/cargo-beta-aarch64-unknown-linux-gnu.tar.gz": "d22d886ff0017682c27aed6e43e0a3519864847a36ea7546bc7924340098ebbb",
+    "dist/2022-01-28/cargo-beta-aarch64-unknown-linux-gnu.tar.xz": "cb2221cd5c4e6251bcfb5e1d6ae49bbdb3d6463258866cb3971f86db4e4221de",
+    "dist/2022-01-28/cargo-beta-aarch64-unknown-linux-musl.tar.gz": "64046c814a93d4771e6c835afe30303afeb4c511282d2fbec1a716334ab1d630",
+    "dist/2022-01-28/cargo-beta-aarch64-unknown-linux-musl.tar.xz": "1f3ebb839986c3548dfff2da3c716e954bb0eb40abf823e1f1933ba79425b85e",
+    "dist/2022-01-28/cargo-beta-arm-unknown-linux-gnueabi.tar.gz": "50c894bf151d8d8073d667712097c1dbb254c99ac1fcdadd495a7928d21a957a",
+    "dist/2022-01-28/cargo-beta-arm-unknown-linux-gnueabi.tar.xz": "e6a52d5cccf994e65240983924f6b8469669dc710715060730e94e67dbd74877",
+    "dist/2022-01-28/cargo-beta-arm-unknown-linux-gnueabihf.tar.gz": "91c47a849fd1ffb764508d8a287bb717627d3a6fb12171df7bd427490e826dda",
+    "dist/2022-01-28/cargo-beta-arm-unknown-linux-gnueabihf.tar.xz": "a493a29a384a9573ab29ce9f366dc419907500a01e389e8486a5f5aa57c8394b",
+    "dist/2022-01-28/cargo-beta-armv7-unknown-linux-gnueabihf.tar.gz": "c55187e202b699570db7ae49a1fbd615696f30008be60a3bd5c9ee708925e4a5",
+    "dist/2022-01-28/cargo-beta-armv7-unknown-linux-gnueabihf.tar.xz": "288ea72dff7dc1882b51b4d4e73ac8d05f351da44a99d3ad5ee50b231f189f1b",
+    "dist/2022-01-28/cargo-beta-i686-pc-windows-gnu.tar.gz": "a746316d99b1943cd63c485180c512ddfc7d394fd76a51f9ed56dd2dcadc032a",
+    "dist/2022-01-28/cargo-beta-i686-pc-windows-gnu.tar.xz": "4395f831aa0a9413b5733902df58c6474913c53f46600ffe6f694c4312dc9d70",
+    "dist/2022-01-28/cargo-beta-i686-pc-windows-msvc.tar.gz": "d1f3441addc86e7b5bc21fbb2550e6a3e59a818027137ce2bac1b3208168726b",
+    "dist/2022-01-28/cargo-beta-i686-pc-windows-msvc.tar.xz": "4081e7ab2bb2208d636812f74a9f5b7d3c057f694d40589aa3affe3df35d0981",
+    "dist/2022-01-28/cargo-beta-i686-unknown-linux-gnu.tar.gz": "ab9bc43f20705cf5899d35381f3bd432a346c85762182a8f3b61adb93149910c",
+    "dist/2022-01-28/cargo-beta-i686-unknown-linux-gnu.tar.xz": "b50084926003b1e7b8f3a6a60f41a7c1dce764b1ce367567c112293aee16c244",
+    "dist/2022-01-28/cargo-beta-mips-unknown-linux-gnu.tar.gz": "79bebb05444b1288ad6faabc9ed7365206aa8321195285565130017cba61e3d9",
+    "dist/2022-01-28/cargo-beta-mips-unknown-linux-gnu.tar.xz": "ee12f3ae5a08329a482aaa0764e4b674337c659fcc10132220d67313ba663634",
+    "dist/2022-01-28/cargo-beta-mips64-unknown-linux-gnuabi64.tar.gz": "597e2021c3d56d821f91ff26b65ca31c837e6451d7f12d04494208f0b0dac847",
+    "dist/2022-01-28/cargo-beta-mips64-unknown-linux-gnuabi64.tar.xz": "23976bfa23b9a4d0e211daa4fa50fc34e57af95c05c2cae061782b180c9cb308",
+    "dist/2022-01-28/cargo-beta-mips64el-unknown-linux-gnuabi64.tar.gz": "e9b7393951081be935b6f97a0bb5d974975e555eea291d256913f07c9a8ea21e",
+    "dist/2022-01-28/cargo-beta-mips64el-unknown-linux-gnuabi64.tar.xz": "c12b8d1711078cfe2506dc069bdc6a823b8720f10f5f927d2fe0d8a4dac09fd9",
+    "dist/2022-01-28/cargo-beta-mipsel-unknown-linux-gnu.tar.gz": "dd810231860fa9d925a641a9928b05917a697cb205acd6636e11c5d60cc3badf",
+    "dist/2022-01-28/cargo-beta-mipsel-unknown-linux-gnu.tar.xz": "2d36e70cd07a97a92f23b26984cd8a1310c9762cc61e629c69a66a3deb53884b",
+    "dist/2022-01-28/cargo-beta-powerpc-unknown-linux-gnu.tar.gz": "65187ba25062e668abf1b401364f99553ebf8d61d26a5e4a833a00a3dec38f64",
+    "dist/2022-01-28/cargo-beta-powerpc-unknown-linux-gnu.tar.xz": "d5237004a0d161cbbc99c0c36072b2b4ce1112ce2ac26c8dd1770711c5cad8fa",
+    "dist/2022-01-28/cargo-beta-powerpc64-unknown-linux-gnu.tar.gz": "56722110c9436681db0946e6b66883323c077cac33ef666c8f4d79dea3b0f073",
+    "dist/2022-01-28/cargo-beta-powerpc64-unknown-linux-gnu.tar.xz": "d3957129b72dce1d1ab4666b8aa826d93ad938ac42ace1fbc055c97148b5f217",
+    "dist/2022-01-28/cargo-beta-powerpc64le-unknown-linux-gnu.tar.gz": "0b8e012c149c64a163cb22bd0a980cbf30cccd260bd4244a67c64e6adb250cc1",
+    "dist/2022-01-28/cargo-beta-powerpc64le-unknown-linux-gnu.tar.xz": "cfd05fd445176914d90e2f8f6ac4db60b6adaca32551b0290a06dd18dbdfe768",
+    "dist/2022-01-28/cargo-beta-riscv64gc-unknown-linux-gnu.tar.gz": "ba7b03932cdc6d25b1c85e0ceb35360fb41837904283910aa7452ff41ce7b40b",
+    "dist/2022-01-28/cargo-beta-riscv64gc-unknown-linux-gnu.tar.xz": "d036966c31e6f89c52a40889094042454f848d51a371167fde5a99a7d37d95b4",
+    "dist/2022-01-28/cargo-beta-s390x-unknown-linux-gnu.tar.gz": "383957085d629e7a64afc3a560a8cfb9dea25b7deed71b9bb0e172a1218713fb",
+    "dist/2022-01-28/cargo-beta-s390x-unknown-linux-gnu.tar.xz": "eba3a543082a934403ee72222f397831394633f092fbfe34aba21da2f5a3f6ff",
+    "dist/2022-01-28/cargo-beta-x86_64-apple-darwin.tar.gz": "fc8f6ce885d9fa29b71ed8be24da9bf718ed581e4738c167952b68667acb8daf",
+    "dist/2022-01-28/cargo-beta-x86_64-apple-darwin.tar.xz": "47560ce1cefeca1b1b80f4df3a8bc01cda9de6aaa9c46e64c5fb051e1e221e08",
+    "dist/2022-01-28/cargo-beta-x86_64-pc-windows-gnu.tar.gz": "281c046114664c1df3629bd2001d4785e930d7f86a743acf21d2a2b117b9e857",
+    "dist/2022-01-28/cargo-beta-x86_64-pc-windows-gnu.tar.xz": "66207bd42c186fd52c1ab4156343842f5e561770142762dc7f553460d689b444",
+    "dist/2022-01-28/cargo-beta-x86_64-pc-windows-msvc.tar.gz": "949de6cd5b2856d4c70162bb6a5321ec193430fa0120e69bf6af9851f9e0d17d",
+    "dist/2022-01-28/cargo-beta-x86_64-pc-windows-msvc.tar.xz": "796f3cee5426cf482da4e065351ad1b7208cfe03addb721433594ff7321d0611",
+    "dist/2022-01-28/cargo-beta-x86_64-unknown-freebsd.tar.gz": "2e587bbe22cfb0a8f62822279611505d31498bcce1e85578fb7ac092ae88007d",
+    "dist/2022-01-28/cargo-beta-x86_64-unknown-freebsd.tar.xz": "800ac9e61fdff1e046c8bf5708fde53a8ea96ebb9c74d1268dbb15518fa1a2cb",
+    "dist/2022-01-28/cargo-beta-x86_64-unknown-illumos.tar.gz": "8d543d45cc1770ba6d7591c65aa9fe20ec7d877e227e5d9fd3778b8dfa1fa073",
+    "dist/2022-01-28/cargo-beta-x86_64-unknown-illumos.tar.xz": "dfb18af670d92c55539bb99df1b48e834dcd3ac080c2a93b66d86785e01d7784",
+    "dist/2022-01-28/cargo-beta-x86_64-unknown-linux-gnu.tar.gz": "21539d224d42f19d6ac44824c13c2a81a33695239d6c9903921ac89ebedf1608",
+    "dist/2022-01-28/cargo-beta-x86_64-unknown-linux-gnu.tar.xz": "a9b81e05c3341d89e14cce58af2334c4a09ecf7e468141aaa74f7d32383b4a41",
+    "dist/2022-01-28/cargo-beta-x86_64-unknown-linux-musl.tar.gz": "cd0b693001a83b24e31b380f02b02cbd92365b1398884e174bbafc4991470747",
+    "dist/2022-01-28/cargo-beta-x86_64-unknown-linux-musl.tar.xz": "5755a6a61d233c097e99b5b6597f70e42f79feb3e661daecade9847fbf322019",
+    "dist/2022-01-28/cargo-beta-x86_64-unknown-netbsd.tar.gz": "807f8fec9df54aab2bc2b70d8fe581922ed9f6210608bb3c06ca919c4ce18c77",
+    "dist/2022-01-28/cargo-beta-x86_64-unknown-netbsd.tar.xz": "29defeeaa32612bef8b0fc54cf70ce7b472dab9a0bc3bd4516dfbcfad682adec",
+    "dist/2022-01-28/rust-std-beta-aarch64-apple-darwin.tar.gz": "bf8adfd2906d4fbf2e86700a2d753afb6397a0a8cbb3249977fb5b5c63cb7fea",
+    "dist/2022-01-28/rust-std-beta-aarch64-apple-darwin.tar.xz": "eb45b62563528fe2eb53e8a4b21bd94f818c6d7e053a6d467854bb4870d97124",
+    "dist/2022-01-28/rust-std-beta-aarch64-apple-ios-sim.tar.gz": "fc0218862447e94362de8b4c0537ab3e52715dd3becd3a467d2b8b772379eafa",
+    "dist/2022-01-28/rust-std-beta-aarch64-apple-ios-sim.tar.xz": "290440ff743ad923ab3dadbec37b5f8f32bf0fb71cd52348932045a358a7c79d",
+    "dist/2022-01-28/rust-std-beta-aarch64-apple-ios.tar.gz": "c2d73f7b0bc523ffbaca6b996d3739d7504d49197a3f43660ef0b60b43e0d372",
+    "dist/2022-01-28/rust-std-beta-aarch64-apple-ios.tar.xz": "8aedb963e75125eb73f0cfb5fca4c1e687f9c05bda1829faf2feca67644b3f05",
+    "dist/2022-01-28/rust-std-beta-aarch64-fuchsia.tar.gz": "9a54522ddbb3d013584374123bf9af94529880641b1a06de95f60b003e4cebb8",
+    "dist/2022-01-28/rust-std-beta-aarch64-fuchsia.tar.xz": "2fa07e359705959879b53d2384ba4b1cdbf5cf9d2d4de09f7e1951a7f762233d",
+    "dist/2022-01-28/rust-std-beta-aarch64-linux-android.tar.gz": "55e1116809e6b6a2e2284496ab5295687ad5ea78b258425fdfb1408463b5e13a",
+    "dist/2022-01-28/rust-std-beta-aarch64-linux-android.tar.xz": "a28d4e982f7e9be7d77a56aaa2a2cb56d8d9e973abf53251b17c9304702d0501",
+    "dist/2022-01-28/rust-std-beta-aarch64-pc-windows-msvc.tar.gz": "d764bee67fb0b03649c3d66d969cbc164d0e3044745dd03df9618cb6fadc18c1",
+    "dist/2022-01-28/rust-std-beta-aarch64-pc-windows-msvc.tar.xz": "b955936e318bc72118a28b90049507b515f252b2cb2e7b13ebdfd0b7e26fa160",
+    "dist/2022-01-28/rust-std-beta-aarch64-unknown-linux-gnu.tar.gz": "6f73c34ce381c71f9d4b26eb68180fe4095d6093aa3cefd8247bc1752df9180d",
+    "dist/2022-01-28/rust-std-beta-aarch64-unknown-linux-gnu.tar.xz": "ca82c0aa61c59b29f02f5dfd4ca6ef2836d145944b39e24f4d257eef4765ef46",
+    "dist/2022-01-28/rust-std-beta-aarch64-unknown-linux-musl.tar.gz": "a369a6f079274e0e8604616bd911dced66e3557a109aef5d8a2495c657d51f30",
+    "dist/2022-01-28/rust-std-beta-aarch64-unknown-linux-musl.tar.xz": "ce8e9ce1c71ecc704830df274df4eab48c1bb431bc0a2260208e80bd7c9f0ce9",
+    "dist/2022-01-28/rust-std-beta-aarch64-unknown-none-softfloat.tar.gz": "8a331a2e9e90260ccd31c8868d321badfc499adf875492c6b3fc89cd6bb30108",
+    "dist/2022-01-28/rust-std-beta-aarch64-unknown-none-softfloat.tar.xz": "fb17a241fd1b05c1c63ecf0f2318106f5992fb90eab5c4128186e1f7a232fdcc",
+    "dist/2022-01-28/rust-std-beta-aarch64-unknown-none.tar.gz": "892fc92ff90f729e1cd72db18c9b33a4a534f960e8ccf25b99e098b9c7bd1fe9",
+    "dist/2022-01-28/rust-std-beta-aarch64-unknown-none.tar.xz": "f781f4f9c7528860c720ac89a8c883bd9ae0ef515a9110a15588d2ea4ceffaa7",
+    "dist/2022-01-28/rust-std-beta-arm-linux-androideabi.tar.gz": "1767a44aa4999d4cbbb0f99ee79c02f1afe573e93c9fd8326090fe250ff05c4b",
+    "dist/2022-01-28/rust-std-beta-arm-linux-androideabi.tar.xz": "bfdef77cb3101b83881069b3cf908f119c1611b547c1620a2e9b06b63e18706c",
+    "dist/2022-01-28/rust-std-beta-arm-unknown-linux-gnueabi.tar.gz": "8cb857bc6779224fb9ff3fdbdc21b770814a02a93cbad96c19bd155f007efea5",
+    "dist/2022-01-28/rust-std-beta-arm-unknown-linux-gnueabi.tar.xz": "5a708abe835aab411885c13a5d47584b279f5955a971729084f869f0e9f05c14",
+    "dist/2022-01-28/rust-std-beta-arm-unknown-linux-gnueabihf.tar.gz": "c214aa4109e2b2069c3e739524570d5412475f65741a6eeca3e54fa8cd8486c5",
+    "dist/2022-01-28/rust-std-beta-arm-unknown-linux-gnueabihf.tar.xz": "6c957c577b75d8b2f1b0f7a8e7b0eae8256bec71c93b7cc69a1231754890cff9",
+    "dist/2022-01-28/rust-std-beta-arm-unknown-linux-musleabi.tar.gz": "14ddf068ecc33aba42de9cab00a52498691564c1c83b4e043024a9b093942533",
+    "dist/2022-01-28/rust-std-beta-arm-unknown-linux-musleabi.tar.xz": "2950de6376f7ee9c05145fbd8143c61a7344fb748f540c835d0523cd645176f0",
+    "dist/2022-01-28/rust-std-beta-arm-unknown-linux-musleabihf.tar.gz": "94ca02d2b03e71b9a6515a296a958ceeeb2fa0f3b6f14d46ff455e5adfdbd167",
+    "dist/2022-01-28/rust-std-beta-arm-unknown-linux-musleabihf.tar.xz": "7b48e5e497dd82144e2e9d2b718855ddcbacb91c5a7544762d57fc18024b2b5d",
+    "dist/2022-01-28/rust-std-beta-armebv7r-none-eabi.tar.gz": "afd44d9aee954a7f5c1b744862c7e62ebc4812192deffc06052e4c5f23fbb1b4",
+    "dist/2022-01-28/rust-std-beta-armebv7r-none-eabi.tar.xz": "2cbcd24628de62d41b18fbf2434104dc8815edcf4d4fc895cf0fdbe91d920ea7",
+    "dist/2022-01-28/rust-std-beta-armebv7r-none-eabihf.tar.gz": "4dd22c4893a31d58dbdda4c60bca249fb261a49f64c0dd33b93916924b301668",
+    "dist/2022-01-28/rust-std-beta-armebv7r-none-eabihf.tar.xz": "f51031ffcee2cfc0720a5a39a2fc319df099c829eba0bc9d57758dabad2901c6",
+    "dist/2022-01-28/rust-std-beta-armv5te-unknown-linux-gnueabi.tar.gz": "c5fb7b66c2b4f5cae789895a6670548fc14a71626b4962fcf973191b3408b6e7",
+    "dist/2022-01-28/rust-std-beta-armv5te-unknown-linux-gnueabi.tar.xz": "0ce55128a439376a176e36b96615ff6d595fec18acb3f1e72d97a48fba52d9e1",
+    "dist/2022-01-28/rust-std-beta-armv5te-unknown-linux-musleabi.tar.gz": "e1ce999a808d0c3046b5aac0abc494b37d15256d91acfc0031f7409e03c37cef",
+    "dist/2022-01-28/rust-std-beta-armv5te-unknown-linux-musleabi.tar.xz": "8c1990aa82d0cb1081918500967669a3026bbdb14cb72114305253a03e38b89e",
+    "dist/2022-01-28/rust-std-beta-armv7-linux-androideabi.tar.gz": "0d7ca26d9c90df9657eb01829e8536d2d5493a79ce785eb025e5b09c180a0bbd",
+    "dist/2022-01-28/rust-std-beta-armv7-linux-androideabi.tar.xz": "89a7e989fbac5b272840635f7deb1d0b65079a1b97e5b055c22306ead886b2dd",
+    "dist/2022-01-28/rust-std-beta-armv7-unknown-linux-gnueabi.tar.gz": "45746a4f15d418902ba608ca5992f207277f3b591c440839f6c89fdabc4c3330",
+    "dist/2022-01-28/rust-std-beta-armv7-unknown-linux-gnueabi.tar.xz": "625d0dac58197517630362f993712c0e7706e43be5d5ef36159321ce3cc6b20e",
+    "dist/2022-01-28/rust-std-beta-armv7-unknown-linux-gnueabihf.tar.gz": "aca7527de247595d7c7a240f093d66ffb4e2d11282f1df2fde9531096d4fe9b0",
+    "dist/2022-01-28/rust-std-beta-armv7-unknown-linux-gnueabihf.tar.xz": "0c0e620d4fea01054af6fdf28c8b2f15eac40acd41b0ae0a8ed9520b72d2c5ac",
+    "dist/2022-01-28/rust-std-beta-armv7-unknown-linux-musleabi.tar.gz": "084b0f9a065821c2996da457c67ddca54219f39788b22f6b24a4be6c4cad07f7",
+    "dist/2022-01-28/rust-std-beta-armv7-unknown-linux-musleabi.tar.xz": "eec6022b0123e24c97a453fbf40eb3a9ee606aa5f797a790f2bde9b2eea2bb5d",
+    "dist/2022-01-28/rust-std-beta-armv7-unknown-linux-musleabihf.tar.gz": "343fea5dcc3e75db9577d2955e6e1c4bf75aa622f741456d64843d927491ed90",
+    "dist/2022-01-28/rust-std-beta-armv7-unknown-linux-musleabihf.tar.xz": "37d9a42c59374785f05bb478b0af26e80e212a229720a3f2f59db7157d5a028e",
+    "dist/2022-01-28/rust-std-beta-armv7a-none-eabi.tar.gz": "f35390f75f201567458b43b76affa4bbc677adb3ebf0e3f07513ca707bbd832d",
+    "dist/2022-01-28/rust-std-beta-armv7a-none-eabi.tar.xz": "38a2776f222485a7381e35ed4f50a9756f0615e83b1143dffa7a6f1aa47e7001",
+    "dist/2022-01-28/rust-std-beta-armv7r-none-eabi.tar.gz": "2c3730bc1d7cd878cd9f0070697ae0a64f209b74bd2442afb1ea536b11f92da1",
+    "dist/2022-01-28/rust-std-beta-armv7r-none-eabi.tar.xz": "0bdd8d03334ff042fa693eaa27afddf1afc670aab89293e5baec57ce9e5c6c57",
+    "dist/2022-01-28/rust-std-beta-armv7r-none-eabihf.tar.gz": "b1f1088d554a06bc30b5c9bfd2043d952c80f8ff972c824760911dd0fa487a2d",
+    "dist/2022-01-28/rust-std-beta-armv7r-none-eabihf.tar.xz": "0cc2026f2968ce7f4e262e0899251fb6ee0dc84b49d3d9bd496e00795070d842",
+    "dist/2022-01-28/rust-std-beta-asmjs-unknown-emscripten.tar.gz": "858c4a3660ef76c3fe792881638e67563c2290d9a81c3b0f49963b252e1e493a",
+    "dist/2022-01-28/rust-std-beta-asmjs-unknown-emscripten.tar.xz": "10fcf8c290e936a4ff78163d5e0fb9827176a9860578f9352094026e85a81c14",
+    "dist/2022-01-28/rust-std-beta-i586-pc-windows-msvc.tar.gz": "7d5e5fe1c399e58a889c861864278d2d4641a888be548ae55d3b6734b6490c15",
+    "dist/2022-01-28/rust-std-beta-i586-pc-windows-msvc.tar.xz": "f53c2713dbeb793e8564fc222c4ec90263eb2a908c938e4e9ca06aff40e24a84",
+    "dist/2022-01-28/rust-std-beta-i586-unknown-linux-gnu.tar.gz": "0519f54f0f3829e7d0a26dabe0450de23189fd771a33720d71e17ef7017d27e7",
+    "dist/2022-01-28/rust-std-beta-i586-unknown-linux-gnu.tar.xz": "ab2d89d1be4b2c5076a4d83108ac5785178e2726362a8f76d4d4eabffc016ba7",
+    "dist/2022-01-28/rust-std-beta-i586-unknown-linux-musl.tar.gz": "873a4c495f57514224fa25a67e4c714b5d37cf760c18aae38bea6b7b8c8f089f",
+    "dist/2022-01-28/rust-std-beta-i586-unknown-linux-musl.tar.xz": "01bb0327a8f63fe2a42a6af07a743253974fcbfecab3bdd739be58e96e0d0c0c",
+    "dist/2022-01-28/rust-std-beta-i686-linux-android.tar.gz": "630d53d2eb46c63cd183f5d130af45e2641313d1b1c607c41f7a4a507fca16e4",
+    "dist/2022-01-28/rust-std-beta-i686-linux-android.tar.xz": "323660e7d58d468ddc33dbbd0fa37621fe78713091ba2ef178d4a8fe01bf81e1",
+    "dist/2022-01-28/rust-std-beta-i686-pc-windows-gnu.tar.gz": "0d687096fcf757434d07db355f96eddd8e07a90d952d123f2af30a0f63dffaf4",
+    "dist/2022-01-28/rust-std-beta-i686-pc-windows-gnu.tar.xz": "22fb93f31abf9f7d9e4cdfd5a7ddd03705ecc48db22d7a4ebd58e421891fb998",
+    "dist/2022-01-28/rust-std-beta-i686-pc-windows-msvc.tar.gz": "1c644591da0698df4a40977c9db8a00a002c1a34cb828a4038c5c17d1a3aae58",
+    "dist/2022-01-28/rust-std-beta-i686-pc-windows-msvc.tar.xz": "e0220fd4ee5f36b29f605f9a8bcdea1bd7721c40787b59e1fb63915e5da0668f",
+    "dist/2022-01-28/rust-std-beta-i686-unknown-freebsd.tar.gz": "eb9faa1d7492d92cffec3495937c7682e3c578d9c6ac5d9074efea0d1097d63b",
+    "dist/2022-01-28/rust-std-beta-i686-unknown-freebsd.tar.xz": "10732369b289fc92ea0566cbf8494fa267ac551e682921f1824d76b70170d73c",
+    "dist/2022-01-28/rust-std-beta-i686-unknown-linux-gnu.tar.gz": "355c6c1178d34e687a071081dddd093a1d6edd3e93cd73aac46f425797c6c541",
+    "dist/2022-01-28/rust-std-beta-i686-unknown-linux-gnu.tar.xz": "4904406365f855ed10cf113f04cbeaaf29842789afb91d84396ba3953125d873",
+    "dist/2022-01-28/rust-std-beta-i686-unknown-linux-musl.tar.gz": "832737bfc8c70f07a8463d1db39f260829de67dc8c588cf11170f2dcb2b0dc28",
+    "dist/2022-01-28/rust-std-beta-i686-unknown-linux-musl.tar.xz": "8220b586c8cbe913db4d00699f7821fdf40ca8da85faf4fbfc84ae56916460e9",
+    "dist/2022-01-28/rust-std-beta-mips-unknown-linux-gnu.tar.gz": "82939695d5bfe904481e3858e2d203d56f0877683ebfb33326ab9d0699ff2c5f",
+    "dist/2022-01-28/rust-std-beta-mips-unknown-linux-gnu.tar.xz": "f337c7caee2e964926801811a282e4f18f4e196521ddfa81417ff6dca46927c4",
+    "dist/2022-01-28/rust-std-beta-mips-unknown-linux-musl.tar.gz": "e7256b993f54fc5b7aa68c8aa5e5f1294d82681f0b8b38c7f7ed6e1d57064af4",
+    "dist/2022-01-28/rust-std-beta-mips-unknown-linux-musl.tar.xz": "00bf1b30ac924ca221569fb2febf34593ca435540163d12ec4e433a7406c2819",
+    "dist/2022-01-28/rust-std-beta-mips64-unknown-linux-gnuabi64.tar.gz": "6d2c2d9b82d95d808a23e99e0f9b828d9087fe82efeabce200ea7634636857da",
+    "dist/2022-01-28/rust-std-beta-mips64-unknown-linux-gnuabi64.tar.xz": "e504cbcda58085ad283dcccf4aa5160a117aeef01f4017ffb4350a6e3b18113f",
+    "dist/2022-01-28/rust-std-beta-mips64-unknown-linux-muslabi64.tar.gz": "c382edfa08997d2c5d400ca9c93eee9457fdabf157da2306187af68a11cd3705",
+    "dist/2022-01-28/rust-std-beta-mips64-unknown-linux-muslabi64.tar.xz": "616d4daf1ed58c7718a204da636d96597d184ecdc71b414a9b20e5fef710c078",
+    "dist/2022-01-28/rust-std-beta-mips64el-unknown-linux-gnuabi64.tar.gz": "5d24d7be185cb8fb8bdb1a89a63be323491284d2e9bb191104ef59a547e3899e",
+    "dist/2022-01-28/rust-std-beta-mips64el-unknown-linux-gnuabi64.tar.xz": "c055f2f3d77354a9d03276f7af8221e3c8a337b11198143a31b6b654e8bc4f28",
+    "dist/2022-01-28/rust-std-beta-mips64el-unknown-linux-muslabi64.tar.gz": "ae730a78c7382af9c16f0b4bc157f339bf8befced1748b955e29e0db751cd5cb",
+    "dist/2022-01-28/rust-std-beta-mips64el-unknown-linux-muslabi64.tar.xz": "18f02642733d06bfad35e6d383e6634a22c79dfc56f6b6f1976a5bf71ca36478",
+    "dist/2022-01-28/rust-std-beta-mipsel-unknown-linux-gnu.tar.gz": "cf162ecf50f6edddff265f5e051719f8c15c730f3826cecff3477d5c63f3f28b",
+    "dist/2022-01-28/rust-std-beta-mipsel-unknown-linux-gnu.tar.xz": "f82bf7eac361cfd2b255c3eb1f2ba4e6349fe5f88d6e6e9edee0aa7e9ae4e721",
+    "dist/2022-01-28/rust-std-beta-mipsel-unknown-linux-musl.tar.gz": "30e48dc0b5c8cfb1d3fd18e06ca19f7136aae366cc9e2b142999d8a0430e3513",
+    "dist/2022-01-28/rust-std-beta-mipsel-unknown-linux-musl.tar.xz": "7db67dfd175d398f4e922be87002cee22e7badc661ab3ee4aba7c7e9673ecf0e",
+    "dist/2022-01-28/rust-std-beta-nvptx64-nvidia-cuda.tar.gz": "d72d9066354bf5f2daddd8ca00f2221c897142e68b7e8343c6c965e5537ccb10",
+    "dist/2022-01-28/rust-std-beta-nvptx64-nvidia-cuda.tar.xz": "eb5f848052e0ab07de8aec5f767d6d4413da0c135ce02e766d125da5850a585f",
+    "dist/2022-01-28/rust-std-beta-powerpc-unknown-linux-gnu.tar.gz": "6cf15da4eee99e1b89f2306ffebebce537543f08ef36f3a8aad38b0202bf1378",
+    "dist/2022-01-28/rust-std-beta-powerpc-unknown-linux-gnu.tar.xz": "b35d2296994172b05ffd0bb3bb59cddc007ad93cc089aeb1f8b4a2d7a1d716d4",
+    "dist/2022-01-28/rust-std-beta-powerpc64-unknown-linux-gnu.tar.gz": "819327e4a040bea527712ac2d935b2db9539262a9e552450144b9829038db48f",
+    "dist/2022-01-28/rust-std-beta-powerpc64-unknown-linux-gnu.tar.xz": "68cd8c861a62931feae04eef5a3ecbb9bdd97433d082cae060e005f1da6523f5",
+    "dist/2022-01-28/rust-std-beta-powerpc64le-unknown-linux-gnu.tar.gz": "fc1459aa99a44895a0631a35cadd7c8683b7570fe0a743e0bdc7f397936a377a",
+    "dist/2022-01-28/rust-std-beta-powerpc64le-unknown-linux-gnu.tar.xz": "702b008b7390df74ed639b99133abbc5c0441c002d4d99594c9c56f46e13e518",
+    "dist/2022-01-28/rust-std-beta-riscv32i-unknown-none-elf.tar.gz": "45dea87501465e6ec421f7a9a6a364fb4bbe7f6e6c00aef16bd66b58a204ed18",
+    "dist/2022-01-28/rust-std-beta-riscv32i-unknown-none-elf.tar.xz": "f7d5178e5b2514e52336dd3d4dd7ebe7f452e6427ff578d19f955d611625c2ac",
+    "dist/2022-01-28/rust-std-beta-riscv32imac-unknown-none-elf.tar.gz": "9c7b727799288d289f7569823b4f75c691d42a2c25066f742e74efcb1e9e7c31",
+    "dist/2022-01-28/rust-std-beta-riscv32imac-unknown-none-elf.tar.xz": "536397a308e268b30a6bd1a2a869ade61e0d048aba76b9787b130c5d8ede7d12",
+    "dist/2022-01-28/rust-std-beta-riscv32imc-unknown-none-elf.tar.gz": "21397afe74f4a3611e91c4e9efede79d3cf982a13d1b864c878be7d3436e3129",
+    "dist/2022-01-28/rust-std-beta-riscv32imc-unknown-none-elf.tar.xz": "3c61d50eb15c56087ab9f9cfe765586a2fbcdff93d60740a75bb435dcd18619f",
+    "dist/2022-01-28/rust-std-beta-riscv64gc-unknown-linux-gnu.tar.gz": "7f654430af17b09cd974e35f6c99b1ff88fad706e659fe9d48ed9cb765722278",
+    "dist/2022-01-28/rust-std-beta-riscv64gc-unknown-linux-gnu.tar.xz": "9d7ee3d8dd1e93c754e2991f656acc2a03e88b9ee2deaa865c83fabe05aa5618",
+    "dist/2022-01-28/rust-std-beta-riscv64gc-unknown-none-elf.tar.gz": "47ea53de8215c251bb206f81ff6e8ad2d632e9f74e793d36db00d8329e7f4dea",
+    "dist/2022-01-28/rust-std-beta-riscv64gc-unknown-none-elf.tar.xz": "56c033b71340b5379a59dfc0219bb5350a3e95aa22983c0bbfe1cad6b347718c",
+    "dist/2022-01-28/rust-std-beta-riscv64imac-unknown-none-elf.tar.gz": "3902efc5f212d815a77d39211a7ad662c2826857bde89ec7c0f6411745531e6a",
+    "dist/2022-01-28/rust-std-beta-riscv64imac-unknown-none-elf.tar.xz": "f9631edc7899d7f71230483caff7215a423b4ced12a963e41dc0e268301c4565",
+    "dist/2022-01-28/rust-std-beta-s390x-unknown-linux-gnu.tar.gz": "e1006abf94a35dc9eed587cde1eef3bf35ce0e685f4040176c2460df4ef71f69",
+    "dist/2022-01-28/rust-std-beta-s390x-unknown-linux-gnu.tar.xz": "34f5901fef0845b5da92f3a49a20d533b6bcdb77cbfd9d8432eac8aa47b28675",
+    "dist/2022-01-28/rust-std-beta-sparc64-unknown-linux-gnu.tar.gz": "d3a63e5ba55d291045562d95d27cfaa6f116ecc72ebba39ff97ee8e960030de1",
+    "dist/2022-01-28/rust-std-beta-sparc64-unknown-linux-gnu.tar.xz": "f9b7b16aa77ac7ca1e8384d74c5cfcb66626cc57eede7aff1da4cdb7ac13942d",
+    "dist/2022-01-28/rust-std-beta-sparcv9-sun-solaris.tar.gz": "9af8b18ab6089bb2e06ea33a17a44ee98cd0ac3c54b688f5848d4cd141ff2389",
+    "dist/2022-01-28/rust-std-beta-sparcv9-sun-solaris.tar.xz": "1809d88ac573ea265f3d21d4142d0176ba9ab51e789911825a9d72ca917ddfd1",
+    "dist/2022-01-28/rust-std-beta-thumbv6m-none-eabi.tar.gz": "5a1aeb44ca3b92a37eced85edf374d2ffe17ba6f6da748580baaf3af1c3a8a36",
+    "dist/2022-01-28/rust-std-beta-thumbv6m-none-eabi.tar.xz": "7d3cdc3b7b3d9d47aa0d1d6de4fc5f520ee99c52b4678fc3987823efe4e1ca98",
+    "dist/2022-01-28/rust-std-beta-thumbv7em-none-eabi.tar.gz": "a950ffaf7228864eb2fd9570bb86a5544f89f8293a3e96f794d36eaa7e9f8825",
+    "dist/2022-01-28/rust-std-beta-thumbv7em-none-eabi.tar.xz": "527be16c3474ab25c3ac56aab6278a3d4f1b535bee0c226dbf63e52f5ea2acf7",
+    "dist/2022-01-28/rust-std-beta-thumbv7em-none-eabihf.tar.gz": "fc864b408f7d8688733b260b7ca2f476f148a0c04cef15b4b99348fb59627ce9",
+    "dist/2022-01-28/rust-std-beta-thumbv7em-none-eabihf.tar.xz": "3a966b6343c75933d00ead88f54e797aa81abc1b521902d15c22d44791b33e71",
+    "dist/2022-01-28/rust-std-beta-thumbv7m-none-eabi.tar.gz": "4ab03955b4b787f5d2b1096e03aa4b0948a2a53562107ef6f9cf0ae122668b86",
+    "dist/2022-01-28/rust-std-beta-thumbv7m-none-eabi.tar.xz": "2c0e443dcda563ff4cad6285ea648797bca6ce828bfed66f3b868fa386a0a693",
+    "dist/2022-01-28/rust-std-beta-thumbv7neon-linux-androideabi.tar.gz": "831e7af7924d20ba5289a67d6f0d55942f624ad1abb997a90e05fe303c442870",
+    "dist/2022-01-28/rust-std-beta-thumbv7neon-linux-androideabi.tar.xz": "e99648317cc93eb4e3e807dc85b28bc6336136750caa9ae000a8041e93d1a9e1",
+    "dist/2022-01-28/rust-std-beta-thumbv7neon-unknown-linux-gnueabihf.tar.gz": "37db1b82732ee477e4bd8f1d430ca0f7b50f9699285188cc4c55efc024c760f3",
+    "dist/2022-01-28/rust-std-beta-thumbv7neon-unknown-linux-gnueabihf.tar.xz": "5dfd285234f1f9da127b7ae7f823facac9f6f281713b5502268ff75668ae8a6e",
+    "dist/2022-01-28/rust-std-beta-thumbv8m.base-none-eabi.tar.gz": "22c21d88398dcc6dff166270e455e6a4be8bc06b1932f4138ce8c931e3a900f6",
+    "dist/2022-01-28/rust-std-beta-thumbv8m.base-none-eabi.tar.xz": "2eb7e4dbd9984ca60746af13c631871c3d872b95239c422d135de2bda203707a",
+    "dist/2022-01-28/rust-std-beta-thumbv8m.main-none-eabi.tar.gz": "97e6b0834227d725660d6f9729b198ddb70ba238640f2a43de4568230ac7bf5d",
+    "dist/2022-01-28/rust-std-beta-thumbv8m.main-none-eabi.tar.xz": "e9b06591f4769bed69b6be6647deded3991125c0a5bec5486126e6572707fd7c",
+    "dist/2022-01-28/rust-std-beta-thumbv8m.main-none-eabihf.tar.gz": "6afa229d0a1159f853a13f0ea36c4dcb8bf964bd699ecafc57539a1391861591",
+    "dist/2022-01-28/rust-std-beta-thumbv8m.main-none-eabihf.tar.xz": "5811a551c8c19b09f6928aeaa655c69f32657775b9149e4fa37a5003be15faec",
+    "dist/2022-01-28/rust-std-beta-wasm32-unknown-emscripten.tar.gz": "522e98515cbedd4b75cd2a3151d16517d71d8078005c3a1133e6e222dad163a1",
+    "dist/2022-01-28/rust-std-beta-wasm32-unknown-emscripten.tar.xz": "2654caa437d1f1871db5400652287597bec88eb366e099b03d7cca70367d3722",
+    "dist/2022-01-28/rust-std-beta-wasm32-unknown-unknown.tar.gz": "c18dfcedf25851f446271979b868bcd8dbdad2ca2a4762f3594385d65811d449",
+    "dist/2022-01-28/rust-std-beta-wasm32-unknown-unknown.tar.xz": "0dc5da1073e3df2899909045c33c4aceb9b159faf7a20c2e32affca7e7587554",
+    "dist/2022-01-28/rust-std-beta-wasm32-wasi.tar.gz": "e6e03121c99326cb56bb3a6f6eb352cadfcc487b20f5a7e1b95c5c7f1c97feb0",
+    "dist/2022-01-28/rust-std-beta-wasm32-wasi.tar.xz": "8cf642cc54d22908a3db701a1beb13aa43143857596f4965261cdfa35812cfeb",
+    "dist/2022-01-28/rust-std-beta-x86_64-apple-darwin.tar.gz": "e3065e70fcea7f03ce4ae41742bc6540ee2e0df50501d8ed81215d0ca4c63f9d",
+    "dist/2022-01-28/rust-std-beta-x86_64-apple-darwin.tar.xz": "e5e683cc14760ab0f94c4f02b721e3cb2c0c780ab68e63c971de70355c30d2cb",
+    "dist/2022-01-28/rust-std-beta-x86_64-apple-ios.tar.gz": "b31791d217e4868caf88fa4c96c3476a4c65bb8ab59e8846f7e2f4f003be7cc9",
+    "dist/2022-01-28/rust-std-beta-x86_64-apple-ios.tar.xz": "24dd9d59c9ecfd0c7a56143a9e0368b077d61ac7d9c56cb940e8b195fb5ccde8",
+    "dist/2022-01-28/rust-std-beta-x86_64-fortanix-unknown-sgx.tar.gz": "15bad901b51a039c70dda2379eb1cbfb7098ed00415924ad19fb9318f176d34f",
+    "dist/2022-01-28/rust-std-beta-x86_64-fortanix-unknown-sgx.tar.xz": "6fd144e0d7cf510f5df11798d9e8f2faeee52d9dd5134fdfb90fac2adb9c1d21",
+    "dist/2022-01-28/rust-std-beta-x86_64-fuchsia.tar.gz": "f22276c2c07074dd8f3634f95eb4422ca1a2ddb89e22e05450c77e59676445f9",
+    "dist/2022-01-28/rust-std-beta-x86_64-fuchsia.tar.xz": "fa745d421e36d9255da6e69ae4adf968910200f99394a8ca88aa2917b0931758",
+    "dist/2022-01-28/rust-std-beta-x86_64-linux-android.tar.gz": "b6924656e61295d96c5c792cd482435248867a846000d232f8895b983f2fd68a",
+    "dist/2022-01-28/rust-std-beta-x86_64-linux-android.tar.xz": "58b981335322b7f5f11ecf71411b9b7fe045d160fb99b1f8a452d0d833926461",
+    "dist/2022-01-28/rust-std-beta-x86_64-pc-solaris.tar.gz": "559721b2bf60bbd7688b8aeeccdd3d6c92eee2eaf29082f42ec53689f2fddb92",
+    "dist/2022-01-28/rust-std-beta-x86_64-pc-solaris.tar.xz": "c6341953f2a9d11159e3bf398b90cf9e76af4b6af7cd6d828b22661bc4f3fc5c",
+    "dist/2022-01-28/rust-std-beta-x86_64-pc-windows-gnu.tar.gz": "59b91baee1eeee88c78b55ac3a32ce1cdf59107715a3db7c3476843ea981b70c",
+    "dist/2022-01-28/rust-std-beta-x86_64-pc-windows-gnu.tar.xz": "2f7bd143bb9f40a06e69b5f9908ab14e364db254918dd1c984c272a853a56f0b",
+    "dist/2022-01-28/rust-std-beta-x86_64-pc-windows-msvc.tar.gz": "1258d1207468450556a0a265342e5155474a7f87e8c33b5233c72a959b13421c",
+    "dist/2022-01-28/rust-std-beta-x86_64-pc-windows-msvc.tar.xz": "907d14ff6bb742f2bf12f4b51054c8c6bb128cdaee957918e4fdeda61ac18c53",
+    "dist/2022-01-28/rust-std-beta-x86_64-sun-solaris.tar.gz": "ca0cef7d3497ae9714537bbdd2469b48afb20ba1dfecf03d680e801871a3ec97",
+    "dist/2022-01-28/rust-std-beta-x86_64-sun-solaris.tar.xz": "73eaceff8046cdb76ccb7a6739f01dfff5b740ffdf5366067e92814be5ff97a0",
+    "dist/2022-01-28/rust-std-beta-x86_64-unknown-freebsd.tar.gz": "bb8671bf78ee0c8840d453af9ca0d337c167d69c293e4710d6aac2d19c3a044b",
+    "dist/2022-01-28/rust-std-beta-x86_64-unknown-freebsd.tar.xz": "87cdacf1caa7fb3656be04fb3b37f21541b2e8eed214bb5822c0723fe9f23067",
+    "dist/2022-01-28/rust-std-beta-x86_64-unknown-illumos.tar.gz": "7dd006b93c449864bc3c6e024e0f0903db1c422b6bccb1bd1ee8187fcbb4e3d4",
+    "dist/2022-01-28/rust-std-beta-x86_64-unknown-illumos.tar.xz": "7d77712a5d07578e2f9947ef11ced00a84b22d3075f747781b6c0e0483bd7fc8",
+    "dist/2022-01-28/rust-std-beta-x86_64-unknown-linux-gnu.tar.gz": "5f6fb2124a40f0a7ed2631b59f67762d701c9fd8ede051dc922d99ac6fe29c97",
+    "dist/2022-01-28/rust-std-beta-x86_64-unknown-linux-gnu.tar.xz": "e00f0da85fb8378dac3ae76f235f54cca568680d4208fed065143e1ecde1b87d",
+    "dist/2022-01-28/rust-std-beta-x86_64-unknown-linux-gnux32.tar.gz": "d2d0222ba528a42d8804423c15cac59a5c37e36b76248605dfcf9d732cceb1de",
+    "dist/2022-01-28/rust-std-beta-x86_64-unknown-linux-gnux32.tar.xz": "d2c8cf8510369513fd79107bd450df429a97f5bfbc59ef8a7fea5fbd75462a65",
+    "dist/2022-01-28/rust-std-beta-x86_64-unknown-linux-musl.tar.gz": "a7934e15342434f242ea7eb9c9c853a984f70befaf1cf2266cc5a198233a2337",
+    "dist/2022-01-28/rust-std-beta-x86_64-unknown-linux-musl.tar.xz": "bc5de5c3df04aa3aaf4866e432b3b50dafaf790345587eaf066334f7f52ff34a",
+    "dist/2022-01-28/rust-std-beta-x86_64-unknown-netbsd.tar.gz": "9827751229decaf827c8bbbbeebe868c86d7002a82d776f0ecf310d539eb285b",
+    "dist/2022-01-28/rust-std-beta-x86_64-unknown-netbsd.tar.xz": "88d41e6fa0d290fd39470f824045abdf3557e0028ae877c9c4081231531dc8cd",
+    "dist/2022-01-28/rust-std-beta-x86_64-unknown-redox.tar.gz": "5b1c8bed24c4bee0cfffbf54029e39673545a314102be2281018f8bbd05a9d17",
+    "dist/2022-01-28/rust-std-beta-x86_64-unknown-redox.tar.xz": "3bc2a98b43bda5080734ba0ad1235e72a3e12e3bbb5c603193aae3a18feeee1c",
+    "dist/2022-01-28/rustc-beta-aarch64-apple-darwin.tar.gz": "be36422d10d4dcbc618eec2dc33ebd62c16e366a0bcf8a4a3b9ddf5bfe236bf2",
+    "dist/2022-01-28/rustc-beta-aarch64-apple-darwin.tar.xz": "cf6e5b5475733dc71f68c8d8b08556d410c3f2bc87813565cb9a69d0984fdf48",
+    "dist/2022-01-28/rustc-beta-aarch64-pc-windows-msvc.tar.gz": "c2eff28806e697087a39da7922ede30b937110d1e492ab839644c695c02ea467",
+    "dist/2022-01-28/rustc-beta-aarch64-pc-windows-msvc.tar.xz": "ea9fda833ade80ef87afcf3cfdc0ace851c01b66b00701d70722ba9aab1c9d0f",
+    "dist/2022-01-28/rustc-beta-aarch64-unknown-linux-gnu.tar.gz": "e9e37df47dfb3bcbae3110e0b372ae661aff82d5e6a6837deff78978a85dd2f3",
+    "dist/2022-01-28/rustc-beta-aarch64-unknown-linux-gnu.tar.xz": "f11adc9a47432ab4ecd0e95c8fbde21c493dcac730ac9bcc924e096eacce6b94",
+    "dist/2022-01-28/rustc-beta-aarch64-unknown-linux-musl.tar.gz": "6279fd872148c28c0684d7dbfd6e96838fff8acbec83c45e235e85f3d68802de",
+    "dist/2022-01-28/rustc-beta-aarch64-unknown-linux-musl.tar.xz": "c969e5c760dda90fe23cf8df764601c38ada25a2d7bed0d497f31701c7bcc62d",
+    "dist/2022-01-28/rustc-beta-arm-unknown-linux-gnueabi.tar.gz": "d4025f62b09f94d5c464fa6bb614186e9968c6b34f5a12544ee35323426eae19",
+    "dist/2022-01-28/rustc-beta-arm-unknown-linux-gnueabi.tar.xz": "992d055af2f888d2c61e5aa1670ef40a8bf7ac761cf6ecf76d7a8d13b3eb9a0c",
+    "dist/2022-01-28/rustc-beta-arm-unknown-linux-gnueabihf.tar.gz": "ab153065e0db468cdcab3a3a251d0f80a7d94940f3455db419b3a3ae5bffb651",
+    "dist/2022-01-28/rustc-beta-arm-unknown-linux-gnueabihf.tar.xz": "2501ad4358112e7acc736f9820d6f822bd985acd577e56c124573082a8e26cec",
+    "dist/2022-01-28/rustc-beta-armv7-unknown-linux-gnueabihf.tar.gz": "3e145f4111fc7835949b6ba34d0ed7a58605166cfcde22d96d2e8dad3f8c65ff",
+    "dist/2022-01-28/rustc-beta-armv7-unknown-linux-gnueabihf.tar.xz": "948f13b6f988072c707cf8c730abf970d6b47d4fb6044d4f6b615b48c21369c1",
+    "dist/2022-01-28/rustc-beta-i686-pc-windows-gnu.tar.gz": "997ba934c0bc912df01906b547f240f4cf7036300cd34ff341e72b69502b1cab",
+    "dist/2022-01-28/rustc-beta-i686-pc-windows-gnu.tar.xz": "c0ef12248f08da0f88629e55ab805b637289e7a29a92bdec5cdbf138df272baf",
+    "dist/2022-01-28/rustc-beta-i686-pc-windows-msvc.tar.gz": "94e6df381784d4f7bd9c8cbff39fe3066d636c64257093563f84a59ee84b686b",
+    "dist/2022-01-28/rustc-beta-i686-pc-windows-msvc.tar.xz": "ce392e7c1942f3267b029faa1f06a4162c3a21316ad819fa218a0ddbd9993b79",
+    "dist/2022-01-28/rustc-beta-i686-unknown-linux-gnu.tar.gz": "0809b22fc64166ed66a32090c3af49bf3b1515d9aa37958d1bf4d8edeef67bac",
+    "dist/2022-01-28/rustc-beta-i686-unknown-linux-gnu.tar.xz": "6a24a429d45b5558ebf069b0ea730a8b2c0f8cb8e8247d3e50739b5c6a06f45c",
+    "dist/2022-01-28/rustc-beta-mips-unknown-linux-gnu.tar.gz": "af3ff96546ae18359f529f35430c4faec41e411357a74e420b5eb6e939e56f9d",
+    "dist/2022-01-28/rustc-beta-mips-unknown-linux-gnu.tar.xz": "40e578de34500ac7bfd1513187894787b9a2a13e1cffbfb4a3fc04779e8f564e",
+    "dist/2022-01-28/rustc-beta-mips64-unknown-linux-gnuabi64.tar.gz": "9b4eeabf21940541791b768db2995c2fcd0f3aa4077f741df941892e65c03e1a",
+    "dist/2022-01-28/rustc-beta-mips64-unknown-linux-gnuabi64.tar.xz": "15940aaeb1da2bd7c3a5f4a3a76c90018a5d38bb933fa516b9833d3b5c9bc465",
+    "dist/2022-01-28/rustc-beta-mips64el-unknown-linux-gnuabi64.tar.gz": "e2d93d8ab7f3a43be6bed773a5afc1ce0b43c15ddb6390a34facb920dcac6980",
+    "dist/2022-01-28/rustc-beta-mips64el-unknown-linux-gnuabi64.tar.xz": "1ce438ec11c7d5912a348bd08fd9a81cd77e7ae9b221ded4473dd203fa5507e7",
+    "dist/2022-01-28/rustc-beta-mipsel-unknown-linux-gnu.tar.gz": "537928c967794a4b0b6fb3c6df138aafec1c26a5bc608089cba5b2ee2fb3679c",
+    "dist/2022-01-28/rustc-beta-mipsel-unknown-linux-gnu.tar.xz": "1ac3144f0ed01c686adb813e5f59ba9f07522161269928d852abf886f8beaa8f",
+    "dist/2022-01-28/rustc-beta-powerpc-unknown-linux-gnu.tar.gz": "23d6bddd60b9615b9b2dcc711587eb73022905f4f84db0b85433fb018db9fa90",
+    "dist/2022-01-28/rustc-beta-powerpc-unknown-linux-gnu.tar.xz": "172bf1d122830c06caae2879b0f175829938a6a043c39fba39ae2684632cec8f",
+    "dist/2022-01-28/rustc-beta-powerpc64-unknown-linux-gnu.tar.gz": "df0f58797083a0fb07072237932d6ef30035df227f347976e766dfba0b4d16c7",
+    "dist/2022-01-28/rustc-beta-powerpc64-unknown-linux-gnu.tar.xz": "951a378b2bd9e8dd60cc5813664c6a7b020e256b5efe88dc9ffc776c9bb9aa5f",
+    "dist/2022-01-28/rustc-beta-powerpc64le-unknown-linux-gnu.tar.gz": "93fb7cd91ff9e530d6eae0496d6456aa48cb6a7e81dc118d40fa5db84324e0ef",
+    "dist/2022-01-28/rustc-beta-powerpc64le-unknown-linux-gnu.tar.xz": "e0facee99193bcc891feb961a2eded35b4bd40f80b5fff977fcc48f7e7b26b84",
+    "dist/2022-01-28/rustc-beta-riscv64gc-unknown-linux-gnu.tar.gz": "d6c9a1014fe73d03ba7fe5248e84fba7abe46b96f61cc45a8972d0c85f577cc4",
+    "dist/2022-01-28/rustc-beta-riscv64gc-unknown-linux-gnu.tar.xz": "1f9f65bd07e075d4c7065d860ffa09441210a220abc4f6c0302de1cba4b56ebc",
+    "dist/2022-01-28/rustc-beta-s390x-unknown-linux-gnu.tar.gz": "0f73fe2bda02e6b9e0f17b8907571d11c622df6b9349ecb60b8d28fab0090f45",
+    "dist/2022-01-28/rustc-beta-s390x-unknown-linux-gnu.tar.xz": "8b1b8cb25ab0a00213b4272390175d91b486cb08e45425f52a8ee1104bc11efe",
+    "dist/2022-01-28/rustc-beta-x86_64-apple-darwin.tar.gz": "a6fa895d1debcbce04c68c64fac8ddf875f6c4e8d7298ec4e46e79cb702e103a",
+    "dist/2022-01-28/rustc-beta-x86_64-apple-darwin.tar.xz": "a0dc92f6a544b215f1b8cf71dc21fb26423883baa24c551c96c250bf05b21c99",
+    "dist/2022-01-28/rustc-beta-x86_64-pc-windows-gnu.tar.gz": "867038c72a56f889420bba6f1946ea560a328a79dd54b70caa8d7ae83712ad54",
+    "dist/2022-01-28/rustc-beta-x86_64-pc-windows-gnu.tar.xz": "a59d3409f4ca6f534608f5fe709ec6442e253f8d9400b9169814c5273765bb72",
+    "dist/2022-01-28/rustc-beta-x86_64-pc-windows-msvc.tar.gz": "e07ee24da341ae8fb8fe55f895ca5fdbedfc392454906396c61d79f1f5cac631",
+    "dist/2022-01-28/rustc-beta-x86_64-pc-windows-msvc.tar.xz": "668aa9303bf8a90c90167b6ca4a9a8a885d5ba21bcbacc379c3ce9b5c1a2f7d7",
+    "dist/2022-01-28/rustc-beta-x86_64-unknown-freebsd.tar.gz": "5e9b6a14feaf665839070f20a795ce2ed1c11824a56264fb35de5e894f7e2c13",
+    "dist/2022-01-28/rustc-beta-x86_64-unknown-freebsd.tar.xz": "3506fc1b57f8da75e93f48d00c49f4d0cdf61b459955449a87d1a7fc051c40dd",
+    "dist/2022-01-28/rustc-beta-x86_64-unknown-illumos.tar.gz": "b30f734100da20382605a98a70d3b6c34febdb11e105fc1a1639ab7b1338545f",
+    "dist/2022-01-28/rustc-beta-x86_64-unknown-illumos.tar.xz": "0b1ca988d1e25423d49f92acb123e8f91ca6772418d2bf4411e4fc1387410c5b",
+    "dist/2022-01-28/rustc-beta-x86_64-unknown-linux-gnu.tar.gz": "9320b51f221d9f875a98455fee8494d09318aa0aa90946e1fc03b73173738bb8",
+    "dist/2022-01-28/rustc-beta-x86_64-unknown-linux-gnu.tar.xz": "374ba55f3b7d1c6dfaa3385e7b033612335eaf01fa0d06eaeab95cc00503617b",
+    "dist/2022-01-28/rustc-beta-x86_64-unknown-linux-musl.tar.gz": "556428fed3c5b92e001fa9b762915583004e0e3384d1eb17d08bdbb07eff1a91",
+    "dist/2022-01-28/rustc-beta-x86_64-unknown-linux-musl.tar.xz": "5122a66d96e89e7f31e04604792cd26f7cf687d007d839732ad8ec3c32546014",
+    "dist/2022-01-28/rustc-beta-x86_64-unknown-netbsd.tar.gz": "689e0892a575b507032bf4948319fb0706f3d58da7ac55c40560edfb85fb617b",
+    "dist/2022-01-28/rustc-beta-x86_64-unknown-netbsd.tar.xz": "8b1fda9cb3779af899b6988225a4d89a4b3b5f5ab696c0178c82ea5730f4503d",
+    "dist/2022-01-28/rustfmt-nightly-aarch64-apple-darwin.tar.gz": "d10e91d44175ed8841bfaa0ac36641e5b5fd9f562a69634e1dc8e74937f6b910",
+    "dist/2022-01-28/rustfmt-nightly-aarch64-apple-darwin.tar.xz": "26ddf37786bf057527b1ef72580b09f5ab2954046699e5ea8d773ff833d938c8",
+    "dist/2022-01-28/rustfmt-nightly-aarch64-pc-windows-msvc.tar.gz": "59482a7e368c63812aec689c9b9575c267273c1e2096bcc5a1bb0e4fe87f9703",
+    "dist/2022-01-28/rustfmt-nightly-aarch64-pc-windows-msvc.tar.xz": "b7aae7502c13cff81125b8960b06eb808b1ad51fecc311f7cfb02b5aeed8a0d9",
+    "dist/2022-01-28/rustfmt-nightly-aarch64-unknown-linux-gnu.tar.gz": "28dcc5231402b7c71d0a741878ff0c64fcd37537889f0a0ab5e04fdb2001c3c5",
+    "dist/2022-01-28/rustfmt-nightly-aarch64-unknown-linux-gnu.tar.xz": "24d0e5ef0a8b5c7359243a0ed06801281782ba2fe4ee315ebcc53ce78e84d338",
+    "dist/2022-01-28/rustfmt-nightly-aarch64-unknown-linux-musl.tar.gz": "4f7ed5c1e05a7e903bcbcdccae8da1f296ec182f56c4bd29c38cdee2c022b20a",
+    "dist/2022-01-28/rustfmt-nightly-aarch64-unknown-linux-musl.tar.xz": "c5bbefb41d4ca4f376431d64fb15e250d5dedb8d4ff220f19532fbf7c24fb627",
+    "dist/2022-01-28/rustfmt-nightly-arm-unknown-linux-gnueabi.tar.gz": "ccb65098e45ead43ef62b4b0b10dd552d4cf23786b9639ac665612d458c4eea1",
+    "dist/2022-01-28/rustfmt-nightly-arm-unknown-linux-gnueabi.tar.xz": "5674d7e984b0fbb51e927d991296411cf0da46465eaaf86a58b2ba81d801cc92",
+    "dist/2022-01-28/rustfmt-nightly-arm-unknown-linux-gnueabihf.tar.gz": "a6f868aa17cf4c8734f800451f33bc55d38bf6fe4d658714f469416b86fdf911",
+    "dist/2022-01-28/rustfmt-nightly-arm-unknown-linux-gnueabihf.tar.xz": "acf5681ce5f75bd807aeb23964958d77b5c77a3cabe51d102aeab22c99bd1d24",
+    "dist/2022-01-28/rustfmt-nightly-armv7-unknown-linux-gnueabihf.tar.gz": "e973affc0149d03981875496ae8aea5d7eb5b5a8fcf42380589a3c5f49e7f9f3",
+    "dist/2022-01-28/rustfmt-nightly-armv7-unknown-linux-gnueabihf.tar.xz": "7a00e48bae6d388c0514537429d17b31a316ffddc1bd3d2c6651babec8d2787d",
+    "dist/2022-01-28/rustfmt-nightly-i686-pc-windows-gnu.tar.gz": "e3169c339cd6cd1a9355c4f55281f32ab78e60ccad46129b1848135cdbab1f25",
+    "dist/2022-01-28/rustfmt-nightly-i686-pc-windows-gnu.tar.xz": "0ae17e2d2ad1a03de08f8462c462888e6c72e36d9d7e4737e85ad9890eff3a4e",
+    "dist/2022-01-28/rustfmt-nightly-i686-pc-windows-msvc.tar.gz": "c884249be750942fb19da009dabc296438be4e25c872b548c7cd501135367030",
+    "dist/2022-01-28/rustfmt-nightly-i686-pc-windows-msvc.tar.xz": "8b92f8cf72c3289d4be864dd44ce230ff3098f52b16215464f34451dd16f4b9e",
+    "dist/2022-01-28/rustfmt-nightly-i686-unknown-linux-gnu.tar.gz": "31e97a0e6b1078a2bd78ac92c5861ad5a6dd91c4f819c69e2c07e3941ab893d7",
+    "dist/2022-01-28/rustfmt-nightly-i686-unknown-linux-gnu.tar.xz": "d36fbd52792645198dd0d2b8fd7b5389931e101313ed0c3793370120a58f5ff6",
+    "dist/2022-01-28/rustfmt-nightly-mips-unknown-linux-gnu.tar.gz": "b3384f0e386aa2b77def7cb36906a3fdbc4ada92fab50deb923561cf6043b98a",
+    "dist/2022-01-28/rustfmt-nightly-mips-unknown-linux-gnu.tar.xz": "f728634605fd782ca173c6be41c4ab9eac5b036419e2d33513d1cae197367834",
+    "dist/2022-01-28/rustfmt-nightly-mips64-unknown-linux-gnuabi64.tar.gz": "07404280a97ac98597ced7de15856dc05b855123058984aac3f0b2ab896bccf7",
+    "dist/2022-01-28/rustfmt-nightly-mips64-unknown-linux-gnuabi64.tar.xz": "02de9fa0ee4334af980cd25a4bd467ffbc275ee0871224b84f9549c23f922bc1",
+    "dist/2022-01-28/rustfmt-nightly-mips64el-unknown-linux-gnuabi64.tar.gz": "81bfb88af8c591d32508986d7ff96261b0d84eacb8303f614fcae9095a25fbdb",
+    "dist/2022-01-28/rustfmt-nightly-mips64el-unknown-linux-gnuabi64.tar.xz": "e7bff69f544d999c4b2c27071c049dc092df47431e658a9a8f07c7e2cc08c8d4",
+    "dist/2022-01-28/rustfmt-nightly-mipsel-unknown-linux-gnu.tar.gz": "d1d7081173f89fdd287f6b5010ab5787198c504cba5de4bf54f8473777e20bfa",
+    "dist/2022-01-28/rustfmt-nightly-mipsel-unknown-linux-gnu.tar.xz": "d77625ec03a2e0101fcb743c440dd8e21fdafbd04bb652ee4db6c365e0e0ad49",
+    "dist/2022-01-28/rustfmt-nightly-powerpc-unknown-linux-gnu.tar.gz": "80143957513b49c7d3f4e113e86a9181cda78f2b928f765b3f4060fbd9bf44f7",
+    "dist/2022-01-28/rustfmt-nightly-powerpc-unknown-linux-gnu.tar.xz": "7d9ad14154b99fe9e82e6fd59884b9bc1c3d379c16c376f990dda859d3b86fdf",
+    "dist/2022-01-28/rustfmt-nightly-powerpc64-unknown-linux-gnu.tar.gz": "897629dc734984e2ff984fd911f6b02fb8d3d9e4ac70bb209981226d27800392",
+    "dist/2022-01-28/rustfmt-nightly-powerpc64-unknown-linux-gnu.tar.xz": "9bf72e0f71a81f2afb66ecb5bc242b349d92e8b9f51249f52de172e12281fcfd",
+    "dist/2022-01-28/rustfmt-nightly-powerpc64le-unknown-linux-gnu.tar.gz": "89893ed9bd3c2ec611d54d44aac79379db78dd1c4994747e5a6e55cb779a1d1e",
+    "dist/2022-01-28/rustfmt-nightly-powerpc64le-unknown-linux-gnu.tar.xz": "f7b8ca2f4afcabc178f166161c0c006fe0b8eb16455fa8a2fe7d8429718d65b3",
+    "dist/2022-01-28/rustfmt-nightly-riscv64gc-unknown-linux-gnu.tar.gz": "90aafc241355240df41729288bcd61aeb61c792528570f643f5e9fe34a33ccc6",
+    "dist/2022-01-28/rustfmt-nightly-riscv64gc-unknown-linux-gnu.tar.xz": "7018db141ad7b1960640245034efc233a267b05cc412a7969ccb26d87b46c49d",
+    "dist/2022-01-28/rustfmt-nightly-s390x-unknown-linux-gnu.tar.gz": "b986c3ecf6d5e6683f44efbc24ccb1486e42514c695e3401082c396caf26a69d",
+    "dist/2022-01-28/rustfmt-nightly-s390x-unknown-linux-gnu.tar.xz": "8c4d895c603bb875f24fadef68f0b19b5c390640ee170dcf41bdba07d79a4f03",
+    "dist/2022-01-28/rustfmt-nightly-x86_64-apple-darwin.tar.gz": "7c95e4d7c161eea4af6f59f6ff69829eba791dae1fe18cd2a18a5b2c1fb1190d",
+    "dist/2022-01-28/rustfmt-nightly-x86_64-apple-darwin.tar.xz": "51f32b5abbaefb3590cc174c909ea2b80cb15fc1c2cd6c60e749035d9899c5dc",
+    "dist/2022-01-28/rustfmt-nightly-x86_64-pc-windows-gnu.tar.gz": "aaff3042d48acefad9fd012a7c44148e6503dce61c2eedbd06d025d35d086ff6",
+    "dist/2022-01-28/rustfmt-nightly-x86_64-pc-windows-gnu.tar.xz": "8811d63c78d7b3bd6ee4b7b735fbce58cb13783d1d12b16c6cd584f518934a4b",
+    "dist/2022-01-28/rustfmt-nightly-x86_64-pc-windows-msvc.tar.gz": "7d526137c7437d9d2bdfa8e87790b038b053805e9528a8b8b9c6827d5d0ce64e",
+    "dist/2022-01-28/rustfmt-nightly-x86_64-pc-windows-msvc.tar.xz": "84c8c33267286b65acbb8c1a692d410ee49ebfec708cd3cf35013b76c87ec292",
+    "dist/2022-01-28/rustfmt-nightly-x86_64-unknown-freebsd.tar.gz": "4e52381a3c7acd8435bfcdd45de3a238916985dc7c746615847381b7c2f3fab0",
+    "dist/2022-01-28/rustfmt-nightly-x86_64-unknown-freebsd.tar.xz": "4979e2ca9e1bb42635b0d633b26dcd9d9265698bbe10320daf464243a803d100",
+    "dist/2022-01-28/rustfmt-nightly-x86_64-unknown-illumos.tar.gz": "aea87359d72f23a27bee9763074301d4e4c85c5e91cc1c18c16c8477b52ff9c2",
+    "dist/2022-01-28/rustfmt-nightly-x86_64-unknown-illumos.tar.xz": "6bcf6b03d018964d63c20782d01f8fa832f5f22a8eb719d59c93fc18510804a5",
+    "dist/2022-01-28/rustfmt-nightly-x86_64-unknown-linux-gnu.tar.gz": "651db4ab2e12f46771ca41f1344d145d8163d5fa02b974b0ad07fe011219040c",
+    "dist/2022-01-28/rustfmt-nightly-x86_64-unknown-linux-gnu.tar.xz": "d774f9b51f5a25b32b37b933c898eaa420d51a7ccf0277d1b980ba69a128db59",
+    "dist/2022-01-28/rustfmt-nightly-x86_64-unknown-linux-musl.tar.gz": "39c5c15b939ca8d41af51945e4c9aea6a8011564bfac8e71dee7141a237e7499",
+    "dist/2022-01-28/rustfmt-nightly-x86_64-unknown-linux-musl.tar.xz": "3fd188964c03825728fd6691210a44c715651010305436056977b15a03989b75",
+    "dist/2022-01-28/rustfmt-nightly-x86_64-unknown-netbsd.tar.gz": "835877a13df7d811f5cf6f5d983a43be03a7cf831a0135900e484c1c6cb2da33",
+    "dist/2022-01-28/rustfmt-nightly-x86_64-unknown-netbsd.tar.xz": "616f16ce1e5c4b50a7bc19550886cab1b861d0b925a7fab4b4d73a37e40552ed"
   }
 }
index e32f5ca24ea0f9de389575b53363f89279239cd5..2404b321942890ed841d897e8df1913493b646bb 100644 (file)
@@ -28,67 +28,67 @@ fn syntax() {
     let _ = #[attr] (x as Y);
     let _ =
         #[attr] while true {
-                    #![attr]
-                };
+            #![attr]
+        };
     let _ =
         #[attr] while let Some(false) = true {
-                    #![attr]
-                };
+            #![attr]
+        };
     let _ =
         #[attr] for x in y {
-                    #![attr]
-                };
+            #![attr]
+        };
     let _ =
         #[attr] loop {
-                    #![attr]
-                };
+            #![attr]
+        };
     let _ =
         #[attr] match true {
-                    #![attr]
-                            #[attr]
-                            _ => false,
-                };
+            #![attr]
+                #[attr]
+                _ => false,
+        };
     let _ = #[attr] || #[attr] foo;
     let _ = #[attr] move || #[attr] foo;
     let _ =
         #[attr] ||
-                    #[attr] {
-                                #![attr]
-                                foo
-                            };
+            #[attr] {
+                #![attr]
+                foo
+            };
     let _ =
         #[attr] move ||
-                    #[attr] {
-                                #![attr]
-                                foo
-                            };
+            #[attr] {
+                #![attr]
+                foo
+            };
     let _ =
         #[attr] ||
-                    {
-                        #![attr]
-                        foo
-                    };
+            {
+                #![attr]
+                foo
+            };
     let _ =
         #[attr] move ||
-                    {
-                        #![attr]
-                        foo
-                    };
+            {
+                #![attr]
+                foo
+            };
     let _ =
         #[attr] {
-                    #![attr]
-                };
+            #![attr]
+        };
     let _ =
         #[attr] {
-                    #![attr]
-                    let _ = ();
-                };
+            #![attr]
+            let _ = ();
+        };
     let _ =
         #[attr] {
-                    #![attr]
-                    let _ = ();
-                    foo
-                };
+            #![attr]
+            let _ = ();
+            foo
+        };
     let _ = #[attr] x = y;
     let _ = #[attr] (x = y);
     let _ = #[attr] x += y;
index 385afa4f33ec115675e6ab531990b5847281a4cb..8c8580b07c218873f5bb8672289ed5853e1c8cca 100644 (file)
@@ -93,9 +93,9 @@ fn main() {
     // Taken from https://www.unicode.org/Public/UNIDATA/PropList.txt
     let chars =
         ['\x0A', '\x0B', '\x0C', '\x0D', '\x20', '\u{85}', '\u{A0}',
-         '\u{1680}', '\u{2000}', '\u{2001}', '\u{2002}', '\u{2003}',
-         '\u{2004}', '\u{2005}', '\u{2006}', '\u{2007}', '\u{2008}',
-         '\u{2009}', '\u{200A}', '\u{2028}', '\u{2029}', '\u{202F}',
-         '\u{205F}', '\u{3000}'];
+                '\u{1680}', '\u{2000}', '\u{2001}', '\u{2002}', '\u{2003}',
+                '\u{2004}', '\u{2005}', '\u{2006}', '\u{2007}', '\u{2008}',
+                '\u{2009}', '\u{200A}', '\u{2028}', '\u{2029}', '\u{202F}',
+                '\u{205F}', '\u{3000}'];
     for c in &chars { let ws = c.is_whitespace(); println!("{} {}", c, ws); }
 }
index 1137d8045648920697911ee34dd97200170c9b91..c7c9277faf69ebc18e01474ece4237c20f6cfb93 100644 (file)
@@ -17,9 +17,9 @@ fn clone() -> S
 
 mac! {
     a(aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa
-      aaaaaaaa aaaaaaaa) a
+    aaaaaaaa aaaaaaaa) a
     [aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa
-     aaaaaaaa aaaaaaaa] a
+    aaaaaaaa aaaaaaaa] a
     {
         aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa
         aaaaaaaa aaaaaaaa aaaaaaaa
@@ -27,22 +27,22 @@ fn clone() -> S
 }
 
 mac!(aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa
-     aaaaaaaa aaaaaaaa);
+aaaaaaaa aaaaaaaa);
 mac![aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa
-     aaaaaaaa aaaaaaaa];
+aaaaaaaa aaaaaaaa];
 mac! {
     aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa
     aaaaaaaa aaaaaaaa
 }
 
 #[rustc_dummy(aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa
-              aaaaaaaa aaaaaaaa aaaaaaaa)]
+aaaaaaaa aaaaaaaa aaaaaaaa)]
 #[rustc_dummy[aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa
-              aaaaaaaa aaaaaaaa aaaaaaaa]]
+aaaaaaaa aaaaaaaa aaaaaaaa]]
 #[rustc_dummy {
-      aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa
-      aaaaaaaa aaaaaaaa
-  }]
+    aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa
+    aaaaaaaa aaaaaaaa
+}]
 #[rustc_dummy =
-  "aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa"]
+"aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa"]
 fn main() {}
index 93967e720c1b0b5de1c582c06eabd013313bdc75..3830c3aa6c9f191beb7a50ba2499d18b3a31a03c 100644 (file)
@@ -11,15 +11,15 @@ extern crate std;
 pub fn foo(_: [i32; (3 as usize)]) ({ } as ())
 
 pub fn bar() ({
-                  const FOO: usize = ((5 as usize) - (4 as usize) as usize);
-                  let _: [(); (FOO as usize)] = ([(() as ())] as [(); 1]);
+        const FOO: usize = ((5 as usize) - (4 as usize) as usize);
+        let _: [(); (FOO as usize)] = ([(() as ())] as [(); 1]);
 
-                  let _: [(); (1 as usize)] = ([(() as ())] as [(); 1]);
+        let _: [(); (1 as usize)] = ([(() as ())] as [(); 1]);
 
-                  let _ =
-                      (((&([(1 as i32), (2 as i32), (3 as i32)] as [i32; 3])
-                            as &[i32; 3]) as *const _ as *const [i32; 3]) as
-                          *const [i32; (3 as usize)] as *const [i32; 3]);
+        let _ =
+            (((&([(1 as i32), (2 as i32), (3 as i32)] as [i32; 3]) as
+                        &[i32; 3]) as *const _ as *const [i32; 3]) as
+                *const [i32; (3 as usize)] as *const [i32; 3]);
 
 
 
@@ -29,29 +29,19 @@ pub fn bar() ({
 
 
 
-                  ({
-                       let res =
-                           ((::alloc::fmt::format as
-                                for<'r> fn(Arguments<'r>) -> String {format})(((::core::fmt::Arguments::new_v1
-                                                                                   as
-                                                                                   fn(&[&'static str], &[ArgumentV1]) -> Arguments {Arguments::new_v1})((&([("test"
-                                                                                                                                                                as
-                                                                                                                                                                &str)]
-                                                                                                                                                              as
-                                                                                                                                                              [&str; 1])
-                                                                                                                                                            as
-                                                                                                                                                            &[&str; 1]),
-                                                                                                                                                        (&([]
-                                                                                                                                                              as
-                                                                                                                                                              [ArgumentV1; 0])
-                                                                                                                                                            as
-                                                                                                                                                            &[ArgumentV1; 0]))
-                                                                                  as
-                                                                                  Arguments))
-                               as String);
-                       (res as String)
-                   } as String);
-              } as ())
+        ({
+                let res =
+                    ((::alloc::fmt::format as
+                            for<'r> fn(Arguments<'r>) -> String {format})(((::core::fmt::Arguments::new_v1
+                                as
+                                fn(&[&'static str], &[ArgumentV1]) -> Arguments {Arguments::new_v1})((&([("test"
+                                            as &str)] as [&str; 1]) as
+                                &[&str; 1]),
+                            (&([] as [ArgumentV1; 0]) as &[ArgumentV1; 0])) as
+                            Arguments)) as String);
+                (res as String)
+            } as String);
+    } as ())
 pub type Foo = [i32; (3 as usize)];
 pub struct Bar {
     pub x: [i32; (3 as usize)],
@@ -60,19 +50,9 @@ pub struct TupleBar([i32; (4 as usize)]);
 pub enum Baz { BazVariant([i32; (5 as usize)]), }
 pub fn id<T>(x: T) -> T ({ (x as T) } as T)
 pub fn use_id() ({
-                     let _ =
-                         ((id::<[i32; (3 as usize)]> as
-                              fn([i32; 3]) -> [i32; 3] {id::<[i32; 3]>})(([(1
-                                                                               as
-                                                                               i32),
-                                                                           (2
-                                                                               as
-                                                                               i32),
-                                                                           (3
-                                                                               as
-                                                                               i32)]
-                                                                             as
-                                                                             [i32; 3]))
-                             as [i32; 3]);
-                 } as ())
+        let _ =
+            ((id::<[i32; (3 as usize)]> as
+                    fn([i32; 3]) -> [i32; 3] {id::<[i32; 3]>})(([(1 as i32),
+                        (2 as i32), (3 as i32)] as [i32; 3])) as [i32; 3]);
+    } as ())
 fn main() ({ } as ())
index ed7879001d5598df74797deeb9d6ac73db3a5b01..87f525a6178e63ac6eb4c805a4d4cb5ef5440252 100644 (file)
@@ -9,8 +9,8 @@ struct C {
 #[allow()]
 const C: C =
     C{
-      #[cfg(debug_assertions)]
-      field: 0,
+        #[cfg(debug_assertions)]
+        field: 0,
 
-      #[cfg(not(debug_assertions))]
-      field: 1,};
+        #[cfg(not(debug_assertions))]
+        field: 1,};
index fb66e4a7758420962926977cb859dcfc997243b5..01adb14133b3536f5cdf42715c8fec0217398de2 100644 (file)
@@ -12,8 +12,8 @@ macro_rules! matcher_brackets {
 
 macro_rules! all_fragments {
     ($b : block, $e : expr, $i : ident, $it : item, $l : lifetime, $lit :
-     literal, $m : meta, $p : pat, $pth : path, $s : stmt, $tt : tt, $ty : ty,
-     $vis : vis) => {} ;
+    literal, $m : meta, $p : pat, $pth : path, $s : stmt, $tt : tt, $ty : ty,
+    $vis : vis) => {} ;
 }
 
 fn main() {}
index a124fdff3900dfce3ac9cafa3b6c6bafd85aa629..836af99002d65cd0282c00c8f1b52944e6b8530d 100644 (file)
@@ -5,10 +5,10 @@ fn main() {
     let _y =
         match x {
             Some(_) =>
-            ["some(_)".to_string(), "not".to_string(), "SO".to_string(),
-             "long".to_string(), "string".to_string()],
+                ["some(_)".to_string(), "not".to_string(), "SO".to_string(),
+                        "long".to_string(), "string".to_string()],
             None =>
-            ["none".to_string(), "a".to_string(), "a".to_string(),
-             "a".to_string(), "a".to_string()],
+                ["none".to_string(), "a".to_string(), "a".to_string(),
+                        "a".to_string(), "a".to_string()],
         };
 }
index 01533cd8107b07e95890c0399a6dcecaef8883b1..96bde96200af9a3312a1067a290b8330eec8108a 100644 (file)
@@ -48,9 +48,9 @@ fn _4() {
 
     let _ =
         #[rustc_dummy] match () {
-                           #![rustc_dummy]
-                           () => (),
-                       };
+            #![rustc_dummy]
+            () => (),
+        };
 }
 
 fn _5() {
@@ -156,56 +156,56 @@ fn _11() {
     let _ = #[rustc_dummy] 0 as usize;
     let _ =
         #[rustc_dummy] while false {
-                           #![rustc_dummy]
-                       };
+            #![rustc_dummy]
+        };
     let _ =
         #[rustc_dummy] while let None = Some(()) {
-                           #![rustc_dummy]
-                       };
+            #![rustc_dummy]
+        };
     let _ =
         #[rustc_dummy] for _ in 0..0 {
-                           #![rustc_dummy]
-                       };
+            #![rustc_dummy]
+        };
     let _ =
         #[rustc_dummy] loop {
-                           #![rustc_dummy]
-                       };
+            #![rustc_dummy]
+        };
     let _ =
         #[rustc_dummy] match false {
-                           #![rustc_dummy]
-                           _ => (),
-                       };
+            #![rustc_dummy]
+            _ => (),
+        };
     let _ = #[rustc_dummy] || #[rustc_dummy] ();
     let _ = #[rustc_dummy] move || #[rustc_dummy] ();
     let _ =
         #[rustc_dummy] ||
-                           {
-                               #![rustc_dummy]
-                               #[rustc_dummy]
-                               ()
-                           };
+            {
+                #![rustc_dummy]
+                #[rustc_dummy]
+                ()
+            };
     let _ =
         #[rustc_dummy] move ||
-                           {
-                               #![rustc_dummy]
-                               #[rustc_dummy]
-                               ()
-                           };
+            {
+                #![rustc_dummy]
+                #[rustc_dummy]
+                ()
+            };
     let _ =
         #[rustc_dummy] {
-                           #![rustc_dummy]
-                       };
+            #![rustc_dummy]
+        };
     let _ =
         #[rustc_dummy] {
-                           #![rustc_dummy]
-                           let _ = ();
-                       };
+            #![rustc_dummy]
+            let _ = ();
+        };
     let _ =
         #[rustc_dummy] {
-                           #![rustc_dummy]
-                           let _ = ();
-                           ()
-                       };
+            #![rustc_dummy]
+            let _ = ();
+            ()
+        };
     let mut x = 0;
     let _ = #[rustc_dummy] x = 15;
     let _ = #[rustc_dummy] x += 15;
index a150cf0b8ea8ae5e8af24666be225c972010a6ab..f2f807c59de99cf9b184476aa7940041a2c3e5a7 100644 (file)
@@ -4,26 +4,26 @@
 fn main() {
     let _v1 =
         [
-         // Comment
-         0,
-         // Comment
-         1,
-         // Comment
-         2];
+                // Comment
+                0,
+                // Comment
+                1,
+                // Comment
+                2];
     let _v2 =
         [0, // Comment
-         1, // Comment
-         2]; // Comment
+                1, // Comment
+                2]; // Comment
     let _v3 =
         [
-         /* Comment */
-         0,
-         /* Comment */
-         1,
-         /* Comment */
-         2];
+                /* Comment */
+                0,
+                /* Comment */
+                1,
+                /* Comment */
+                2];
     let _v4 =
         [0, /* Comment */
-         1, /* Comment */
-         2]; /* Comment */
+                1, /* Comment */
+                2]; /* Comment */
 }
index 7eb393bb4481f0d6aae1e37a3ab7eee30dba2556..e463099a5ee4795186d28aab4710755993fabb4e 100644 (file)
@@ -29,8 +29,8 @@
    29|      1|    some_string = Some(String::from("the string content"));
    30|      1|    let
    31|      1|        a
-   32|       |    =
-   33|       |        ||
+   32|      1|    =
+   33|      1|        ||
    34|      0|    {
    35|      0|        let mut countdown = 0;
    36|      0|        if is_false {
   116|      1|
   117|      1|    let
   118|      1|        _unused_closure
-  119|      1|    =
-  120|      1|        |
+  119|       |    =
+  120|       |        |
   121|       |            mut countdown
   122|       |        |
   123|      0|    {
index 768dcb2f6084cdc36abe9452ec3e499d3fb6747f..c2d5143a61816f881992c53bf2c3fa2a412201dc 100644 (file)
    18|      2|    println!("used_only_from_bin_crate_generic_function with {:?}", arg);
    19|      2|}
   ------------------
-  | used_crate::used_only_from_bin_crate_generic_function::<&alloc::vec::Vec<i32>>:
+  | used_crate::used_only_from_bin_crate_generic_function::<&str>:
   |   17|      1|pub fn used_only_from_bin_crate_generic_function<T: Debug>(arg: T) {
   |   18|      1|    println!("used_only_from_bin_crate_generic_function with {:?}", arg);
   |   19|      1|}
   ------------------
-  | used_crate::used_only_from_bin_crate_generic_function::<&str>:
+  | used_crate::used_only_from_bin_crate_generic_function::<&alloc::vec::Vec<i32>>:
   |   17|      1|pub fn used_only_from_bin_crate_generic_function<T: Debug>(arg: T) {
   |   18|      1|    println!("used_only_from_bin_crate_generic_function with {:?}", arg);
   |   19|      1|}
    22|      2|    println!("used_only_from_this_lib_crate_generic_function with {:?}", arg);
    23|      2|}
   ------------------
-  | used_crate::used_only_from_this_lib_crate_generic_function::<alloc::vec::Vec<i32>>:
+  | used_crate::used_only_from_this_lib_crate_generic_function::<&str>:
   |   21|      1|pub fn used_only_from_this_lib_crate_generic_function<T: Debug>(arg: T) {
   |   22|      1|    println!("used_only_from_this_lib_crate_generic_function with {:?}", arg);
   |   23|      1|}
   ------------------
-  | used_crate::used_only_from_this_lib_crate_generic_function::<&str>:
+  | used_crate::used_only_from_this_lib_crate_generic_function::<alloc::vec::Vec<i32>>:
   |   21|      1|pub fn used_only_from_this_lib_crate_generic_function<T: Debug>(arg: T) {
   |   22|      1|    println!("used_only_from_this_lib_crate_generic_function with {:?}", arg);
   |   23|      1|}
index 89636294035df53dcdd8167e3e0aa08982b18171..dab31cbf4ac9eef4770d4c4a0b292c5da3f0aa25 100644 (file)
    40|      2|    println!("used_only_from_bin_crate_generic_function with {:?}", arg);
    41|      2|}
   ------------------
-  | used_inline_crate::used_only_from_bin_crate_generic_function::<&str>:
+  | used_inline_crate::used_only_from_bin_crate_generic_function::<&alloc::vec::Vec<i32>>:
   |   39|      1|pub fn used_only_from_bin_crate_generic_function<T: Debug>(arg: T) {
   |   40|      1|    println!("used_only_from_bin_crate_generic_function with {:?}", arg);
   |   41|      1|}
   ------------------
-  | used_inline_crate::used_only_from_bin_crate_generic_function::<&alloc::vec::Vec<i32>>:
+  | used_inline_crate::used_only_from_bin_crate_generic_function::<&str>:
   |   39|      1|pub fn used_only_from_bin_crate_generic_function<T: Debug>(arg: T) {
   |   40|      1|    println!("used_only_from_bin_crate_generic_function with {:?}", arg);
   |   41|      1|}
    46|      4|    println!("used_only_from_this_lib_crate_generic_function with {:?}", arg);
    47|      4|}
   ------------------
-  | used_inline_crate::used_only_from_this_lib_crate_generic_function::<&str>:
+  | used_inline_crate::used_only_from_this_lib_crate_generic_function::<alloc::vec::Vec<i32>>:
   |   45|      2|pub fn used_only_from_this_lib_crate_generic_function<T: Debug>(arg: T) {
   |   46|      2|    println!("used_only_from_this_lib_crate_generic_function with {:?}", arg);
   |   47|      2|}
   ------------------
-  | used_inline_crate::used_only_from_this_lib_crate_generic_function::<alloc::vec::Vec<i32>>:
+  | used_inline_crate::used_only_from_this_lib_crate_generic_function::<&str>:
   |   45|      2|pub fn used_only_from_this_lib_crate_generic_function<T: Debug>(arg: T) {
   |   46|      2|    println!("used_only_from_this_lib_crate_generic_function with {:?}", arg);
   |   47|      2|}
index acde112392521caf3be383a9c11ce7c76d4ece7d..8f9c9248f5ff1e4edf132b60ad222a92e9c80cd4 100644 (file)
@@ -2,6 +2,8 @@
 goto: file://|DOC_PATH|/staged_api/struct.Foo.html
 size: (400, 600)
 
+font-size: 18
+
 // The out-of-band info (source, stable version, collapse) should be below the
 // h1 when the screen gets narrow enough.
 assert-css: (".main-heading", {
@@ -9,6 +11,8 @@ assert-css: (".main-heading", {
   "flex-direction": "column"
 })
 
+assert-property: (".mobile-topbar h2.location", {"offsetHeight": 45})
+
 // Note: We can't use assert-text here because the 'Since' is set by CSS and
 // is therefore not part of the DOM.
 assert-css: (".content .out-of-band .since::before", { "content": "\"Since \"" })
index 680822b6ecb8c075eb457b4f43ac3388e184cddd..60bcffe120beca8385c09f91fdd79427f077b9d2 100644 (file)
@@ -35,3 +35,8 @@ assert-property: (".mobile-topbar", {"clientHeight": "45"})
 click: ".sidebar-menu-toggle"
 click: ".sidebar-links a"
 assert-position: ("#method\.must_use", {"y": 45})
+
+// Check that the bottom-most item on the sidebar menu can be scrolled fully into view.
+click: ".sidebar-menu-toggle"
+scroll-to: ".block.keyword li:nth-child(1)"
+assert-position: (".block.keyword li:nth-child(1)", {"y": 542.96875})
index 60d089ffa37587db122cb160b08dcd966d56d34d..73edee64e4372040593e737ba421fe7bcfc0c850 100644 (file)
@@ -9,3 +9,19 @@ click: "#theme-choices > button:last-child"
 wait-for: 500
 // should be the light theme so let's check the color
 assert-css: ("body", { "background-color": "rgb(255, 255, 255)" })
+
+goto: file://|DOC_PATH|/settings.html
+click: "#theme-light"
+wait-for: 500
+assert-css: ("body", { "background-color": "rgb(255, 255, 255)" })
+assert-local-storage: { "rustdoc-theme": "light" }
+
+click: "#theme-dark"
+wait-for: 500
+assert-css: ("body", { "background-color": "rgb(53, 53, 53)" })
+assert-local-storage: { "rustdoc-theme": "dark" }
+
+click: "#theme-ayu"
+wait-for: 500
+assert-css: ("body", { "background-color": "rgb(15, 20, 25)" })
+assert-local-storage: { "rustdoc-theme": "ayu" }
diff --git a/src/test/rustdoc-gui/theme-in-history.goml b/src/test/rustdoc-gui/theme-in-history.goml
new file mode 100644 (file)
index 0000000..b537991
--- /dev/null
@@ -0,0 +1,25 @@
+// Ensures that the theme is working when going back in history.
+goto: file://|DOC_PATH|/test_docs/index.html
+// Set the theme to dark.
+local-storage: {"rustdoc-theme": "dark", "rustdoc-preferred-dark-theme": "dark", "rustdoc-use-system-theme": "false"}
+// We reload the page so the local storage settings are being used.
+reload:
+assert-css: ("body", { "background-color": "rgb(53, 53, 53)" })
+assert-local-storage: { "rustdoc-theme": "dark" }
+
+// Now we go to the settings page.
+click: "#settings-menu"
+wait-for: ".settings"
+// We change the theme to "light".
+click: "#theme-light"
+wait-for: 250
+assert-css: ("body", { "background-color": "rgb(255, 255, 255)" })
+assert-local-storage: { "rustdoc-theme": "light" }
+
+// We go back in history.
+history-go-back:
+// Confirm that we're not on the settings page.
+assert-false: ".settings"
+// Check that the current theme is still "light".
+assert-css: ("body", { "background-color": "rgb(255, 255, 255)" })
+assert-local-storage: { "rustdoc-theme": "light" }
index c35b38747dfaf087c94095046b994e79a97c4ba2..229c6d6ba6b9682f454fb5af4baa1d7b3c903d54 100644 (file)
@@ -31,6 +31,6 @@ assert-property: (".item-decl pre", {"scrollWidth": "950"})
 // On mobile:
 size: (600, 600)
 goto: file://|DOC_PATH|/lib2/too_long/struct.SuperIncrediblyLongLongLongLongLongLongLongGigaGigaGigaMegaLongLongLongStructName.html
-assert-property: (".mobile-topbar .location", {"scrollWidth": "504"})
+assert-property: (".mobile-topbar .location", {"scrollWidth": "986"})
 assert-property: (".mobile-topbar .location", {"clientWidth": "504"})
 assert-css: (".mobile-topbar .location", {"overflow-x": "hidden"})
diff --git a/src/test/rustdoc/intra-doc/crate-relative.rs b/src/test/rustdoc/intra-doc/crate-relative.rs
new file mode 100644 (file)
index 0000000..bacbcab
--- /dev/null
@@ -0,0 +1,13 @@
+pub struct Test<'a> {
+    data: &'a (),
+}
+
+impl<'a> Test<'a> {
+    pub fn do_test(&self) {}
+}
+
+// @has crate_relative/demo/index.html
+// @has - '//a/@href' '../struct.Test.html#method.do_test'
+pub mod demo {
+    //! [`crate::Test::do_test`]
+}
diff --git a/src/test/rustdoc/intra-doc/mod-relative.rs b/src/test/rustdoc/intra-doc/mod-relative.rs
new file mode 100644 (file)
index 0000000..49d3399
--- /dev/null
@@ -0,0 +1,17 @@
+pub mod wrapper {
+
+    pub struct Test<'a> {
+        data: &'a (),
+    }
+
+    impl<'a> Test<'a> {
+        pub fn do_test(&self) {}
+    }
+
+    // @has mod_relative/wrapper/demo/index.html
+    // @has - '//a/@href' '../struct.Test.html#method.do_test'
+    /// [`Test::do_test`]
+    pub mod demo {
+    }
+
+}
diff --git a/src/test/rustdoc/macro-generated-macro.macro_linebreak_pre.html b/src/test/rustdoc/macro-generated-macro.macro_linebreak_pre.html
new file mode 100644 (file)
index 0000000..ce5d3a8
--- /dev/null
@@ -0,0 +1,6 @@
+macro_rules! linebreak {
+    (
+        <= 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
+        26 27 28 =>
+    ) => { ... };
+}
\ No newline at end of file
diff --git a/src/test/rustdoc/macro-generated-macro.macro_morestuff_pre.html b/src/test/rustdoc/macro-generated-macro.macro_morestuff_pre.html
new file mode 100644 (file)
index 0000000..28f1552
--- /dev/null
@@ -0,0 +1,15 @@
+macro_rules! morestuff {
+    (
+        <= "space between most kinds of tokens" : 1 $x + @ :: >>= 'static
+        "no space inside paren or bracket" : (2 a) [2 a] $(2 $a:tt)*
+        "space inside curly brace" : { 2 a }
+        "no space inside empty delimiters" : () [] {}
+        "no space before comma or semicolon" : a, (a), { a }, a; [T; 0];
+        "the three repetition specifiers" : $(@)*, $(@)+, $(@)?
+        "repetition separators" : $(@)|*, $(@)|+, $(@)==*, $(@)static*
+        "plus or star cannot be a repetition separator" : $(@)+ * $(@)* +
+        "no space between ident and paren" : let _ = f(0) + f[0] + Struct {};
+        "space between keyword and paren" : return (a,) & for x in (..)
+        "some special case keywords" : pub(crate), fn() -> u8, Self(0, 0) =>
+    ) => { ... };
+}
\ No newline at end of file
index 25d8bc3ec62817243fcb29657566ea1b89b2a0d1..1a423cac1b5cacfaec09273972997ced38adc115 100644 (file)
@@ -1,14 +1,39 @@
-macro_rules! outer {
-    ($($matcher:tt)*) => {
+macro_rules! make_macro {
+    ($macro_name:ident $($matcher:tt)*) => {
         #[macro_export]
-        macro_rules! inner {
+        macro_rules! $macro_name {
             (<= $($matcher)* =>) => {};
         }
     }
 }
 
-// @has macro_generated_macro/macro.inner.html //pre 'macro_rules! inner {'
-// @has - //pre '(<= type $($i : ident) :: * + $e : expr =>) => { ... };'
-outer!(type $($i:ident)::* + $e:expr);
+// @has macro_generated_macro/macro.interpolations.html //pre 'macro_rules! interpolations {'
+// @has - //pre '(<= type $($i:ident)::* + $e:expr =>) => { ... };'
+make_macro!(interpolations type $($i:ident)::* + $e:expr);
+interpolations!(<= type foo::bar + x.sort() =>);
 
-inner!(<= type foo::bar + x.sort() =>);
+// @has macro_generated_macro/macro.attributes.html //pre 'macro_rules! attributes {'
+// @has - //pre '(<= #![no_std] #[cfg(feature = "alloc")] =>) => { ... };'
+make_macro!(attributes #![no_std] #[cfg(feature = "alloc")]);
+
+// @has macro_generated_macro/macro.groups.html //pre 'macro_rules! groups {'
+// @has - //pre '(<= fn {} () { foo[0] } =>) => { ... };'
+make_macro!(groups fn {}() {foo[0]});
+
+// @snapshot macro_linebreak_pre macro_generated_macro/macro.linebreak.html //pre/text()
+make_macro!(linebreak 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28);
+
+// @snapshot macro_morestuff_pre macro_generated_macro/macro.morestuff.html //pre/text()
+make_macro!(morestuff
+    "space between most kinds of tokens": 1 $x + @ :: >>= 'static
+    "no space inside paren or bracket": (2 a) [2 a] $(2 $a:tt)*
+    "space inside curly brace": { 2 a }
+    "no space inside empty delimiters": () [] {}
+    "no space before comma or semicolon": a, (a), { a }, a; [T; 0];
+    "the three repetition specifiers": $(@)*, $(@)+, $(@)?
+    "repetition separators": $(@)|*, $(@)|+, $(@)==*, $(@)static*
+    "plus or star cannot be a repetition separator": $(@)+ * $(@)* +
+    "no space between ident and paren": let _ = f(0) + f[0] + Struct {};
+    "space between keyword and paren": return (a,) & for x in (..)
+    "some special case keywords": pub(crate), fn() -> u8, Self(0, 0)
+);
diff --git a/src/test/rustdoc/version-separator-without-source.rs b/src/test/rustdoc/version-separator-without-source.rs
new file mode 100644 (file)
index 0000000..bffe503
--- /dev/null
@@ -0,0 +1,23 @@
+#![doc(html_no_source)]
+#![feature(staged_api)]
+#![stable(feature = "bar", since = "1.0")]
+#![crate_name = "foo"]
+
+// @has foo/fn.foo.html
+// @has - '//div[@class="main-heading"]/*[@class="out-of-band"]' '1.0 Â· '
+// @!has - '//div[@class="main-heading"]/*[@class="out-of-band"]' '1.0 Â· source Â· '
+#[stable(feature = "bar", since = "1.0")]
+pub fn foo() {}
+
+// @has foo/struct.Bar.html
+// @has - '//div[@class="main-heading"]/*[@class="out-of-band"]' '1.0 Â· '
+// @!has - '//div[@class="main-heading"]/*[@class="out-of-band"]' '1.0 Â· source Â· '
+#[stable(feature = "bar", since = "1.0")]
+pub struct Bar;
+
+impl Bar {
+    // @has - '//div[@id="method.bar"]/*[@class="rightside"]' '2.0'
+    // @!has - '//div[@id="method.bar"]/*[@class="rightside"]' '2.0 Â·'
+    #[stable(feature = "foobar", since = "2.0")]
+    pub fn bar() {}
+}
index b8ff42d86b5646de8c8f33fb9a62eac021e10663..001601497a2720f617c16ae8bc4eec8b7deeb3ac 100644 (file)
@@ -6,6 +6,7 @@ LL |         asm!("bar: nop");
    |
    = note: `#[deny(named_asm_labels)]` on by default
    = help: only local labels of the form `<number>:` should be used in inline asm
+   = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information
 
 error: avoid using named labels in inline assembly
   --> $DIR/named-asm-labels.rs:27:15
@@ -14,6 +15,7 @@ LL |         asm!("abcd:");
    |               ^^^^
    |
    = help: only local labels of the form `<number>:` should be used in inline asm
+   = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information
 
 error: avoid using named labels in inline assembly
   --> $DIR/named-asm-labels.rs:30:15
@@ -22,6 +24,7 @@ LL |         asm!("foo: bar1: nop");
    |               ^^^  ^^^^
    |
    = help: only local labels of the form `<number>:` should be used in inline asm
+   = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information
 
 error: avoid using named labels in inline assembly
   --> $DIR/named-asm-labels.rs:34:15
@@ -30,6 +33,7 @@ LL |         asm!("foo1: nop", "nop");
    |               ^^^^
    |
    = help: only local labels of the form `<number>:` should be used in inline asm
+   = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information
 
 error: avoid using named labels in inline assembly
   --> $DIR/named-asm-labels.rs:35:15
@@ -38,6 +42,7 @@ LL |         asm!("foo2: foo3: nop", "nop");
    |               ^^^^  ^^^^
    |
    = help: only local labels of the form `<number>:` should be used in inline asm
+   = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information
 
 error: avoid using named labels in inline assembly
   --> $DIR/named-asm-labels.rs:37:22
@@ -46,6 +51,7 @@ LL |         asm!("nop", "foo4: nop");
    |                      ^^^^
    |
    = help: only local labels of the form `<number>:` should be used in inline asm
+   = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information
 
 error: avoid using named labels in inline assembly
   --> $DIR/named-asm-labels.rs:38:15
@@ -54,6 +60,7 @@ LL |         asm!("foo5: nop", "foo6: nop");
    |               ^^^^
    |
    = help: only local labels of the form `<number>:` should be used in inline asm
+   = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information
 
 error: avoid using named labels in inline assembly
   --> $DIR/named-asm-labels.rs:38:28
@@ -62,6 +69,7 @@ LL |         asm!("foo5: nop", "foo6: nop");
    |                            ^^^^
    |
    = help: only local labels of the form `<number>:` should be used in inline asm
+   = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information
 
 error: avoid using named labels in inline assembly
   --> $DIR/named-asm-labels.rs:43:15
@@ -70,6 +78,7 @@ LL |         asm!("foo7: nop; foo8: nop");
    |               ^^^^       ^^^^
    |
    = help: only local labels of the form `<number>:` should be used in inline asm
+   = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information
 
 error: avoid using named labels in inline assembly
   --> $DIR/named-asm-labels.rs:45:15
@@ -78,6 +87,7 @@ LL |         asm!("foo9: nop; nop");
    |               ^^^^
    |
    = help: only local labels of the form `<number>:` should be used in inline asm
+   = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information
 
 error: avoid using named labels in inline assembly
   --> $DIR/named-asm-labels.rs:46:20
@@ -86,6 +96,7 @@ LL |         asm!("nop; foo10: nop");
    |                    ^^^^^
    |
    = help: only local labels of the form `<number>:` should be used in inline asm
+   = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information
 
 error: avoid using named labels in inline assembly
   --> $DIR/named-asm-labels.rs:49:15
@@ -94,6 +105,7 @@ LL |         asm!("bar2: nop\n bar3: nop");
    |               ^^^^        ^^^^
    |
    = help: only local labels of the form `<number>:` should be used in inline asm
+   = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information
 
 error: avoid using named labels in inline assembly
   --> $DIR/named-asm-labels.rs:51:15
@@ -102,6 +114,7 @@ LL |         asm!("bar4: nop\n nop");
    |               ^^^^
    |
    = help: only local labels of the form `<number>:` should be used in inline asm
+   = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information
 
 error: avoid using named labels in inline assembly
   --> $DIR/named-asm-labels.rs:52:21
@@ -110,6 +123,7 @@ LL |         asm!("nop\n bar5: nop");
    |                     ^^^^
    |
    = help: only local labels of the form `<number>:` should be used in inline asm
+   = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information
 
 error: avoid using named labels in inline assembly
   --> $DIR/named-asm-labels.rs:53:21
@@ -118,6 +132,7 @@ LL |         asm!("nop\n bar6: bar7: nop");
    |                     ^^^^  ^^^^
    |
    = help: only local labels of the form `<number>:` should be used in inline asm
+   = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information
 
 error: avoid using named labels in inline assembly
   --> $DIR/named-asm-labels.rs:59:13
@@ -128,6 +143,7 @@ LL |             blah3: nop
    |             ^^^^^
    |
    = help: only local labels of the form `<number>:` should be used in inline asm
+   = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information
 
 error: avoid using named labels in inline assembly
   --> $DIR/named-asm-labels.rs:68:19
@@ -136,6 +152,7 @@ LL |             nop ; blah4: nop
    |                   ^^^^^
    |
    = help: only local labels of the form `<number>:` should be used in inline asm
+   = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information
 
 error: avoid using named labels in inline assembly
   --> $DIR/named-asm-labels.rs:82:15
@@ -144,6 +161,7 @@ LL |         asm!("blah1: 2bar: nop");
    |               ^^^^^
    |
    = help: only local labels of the form `<number>:` should be used in inline asm
+   = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information
 
 error: avoid using named labels in inline assembly
   --> $DIR/named-asm-labels.rs:85:15
@@ -152,6 +170,7 @@ LL |         asm!("def: def: nop");
    |               ^^^
    |
    = help: only local labels of the form `<number>:` should be used in inline asm
+   = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information
 
 error: avoid using named labels in inline assembly
   --> $DIR/named-asm-labels.rs:86:15
@@ -160,6 +179,7 @@ LL |         asm!("def: nop\ndef: nop");
    |               ^^^
    |
    = help: only local labels of the form `<number>:` should be used in inline asm
+   = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information
 
 error: avoid using named labels in inline assembly
   --> $DIR/named-asm-labels.rs:87:15
@@ -168,6 +188,7 @@ LL |         asm!("def: nop; def: nop");
    |               ^^^
    |
    = help: only local labels of the form `<number>:` should be used in inline asm
+   = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information
 
 error: avoid using named labels in inline assembly
   --> $DIR/named-asm-labels.rs:95:15
@@ -176,6 +197,7 @@ LL |         asm!("fooo\u{003A} nop");
    |               ^^^^^^^^^^^^^^^^
    |
    = help: only local labels of the form `<number>:` should be used in inline asm
+   = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information
 
 error: avoid using named labels in inline assembly
   --> $DIR/named-asm-labels.rs:96:15
@@ -184,6 +206,7 @@ LL |         asm!("foooo\x3A nop");
    |               ^^^^^^^^^^^^^
    |
    = help: only local labels of the form `<number>:` should be used in inline asm
+   = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information
 
 error: avoid using named labels in inline assembly
   --> $DIR/named-asm-labels.rs:99:15
@@ -192,6 +215,7 @@ LL |         asm!("fooooo:\u{000A} nop");
    |               ^^^^^^
    |
    = help: only local labels of the form `<number>:` should be used in inline asm
+   = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information
 
 error: avoid using named labels in inline assembly
   --> $DIR/named-asm-labels.rs:100:15
@@ -200,6 +224,7 @@ LL |         asm!("foooooo:\x0A nop");
    |               ^^^^^^^
    |
    = help: only local labels of the form `<number>:` should be used in inline asm
+   = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information
 
 error: avoid using named labels in inline assembly
   --> $DIR/named-asm-labels.rs:104:14
@@ -208,6 +233,7 @@ LL |         asm!("\x41\x42\x43\x3A\x20\x6E\x6F\x70");
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: only local labels of the form `<number>:` should be used in inline asm
+   = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information
 
 error: avoid using named labels in inline assembly
   --> $DIR/named-asm-labels.rs:112:13
@@ -216,6 +242,7 @@ LL |             ab: nop // ab: does foo
    |             ^^
    |
    = help: only local labels of the form `<number>:` should be used in inline asm
+   = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information
 
 error: avoid using named labels in inline assembly
   --> $DIR/named-asm-labels.rs:124:14
@@ -224,6 +251,7 @@ LL |         asm!(include_str!("named-asm-labels.s"));
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: only local labels of the form `<number>:` should be used in inline asm
+   = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information
 
 warning: avoid using named labels in inline assembly
   --> $DIR/named-asm-labels.rs:134:19
@@ -237,6 +265,7 @@ note: the lint level is defined here
 LL |         #[warn(named_asm_labels)]
    |                ^^^^^^^^^^^^^^^^
    = help: only local labels of the form `<number>:` should be used in inline asm
+   = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information
 
 error: avoid using named labels in inline assembly
   --> $DIR/named-asm-labels.rs:143:20
@@ -245,6 +274,7 @@ LL |     unsafe { asm!(".Lfoo: mov rax, {}; ret;", "nop", const 1, options(noret
    |                    ^^^^^
    |
    = help: only local labels of the form `<number>:` should be used in inline asm
+   = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information
 
 error: avoid using named labels in inline assembly
   --> $DIR/named-asm-labels.rs:149:20
@@ -253,6 +283,7 @@ LL |     unsafe { asm!(".Lbar: mov rax, {}; ret;", "nop", const 1, options(noret
    |                    ^^^^^
    |
    = help: only local labels of the form `<number>:` should be used in inline asm
+   = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information
 
 error: avoid using named labels in inline assembly
   --> $DIR/named-asm-labels.rs:157:20
@@ -261,6 +292,7 @@ LL |     unsafe { asm!(".Laaa: nop; ret;", options(noreturn)) }
    |                    ^^^^^
    |
    = help: only local labels of the form `<number>:` should be used in inline asm
+   = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information
 
 error: avoid using named labels in inline assembly
   --> $DIR/named-asm-labels.rs:167:24
@@ -269,6 +301,7 @@ LL |         unsafe { asm!(".Lbbb: nop; ret;", options(noreturn)) }
    |                        ^^^^^
    |
    = help: only local labels of the form `<number>:` should be used in inline asm
+   = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information
 
 error: avoid using named labels in inline assembly
   --> $DIR/named-asm-labels.rs:176:15
@@ -277,6 +310,7 @@ LL |         asm!("closure1: nop");
    |               ^^^^^^^^
    |
    = help: only local labels of the form `<number>:` should be used in inline asm
+   = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information
 
 error: avoid using named labels in inline assembly
   --> $DIR/named-asm-labels.rs:180:15
@@ -285,6 +319,7 @@ LL |         asm!("closure2: nop");
    |               ^^^^^^^^
    |
    = help: only local labels of the form `<number>:` should be used in inline asm
+   = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information
 
 error: avoid using named labels in inline assembly
   --> $DIR/named-asm-labels.rs:190:19
@@ -293,6 +328,7 @@ LL |             asm!("closure3: nop");
    |                   ^^^^^^^^
    |
    = help: only local labels of the form `<number>:` should be used in inline asm
+   = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information
 
 error: aborting due to 35 previous errors; 1 warning emitted
 
index 56020d1b2f599b5b90dff37936c05ad234094deb..ccbaa1f2af0d8d079a75277c95376e4f0c898127 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found keyword `await`
 LL |     pub mod await {
    |             ^^^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `await` to use it as an identifier
    |
 LL |     pub mod r#await {
-   |             ~~~~~~~
+   |             ++
 
 error: expected identifier, found keyword `await`
   --> $DIR/2018-edition-error-in-non-macro-position.rs:7:20
@@ -15,10 +15,10 @@ error: expected identifier, found keyword `await`
 LL |         pub struct await;
    |                    ^^^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `await` to use it as an identifier
    |
 LL |         pub struct r#await;
-   |                    ~~~~~~~
+   |                    ++
 
 error: expected identifier, found keyword `await`
   --> $DIR/2018-edition-error-in-non-macro-position.rs:10:22
@@ -26,10 +26,10 @@ error: expected identifier, found keyword `await`
 LL | use self::outer_mod::await::await;
    |                      ^^^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `await` to use it as an identifier
    |
 LL | use self::outer_mod::r#await::await;
-   |                      ~~~~~~~
+   |                      ++
 
 error: expected identifier, found keyword `await`
   --> $DIR/2018-edition-error-in-non-macro-position.rs:10:29
@@ -37,10 +37,10 @@ error: expected identifier, found keyword `await`
 LL | use self::outer_mod::await::await;
    |                             ^^^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `await` to use it as an identifier
    |
 LL | use self::outer_mod::await::r#await;
-   |                             ~~~~~~~
+   |                             ++
 
 error: expected identifier, found keyword `await`
   --> $DIR/2018-edition-error-in-non-macro-position.rs:13:14
@@ -48,10 +48,10 @@ error: expected identifier, found keyword `await`
 LL | struct Foo { await: () }
    |              ^^^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `await` to use it as an identifier
    |
 LL | struct Foo { r#await: () }
-   |              ~~~~~~~
+   |              ++
 
 error: expected identifier, found keyword `await`
   --> $DIR/2018-edition-error-in-non-macro-position.rs:16:15
@@ -59,10 +59,10 @@ error: expected identifier, found keyword `await`
 LL | impl Foo { fn await() {} }
    |               ^^^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `await` to use it as an identifier
    |
 LL | impl Foo { fn r#await() {} }
-   |               ~~~~~~~
+   |               ++
 
 error: expected identifier, found keyword `await`
   --> $DIR/2018-edition-error-in-non-macro-position.rs:19:14
@@ -70,10 +70,10 @@ error: expected identifier, found keyword `await`
 LL | macro_rules! await {
    |              ^^^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `await` to use it as an identifier
    |
 LL | macro_rules! r#await {
-   |              ~~~~~~~
+   |              ++
 
 error: aborting due to 7 previous errors
 
index e90cd644457a18843bcbf100009a918c55a19969..34bfdfc71316e5741a36b739d4dfe52fa8bbef0f 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found keyword `await`
 LL |     pub mod await {
    |             ^^^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `await` to use it as an identifier
    |
 LL |     pub mod r#await {
-   |             ~~~~~~~
+   |             ++
 
 error: expected identifier, found keyword `await`
   --> $DIR/2018-edition-error.rs:6:20
@@ -15,10 +15,10 @@ error: expected identifier, found keyword `await`
 LL |         pub struct await;
    |                    ^^^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `await` to use it as an identifier
    |
 LL |         pub struct r#await;
-   |                    ~~~~~~~
+   |                    ++
 
 error: expected identifier, found keyword `await`
   --> $DIR/2018-edition-error.rs:9:22
@@ -26,10 +26,10 @@ error: expected identifier, found keyword `await`
 LL | use self::outer_mod::await::await;
    |                      ^^^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `await` to use it as an identifier
    |
 LL | use self::outer_mod::r#await::await;
-   |                      ~~~~~~~
+   |                      ++
 
 error: expected identifier, found keyword `await`
   --> $DIR/2018-edition-error.rs:9:29
@@ -37,10 +37,10 @@ error: expected identifier, found keyword `await`
 LL | use self::outer_mod::await::await;
    |                             ^^^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `await` to use it as an identifier
    |
 LL | use self::outer_mod::await::r#await;
-   |                             ~~~~~~~
+   |                             ++
 
 error: expected identifier, found keyword `await`
   --> $DIR/2018-edition-error.rs:12:14
@@ -48,10 +48,10 @@ error: expected identifier, found keyword `await`
 LL | macro_rules! await { () => {}; }
    |              ^^^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `await` to use it as an identifier
    |
 LL | macro_rules! r#await { () => {}; }
-   |              ~~~~~~~
+   |              ++
 
 error: expected expression, found `)`
   --> $DIR/2018-edition-error.rs:15:12
index 268e382327e1dd703cf40dee277f6d9c2d8d4f2b..1b7cb76b55366d194c452fec72f66a0c4de67686 100644 (file)
@@ -16,12 +16,11 @@ LL | bug!();
    = note: this error originates in the macro `bug` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: unexpected token: `{
-           let res =
-               ::alloc::fmt::format(::core::fmt::Arguments::new_v1(&[""],
-                                                                   &[::core::fmt::ArgumentV1::new(&"u8",
-                                                                                                  ::core::fmt::Display::fmt)]));
-           res
-       }.as_str()`
+               let res =
+                   ::alloc::fmt::format(::core::fmt::Arguments::new_v1(&[""],
+                           &[::core::fmt::ArgumentV1::new_display(&"u8")]));
+               res
+           }.as_str()`
   --> $DIR/key-value-expansion.rs:48:23
    |
 LL |         doc_comment! {format!("{coor}", coor = stringify!($t1)).as_str()}
diff --git a/src/test/ui/closures/issue-84044-drop-non-mut.rs b/src/test/ui/closures/issue-84044-drop-non-mut.rs
new file mode 100644 (file)
index 0000000..aed7750
--- /dev/null
@@ -0,0 +1,6 @@
+// #84044: This used to ICE.
+
+fn main() {
+    let f = || {};
+    drop(&mut f); //~ ERROR cannot borrow `f` as mutable, as it is not declared as mutable
+}
diff --git a/src/test/ui/closures/issue-84044-drop-non-mut.stderr b/src/test/ui/closures/issue-84044-drop-non-mut.stderr
new file mode 100644 (file)
index 0000000..c0bfad2
--- /dev/null
@@ -0,0 +1,11 @@
+error[E0596]: cannot borrow `f` as mutable, as it is not declared as mutable
+  --> $DIR/issue-84044-drop-non-mut.rs:5:10
+   |
+LL |     let f = || {};
+   |         - help: consider changing this to be mutable: `mut f`
+LL |     drop(&mut f);
+   |          ^^^^^^ cannot borrow as mutable
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0596`.
index bdc71b8dcaa20c0983464dce669cab7cda0f299a..aee782a1c5b8529bbd1b95747c55a05c031d975b 100644 (file)
@@ -9,7 +9,7 @@ LL |         let c1 : () = c;
    |                  expected due to this
    |
    = note: expected unit type `()`
-                found closure `[mod1::f<T>::{closure#0} closure_substs=(unavailable) substs=[T, _#19t, extern "rust-call" fn(()), _#20t]]`
+                found closure `[mod1::f<T>::{closure#0} closure_substs=(unavailable) substs=[T, _#16t, extern "rust-call" fn(()), _#15t]]`
 help: use parentheses to call this closure
    |
 LL |         let c1 : () = c();
index 453f18891d319ae18a9c6f854344664c0826e314..6a994ce718eac75e4d6515ef2c2e36c93a6641f2 100644 (file)
@@ -9,7 +9,7 @@ LL |         let c1 : () = c;
    |                  expected due to this
    |
    = note: expected unit type `()`
-                found closure `[f<T>::{closure#0} closure_substs=(unavailable) substs=[T, _#19t, extern "rust-call" fn(()), _#20t]]`
+                found closure `[f<T>::{closure#0} closure_substs=(unavailable) substs=[T, _#16t, extern "rust-call" fn(()), _#15t]]`
 help: use parentheses to call this closure
    |
 LL |         let c1 : () = c();
index 99fe9d2e4b3c3ae5d23506972f52d4a228fabb95..121138605f1a2f1a50ce63da1c4da4f34a486587 100644 (file)
@@ -15,4 +15,4 @@ trait Foo<const KIND : bool = true> {}
 fn foo<const SIZE : usize = 5>() {}
 
 struct Range<const FROM : usize = 0, const LEN : usize = 0, const TO : usize =
-             FROM>;
+    FROM>;
index 1a1d9a6d540d899e6469740c1cbdc70827d90f82..ac9e8b64b48972476ffa83557b561f4032b8afb9 100644 (file)
@@ -6,11 +6,10 @@
 const FOO: i32 = foo();
 const fn foo() -> i32 {
     unsafe {
-        let _ = intrinsics::const_allocate(4, 3) as * mut i32;
+        let _ = intrinsics::const_allocate(4, 3) as *mut i32;
         //~^ error: evaluation of constant value failed
     }
     1
-
 }
 
 fn main() {}
index 74fb65ca1a658fdba44d987d38b55be201d594dc..2628a78455c76b3f5a5f3100852c11807ecb8a26 100644 (file)
@@ -4,7 +4,7 @@ error[E0080]: evaluation of constant value failed
 LL | const FOO: i32 = foo();
    |                  ----- inside `FOO` at $DIR/alloc_intrinsic_errors.rs:6:18
 ...
-LL |         let _ = intrinsics::const_allocate(4, 3) as * mut i32;
+LL |         let _ = intrinsics::const_allocate(4, 3) as *mut i32;
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |                 |
    |                 align has to be a power of 2, `3` is not a power of 2
diff --git a/src/test/ui/consts/const-eval/heap/alloc_intrinsic_zero_sized.rs b/src/test/ui/consts/const-eval/heap/alloc_intrinsic_zero_sized.rs
new file mode 100644 (file)
index 0000000..407e69d
--- /dev/null
@@ -0,0 +1,16 @@
+// run-pass
+#![feature(core_intrinsics)]
+#![feature(const_heap)]
+#![feature(inline_const)]
+
+use std::intrinsics;
+
+struct ZST;
+
+fn main() {
+    const {
+        unsafe {
+            let _ = intrinsics::const_allocate(0, 0) as *mut ZST;
+        }
+    }
+}
diff --git a/src/test/ui/consts/const-eval/heap/dealloc_intrinsic.rs b/src/test/ui/consts/const-eval/heap/dealloc_intrinsic.rs
new file mode 100644 (file)
index 0000000..aac90cd
--- /dev/null
@@ -0,0 +1,36 @@
+// run-pass
+#![feature(core_intrinsics)]
+#![feature(const_heap)]
+#![feature(const_mut_refs)]
+
+use std::intrinsics;
+
+const _X: () = unsafe {
+    let ptr = intrinsics::const_allocate(4, 4);
+    intrinsics::const_deallocate(ptr, 4, 4);
+};
+
+const Y: &u32 = unsafe {
+    let ptr = intrinsics::const_allocate(4, 4) as *mut u32;
+    *ptr = 42;
+    &*ptr
+};
+
+const Z: &u32 = &42;
+
+const _Z: () = unsafe {
+    let ptr1 = Y as *const _ as *mut u8;
+    intrinsics::const_deallocate(ptr1, 4, 4); // nop
+    intrinsics::const_deallocate(ptr1, 2, 4); // nop
+    intrinsics::const_deallocate(ptr1, 4, 2); // nop
+
+    let ptr2 = Z as *const _ as *mut u8;
+    intrinsics::const_deallocate(ptr2, 4, 4); // nop
+    intrinsics::const_deallocate(ptr2, 2, 4); // nop
+    intrinsics::const_deallocate(ptr2, 4, 2); // nop
+};
+
+fn main() {
+    assert_eq!(*Y, 42);
+    assert_eq!(*Z, 42);
+}
diff --git a/src/test/ui/consts/const-eval/heap/dealloc_intrinsic_dangling.rs b/src/test/ui/consts/const-eval/heap/dealloc_intrinsic_dangling.rs
new file mode 100644 (file)
index 0000000..b6d89a5
--- /dev/null
@@ -0,0 +1,22 @@
+#![feature(core_intrinsics)]
+#![feature(const_heap)]
+#![feature(const_mut_refs)]
+
+use std::intrinsics;
+
+const _X: &'static u8 = unsafe {
+    let ptr = intrinsics::const_allocate(4, 4);
+    intrinsics::const_deallocate(ptr, 4, 4);
+    &*ptr
+    //~^ error: evaluation of constant value failed
+};
+
+const _Y: u8 = unsafe {
+    let ptr = intrinsics::const_allocate(4, 4);
+    let reference = &*ptr;
+    intrinsics::const_deallocate(ptr, 4, 4);
+    *reference
+    //~^ error: evaluation of constant value failed
+};
+
+fn main() {}
diff --git a/src/test/ui/consts/const-eval/heap/dealloc_intrinsic_dangling.stderr b/src/test/ui/consts/const-eval/heap/dealloc_intrinsic_dangling.stderr
new file mode 100644 (file)
index 0000000..4eb1c42
--- /dev/null
@@ -0,0 +1,15 @@
+error[E0080]: evaluation of constant value failed
+  --> $DIR/dealloc_intrinsic_dangling.rs:10:5
+   |
+LL |     &*ptr
+   |     ^^^^^ pointer to alloc2 was dereferenced after this allocation got freed
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/dealloc_intrinsic_dangling.rs:18:5
+   |
+LL |     *reference
+   |     ^^^^^^^^^^ pointer to alloc4 was dereferenced after this allocation got freed
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-eval/heap/dealloc_intrinsic_duplicate.rs b/src/test/ui/consts/const-eval/heap/dealloc_intrinsic_duplicate.rs
new file mode 100644 (file)
index 0000000..4010b47
--- /dev/null
@@ -0,0 +1,13 @@
+#![feature(core_intrinsics)]
+#![feature(const_heap)]
+
+use std::intrinsics;
+
+const _X: () = unsafe {
+    let ptr = intrinsics::const_allocate(4, 4);
+    intrinsics::const_deallocate(ptr, 4, 4);
+    intrinsics::const_deallocate(ptr, 4, 4);
+    //~^ error: evaluation of constant value failed
+};
+
+fn main() {}
diff --git a/src/test/ui/consts/const-eval/heap/dealloc_intrinsic_duplicate.stderr b/src/test/ui/consts/const-eval/heap/dealloc_intrinsic_duplicate.stderr
new file mode 100644 (file)
index 0000000..8177a08
--- /dev/null
@@ -0,0 +1,9 @@
+error[E0080]: evaluation of constant value failed
+  --> $DIR/dealloc_intrinsic_duplicate.rs:9:5
+   |
+LL |     intrinsics::const_deallocate(ptr, 4, 4);
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pointer to alloc2 was dereferenced after this allocation got freed
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-eval/heap/dealloc_intrinsic_incorrect_layout.rs b/src/test/ui/consts/const-eval/heap/dealloc_intrinsic_incorrect_layout.rs
new file mode 100644 (file)
index 0000000..031d70f
--- /dev/null
@@ -0,0 +1,29 @@
+#![feature(core_intrinsics)]
+#![feature(const_heap)]
+
+use std::intrinsics;
+
+const _X: () = unsafe {
+    let ptr = intrinsics::const_allocate(4, 4);
+    intrinsics::const_deallocate(ptr, 4, 2);
+    //~^ error: evaluation of constant value failed
+};
+const _Y: () = unsafe {
+    let ptr = intrinsics::const_allocate(4, 4);
+    intrinsics::const_deallocate(ptr, 2, 4);
+    //~^ error: evaluation of constant value failed
+};
+
+const _Z: () = unsafe {
+    let ptr = intrinsics::const_allocate(4, 4);
+    intrinsics::const_deallocate(ptr, 3, 4);
+    //~^ error: evaluation of constant value failed
+};
+
+const _W: () = unsafe {
+    let ptr = intrinsics::const_allocate(4, 4);
+    intrinsics::const_deallocate(ptr, 4, 3);
+    //~^ error: evaluation of constant value failed
+};
+
+fn main() {}
diff --git a/src/test/ui/consts/const-eval/heap/dealloc_intrinsic_incorrect_layout.stderr b/src/test/ui/consts/const-eval/heap/dealloc_intrinsic_incorrect_layout.stderr
new file mode 100644 (file)
index 0000000..650b409
--- /dev/null
@@ -0,0 +1,27 @@
+error[E0080]: evaluation of constant value failed
+  --> $DIR/dealloc_intrinsic_incorrect_layout.rs:8:5
+   |
+LL |     intrinsics::const_deallocate(ptr, 4, 2);
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect layout on deallocation: alloc2 has size 4 and alignment 4, but gave size 4 and alignment 2
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/dealloc_intrinsic_incorrect_layout.rs:13:5
+   |
+LL |     intrinsics::const_deallocate(ptr, 2, 4);
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect layout on deallocation: alloc4 has size 4 and alignment 4, but gave size 2 and alignment 4
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/dealloc_intrinsic_incorrect_layout.rs:19:5
+   |
+LL |     intrinsics::const_deallocate(ptr, 3, 4);
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect layout on deallocation: alloc6 has size 4 and alignment 4, but gave size 3 and alignment 4
+
+error[E0080]: evaluation of constant value failed
+  --> $DIR/dealloc_intrinsic_incorrect_layout.rs:25:5
+   |
+LL |     intrinsics::const_deallocate(ptr, 4, 3);
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ align has to be a power of 2, `3` is not a power of 2
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-eval/heap/dealloc_intrinsic_zero_sized.rs b/src/test/ui/consts/const-eval/heap/dealloc_intrinsic_zero_sized.rs
new file mode 100644 (file)
index 0000000..84fb4d2
--- /dev/null
@@ -0,0 +1,17 @@
+// run-pass
+#![feature(core_intrinsics)]
+#![feature(const_heap)]
+#![feature(inline_const)]
+
+use std::intrinsics;
+
+fn main() {
+    const {
+        unsafe {
+            let ptr1 = intrinsics::const_allocate(0, 0);
+            let ptr2 = intrinsics::const_allocate(0, 0);
+            intrinsics::const_deallocate(ptr1, 0, 0);
+            intrinsics::const_deallocate(ptr2, 0, 0);
+        }
+    }
+}
diff --git a/src/test/ui/did_you_mean/issue-93210-ignore-doc-hidden.rs b/src/test/ui/did_you_mean/issue-93210-ignore-doc-hidden.rs
new file mode 100644 (file)
index 0000000..0efc7da
--- /dev/null
@@ -0,0 +1,24 @@
+#[derive(Default)]
+pub struct A {
+    #[doc(hidden)]
+    pub hello: i32,
+    pub bye: i32,
+}
+
+#[derive(Default)]
+pub struct B {
+    pub hello: i32,
+    pub bye: i32,
+}
+
+fn main() {
+    A::default().hey;
+    //~^ ERROR no field `hey` on type `A`
+    //~| NOTE unknown field
+    //~| NOTE available fields are: `bye`
+
+    B::default().hey;
+    //~^ ERROR no field `hey` on type `B`
+    //~| NOTE unknown field
+    //~| NOTE available fields are: `hello`, `bye`
+}
diff --git a/src/test/ui/did_you_mean/issue-93210-ignore-doc-hidden.stderr b/src/test/ui/did_you_mean/issue-93210-ignore-doc-hidden.stderr
new file mode 100644 (file)
index 0000000..784986d
--- /dev/null
@@ -0,0 +1,19 @@
+error[E0609]: no field `hey` on type `A`
+  --> $DIR/issue-93210-ignore-doc-hidden.rs:15:18
+   |
+LL |     A::default().hey;
+   |                  ^^^ unknown field
+   |
+   = note: available fields are: `bye`
+
+error[E0609]: no field `hey` on type `B`
+  --> $DIR/issue-93210-ignore-doc-hidden.rs:20:18
+   |
+LL |     B::default().hey;
+   |                  ^^^ unknown field
+   |
+   = note: available fields are: `hello`, `bye`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0609`.
index 65d9199fa3326d5a528684fc7f6e45b07ae63c64..23dad2c16b22c95fa286b29ac19c1b6508e48c7d 100644 (file)
@@ -5,10 +5,10 @@ LL |     produces_async! {}
    |     ^^^^^^^^^^^^^^^^^^ expected identifier, found keyword
    |
    = note: this error originates in the macro `produces_async` (in Nightly builds, run with -Z macro-backtrace for more info)
-help: you can escape reserved keywords to use them as identifiers
+help: escape `async` to use it as an identifier
    |
 LL |     () => (pub fn r#async() {})
-   |                   ~~~~~~~
+   |                   ++
 
 error: aborting due to previous error
 
index 837d35bfccb0e5d291254f62da2e2d3a4f790737..e1eea725bb0b0cd25fc5b5e27f32b937328af3ec 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found keyword `async`
 LL |     let mut async = 1;
    |             ^^^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `async` to use it as an identifier
    |
 LL |     let mut r#async = 1;
-   |             ~~~~~~~
+   |             ++
 
 error: expected identifier, found keyword `async`
   --> $DIR/edition-keywords-2018-2015-parsing.rs:26:13
@@ -15,10 +15,10 @@ error: expected identifier, found keyword `async`
 LL |     module::async();
    |             ^^^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `async` to use it as an identifier
    |
 LL |     module::r#async();
-   |             ~~~~~~~
+   |             ++
 
 error: no rules expected the token `r#async`
   --> $DIR/edition-keywords-2018-2015-parsing.rs:20:31
index 77b95ec87a0334f5b424eba42a674abb04dec66e..67f9aa6041399b4ecf2a4afc33ecc487f849a171 100644 (file)
@@ -5,10 +5,10 @@ LL |     produces_async! {}
    |     ^^^^^^^^^^^^^^^^^^ expected identifier, found keyword
    |
    = note: this error originates in the macro `produces_async` (in Nightly builds, run with -Z macro-backtrace for more info)
-help: you can escape reserved keywords to use them as identifiers
+help: escape `async` to use it as an identifier
    |
 LL |     () => (pub fn r#async() {})
-   |                   ~~~~~~~
+   |                   ++
 
 error: aborting due to previous error
 
index 7c183699ac255f05c8f381531b8f29887004e905..0af4da09c19e3c2269d094805fa04dc38b908a71 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found keyword `async`
 LL |     let mut async = 1;
    |             ^^^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `async` to use it as an identifier
    |
 LL |     let mut r#async = 1;
-   |             ~~~~~~~
+   |             ++
 
 error: expected identifier, found keyword `async`
   --> $DIR/edition-keywords-2018-2018-parsing.rs:26:13
@@ -15,10 +15,10 @@ error: expected identifier, found keyword `async`
 LL |     module::async();
    |             ^^^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `async` to use it as an identifier
    |
 LL |     module::r#async();
-   |             ~~~~~~~
+   |             ++
 
 error: no rules expected the token `r#async`
   --> $DIR/edition-keywords-2018-2018-parsing.rs:20:31
diff --git a/src/test/ui/fmt/format-with-yield-point.rs b/src/test/ui/fmt/format-with-yield-point.rs
new file mode 100644 (file)
index 0000000..e484074
--- /dev/null
@@ -0,0 +1,33 @@
+// check-pass
+// edition:2021
+
+macro_rules! m {
+    () => {
+        async {}.await
+    };
+}
+
+async fn with_await() {
+    println!("{} {:?}", "", async {}.await);
+}
+
+async fn with_macro_call_expr() {
+    println!("{} {:?}", "", m!());
+}
+
+async fn with_macro_call_stmt_semi() {
+    println!("{} {:?}", "", { m!(); });
+}
+
+async fn with_macro_call_stmt_braced() {
+    println!("{} {:?}", "", { m!{} });
+}
+
+fn assert_send(_: impl Send) {}
+
+fn main() {
+    assert_send(with_await());
+    assert_send(with_macro_call_expr());
+    assert_send(with_macro_call_stmt_semi());
+    assert_send(with_macro_call_stmt_braced());
+}
index bee165437cb15152afa821ebf5f69210a9e56b43..6e8dd79219106c69985584843efc8f574612ee1c 100644 (file)
@@ -5,6 +5,11 @@ LL |     format!("{:X}", "3");
    |                     ^^^ the trait `UpperHex` is not implemented for `str`
    |
    = note: required because of the requirements on the impl of `UpperHex` for `&str`
+note: required by a bound in `ArgumentV1::<'a>::new_upper_hex`
+  --> $SRC_DIR/core/src/fmt/mod.rs:LL:COL
+   |
+LL |     arg_new!(new_upper_hex, UpperHex);
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `ArgumentV1::<'a>::new_upper_hex`
    = note: this error originates in the macro `$crate::__export::format_args` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: aborting due to previous error
diff --git a/src/test/ui/generic-associated-types/elided-in-expr-position.rs b/src/test/ui/generic-associated-types/elided-in-expr-position.rs
new file mode 100644 (file)
index 0000000..482d0d5
--- /dev/null
@@ -0,0 +1,38 @@
+#![feature(generic_associated_types)]
+#![allow(unused)]
+
+pub trait Trait  {
+    type Assoc<'a> where Self: 'a;
+
+    fn f(&self) -> Self::Assoc<'_>;
+
+    // Disallow elision in return position, for now
+    fn g(&self) -> Self::Assoc;
+    //~^ ERROR missing generics for associated type `Trait::Assoc`
+}
+
+pub struct Struct {
+    item: f32
+}
+
+pub struct GenericStruct<'a> {
+    ref_item: &'a f32
+}
+
+impl Trait for Struct {
+    type Assoc<'a> = GenericStruct<'a>;
+
+    fn f(&self) -> Self::Assoc<'_> {
+        Self::Assoc {
+            ref_item: &self.item
+        }
+    }
+
+    // Disallow elision in return position, for now
+    fn g(&self) -> Self::Assoc {
+    //~^ ERROR missing generics for associated type `Trait::Assoc`
+        todo!()
+    }
+}
+
+fn main() {}
diff --git a/src/test/ui/generic-associated-types/elided-in-expr-position.stderr b/src/test/ui/generic-associated-types/elided-in-expr-position.stderr
new file mode 100644 (file)
index 0000000..9263f3d
--- /dev/null
@@ -0,0 +1,35 @@
+error[E0107]: missing generics for associated type `Trait::Assoc`
+  --> $DIR/elided-in-expr-position.rs:10:26
+   |
+LL |     fn g(&self) -> Self::Assoc;
+   |                          ^^^^^ expected 1 lifetime argument
+   |
+note: associated type defined here, with 1 lifetime parameter: `'a`
+  --> $DIR/elided-in-expr-position.rs:5:10
+   |
+LL |     type Assoc<'a> where Self: 'a;
+   |          ^^^^^ --
+help: add missing lifetime argument
+   |
+LL |     fn g(&self) -> Self::Assoc<'_>;
+   |                          ~~~~~~~~~
+
+error[E0107]: missing generics for associated type `Trait::Assoc`
+  --> $DIR/elided-in-expr-position.rs:32:26
+   |
+LL |     fn g(&self) -> Self::Assoc {
+   |                          ^^^^^ expected 1 lifetime argument
+   |
+note: associated type defined here, with 1 lifetime parameter: `'a`
+  --> $DIR/elided-in-expr-position.rs:5:10
+   |
+LL |     type Assoc<'a> where Self: 'a;
+   |          ^^^^^ --
+help: add missing lifetime argument
+   |
+LL |     fn g(&self) -> Self::Assoc<'_> {
+   |                          ~~~~~~~~~
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0107`.
diff --git a/src/test/ui/generic-associated-types/issue-93340.rs b/src/test/ui/generic-associated-types/issue-93340.rs
new file mode 100644 (file)
index 0000000..d065bde
--- /dev/null
@@ -0,0 +1,20 @@
+// check-pass
+
+#![feature(generic_associated_types)]
+
+pub trait Scalar: 'static {
+    type RefType<'a>: ScalarRef<'a>;
+}
+
+pub trait ScalarRef<'a>: 'a {}
+
+fn cmp_eq<'a, 'b, A: Scalar, B: Scalar, O: Scalar>(a: A::RefType<'a>, b: B::RefType<'b>) -> O {
+    todo!()
+}
+
+fn build_expression<A: Scalar, B: Scalar, O: Scalar>(
+) -> impl Fn(A::RefType<'_>, B::RefType<'_>) -> O {
+    cmp_eq
+}
+
+fn main() {}
index 083b00645388eb02d09352b79fe9634919134e14..06a7a2f63cf5a6408b97b774f617f109403bcd42 100644 (file)
@@ -7,6 +7,11 @@ LL |     const_eval_select((), || {}, || {});
    |     required by a bound introduced by this call
    |
    = help: the trait `~const FnOnce<()>` is not implemented for `[closure@$DIR/const-eval-select-bad.rs:6:27: 6:32]`
+note: the trait `FnOnce<()>` is implemented for `[closure@$DIR/const-eval-select-bad.rs:6:27: 6:32]`, but that implementation is not `const`
+  --> $DIR/const-eval-select-bad.rs:6:27
+   |
+LL |     const_eval_select((), || {}, || {});
+   |                           ^^^^^
    = note: wrap the `[closure@$DIR/const-eval-select-bad.rs:6:27: 6:32]` in a closure with no arguments: `|| { /* code */ }`
 note: required by a bound in `const_eval_select`
   --> $SRC_DIR/core/src/intrinsics.rs:LL:COL
index 95617e4ecc8b82473b1ad844f346eb4c951b8dba..378fdc97dd315559ceb83bf4b93f59d0625c2bcb 100644 (file)
@@ -1,14 +1,14 @@
 error[E0282]: type annotations needed
-  --> $DIR/issue-69455.rs:29:5
+  --> $DIR/issue-69455.rs:29:20
    |
 LL |     type Output;
    |     ------------ `<Self as Test<Rhs>>::Output` defined here
 ...
 LL |     println!("{}", 23u64.test(xs.iter().sum()));
-   |     ^^^^^^^^^^^^^^^---------------------------^
-   |     |              |
-   |     |              this method call resolves to `<Self as Test<Rhs>>::Output`
-   |     cannot infer type for type parameter `T` declared on the associated function `new`
+   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |                    |
+   |                    this method call resolves to `<Self as Test<Rhs>>::Output`
+   |                    cannot infer type for type parameter `T` declared on the associated function `new_display`
    |
    = note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
 
index b3535232f0296cef76d1b0e53c8fc8f457f2ea3e..9bf416341e8c356628ba8fb7ef62331062ee6399 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found keyword `extern`
 LL |     let extern = 0;
    |         ^^^^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `extern` to use it as an identifier
    |
 LL |     let r#extern = 0;
-   |         ~~~~~~~~
+   |         ++
 
 error: aborting due to previous error
 
index a5787d657589d22847ecdda75286673d2788f8b4..247d6b0ed71635129b3b7c8604abe5bcaec52954 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found keyword `extern`
 LL | use extern::foo;
    |     ^^^^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `extern` to use it as an identifier
    |
 LL | use r#extern::foo;
-   |     ~~~~~~~~
+   |     ++
 
 error[E0432]: unresolved import `r#extern`
   --> $DIR/keyword-extern-as-identifier-use.rs:1:5
index 4f46e32dc3070396209c709a8f9f934106059814..2054d43c40957d9f4075aa9fcb9c844bcc615a71 100644 (file)
@@ -7,13 +7,11 @@ extern crate std;
 // check-pass
 
 pub fn main() ({
-                   (if (true as bool)
-                       ({ } as
-                           ()) else if (let Some(a) =
-                                           ((Some as
-                                                fn(i32) -> Option<i32> {Option::<i32>::Some})((3
-                                                                                                  as
-                                                                                                  i32))
-                                               as Option<i32>) as bool)
-                              ({ } as ()) as ())
-                             } as ())
+        (if (true as bool)
+                ({ } as
+                    ()) else if (let Some(a) =
+                       ((Some as
+                               fn(i32) -> Option<i32> {Option::<i32>::Some})((3
+                               as i32)) as Option<i32>) as bool) ({ } as ())
+                   as ())
+               } as ())
index b23322f2c8ced595d162799ea8ba1a83cbe2585d..30c05ecf30a9949768d28c80fe169410fd79836a 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found keyword `false`
 LL | fn false() { }
    |    ^^^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `false` to use it as an identifier
    |
 LL | fn r#false() { }
-   |    ~~~~~~~
+   |    ++
 
 error: aborting due to previous error
 
index 3eaa6004796cbabede4f97f8386f9bf4b94aa04d..74137fa7001acdab9a8469572539abf5ba459b75 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found keyword `true`
 LL | fn true() { }
    |    ^^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `true` to use it as an identifier
    |
 LL | fn r#true() { }
-   |    ~~~~~~
+   |    ++
 
 error: aborting due to previous error
 
index 5cefead2c74d29af835ded00b73fcd3b7204ffd8..c59c811199ea8879460f9009be40499f65110802 100644 (file)
@@ -7,10 +7,10 @@ LL |
 LL |             return
    |             ^^^^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `return` to use it as an identifier
    |
 LL |             r#return
-   |
+   |             ++
 
 error: expected one of `.`, `=>`, `?`, or an operator, found reserved identifier `_`
   --> $DIR/issue-15980.rs:13:9
index 61419040b3381419c541dffc7ef7cd65714bb5bd..2f85d8cd8656bac5ba0c57e8bea44334640b7f4d 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found keyword `true`
 LL |     foo!(true);
    |          ^^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `true` to use it as an identifier
    |
 LL |     foo!(r#true);
-   |          ~~~~~~
+   |          ++
 
 error: invalid `struct` delimiters or `fn` call arguments
   --> $DIR/issue-44406.rs:3:9
index 5a56d80a7d74e32698477412653739069d60e510..dd70b40224ceff239c1daef93682edd6089a262a 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found keyword `for`
 LL |     m::for();
    |        ^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `for` to use it as an identifier
    |
 LL |     m::r#for();
-   |        ~~~~~
+   |        ++
 
 error: aborting due to previous error
 
index a62c9b0a1aac4929a544e5083279003a1490e710..40873388dfb8a01f206b706610c7d95bdd6987b6 100644 (file)
@@ -8,10 +8,10 @@ LL | impl
 LL | }
    | - the item list ends here
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `impl` to use it as an identifier
    |
 LL | r#impl
-   | ~~~~~~
+   | ++
 
 error: aborting due to previous error
 
index 730c5b64b5b7dba387d93e2b0723f9ca51ea5899..b7d1ce7cd7c2b82d83bb85c03946f4041c1f5798 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found reserved keyword `abstract`
 LL |     let abstract = ();
    |         ^^^^^^^^ expected identifier, found reserved keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `abstract` to use it as an identifier
    |
 LL |     let r#abstract = ();
-   |         ~~~~~~~~~~
+   |         ++
 
 error: aborting due to previous error
 
index b9ebdf4b909125d23be4362be910146be5fb1a8f..3c5ad950db87aed019e35b836318f5f049db2008 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found keyword `as`
 LL |     let as = "foo";
    |         ^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `as` to use it as an identifier
    |
 LL |     let r#as = "foo";
-   |         ~~~~
+   |         ++
 
 error: aborting due to previous error
 
index 05615b41756b9723c8c3ffcd3a29ff0dbddb6adc..a4535eb40a158a0a53b181b65d7b243dfb67e830 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found keyword `break`
 LL |     let break = "foo";
    |         ^^^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `break` to use it as an identifier
    |
 LL |     let r#break = "foo";
-   |         ~~~~~~~
+   |         ++
 
 error: aborting due to previous error
 
index f7efa53a45e2cb92c195df17087c82f4aec710c7..31922f150e538aae45dfcbad88074dd01e61e9e4 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found keyword `const`
 LL |     let const = "foo";
    |         ^^^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `const` to use it as an identifier
    |
 LL |     let r#const = "foo";
-   |         ~~~~~~~
+   |         ++
 
 error: aborting due to previous error
 
index aed6be2089967738d73607645d3b0cc3b255af3f..81285633faa10a0e87f026b87bff6ce73d7b0e56 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found keyword `continue`
 LL |     let continue = "foo";
    |         ^^^^^^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `continue` to use it as an identifier
    |
 LL |     let r#continue = "foo";
-   |         ~~~~~~~~~~
+   |         ++
 
 error: aborting due to previous error
 
index 3fc8af3d154a543a72dbf119015149a7a9199413..2125fe84aedd428137de6bfd5a1721445f2000f9 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found keyword `else`
 LL |     let else = "foo";
    |         ^^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `else` to use it as an identifier
    |
 LL |     let r#else = "foo";
-   |         ~~~~~~
+   |         ++
 
 error: aborting due to previous error
 
index 4632814019dab02fe65b5ad4f24b16639ba4a7f3..92d092ccb65b4c8781ef4c5fcbbaa7874e710649 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found keyword `enum`
 LL |     let enum = "foo";
    |         ^^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `enum` to use it as an identifier
    |
 LL |     let r#enum = "foo";
-   |         ~~~~~~
+   |         ++
 
 error: aborting due to previous error
 
index f2edc3fa6b923f74ca82f46ae768a7b8645c048a..f1f9f2e2c90e465e564711ce0103c43294087632 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found reserved keyword `final`
 LL |     let final = ();
    |         ^^^^^ expected identifier, found reserved keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `final` to use it as an identifier
    |
 LL |     let r#final = ();
-   |         ~~~~~~~
+   |         ++
 
 error: aborting due to previous error
 
index 100295caf634871b5b0ecb813b17ed0bf645b7d9..645efbcae71361111a6daefbb6c667d810d30d62 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found keyword `fn`
 LL |     let fn = "foo";
    |         ^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `fn` to use it as an identifier
    |
 LL |     let r#fn = "foo";
-   |         ~~~~
+   |         ++
 
 error: aborting due to previous error
 
index 312a635cddc2a3363223f91588c0b190785405bc..26407cc4d3ad2ff11e54fcf431eca7eefa2b8170 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found keyword `for`
 LL |     let for = "foo";
    |         ^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `for` to use it as an identifier
    |
 LL |     let r#for = "foo";
-   |         ~~~~~
+   |         ++
 
 error: aborting due to previous error
 
index 086a77742a7b9e2bc925b2e7917b7b2f8d4cade8..26f9a15a7d00c9422f3e81ea287a89a90ada6310 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found keyword `if`
 LL |     let if = "foo";
    |         ^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `if` to use it as an identifier
    |
 LL |     let r#if = "foo";
-   |         ~~~~
+   |         ++
 
 error: aborting due to previous error
 
index a7493d2e60ba5fd85fa121e72ddb95b20c4faece..73a50bc38bcf1ee4d2418823c07fbcc6f9d7a0d3 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found keyword `impl`
 LL |     let impl = "foo";
    |         ^^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `impl` to use it as an identifier
    |
 LL |     let r#impl = "foo";
-   |         ~~~~~~
+   |         ++
 
 error: aborting due to previous error
 
index 456e06dbfaa181ff6d4071df4c2d8caad2c70a5d..86faaed382f0310ae051de8f186220ea8e2c5076 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found keyword `let`
 LL |     let let = "foo";
    |         ^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `let` to use it as an identifier
    |
 LL |     let r#let = "foo";
-   |         ~~~~~
+   |         ++
 
 error: aborting due to previous error
 
index c3b33afb4a32d1d6858897786fd1d621664761e2..304ad61ccafc959c2487b79b96662d0f58f96fef 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found keyword `loop`
 LL |     let loop = "foo";
    |         ^^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `loop` to use it as an identifier
    |
 LL |     let r#loop = "foo";
-   |         ~~~~~~
+   |         ++
 
 error: aborting due to previous error
 
index 1ca80dbbd09e43befb10478b0649d52714f6ce5f..25ac397fb7e2e8f15fc3048aaa49ce66e32beb1b 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found keyword `match`
 LL |     let match = "foo";
    |         ^^^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `match` to use it as an identifier
    |
 LL |     let r#match = "foo";
-   |         ~~~~~~~
+   |         ++
 
 error: aborting due to previous error
 
index ea161b004c1411c7e377385f3753dbb3e15837e9..d5688e871b2d7eb79a4fa6050040223bc7b1730e 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found keyword `mod`
 LL |     let mod = "foo";
    |         ^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `mod` to use it as an identifier
    |
 LL |     let r#mod = "foo";
-   |         ~~~~~
+   |         ++
 
 error: aborting due to previous error
 
index 8036cecd791dd1363a347f7d204d29a53808f6c3..75653cffc13e7d0934afa41cc273b8c0b064ea70 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found keyword `move`
 LL |     let move = "foo";
    |         ^^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `move` to use it as an identifier
    |
 LL |     let r#move = "foo";
-   |         ~~~~~~
+   |         ++
 
 error: aborting due to previous error
 
index 7ae669b27193b6eb828ed7efa3333f435546baaf..cdb5736866d31887414febce71a7e6dc56643b8a 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found reserved keyword `override`
 LL |     let override = ();
    |         ^^^^^^^^ expected identifier, found reserved keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `override` to use it as an identifier
    |
 LL |     let r#override = ();
-   |         ~~~~~~~~~~
+   |         ++
 
 error: aborting due to previous error
 
index df9429a98f0bd4568c712ef9b38c7e05db4ec567..8d513507c810c4cc3cebde145174c64911b1cbb1 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found keyword `pub`
 LL |     let pub = "foo";
    |         ^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `pub` to use it as an identifier
    |
 LL |     let r#pub = "foo";
-   |         ~~~~~
+   |         ++
 
 error: aborting due to previous error
 
index 831f557c27a4576437be2558ae4988a303fb693f..eeb8e468ba6215b35f1569ee311e3023b078f16f 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found keyword `return`
 LL |     let return = "foo";
    |         ^^^^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `return` to use it as an identifier
    |
 LL |     let r#return = "foo";
-   |         ~~~~~~~~
+   |         ++
 
 error: aborting due to previous error
 
index d133e939d3a0d822907526331133365ce3dfc56b..a3213e2f297402ea91f1a915561d6358d9174bfc 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found keyword `static`
 LL |     let static = "foo";
    |         ^^^^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `static` to use it as an identifier
    |
 LL |     let r#static = "foo";
-   |         ~~~~~~~~
+   |         ++
 
 error: aborting due to previous error
 
index 228ba7c2bc7267bc14998e57d8214c06b65fa2ba..b73361a5585d4675b47ed60fafc48798ed6185ea 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found keyword `struct`
 LL |     let struct = "foo";
    |         ^^^^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `struct` to use it as an identifier
    |
 LL |     let r#struct = "foo";
-   |         ~~~~~~~~
+   |         ++
 
 error: aborting due to previous error
 
index ea90ed3f05e13478b3f14d040180439f0ef6697f..56ef5f60690d2d57cd2cbbd9758eac04e06f3d15 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found keyword `trait`
 LL |     let trait = "foo";
    |         ^^^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `trait` to use it as an identifier
    |
 LL |     let r#trait = "foo";
-   |         ~~~~~~~
+   |         ++
 
 error: aborting due to previous error
 
index 37ba0f27bc241fc4b0f6cfe041f97f67a3432c91..94a106d47d710c273824d7da5804359d63d32b8b 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found reserved keyword `try`
 LL |     let try = "foo";
    |         ^^^ expected identifier, found reserved keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `try` to use it as an identifier
    |
 LL |     let r#try = "foo";
-   |         ~~~~~
+   |         ++
 
 error: aborting due to previous error
 
index 1c49811ae5c84980620689d8be95503fc3798b7c..624c1006b12fc41676a273517bf159b3129cc429 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found keyword `type`
 LL |     let type = "foo";
    |         ^^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `type` to use it as an identifier
    |
 LL |     let r#type = "foo";
-   |         ~~~~~~
+   |         ++
 
 error: aborting due to previous error
 
index 9fb8ac12db4e4a6504e345edd6bf0543ad7cd9fc..4c5324505e96a080df1b1d81742909a081bc57e6 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found reserved keyword `typeof`
 LL |     let typeof = ();
    |         ^^^^^^ expected identifier, found reserved keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `typeof` to use it as an identifier
    |
 LL |     let r#typeof = ();
-   |         ~~~~~~~~
+   |         ++
 
 error: aborting due to previous error
 
index ddd1bd53083bd4e6f816eec31483e011964b8656..b552c9cd386594bce2e81793084d6539d14a7c4f 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found keyword `unsafe`
 LL |     let unsafe = "foo";
    |         ^^^^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `unsafe` to use it as an identifier
    |
 LL |     let r#unsafe = "foo";
-   |         ~~~~~~~~
+   |         ++
 
 error: aborting due to previous error
 
index 880afb0075f06aafa18c952c801acb15566038b3..630798659a8a4f4e4d6f425bd568c616460ab910 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found keyword `use`
 LL |     let use = "foo";
    |         ^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `use` to use it as an identifier
    |
 LL |     let r#use = "foo";
-   |         ~~~~~
+   |         ++
 
 error: aborting due to previous error
 
index 7b6210b712d4f8c19553a2e8ad888c525a5891cb..9e72f7940428c997607506c7e1d01be267f57b3d 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found keyword `where`
 LL |     let where = "foo";
    |         ^^^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `where` to use it as an identifier
    |
 LL |     let r#where = "foo";
-   |         ~~~~~~~
+   |         ++
 
 error: aborting due to previous error
 
index 8f744c3b1ad6ff5dc909734493b4216f583126d2..2bb62105d170e774939a882e95d97d122e826ee4 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found keyword `while`
 LL |     let while = "foo";
    |         ^^^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `while` to use it as an identifier
    |
 LL |     let r#while = "foo";
-   |         ~~~~~~~
+   |         ++
 
 error: aborting due to previous error
 
index f7692f8c57fe23ad231fd85794f90349dbd0d9dc..ee7d72b3996b778a85533ad4ec205025add86e5c 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found keyword `break`
 LL | pub mod break {
    |         ^^^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `break` to use it as an identifier
    |
 LL | pub mod r#break {
-   |         ~~~~~~~
+   |         ++
 
 error: aborting due to previous error
 
index 22f3ccd0de6fb6fb625a29834f466f1da41137c5..d794671f8ab2fdc6d6074adae3c1ed5e55485155 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found reserved keyword `macro`
 LL | fn macro() {
    |    ^^^^^ expected identifier, found reserved keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `macro` to use it as an identifier
    |
 LL | fn r#macro() {
-   |    ~~~~~~~
+   |    ++
 
 error: aborting due to previous error
 
index 59dba4ae216469326a7a0c66079ef88b52300a04..f179d8c9e0a839d9e425390e5ede86ccbbaf9adc 100644 (file)
@@ -56,10 +56,10 @@ error: expected identifier, found reserved keyword `yield`
 LL |     let mut mut yield(become, await) = r#yield(0, 0);
    |                 ^^^^^ expected identifier, found reserved keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `yield` to use it as an identifier
    |
 LL |     let mut mut r#yield(become, await) = r#yield(0, 0);
-   |                 ~~~~~~~
+   |                 ++
 
 error: expected identifier, found reserved keyword `become`
   --> $DIR/mut-patterns.rs:28:23
@@ -67,10 +67,10 @@ error: expected identifier, found reserved keyword `become`
 LL |     let mut mut yield(become, await) = r#yield(0, 0);
    |                       ^^^^^^ expected identifier, found reserved keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `become` to use it as an identifier
    |
 LL |     let mut mut yield(r#become, await) = r#yield(0, 0);
-   |                       ~~~~~~~~
+   |                       ++
 
 error: expected identifier, found keyword `await`
   --> $DIR/mut-patterns.rs:28:31
@@ -78,10 +78,10 @@ error: expected identifier, found keyword `await`
 LL |     let mut mut yield(become, await) = r#yield(0, 0);
    |                               ^^^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `await` to use it as an identifier
    |
 LL |     let mut mut yield(become, r#await) = r#yield(0, 0);
-   |                               ~~~~~~~
+   |                               ++
 
 error: `mut` must be attached to each individual binding
   --> $DIR/mut-patterns.rs:28:9
index debbad57a86994f644431d00ced7a18e8cdaa068..9d25def587cd60bcd0bff622382540472bf56b33 100644 (file)
@@ -1,9 +1,9 @@
 PRINT-ATTR INPUT (DISPLAY): impl Foo <
 [u8 ;
- {
-     #! [rustc_dummy(cursed_inner)] #! [allow(unused)] struct Inner
-     { field : [u8 ; { #! [rustc_dummy(another_cursed_inner)] 1 }] } 0
- }] > { #! [rustc_dummy(evaluated_attr)] fn bar() {} }
+{
+    #! [rustc_dummy(cursed_inner)] #! [allow(unused)] struct Inner
+    { field : [u8 ; { #! [rustc_dummy(another_cursed_inner)] 1 }] } 0
+}] > { #! [rustc_dummy(evaluated_attr)] fn bar() {} }
 PRINT-ATTR INPUT (DEBUG): TokenStream [
     Ident {
         ident: "impl",
index fdd178a52292f5d27df6d410295c6b3e54e5b5f4..c81fa201cbcf5e41f67b297bd12b64d9b8d652c7 100644 (file)
@@ -4,23 +4,23 @@ struct Foo < #[cfg(FALSE)] A, B >
     #[cfg(FALSE)] first : String, #[cfg_attr(FALSE, deny(warnings))] second :
     bool, third :
     [u8 ;
-     {
-         #[cfg(FALSE)] struct Bar ; #[cfg(not(FALSE))] struct Inner ;
-         #[cfg(FALSE)] let a = 25 ; match true
-         {
-             #[cfg(FALSE)] true => {},
-             #[cfg_attr(not(FALSE), allow(warnings))] false => {}, _ => {}
-         } ; #[print_helper(should_be_removed)] fn removed_fn()
-         { #! [cfg(FALSE)] } #[print_helper(c)] #[cfg(not(FALSE))] fn
-         kept_fn() { #! [cfg(not(FALSE))] let my_val = true ; } enum TupleEnum
-         {
-             Foo(#[cfg(FALSE)] u8, #[cfg(FALSE)] bool, #[cfg(not(FALSE))] i32,
-                 #[cfg(FALSE)] String, u8)
-         } struct
-         TupleStruct(#[cfg(FALSE)] String, #[cfg(not(FALSE))] i32,
-                     #[cfg(FALSE)] bool, u8) ; fn plain_removed_fn()
-         { #! [cfg_attr(not(FALSE), cfg(FALSE))] } 0
-     }], #[print_helper(d)] fourth : B
+    {
+        #[cfg(FALSE)] struct Bar ; #[cfg(not(FALSE))] struct Inner ;
+        #[cfg(FALSE)] let a = 25 ; match true
+        {
+            #[cfg(FALSE)] true => {}, #[cfg_attr(not(FALSE), allow(warnings))]
+            false => {}, _ => {}
+        } ; #[print_helper(should_be_removed)] fn removed_fn()
+        { #! [cfg(FALSE)] } #[print_helper(c)] #[cfg(not(FALSE))] fn kept_fn()
+        { #! [cfg(not(FALSE))] let my_val = true ; } enum TupleEnum
+        {
+            Foo(#[cfg(FALSE)] u8, #[cfg(FALSE)] bool, #[cfg(not(FALSE))] i32,
+            #[cfg(FALSE)] String, u8)
+        } struct
+        TupleStruct(#[cfg(FALSE)] String, #[cfg(not(FALSE))] i32,
+        #[cfg(FALSE)] bool, u8) ; fn plain_removed_fn()
+        { #! [cfg_attr(not(FALSE), cfg(FALSE))] } 0
+    }], #[print_helper(d)] fourth : B
 }
 PRINT-ATTR INPUT (DEBUG): TokenStream [
     Punct {
@@ -1276,14 +1276,14 @@ PRINT-DERIVE INPUT (DISPLAY): #[print_helper(a)] #[allow(dead_code)] #[print_hel
 {
     second : bool, third :
     [u8 ;
-     {
-         #[cfg(not(FALSE))] struct Inner ; match true
-         { #[allow(warnings)] false => {}, _ => {} } ; #[print_helper(c)]
-         #[cfg(not(FALSE))] fn kept_fn()
-         { #! [cfg(not(FALSE))] let my_val = true ; } enum TupleEnum
-         { Foo(#[cfg(not(FALSE))] i32, u8) } struct
-         TupleStruct(#[cfg(not(FALSE))] i32, u8) ; 0
-     }], #[print_helper(d)] fourth : B
+    {
+        #[cfg(not(FALSE))] struct Inner ; match true
+        { #[allow(warnings)] false => {}, _ => {} } ; #[print_helper(c)]
+        #[cfg(not(FALSE))] fn kept_fn()
+        { #! [cfg(not(FALSE))] let my_val = true ; } enum TupleEnum
+        { Foo(#[cfg(not(FALSE))] i32, u8) } struct
+        TupleStruct(#[cfg(not(FALSE))] i32, u8) ; 0
+    }], #[print_helper(d)] fourth : B
 }
 PRINT-DERIVE INPUT (DEBUG): TokenStream [
     Punct {
index 6e2b6a2e5bdf68f2d5c1e836b5bc7a89447ab145..74641058ef3d23a87751020f1d283411dece4439 100644 (file)
@@ -2,10 +2,10 @@ PRINT-DERIVE INPUT (DISPLAY): struct Foo
 {
     val :
     [bool ;
-     {
-         let a = #[rustc_dummy(first)] #[rustc_dummy(second)]
-         { #! [allow(unused)] 30 } ; 0
-     }]
+    {
+        let a = #[rustc_dummy(first)] #[rustc_dummy(second)]
+        { #! [allow(unused)] 30 } ; 0
+    }]
 }
 PRINT-DERIVE INPUT (DEBUG): TokenStream [
     Ident {
index 4bdc04b9ac4306654f3d97a1584589df3ea0f935..79651f01b9534cebade236661bff41b135cda97b 100644 (file)
@@ -19,29 +19,27 @@ extern crate proc_macro;
 
 fn main() {
     [crate::TokenStream::from(crate::TokenTree::Ident(crate::Ident::new("let",
-                                                                        crate::Span::recover_proc_macro_span(0)))),
-     crate::TokenStream::from(crate::TokenTree::Ident(crate::Ident::new("hello",
-                                                                        crate::Span::recover_proc_macro_span(1)))),
-     crate::TokenStream::from(crate::TokenTree::Punct(crate::Punct::new('\u{3d}',
-                                                                        crate::Spacing::Alone))),
-     crate::TokenStream::from(crate::TokenTree::Literal({
-                                                            let mut iter =
-                                                                "\"world\"".parse::<crate::TokenStream>().unwrap().into_iter();
-                                                            if let (Some(crate::TokenTree::Literal(mut lit)),
-                                                                    None) =
-                                                                   (iter.next(),
-                                                                    iter.next())
-                                                               {
-                                                                lit.set_span(crate::Span::recover_proc_macro_span(2));
-                                                                lit
-                                                            } else {
-                                                                {
-                                                                    ::core::panicking::panic("internal error: entered unreachable code")
-                                                                }
-                                                            }
-                                                        })),
-     crate::TokenStream::from(crate::TokenTree::Punct(crate::Punct::new('\u{3b}',
-                                                                        crate::Spacing::Alone)))].iter().cloned().collect::<crate::TokenStream>()
+                                    crate::Span::recover_proc_macro_span(0)))),
+                        crate::TokenStream::from(crate::TokenTree::Ident(crate::Ident::new("hello",
+                                    crate::Span::recover_proc_macro_span(1)))),
+                        crate::TokenStream::from(crate::TokenTree::Punct(crate::Punct::new('\u{3d}',
+                                    crate::Spacing::Alone))),
+                        crate::TokenStream::from(crate::TokenTree::Literal({
+                                    let mut iter =
+                                        "\"world\"".parse::<crate::TokenStream>().unwrap().into_iter();
+                                    if let (Some(crate::TokenTree::Literal(mut lit)),
+                                                None) =
+                                                (iter.next(), iter.next()) {
+                                            lit.set_span(crate::Span::recover_proc_macro_span(2));
+                                            lit
+                                        } else {
+                                           {
+                                               ::core::panicking::panic("internal error: entered unreachable code")
+                                           }
+                                       }
+                                })),
+                        crate::TokenStream::from(crate::TokenTree::Punct(crate::Punct::new('\u{3b}',
+                                    crate::Spacing::Alone)))].iter().cloned().collect::<crate::TokenStream>()
 }
 const _: () =
     {
index 7878efeebe996fa6a391e4bc1fb95fa9acb4a54d..0703b76d6de4a8f7308ca17c1fd08699cbd18dad 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found reserved keyword `become`
 LL |     let become = 0;
    |         ^^^^^^ expected identifier, found reserved keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `become` to use it as an identifier
    |
 LL |     let r#become = 0;
-   |         ~~~~~~~~
+   |         ++
 
 error: aborting due to previous error
 
index 8800d3e66f9e42909fba8c00c93f17eafbb6d944..82c4120b4c789c70d38cbe9173c9787102fe1d2c 100644 (file)
@@ -37,7 +37,7 @@ pub fn $attr_name(attr: TokenStream, input: TokenStream) -> TokenStream {
     fn hello(#[angery(true)] a : i32, #[a2] b : i32, #[what = "how"] c : u32)
     {} fn
     hello2(#[a1] #[a2] a : i32, #[what = "how"] b : i32, #[angery(true)] c :
-           u32) {} fn
+    u32) {} fn
     hello_self(#[a1] #[a2] & self, #[a1] #[a2] a : i32, #[what = "how"] b :
-               i32, #[angery(true)] c : u32) {}
+    i32, #[angery(true)] c : u32) {}
 }"#);
index 429b9f3364be1d46e52faa50f0eee6a3c5a77fbd..0788b17a1c0327d53e3dd0730ce01d0d6496963b 100644 (file)
@@ -5,6 +5,11 @@ LL |     type Bar = NonConstAdd;
    |                ^^^^^^^^^^^ no implementation for `NonConstAdd + NonConstAdd`
    |
    = help: the trait `~const Add` is not implemented for `NonConstAdd`
+note: the trait `Add` is implemented for `NonConstAdd`, but that implementation is not `const`
+  --> $DIR/assoc-type.rs:18:16
+   |
+LL |     type Bar = NonConstAdd;
+   |                ^^^^^^^^^^^
 note: required by a bound in `Foo::Bar`
   --> $DIR/assoc-type.rs:14:15
    |
index 13cffaba91a1ddd191235bdd30143778818f63b9..35b7fe8e401c3162b674e93169a3c6b9d3566ee5 100644 (file)
@@ -7,6 +7,11 @@ LL | pub const EQ: bool = equals_self(&S);
    |                      required by a bound introduced by this call
    |
    = help: the trait `~const PartialEq` is not implemented for `S`
+note: the trait `PartialEq` is implemented for `S`, but that implementation is not `const`
+  --> $DIR/call-generic-method-nonconst.rs:19:34
+   |
+LL | pub const EQ: bool = equals_self(&S);
+   |                                  ^^
 note: required by a bound in `equals_self`
   --> $DIR/call-generic-method-nonconst.rs:12:25
    |
index df776908a03655a3de0bdf68b8d69931b9dc77a7..d280cd2556f06f6c0eeed84d923930f512e3b6a1 100644 (file)
@@ -28,6 +28,11 @@ LL |         const _: () = check($exp);
 LL |     ConstImplWithDropGlue(NonTrivialDrop),
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `ConstImplWithDropGlue`, the trait `~const Drop` is not implemented for `NonTrivialDrop`
    |
+note: the trait `Drop` is implemented for `NonTrivialDrop`, but that implementation is not `const`
+  --> $DIR/const-drop-fail.rs:46:5
+   |
+LL |     ConstImplWithDropGlue(NonTrivialDrop),
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 note: required because it appears within the type `ConstImplWithDropGlue`
   --> $DIR/const-drop-fail.rs:17:8
    |
index df776908a03655a3de0bdf68b8d69931b9dc77a7..d280cd2556f06f6c0eeed84d923930f512e3b6a1 100644 (file)
@@ -28,6 +28,11 @@ LL |         const _: () = check($exp);
 LL |     ConstImplWithDropGlue(NonTrivialDrop),
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `ConstImplWithDropGlue`, the trait `~const Drop` is not implemented for `NonTrivialDrop`
    |
+note: the trait `Drop` is implemented for `NonTrivialDrop`, but that implementation is not `const`
+  --> $DIR/const-drop-fail.rs:46:5
+   |
+LL |     ConstImplWithDropGlue(NonTrivialDrop),
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 note: required because it appears within the type `ConstImplWithDropGlue`
   --> $DIR/const-drop-fail.rs:17:8
    |
index 05a74757b94f119dd90efdbbbc51f98c5983c372..bc807507fd6683fbf8deda4b6db4cc9aea466547 100644 (file)
@@ -4,6 +4,11 @@ error[E0277]: the trait bound `(): ~const Tr` is not satisfied
 LL |         foo::<()>();
    |               ^^ the trait `~const Tr` is not implemented for `()`
    |
+note: the trait `Tr` is implemented for `()`, but that implementation is not `const`
+  --> $DIR/default-method-body-is-const-body-checking.rs:12:15
+   |
+LL |         foo::<()>();
+   |               ^^
 note: required by a bound in `foo`
   --> $DIR/default-method-body-is-const-body-checking.rs:7:28
    |
index 903cd924ca55b466d3cf8d7f338fdde95993ef0f..f9b5d81c63b85a420c3c591456a1e8cc60fe8655 100644 (file)
@@ -4,6 +4,11 @@ error[E0277]: the trait bound `T: ~const Bar` is not satisfied
 LL |     T::b();
    |     ^^^^ the trait `~const Bar` is not implemented for `T`
    |
+note: the trait `Bar` is implemented for `T`, but that implementation is not `const`
+  --> $DIR/trait-where-clause.rs:14:5
+   |
+LL |     T::b();
+   |     ^^^^
 note: required by a bound in `Foo::b`
   --> $DIR/trait-where-clause.rs:8:24
    |
@@ -20,6 +25,11 @@ error[E0277]: the trait bound `T: ~const Bar` is not satisfied
 LL |     T::c::<T>();
    |     ^^^^^^^^^ the trait `~const Bar` is not implemented for `T`
    |
+note: the trait `Bar` is implemented for `T`, but that implementation is not `const`
+  --> $DIR/trait-where-clause.rs:16:5
+   |
+LL |     T::c::<T>();
+   |     ^^^^^^^^^
 note: required by a bound in `Foo::c`
   --> $DIR/trait-where-clause.rs:9:13
    |
index 495b06fd2ccff14d08781544abf47e93e595caff..cf4d6c19cf0b598b0d71998ba688ef7db572f8be 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found keyword `dyn`
 LL | type A1 = dyn::dyn;
    |                ^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `dyn` to use it as an identifier
    |
 LL | type A1 = dyn::r#dyn;
-   |                ~~~~~
+   |                ++
 
 error: expected identifier, found `<`
   --> $DIR/dyn-trait-compatibility.rs:5:14
diff --git a/src/test/ui/save-analysis/issue-89066.rs b/src/test/ui/save-analysis/issue-89066.rs
new file mode 100644 (file)
index 0000000..2873f52
--- /dev/null
@@ -0,0 +1,28 @@
+// compile-flags: -Zsave-analysis
+
+// Check that this does not ICE.
+// Stolen from src/test/ui/const-generics/generic_arg_infer/infer-arg-test.rs
+
+#![feature(generic_arg_infer)]
+
+struct All<'a, T, const N: usize> {
+  v: &'a T,
+}
+
+struct BadInfer<_>;
+//~^ ERROR expected identifier
+//~| ERROR parameter `_` is never used
+
+fn all_fn<'a, T, const N: usize>() {}
+
+fn bad_infer_fn<_>() {}
+//~^ ERROR expected identifier
+
+
+fn main() {
+  let a: All<_, _, _>;
+  //~^ ERROR this struct takes 2 generic arguments but 3 generic arguments were supplied
+  all_fn();
+  let v: [u8; _];
+  let v: [u8; 10] = [0; _];
+}
diff --git a/src/test/ui/save-analysis/issue-89066.stderr b/src/test/ui/save-analysis/issue-89066.stderr
new file mode 100644 (file)
index 0000000..a3ff1c0
--- /dev/null
@@ -0,0 +1,39 @@
+error: expected identifier, found reserved identifier `_`
+  --> $DIR/issue-89066.rs:12:17
+   |
+LL | struct BadInfer<_>;
+   |                 ^ expected identifier, found reserved identifier
+
+error: expected identifier, found reserved identifier `_`
+  --> $DIR/issue-89066.rs:18:17
+   |
+LL | fn bad_infer_fn<_>() {}
+   |                 ^ expected identifier, found reserved identifier
+
+error[E0392]: parameter `_` is never used
+  --> $DIR/issue-89066.rs:12:17
+   |
+LL | struct BadInfer<_>;
+   |                 ^ unused parameter
+   |
+   = help: consider removing `_`, referring to it in a field, or using a marker such as `PhantomData`
+   = help: if you intended `_` to be a const parameter, use `const _: usize` instead
+
+error[E0107]: this struct takes 2 generic arguments but 3 generic arguments were supplied
+  --> $DIR/issue-89066.rs:23:10
+   |
+LL |   let a: All<_, _, _>;
+   |          ^^^       - help: remove this generic argument
+   |          |
+   |          expected 2 generic arguments
+   |
+note: struct defined here, with 2 generic parameters: `T`, `N`
+  --> $DIR/issue-89066.rs:8:8
+   |
+LL | struct All<'a, T, const N: usize> {
+   |        ^^^     -        -
+
+error: aborting due to 4 previous errors
+
+Some errors have detailed explanations: E0107, E0392.
+For more information about an error, try `rustc --explain E0107`.
index 63d291ed7cdb95e24fa76fbaa85475d746b29122..b125eacfb6cf4444d6f351b3f94438304477e548 100644 (file)
@@ -38,4 +38,5 @@ LL |     impl MyTrait for Box<dyn ObjectTrait<Assoc = i32> + '_> {
 
 error: aborting due to 4 previous errors
 
-For more information about this error, try `rustc --explain E0515`.
+Some errors have detailed explanations: E0515, E0772.
+For more information about an error, try `rustc --explain E0515`.
index 55a1bbf18ab9fbfee2ad49631fbcf3dd7d0e07f7..ed094c1365caa6a72de2ca9b6580b1ed59c317c5 100644 (file)
@@ -131,4 +131,5 @@ LL |     impl MyTrait for Box<dyn ObjectTrait + '_> {
 
 error: aborting due to 6 previous errors
 
-For more information about this error, try `rustc --explain E0759`.
+Some errors have detailed explanations: E0759, E0772.
+For more information about an error, try `rustc --explain E0759`.
diff --git a/src/test/ui/suggestions/private-field.rs b/src/test/ui/suggestions/private-field.rs
new file mode 100644 (file)
index 0000000..1cc4d2a
--- /dev/null
@@ -0,0 +1,19 @@
+// compile-flags: --crate-type lib
+pub struct S {
+    pub val: string::MyString,
+}
+
+pub fn test(s: S) {
+    dbg!(s.cap) //~ ERROR: no field `cap` on type `S` [E0609]
+}
+
+pub(crate) mod string {
+
+    pub struct MyString {
+        buf: MyVec,
+    }
+
+    struct MyVec {
+        cap: usize,
+    }
+}
diff --git a/src/test/ui/suggestions/private-field.stderr b/src/test/ui/suggestions/private-field.stderr
new file mode 100644 (file)
index 0000000..c38c795
--- /dev/null
@@ -0,0 +1,11 @@
+error[E0609]: no field `cap` on type `S`
+  --> $DIR/private-field.rs:7:12
+   |
+LL |     dbg!(s.cap)
+   |            ^^^ unknown field
+   |
+   = note: available fields are: `val`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0609`.
index bfefc144698352f52940ca9ac964952dbf797010..95c26b9ade8b981153752e6792974e2554a1be10 100644 (file)
@@ -4,10 +4,10 @@ error: expected identifier, found keyword `break`
 LL |     pub fn break() {}
    |            ^^^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `break` to use it as an identifier
    |
 LL |     pub fn r#break() {}
-   |            ~~~~~~~
+   |            ++
 
 error: expected identifier, found keyword `let`
   --> $DIR/raw-name-use-suggestion.rs:7:10
@@ -15,10 +15,10 @@ error: expected identifier, found keyword `let`
 LL |     foo::let();
    |          ^^^ expected identifier, found keyword
    |
-help: you can escape reserved keywords to use them as identifiers
+help: escape `let` to use it as an identifier
    |
 LL |     foo::r#let();
-   |          ~~~~~
+   |          ++
 
 error[E0425]: cannot find function `r#break` in this scope
   --> $DIR/raw-name-use-suggestion.rs:8:5
diff --git a/src/test/ui/traits/issue-91594.rs b/src/test/ui/traits/issue-91594.rs
new file mode 100644 (file)
index 0000000..930f7f0
--- /dev/null
@@ -0,0 +1,17 @@
+// #91594: This used to ICE.
+
+trait Component<M> {
+    type Interface;
+}
+trait HasComponent<I> {}
+
+struct Foo;
+
+impl HasComponent<<Foo as Component<Foo>>::Interface> for Foo {}
+//~^ ERROR the trait bound `Foo: HasComponent<()>` is not satisfied
+
+impl<M: HasComponent<()>> Component<M> for Foo {
+    type Interface = u8;
+}
+
+fn main() {}
diff --git a/src/test/ui/traits/issue-91594.stderr b/src/test/ui/traits/issue-91594.stderr
new file mode 100644 (file)
index 0000000..10298a0
--- /dev/null
@@ -0,0 +1,17 @@
+error[E0277]: the trait bound `Foo: HasComponent<()>` is not satisfied
+  --> $DIR/issue-91594.rs:10:6
+   |
+LL | impl HasComponent<<Foo as Component<Foo>>::Interface> for Foo {}
+   |      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `HasComponent<()>` is not implemented for `Foo`
+   |
+   = help: the following implementations were found:
+             <Foo as HasComponent<<Foo as Component<Foo>>::Interface>>
+note: required because of the requirements on the impl of `Component<Foo>` for `Foo`
+  --> $DIR/issue-91594.rs:13:27
+   |
+LL | impl<M: HasComponent<()>> Component<M> for Foo {
+   |                           ^^^^^^^^^^^^     ^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
index 14a49f20e6b22f9850e8c588f4c779f8e78d7a9b..a46047d91743d899d83ca79db0bc1e75553de94d 100644 (file)
@@ -10,5 +10,5 @@ extern crate std;
 trait Animal { }
 
 fn main() {
-              pub type ServeFut = /*impl Trait*/;
-          }
+        pub type ServeFut = /*impl Trait*/;
+    }
index 667652106987a6bff185c95d32c0334f2ed1c90e..2a4bcd773c684a508bcaff5c70c3405cf3ab9e47 100644 (file)
@@ -4,7 +4,7 @@
 use clippy_utils::ty::is_copy;
 use clippy_utils::{is_expn_of, is_lint_allowed, meets_msrv, msrvs, path_to_local};
 use if_chain::if_chain;
-use rustc_data_structures::fx::{FxHashMap, FxHashSet};
+use rustc_data_structures::fx::{FxHashSet, FxIndexMap};
 use rustc_errors::Applicability;
 use rustc_hir as hir;
 use rustc_hir::intravisit::{self, Visitor};
@@ -92,9 +92,9 @@ fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'_>) {
     extract_msrv_attr!(LateContext);
 }
 
-fn find_slice_values(cx: &LateContext<'_>, pat: &hir::Pat<'_>) -> FxHashMap<hir::HirId, SliceLintInformation> {
+fn find_slice_values(cx: &LateContext<'_>, pat: &hir::Pat<'_>) -> FxIndexMap<hir::HirId, SliceLintInformation> {
     let mut removed_pat: FxHashSet<hir::HirId> = FxHashSet::default();
-    let mut slices: FxHashMap<hir::HirId, SliceLintInformation> = FxHashMap::default();
+    let mut slices: FxIndexMap<hir::HirId, SliceLintInformation> = FxIndexMap::default();
     pat.walk_always(|pat| {
         if let hir::PatKind::Binding(binding, value_hir_id, ident, sub_pat) = pat.kind {
             // We'll just ignore mut and ref mut for simplicity sake right now
@@ -208,10 +208,10 @@ fn new(ident: Ident, needs_ref: bool) -> Self {
 
 fn filter_lintable_slices<'a, 'tcx>(
     cx: &'a LateContext<'tcx>,
-    slice_lint_info: FxHashMap<hir::HirId, SliceLintInformation>,
+    slice_lint_info: FxIndexMap<hir::HirId, SliceLintInformation>,
     max_suggested_slice: u64,
     scope: &'tcx hir::Expr<'tcx>,
-) -> FxHashMap<hir::HirId, SliceLintInformation> {
+) -> FxIndexMap<hir::HirId, SliceLintInformation> {
     let mut visitor = SliceIndexLintingVisitor {
         cx,
         slice_lint_info,
@@ -225,7 +225,7 @@ fn filter_lintable_slices<'a, 'tcx>(
 
 struct SliceIndexLintingVisitor<'a, 'tcx> {
     cx: &'a LateContext<'tcx>,
-    slice_lint_info: FxHashMap<hir::HirId, SliceLintInformation>,
+    slice_lint_info: FxIndexMap<hir::HirId, SliceLintInformation>,
     max_suggested_slice: u64,
 }
 
index b7a242cf90a43369e752aa36451fd8e65b52f597..a75f6b86a9bae4de295769ec1a72c5bfcd4db38c 100644 (file)
@@ -339,15 +339,13 @@ pub fn parse(cx: &LateContext<'_>, expr: &'tcx Expr<'tcx>) -> Option<Self> {
         expr_visitor_no_bodies(|e| {
             // if we're still inside of the macro definition...
             if e.span.ctxt() == expr.span.ctxt() {
-                // ArgumnetV1::new(<value>, <format_trait>::fmt)
+                // ArgumnetV1::new_<format_trait>(<value>)
                 if_chain! {
-                    if let ExprKind::Call(callee, [val, fmt_path]) = e.kind;
+                    if let ExprKind::Call(callee, [val]) = e.kind;
                     if let ExprKind::Path(QPath::TypeRelative(ty, seg)) = callee.kind;
-                    if seg.ident.name == sym::new;
                     if let hir::TyKind::Path(QPath::Resolved(_, path)) = ty.kind;
                     if path.segments.last().unwrap().ident.name == sym::ArgumentV1;
-                    if let ExprKind::Path(QPath::Resolved(_, path)) = fmt_path.kind;
-                    if let [.., fmt_trait, _fmt] = path.segments;
+                    if seg.ident.name.as_str().starts_with("new_");
                     then {
                         let val_idx = if_chain! {
                             if val.span.ctxt() == expr.span.ctxt();
@@ -361,7 +359,19 @@ pub fn parse(cx: &LateContext<'_>, expr: &'tcx Expr<'tcx>) -> Option<Self> {
                                 formatters.len()
                             }
                         };
-                        formatters.push((val_idx, fmt_trait.ident.name));
+                        let fmt_trait = match seg.ident.name.as_str() {
+                            "new_display" => "Display",
+                            "new_debug" => "Debug",
+                            "new_lower_exp" => "LowerExp",
+                            "new_upper_exp" => "UpperExp",
+                            "new_octal" => "Octal",
+                            "new_pointer" => "Pointer",
+                            "new_binary" => "Binary",
+                            "new_lower_hex" => "LowerHex",
+                            "new_upper_hex" => "UpperHex",
+                            _ => unreachable!(),
+                        };
+                        formatters.push((val_idx, Symbol::intern(fmt_trait)));
                     }
                 }
                 if let ExprKind::Struct(QPath::Resolved(_, path), ..) = e.kind {