]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #61394 - pietroalbini:rollup-lzugnb4, r=pietroalbini
authorbors <bors@rust-lang.org>
Sat, 1 Jun 2019 00:57:37 +0000 (00:57 +0000)
committerbors <bors@rust-lang.org>
Sat, 1 Jun 2019 00:57:37 +0000 (00:57 +0000)
Rollup of 11 pull requests

Successful merges:

 - #60897 (error: remove StringError from Debug output)
 - #61304 (Speed up Azure CI installing Windows dependencies)
 - #61319 (Swap order of `unsafe async fn` to `async unsafe fn`)
 - #61342 (Set ellipsis_inclusive_range_patterns lint to warn)
 - #61344 (Add regression test for const generics ICE)
 - #61359 (Fix links in Deref documentation)
 - #61363 (Stabilize iter_nth_back feature)
 - #61369 (Fixed lifetime misspelling)
 - #61372 (Migrate some books to mdbook version 0.2)
 - #61374 (Explicitly suggest 'type_ascription' feature)
 - #61382 (Fixed a typo in core::convert::AsMut)

Failed merges:

r? @ghost

47 files changed:
.azure-pipelines/steps/install-clang.yml
.azure-pipelines/steps/install-sccache.yml
.azure-pipelines/steps/install-windows-build-deps.yml
src/bootstrap/doc.rs
src/doc/rustdoc/src/command-line-arguments.md
src/doc/rustdoc/src/passes.md
src/doc/unstable-book/src/language-features/asm.md
src/doc/unstable-book/src/language-features/box-patterns.md
src/doc/unstable-book/src/language-features/box-syntax.md
src/doc/unstable-book/src/language-features/global-asm.md
src/doc/unstable-book/src/language-features/lang-items.md
src/doc/unstable-book/src/language-features/non-ascii-idents.md
src/doc/unstable-book/src/language-features/plugin-registrar.md
src/doc/unstable-book/src/language-features/plugin.md
src/doc/unstable-book/src/language-features/unboxed-closures.md
src/doc/unstable-book/src/library-features/fn-traits.md
src/doc/unstable-book/src/library-features/fnbox.md
src/doc/unstable-book/src/the-unstable-book.md
src/liballoc/lib.rs
src/libcore/convert.rs
src/libcore/iter/traits/double_ended.rs
src/libcore/ops/deref.rs
src/libcore/tests/lib.rs
src/librustc_codegen_ssa/README.md
src/librustc_lint/builtin.rs
src/libstd/error.rs
src/libsyntax/parse/diagnostics.rs
src/libsyntax/parse/parser.rs
src/test/run-pass/associated-consts/associated-const-range-match-patterns.rs
src/test/run-pass/binding/pat-ranges.rs
src/test/run-pass/inc-range-pat.rs
src/test/run-pass/issues/issue-15881-model-lexer-dotdotdot.rs
src/test/run-pass/mir/mir_build_match_comparisons.rs
src/test/ui/async-await/async-await.rs
src/test/ui/async-await/await-macro.rs
src/test/ui/const-generics/const-generic-array-wrapper.rs [new file with mode: 0644]
src/test/ui/const-generics/const-generic-array-wrapper.stderr [new file with mode: 0644]
src/test/ui/issues/issue-22644.stderr
src/test/ui/issues/issue-34255-1.stderr
src/test/ui/lifetime_starts_expressions.stderr
src/test/ui/lint/issue-54538-unused-parens-lint.rs
src/test/ui/lint/issue-54538-unused-parens-lint.stderr
src/test/ui/match/match-range-fail-dominate.rs
src/test/ui/match/match-range-fail-dominate.stderr
src/test/ui/nll/issue-57960.rs
src/test/ui/parser/recover-from-bad-variant.stderr
src/test/ui/type/type-ascription-instead-of-statement-end.stderr

index e1a6ea510d087550d787a6c3bdd96bb3d6f2c482..0cd6f24e32c7cf186416366fa415724f1306100e 100644 (file)
@@ -27,7 +27,7 @@ steps:
 # Original downloaded here came from
 # http://releases.llvm.org/7.0.0/LLVM-7.0.0-win64.exe
 - script: |
-    powershell -Command "iwr -outf %TEMP%\LLVM-7.0.0-win64.exe https://rust-lang-ci2.s3.amazonaws.com/rust-ci-mirror/LLVM-7.0.0-win64.exe"
+    powershell -Command "$ProgressPreference = 'SilentlyContinue'; iwr -outf %TEMP%\LLVM-7.0.0-win64.exe https://rust-lang-ci2.s3.amazonaws.com/rust-ci-mirror/LLVM-7.0.0-win64.exe"
     set CLANG_DIR=%CD%\citools\clang-rust
     %TEMP%\LLVM-7.0.0-win64.exe /S /NCRC /D=%CLANG_DIR%
     set RUST_CONFIGURE_ARGS=%RUST_CONFIGURE_ARGS% --set llvm.clang-cl=%CLANG_DIR%\bin\clang-cl.exe
index 7622f716cc801e6c6dc8042b0c66d576f6c469f8..427e50f571f764197cfca484c0e93fd6da670808 100644 (file)
@@ -9,7 +9,7 @@ steps:
 
 - script: |
     md sccache
-    powershell -Command "iwr -outf sccache\sccache.exe https://rust-lang-ci2.s3.amazonaws.com/rust-ci-mirror/2018-04-26-sccache-x86_64-pc-windows-msvc"
+    powershell -Command "$ProgressPreference = 'SilentlyContinue'; iwr -outf sccache\sccache.exe https://rust-lang-ci2.s3.amazonaws.com/rust-ci-mirror/2018-04-26-sccache-x86_64-pc-windows-msvc"
     echo ##vso[task.prependpath]%CD%\sccache
   displayName: Install sccache (Windows)
   condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
index d79ebe973bafbd623791ac22a0cd74797e211fd3..04662a69c87477a16d807449512e62d3daba6ab0 100644 (file)
@@ -54,9 +54,9 @@ steps:
 # Note that we don't literally overwrite the gdb.exe binary because it appears
 # to just use gdborig.exe, so that's the binary we deal with instead.
 - script: |
-    powershell -Command "iwr -outf %MINGW_ARCHIVE% %MINGW_URL%/%MINGW_ARCHIVE%"
+    powershell -Command "$ProgressPreference = 'SilentlyContinue'; iwr -outf %MINGW_ARCHIVE% %MINGW_URL%/%MINGW_ARCHIVE%"
     7z x -y %MINGW_ARCHIVE% > nul
-    powershell -Command "iwr -outf 2017-04-20-%MSYS_BITS%bit-gdborig.exe %MINGW_URL%/2017-04-20-%MSYS_BITS%bit-gdborig.exe"
+    powershell -Command "$ProgressPreference = 'SilentlyContinue'; iwr -outf 2017-04-20-%MSYS_BITS%bit-gdborig.exe %MINGW_URL%/2017-04-20-%MSYS_BITS%bit-gdborig.exe"
     mv 2017-04-20-%MSYS_BITS%bit-gdborig.exe %MINGW_DIR%\bin\gdborig.exe
     echo ##vso[task.prependpath]%CD%\%MINGW_DIR%\bin
   condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'), ne(variables['MINGW_URL'],''))
@@ -81,7 +81,7 @@ steps:
 # Note that this is originally from the github releases patch of Ninja
 - script: |
     md ninja
-    powershell -Command "iwr -outf 2017-03-15-ninja-win.zip https://rust-lang-ci2.s3.amazonaws.com/rust-ci-mirror/2017-03-15-ninja-win.zip"
+    powershell -Command "$ProgressPreference = 'SilentlyContinue'; iwr -outf 2017-03-15-ninja-win.zip https://rust-lang-ci2.s3.amazonaws.com/rust-ci-mirror/2017-03-15-ninja-win.zip"
     7z x -oninja 2017-03-15-ninja-win.zip
     del 2017-03-15-ninja-win.zip
     set RUST_CONFIGURE_ARGS=%RUST_CONFIGURE_ARGS% --enable-ninja
index 12bdfa5691dc744a7479a6074d6d546ccb3965b0..2a3577a3d20446b0593ec1ba1f916125cdbea3ca 100644 (file)
@@ -62,11 +62,11 @@ fn run(self, builder: &Builder<'_>) {
 book!(
     EditionGuide, "src/doc/edition-guide", "edition-guide", RustbookVersion::MdBook2;
     EmbeddedBook, "src/doc/embedded-book", "embedded-book", RustbookVersion::MdBook2;
-    Nomicon, "src/doc/nomicon", "nomicon", RustbookVersion::MdBook1;
+    Nomicon, "src/doc/nomicon", "nomicon", RustbookVersion::MdBook2;
     Reference, "src/doc/reference", "reference", RustbookVersion::MdBook1;
     RustByExample, "src/doc/rust-by-example", "rust-by-example", RustbookVersion::MdBook1;
     RustcBook, "src/doc/rustc", "rustc", RustbookVersion::MdBook1;
-    RustdocBook, "src/doc/rustdoc", "rustdoc", RustbookVersion::MdBook1;
+    RustdocBook, "src/doc/rustdoc", "rustdoc", RustbookVersion::MdBook2;
 );
 
 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
@@ -134,7 +134,7 @@ fn run(self, builder: &Builder<'_>) {
             target: self.target,
             name: INTERNER.intern_str("unstable-book"),
             src: builder.md_doc_out(self.target),
-            version: RustbookVersion::MdBook1,
+            version: RustbookVersion::MdBook2,
         })
     }
 }
index aba485f752ab2bd9b706a1a9739d32bfd2ae1d5c..b21defaedc31312147423bd3c051d9a34b472973 100644 (file)
@@ -178,7 +178,7 @@ $ rustdoc src/lib.rs --passes strip-priv-imports
 An argument of "list" will print a list of possible "rustdoc passes", and other
 arguments will be the name of which passes to run in addition to the defaults.
 
-For more details on passes, see [the chapter on them](passes.html).
+For more details on passes, see [the chapter on them](passes.md).
 
 See also `--no-defaults`.
 
@@ -194,7 +194,7 @@ By default, `rustdoc` will run several passes over your code. This
 removes those defaults, allowing you to use `--passes` to specify
 exactly which passes you want.
 
-For more details on passes, see [the chapter on them](passes.html).
+For more details on passes, see [the chapter on them](passes.md).
 
 See also `--passes`.
 
@@ -207,7 +207,7 @@ $ rustdoc src/lib.rs --test
 ```
 
 This flag will run your code examples as tests. For more, see [the chapter
-on documentation tests](documentation-tests.html).
+on documentation tests](documentation-tests.md).
 
 See also `--test-args`.
 
@@ -220,7 +220,7 @@ $ rustdoc src/lib.rs --test --test-args ignored
 ```
 
 This flag will pass options to the test runner when running documentation tests.
-For more, see [the chapter on documentation tests](documentation-tests.html).
+For more, see [the chapter on documentation tests](documentation-tests.md).
 
 See also `--test`.
 
index 615b3dca199f1cc218a426b49b1bfd2e74d40435..12d4ea205b31e64308106741522b85a910300d99 100644 (file)
@@ -5,8 +5,8 @@ Rustdoc has a concept called "passes". These are transformations that
 
 In addition to the passes below, check out the docs for these flags:
 
-* [`--passes`](command-line-arguments.html#a--passes-add-more-rustdoc-passes)
-* [`--no-defaults`](command-line-arguments.html#a--no-defaults-dont-run-default-passes)
+* [`--passes`](command-line-arguments.md#--passes-add-more-rustdoc-passes)
+* [`--no-defaults`](command-line-arguments.md#--no-defaults-dont-run-default-passes)
 
 ## Default passes
 
index f22095fe5de2e632bdcaae4142b204b744815748..2a1b6397781f95fc9a98fbb620c6e5b2dd29aae8 100644 (file)
@@ -190,4 +190,4 @@ constraints, etc.
 [llvm-docs]: http://llvm.org/docs/LangRef.html#inline-assembler-expressions
 
 If you need more power and don't mind losing some of the niceties of
-`asm!`, check out [global_asm](language-features/global-asm.html).
+`asm!`, check out [global_asm](global-asm.md).
index 0896627acae1b3203a39d1463bcae4d6e470fa19..bf0819ec920b7f0462ad912fa87ad80124e1c34c 100644 (file)
@@ -4,7 +4,7 @@ The tracking issue for this feature is: [#29641]
 
 [#29641]: https://github.com/rust-lang/rust/issues/29641
 
-See also [`box_syntax`](language-features/box-syntax.html)
+See also [`box_syntax`](box-syntax.md)
 
 ------------------------
 
index 414dc48e557d3ec3f391fbb7bd288c19a88a33e4..9569974d22ca28124cd888e78c56a9a81d15aedf 100644 (file)
@@ -4,7 +4,7 @@ The tracking issue for this feature is: [#49733]
 
 [#49733]: https://github.com/rust-lang/rust/issues/49733
 
-See also [`box_patterns`](language-features/box-patterns.html)
+See also [`box_patterns`](box-patterns.md)
 
 ------------------------
 
index f1ef74a63b513acedd4ff96396812640b451ac9b..bc55fe80fa64c599f954ebdedd613ebba60465e1 100644 (file)
@@ -75,4 +75,4 @@ usages and placed the larger, single usage in the crate root.
 If you don't need quite as much power and flexibility as
 `global_asm!` provides, and you don't mind restricting your inline
 assembly to `fn` bodies only, you might try the
-[asm](language-features/asm.html) feature instead.
+[asm](asm.md) feature instead.
index b16739b4743a9ebb0070527216419f6388da4fb3..3ee024c6b588361e8f10a3f593aebf1f60b6333d 100644 (file)
@@ -192,7 +192,7 @@ such as "```undefined reference to `__rust_probestack'```". Using this crate
 also requires enabling the library feature `compiler_builtins_lib`. You can read
 more about this [here][compiler-builtins-lib].
 
-[compiler-builtins-lib]: library-features/compiler-builtins-lib.html
+[compiler-builtins-lib]: ../library-features/compiler-builtins-lib.md
 
 ## More about the language items
 
index 46957c00bf95c749961c44af34d0e455871c5967..22dae0c89a6ff5a460ef4c04679f2b29c24ca0c6 100644 (file)
@@ -45,4 +45,4 @@ that does _not_ occur in the set of [strict keywords].
 
 [`XID_start`]:  http://unicode.org/cldr/utility/list-unicodeset.jsp?a=%5B%3AXID_Start%3A%5D&abb=on&g=&i=
 [`XID_continue`]: http://unicode.org/cldr/utility/list-unicodeset.jsp?a=%5B%3AXID_Continue%3A%5D&abb=on&g=&i=
-[strict keywords]: ../reference/keywords.html#strict-keywords
+[strict keywords]: ../../reference/keywords.md#strict-keywords
index b16e2ac2d221c97941e4f4ba0c01b31781335bed..bf5dd81d735af768be0994f50fa6fb6193be9569 100644 (file)
@@ -8,6 +8,6 @@ This feature is part of "compiler plugins." It will often be used with the
 [`plugin`] and `rustc_private` features as well. For more details, see
 their docs.
 
-[`plugin`]: language-features/plugin.html
+[`plugin`]: plugin.md
 
 ------------------------
index 49fe7c9e994fe15b7f1df0ddebd4806f1af429d0..43fffd680372fb1330454972561e42abd40a434d 100644 (file)
@@ -8,7 +8,7 @@ The tracking issue for this feature is: [#29597]
 This feature is part of "compiler plugins." It will often be used with the
 [`plugin_registrar`] and `rustc_private` features.
 
-[`plugin_registrar`]: language-features/plugin-registrar.html
+[`plugin_registrar`]: plugin-registrar.md
 
 ------------------------
 
@@ -39,7 +39,7 @@ of a library.
 
 Plugins can extend Rust's syntax in various ways. One kind of syntax extension
 is the procedural macro. These are invoked the same way as [ordinary
-macros](../book/macros.html), but the expansion is performed by arbitrary Rust
+macros](../../book/macros.md), but the expansion is performed by arbitrary Rust
 code that manipulates syntax trees at
 compile time.
 
@@ -130,7 +130,7 @@ The advantages over a simple `fn(&str) -> u32` are:
   a way to define new literal syntax for any data type.
 
 In addition to procedural macros, you can define new
-[`derive`](../reference/attributes/derive.html)-like attributes and other kinds
+[`derive`](../../reference/attributes/derive.md)-like attributes and other kinds
 of extensions.  See `Registry::register_syntax_extension` and the
 `SyntaxExtension` enum.  For a more involved macro example, see
 [`regex_macros`](https://github.com/rust-lang/regex/blob/master/regex_macros/src/lib.rs).
@@ -174,7 +174,7 @@ quasiquote as an ordinary plugin library.
 # Lint plugins
 
 Plugins can extend [Rust's lint
-infrastructure](../reference/attributes/diagnostics.html#lint-check-attributes) with
+infrastructure](../../reference/attributes/diagnostics.md#lint-check-attributes) with
 additional checks for code style, safety, etc. Now let's write a plugin
 [`lint_plugin_test.rs`](https://github.com/rust-lang/rust/blob/master/src/test/ui-fulldeps/auxiliary/lint_plugin_test.rs)
 that warns about any item named `lintme`.
@@ -253,7 +253,7 @@ mostly use the same infrastructure as lint plugins, and provide examples of how
 to access type information.
 
 Lints defined by plugins are controlled by the usual [attributes and compiler
-flags](../reference/attributes/diagnostics.html#lint-check-attributes), e.g.
+flags](../../reference/attributes/diagnostics.md#lint-check-attributes), e.g.
 `#[allow(test_lint)]` or `-A test-lint`. These identifiers are derived from the
 first argument to `declare_lint!`, with appropriate case and punctuation
 conversion.
index d845c99a88a691946d439861d7df4acec850a998..71003fba00ba237e9fed3601258d7aa18c502165 100644 (file)
@@ -2,7 +2,7 @@
 
 The tracking issue for this feature is [#29625]
 
-See Also: [`fn_traits`](library-features/fn-traits.html)
+See Also: [`fn_traits`](../library-features/fn-traits.md)
 
 [#29625]: https://github.com/rust-lang/rust/issues/29625
 
index 72a3f36c10b69ed1d6acc28e9577c085d71e9cd1..29a8aecee6c2fd26e5420a2c06640823e01b99fa 100644 (file)
@@ -2,7 +2,7 @@
 
 The tracking issue for this feature is [#29625]
 
-See Also: [`unboxed_closures`](language-features/unboxed-closures.html)
+See Also: [`unboxed_closures`](../language-features/unboxed-closures.md)
 
 [#29625]: https://github.com/rust-lang/rust/issues/29625
 
index cb3386b7152112a5953d457b12c36c181f061618..97e32cc0acb121ef319d51fa79275dbd5e2073ba 100644 (file)
@@ -27,6 +27,6 @@ impl<A, F> Fn for &F where F: Fn<A> + ?Sized {}
 
 Before the introduction of [`unsized_locals`][unsized_locals], we had been unable to provide the former impls. That means, unlike `&dyn Fn()` or `&mut dyn FnMut()` we could not use `Box<dyn FnOnce()>` at that time.
 
-[unsized_locals]: language-features/unsized-locals.html
+[unsized_locals]: ../language-features/unsized-locals.md
 
 `FnBox()` is an alternative approach to `Box<dyn FnBox()>` is delegated to `FnBox::call_box` which doesn't need unsized locals. As we now have `Box<dyn FnOnce()>` working, the `fnbox` feature is going to be removed.
index 604b449f16379956897e2965c600ad86d80917e3..554c52c3c9c2761c7f6768a51923c7b36fdbf2c5 100644 (file)
@@ -14,7 +14,7 @@ fn main() {
 
 The `box_syntax` feature [has a chapter][box] describing how to use it.
 
-[box]: language-features/box-syntax.html
+[box]: language-features/box-syntax.md
 
 Because this documentation relates to unstable features, we make no guarantees
 that what is contained here is accurate or up to date. It's developed on a
index d90036eaf49b8f3da6389d23e8f978f69fe5984e..bfc008e14a486f870edffde929bdaca1f939d989 100644 (file)
 #![feature(maybe_uninit_extra, maybe_uninit_slice, maybe_uninit_array)]
 #![feature(alloc_layout_extra)]
 #![feature(try_trait)]
-#![feature(iter_nth_back)]
 
 // Allow testing this library
 
index b3ff447be5ee4802f110e4c601b38007b9a30bef..a2796ad0cf0b0e898adac7b06a1952d7ef617172 100644 (file)
@@ -177,8 +177,8 @@ pub trait AsRef<T: ?Sized> {
 ///
 /// Using `AsMut` as trait bound for a generic function we can accept all mutable references
 /// that can be converted to type `&mut T`. Because [`Box<T>`] implements `AsMut<T>` we can
-/// write a function `add_one`that takes all arguments that can be converted to `&mut u64`.
-/// Because [`Box<T>`] implements `AsMut<T>` `add_one` accepts arguments of type
+/// write a function `add_one` that takes all arguments that can be converted to `&mut u64`.
+/// Because [`Box<T>`] implements `AsMut<T>`, `add_one` accepts arguments of type
 /// `&mut Box<u64>` as well:
 ///
 /// ```
index 06de95c082724bdfcefa15e972374ee46aed10ae..2c1aeb5690a585d0e254bc4b274b9828597a5b8d 100644 (file)
@@ -88,7 +88,6 @@ pub trait DoubleEndedIterator: Iterator {
     /// Basic usage:
     ///
     /// ```
-    /// #![feature(iter_nth_back)]
     /// let a = [1, 2, 3];
     /// assert_eq!(a.iter().nth_back(2), Some(&1));
     /// ```
@@ -96,7 +95,6 @@ pub trait DoubleEndedIterator: Iterator {
     /// Calling `nth_back()` multiple times doesn't rewind the iterator:
     ///
     /// ```
-    /// #![feature(iter_nth_back)]
     /// let a = [1, 2, 3];
     ///
     /// let mut iter = a.iter();
@@ -108,12 +106,11 @@ pub trait DoubleEndedIterator: Iterator {
     /// Returning `None` if there are less than `n + 1` elements:
     ///
     /// ```
-    /// #![feature(iter_nth_back)]
     /// let a = [1, 2, 3];
     /// assert_eq!(a.iter().nth_back(10), None);
     /// ```
     #[inline]
-    #[unstable(feature = "iter_nth_back", issue = "56995")]
+    #[stable(feature = "iter_nth_back", since = "1.37.0")]
     fn nth_back(&mut self, mut n: usize) -> Option<Self::Item> {
         for x in self.rev() {
             if n == 0 { return Some(x) }
index e44a6c4d2a0e92a13d35ccc978d56ba5030df1b8..ce0d3fd01f78fefc030dbe2d2a3b67afbfc7561c 100644 (file)
@@ -23,9 +23,9 @@
 /// * Values of type `&T` are coerced to values of type `&U`
 /// * `T` implicitly implements all the (immutable) methods of the type `U`.
 ///
-/// For more details, visit [the chapter in *The Rust Programming Language*]
-/// [book] as well as the reference sections on [the dereference operator]
-/// [ref-deref-op], [method resolution] and [type coercions].
+/// For more details, visit [the chapter in *The Rust Programming Language*][book]
+/// as well as the reference sections on [the dereference operator][ref-deref-op],
+/// [method resolution] and [type coercions].
 ///
 /// [book]: ../../book/ch15-02-deref.html
 /// [`DerefMut`]: trait.DerefMut.html
@@ -113,9 +113,9 @@ fn deref(&self) -> &T { *self }
 /// * Values of type `&mut T` are coerced to values of type `&mut U`
 /// * `T` implicitly implements all the (mutable) methods of the type `U`.
 ///
-/// For more details, visit [the chapter in *The Rust Programming Language*]
-/// [book] as well as the reference sections on [the dereference operator]
-/// [ref-deref-op], [method resolution] and [type coercions].
+/// For more details, visit [the chapter in *The Rust Programming Language*][book]
+/// as well as the reference sections on [the dereference operator][ref-deref-op],
+/// [method resolution] and [type coercions].
 ///
 /// [book]: ../../book/ch15-02-deref.html
 /// [`Deref`]: trait.Deref.html
index c617596aba80159af2ecb5f3c4967bc099897f8f..0dba2bed62c93c30526be8e91429d5763bce5223 100644 (file)
@@ -10,7 +10,6 @@
 #![feature(fmt_internals)]
 #![feature(hashmap_internals)]
 #![feature(is_sorted)]
-#![feature(iter_nth_back)]
 #![feature(iter_once_with)]
 #![feature(pattern)]
 #![feature(range_is_empty)]
index 9e1d429180367c199e435743644faeaa32cbc9fa..11fac239edf124d8bce7dd17cb86f7ad5d5735f5 100644 (file)
@@ -26,7 +26,7 @@ While the LLVM-specific code will be left in `rustc_codegen_llvm`, all the new t
 
 @irinagpopa started to parametrize the types of `rustc_codegen_llvm` by a generic `Value` type, implemented in LLVM by a reference `&'ll Value`. This work has been extended to all structures inside the `mir` folder and elsewhere, as well as for LLVM's `BasicBlock` and `Type` types.
 
-The two most important structures for the LLVM codegen are `CodegenCx` and `Builder`. They are parametrized by multiple liftime parameters and the type for `Value`.
+The two most important structures for the LLVM codegen are `CodegenCx` and `Builder`. They are parametrized by multiple lifetime parameters and the type for `Value`.
 
 ```rust
 struct CodegenCx<'ll, 'tcx: 'll> {
index 44b727c6925d94c544e6f53133e22b7d5e6f91c5..f9a12c19e427606dfc7d685bfe9a6a739a747dc9 100644 (file)
@@ -1275,7 +1275,7 @@ fn check_item(
 
 declare_lint! {
     pub ELLIPSIS_INCLUSIVE_RANGE_PATTERNS,
-    Allow,
+    Warn,
     "`...` range patterns are deprecated"
 }
 
index c8978a94fcda46507e007c3cdf58fc0bfaadc453..5cc7dcdae1fcd5917db45d4210891758b3041df4 100644 (file)
@@ -314,7 +314,6 @@ impl From<String> for Box<dyn Error + Send + Sync> {
     ///     mem::size_of::<Box<dyn Error + Send + Sync>>() == mem::size_of_val(&a_boxed_error))
     /// ```
     fn from(err: String) -> Box<dyn Error + Send + Sync> {
-        #[derive(Debug)]
         struct StringError(String);
 
         impl Error for StringError {
@@ -327,6 +326,13 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
             }
         }
 
+        // Purposefully skip printing "StringError(..)"
+        impl Debug for StringError {
+            fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+                Debug::fmt(&self.0, f)
+            }
+        }
+
         Box::new(StringError(err))
     }
 }
index b3d49524d7668599e9d37ed6d46907db65981776..2e4d4c091398ea5770080490b260312ca6c8c186 100644 (file)
@@ -858,8 +858,8 @@ pub fn unexpected_try_recover(
                     Applicability::MaybeIncorrect,
                 );
             } else {
-                err.note("type ascription is a nightly-only feature that lets \
-                          you annotate an expression with a type: `<expr>: <type>`")
+                err.note("#![feature(type_ascription)] lets you annotate an \
+                          expression with a type: `<expr>: <type>`")
                     .span_note(
                         lhs_span,
                         "this expression expects an ascribed type after the colon",
index 746e9cad4962ca4057e9214ef433aedaedade7f2..92c27f883d1a9ec882d3a12fd36ca009148d916a 100644 (file)
@@ -7205,44 +7205,41 @@ fn parse_item_implementation(
             return Ok(Some(item));
         }
 
-        // `unsafe async fn` or `async fn`
-        if (
-            self.check_keyword(kw::Unsafe) &&
-            self.is_keyword_ahead(1, &[kw::Async])
-        ) || (
-            self.check_keyword(kw::Async) &&
-            self.is_keyword_ahead(1, &[kw::Fn])
-        )
-        {
-            // ASYNC FUNCTION ITEM
-            let unsafety = self.parse_unsafety();
-            self.expect_keyword(kw::Async)?;
-            let async_span = self.prev_span;
-            self.expect_keyword(kw::Fn)?;
-            let fn_span = self.prev_span;
-            let (ident, item_, extra_attrs) =
-                self.parse_item_fn(unsafety,
-                                   respan(async_span, IsAsync::Async {
-                                       closure_id: ast::DUMMY_NODE_ID,
-                                       return_impl_trait_id: ast::DUMMY_NODE_ID,
-                                       arguments: Vec::new(),
-                                   }),
-                                   respan(fn_span, Constness::NotConst),
-                                   Abi::Rust)?;
-            let prev_span = self.prev_span;
-            let item = self.mk_item(lo.to(prev_span),
-                                    ident,
-                                    item_,
-                                    visibility,
-                                    maybe_append(attrs, extra_attrs));
-            if self.span.rust_2015() {
-                self.diagnostic().struct_span_err_with_code(
-                    async_span,
-                    "`async fn` is not permitted in the 2015 edition",
-                    DiagnosticId::Error("E0670".into())
-                ).emit();
+        // Parse `async unsafe? fn`.
+        if self.check_keyword(kw::Async) {
+            let async_span = self.span;
+            if self.is_keyword_ahead(1, &[kw::Fn])
+                || self.is_keyword_ahead(2, &[kw::Fn])
+            {
+                // ASYNC FUNCTION ITEM
+                self.bump(); // `async`
+                let unsafety = self.parse_unsafety(); // `unsafe`?
+                self.expect_keyword(kw::Fn)?; // `fn`
+                let fn_span = self.prev_span;
+                let (ident, item_, extra_attrs) =
+                    self.parse_item_fn(unsafety,
+                                    respan(async_span, IsAsync::Async {
+                                        closure_id: ast::DUMMY_NODE_ID,
+                                        return_impl_trait_id: ast::DUMMY_NODE_ID,
+                                        arguments: Vec::new(),
+                                    }),
+                                    respan(fn_span, Constness::NotConst),
+                                    Abi::Rust)?;
+                let prev_span = self.prev_span;
+                let item = self.mk_item(lo.to(prev_span),
+                                        ident,
+                                        item_,
+                                        visibility,
+                                        maybe_append(attrs, extra_attrs));
+                if self.span.rust_2015() {
+                    self.diagnostic().struct_span_err_with_code(
+                        async_span,
+                        "`async fn` is not permitted in the 2015 edition",
+                        DiagnosticId::Error("E0670".into())
+                    ).emit();
+                }
+                return Ok(Some(item));
             }
-            return Ok(Some(item));
         }
         if self.check_keyword(kw::Unsafe) &&
             self.is_keyword_ahead(1, &[kw::Trait, kw::Auto])
index 4801369cfd1a8a3ffeb0fba3aaaa17f829669c56..5276869a702eeb0c83e2c597d46cc5d4b7cf54fc 100644 (file)
@@ -1,5 +1,6 @@
 // run-pass
 #![allow(dead_code, unreachable_patterns)]
+#![allow(ellipsis_inclusive_range_patterns)]
 
 struct Foo;
 
@@ -23,4 +24,17 @@ fn main() {
         <Foo as HasNum>::NUM ... <Foo>::NUM => true,
         _ => false,
     });
+
+    assert!(match 2 {
+        Foo::NUM ..= 3 => true,
+        _ => false,
+    });
+    assert!(match 0 {
+        -1 ..= <Foo as HasNum>::NUM => true,
+        _ => false,
+    });
+    assert!(match 1 {
+        <Foo as HasNum>::NUM ..= <Foo>::NUM => true,
+        _ => false,
+    });
 }
index b3729a79615a647b5827a40dbf85b4a2ff1a8e76..19b3045784f86aab3b465914a8798e7f423b4e08 100644 (file)
@@ -1,6 +1,8 @@
 // run-pass
 // Parsing of range patterns
 
+#![allow(ellipsis_inclusive_range_patterns)]
+
 const NUM1: i32 = 10;
 
 mod m {
@@ -11,4 +13,8 @@ fn main() {
     if let NUM1 ... m::NUM2 = 10 {} else { panic!() }
     if let ::NUM1 ... ::m::NUM2 = 11 {} else { panic!() }
     if let -13 ... -10 = 12 { panic!() } else {}
+
+    if let NUM1 ..= m::NUM2 = 10 {} else { panic!() }
+    if let ::NUM1 ..= ::m::NUM2 = 11 {} else { panic!() }
+    if let -13 ..= -10 = 12 { panic!() } else {}
 }
index 6bf857a11f81657e0935f1bcd585f22d7ff5b41b..a648ff17492eedd11ee2fe56bcd961b5756f2267 100644 (file)
@@ -1,5 +1,7 @@
 // Test old and new syntax for inclusive range patterns.
 
+#![allow(ellipsis_inclusive_range_patterns)]
+
 fn main() {
     assert!(match 42 { 0 ... 100 => true, _ => false });
     assert!(match 42 { 0 ..= 100 => true, _ => false });
index 2470e37e1820b13a2cb5944c54036e94aefd6de7..dee7f25d7bb3a8a36491e7a760683a5b93f3dd31 100644 (file)
@@ -1,5 +1,6 @@
 // run-pass
 #![allow(illegal_floating_point_literal_pattern)] // FIXME #41620
+#![allow(ellipsis_inclusive_range_patterns)]
 
 // regression test for the model lexer handling the DOTDOTDOT syntax (#15877)
 
index 8913009f6915654f1fa11f61822311ce68c3c8a8..04570055763a96b0dfdde00cc9b4dd68b1703da8 100644 (file)
@@ -2,7 +2,7 @@
 #![allow(dead_code)]
 fn test1(x: i8) -> i32 {
   match x {
-    1...10 => 0,
+    1..=10 => 0,
     _ => 1,
   }
 }
index 6fa013e5c54ca6764f175da94a6a2b2c47ea41fa..38261ca4570eb96d0475010c1fe7fc238064e1b1 100644 (file)
@@ -122,7 +122,7 @@ fn async_fn_with_internal_borrow(y: u8) -> impl Future<Output = u8> {
     }
 }
 
-unsafe async fn unsafe_async_fn(x: u8) -> u8 {
+async unsafe fn unsafe_async_fn(x: u8) -> u8 {
     wake_and_yield_once().await;
     x
 }
index 1b807588d6ac2c78fb72ba1d3e06461a516f049e..7d8b7a257dad973c92fcfd5580f4be9551d85995 100644 (file)
@@ -122,7 +122,7 @@ fn async_fn_with_internal_borrow(y: u8) -> impl Future<Output = u8> {
     }
 }
 
-unsafe async fn unsafe_async_fn(x: u8) -> u8 {
+async unsafe fn unsafe_async_fn(x: u8) -> u8 {
     await!(wake_and_yield_once());
     x
 }
diff --git a/src/test/ui/const-generics/const-generic-array-wrapper.rs b/src/test/ui/const-generics/const-generic-array-wrapper.rs
new file mode 100644 (file)
index 0000000..adffe32
--- /dev/null
@@ -0,0 +1,18 @@
+// run-pass
+
+#![feature(const_generics)]
+//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
+
+struct Foo<T, const N: usize>([T; {N}]);
+
+impl<T, const N: usize> Foo<T, {N}> {
+    fn foo(&self) -> usize {
+        {N}
+    }
+}
+
+fn main() {
+    let foo = Foo([0u32; 21]);
+    assert_eq!(foo.0, [0u32; 21]);
+    assert_eq!(foo.foo(), 21);
+}
diff --git a/src/test/ui/const-generics/const-generic-array-wrapper.stderr b/src/test/ui/const-generics/const-generic-array-wrapper.stderr
new file mode 100644 (file)
index 0000000..f92e11d
--- /dev/null
@@ -0,0 +1,6 @@
+warning: the feature `const_generics` is incomplete and may cause the compiler to crash
+  --> $DIR/const-generic-array-wrapper.rs:3:12
+   |
+LL | #![feature(const_generics)]
+   |            ^^^^^^^^^^^^^^
+
index a28ea0d09f8f0fca7452fabb99118a15dc7155b0..cf36953546549c10e1d64d3f7c91d16c84062986 100644 (file)
@@ -89,7 +89,7 @@ error: expected type, found `4`
 LL |     println!("{}", a: &mut 4);
    |                            ^ expecting a type here because of type ascription
    |
-   = note: type ascription is a nightly-only feature that lets you annotate an expression with a type: `<expr>: <type>`
+   = note: #![feature(type_ascription)] lets you annotate an expression with a type: `<expr>: <type>`
 note: this expression expects an ascribed type after the colon
   --> $DIR/issue-22644.rs:34:20
    |
index 7899c8d30f1ddca60eea74c71ded0ba3b83918c1..01f395377701751b7d82e155c205c5154d52954f 100644 (file)
@@ -4,7 +4,7 @@ error: expected type, found `42`
 LL |     Test::Drill(field: 42);
    |                        ^^ expecting a type here because of type ascription
    |
-   = note: type ascription is a nightly-only feature that lets you annotate an expression with a type: `<expr>: <type>`
+   = note: #![feature(type_ascription)] lets you annotate an expression with a type: `<expr>: <type>`
 note: this expression expects an ascribed type after the colon
   --> $DIR/issue-34255-1.rs:8:17
    |
index cb5a52a3e081a75668a83902803fca0418b88ddb..8ae8018c2ff25f41d8018b21593eb9b1c35440b3 100644 (file)
@@ -14,7 +14,7 @@ error: expected type, found keyword `loop`
 LL |     loop { break 'label: loop { break 'label 42; }; }
    |                          ^^^^ expecting a type here because of type ascription
    |
-   = note: type ascription is a nightly-only feature that lets you annotate an expression with a type: `<expr>: <type>`
+   = note: #![feature(type_ascription)] lets you annotate an expression with a type: `<expr>: <type>`
 note: this expression expects an ascribed type after the colon
   --> $DIR/lifetime_starts_expressions.rs:6:12
    |
index 6ca53816e3c6b0f892a6a725fccf96b66ec831a7..3a52996195c0d6e9b1b11ba59c2fe9deb452d55a 100644 (file)
@@ -1,10 +1,32 @@
 // compile-pass
 
+#![allow(ellipsis_inclusive_range_patterns)]
 #![allow(unreachable_patterns)]
 #![allow(unused_variables)]
 #![warn(unused_parens)]
 
 fn main() {
+    match 1 {
+        (_) => {}         //~ WARNING: unnecessary parentheses around pattern
+        (y) => {}         //~ WARNING: unnecessary parentheses around pattern
+        (ref r) => {}     //~ WARNING: unnecessary parentheses around pattern
+        (e @ 1...2) => {} //~ WARNING: unnecessary parentheses around outer pattern
+        (1...2) => {}     // Non ambiguous range pattern should not warn
+        e @ (3...4) => {} // Non ambiguous range pattern should not warn
+    }
+
+    match &1 {
+        (e @ &(1...2)) => {} //~ WARNING: unnecessary parentheses around outer pattern
+        &(_) => {}           //~ WARNING: unnecessary parentheses around pattern
+        e @ &(1...2) => {}   // Ambiguous range pattern should not warn
+        &(1...2) => {}       // Ambiguous range pattern should not warn
+    }
+
+    match &1 {
+        e @ &(1...2) | e @ &(3...4) => {} // Complex ambiguous pattern should not warn
+        &_ => {}
+    }
+
     match 1 {
         (_) => {}         //~ WARNING: unnecessary parentheses around pattern
         (y) => {}         //~ WARNING: unnecessary parentheses around pattern
@@ -15,14 +37,14 @@ fn main() {
     }
 
     match &1 {
-        (e @ &(1...2)) => {} //~ WARNING: unnecessary parentheses around outer pattern
+        (e @ &(1..=2)) => {} //~ WARNING: unnecessary parentheses around outer pattern
         &(_) => {}           //~ WARNING: unnecessary parentheses around pattern
-        e @ &(1...2) => {}   // Ambiguous range pattern should not warn
+        e @ &(1..=2) => {}   // Ambiguous range pattern should not warn
         &(1..=2) => {}       // Ambiguous range pattern should not warn
     }
 
     match &1 {
-        e @ &(1...2) | e @ &(3..=4) => {} // Complex ambiguous pattern should not warn
+        e @ &(1..=2) | e @ &(3..=4) => {} // Complex ambiguous pattern should not warn
         &_ => {}
     }
 }
index 3cf321b072f40fe57b552cc1752f824c71e33d74..3b312198952a5b66cb51073302e3c2f8bf4283c9 100644 (file)
@@ -1,41 +1,77 @@
 warning: unnecessary parentheses around pattern
-  --> $DIR/issue-54538-unused-parens-lint.rs:9:9
+  --> $DIR/issue-54538-unused-parens-lint.rs:10:9
    |
 LL |         (_) => {}
    |         ^^^ help: remove these parentheses
    |
 note: lint level defined here
-  --> $DIR/issue-54538-unused-parens-lint.rs:5:9
+  --> $DIR/issue-54538-unused-parens-lint.rs:6:9
    |
 LL | #![warn(unused_parens)]
    |         ^^^^^^^^^^^^^
 
 warning: unnecessary parentheses around pattern
-  --> $DIR/issue-54538-unused-parens-lint.rs:10:9
+  --> $DIR/issue-54538-unused-parens-lint.rs:11:9
    |
 LL |         (y) => {}
    |         ^^^ help: remove these parentheses
 
 warning: unnecessary parentheses around pattern
-  --> $DIR/issue-54538-unused-parens-lint.rs:11:9
+  --> $DIR/issue-54538-unused-parens-lint.rs:12:9
    |
 LL |         (ref r) => {}
    |         ^^^^^^^ help: remove these parentheses
 
 warning: unnecessary parentheses around pattern
-  --> $DIR/issue-54538-unused-parens-lint.rs:12:9
+  --> $DIR/issue-54538-unused-parens-lint.rs:13:9
    |
-LL |         (e @ 1..=2) => {}
+LL |         (e @ 1...2) => {}
    |         ^^^^^^^^^^^ help: remove these parentheses
 
 warning: unnecessary parentheses around pattern
-  --> $DIR/issue-54538-unused-parens-lint.rs:18:9
+  --> $DIR/issue-54538-unused-parens-lint.rs:19:9
    |
 LL |         (e @ &(1...2)) => {}
    |         ^^^^^^^^^^^^^^ help: remove these parentheses
 
 warning: unnecessary parentheses around pattern
-  --> $DIR/issue-54538-unused-parens-lint.rs:19:10
+  --> $DIR/issue-54538-unused-parens-lint.rs:20:10
+   |
+LL |         &(_) => {}
+   |          ^^^ help: remove these parentheses
+
+warning: unnecessary parentheses around pattern
+  --> $DIR/issue-54538-unused-parens-lint.rs:31:9
+   |
+LL |         (_) => {}
+   |         ^^^ help: remove these parentheses
+
+warning: unnecessary parentheses around pattern
+  --> $DIR/issue-54538-unused-parens-lint.rs:32:9
+   |
+LL |         (y) => {}
+   |         ^^^ help: remove these parentheses
+
+warning: unnecessary parentheses around pattern
+  --> $DIR/issue-54538-unused-parens-lint.rs:33:9
+   |
+LL |         (ref r) => {}
+   |         ^^^^^^^ help: remove these parentheses
+
+warning: unnecessary parentheses around pattern
+  --> $DIR/issue-54538-unused-parens-lint.rs:34:9
+   |
+LL |         (e @ 1..=2) => {}
+   |         ^^^^^^^^^^^ help: remove these parentheses
+
+warning: unnecessary parentheses around pattern
+  --> $DIR/issue-54538-unused-parens-lint.rs:40:9
+   |
+LL |         (e @ &(1..=2)) => {}
+   |         ^^^^^^^^^^^^^^ help: remove these parentheses
+
+warning: unnecessary parentheses around pattern
+  --> $DIR/issue-54538-unused-parens-lint.rs:41:10
    |
 LL |         &(_) => {}
    |          ^^^ help: remove these parentheses
index 99069183e4eda15fc97d9876f455a38ecb1e7150..a0cc773d20edd3cd184a5598f3b616b92454b25b 100644 (file)
@@ -8,31 +8,31 @@
 
 fn main() {
     match 5 {
-      1 ... 10 => { }
-      5 ... 6 => { }
+      1 ..= 10 => { }
+      5 ..= 6 => { }
       _ => {}
     };
 
     match 5 {
-      3 ... 6 => { }
-      4 ... 6 => { }
+      3 ..= 6 => { }
+      4 ..= 6 => { }
       _ => {}
     };
 
     match 5 {
-      4 ... 6 => { }
-      4 ... 6 => { }
+      4 ..= 6 => { }
+      4 ..= 6 => { }
       _ => {}
     };
 
     match 'c' {
-      'A' ... 'z' => {}
-      'a' ... 'z' => {}
+      'A' ..= 'z' => {}
+      'a' ..= 'z' => {}
       _ => {}
     };
 
     match 1.0f64 {
-      0.01f64 ... 6.5f64 => {}
+      0.01f64 ..= 6.5f64 => {}
       0.02f64 => {}
       _ => {}
     };
index 0f5ab7fff384050684ab068f5d14fe3c0e9d7119..f481e56c85e56bef00f4bd87f86c6e0752b6f865 100644 (file)
@@ -1,7 +1,7 @@
 error: unreachable pattern
   --> $DIR/match-range-fail-dominate.rs:12:7
    |
-LL |       5 ... 6 => { }
+LL |       5 ..= 6 => { }
    |       ^^^^^^^
    |
 note: lint level defined here
@@ -13,25 +13,25 @@ LL | #![deny(unreachable_patterns)]
 error: unreachable pattern
   --> $DIR/match-range-fail-dominate.rs:18:7
    |
-LL |       4 ... 6 => { }
+LL |       4 ..= 6 => { }
    |       ^^^^^^^
 
 error: unreachable pattern
   --> $DIR/match-range-fail-dominate.rs:24:7
    |
-LL |       4 ... 6 => { }
+LL |       4 ..= 6 => { }
    |       ^^^^^^^
 
 error: unreachable pattern
   --> $DIR/match-range-fail-dominate.rs:30:7
    |
-LL |       'a' ... 'z' => {}
+LL |       'a' ..= 'z' => {}
    |       ^^^^^^^^^^^
 
 warning: floating-point types cannot be used in patterns
   --> $DIR/match-range-fail-dominate.rs:35:7
    |
-LL |       0.01f64 ... 6.5f64 => {}
+LL |       0.01f64 ..= 6.5f64 => {}
    |       ^^^^^^^
    |
    = note: #[warn(illegal_floating_point_literal_pattern)] on by default
@@ -41,7 +41,7 @@ LL |       0.01f64 ... 6.5f64 => {}
 warning: floating-point types cannot be used in patterns
   --> $DIR/match-range-fail-dominate.rs:35:19
    |
-LL |       0.01f64 ... 6.5f64 => {}
+LL |       0.01f64 ..= 6.5f64 => {}
    |                   ^^^^^^
    |
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
@@ -65,7 +65,7 @@ LL |       0.02f64 => {}
 warning: floating-point types cannot be used in patterns
   --> $DIR/match-range-fail-dominate.rs:35:7
    |
-LL |       0.01f64 ... 6.5f64 => {}
+LL |       0.01f64 ..= 6.5f64 => {}
    |       ^^^^^^^
    |
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
index 0b52e46c45989b9ea2d76ce845edb3d1912b2471..1399694a79b6ab4d03da60a7051d18442e328c58 100644 (file)
@@ -27,9 +27,9 @@ impl Range for ThreeDigits {
 
 fn digits(x: u8) -> u32 {
     match x {
-        OneDigit::FIRST...OneDigit::LAST => 1,
-        TwoDigits::FIRST...TwoDigits::LAST => 2,
-        ThreeDigits::FIRST...ThreeDigits::LAST => 3,
+        OneDigit::FIRST..=OneDigit::LAST => 1,
+        TwoDigits::FIRST..=TwoDigits::LAST => 2,
+        ThreeDigits::FIRST..=ThreeDigits::LAST => 3,
         _ => unreachable!(),
     }
 }
index 1eba6d7d52877fa80ff1dc22e06aad06e3794433..150d74f07428d97cf519db0d0457604c84e89713 100644 (file)
@@ -4,7 +4,7 @@ error: expected type, found `3`
 LL |     let x = Enum::Foo(a: 3, b: 4);
    |                          ^ expecting a type here because of type ascription
    |
-   = note: type ascription is a nightly-only feature that lets you annotate an expression with a type: `<expr>: <type>`
+   = note: #![feature(type_ascription)] lets you annotate an expression with a type: `<expr>: <type>`
 note: this expression expects an ascribed type after the colon
   --> $DIR/recover-from-bad-variant.rs:7:23
    |
index 2084cbcce4f6253ddd17027f2864c8b7498c288c..4929922c83fe6c0338d333e31f76149e547e3ad0 100644 (file)
@@ -12,7 +12,7 @@ error: expected type, found `0`
 LL |     println!("test"): 0;
    |                       ^ expecting a type here because of type ascription
    |
-   = note: type ascription is a nightly-only feature that lets you annotate an expression with a type: `<expr>: <type>`
+   = note: #![feature(type_ascription)] lets you annotate an expression with a type: `<expr>: <type>`
 note: this expression expects an ascribed type after the colon
   --> $DIR/type-ascription-instead-of-statement-end.rs:9:5
    |