diff --git a/RELEASES.md b/RELEASES.md index 355e53cbed25c..51cd6578ec531 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,3 +1,121 @@ +Version 1.37.0 (2019-08-15) +========================== + +Language +-------- +- `#[must_use]` will now warn if the type is contained in a [tuple][61100], + [`Box`][62228], or an [array][62235] and unused. +- [You can now use the `cfg` and `cfg_attr` attributes on + generic parameters.][61547] +- [You can now use enum variants through type alias.][61682] e.g. You can + write the following: + ```rust + type MyOption = Option; + + fn increment_or_zero(x: MyOption) -> u8 { + match x { + MyOption::Some(y) => y + 1, + MyOption::None => 0, + } + } + ``` +- [You can now use `_` as an identifier for consts.][61347] e.g. You can write + `const _: u32 = 5;`. +- [You can now use `#[repr(align(X)]` on enums.][61229] +- [The `?`/_"Kleene"_ macro operator is now available in the + 2015 edition.][60932] + +Compiler +-------- +- [You can now enable Profile-Guided Optimization with the `-C profile-generate` + and `-C profile-use` flags.][61268] For more information on how to use profile + guided optimization, please refer to the [rustc book][rustc-book-pgo]. +- [The `rust-lldb` wrapper script should now work again.][61827] + +Libraries +--------- +- [`mem::MaybeUninit` is now ABI-compatible with `T`.][61802] + +Stabilized APIs +--------------- +- [`BufReader::buffer`] +- [`BufWriter::buffer`] +- [`Cell::from_mut`] +- [`Cell<[T]>::as_slice_of_cells`][`Cell::as_slice_of_cells`] +- [`DoubleEndedIterator::nth_back`] +- [`Option::xor`] +- [`Wrapping::reverse_bits`] +- [`i128::reverse_bits`] +- [`i16::reverse_bits`] +- [`i32::reverse_bits`] +- [`i64::reverse_bits`] +- [`i8::reverse_bits`] +- [`isize::reverse_bits`] +- [`slice::copy_within`] +- [`u128::reverse_bits`] +- [`u16::reverse_bits`] +- [`u32::reverse_bits`] +- [`u64::reverse_bits`] +- [`u8::reverse_bits`] +- [`usize::reverse_bits`] + +Cargo +----- +- [`Cargo.lock` files are now included by default when publishing executable crates + with executables.][cargo/7026] +- [You can now specify `default-run="foo"` in `[package]` to specify the + default executable to use for `cargo run`.][cargo/7056] + +Misc +---- + +Compatibility Notes +------------------- +- [Using `...` for inclusive range patterns will now warn by default.][61342] + Please transition your code to using the `..=` syntax for inclusive + ranges instead. +- [Using a trait object without the `dyn` will now warn by default.][61203] + Please transition your code to use `dyn Trait` for trait objects instead. + +[62228]: https://github.com/rust-lang/rust/pull/62228/ +[62235]: https://github.com/rust-lang/rust/pull/62235/ +[61802]: https://github.com/rust-lang/rust/pull/61802/ +[61827]: https://github.com/rust-lang/rust/pull/61827/ +[61547]: https://github.com/rust-lang/rust/pull/61547/ +[61682]: https://github.com/rust-lang/rust/pull/61682/ +[61268]: https://github.com/rust-lang/rust/pull/61268/ +[61342]: https://github.com/rust-lang/rust/pull/61342/ +[61347]: https://github.com/rust-lang/rust/pull/61347/ +[61100]: https://github.com/rust-lang/rust/pull/61100/ +[61203]: https://github.com/rust-lang/rust/pull/61203/ +[61229]: https://github.com/rust-lang/rust/pull/61229/ +[60932]: https://github.com/rust-lang/rust/pull/60932/ +[cargo/7026]: https://github.com/rust-lang/cargo/pull/7026/ +[cargo/7056]: https://github.com/rust-lang/cargo/pull/7056/ +[`BufReader::buffer`]: https://doc.rust-lang.org/std/io/struct.BufReader.html#method.buffer +[`BufWriter::buffer`]: https://doc.rust-lang.org/std/io/struct.BufWriter.html#method.buffer +[`Cell::from_mut`]: https://doc.rust-lang.org/std/cell/struct.Cell.html#method.from_mut +[`Cell::as_slice_of_cells`]: https://doc.rust-lang.org/std/cell/struct.Cell.html#method.as_slice_of_cells +[`DoubleEndedIterator::nth_back`]: https://doc.rust-lang.org/std/iter/trait.DoubleEndedIterator.html#method.nth_back +[`Option::xor`]: https://doc.rust-lang.org/std/option/enum.Option.html#method.xor +[`RefCell::try_borrow_unguarded`]: https://doc.rust-lang.org/std/cell/struct.RefCell.html#method.try_borrow_unguarded +[`Wrapping::reverse_bits`]: https://doc.rust-lang.org/std/num/struct.Wrapping.html#method.reverse_bits +[`i128::reverse_bits`]: https://doc.rust-lang.org/std/primitive.i128.html#method.reverse_bits +[`i16::reverse_bits`]: https://doc.rust-lang.org/std/primitive.i16.html#method.reverse_bits +[`i32::reverse_bits`]: https://doc.rust-lang.org/std/primitive.i32.html#method.reverse_bits +[`i64::reverse_bits`]: https://doc.rust-lang.org/std/primitive.i64.html#method.reverse_bits +[`i8::reverse_bits`]: https://doc.rust-lang.org/std/primitive.i8.html#method.reverse_bits +[`isize::reverse_bits`]: https://doc.rust-lang.org/std/primitive.isize.html#method.reverse_bits +[`slice::copy_within`]: https://doc.rust-lang.org/std/primitive.slice.html#method.copy_within +[`u128::reverse_bits`]: https://doc.rust-lang.org/std/primitive.u128.html#method.reverse_bits +[`u16::reverse_bits`]: https://doc.rust-lang.org/std/primitive.u16.html#method.reverse_bits +[`u32::reverse_bits`]: https://doc.rust-lang.org/std/primitive.u32.html#method.reverse_bits +[`u64::reverse_bits`]: https://doc.rust-lang.org/std/primitive.u64.html#method.reverse_bits +[`u8::reverse_bits`]: https://doc.rust-lang.org/std/primitive.u8.html#method.reverse_bits +[`usize::reverse_bits`]: https://doc.rust-lang.org/std/primitive.usize.html#method.reverse_bits +[rustc-book-pgo]: https://doc.rust-lang.org/rustc/profile-guided-optimization.html + + Version 1.36.0 (2019-07-04) ========================== @@ -39,7 +157,7 @@ Stabilized APIs - [`mem::MaybeUninit`] - [`pointer::align_offset`] - [`future::Future`] -- [`task::Context`] +- [`task::Context`] - [`task::RawWaker`] - [`task::RawWakerVTable`] - [`task::Waker`] diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs index c0f345443b907..98fa754759aa4 100644 --- a/src/liballoc/lib.rs +++ b/src/liballoc/lib.rs @@ -10,9 +10,9 @@ //! //! ## Boxed values //! -//! The [`Box`](boxed/index.html) type is a smart pointer type. There can -//! only be one owner of a `Box`, and the owner can decide to mutate the -//! contents, which live on the heap. +//! The [`Box`] type is a smart pointer type. There can only be one owner of a +//! [`Box`], and the owner can decide to mutate the contents, which live on the +//! heap. //! //! This type can be sent among threads efficiently as the size of a `Box` value //! is the same as that of a pointer. Tree-like data structures are often built @@ -20,20 +20,20 @@ //! //! ## Reference counted pointers //! -//! The [`Rc`](rc/index.html) type is a non-threadsafe reference-counted pointer -//! type intended for sharing memory within a thread. An `Rc` pointer wraps a -//! type, `T`, and only allows access to `&T`, a shared reference. +//! The [`Rc`] type is a non-threadsafe reference-counted pointer type intended +//! for sharing memory within a thread. An [`Rc`] pointer wraps a type, `T`, and +//! only allows access to `&T`, a shared reference. //! -//! This type is useful when inherited mutability (such as using `Box`) is too -//! constraining for an application, and is often paired with the `Cell` or -//! `RefCell` types in order to allow mutation. +//! This type is useful when inherited mutability (such as using [`Box`]) is too +//! constraining for an application, and is often paired with the [`Cell`] or +//! [`RefCell`] types in order to allow mutation. //! //! ## Atomically reference counted pointers //! -//! The [`Arc`](sync/index.html) type is the threadsafe equivalent of the `Rc` -//! type. It provides all the same functionality of `Rc`, except it requires -//! that the contained type `T` is shareable. Additionally, `Arc` is itself -//! sendable while `Rc` is not. +//! The [`Arc`] type is the threadsafe equivalent of the [`Rc`] type. It +//! provides all the same functionality of [`Rc`], except it requires that the +//! contained type `T` is shareable. Additionally, [`Arc`][`Arc`] is itself +//! sendable while [`Rc`][`Rc`] is not. //! //! This type allows for shared access to the contained data, and is often //! paired with synchronization primitives such as mutexes to allow mutation of @@ -49,6 +49,12 @@ //! //! The [`alloc`](alloc/index.html) module defines the low-level interface to the //! default global allocator. It is not compatible with the libc allocator API. +//! +//! [`Arc`]: sync/index.html +//! [`Box`]: boxed/index.html +//! [`Cell`]: ../core/cell/index.html +//! [`Rc`]: rc/index.html +//! [`RefCell`]: ../core/cell/index.html #![allow(unused_attributes)] #![stable(feature = "alloc", since = "1.36.0")] @@ -63,6 +69,7 @@ #![warn(missing_debug_implementations)] #![deny(intra_doc_link_resolution_failure)] // rustdoc is run without -D warnings #![allow(explicit_outlives_requirements)] +#![cfg_attr(not(bootstrap), allow(incomplete_features))] #![cfg_attr(not(test), feature(generator_trait))] #![cfg_attr(test, feature(test))] diff --git a/src/libcore/any.rs b/src/libcore/any.rs index f7aef66942d9b..078091a9b5475 100644 --- a/src/libcore/any.rs +++ b/src/libcore/any.rs @@ -468,7 +468,8 @@ impl TypeId { /// The current implementation uses the same infrastructure as compiler /// diagnostics and debuginfo, but this is not guaranteed. #[stable(feature = "type_name", since = "1.38.0")] -pub fn type_name() -> &'static str { +#[rustc_const_unstable(feature = "const_type_name")] +pub const fn type_name() -> &'static str { #[cfg(bootstrap)] unsafe { intrinsics::type_name::() diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs index bdfc1e66fd494..4d627383fd7cc 100644 --- a/src/libcore/lib.rs +++ b/src/libcore/lib.rs @@ -63,6 +63,7 @@ #![warn(missing_debug_implementations)] #![deny(intra_doc_link_resolution_failure)] // rustdoc is run without -D warnings #![allow(explicit_outlives_requirements)] +#![cfg_attr(not(bootstrap), allow(incomplete_features))] #![feature(allow_internal_unstable)] #![feature(arbitrary_self_types)] diff --git a/src/librustc/error_codes.rs b/src/librustc/error_codes.rs index 1edadbd5bae1a..b3eee7c346489 100644 --- a/src/librustc/error_codes.rs +++ b/src/librustc/error_codes.rs @@ -2088,11 +2088,11 @@ generator can be constructed. Erroneous code example: ```edition2018,compile-fail,E0698 -#![feature(futures_api, async_await, await_macro)] +#![feature(async_await)] async fn bar() -> () {} async fn foo() { - await!(bar()); // error: cannot infer type for `T` + bar().await; // error: cannot infer type for `T` } ``` @@ -2101,12 +2101,12 @@ To fix this you must bind `T` to a concrete type such as `String` so that a generator can then be constructed: ```edition2018 -#![feature(futures_api, async_await, await_macro)] +#![feature(async_await)] async fn bar() -> () {} async fn foo() { - await!(bar::()); - // ^^^^^^^^ specify type explicitly + bar::().await; + // ^^^^^^^^ specify type explicitly } ``` "##, diff --git a/src/librustc/hir/lowering.rs b/src/librustc/hir/lowering.rs index 4ddd7818bb1aa..026c3cc6f95b2 100644 --- a/src/librustc/hir/lowering.rs +++ b/src/librustc/hir/lowering.rs @@ -4685,7 +4685,7 @@ impl<'a> LoweringContext<'a> { }) }) } - ExprKind::Await(_origin, ref expr) => self.lower_await(e.span, expr), + ExprKind::Await(ref expr) => self.lower_await(e.span, expr), ExprKind::Closure( capture_clause, asyncness, movability, ref decl, ref body, fn_decl_span ) => { diff --git a/src/librustc_lint/builtin.rs b/src/librustc_lint/builtin.rs index b63d14ca949ee..6ac68e86e4be9 100644 --- a/src/librustc_lint/builtin.rs +++ b/src/librustc_lint/builtin.rs @@ -33,13 +33,12 @@ use lint::{LintPass, LateLintPass, EarlyLintPass, EarlyContext}; use rustc::util::nodemap::FxHashSet; use syntax::tokenstream::{TokenTree, TokenStream}; -use syntax::ast; +use syntax::ast::{self, Expr}; use syntax::ptr::P; -use syntax::ast::Expr; use syntax::attr::{self, HasAttrs, AttributeTemplate}; use syntax::source_map::Spanned; use syntax::edition::Edition; -use syntax::feature_gate::{AttributeGate, AttributeType}; +use syntax::feature_gate::{self, AttributeGate, AttributeType}; use syntax::feature_gate::{Stability, deprecated_attributes}; use syntax_pos::{BytePos, Span, SyntaxContext}; use syntax::symbol::{Symbol, kw, sym}; @@ -1831,3 +1830,35 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ExplicitOutlivesRequirements { } } } + +declare_lint! { + pub INCOMPLETE_FEATURES, + Warn, + "incomplete features that may function improperly in some or all cases" +} + +declare_lint_pass!( + /// Check for used feature gates in `INCOMPLETE_FEATURES` in `feature_gate.rs`. + IncompleteFeatures => [INCOMPLETE_FEATURES] +); + +impl EarlyLintPass for IncompleteFeatures { + fn check_crate(&mut self, cx: &EarlyContext<'_>, _: &ast::Crate) { + let features = cx.sess.features_untracked(); + features.declared_lang_features + .iter().map(|(name, span, _)| (name, span)) + .chain(features.declared_lib_features.iter().map(|(name, span)| (name, span))) + .filter(|(name, _)| feature_gate::INCOMPLETE_FEATURES.iter().any(|f| name == &f)) + .for_each(|(name, &span)| { + cx.struct_span_lint( + INCOMPLETE_FEATURES, + span, + &format!( + "the feature `{}` is incomplete and may cause the compiler to crash", + name, + ) + ) + .emit(); + }); + } +} diff --git a/src/librustc_lint/lib.rs b/src/librustc_lint/lib.rs index d3975360525d0..78bc164ba1a0f 100644 --- a/src/librustc_lint/lib.rs +++ b/src/librustc_lint/lib.rs @@ -97,6 +97,7 @@ macro_rules! early_lint_passes { DeprecatedAttr: DeprecatedAttr::new(), WhileTrue: WhileTrue, NonAsciiIdents: NonAsciiIdents, + IncompleteFeatures: IncompleteFeatures, ]); ) } diff --git a/src/libstd/sys/vxworks/process/process_vxworks.rs b/src/libstd/sys/vxworks/process/process_vxworks.rs index d06d63bb43de5..b07966fa20626 100644 --- a/src/libstd/sys/vxworks/process/process_vxworks.rs +++ b/src/libstd/sys/vxworks/process/process_vxworks.rs @@ -1,7 +1,7 @@ use crate::io::{self, Error, ErrorKind}; -use libc::{self, c_int}; +use libc::{self, c_int, c_char}; use libc::{RTP_ID}; - +use crate::sys; use crate::sys::cvt; use crate::sys::process::rtp; use crate::sys::process::process_common::*; @@ -16,8 +16,6 @@ impl Command { use crate::sys::{cvt_r}; const CLOEXEC_MSG_FOOTER: &'static [u8] = b"NOEX"; - let envp = self.capture_env(); - if self.saw_nul() { return Err(io::Error::new(ErrorKind::InvalidInput, "nul byte found in provided data")); @@ -54,19 +52,10 @@ impl Command { t!(cvt(libc::chdir(cwd.as_ptr()))); } - // let envp = envp.map(|c| c.as_ptr()) - // .unwrap_or(*sys::os::environ() as *const _); - // FIXME: https://github.com/rust-lang/rust/issues/61993 - let envp_empty = CStringArray::with_capacity(0); - let envp = match envp { - Some(x) => x, - None => envp_empty, - }; - let envp = envp.as_ptr(); let ret = rtp::rtpSpawn( self.get_argv()[0], // executing program self.get_argv().as_ptr() as *const _, // argv - envp as *const _, // environment variable pointers + *sys::os::environ() as *const *const c_char, 100 as c_int, // initial priority 0x16000, // initial stack size. 0 defaults // to 0x4000 in 32 bit and 0x8000 in 64 bit diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 58a1c4aee9ad9..b633705a65f5d 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -1178,7 +1178,7 @@ pub enum ExprKind { /// preexisting defs. Async(CaptureBy, NodeId, P), /// An await expression (`my_future.await`). - Await(AwaitOrigin, P), + Await(P), /// A try block (`try { ... }`). TryBlock(P), diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 34e4d7d5a1993..4f637a23e6917 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -468,10 +468,6 @@ declare_features! ( // Allows async and await syntax. (active, async_await, "1.28.0", Some(50547), None), - // Allows await! macro-like syntax. - // This will likely be removed prior to stabilization of async/await. - (active, await_macro, "1.28.0", Some(50547), None), - // Allows reinterpretation of the bits of a value of one type as another type during const eval. (active, const_transmute, "1.29.0", Some(53605), None), @@ -569,10 +565,10 @@ declare_features! ( // ------------------------------------------------------------------------- ); -// Some features are known to be incomplete and using them is likely to have -// unanticipated results, such as compiler crashes. We warn the user about these -// to alert them. -const INCOMPLETE_FEATURES: &[Symbol] = &[ +/// Some features are known to be incomplete and using them is likely to have +/// unanticipated results, such as compiler crashes. We warn the user about these +/// to alert them. +pub const INCOMPLETE_FEATURES: &[Symbol] = &[ sym::impl_trait_in_bindings, sym::generic_associated_types, sym::const_generics, @@ -627,6 +623,8 @@ declare_features! ( (removed, quote, "1.33.0", Some(29601), None, None), // Allows using `#[unsafe_destructor_blind_to_params]` (RFC 1238). (removed, dropck_parametricity, "1.38.0", Some(28498), None, None), + (removed, await_macro, "1.38.0", Some(50547), None, + Some("subsumed by `.await` syntax")), // ------------------------------------------------------------------------- // feature-group-end: removed features @@ -2109,19 +2107,8 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> { ast::ExprKind::Async(..) => { gate_feature_post!(&self, async_await, e.span, "async blocks are unstable"); } - ast::ExprKind::Await(origin, _) => { - match origin { - ast::AwaitOrigin::FieldLike => - gate_feature_post!(&self, async_await, e.span, "async/await is unstable"), - ast::AwaitOrigin::MacroLike => - gate_feature_post!( - &self, - await_macro, - e.span, - "`await!()` macro syntax is unstable, and will soon be removed \ - in favor of `.await` syntax." - ), - } + ast::ExprKind::Await(_) => { + gate_feature_post!(&self, async_await, e.span, "async/await is unstable"); } _ => {} } @@ -2338,15 +2325,6 @@ pub fn get_features(span_handler: &Handler, krate_attrs: &[ast::Attribute], } let name = mi.name_or_empty(); - if INCOMPLETE_FEATURES.iter().any(|f| name == *f) { - span_handler.struct_span_warn( - mi.span(), - &format!( - "the feature `{}` is incomplete and may cause the compiler to crash", - name - ) - ).emit(); - } if let Some(edition) = ALL_EDITIONS.iter().find(|e| name == e.feature_name()) { if *edition <= crate_edition { diff --git a/src/libsyntax/mut_visit.rs b/src/libsyntax/mut_visit.rs index 43b6bea69d9ed..7b328e817bf8e 100644 --- a/src/libsyntax/mut_visit.rs +++ b/src/libsyntax/mut_visit.rs @@ -1139,7 +1139,7 @@ pub fn noop_visit_expr(Expr { node, id, span, attrs }: &mut Expr, vis.visit_id(node_id); vis.visit_block(body); } - ExprKind::Await(_origin, expr) => vis.visit_expr(expr), + ExprKind::Await(expr) => vis.visit_expr(expr), ExprKind::Assign(el, er) => { vis.visit_expr(el); vis.visit_expr(er); diff --git a/src/libsyntax/parse/diagnostics.rs b/src/libsyntax/parse/diagnostics.rs index 9eb6aa303b06b..730efb5ef013c 100644 --- a/src/libsyntax/parse/diagnostics.rs +++ b/src/libsyntax/parse/diagnostics.rs @@ -869,13 +869,23 @@ impl<'a> Parser<'a> { Ok(()) } - /// Consume alternative await syntaxes like `await `, `await? `, `await()` - /// and `await { }`. + /// Consume alternative await syntaxes like `await!()`, `await `, + /// `await? `, `await()`, and `await { }`. crate fn parse_incorrect_await_syntax( &mut self, lo: Span, await_sp: Span, ) -> PResult<'a, (Span, ExprKind)> { + if self.token == token::Not { + // Handle `await!()`. + self.expect(&token::Not)?; + self.expect(&token::OpenDelim(token::Paren))?; + let expr = self.parse_expr()?; + self.expect(&token::CloseDelim(token::Paren))?; + let sp = self.error_on_incorrect_await(lo, self.prev_span, &expr, false); + return Ok((sp, ExprKind::Await(expr))) + } + let is_question = self.eat(&token::Question); // Handle `await? `. let expr = if self.token == token::OpenDelim(token::Brace) { // Handle `await { }`. @@ -893,10 +903,15 @@ impl<'a> Parser<'a> { err.span_label(await_sp, "while parsing this incorrect await expression"); err })?; + let sp = self.error_on_incorrect_await(lo, expr.span, &expr, is_question); + Ok((sp, ExprKind::Await(expr))) + } + + fn error_on_incorrect_await(&self, lo: Span, hi: Span, expr: &Expr, is_question: bool) -> Span { let expr_str = self.span_to_snippet(expr.span) .unwrap_or_else(|_| pprust::expr_to_string(&expr)); let suggestion = format!("{}.await{}", expr_str, if is_question { "?" } else { "" }); - let sp = lo.to(expr.span); + let sp = lo.to(hi); let app = match expr.node { ExprKind::Try(_) => Applicability::MaybeIncorrect, // `await ?` _ => Applicability::MachineApplicable, @@ -904,7 +919,7 @@ impl<'a> Parser<'a> { self.struct_span_err(sp, "incorrect use of `await`") .span_suggestion(sp, "`await` is a postfix operation", suggestion, app) .emit(); - Ok((sp, ExprKind::Await(ast::AwaitOrigin::FieldLike, expr))) + sp } /// If encountering `future.await()`, consume and emit error. diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index fb5ff7e8f9862..7fda9158b4bdf 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -2234,7 +2234,7 @@ impl<'a> Parser<'a> { } else if self.eat_keyword(kw::Let) { return self.parse_let_expr(attrs); } else if is_span_rust_2018 && self.eat_keyword(kw::Await) { - let (await_hi, e_kind) = self.parse_await_macro_or_alt(lo, self.prev_span)?; + let (await_hi, e_kind) = self.parse_incorrect_await_syntax(lo, self.prev_span)?; hi = await_hi; ex = e_kind; } else if self.token.is_path_start() { @@ -2282,31 +2282,6 @@ impl<'a> Parser<'a> { self.maybe_recover_from_bad_qpath(expr, true) } - /// Parse `await!()` calls, or alternatively recover from incorrect but reasonable - /// alternative syntaxes `await `, `await? `, `await()` and - /// `await { }`. - fn parse_await_macro_or_alt( - &mut self, - lo: Span, - await_sp: Span, - ) -> PResult<'a, (Span, ExprKind)> { - if self.token == token::Not { - // Handle correct `await!()`. - // FIXME: make this an error when `await!` is no longer supported - // https://github.com/rust-lang/rust/issues/60610 - self.expect(&token::Not)?; - self.expect(&token::OpenDelim(token::Paren))?; - let expr = self.parse_expr().map_err(|mut err| { - err.span_label(await_sp, "while parsing this await macro call"); - err - })?; - self.expect(&token::CloseDelim(token::Paren))?; - Ok((self.prev_span, ExprKind::Await(ast::AwaitOrigin::MacroLike, expr))) - } else { // Handle `await `. - self.parse_incorrect_await_syntax(lo, await_sp) - } - } - fn maybe_parse_struct_expr( &mut self, lo: Span, @@ -2509,18 +2484,19 @@ impl<'a> Parser<'a> { ) } - // Assuming we have just parsed `.`, continue parsing into an expression. + fn mk_await_expr(&mut self, self_arg: P, lo: Span) -> PResult<'a, P> { + let span = lo.to(self.prev_span); + let await_expr = self.mk_expr(span, ExprKind::Await(self_arg), ThinVec::new()); + self.recover_from_await_method_call(); + Ok(await_expr) + } + + /// Assuming we have just parsed `.`, continue parsing into an expression. fn parse_dot_suffix(&mut self, self_arg: P, lo: Span) -> PResult<'a, P> { if self.token.span.rust_2018() && self.eat_keyword(kw::Await) { - let span = lo.to(self.prev_span); - let await_expr = self.mk_expr( - span, - ExprKind::Await(ast::AwaitOrigin::FieldLike, self_arg), - ThinVec::new(), - ); - self.recover_from_await_method_call(); - return Ok(await_expr); + return self.mk_await_expr(self_arg, lo); } + let segment = self.parse_path_segment(PathStyle::Expr)?; self.check_trailing_angle_brackets(&segment, token::OpenDelim(token::Paren)); diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index c7be0b123023d..88ff6ee907101 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -2120,17 +2120,9 @@ impl<'a> State<'a> { self.ibox(0); self.print_block_with_attrs(blk, attrs); } - ast::ExprKind::Await(origin, ref expr) => { - match origin { - ast::AwaitOrigin::MacroLike => { - self.s.word("await!"); - self.print_expr_maybe_paren(expr, parser::PREC_FORCE_PAREN); - } - ast::AwaitOrigin::FieldLike => { - self.print_expr_maybe_paren(expr, parser::PREC_POSTFIX); - self.s.word(".await"); - } - } + ast::ExprKind::Await(ref expr) => { + self.print_expr_maybe_paren(expr, parser::PREC_POSTFIX); + self.s.word(".await"); } ast::ExprKind::Assign(ref lhs, ref rhs) => { let prec = AssocOp::Assign.precedence() as i8; diff --git a/src/libsyntax/util/parser.rs b/src/libsyntax/util/parser.rs index 1e52186a106c1..d71358f45c470 100644 --- a/src/libsyntax/util/parser.rs +++ b/src/libsyntax/util/parser.rs @@ -382,7 +382,7 @@ pub fn contains_exterior_struct_lit(value: &ast::Expr) -> bool { // X { y: 1 } + X { y: 2 } contains_exterior_struct_lit(&lhs) || contains_exterior_struct_lit(&rhs) } - ast::ExprKind::Await(_, ref x) | + ast::ExprKind::Await(ref x) | ast::ExprKind::Unary(_, ref x) | ast::ExprKind::Cast(ref x, _) | ast::ExprKind::Type(ref x, _) | diff --git a/src/libsyntax/visit.rs b/src/libsyntax/visit.rs index 50be8c68f7f8c..5fee8ed81ab3b 100644 --- a/src/libsyntax/visit.rs +++ b/src/libsyntax/visit.rs @@ -757,7 +757,7 @@ pub fn walk_expr<'a, V: Visitor<'a>>(visitor: &mut V, expression: &'a Expr) { ExprKind::Async(_, _, ref body) => { visitor.visit_block(body); } - ExprKind::Await(_, ref expr) => visitor.visit_expr(expr), + ExprKind::Await(ref expr) => visitor.visit_expr(expr), ExprKind::Assign(ref left_hand_expression, ref right_hand_expression) => { visitor.visit_expr(left_hand_expression); visitor.visit_expr(right_hand_expression); diff --git a/src/test/ui/array-slice-vec/subslice-patterns-pass.rs b/src/test/ui/array-slice-vec/subslice-patterns-pass.rs new file mode 100644 index 0000000000000..1ebf3def78876 --- /dev/null +++ b/src/test/ui/array-slice-vec/subslice-patterns-pass.rs @@ -0,0 +1,128 @@ +// This test comprehensively checks the passing static and dynamic semantics +// of subslice patterns `..`, `x @ ..`, `ref x @ ..`, and `ref mut @ ..` +// in slice patterns `[$($pat), $(,)?]` . + +// run-pass + +#![feature(slice_patterns)] + +#![allow(unreachable_patterns)] + +use std::convert::identity; + +#[derive(PartialEq, Debug, Clone)] +struct N(u8); + +macro_rules! n { + ($($e:expr),* $(,)?) => { + [$(N($e)),*] + } +} + +macro_rules! c { + ($inp:expr, $typ:ty, $out:expr $(,)?) => { + assert_eq!($out, identity::<$typ>($inp)); + } +} + +macro_rules! m { + ($e:expr, $p:pat => $b:expr) => { + match $e { + $p => $b, + _ => panic!(), + } + } +} + +fn main() { + slices(); + arrays(); +} + +fn slices() { + // Matching slices using `ref` patterns: + let mut v = vec![N(0), N(1), N(2), N(3), N(4)]; + let mut vc = (0..=4).collect::>(); + + let [..] = v[..]; // Always matches. + m!(v[..], [N(0), ref sub @ .., N(4)] => c!(sub, &[N], n![1, 2, 3])); + m!(v[..], [N(0), ref sub @ ..] => c!(sub, &[N], n![1, 2, 3, 4])); + m!(v[..], [ref sub @ .., N(4)] => c!(sub, &[N], n![0, 1, 2, 3])); + m!(v[..], [ref sub @ .., _, _, _, _, _] => c!(sub, &[N], &n![] as &[N])); + m!(v[..], [_, _, _, _, _, ref sub @ ..] => c!(sub, &[N], &n![] as &[N])); + m!(vc[..], [x, .., y] => c!((x, y), (u8, u8), (0, 4))); + + // Matching slices using `ref mut` patterns: + let [..] = v[..]; // Always matches. + m!(v[..], [N(0), ref mut sub @ .., N(4)] => c!(sub, &mut [N], n![1, 2, 3])); + m!(v[..], [N(0), ref mut sub @ ..] => c!(sub, &mut [N], n![1, 2, 3, 4])); + m!(v[..], [ref mut sub @ .., N(4)] => c!(sub, &mut [N], n![0, 1, 2, 3])); + m!(v[..], [ref mut sub @ .., _, _, _, _, _] => c!(sub, &mut [N], &mut n![] as &mut [N])); + m!(v[..], [_, _, _, _, _, ref mut sub @ ..] => c!(sub, &mut [N], &mut n![] as &mut [N])); + m!(vc[..], [x, .., y] => c!((x, y), (u8, u8), (0, 4))); + + // Matching slices using default binding modes (&): + let [..] = &v[..]; // Always matches. + m!(&v[..], [N(0), sub @ .., N(4)] => c!(sub, &[N], n![1, 2, 3])); + m!(&v[..], [N(0), sub @ ..] => c!(sub, &[N], n![1, 2, 3, 4])); + m!(&v[..], [sub @ .., N(4)] => c!(sub, &[N], n![0, 1, 2, 3])); + m!(&v[..], [sub @ .., _, _, _, _, _] => c!(sub, &[N], &n![] as &[N])); + m!(&v[..], [_, _, _, _, _, sub @ ..] => c!(sub, &[N], &n![] as &[N])); + m!(&vc[..], [x, .., y] => c!((x, y), (&u8, &u8), (&0, &4))); + + // Matching slices using default binding modes (&mut): + let [..] = &mut v[..]; // Always matches. + m!(&mut v[..], [N(0), sub @ .., N(4)] => c!(sub, &mut [N], n![1, 2, 3])); + m!(&mut v[..], [N(0), sub @ ..] => c!(sub, &mut [N], n![1, 2, 3, 4])); + m!(&mut v[..], [sub @ .., N(4)] => c!(sub, &mut [N], n![0, 1, 2, 3])); + m!(&mut v[..], [sub @ .., _, _, _, _, _] => c!(sub, &mut [N], &mut n![] as &mut [N])); + m!(&mut v[..], [_, _, _, _, _, sub @ ..] => c!(sub, &mut [N], &mut n![] as &mut [N])); + m!(&mut vc[..], [x, .., y] => c!((x, y), (&mut u8, &mut u8), (&mut 0, &mut 4))); +} + +fn arrays() { + let mut v = n![0, 1, 2, 3, 4]; + let vc = [0, 1, 2, 3, 4]; + + // Matching arrays by value: + m!(v.clone(), [N(0), sub @ .., N(4)] => c!(sub, [N; 3], n![1, 2, 3])); + m!(v.clone(), [N(0), sub @ ..] => c!(sub, [N; 4], n![1, 2, 3, 4])); + m!(v.clone(), [sub @ .., N(4)] => c!(sub, [N; 4], n![0, 1, 2, 3])); + m!(v.clone(), [sub @ .., _, _, _, _, _] => c!(sub, [N; 0], n![] as [N; 0])); + m!(v.clone(), [_, _, _, _, _, sub @ ..] => c!(sub, [N; 0], n![] as [N; 0])); + m!(v.clone(), [x, .., y] => c!((x, y), (N, N), (N(0), N(4)))); + m!(v.clone(), [..] => ()); + + // Matching arrays by ref patterns: + m!(v, [N(0), ref sub @ .., N(4)] => c!(sub, &[N; 3], &n![1, 2, 3])); + m!(v, [N(0), ref sub @ ..] => c!(sub, &[N; 4], &n![1, 2, 3, 4])); + m!(v, [ref sub @ .., N(4)] => c!(sub, &[N; 4], &n![0, 1, 2, 3])); + m!(v, [ref sub @ .., _, _, _, _, _] => c!(sub, &[N; 0], &n![] as &[N; 0])); + m!(v, [_, _, _, _, _, ref sub @ ..] => c!(sub, &[N; 0], &n![] as &[N; 0])); + m!(vc, [x, .., y] => c!((x, y), (u8, u8), (0, 4))); + + // Matching arrays by ref mut patterns: + m!(v, [N(0), ref mut sub @ .., N(4)] => c!(sub, &mut [N; 3], &mut n![1, 2, 3])); + m!(v, [N(0), ref mut sub @ ..] => c!(sub, &mut [N; 4], &mut n![1, 2, 3, 4])); + m!(v, [ref mut sub @ .., N(4)] => c!(sub, &mut [N; 4], &mut n![0, 1, 2, 3])); + m!(v, [ref mut sub @ .., _, _, _, _, _] => c!(sub, &mut [N; 0], &mut n![] as &mut [N; 0])); + m!(v, [_, _, _, _, _, ref mut sub @ ..] => c!(sub, &mut [N; 0], &mut n![] as &mut [N; 0])); + + // Matching arrays by default binding modes (&): + m!(&v, [N(0), sub @ .., N(4)] => c!(sub, &[N; 3], &n![1, 2, 3])); + m!(&v, [N(0), sub @ ..] => c!(sub, &[N; 4], &n![1, 2, 3, 4])); + m!(&v, [sub @ .., N(4)] => c!(sub, &[N; 4], &n![0, 1, 2, 3])); + m!(&v, [sub @ .., _, _, _, _, _] => c!(sub, &[N; 0], &n![] as &[N; 0])); + m!(&v, [_, _, _, _, _, sub @ ..] => c!(sub, &[N; 0], &n![] as &[N; 0])); + m!(&v, [..] => ()); + m!(&v, [x, .., y] => c!((x, y), (&N, &N), (&N(0), &N(4)))); + + // Matching arrays by default binding modes (&mut): + m!(&mut v, [N(0), sub @ .., N(4)] => c!(sub, &mut [N; 3], &mut n![1, 2, 3])); + m!(&mut v, [N(0), sub @ ..] => c!(sub, &mut [N; 4], &mut n![1, 2, 3, 4])); + m!(&mut v, [sub @ .., N(4)] => c!(sub, &mut [N; 4], &mut n![0, 1, 2, 3])); + m!(&mut v, [sub @ .., _, _, _, _, _] => c!(sub, &mut [N; 0], &mut n![] as &[N; 0])); + m!(&mut v, [_, _, _, _, _, sub @ ..] => c!(sub, &mut [N; 0], &mut n![] as &[N; 0])); + m!(&mut v, [..] => ()); + m!(&mut v, [x, .., y] => c!((x, y), (&mut N, &mut N), (&mut N(0), &mut N(4)))); +} diff --git a/src/test/ui/associated-type-bounds/duplicate.stderr b/src/test/ui/associated-type-bounds/duplicate.stderr index 68367c916546c..7f14a033688bd 100644 --- a/src/test/ui/associated-type-bounds/duplicate.stderr +++ b/src/test/ui/associated-type-bounds/duplicate.stderr @@ -3,6 +3,8 @@ warning: the feature `impl_trait_in_bindings` is incomplete and may cause the co | LL | #![feature(impl_trait_in_bindings)] | ^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default error[E0719]: the value of the associated type `Item` (from the trait `std::iter::Iterator`) is already specified --> $DIR/duplicate.rs:12:36 diff --git a/src/test/ui/associated-type-bounds/dyn-lcsit.stderr b/src/test/ui/associated-type-bounds/dyn-lcsit.stderr index 5fe4818ef8fed..1b3975f0999b6 100644 --- a/src/test/ui/associated-type-bounds/dyn-lcsit.stderr +++ b/src/test/ui/associated-type-bounds/dyn-lcsit.stderr @@ -3,4 +3,6 @@ warning: the feature `impl_trait_in_bindings` is incomplete and may cause the co | LL | #![feature(impl_trait_in_bindings)] | ^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default diff --git a/src/test/ui/associated-type-bounds/lcsit.stderr b/src/test/ui/associated-type-bounds/lcsit.stderr index 8fda11beddc4f..7c4349541e000 100644 --- a/src/test/ui/associated-type-bounds/lcsit.stderr +++ b/src/test/ui/associated-type-bounds/lcsit.stderr @@ -3,4 +3,6 @@ warning: the feature `impl_trait_in_bindings` is incomplete and may cause the co | LL | #![feature(impl_trait_in_bindings)] | ^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default diff --git a/src/test/ui/async-await/await-keyword/2015-edition-error-in-non-macro-position.rs b/src/test/ui/async-await/await-keyword/2015-edition-error-various-positions.rs similarity index 89% rename from src/test/ui/async-await/await-keyword/2015-edition-error-in-non-macro-position.rs rename to src/test/ui/async-await/await-keyword/2015-edition-error-various-positions.rs index c4f3f3edc486e..422a5a6394f8e 100644 --- a/src/test/ui/async-await/await-keyword/2015-edition-error-in-non-macro-position.rs +++ b/src/test/ui/async-await/await-keyword/2015-edition-error-various-positions.rs @@ -1,4 +1,4 @@ -#![feature(async_await, await_macro)] +#![feature(async_await)] #![allow(non_camel_case_types)] #![deny(keyword_idents)] @@ -29,6 +29,9 @@ macro_rules! await { } fn main() { + await!(); //~ ERROR `await` is a keyword in the 2018 edition + //~^ WARN this was previously accepted by the compiler + match await { await => {} } //~ ERROR `await` is a keyword in the 2018 edition //~^ ERROR `await` is a keyword in the 2018 edition //~^^ WARN this was previously accepted by the compiler diff --git a/src/test/ui/async-await/await-keyword/2015-edition-error-in-non-macro-position.stderr b/src/test/ui/async-await/await-keyword/2015-edition-error-various-positions.stderr similarity index 78% rename from src/test/ui/async-await/await-keyword/2015-edition-error-in-non-macro-position.stderr rename to src/test/ui/async-await/await-keyword/2015-edition-error-various-positions.stderr index 067ecd6a5138d..8af0110169ebd 100644 --- a/src/test/ui/async-await/await-keyword/2015-edition-error-in-non-macro-position.stderr +++ b/src/test/ui/async-await/await-keyword/2015-edition-error-various-positions.stderr @@ -1,11 +1,11 @@ error: `await` is a keyword in the 2018 edition - --> $DIR/2015-edition-error-in-non-macro-position.rs:6:13 + --> $DIR/2015-edition-error-various-positions.rs:6:13 | LL | pub mod await { | ^^^^^ help: you can use a raw identifier to stay compatible: `r#await` | note: lint level defined here - --> $DIR/2015-edition-error-in-non-macro-position.rs:3:9 + --> $DIR/2015-edition-error-various-positions.rs:3:9 | LL | #![deny(keyword_idents)] | ^^^^^^^^^^^^^^ @@ -13,7 +13,7 @@ LL | #![deny(keyword_idents)] = note: for more information, see issue #49716 error: `await` is a keyword in the 2018 edition - --> $DIR/2015-edition-error-in-non-macro-position.rs:8:20 + --> $DIR/2015-edition-error-various-positions.rs:8:20 | LL | pub struct await; | ^^^^^ help: you can use a raw identifier to stay compatible: `r#await` @@ -22,7 +22,7 @@ LL | pub struct await; = note: for more information, see issue #49716 error: `await` is a keyword in the 2018 edition - --> $DIR/2015-edition-error-in-non-macro-position.rs:12:16 + --> $DIR/2015-edition-error-various-positions.rs:12:16 | LL | use outer_mod::await::await; | ^^^^^ help: you can use a raw identifier to stay compatible: `r#await` @@ -31,7 +31,7 @@ LL | use outer_mod::await::await; = note: for more information, see issue #49716 error: `await` is a keyword in the 2018 edition - --> $DIR/2015-edition-error-in-non-macro-position.rs:12:23 + --> $DIR/2015-edition-error-various-positions.rs:12:23 | LL | use outer_mod::await::await; | ^^^^^ help: you can use a raw identifier to stay compatible: `r#await` @@ -40,7 +40,7 @@ LL | use outer_mod::await::await; = note: for more information, see issue #49716 error: `await` is a keyword in the 2018 edition - --> $DIR/2015-edition-error-in-non-macro-position.rs:17:14 + --> $DIR/2015-edition-error-various-positions.rs:17:14 | LL | struct Foo { await: () } | ^^^^^ help: you can use a raw identifier to stay compatible: `r#await` @@ -49,7 +49,7 @@ LL | struct Foo { await: () } = note: for more information, see issue #49716 error: `await` is a keyword in the 2018 edition - --> $DIR/2015-edition-error-in-non-macro-position.rs:21:15 + --> $DIR/2015-edition-error-various-positions.rs:21:15 | LL | impl Foo { fn await() {} } | ^^^^^ help: you can use a raw identifier to stay compatible: `r#await` @@ -58,7 +58,7 @@ LL | impl Foo { fn await() {} } = note: for more information, see issue #49716 error: `await` is a keyword in the 2018 edition - --> $DIR/2015-edition-error-in-non-macro-position.rs:25:14 + --> $DIR/2015-edition-error-various-positions.rs:25:14 | LL | macro_rules! await { | ^^^^^ help: you can use a raw identifier to stay compatible: `r#await` @@ -67,7 +67,16 @@ LL | macro_rules! await { = note: for more information, see issue #49716 error: `await` is a keyword in the 2018 edition - --> $DIR/2015-edition-error-in-non-macro-position.rs:32:11 + --> $DIR/2015-edition-error-various-positions.rs:32:5 + | +LL | await!(); + | ^^^^^ help: you can use a raw identifier to stay compatible: `r#await` + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition! + = note: for more information, see issue #49716 + +error: `await` is a keyword in the 2018 edition + --> $DIR/2015-edition-error-various-positions.rs:35:11 | LL | match await { await => {} } | ^^^^^ help: you can use a raw identifier to stay compatible: `r#await` @@ -76,7 +85,7 @@ LL | match await { await => {} } = note: for more information, see issue #49716 error: `await` is a keyword in the 2018 edition - --> $DIR/2015-edition-error-in-non-macro-position.rs:32:19 + --> $DIR/2015-edition-error-various-positions.rs:35:19 | LL | match await { await => {} } | ^^^^^ help: you can use a raw identifier to stay compatible: `r#await` @@ -84,5 +93,5 @@ LL | match await { await => {} } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition! = note: for more information, see issue #49716 -error: aborting due to 9 previous errors +error: aborting due to 10 previous errors diff --git a/src/test/ui/async-await/await-keyword/2018-edition-error.rs b/src/test/ui/async-await/await-keyword/2018-edition-error.rs index d856869684266..e620c27f9e36d 100644 --- a/src/test/ui/async-await/await-keyword/2018-edition-error.rs +++ b/src/test/ui/async-await/await-keyword/2018-edition-error.rs @@ -9,4 +9,8 @@ mod outer_mod { use self::outer_mod::await::await; //~ ERROR expected identifier //~^ ERROR expected identifier, found reserved keyword `await` -fn main() {} +macro_rules! await { () => {}; } //~ ERROR expected identifier, found reserved keyword `await` + +fn main() { + await!(); //~ ERROR expected expression, found `)` +} diff --git a/src/test/ui/async-await/await-keyword/2018-edition-error.stderr b/src/test/ui/async-await/await-keyword/2018-edition-error.stderr index 8afe5c1a36b36..9304928cfde5d 100644 --- a/src/test/ui/async-await/await-keyword/2018-edition-error.stderr +++ b/src/test/ui/async-await/await-keyword/2018-edition-error.stderr @@ -38,5 +38,21 @@ help: you can escape reserved keywords to use them as identifiers LL | use self::outer_mod::await::r#await; | ^^^^^^^ -error: aborting due to 4 previous errors +error: expected identifier, found reserved keyword `await` + --> $DIR/2018-edition-error.rs:12:14 + | +LL | macro_rules! await { () => {}; } + | ^^^^^ expected identifier, found reserved keyword +help: you can escape reserved keywords to use them as identifiers + | +LL | macro_rules! r#await { () => {}; } + | ^^^^^^^ + +error: expected expression, found `)` + --> $DIR/2018-edition-error.rs:15:12 + | +LL | await!(); + | ^ expected expression + +error: aborting due to 6 previous errors diff --git a/src/test/ui/async-await/await-keyword/incorrect-syntax-suggestions.rs b/src/test/ui/async-await/await-keyword/incorrect-syntax-suggestions.rs index e1e5bdd3d1b92..25da337c58798 100644 --- a/src/test/ui/async-await/await-keyword/incorrect-syntax-suggestions.rs +++ b/src/test/ui/async-await/await-keyword/incorrect-syntax-suggestions.rs @@ -104,6 +104,31 @@ fn foo25() -> Result<(), ()> { foo() } +async fn foo26() -> Result<(), ()> { + let _ = await!(bar()); //~ ERROR incorrect use of `await` + Ok(()) +} +async fn foo27() -> Result<(), ()> { + let _ = await!(bar())?; //~ ERROR incorrect use of `await` + Ok(()) +} +fn foo28() -> Result<(), ()> { + fn foo() -> Result<(), ()> { + let _ = await!(bar())?; //~ ERROR incorrect use of `await` + //~^ ERROR `await` is only allowed inside `async` functions + Ok(()) + } + foo() +} +fn foo29() -> Result<(), ()> { + let foo = || { + let _ = await!(bar())?; //~ ERROR incorrect use of `await` + //~^ ERROR `await` is only allowed inside `async` functions + Ok(()) + }; + foo() +} + fn main() { match await { await => () } //~^ ERROR expected expression, found `=>` diff --git a/src/test/ui/async-await/await-keyword/incorrect-syntax-suggestions.stderr b/src/test/ui/async-await/await-keyword/incorrect-syntax-suggestions.stderr index 380da4448ad32..db86d3d5d03ba 100644 --- a/src/test/ui/async-await/await-keyword/incorrect-syntax-suggestions.stderr +++ b/src/test/ui/async-await/await-keyword/incorrect-syntax-suggestions.stderr @@ -88,8 +88,32 @@ error: incorrect use of `await` LL | let _ = bar().await()?; | ^^ help: `await` is not a method call, remove the parentheses +error: incorrect use of `await` + --> $DIR/incorrect-syntax-suggestions.rs:108:13 + | +LL | let _ = await!(bar()); + | ^^^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await` + +error: incorrect use of `await` + --> $DIR/incorrect-syntax-suggestions.rs:112:13 + | +LL | let _ = await!(bar())?; + | ^^^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await` + +error: incorrect use of `await` + --> $DIR/incorrect-syntax-suggestions.rs:117:17 + | +LL | let _ = await!(bar())?; + | ^^^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await` + +error: incorrect use of `await` + --> $DIR/incorrect-syntax-suggestions.rs:125:17 + | +LL | let _ = await!(bar())?; + | ^^^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await` + error: expected expression, found `=>` - --> $DIR/incorrect-syntax-suggestions.rs:108:25 + --> $DIR/incorrect-syntax-suggestions.rs:133:25 | LL | match await { await => () } | ----- ^^ expected expression @@ -97,13 +121,13 @@ LL | match await { await => () } | while parsing this incorrect await expression error: incorrect use of `await` - --> $DIR/incorrect-syntax-suggestions.rs:108:11 + --> $DIR/incorrect-syntax-suggestions.rs:133:11 | LL | match await { await => () } | ^^^^^^^^^^^^^^^^^^^^^ help: `await` is a postfix operation: `{ await => () }.await` error: expected one of `.`, `?`, `{`, or an operator, found `}` - --> $DIR/incorrect-syntax-suggestions.rs:111:1 + --> $DIR/incorrect-syntax-suggestions.rs:136:1 | LL | match await { await => () } | ----- - expected one of `.`, `?`, `{`, or an operator here @@ -193,6 +217,22 @@ LL | let foo = || { LL | let _ = bar().await?; | ^^^^^^^^^^^ only allowed inside `async` functions and blocks +error[E0728]: `await` is only allowed inside `async` functions and blocks + --> $DIR/incorrect-syntax-suggestions.rs:117:17 + | +LL | fn foo() -> Result<(), ()> { + | --- this is not `async` +LL | let _ = await!(bar())?; + | ^^^^^^^^^^^^^ only allowed inside `async` functions and blocks + +error[E0728]: `await` is only allowed inside `async` functions and blocks + --> $DIR/incorrect-syntax-suggestions.rs:125:17 + | +LL | let foo = || { + | -- this is not `async` +LL | let _ = await!(bar())?; + | ^^^^^^^^^^^^^ only allowed inside `async` functions and blocks + error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try` --> $DIR/incorrect-syntax-suggestions.rs:18:19 | @@ -202,6 +242,6 @@ LL | let _ = await bar()?; = help: the trait `std::ops::Try` is not implemented for `impl std::future::Future` = note: required by `std::ops::Try::into_result` -error: aborting due to 29 previous errors +error: aborting due to 35 previous errors For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/async-await/await-keyword/post_expansion_error.stderr b/src/test/ui/async-await/await-keyword/post_expansion_error.stderr index 4e525974c2c6f..0996c38b3b6c6 100644 --- a/src/test/ui/async-await/await-keyword/post_expansion_error.stderr +++ b/src/test/ui/async-await/await-keyword/post_expansion_error.stderr @@ -2,9 +2,7 @@ error: expected expression, found `)` --> $DIR/post_expansion_error.rs:8:12 | LL | await!() - | ----- ^ expected expression - | | - | while parsing this await macro call + | ^ expected expression error: aborting due to previous error diff --git a/src/test/ui/async-await/await-macro.rs b/src/test/ui/async-await/await-macro.rs deleted file mode 100644 index b9cd3903513a4..0000000000000 --- a/src/test/ui/async-await/await-macro.rs +++ /dev/null @@ -1,230 +0,0 @@ -// run-pass - -// edition:2018 -// aux-build:arc_wake.rs - -#![feature(async_await, async_closure, await_macro)] - -extern crate arc_wake; - -use std::pin::Pin; -use std::future::Future; -use std::sync::{ - Arc, - atomic::{self, AtomicUsize}, -}; -use std::task::{Context, Poll}; -use arc_wake::ArcWake; - -struct Counter { - wakes: AtomicUsize, -} - -impl ArcWake for Counter { - fn wake(self: Arc) { - Self::wake_by_ref(&self) - } - fn wake_by_ref(arc_self: &Arc) { - arc_self.wakes.fetch_add(1, atomic::Ordering::SeqCst); - } -} - -struct WakeOnceThenComplete(bool); - -fn wake_and_yield_once() -> WakeOnceThenComplete { WakeOnceThenComplete(false) } - -impl Future for WakeOnceThenComplete { - type Output = (); - fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<()> { - if self.0 { - Poll::Ready(()) - } else { - cx.waker().wake_by_ref(); - self.0 = true; - Poll::Pending - } - } -} - -fn async_block(x: u8) -> impl Future { - async move { - await!(wake_and_yield_once()); - x - } -} - -fn async_block_with_borrow_named_lifetime<'a>(x: &'a u8) -> impl Future + 'a { - async move { - await!(wake_and_yield_once()); - *x - } -} - -fn async_nonmove_block(x: u8) -> impl Future { - async move { - let future = async { - await!(wake_and_yield_once()); - x - }; - await!(future) - } -} - -fn async_closure(x: u8) -> impl Future { - (async move |x: u8| -> u8 { - await!(wake_and_yield_once()); - x - })(x) -} - -fn async_closure_in_unsafe_block(x: u8) -> impl Future { - (unsafe { - async move |x: u8| unsafe_fn(await!(unsafe_async_fn(x))) - })(x) -} - -async fn async_fn(x: u8) -> u8 { - await!(wake_and_yield_once()); - x -} - -async fn generic_async_fn(x: T) -> T { - await!(wake_and_yield_once()); - x -} - -async fn async_fn_with_borrow(x: &u8) -> u8 { - await!(wake_and_yield_once()); - *x -} - -async fn async_fn_with_borrow_named_lifetime<'a>(x: &'a u8) -> u8 { - await!(wake_and_yield_once()); - *x -} - -fn async_fn_with_impl_future_named_lifetime<'a>(x: &'a u8) -> impl Future + 'a { - async move { - await!(wake_and_yield_once()); - *x - } -} - -/* FIXME(cramertj) support when `existential type T<'a, 'b>:;` works -async fn async_fn_multiple_args(x: &u8, _y: &u8) -> u8 { - await!(wake_and_yield_once()); - *x -} -*/ - -async fn async_fn_multiple_args_named_lifetime<'a>(x: &'a u8, _y: &'a u8) -> u8 { - await!(wake_and_yield_once()); - *x -} - -fn async_fn_with_internal_borrow(y: u8) -> impl Future { - async move { - await!(async_fn_with_borrow_named_lifetime(&y)) - } -} - -async unsafe fn unsafe_async_fn(x: u8) -> u8 { - await!(wake_and_yield_once()); - x -} - -unsafe fn unsafe_fn(x: u8) -> u8 { - x -} - -fn async_block_in_unsafe_block(x: u8) -> impl Future { - unsafe { - async move { - unsafe_fn(await!(unsafe_async_fn(x))) - } - } -} - -struct Foo; - -trait Bar { - fn foo() {} -} - -impl Foo { - async fn async_assoc_item(x: u8) -> u8 { - unsafe { - await!(unsafe_async_fn(x)) - } - } - - async unsafe fn async_unsafe_assoc_item(x: u8) -> u8 { - await!(unsafe_async_fn(x)) - } -} - -fn test_future_yields_once_then_returns(f: F) -where - F: FnOnce(u8) -> Fut, - Fut: Future, -{ - let mut fut = Box::pin(f(9)); - let counter = Arc::new(Counter { wakes: AtomicUsize::new(0) }); - let waker = ArcWake::into_waker(counter.clone()); - let mut cx = Context::from_waker(&waker); - assert_eq!(0, counter.wakes.load(atomic::Ordering::SeqCst)); - assert_eq!(Poll::Pending, fut.as_mut().poll(&mut cx)); - assert_eq!(1, counter.wakes.load(atomic::Ordering::SeqCst)); - assert_eq!(Poll::Ready(9), fut.as_mut().poll(&mut cx)); -} - -fn main() { - macro_rules! test { - ($($fn_name:expr,)*) => { $( - test_future_yields_once_then_returns($fn_name); - )* } - } - - macro_rules! test_with_borrow { - ($($fn_name:expr,)*) => { $( - test_future_yields_once_then_returns(|x| { - async move { - await!($fn_name(&x)) - } - }); - )* } - } - - test! { - async_block, - async_nonmove_block, - async_closure, - async_closure_in_unsafe_block, - async_fn, - generic_async_fn, - async_fn_with_internal_borrow, - async_block_in_unsafe_block, - Foo::async_assoc_item, - |x| { - async move { - unsafe { await!(unsafe_async_fn(x)) } - } - }, - |x| { - async move { - unsafe { await!(Foo::async_unsafe_assoc_item(x)) } - } - }, - } - test_with_borrow! { - async_block_with_borrow_named_lifetime, - async_fn_with_borrow, - async_fn_with_borrow_named_lifetime, - async_fn_with_impl_future_named_lifetime, - |x| { - async move { - await!(async_fn_multiple_args_named_lifetime(x, x)) - } - }, - } -} diff --git a/src/test/ui/async-await/multiple-lifetimes/named.rs b/src/test/ui/async-await/multiple-lifetimes/named.rs index 7d13d48bc8bbd..cd479e256b4e5 100644 --- a/src/test/ui/async-await/multiple-lifetimes/named.rs +++ b/src/test/ui/async-await/multiple-lifetimes/named.rs @@ -3,7 +3,7 @@ // Test that we can use async fns with multiple arbitrary lifetimes. -#![feature(arbitrary_self_types, async_await, await_macro)] +#![feature(async_await)] async fn multiple_named_lifetimes<'a, 'b>(_: &'a u8, _: &'b u8) {} diff --git a/src/test/ui/const-generics/apit-with-const-param.stderr b/src/test/ui/const-generics/apit-with-const-param.stderr index b3038ee648851..c4ad38a571170 100644 --- a/src/test/ui/const-generics/apit-with-const-param.stderr +++ b/src/test/ui/const-generics/apit-with-const-param.stderr @@ -3,4 +3,6 @@ warning: the feature `const_generics` is incomplete and may cause the compiler t | LL | #![feature(const_generics)] | ^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default diff --git a/src/test/ui/const-generics/array-wrapper-struct-ctor.stderr b/src/test/ui/const-generics/array-wrapper-struct-ctor.stderr index bd18264c1637d..5a5eaba0b197e 100644 --- a/src/test/ui/const-generics/array-wrapper-struct-ctor.stderr +++ b/src/test/ui/const-generics/array-wrapper-struct-ctor.stderr @@ -3,4 +3,6 @@ warning: the feature `const_generics` is incomplete and may cause the compiler t | LL | #![feature(const_generics)] | ^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default diff --git a/src/test/ui/const-generics/broken-mir-1.stderr b/src/test/ui/const-generics/broken-mir-1.stderr index 55dc7fcb7cc72..51de98ad5237a 100644 --- a/src/test/ui/const-generics/broken-mir-1.stderr +++ b/src/test/ui/const-generics/broken-mir-1.stderr @@ -3,4 +3,6 @@ warning: the feature `const_generics` is incomplete and may cause the compiler t | LL | #![feature(const_generics)] | ^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default diff --git a/src/test/ui/const-generics/broken-mir-2.stderr b/src/test/ui/const-generics/broken-mir-2.stderr index 7cad4017712b2..b72bc6a46a056 100644 --- a/src/test/ui/const-generics/broken-mir-2.stderr +++ b/src/test/ui/const-generics/broken-mir-2.stderr @@ -3,6 +3,8 @@ warning: the feature `const_generics` is incomplete and may cause the compiler t | LL | #![feature(const_generics)] | ^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default error[E0277]: arrays only have std trait implementations for lengths 0..=32 --> $DIR/broken-mir-2.rs:7:36 diff --git a/src/test/ui/const-generics/cannot-infer-const-args.stderr b/src/test/ui/const-generics/cannot-infer-const-args.stderr index 544cd05cdbebf..32adc63156a37 100644 --- a/src/test/ui/const-generics/cannot-infer-const-args.stderr +++ b/src/test/ui/const-generics/cannot-infer-const-args.stderr @@ -3,6 +3,8 @@ warning: the feature `const_generics` is incomplete and may cause the compiler t | LL | #![feature(const_generics)] | ^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default error[E0282]: type annotations needed --> $DIR/cannot-infer-const-args.rs:9:5 diff --git a/src/test/ui/const-generics/cannot-infer-type-for-const-param.stderr b/src/test/ui/const-generics/cannot-infer-type-for-const-param.stderr index 52907bbb67720..00a98e3ba9b3e 100644 --- a/src/test/ui/const-generics/cannot-infer-type-for-const-param.stderr +++ b/src/test/ui/const-generics/cannot-infer-type-for-const-param.stderr @@ -3,4 +3,6 @@ warning: the feature `const_generics` is incomplete and may cause the compiler t | LL | #![feature(const_generics)] | ^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default diff --git a/src/test/ui/const-generics/concrete-const-as-fn-arg.stderr b/src/test/ui/const-generics/concrete-const-as-fn-arg.stderr index 955b319d70044..0392488fce1c7 100644 --- a/src/test/ui/const-generics/concrete-const-as-fn-arg.stderr +++ b/src/test/ui/const-generics/concrete-const-as-fn-arg.stderr @@ -3,4 +3,6 @@ warning: the feature `const_generics` is incomplete and may cause the compiler t | LL | #![feature(const_generics)] | ^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default diff --git a/src/test/ui/const-generics/concrete-const-impl-method.stderr b/src/test/ui/const-generics/concrete-const-impl-method.stderr index 3ce488c62755a..5e730b5643a7d 100644 --- a/src/test/ui/const-generics/concrete-const-impl-method.stderr +++ b/src/test/ui/const-generics/concrete-const-impl-method.stderr @@ -3,4 +3,6 @@ warning: the feature `const_generics` is incomplete and may cause the compiler t | LL | #![feature(const_generics)] | ^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default diff --git a/src/test/ui/const-generics/condition-in-trait-const-arg.stderr b/src/test/ui/const-generics/condition-in-trait-const-arg.stderr index 7c85651e7082f..c9e22ab39018b 100644 --- a/src/test/ui/const-generics/condition-in-trait-const-arg.stderr +++ b/src/test/ui/const-generics/condition-in-trait-const-arg.stderr @@ -3,4 +3,6 @@ warning: the feature `const_generics` is incomplete and may cause the compiler t | LL | #![feature(const_generics)] | ^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default diff --git a/src/test/ui/const-generics/const-arg-in-fn.stderr b/src/test/ui/const-generics/const-arg-in-fn.stderr index e32b714b25d36..61ba9cdaf55b4 100644 --- a/src/test/ui/const-generics/const-arg-in-fn.stderr +++ b/src/test/ui/const-generics/const-arg-in-fn.stderr @@ -3,4 +3,6 @@ warning: the feature `const_generics` is incomplete and may cause the compiler t | LL | #![feature(const_generics)] | ^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default diff --git a/src/test/ui/const-generics/const-expression-parameter.stderr b/src/test/ui/const-generics/const-expression-parameter.stderr index c255127c28079..7311e27c289f7 100644 --- a/src/test/ui/const-generics/const-expression-parameter.stderr +++ b/src/test/ui/const-generics/const-expression-parameter.stderr @@ -9,6 +9,8 @@ warning: the feature `const_generics` is incomplete and may cause the compiler t | LL | #![feature(const_generics)] | ^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default error: aborting due to previous error diff --git a/src/test/ui/const-generics/const-fn-with-const-param.stderr b/src/test/ui/const-generics/const-fn-with-const-param.stderr index c0cd7bace471c..3437ed33d0c6f 100644 --- a/src/test/ui/const-generics/const-fn-with-const-param.stderr +++ b/src/test/ui/const-generics/const-fn-with-const-param.stderr @@ -1,9 +1,3 @@ -warning: the feature `const_generics` is incomplete and may cause the compiler to crash - --> $DIR/const-fn-with-const-param.rs:1:12 - | -LL | #![feature(const_generics)] - | ^^^^^^^^^^^^^^ - error: const parameters are not permitted in `const fn` --> $DIR/const-fn-with-const-param.rs:4:1 | @@ -13,5 +7,13 @@ LL | | X LL | | } | |_^ +warning: the feature `const_generics` is incomplete and may cause the compiler to crash + --> $DIR/const-fn-with-const-param.rs:1:12 + | +LL | #![feature(const_generics)] + | ^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default + error: aborting due to previous error diff --git a/src/test/ui/const-generics/const-generic-array-wrapper.stderr b/src/test/ui/const-generics/const-generic-array-wrapper.stderr index f92e11d47ed37..5c7b6a70d3b3f 100644 --- a/src/test/ui/const-generics/const-generic-array-wrapper.stderr +++ b/src/test/ui/const-generics/const-generic-array-wrapper.stderr @@ -3,4 +3,6 @@ warning: the feature `const_generics` is incomplete and may cause the compiler t | LL | #![feature(const_generics)] | ^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default diff --git a/src/test/ui/const-generics/const-param-before-other-params.rs b/src/test/ui/const-generics/const-param-before-other-params.rs index 2c81681b85e7d..5bdbfd8ff1f39 100644 --- a/src/test/ui/const-generics/const-param-before-other-params.rs +++ b/src/test/ui/const-generics/const-param-before-other-params.rs @@ -1,5 +1,4 @@ #![feature(const_generics)] -//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash fn bar(_: &'a ()) { //~^ ERROR lifetime parameters must be declared prior to const parameters diff --git a/src/test/ui/const-generics/const-param-before-other-params.stderr b/src/test/ui/const-generics/const-param-before-other-params.stderr index 33f981d1eba9b..87622f7e50010 100644 --- a/src/test/ui/const-generics/const-param-before-other-params.stderr +++ b/src/test/ui/const-generics/const-param-before-other-params.stderr @@ -1,17 +1,11 @@ -warning: the feature `const_generics` is incomplete and may cause the compiler to crash - --> $DIR/const-param-before-other-params.rs:1:12 - | -LL | #![feature(const_generics)] - | ^^^^^^^^^^^^^^ - error: lifetime parameters must be declared prior to const parameters - --> $DIR/const-param-before-other-params.rs:4:21 + --> $DIR/const-param-before-other-params.rs:3:21 | LL | fn bar(_: &'a ()) { | --------------^^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, const X: ()>` error: type parameters must be declared prior to const parameters - --> $DIR/const-param-before-other-params.rs:8:21 + --> $DIR/const-param-before-other-params.rs:7:21 | LL | fn foo(_: &T) { | --------------^- help: reorder the parameters: lifetimes, then types, then consts: `` diff --git a/src/test/ui/const-generics/const-param-from-outer-fn.stderr b/src/test/ui/const-generics/const-param-from-outer-fn.stderr index f0b7562f62196..90ca85cd62f92 100644 --- a/src/test/ui/const-generics/const-param-from-outer-fn.stderr +++ b/src/test/ui/const-generics/const-param-from-outer-fn.stderr @@ -1,9 +1,3 @@ -warning: the feature `const_generics` is incomplete and may cause the compiler to crash - --> $DIR/const-param-from-outer-fn.rs:1:12 - | -LL | #![feature(const_generics)] - | ^^^^^^^^^^^^^^ - error[E0401]: can't use generic parameters from outer function --> $DIR/const-param-from-outer-fn.rs:6:9 | @@ -14,6 +8,14 @@ LL | fn bar() -> u32 { LL | X | ^ use of generic parameter from outer function +warning: the feature `const_generics` is incomplete and may cause the compiler to crash + --> $DIR/const-param-from-outer-fn.rs:1:12 + | +LL | #![feature(const_generics)] + | ^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default + error: aborting due to previous error For more information about this error, try `rustc --explain E0401`. diff --git a/src/test/ui/const-generics/const-param-in-trait.stderr b/src/test/ui/const-generics/const-param-in-trait.stderr index a48eefddaa844..c45523d2fa6f6 100644 --- a/src/test/ui/const-generics/const-param-in-trait.stderr +++ b/src/test/ui/const-generics/const-param-in-trait.stderr @@ -3,4 +3,6 @@ warning: the feature `const_generics` is incomplete and may cause the compiler t | LL | #![feature(const_generics)] | ^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default diff --git a/src/test/ui/const-generics/const-param-type-depends-on-type-param.stderr b/src/test/ui/const-generics/const-param-type-depends-on-type-param.stderr index c7dcbe1354266..142efe45ac2d7 100644 --- a/src/test/ui/const-generics/const-param-type-depends-on-type-param.stderr +++ b/src/test/ui/const-generics/const-param-type-depends-on-type-param.stderr @@ -1,14 +1,16 @@ +error[E0671]: const parameters cannot depend on type parameters + --> $DIR/const-param-type-depends-on-type-param.rs:9:34 + | +LL | pub struct Dependent([(); X]); + | ^ const parameter depends on type parameter + warning: the feature `const_generics` is incomplete and may cause the compiler to crash --> $DIR/const-param-type-depends-on-type-param.rs:1:12 | LL | #![feature(const_generics)] | ^^^^^^^^^^^^^^ - -error[E0671]: const parameters cannot depend on type parameters - --> $DIR/const-param-type-depends-on-type-param.rs:9:34 | -LL | pub struct Dependent([(); X]); - | ^ const parameter depends on type parameter + = note: `#[warn(incomplete_features)]` on by default error[E0392]: parameter `T` is never used --> $DIR/const-param-type-depends-on-type-param.rs:9:22 diff --git a/src/test/ui/const-generics/const-parameter-uppercase-lint.stderr b/src/test/ui/const-generics/const-parameter-uppercase-lint.stderr index 190798d202bea..fddb06981bc73 100644 --- a/src/test/ui/const-generics/const-parameter-uppercase-lint.stderr +++ b/src/test/ui/const-generics/const-parameter-uppercase-lint.stderr @@ -3,6 +3,8 @@ warning: the feature `const_generics` is incomplete and may cause the compiler t | LL | #![feature(const_generics)] | ^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default error: const parameter `x` should have an upper case name --> $DIR/const-parameter-uppercase-lint.rs:6:15 diff --git a/src/test/ui/const-generics/const-types.stderr b/src/test/ui/const-generics/const-types.stderr index fbf5d53754164..ca3d7810ca530 100644 --- a/src/test/ui/const-generics/const-types.stderr +++ b/src/test/ui/const-generics/const-types.stderr @@ -3,4 +3,6 @@ warning: the feature `const_generics` is incomplete and may cause the compiler t | LL | #![feature(const_generics)] | ^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default diff --git a/src/test/ui/const-generics/derive-debug-array-wrapper.stderr b/src/test/ui/const-generics/derive-debug-array-wrapper.stderr index 799ab145edf38..08a9037a207b3 100644 --- a/src/test/ui/const-generics/derive-debug-array-wrapper.stderr +++ b/src/test/ui/const-generics/derive-debug-array-wrapper.stderr @@ -3,6 +3,8 @@ warning: the feature `const_generics` is incomplete and may cause the compiler t | LL | #![feature(const_generics)] | ^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default error[E0277]: arrays only have std trait implementations for lengths 0..=32 --> $DIR/derive-debug-array-wrapper.rs:6:5 diff --git a/src/test/ui/const-generics/fn-taking-const-generic-array.stderr b/src/test/ui/const-generics/fn-taking-const-generic-array.stderr index 367041283251f..d7f8f1364eef8 100644 --- a/src/test/ui/const-generics/fn-taking-const-generic-array.stderr +++ b/src/test/ui/const-generics/fn-taking-const-generic-array.stderr @@ -3,4 +3,6 @@ warning: the feature `const_generics` is incomplete and may cause the compiler t | LL | #![feature(const_generics)] | ^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default diff --git a/src/test/ui/const-generics/impl-const-generic-struct.stderr b/src/test/ui/const-generics/impl-const-generic-struct.stderr index d443e060a9747..1eae9c4038959 100644 --- a/src/test/ui/const-generics/impl-const-generic-struct.stderr +++ b/src/test/ui/const-generics/impl-const-generic-struct.stderr @@ -3,4 +3,6 @@ warning: the feature `const_generics` is incomplete and may cause the compiler t | LL | #![feature(const_generics)] | ^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default diff --git a/src/test/ui/const-generics/incorrect-number-of-const-args.stderr b/src/test/ui/const-generics/incorrect-number-of-const-args.stderr index 11727733eb533..6aa1c23176bfa 100644 --- a/src/test/ui/const-generics/incorrect-number-of-const-args.stderr +++ b/src/test/ui/const-generics/incorrect-number-of-const-args.stderr @@ -3,6 +3,8 @@ warning: the feature `const_generics` is incomplete and may cause the compiler t | LL | #![feature(const_generics)] | ^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default error[E0107]: wrong number of const arguments: expected 2, found 1 --> $DIR/incorrect-number-of-const-args.rs:9:5 diff --git a/src/test/ui/const-generics/issue-60818-struct-constructors.stderr b/src/test/ui/const-generics/issue-60818-struct-constructors.stderr index 4b8f50b9b0219..3e0cd8168818f 100644 --- a/src/test/ui/const-generics/issue-60818-struct-constructors.stderr +++ b/src/test/ui/const-generics/issue-60818-struct-constructors.stderr @@ -3,4 +3,6 @@ warning: the feature `const_generics` is incomplete and may cause the compiler t | LL | #![feature(const_generics)] | ^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default diff --git a/src/test/ui/const-generics/issue-61336-1.stderr b/src/test/ui/const-generics/issue-61336-1.stderr index 1a5bb9f763bcf..949fa896d8780 100644 --- a/src/test/ui/const-generics/issue-61336-1.stderr +++ b/src/test/ui/const-generics/issue-61336-1.stderr @@ -3,6 +3,8 @@ warning: the feature `const_generics` is incomplete and may cause the compiler t | LL | #![feature(const_generics)] | ^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default error: array lengths can't depend on generic parameters --> $DIR/issue-61336-1.rs:5:9 diff --git a/src/test/ui/const-generics/issue-61336-2.stderr b/src/test/ui/const-generics/issue-61336-2.stderr index 473ed46b104e9..63f86c81b1e7f 100644 --- a/src/test/ui/const-generics/issue-61336-2.stderr +++ b/src/test/ui/const-generics/issue-61336-2.stderr @@ -3,6 +3,8 @@ warning: the feature `const_generics` is incomplete and may cause the compiler t | LL | #![feature(const_generics)] | ^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default error: array lengths can't depend on generic parameters --> $DIR/issue-61336-2.rs:5:9 diff --git a/src/test/ui/const-generics/issue-61336.stderr b/src/test/ui/const-generics/issue-61336.stderr index ae4ef3a906a4f..f96e8e02d4ec0 100644 --- a/src/test/ui/const-generics/issue-61336.stderr +++ b/src/test/ui/const-generics/issue-61336.stderr @@ -3,6 +3,8 @@ warning: the feature `const_generics` is incomplete and may cause the compiler t | LL | #![feature(const_generics)] | ^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default error: array lengths can't depend on generic parameters --> $DIR/issue-61336.rs:5:9 diff --git a/src/test/ui/const-generics/issue-61422.stderr b/src/test/ui/const-generics/issue-61422.stderr index 4cb76ec4fe18c..166bd3c2d3b67 100644 --- a/src/test/ui/const-generics/issue-61422.stderr +++ b/src/test/ui/const-generics/issue-61422.stderr @@ -3,4 +3,6 @@ warning: the feature `const_generics` is incomplete and may cause the compiler t | LL | #![feature(const_generics)] | ^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default diff --git a/src/test/ui/const-generics/mut-ref-const-param-array.stderr b/src/test/ui/const-generics/mut-ref-const-param-array.stderr index 261d3578a11ac..bd7ae49193eed 100644 --- a/src/test/ui/const-generics/mut-ref-const-param-array.stderr +++ b/src/test/ui/const-generics/mut-ref-const-param-array.stderr @@ -3,4 +3,6 @@ warning: the feature `const_generics` is incomplete and may cause the compiler t | LL | #![feature(const_generics)] | ^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default diff --git a/src/test/ui/const-generics/struct-with-invalid-const-param.stderr b/src/test/ui/const-generics/struct-with-invalid-const-param.stderr index 64354752fd2af..dfa2557e9f6f8 100644 --- a/src/test/ui/const-generics/struct-with-invalid-const-param.stderr +++ b/src/test/ui/const-generics/struct-with-invalid-const-param.stderr @@ -1,14 +1,16 @@ +error[E0573]: expected type, found const parameter `C` + --> $DIR/struct-with-invalid-const-param.rs:4:23 + | +LL | struct S(C); + | ^ help: a struct with a similar name exists: `S` + warning: the feature `const_generics` is incomplete and may cause the compiler to crash --> $DIR/struct-with-invalid-const-param.rs:1:12 | LL | #![feature(const_generics)] | ^^^^^^^^^^^^^^ - -error[E0573]: expected type, found const parameter `C` - --> $DIR/struct-with-invalid-const-param.rs:4:23 | -LL | struct S(C); - | ^ help: a struct with a similar name exists: `S` + = note: `#[warn(incomplete_features)]` on by default error: aborting due to previous error diff --git a/src/test/ui/const-generics/transparent-maybeunit-array-wrapper.stderr b/src/test/ui/const-generics/transparent-maybeunit-array-wrapper.stderr index 661bbd113bc0d..156eddafff010 100644 --- a/src/test/ui/const-generics/transparent-maybeunit-array-wrapper.stderr +++ b/src/test/ui/const-generics/transparent-maybeunit-array-wrapper.stderr @@ -3,4 +3,6 @@ warning: the feature `const_generics` is incomplete and may cause the compiler t | LL | #![feature(const_generics)] | ^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default diff --git a/src/test/ui/const-generics/uninferred-consts-during-codegen-1.stderr b/src/test/ui/const-generics/uninferred-consts-during-codegen-1.stderr index eb2e446396c33..3c05a354440f0 100644 --- a/src/test/ui/const-generics/uninferred-consts-during-codegen-1.stderr +++ b/src/test/ui/const-generics/uninferred-consts-during-codegen-1.stderr @@ -3,4 +3,6 @@ warning: the feature `const_generics` is incomplete and may cause the compiler t | LL | #![feature(const_generics)] | ^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default diff --git a/src/test/ui/const-generics/uninferred-consts-during-codegen-2.stderr b/src/test/ui/const-generics/uninferred-consts-during-codegen-2.stderr index eaa20bb789222..f27fc531031f9 100644 --- a/src/test/ui/const-generics/uninferred-consts-during-codegen-2.stderr +++ b/src/test/ui/const-generics/uninferred-consts-during-codegen-2.stderr @@ -3,4 +3,6 @@ warning: the feature `const_generics` is incomplete and may cause the compiler t | LL | #![feature(const_generics)] | ^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default diff --git a/src/test/ui/const-generics/unused-const-param.stderr b/src/test/ui/const-generics/unused-const-param.stderr index 0e7acfb673d1d..27f023eeeff4c 100644 --- a/src/test/ui/const-generics/unused-const-param.stderr +++ b/src/test/ui/const-generics/unused-const-param.stderr @@ -3,4 +3,6 @@ warning: the feature `const_generics` is incomplete and may cause the compiler t | LL | #![feature(const_generics)] | ^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default diff --git a/src/test/ui/consts/const-fn-type-name-any.rs b/src/test/ui/consts/const-fn-type-name-any.rs new file mode 100644 index 0000000000000..4ccfb42098423 --- /dev/null +++ b/src/test/ui/consts/const-fn-type-name-any.rs @@ -0,0 +1,29 @@ +// run-pass + +#![feature(const_fn)] +#![feature(const_type_name)] +#![allow(dead_code)] + +const fn type_name_wrapper(_: &T) -> &'static str { + std::any::type_name::() +} + +struct Struct { + a: TA, + b: TB, + c: TC, +} + +type StructInstantiation = Struct; + +const CONST_STRUCT: StructInstantiation = StructInstantiation { a: 12, b: 13.7, c: false }; + +const CONST_STRUCT_NAME: &'static str = type_name_wrapper(&CONST_STRUCT); + +fn main() { + let non_const_struct = StructInstantiation { a: 87, b: 65.99, c: true }; + + let non_const_struct_name = type_name_wrapper(&non_const_struct); + + assert_eq!(CONST_STRUCT_NAME, non_const_struct_name); +} diff --git a/src/test/ui/error-codes/E0730.stderr b/src/test/ui/error-codes/E0730.stderr index f9281262bb71b..9309ee99064c9 100644 --- a/src/test/ui/error-codes/E0730.stderr +++ b/src/test/ui/error-codes/E0730.stderr @@ -3,6 +3,8 @@ warning: the feature `const_generics` is incomplete and may cause the compiler t | LL | #![feature(const_generics)] | ^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default error[E0730]: cannot pattern-match on an array without a fixed length --> $DIR/E0730.rs:6:9 diff --git a/src/test/ui/existential_types/existential_type_const.stderr b/src/test/ui/existential_types/existential_type_const.stderr index 049b4f75dd204..81754c8f706b5 100644 --- a/src/test/ui/existential_types/existential_type_const.stderr +++ b/src/test/ui/existential_types/existential_type_const.stderr @@ -3,4 +3,6 @@ warning: the feature `impl_trait_in_bindings` is incomplete and may cause the co | LL | #![feature(impl_trait_in_bindings)] | ^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default diff --git a/src/test/ui/feature-gate/await-macro.rs b/src/test/ui/feature-gate/await-macro.rs deleted file mode 100644 index 291db9ba41370..0000000000000 --- a/src/test/ui/feature-gate/await-macro.rs +++ /dev/null @@ -1,12 +0,0 @@ -// gate-test-await_macro -// edition:2018 - -#![feature(async_await)] - -async fn bar() {} - -async fn foo() { - await!(bar()); //~ ERROR `await!()` macro syntax is unstable, and will soon be removed -} - -fn main() {} diff --git a/src/test/ui/feature-gate/await-macro.stderr b/src/test/ui/feature-gate/await-macro.stderr deleted file mode 100644 index 0d4f03e211b52..0000000000000 --- a/src/test/ui/feature-gate/await-macro.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0658]: `await!()` macro syntax is unstable, and will soon be removed in favor of `.await` syntax. - --> $DIR/await-macro.rs:9:5 - | -LL | await!(bar()); - | ^^^^^^^^^^^^^ - | - = note: for more information, see https://github.com/rust-lang/rust/issues/50547 - = help: add `#![feature(await_macro)]` to the crate attributes to enable - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/hygiene/generic_params.stderr b/src/test/ui/hygiene/generic_params.stderr index ecd228a5db5c8..b3e4fef08c20e 100644 --- a/src/test/ui/hygiene/generic_params.stderr +++ b/src/test/ui/hygiene/generic_params.stderr @@ -3,4 +3,6 @@ warning: the feature `const_generics` is incomplete and may cause the compiler t | LL | #![feature(decl_macro, rustc_attrs, const_generics)] | ^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default diff --git a/src/test/ui/hygiene/issue-61574-const-parameters.stderr b/src/test/ui/hygiene/issue-61574-const-parameters.stderr index 302b5fde8879c..c9aac6609a184 100644 --- a/src/test/ui/hygiene/issue-61574-const-parameters.stderr +++ b/src/test/ui/hygiene/issue-61574-const-parameters.stderr @@ -3,4 +3,6 @@ warning: the feature `const_generics` is incomplete and may cause the compiler t | LL | #![feature(const_generics)] | ^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default diff --git a/src/test/ui/impl-trait-in-bindings.stderr b/src/test/ui/impl-trait-in-bindings.stderr index 54b42a102fa1e..629089d8c5c5d 100644 --- a/src/test/ui/impl-trait-in-bindings.stderr +++ b/src/test/ui/impl-trait-in-bindings.stderr @@ -3,4 +3,6 @@ warning: the feature `impl_trait_in_bindings` is incomplete and may cause the co | LL | #![feature(impl_trait_in_bindings)] | ^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default diff --git a/src/test/ui/impl-trait/bindings-opaque.stderr b/src/test/ui/impl-trait/bindings-opaque.stderr index d0a6a4ee578f7..ad108173a7a1e 100644 --- a/src/test/ui/impl-trait/bindings-opaque.stderr +++ b/src/test/ui/impl-trait/bindings-opaque.stderr @@ -3,6 +3,8 @@ warning: the feature `impl_trait_in_bindings` is incomplete and may cause the co | LL | #![feature(impl_trait_in_bindings)] | ^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default error[E0599]: no method named `count_ones` found for type `impl std::marker::Copy` in the current scope --> $DIR/bindings-opaque.rs:11:17 diff --git a/src/test/ui/impl-trait/bindings.stderr b/src/test/ui/impl-trait/bindings.stderr index c66836ab8e5af..e938595519784 100644 --- a/src/test/ui/impl-trait/bindings.stderr +++ b/src/test/ui/impl-trait/bindings.stderr @@ -1,9 +1,3 @@ -warning: the feature `impl_trait_in_bindings` is incomplete and may cause the compiler to crash - --> $DIR/bindings.rs:1:12 - | -LL | #![feature(impl_trait_in_bindings)] - | ^^^^^^^^^^^^^^^^^^^^^^ - error[E0435]: attempt to use a non-constant value in a constant --> $DIR/bindings.rs:5:29 | @@ -28,6 +22,14 @@ error[E0435]: attempt to use a non-constant value in a constant LL | const foo: impl Clone = x; | ^ non-constant value +warning: the feature `impl_trait_in_bindings` is incomplete and may cause the compiler to crash + --> $DIR/bindings.rs:1:12 + | +LL | #![feature(impl_trait_in_bindings)] + | ^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default + error: aborting due to 4 previous errors For more information about this error, try `rustc --explain E0435`. diff --git a/src/test/ui/impl-trait/bound-normalization-fail.stderr b/src/test/ui/impl-trait/bound-normalization-fail.stderr index fa2dd20a6eed7..24a687491e529 100644 --- a/src/test/ui/impl-trait/bound-normalization-fail.stderr +++ b/src/test/ui/impl-trait/bound-normalization-fail.stderr @@ -3,6 +3,8 @@ warning: the feature `impl_trait_in_bindings` is incomplete and may cause the co | LL | #![feature(impl_trait_in_bindings)] | ^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default error[E0271]: type mismatch resolving ` as FooLike>::Output == ::Assoc` --> $DIR/bound-normalization-fail.rs:30:32 diff --git a/src/test/ui/impl-trait/bound-normalization-pass.stderr b/src/test/ui/impl-trait/bound-normalization-pass.stderr index c1b7fb2c253a4..229acdb2b144a 100644 --- a/src/test/ui/impl-trait/bound-normalization-pass.stderr +++ b/src/test/ui/impl-trait/bound-normalization-pass.stderr @@ -3,4 +3,6 @@ warning: the feature `impl_trait_in_bindings` is incomplete and may cause the co | LL | #![feature(impl_trait_in_bindings)] | ^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default diff --git a/src/test/ui/issues/issue-59508-1.stderr b/src/test/ui/issues/issue-59508-1.stderr index 8fb7d7c3c84dc..dd78c7c83134c 100644 --- a/src/test/ui/issues/issue-59508-1.stderr +++ b/src/test/ui/issues/issue-59508-1.stderr @@ -1,14 +1,16 @@ +error: lifetime parameters must be declared prior to type parameters + --> $DIR/issue-59508-1.rs:12:25 + | +LL | pub fn do_things() { + | ----^^--^^----- help: reorder the parameters: lifetimes, then types, then consts: `<'a, 'b: 'a, T>` + warning: the feature `const_generics` is incomplete and may cause the compiler to crash --> $DIR/issue-59508-1.rs:2:12 | LL | #![feature(const_generics)] | ^^^^^^^^^^^^^^ - -error: lifetime parameters must be declared prior to type parameters - --> $DIR/issue-59508-1.rs:12:25 | -LL | pub fn do_things() { - | ----^^--^^----- help: reorder the parameters: lifetimes, then types, then consts: `<'a, 'b: 'a, T>` + = note: `#[warn(incomplete_features)]` on by default error: aborting due to previous error diff --git a/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr b/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr index 207d0d6d6b84a..4edc00efc7e72 100644 --- a/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr +++ b/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr @@ -4,18 +4,6 @@ error: expected one of `,` or `>`, found `&&` LL | true && let 1 = 1 | ^^ expected one of `,` or `>` here -warning: the feature `const_generics` is incomplete and may cause the compiler to crash - --> $DIR/disallowed-positions.rs:20:12 - | -LL | #![feature(const_generics)] - | ^^^^^^^^^^^^^^ - -warning: the feature `let_chains` is incomplete and may cause the compiler to crash - --> $DIR/disallowed-positions.rs:22:12 - | -LL | #![feature(let_chains)] // Avoid inflating `.stderr` with overzealous gates in this test. - | ^^^^^^^^^^ - error: `let` expressions are not supported here --> $DIR/disallowed-positions.rs:32:9 | @@ -511,6 +499,20 @@ LL | true && let 1 = 1 = note: only supported directly in conditions of `if`- and `while`-expressions = note: as well as when nested within `&&` and parenthesis in those conditions +warning: the feature `const_generics` is incomplete and may cause the compiler to crash + --> $DIR/disallowed-positions.rs:20:12 + | +LL | #![feature(const_generics)] + | ^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default + +warning: the feature `let_chains` is incomplete and may cause the compiler to crash + --> $DIR/disallowed-positions.rs:22:12 + | +LL | #![feature(let_chains)] // Avoid inflating `.stderr` with overzealous gates in this test. + | ^^^^^^^^^^ + error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:32:8 | diff --git a/src/test/ui/rfc1598-generic-associated-types/collections.stderr b/src/test/ui/rfc1598-generic-associated-types/collections.stderr index d0fe5035bca46..fa8fcc99240c6 100644 --- a/src/test/ui/rfc1598-generic-associated-types/collections.stderr +++ b/src/test/ui/rfc1598-generic-associated-types/collections.stderr @@ -3,6 +3,8 @@ warning: the feature `generic_associated_types` is incomplete and may cause the | LL | #![feature(generic_associated_types)] | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default error[E0109]: type arguments are not allowed for this type --> $DIR/collections.rs:56:90 diff --git a/src/test/ui/rfc1598-generic-associated-types/construct_with_other_type.stderr b/src/test/ui/rfc1598-generic-associated-types/construct_with_other_type.stderr index b2dd523c8f597..ab161ae21bb67 100644 --- a/src/test/ui/rfc1598-generic-associated-types/construct_with_other_type.stderr +++ b/src/test/ui/rfc1598-generic-associated-types/construct_with_other_type.stderr @@ -3,6 +3,8 @@ warning: the feature `generic_associated_types` is incomplete and may cause the | LL | #![feature(generic_associated_types)] | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default error[E0109]: lifetime arguments are not allowed for this type --> $DIR/construct_with_other_type.rs:17:46 diff --git a/src/test/ui/rfc1598-generic-associated-types/empty_generics.stderr b/src/test/ui/rfc1598-generic-associated-types/empty_generics.stderr index 5b98302924e3c..749032dbcc220 100644 --- a/src/test/ui/rfc1598-generic-associated-types/empty_generics.stderr +++ b/src/test/ui/rfc1598-generic-associated-types/empty_generics.stderr @@ -9,6 +9,8 @@ warning: the feature `generic_associated_types` is incomplete and may cause the | LL | #![feature(generic_associated_types)] | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default error: aborting due to previous error diff --git a/src/test/ui/rfc1598-generic-associated-types/gat-incomplete-warning.stderr b/src/test/ui/rfc1598-generic-associated-types/gat-incomplete-warning.stderr index 6953a28a23b1c..d75f9fb8451b9 100644 --- a/src/test/ui/rfc1598-generic-associated-types/gat-incomplete-warning.stderr +++ b/src/test/ui/rfc1598-generic-associated-types/gat-incomplete-warning.stderr @@ -3,4 +3,6 @@ warning: the feature `generic_associated_types` is incomplete and may cause the | LL | #![feature(generic_associated_types)] | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default diff --git a/src/test/ui/rfc1598-generic-associated-types/generic-associated-types-where.stderr b/src/test/ui/rfc1598-generic-associated-types/generic-associated-types-where.stderr index b323104048f66..0d319a7a599f6 100644 --- a/src/test/ui/rfc1598-generic-associated-types/generic-associated-types-where.stderr +++ b/src/test/ui/rfc1598-generic-associated-types/generic-associated-types-where.stderr @@ -3,4 +3,6 @@ warning: the feature `generic_associated_types` is incomplete and may cause the | LL | #![feature(generic_associated_types)] | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default diff --git a/src/test/ui/rfc1598-generic-associated-types/generic_associated_type_undeclared_lifetimes.stderr b/src/test/ui/rfc1598-generic-associated-types/generic_associated_type_undeclared_lifetimes.stderr index f8c0a1f3bff34..40ea42f62431d 100644 --- a/src/test/ui/rfc1598-generic-associated-types/generic_associated_type_undeclared_lifetimes.stderr +++ b/src/test/ui/rfc1598-generic-associated-types/generic_associated_type_undeclared_lifetimes.stderr @@ -3,6 +3,8 @@ warning: the feature `generic_associated_types` is incomplete and may cause the | LL | #![feature(generic_associated_types)] | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default error[E0261]: use of undeclared lifetime name `'b` --> $DIR/generic_associated_type_undeclared_lifetimes.rs:13:37 diff --git a/src/test/ui/rfc1598-generic-associated-types/iterable.stderr b/src/test/ui/rfc1598-generic-associated-types/iterable.stderr index 6d5d0cc382840..51246d3c9027f 100644 --- a/src/test/ui/rfc1598-generic-associated-types/iterable.stderr +++ b/src/test/ui/rfc1598-generic-associated-types/iterable.stderr @@ -3,6 +3,8 @@ warning: the feature `generic_associated_types` is incomplete and may cause the | LL | #![feature(generic_associated_types)] | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default error[E0109]: lifetime arguments are not allowed for this type --> $DIR/iterable.rs:11:47 diff --git a/src/test/ui/rfc1598-generic-associated-types/parameter_number_and_kind.stderr b/src/test/ui/rfc1598-generic-associated-types/parameter_number_and_kind.stderr index 817d911184d0a..65dbd00c5b121 100644 --- a/src/test/ui/rfc1598-generic-associated-types/parameter_number_and_kind.stderr +++ b/src/test/ui/rfc1598-generic-associated-types/parameter_number_and_kind.stderr @@ -3,6 +3,8 @@ warning: the feature `generic_associated_types` is incomplete and may cause the | LL | #![feature(generic_associated_types)] | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default error[E0109]: lifetime arguments are not allowed for this type --> $DIR/parameter_number_and_kind.rs:17:27 diff --git a/src/test/ui/rfc1598-generic-associated-types/pointer_family.stderr b/src/test/ui/rfc1598-generic-associated-types/pointer_family.stderr index 0966f8f9422aa..626495350a7e6 100644 --- a/src/test/ui/rfc1598-generic-associated-types/pointer_family.stderr +++ b/src/test/ui/rfc1598-generic-associated-types/pointer_family.stderr @@ -3,6 +3,8 @@ warning: the feature `generic_associated_types` is incomplete and may cause the | LL | #![feature(generic_associated_types)] | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default error[E0109]: type arguments are not allowed for this type --> $DIR/pointer_family.rs:37:21 diff --git a/src/test/ui/rfc1598-generic-associated-types/shadowing.stderr b/src/test/ui/rfc1598-generic-associated-types/shadowing.stderr index cba6bbd8512bf..9526df258c497 100644 --- a/src/test/ui/rfc1598-generic-associated-types/shadowing.stderr +++ b/src/test/ui/rfc1598-generic-associated-types/shadowing.stderr @@ -3,4 +3,6 @@ warning: the feature `generic_associated_types` is incomplete and may cause the | LL | #![feature(generic_associated_types)] | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default diff --git a/src/test/ui/rfc1598-generic-associated-types/streaming_iterator.stderr b/src/test/ui/rfc1598-generic-associated-types/streaming_iterator.stderr index 5fc1e3dddbe74..09dd654b575af 100644 --- a/src/test/ui/rfc1598-generic-associated-types/streaming_iterator.stderr +++ b/src/test/ui/rfc1598-generic-associated-types/streaming_iterator.stderr @@ -3,6 +3,8 @@ warning: the feature `generic_associated_types` is incomplete and may cause the | LL | #![feature(generic_associated_types)] | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default error[E0109]: lifetime arguments are not allowed for this type --> $DIR/streaming_iterator.rs:18:41