From 89f41839e4942a051305c62c0ea78e18d9b401f7 Mon Sep 17 00:00:00 2001 From: Tobias Bucher Date: Thu, 9 Jun 2022 14:27:01 +0200 Subject: [PATCH 1/9] Implement `fmt::Write` for `OsString` This allows to format into an `OsString` without unnecessary allocations. E.g. ``` let mut temp_filename = path.into_os_string(); write!(&mut temp_filename, ".tmp.{}", process::id()); ``` --- library/std/src/ffi/os_str.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/library/std/src/ffi/os_str.rs b/library/std/src/ffi/os_str.rs index 247bdd954589c..8ce4c2a601722 100644 --- a/library/std/src/ffi/os_str.rs +++ b/library/std/src/ffi/os_str.rs @@ -615,6 +615,14 @@ impl Hash for OsString { } } +#[stable(feature = "os_string_fmt_write", since = "1.63.0")] +impl fmt::Write for OsString { + fn write_str(&mut self, s: &str) -> fmt::Result { + self.push(s); + Ok(()) + } +} + impl OsStr { /// Coerces into an `OsStr` slice. /// From 29dc72dd107a75ddc22da6b51ea96d0f9067b59f Mon Sep 17 00:00:00 2001 From: Takayuki Maeda Date: Fri, 8 Jul 2022 10:16:28 +0900 Subject: [PATCH 2/9] add `#[test]` to functions in test modules --- .../ui/imports/unused-imports-in-test-mode.rs | 54 ++++++---- .../unused-imports-in-test-mode.stderr | 74 ++----------- .../imports/unused-imports-in-test-module.rs | 53 ++++++--- .../unused-imports-in-test-module.stderr | 102 +++--------------- 4 files changed, 97 insertions(+), 186 deletions(-) diff --git a/src/test/ui/imports/unused-imports-in-test-mode.rs b/src/test/ui/imports/unused-imports-in-test-mode.rs index ed0bb65b3aa91..039f59a8838a1 100644 --- a/src/test/ui/imports/unused-imports-in-test-mode.rs +++ b/src/test/ui/imports/unused-imports-in-test-mode.rs @@ -8,76 +8,94 @@ fn a() {} fn b() {} mod test { - use super::a; //~ ERROR unused import: `super::a` + use super::a; + #[test] fn foo() { - use crate::b; //~ ERROR unused import: `crate::b` + a(); + use crate::b; //~ ERROR unused import: `crate::b` } } mod tests { - use super::a; //~ ERROR unused import: `super::a` + use super::a; + #[test] fn foo() { - use crate::b; //~ ERROR unused import: `crate::b` + a(); + use crate::b; //~ ERROR unused import: `crate::b` } } mod test_a { - use super::a; //~ ERROR unused import: `super::a` + use super::a; + #[test] fn foo() { - use crate::b; //~ ERROR unused import: `crate::b` + a(); + use crate::b; //~ ERROR unused import: `crate::b` } } mod a_test { - use super::a; //~ ERROR unused import: `super::a` + use super::a; + #[test] fn foo() { - use crate::b; //~ ERROR unused import: `crate::b` + a(); + use crate::b; //~ ERROR unused import: `crate::b` } } mod tests_a { - use super::a; //~ ERROR unused import: `super::a` + use super::a; + #[test] fn foo() { - use crate::b; //~ ERROR unused import: `crate::b` + a(); + use crate::b; //~ ERROR unused import: `crate::b` } } mod a_tests { - use super::a; //~ ERROR unused import: `super::a` + use super::a; + #[test] fn foo() { - use crate::b; //~ ERROR unused import: `crate::b` + a(); + use crate::b; //~ ERROR unused import: `crate::b` } } mod fastest_search { - use super::a; //~ ERROR unused import: `super::a` + use super::a; + #[test] fn foo() { - use crate::b; //~ ERROR unused import: `crate::b` + a(); + use crate::b; //~ ERROR unused import: `crate::b` } } #[cfg(test)] mod test_has_attr { - use super::a; //~ ERROR unused import: `super::a` + use super::a; + #[test] fn foo() { - use crate::b; //~ ERROR unused import: `crate::b` + a(); + use crate::b; //~ ERROR unused import: `crate::b` } } mod test_has_no_attr { #[cfg(test)] - use super::a; //~ ERROR unused import: `super::a` + use super::a; + #[test] fn foo() { - use crate::b; //~ ERROR unused import: `crate::b` + a(); + use crate::b; //~ ERROR unused import: `crate::b` } } diff --git a/src/test/ui/imports/unused-imports-in-test-mode.stderr b/src/test/ui/imports/unused-imports-in-test-mode.stderr index 1847abd64b4f2..c5faaa11450cb 100644 --- a/src/test/ui/imports/unused-imports-in-test-mode.stderr +++ b/src/test/ui/imports/unused-imports-in-test-mode.stderr @@ -10,113 +10,59 @@ note: the lint level is defined here LL | #![deny(unused_imports)] | ^^^^^^^^^^^^^^ -error: unused import: `super::a` - --> $DIR/unused-imports-in-test-mode.rs:11:9 - | -LL | use super::a; - | ^^^^^^^^ - error: unused import: `crate::b` - --> $DIR/unused-imports-in-test-mode.rs:14:13 + --> $DIR/unused-imports-in-test-mode.rs:16:13 | LL | use crate::b; | ^^^^^^^^ -error: unused import: `super::a` - --> $DIR/unused-imports-in-test-mode.rs:19:9 - | -LL | use super::a; - | ^^^^^^^^ - error: unused import: `crate::b` - --> $DIR/unused-imports-in-test-mode.rs:22:13 + --> $DIR/unused-imports-in-test-mode.rs:26:13 | LL | use crate::b; | ^^^^^^^^ -error: unused import: `super::a` - --> $DIR/unused-imports-in-test-mode.rs:27:9 - | -LL | use super::a; - | ^^^^^^^^ - error: unused import: `crate::b` - --> $DIR/unused-imports-in-test-mode.rs:30:13 + --> $DIR/unused-imports-in-test-mode.rs:36:13 | LL | use crate::b; | ^^^^^^^^ -error: unused import: `super::a` - --> $DIR/unused-imports-in-test-mode.rs:35:9 - | -LL | use super::a; - | ^^^^^^^^ - error: unused import: `crate::b` - --> $DIR/unused-imports-in-test-mode.rs:38:13 + --> $DIR/unused-imports-in-test-mode.rs:46:13 | LL | use crate::b; | ^^^^^^^^ -error: unused import: `super::a` - --> $DIR/unused-imports-in-test-mode.rs:43:9 - | -LL | use super::a; - | ^^^^^^^^ - error: unused import: `crate::b` - --> $DIR/unused-imports-in-test-mode.rs:46:13 + --> $DIR/unused-imports-in-test-mode.rs:56:13 | LL | use crate::b; | ^^^^^^^^ -error: unused import: `super::a` - --> $DIR/unused-imports-in-test-mode.rs:51:9 - | -LL | use super::a; - | ^^^^^^^^ - error: unused import: `crate::b` - --> $DIR/unused-imports-in-test-mode.rs:54:13 + --> $DIR/unused-imports-in-test-mode.rs:66:13 | LL | use crate::b; | ^^^^^^^^ -error: unused import: `super::a` - --> $DIR/unused-imports-in-test-mode.rs:59:9 - | -LL | use super::a; - | ^^^^^^^^ - error: unused import: `crate::b` - --> $DIR/unused-imports-in-test-mode.rs:62:13 + --> $DIR/unused-imports-in-test-mode.rs:76:13 | LL | use crate::b; | ^^^^^^^^ -error: unused import: `super::a` - --> $DIR/unused-imports-in-test-mode.rs:68:9 - | -LL | use super::a; - | ^^^^^^^^ - error: unused import: `crate::b` - --> $DIR/unused-imports-in-test-mode.rs:71:13 + --> $DIR/unused-imports-in-test-mode.rs:87:13 | LL | use crate::b; | ^^^^^^^^ -error: unused import: `super::a` - --> $DIR/unused-imports-in-test-mode.rs:77:9 - | -LL | use super::a; - | ^^^^^^^^ - error: unused import: `crate::b` - --> $DIR/unused-imports-in-test-mode.rs:80:13 + --> $DIR/unused-imports-in-test-mode.rs:98:13 | LL | use crate::b; | ^^^^^^^^ -error: aborting due to 19 previous errors +error: aborting due to 10 previous errors diff --git a/src/test/ui/imports/unused-imports-in-test-module.rs b/src/test/ui/imports/unused-imports-in-test-module.rs index b003b99b6cff0..7849c3fcd4835 100644 --- a/src/test/ui/imports/unused-imports-in-test-module.rs +++ b/src/test/ui/imports/unused-imports-in-test-module.rs @@ -6,58 +6,83 @@ fn a() {} fn b() {} mod test { - use super::a; //~ ERROR unused import: `super::a` + use super::a; //~ ERROR unused import: `super::a` + #[test] fn foo() { - use crate::b; //~ ERROR unused import: `crate::b` + a(); + use crate::b; } } mod tests { - use super::a; //~ ERROR unused import: `super::a` + use super::a; //~ ERROR unused import: `super::a` + #[test] fn foo() { - use crate::b; //~ ERROR unused import: `crate::b` + a(); + use crate::b; } } mod test_a { - use super::a; //~ ERROR unused import: `super::a` + use super::a; //~ ERROR unused import: `super::a` + #[test] fn foo() { - use crate::b; //~ ERROR unused import: `crate::b` + a(); + use crate::b; } } mod a_test { - use super::a; //~ ERROR unused import: `super::a` + use super::a; //~ ERROR unused import: `super::a` + #[test] fn foo() { - use crate::b; //~ ERROR unused import: `crate::b` + a(); + use crate::b; } } mod tests_a { - use super::a; //~ ERROR unused import: `super::a` + use super::a; //~ ERROR unused import: `super::a` + #[test] fn foo() { - use crate::b; //~ ERROR unused import: `crate::b` + a(); + use crate::b; } } mod a_tests { - use super::a; //~ ERROR unused import: `super::a` + use super::a; //~ ERROR unused import: `super::a` + #[test] fn foo() { - use crate::b; //~ ERROR unused import: `crate::b` + a(); + use crate::b; } } mod fastest_search { - use super::a; //~ ERROR unused import: `super::a` + use super::a; //~ ERROR unused import: `super::a` + #[test] fn foo() { - use crate::b; //~ ERROR unused import: `crate::b` + a(); + use crate::b; + } +} + +#[cfg(test)] +mod test_has_attr { + use super::a; + + #[test] + fn foo() { + a(); + use crate::b; } } diff --git a/src/test/ui/imports/unused-imports-in-test-module.stderr b/src/test/ui/imports/unused-imports-in-test-module.stderr index 2efea5b3609e1..1598368eb32cc 100644 --- a/src/test/ui/imports/unused-imports-in-test-module.stderr +++ b/src/test/ui/imports/unused-imports-in-test-module.stderr @@ -22,149 +22,71 @@ help: consider adding a `#[cfg(test)]` to the containing module LL | mod test { | ^^^^^^^^ -error: unused import: `crate::b` - --> $DIR/unused-imports-in-test-module.rs:12:13 - | -LL | use crate::b; - | ^^^^^^^^ - | -help: consider adding a `#[cfg(test)]` to the containing module - --> $DIR/unused-imports-in-test-module.rs:8:1 - | -LL | mod test { - | ^^^^^^^^ - error: unused import: `super::a` - --> $DIR/unused-imports-in-test-module.rs:17:9 + --> $DIR/unused-imports-in-test-module.rs:19:9 | LL | use super::a; | ^^^^^^^^ | help: consider adding a `#[cfg(test)]` to the containing module - --> $DIR/unused-imports-in-test-module.rs:16:1 - | -LL | mod tests { - | ^^^^^^^^^ - -error: unused import: `crate::b` - --> $DIR/unused-imports-in-test-module.rs:20:13 - | -LL | use crate::b; - | ^^^^^^^^ - | -help: consider adding a `#[cfg(test)]` to the containing module - --> $DIR/unused-imports-in-test-module.rs:16:1 + --> $DIR/unused-imports-in-test-module.rs:18:1 | LL | mod tests { | ^^^^^^^^^ error: unused import: `super::a` - --> $DIR/unused-imports-in-test-module.rs:25:9 + --> $DIR/unused-imports-in-test-module.rs:29:9 | LL | use super::a; | ^^^^^^^^ | help: consider adding a `#[cfg(test)]` to the containing module - --> $DIR/unused-imports-in-test-module.rs:24:1 - | -LL | mod test_a { - | ^^^^^^^^^^ - -error: unused import: `crate::b` - --> $DIR/unused-imports-in-test-module.rs:28:13 - | -LL | use crate::b; - | ^^^^^^^^ - | -help: consider adding a `#[cfg(test)]` to the containing module - --> $DIR/unused-imports-in-test-module.rs:24:1 + --> $DIR/unused-imports-in-test-module.rs:28:1 | LL | mod test_a { | ^^^^^^^^^^ error: unused import: `super::a` - --> $DIR/unused-imports-in-test-module.rs:33:9 + --> $DIR/unused-imports-in-test-module.rs:39:9 | LL | use super::a; | ^^^^^^^^ | help: consider adding a `#[cfg(test)]` to the containing module - --> $DIR/unused-imports-in-test-module.rs:32:1 - | -LL | mod a_test { - | ^^^^^^^^^^ - -error: unused import: `crate::b` - --> $DIR/unused-imports-in-test-module.rs:36:13 - | -LL | use crate::b; - | ^^^^^^^^ - | -help: consider adding a `#[cfg(test)]` to the containing module - --> $DIR/unused-imports-in-test-module.rs:32:1 + --> $DIR/unused-imports-in-test-module.rs:38:1 | LL | mod a_test { | ^^^^^^^^^^ error: unused import: `super::a` - --> $DIR/unused-imports-in-test-module.rs:41:9 + --> $DIR/unused-imports-in-test-module.rs:49:9 | LL | use super::a; | ^^^^^^^^ | help: consider adding a `#[cfg(test)]` to the containing module - --> $DIR/unused-imports-in-test-module.rs:40:1 - | -LL | mod tests_a { - | ^^^^^^^^^^^ - -error: unused import: `crate::b` - --> $DIR/unused-imports-in-test-module.rs:44:13 - | -LL | use crate::b; - | ^^^^^^^^ - | -help: consider adding a `#[cfg(test)]` to the containing module - --> $DIR/unused-imports-in-test-module.rs:40:1 + --> $DIR/unused-imports-in-test-module.rs:48:1 | LL | mod tests_a { | ^^^^^^^^^^^ error: unused import: `super::a` - --> $DIR/unused-imports-in-test-module.rs:49:9 + --> $DIR/unused-imports-in-test-module.rs:59:9 | LL | use super::a; | ^^^^^^^^ | help: consider adding a `#[cfg(test)]` to the containing module - --> $DIR/unused-imports-in-test-module.rs:48:1 - | -LL | mod a_tests { - | ^^^^^^^^^^^ - -error: unused import: `crate::b` - --> $DIR/unused-imports-in-test-module.rs:52:13 - | -LL | use crate::b; - | ^^^^^^^^ - | -help: consider adding a `#[cfg(test)]` to the containing module - --> $DIR/unused-imports-in-test-module.rs:48:1 + --> $DIR/unused-imports-in-test-module.rs:58:1 | LL | mod a_tests { | ^^^^^^^^^^^ error: unused import: `super::a` - --> $DIR/unused-imports-in-test-module.rs:57:9 + --> $DIR/unused-imports-in-test-module.rs:69:9 | LL | use super::a; | ^^^^^^^^ -error: unused import: `crate::b` - --> $DIR/unused-imports-in-test-module.rs:60:13 - | -LL | use crate::b; - | ^^^^^^^^ - -error: aborting due to 15 previous errors +error: aborting due to 8 previous errors From b028bbf9d0618f0f4af279d33b7a057a8072eb18 Mon Sep 17 00:00:00 2001 From: Niklas Fiekas Date: Thu, 16 Jun 2022 00:12:03 +0200 Subject: [PATCH 3/9] Document and stabilize process_set_process_group Tracking issue: https://github.com/rust-lang/rust/issues/93857 FCP finished here: https://github.com/rust-lang/rust/issues/93857#issuecomment-1179551697 --- library/std/src/os/unix/process.rs | 31 +++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/library/std/src/os/unix/process.rs b/library/std/src/os/unix/process.rs index 5065530e8d4d0..bd6d431f8e420 100644 --- a/library/std/src/os/unix/process.rs +++ b/library/std/src/os/unix/process.rs @@ -148,9 +148,34 @@ pub trait CommandExt: Sealed { where S: AsRef; - /// Sets the process group ID of the child process. Translates to a `setpgid` call in the child - /// process. - #[unstable(feature = "process_set_process_group", issue = "93857")] + /// Sets the process group ID of the child process. Equivalent to a + /// `setpgid` call in the child process, but may be more efficient. + /// + /// Process groups determine which processes receive signals. + /// + /// # Examples + /// + /// Pressing Ctrl-C in a terminal will send SIGINT to all processes in + /// the current foreground process group. By spawning the `sleep` + /// subprocess in a new process group, it will not receive SIGINT from the + /// terminal. + /// + /// The parent process could install a signal handler and manage the + /// subprocess on its own terms. + /// + /// ```no_run + /// use std::process::Command; + /// use std::os::unix::process::CommandExt; + /// + /// Command::new("sleep") + /// .arg("10") + /// .process_group(0) + /// .spawn()? + /// .wait()?; + /// # + /// # Ok::<_, Box>(()) + /// ``` + #[stable(feature = "process_set_process_group", since = "1.64.0")] fn process_group(&mut self, pgroup: i32) -> &mut process::Command; } From a9d2ed2ab131ddbd218d32b396189bcd8e480e39 Mon Sep 17 00:00:00 2001 From: Jane Losare-Lusby Date: Fri, 15 Jul 2022 22:13:43 +0000 Subject: [PATCH 4/9] add tracking issue to generic member access APIs --- library/std/src/error.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/library/std/src/error.rs b/library/std/src/error.rs index 57f16f9517f20..ff7b70c328daf 100644 --- a/library/std/src/error.rs +++ b/library/std/src/error.rs @@ -364,12 +364,12 @@ pub trait Error: Debug + Display { /// assert!(core::ptr::eq(&error.backtrace, backtrace_ref)); /// } /// ``` - #[unstable(feature = "error_generic_member_access", issue = "none")] + #[unstable(feature = "error_generic_member_access", issue = "99301")] #[allow(unused_variables)] fn provide<'a>(&'a self, req: &mut Demand<'a>) {} } -#[unstable(feature = "error_generic_member_access", issue = "none")] +#[unstable(feature = "error_generic_member_access", issue = "99301")] impl Provider for dyn Error + 'static { fn provide<'a>(&'a self, req: &mut Demand<'a>) { self.provide(req) @@ -912,13 +912,13 @@ impl dyn Error + 'static { } /// Request a reference of type `T` as context about this error. - #[unstable(feature = "error_generic_member_access", issue = "none")] + #[unstable(feature = "error_generic_member_access", issue = "99301")] pub fn request_ref(&self) -> Option<&T> { core::any::request_ref(self) } /// Request a value of type `T` as context about this error. - #[unstable(feature = "error_generic_member_access", issue = "none")] + #[unstable(feature = "error_generic_member_access", issue = "99301")] pub fn request_value(&self) -> Option { core::any::request_value(self) } @@ -947,13 +947,13 @@ impl dyn Error + 'static + Send { } /// Request a reference of type `T` as context about this error. - #[unstable(feature = "error_generic_member_access", issue = "none")] + #[unstable(feature = "error_generic_member_access", issue = "99301")] pub fn request_ref(&self) -> Option<&T> { ::request_ref(self) } /// Request a value of type `T` as context about this error. - #[unstable(feature = "error_generic_member_access", issue = "none")] + #[unstable(feature = "error_generic_member_access", issue = "99301")] pub fn request_value(&self) -> Option { ::request_value(self) } @@ -982,13 +982,13 @@ impl dyn Error + 'static + Send + Sync { } /// Request a reference of type `T` as context about this error. - #[unstable(feature = "error_generic_member_access", issue = "none")] + #[unstable(feature = "error_generic_member_access", issue = "99301")] pub fn request_ref(&self) -> Option<&T> { ::request_ref(self) } /// Request a value of type `T` as context about this error. - #[unstable(feature = "error_generic_member_access", issue = "none")] + #[unstable(feature = "error_generic_member_access", issue = "99301")] pub fn request_value(&self) -> Option { ::request_value(self) } From 084ad5962275c05e0e1962606cf0501cca4757ae Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Sat, 16 Jul 2022 10:04:14 +0900 Subject: [PATCH 5/9] Stabilize `future_poll_fn` Signed-off-by: Yuki Okushi --- library/core/src/future/join.rs | 4 ++-- library/core/src/future/mod.rs | 2 +- library/core/src/future/poll_fn.rs | 11 +++++------ library/core/tests/lib.rs | 1 - 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/library/core/src/future/join.rs b/library/core/src/future/join.rs index fa4eb0d2f33ee..35f0dea062ef9 100644 --- a/library/core/src/future/join.rs +++ b/library/core/src/future/join.rs @@ -15,7 +15,7 @@ use crate::task::{Context, Poll}; /// # Examples /// /// ``` -/// #![feature(future_join, future_poll_fn)] +/// #![feature(future_join)] /// /// use std::future::join; /// @@ -31,7 +31,7 @@ use crate::task::{Context, Poll}; /// `join!` is variadic, so you can pass any number of futures: /// /// ``` -/// #![feature(future_join, future_poll_fn)] +/// #![feature(future_join)] /// /// use std::future::join; /// diff --git a/library/core/src/future/mod.rs b/library/core/src/future/mod.rs index 90eecb9d4a000..6487aa0885955 100644 --- a/library/core/src/future/mod.rs +++ b/library/core/src/future/mod.rs @@ -37,7 +37,7 @@ pub use pending::{pending, Pending}; #[stable(feature = "future_readiness_fns", since = "1.48.0")] pub use ready::{ready, Ready}; -#[unstable(feature = "future_poll_fn", issue = "72302")] +#[stable(feature = "future_poll_fn", since = "1.64.0")] pub use poll_fn::{poll_fn, PollFn}; /// This type is needed because: diff --git a/library/core/src/future/poll_fn.rs b/library/core/src/future/poll_fn.rs index 9ae118e29f110..db2a523323b7a 100644 --- a/library/core/src/future/poll_fn.rs +++ b/library/core/src/future/poll_fn.rs @@ -10,7 +10,6 @@ use crate::task::{Context, Poll}; /// # Examples /// /// ``` -/// #![feature(future_poll_fn)] /// # async fn run() { /// use core::future::poll_fn; /// use std::task::{Context, Poll}; @@ -23,7 +22,7 @@ use crate::task::{Context, Poll}; /// assert_eq!(read_future.await, "Hello, World!".to_owned()); /// # } /// ``` -#[unstable(feature = "future_poll_fn", issue = "72302")] +#[stable(feature = "future_poll_fn", since = "1.64.0")] pub fn poll_fn(f: F) -> PollFn where F: FnMut(&mut Context<'_>) -> Poll, @@ -36,22 +35,22 @@ where /// This `struct` is created by [`poll_fn()`]. See its /// documentation for more. #[must_use = "futures do nothing unless you `.await` or poll them"] -#[unstable(feature = "future_poll_fn", issue = "72302")] +#[stable(feature = "future_poll_fn", since = "1.64.0")] pub struct PollFn { f: F, } -#[unstable(feature = "future_poll_fn", issue = "72302")] +#[stable(feature = "future_poll_fn", since = "1.64.0")] impl Unpin for PollFn {} -#[unstable(feature = "future_poll_fn", issue = "72302")] +#[stable(feature = "future_poll_fn", since = "1.64.0")] impl fmt::Debug for PollFn { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("PollFn").finish() } } -#[unstable(feature = "future_poll_fn", issue = "72302")] +#[stable(feature = "future_poll_fn", since = "1.64.0")] impl Future for PollFn where F: FnMut(&mut Context<'_>) -> Poll, diff --git a/library/core/tests/lib.rs b/library/core/tests/lib.rs index 5849a37444fac..db94368f6e0cc 100644 --- a/library/core/tests/lib.rs +++ b/library/core/tests/lib.rs @@ -32,7 +32,6 @@ #![feature(fmt_internals)] #![feature(float_minimum_maximum)] #![feature(future_join)] -#![feature(future_poll_fn)] #![feature(generic_assert_internals)] #![feature(array_try_from_fn)] #![feature(hasher_prefixfree_extras)] From 3855e868738a847f1e38a6157590aa1a197604ea Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Sat, 16 Jul 2022 14:36:48 -0700 Subject: [PATCH 6/9] Update `since` version to 1.64 --- library/std/src/ffi/os_str.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/std/src/ffi/os_str.rs b/library/std/src/ffi/os_str.rs index 8ce4c2a601722..f171f142b4237 100644 --- a/library/std/src/ffi/os_str.rs +++ b/library/std/src/ffi/os_str.rs @@ -615,7 +615,7 @@ impl Hash for OsString { } } -#[stable(feature = "os_string_fmt_write", since = "1.63.0")] +#[stable(feature = "os_string_fmt_write", since = "1.64.0")] impl fmt::Write for OsString { fn write_str(&mut self, s: &str) -> fmt::Result { self.push(s); From 629b0b488b3e84ce389c71a10ca3ca976bf05d92 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Sat, 16 Jul 2022 14:45:16 -0700 Subject: [PATCH 7/9] Expand documentation for `process_group` Explain PGID 0, and provide the acronym PGID. --- library/std/src/os/unix/process.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/std/src/os/unix/process.rs b/library/std/src/os/unix/process.rs index bd6d431f8e420..09b2bfe39f094 100644 --- a/library/std/src/os/unix/process.rs +++ b/library/std/src/os/unix/process.rs @@ -148,7 +148,7 @@ pub trait CommandExt: Sealed { where S: AsRef; - /// Sets the process group ID of the child process. Equivalent to a + /// Sets the process group ID (PGID) of the child process. Equivalent to a /// `setpgid` call in the child process, but may be more efficient. /// /// Process groups determine which processes receive signals. @@ -163,6 +163,8 @@ pub trait CommandExt: Sealed { /// The parent process could install a signal handler and manage the /// subprocess on its own terms. /// + /// A process group ID of 0 will use the process ID as the PGID. + /// /// ```no_run /// use std::process::Command; /// use std::os::unix::process::CommandExt; From 326646074940222d602f3683d0559088690830f4 Mon Sep 17 00:00:00 2001 From: Caio Date: Tue, 12 Jul 2022 15:36:59 -0300 Subject: [PATCH 8/9] Stabilize `let_chains` --- compiler/rustc_ast/src/lib.rs | 2 +- compiler/rustc_ast_lowering/src/lib.rs | 2 +- .../rustc_ast_passes/src/ast_validation.rs | 40 +- compiler/rustc_ast_passes/src/feature_gate.rs | 1 - compiler/rustc_ast_passes/src/lib.rs | 2 +- compiler/rustc_attr/src/lib.rs | 2 +- compiler/rustc_borrowck/src/lib.rs | 2 +- compiler/rustc_builtin_macros/src/lib.rs | 2 +- compiler/rustc_codegen_llvm/src/lib.rs | 2 +- compiler/rustc_const_eval/src/lib.rs | 2 +- compiler/rustc_error_messages/src/lib.rs | 2 +- compiler/rustc_expand/src/lib.rs | 2 +- compiler/rustc_feature/src/accepted.rs | 2 + compiler/rustc_feature/src/active.rs | 2 - compiler/rustc_infer/src/lib.rs | 2 +- compiler/rustc_lint/src/lib.rs | 2 +- compiler/rustc_metadata/src/lib.rs | 2 +- compiler/rustc_middle/src/lib.rs | 2 +- compiler/rustc_mir_build/src/lib.rs | 2 +- compiler/rustc_mir_transform/src/lib.rs | 2 +- compiler/rustc_parse/src/lib.rs | 2 +- compiler/rustc_parse/src/parser/expr.rs | 30 +- compiler/rustc_passes/src/lib.rs | 2 +- compiler/rustc_resolve/src/lib.rs | 2 +- compiler/rustc_session/src/lib.rs | 2 +- compiler/rustc_trait_selection/src/lib.rs | 2 +- compiler/rustc_typeck/src/lib.rs | 2 +- library/std/src/lib.rs | 2 +- src/librustdoc/lib.rs | 2 +- src/test/ui/expr/if/attrs/let-chains-attr.rs | 2 - src/test/ui/expr/if/bad-if-let-suggestion.rs | 1 - .../ui/expr/if/bad-if-let-suggestion.stderr | 21 +- src/test/ui/mir/issue-92893.rs | 1 - src/test/ui/mir/issue-92893.stderr | 12 +- src/test/ui/mir/mir_let_chains_drop_order.rs | 1 - .../ui/rfc-2294-if-let-guard/feature-gate.rs | 30 +- .../rfc-2294-if-let-guard/feature-gate.stderr | 174 +----- .../rfc-2497-if-let-chains/allowed-syntax.rs | 30 + .../ast-lowering-does-not-wrap-let-chains.rs | 1 - .../disallowed-positions.rs | 11 +- .../disallowed-positions.stderr | 544 +++++++++--------- ...-else-does-not-interact-with-let-chains.rs | 2 +- .../ui/rfc-2497-if-let-chains/feature-gate.rs | 62 -- .../feature-gate.stderr | 114 ---- .../invalid-let-in-a-valid-let-context.rs | 2 - .../invalid-let-in-a-valid-let-context.stderr | 12 +- .../irrefutable-lets.rs | 2 +- .../ui/rfc-2497-if-let-chains/issue-90722.rs | 2 - .../ui/rfc-2497-if-let-chains/issue-92145.rs | 2 - .../ui/rfc-2497-if-let-chains/issue-93150.rs | 1 - .../rfc-2497-if-let-chains/issue-93150.stderr | 11 +- .../then-else-blocks.rs | 2 +- src/tools/clippy/clippy_dev/src/lib.rs | 2 +- src/tools/clippy/clippy_lints/src/lib.rs | 2 +- src/tools/clippy/clippy_utils/src/lib.rs | 2 +- .../clippy/tests/ui/needless_late_init.fixed | 1 - .../clippy/tests/ui/needless_late_init.rs | 1 - .../clippy/tests/ui/needless_late_init.stderr | 32 +- 58 files changed, 426 insertions(+), 777 deletions(-) create mode 100644 src/test/ui/rfc-2497-if-let-chains/allowed-syntax.rs delete mode 100644 src/test/ui/rfc-2497-if-let-chains/feature-gate.rs delete mode 100644 src/test/ui/rfc-2497-if-let-chains/feature-gate.stderr diff --git a/compiler/rustc_ast/src/lib.rs b/compiler/rustc_ast/src/lib.rs index 4b94ec0d6d8f4..838f77512c5af 100644 --- a/compiler/rustc_ast/src/lib.rs +++ b/compiler/rustc_ast/src/lib.rs @@ -14,7 +14,7 @@ #![feature(const_trait_impl)] #![feature(if_let_guard)] #![feature(label_break_value)] -#![feature(let_chains)] +#![cfg_attr(bootstrap, feature(let_chains))] #![feature(min_specialization)] #![feature(negative_impls)] #![feature(slice_internals)] diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs index b79c1cafba008..7cd360623ec42 100644 --- a/compiler/rustc_ast_lowering/src/lib.rs +++ b/compiler/rustc_ast_lowering/src/lib.rs @@ -31,7 +31,7 @@ //! in the HIR, especially for multiple identifiers. #![feature(box_patterns)] -#![feature(let_chains)] +#![cfg_attr(bootstrap, feature(let_chains))] #![feature(let_else)] #![feature(never_type)] #![recursion_limit = "256"] diff --git a/compiler/rustc_ast_passes/src/ast_validation.rs b/compiler/rustc_ast_passes/src/ast_validation.rs index f284bf4650acc..334326e927fad 100644 --- a/compiler/rustc_ast_passes/src/ast_validation.rs +++ b/compiler/rustc_ast_passes/src/ast_validation.rs @@ -119,33 +119,23 @@ impl<'a> AstValidator<'a> { /// Emits an error banning the `let` expression provided in the given location. fn ban_let_expr(&self, expr: &'a Expr, forbidden_let_reason: ForbiddenLetReason) { - let sess = &self.session; - if sess.opts.unstable_features.is_nightly_build() { - let err = "`let` expressions are not supported here"; - let mut diag = sess.struct_span_err(expr.span, err); - diag.note("only supported directly in conditions of `if` and `while` expressions"); - match forbidden_let_reason { - ForbiddenLetReason::GenericForbidden => {} - ForbiddenLetReason::NotSupportedOr(span) => { - diag.span_note( - span, - "`||` operators are not supported in let chain expressions", - ); - } - ForbiddenLetReason::NotSupportedParentheses(span) => { - diag.span_note( - span, - "`let`s wrapped in parentheses are not supported in a context with let \ - chains", - ); - } + let err = "`let` expressions are not supported here"; + let mut diag = self.session.struct_span_err(expr.span, err); + diag.note("only supported directly in conditions of `if` and `while` expressions"); + match forbidden_let_reason { + ForbiddenLetReason::GenericForbidden => {} + ForbiddenLetReason::NotSupportedOr(span) => { + diag.span_note(span, "`||` operators are not supported in let chain expressions"); + } + ForbiddenLetReason::NotSupportedParentheses(span) => { + diag.span_note( + span, + "`let`s wrapped in parentheses are not supported in a context with let \ + chains", + ); } - diag.emit(); - } else { - sess.struct_span_err(expr.span, "expected expression, found statement (`let`)") - .note("variable declaration using `let` is a statement") - .emit(); } + diag.emit(); } fn check_gat_where( diff --git a/compiler/rustc_ast_passes/src/feature_gate.rs b/compiler/rustc_ast_passes/src/feature_gate.rs index e69f85eacf7cd..ad0e0384acffa 100644 --- a/compiler/rustc_ast_passes/src/feature_gate.rs +++ b/compiler/rustc_ast_passes/src/feature_gate.rs @@ -738,7 +738,6 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session) { "`if let` guards are experimental", "you can write `if matches!(, )` instead of `if let = `" ); - gate_all!(let_chains, "`let` expressions in this position are unstable"); gate_all!( async_closure, "async closures are unstable", diff --git a/compiler/rustc_ast_passes/src/lib.rs b/compiler/rustc_ast_passes/src/lib.rs index 9d52c32885db0..2e3ac0c60186d 100644 --- a/compiler/rustc_ast_passes/src/lib.rs +++ b/compiler/rustc_ast_passes/src/lib.rs @@ -8,7 +8,7 @@ #![feature(box_patterns)] #![feature(if_let_guard)] #![feature(iter_is_partitioned)] -#![feature(let_chains)] +#![cfg_attr(bootstrap, feature(let_chains))] #![feature(let_else)] #![recursion_limit = "256"] diff --git a/compiler/rustc_attr/src/lib.rs b/compiler/rustc_attr/src/lib.rs index c3f9f0cf3621f..afe1d191d10e1 100644 --- a/compiler/rustc_attr/src/lib.rs +++ b/compiler/rustc_attr/src/lib.rs @@ -4,7 +4,7 @@ //! The goal is to move the definition of `MetaItem` and things that don't need to be in `syntax` //! to this crate. -#![feature(let_chains)] +#![cfg_attr(bootstrap, feature(let_chains))] #![feature(let_else)] #[macro_use] diff --git a/compiler/rustc_borrowck/src/lib.rs b/compiler/rustc_borrowck/src/lib.rs index 74321ddcd9919..15c2a9f7aefa0 100644 --- a/compiler/rustc_borrowck/src/lib.rs +++ b/compiler/rustc_borrowck/src/lib.rs @@ -2,7 +2,7 @@ #![allow(rustc::potential_query_instability)] #![feature(box_patterns)] -#![feature(let_chains)] +#![cfg_attr(bootstrap, feature(let_chains))] #![feature(let_else)] #![feature(min_specialization)] #![feature(never_type)] diff --git a/compiler/rustc_builtin_macros/src/lib.rs b/compiler/rustc_builtin_macros/src/lib.rs index 11565ba72d755..0192f3c8ca4f2 100644 --- a/compiler/rustc_builtin_macros/src/lib.rs +++ b/compiler/rustc_builtin_macros/src/lib.rs @@ -8,7 +8,7 @@ #![feature(decl_macro)] #![feature(if_let_guard)] #![feature(is_sorted)] -#![feature(let_chains)] +#![cfg_attr(bootstrap, feature(let_chains))] #![feature(let_else)] #![feature(proc_macro_internals)] #![feature(proc_macro_quote)] diff --git a/compiler/rustc_codegen_llvm/src/lib.rs b/compiler/rustc_codegen_llvm/src/lib.rs index e67568b7b8ffe..25ce1cef9440f 100644 --- a/compiler/rustc_codegen_llvm/src/lib.rs +++ b/compiler/rustc_codegen_llvm/src/lib.rs @@ -6,7 +6,7 @@ #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![feature(hash_raw_entry)] -#![feature(let_chains)] +#![cfg_attr(bootstrap, feature(let_chains))] #![feature(let_else)] #![feature(extern_types)] #![feature(once_cell)] diff --git a/compiler/rustc_const_eval/src/lib.rs b/compiler/rustc_const_eval/src/lib.rs index d65d4f7eb720e..bba3e99f7b1f8 100644 --- a/compiler/rustc_const_eval/src/lib.rs +++ b/compiler/rustc_const_eval/src/lib.rs @@ -9,7 +9,7 @@ Rust MIR: a lowered representation of Rust. #![feature(control_flow_enum)] #![feature(decl_macro)] #![feature(exact_size_is_empty)] -#![feature(let_chains)] +#![cfg_attr(bootstrap, feature(let_chains))] #![feature(let_else)] #![feature(map_try_insert)] #![feature(min_specialization)] diff --git a/compiler/rustc_error_messages/src/lib.rs b/compiler/rustc_error_messages/src/lib.rs index a3040f83fdfc7..6b961eaeb42af 100644 --- a/compiler/rustc_error_messages/src/lib.rs +++ b/compiler/rustc_error_messages/src/lib.rs @@ -1,4 +1,4 @@ -#![feature(let_chains)] +#![cfg_attr(bootstrap, feature(let_chains))] #![feature(once_cell)] #![feature(rustc_attrs)] #![feature(type_alias_impl_trait)] diff --git a/compiler/rustc_expand/src/lib.rs b/compiler/rustc_expand/src/lib.rs index c18147592dc70..03b75d809a088 100644 --- a/compiler/rustc_expand/src/lib.rs +++ b/compiler/rustc_expand/src/lib.rs @@ -3,7 +3,7 @@ #![feature(associated_type_bounds)] #![feature(associated_type_defaults)] #![feature(if_let_guard)] -#![feature(let_chains)] +#![cfg_attr(bootstrap, feature(let_chains))] #![feature(let_else)] #![feature(macro_metavar_expr)] #![feature(proc_macro_diagnostic)] diff --git a/compiler/rustc_feature/src/accepted.rs b/compiler/rustc_feature/src/accepted.rs index 099c40b215d99..2d24101b2d59a 100644 --- a/compiler/rustc_feature/src/accepted.rs +++ b/compiler/rustc_feature/src/accepted.rs @@ -186,6 +186,8 @@ declare_features! ( /// Allows some increased flexibility in the name resolution rules, /// especially around globs and shadowing (RFC 1560). (accepted, item_like_imports, "1.15.0", Some(35120), None), + /// Allows `if/while p && let q = r && ...` chains. + (accepted, let_chains, "1.64.0", Some(53667), None), /// Allows `break {expr}` with a value inside `loop`s. (accepted, loop_break_value, "1.19.0", Some(37339), None), /// Allows use of `?` as the Kleene "at most one" operator in macros. diff --git a/compiler/rustc_feature/src/active.rs b/compiler/rustc_feature/src/active.rs index ef4a17564167a..1018facebaed9 100644 --- a/compiler/rustc_feature/src/active.rs +++ b/compiler/rustc_feature/src/active.rs @@ -424,8 +424,6 @@ declare_features! ( (active, label_break_value, "1.28.0", Some(48594), None), // Allows setting the threshold for the `large_assignments` lint. (active, large_assignments, "1.52.0", Some(83518), None), - /// Allows `if/while p && let q = r && ...` chains. - (active, let_chains, "1.37.0", Some(53667), None), /// Allows `let...else` statements. (active, let_else, "1.56.0", Some(87335), None), /// Allows `#[link(..., cfg(..))]`. diff --git a/compiler/rustc_infer/src/lib.rs b/compiler/rustc_infer/src/lib.rs index 7769a68ba2a66..490ba52503fb2 100644 --- a/compiler/rustc_infer/src/lib.rs +++ b/compiler/rustc_infer/src/lib.rs @@ -18,7 +18,7 @@ #![feature(control_flow_enum)] #![feature(extend_one)] #![feature(label_break_value)] -#![feature(let_chains)] +#![cfg_attr(bootstrap, feature(let_chains))] #![feature(let_else)] #![feature(min_specialization)] #![feature(never_type)] diff --git a/compiler/rustc_lint/src/lib.rs b/compiler/rustc_lint/src/lib.rs index aaee0caa070e7..8726d36498bed 100644 --- a/compiler/rustc_lint/src/lib.rs +++ b/compiler/rustc_lint/src/lib.rs @@ -33,7 +33,7 @@ #![feature(if_let_guard)] #![feature(iter_intersperse)] #![feature(iter_order_by)] -#![feature(let_chains)] +#![cfg_attr(bootstrap, feature(let_chains))] #![feature(let_else)] #![feature(never_type)] #![recursion_limit = "256"] diff --git a/compiler/rustc_metadata/src/lib.rs b/compiler/rustc_metadata/src/lib.rs index 6440f3e390cf1..e192378bcc3d2 100644 --- a/compiler/rustc_metadata/src/lib.rs +++ b/compiler/rustc_metadata/src/lib.rs @@ -4,7 +4,7 @@ #![feature(generators)] #![feature(generic_associated_types)] #![feature(iter_from_generator)] -#![feature(let_chains)] +#![cfg_attr(bootstrap, feature(let_chains))] #![feature(let_else)] #![feature(once_cell)] #![feature(proc_macro_internals)] diff --git a/compiler/rustc_middle/src/lib.rs b/compiler/rustc_middle/src/lib.rs index ef06c457bf4bc..45c6468bc24e5 100644 --- a/compiler/rustc_middle/src/lib.rs +++ b/compiler/rustc_middle/src/lib.rs @@ -40,7 +40,7 @@ #![feature(extern_types)] #![feature(new_uninit)] #![feature(once_cell)] -#![feature(let_chains)] +#![cfg_attr(bootstrap, feature(let_chains))] #![feature(let_else)] #![feature(min_specialization)] #![feature(trusted_len)] diff --git a/compiler/rustc_mir_build/src/lib.rs b/compiler/rustc_mir_build/src/lib.rs index 11cd2a9aa4dea..a7d8431b6c7a2 100644 --- a/compiler/rustc_mir_build/src/lib.rs +++ b/compiler/rustc_mir_build/src/lib.rs @@ -5,7 +5,7 @@ #![feature(box_patterns)] #![feature(control_flow_enum)] #![feature(if_let_guard)] -#![feature(let_chains)] +#![cfg_attr(bootstrap, feature(let_chains))] #![feature(let_else)] #![feature(min_specialization)] #![feature(once_cell)] diff --git a/compiler/rustc_mir_transform/src/lib.rs b/compiler/rustc_mir_transform/src/lib.rs index d968a488519f2..40dc9fe9a05bb 100644 --- a/compiler/rustc_mir_transform/src/lib.rs +++ b/compiler/rustc_mir_transform/src/lib.rs @@ -1,6 +1,6 @@ #![allow(rustc::potential_query_instability)] #![feature(box_patterns)] -#![feature(let_chains)] +#![cfg_attr(bootstrap, feature(let_chains))] #![feature(let_else)] #![feature(map_try_insert)] #![feature(min_specialization)] diff --git a/compiler/rustc_parse/src/lib.rs b/compiler/rustc_parse/src/lib.rs index 113af328a91fa..d56e3773dc7a0 100644 --- a/compiler/rustc_parse/src/lib.rs +++ b/compiler/rustc_parse/src/lib.rs @@ -3,7 +3,7 @@ #![feature(array_windows)] #![feature(box_patterns)] #![feature(if_let_guard)] -#![feature(let_chains)] +#![cfg_attr(bootstrap, feature(let_chains))] #![feature(let_else)] #![feature(never_type)] #![feature(rustc_attrs)] diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index 478d5e4792a15..8e1b279d9b6c2 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -2341,16 +2341,9 @@ impl<'a> Parser<'a> { /// Parses the condition of a `if` or `while` expression. fn parse_cond_expr(&mut self) -> PResult<'a, P> { - let cond = self.with_let_management(true, |local_self| { + self.with_let_management(true, |local_self| { local_self.parse_expr_res(Restrictions::NO_STRUCT_LITERAL, None) - })?; - - if let ExprKind::Let(..) = cond.kind { - // Remove the last feature gating of a `let` expression since it's stable. - self.sess.gated_spans.ungate_last(sym::let_chains, cond.span); - } - - Ok(cond) + }) } // Checks if `let` is in an invalid position like `let x = let y = 1;` or @@ -2389,7 +2382,6 @@ impl<'a> Parser<'a> { this.parse_assoc_expr_with(1 + prec_let_scrutinee_needs_par(), None.into()) })?; let span = lo.to(expr.span); - self.sess.gated_spans.gate(sym::let_chains, span); Ok(self.mk_expr(span, ExprKind::Let(pat, expr, span), attrs)) } @@ -2695,15 +2687,11 @@ impl<'a> Parser<'a> { pub(super) fn parse_arm(&mut self) -> PResult<'a, Arm> { // Used to check the `let_chains` and `if_let_guard` features mostly by scaning // `&&` tokens. - fn check_let_expr(expr: &Expr) -> (bool, bool) { + fn check_let_expr(expr: &Expr) -> bool { match expr.kind { - ExprKind::Binary(_, ref lhs, ref rhs) => { - let lhs_rslt = check_let_expr(lhs); - let rhs_rslt = check_let_expr(rhs); - (lhs_rslt.0 || rhs_rslt.0, false) - } - ExprKind::Let(..) => (true, true), - _ => (false, true), + ExprKind::Binary(_, ref lhs, ref rhs) => check_let_expr(lhs) || check_let_expr(rhs), + ExprKind::Let(..) => true, + _ => false, } } let attrs = self.parse_outer_attributes()?; @@ -2718,12 +2706,8 @@ impl<'a> Parser<'a> { let guard = if this.eat_keyword(kw::If) { let if_span = this.prev_token.span; let cond = this.with_let_management(true, |local_this| local_this.parse_expr())?; - let (has_let_expr, does_not_have_bin_op) = check_let_expr(&cond); + let has_let_expr = check_let_expr(&cond); if has_let_expr { - if does_not_have_bin_op { - // Remove the last feature gating of a `let` expression since it's stable. - this.sess.gated_spans.ungate_last(sym::let_chains, cond.span); - } let span = if_span.to(cond.span); this.sess.gated_spans.gate(sym::if_let_guard, span); } diff --git a/compiler/rustc_passes/src/lib.rs b/compiler/rustc_passes/src/lib.rs index 7b2f83958af85..defa9d15296e0 100644 --- a/compiler/rustc_passes/src/lib.rs +++ b/compiler/rustc_passes/src/lib.rs @@ -7,7 +7,7 @@ #![allow(rustc::potential_query_instability)] #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![feature(iter_intersperse)] -#![feature(let_chains)] +#![cfg_attr(bootstrap, feature(let_chains))] #![feature(let_else)] #![feature(map_try_insert)] #![feature(min_specialization)] diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs index 8968179c92e4b..2fcbe1d4c14a5 100644 --- a/compiler/rustc_resolve/src/lib.rs +++ b/compiler/rustc_resolve/src/lib.rs @@ -10,7 +10,7 @@ #![feature(box_patterns)] #![feature(drain_filter)] #![feature(if_let_guard)] -#![feature(let_chains)] +#![cfg_attr(bootstrap, feature(let_chains))] #![feature(let_else)] #![feature(never_type)] #![recursion_limit = "256"] diff --git a/compiler/rustc_session/src/lib.rs b/compiler/rustc_session/src/lib.rs index 7353c1ca0e208..44cf504864254 100644 --- a/compiler/rustc_session/src/lib.rs +++ b/compiler/rustc_session/src/lib.rs @@ -1,5 +1,5 @@ #![feature(if_let_guard)] -#![feature(let_chains)] +#![cfg_attr(bootstrap, feature(let_chains))] #![feature(let_else)] #![feature(min_specialization)] #![feature(never_type)] diff --git a/compiler/rustc_trait_selection/src/lib.rs b/compiler/rustc_trait_selection/src/lib.rs index 282ee632ce581..c33629192cb2b 100644 --- a/compiler/rustc_trait_selection/src/lib.rs +++ b/compiler/rustc_trait_selection/src/lib.rs @@ -17,7 +17,7 @@ #![feature(drain_filter)] #![feature(hash_drain_filter)] #![feature(label_break_value)] -#![feature(let_chains)] +#![cfg_attr(bootstrap, feature(let_chains))] #![feature(let_else)] #![feature(if_let_guard)] #![feature(never_type)] diff --git a/compiler/rustc_typeck/src/lib.rs b/compiler/rustc_typeck/src/lib.rs index f98ae46c58730..706b9ee40aa99 100644 --- a/compiler/rustc_typeck/src/lib.rs +++ b/compiler/rustc_typeck/src/lib.rs @@ -65,7 +65,7 @@ This API is completely unstable and subject to change. #![feature(is_sorted)] #![feature(iter_intersperse)] #![feature(label_break_value)] -#![feature(let_chains)] +#![cfg_attr(bootstrap, feature(let_chains))] #![feature(let_else)] #![feature(min_specialization)] #![feature(never_type)] diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index ab50845e2b208..9fd426d3ac4e2 100644 --- a/library/std/src/lib.rs +++ b/library/std/src/lib.rs @@ -243,7 +243,7 @@ #![feature(intra_doc_pointers)] #![feature(label_break_value)] #![feature(lang_items)] -#![feature(let_chains)] +#![cfg_attr(bootstrap, feature(let_chains))] #![feature(let_else)] #![feature(linkage)] #![feature(min_specialization)] diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index f7dc91a783233..7429f2b6ab148 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -9,7 +9,7 @@ #![feature(control_flow_enum)] #![feature(box_syntax)] #![feature(drain_filter)] -#![feature(let_chains)] +#![cfg_attr(bootstrap, feature(let_chains))] #![feature(let_else)] #![feature(test)] #![feature(never_type)] diff --git a/src/test/ui/expr/if/attrs/let-chains-attr.rs b/src/test/ui/expr/if/attrs/let-chains-attr.rs index 2cd8731141af7..d62c2cb403fe8 100644 --- a/src/test/ui/expr/if/attrs/let-chains-attr.rs +++ b/src/test/ui/expr/if/attrs/let-chains-attr.rs @@ -1,7 +1,5 @@ // check-pass -#![feature(let_chains)] - #[cfg(FALSE)] fn foo() { #[attr] diff --git a/src/test/ui/expr/if/bad-if-let-suggestion.rs b/src/test/ui/expr/if/bad-if-let-suggestion.rs index a8b2a283039fd..070a5b201286d 100644 --- a/src/test/ui/expr/if/bad-if-let-suggestion.rs +++ b/src/test/ui/expr/if/bad-if-let-suggestion.rs @@ -4,7 +4,6 @@ fn a() { if let x = 1 && i = 2 {} //~^ ERROR cannot find value `i` in this scope - //~| ERROR `let` expressions in this position are unstable //~| ERROR mismatched types //~| ERROR `let` expressions are not supported here } diff --git a/src/test/ui/expr/if/bad-if-let-suggestion.stderr b/src/test/ui/expr/if/bad-if-let-suggestion.stderr index 60d286fedf58a..9f7a21c7d1ad9 100644 --- a/src/test/ui/expr/if/bad-if-let-suggestion.stderr +++ b/src/test/ui/expr/if/bad-if-let-suggestion.stderr @@ -13,7 +13,7 @@ LL | if let x = 1 && i = 2 {} | ^ not found in this scope error[E0425]: cannot find value `i` in this scope - --> $DIR/bad-if-let-suggestion.rs:13:9 + --> $DIR/bad-if-let-suggestion.rs:12:9 | LL | fn a() { | ------ similarly named function `a` defined here @@ -22,7 +22,7 @@ LL | if (i + j) = i {} | ^ help: a function with a similar name exists: `a` error[E0425]: cannot find value `j` in this scope - --> $DIR/bad-if-let-suggestion.rs:13:13 + --> $DIR/bad-if-let-suggestion.rs:12:13 | LL | fn a() { | ------ similarly named function `a` defined here @@ -31,7 +31,7 @@ LL | if (i + j) = i {} | ^ help: a function with a similar name exists: `a` error[E0425]: cannot find value `i` in this scope - --> $DIR/bad-if-let-suggestion.rs:13:18 + --> $DIR/bad-if-let-suggestion.rs:12:18 | LL | fn a() { | ------ similarly named function `a` defined here @@ -40,7 +40,7 @@ LL | if (i + j) = i {} | ^ help: a function with a similar name exists: `a` error[E0425]: cannot find value `x` in this scope - --> $DIR/bad-if-let-suggestion.rs:20:8 + --> $DIR/bad-if-let-suggestion.rs:19:8 | LL | fn a() { | ------ similarly named function `a` defined here @@ -48,22 +48,13 @@ LL | fn a() { LL | if x[0] = 1 {} | ^ help: a function with a similar name exists: `a` -error[E0658]: `let` expressions in this position are unstable - --> $DIR/bad-if-let-suggestion.rs:5:8 - | -LL | if let x = 1 && i = 2 {} - | ^^^^^^^^^ - | - = note: see issue #53667 for more information - = help: add `#![feature(let_chains)]` to the crate attributes to enable - error[E0308]: mismatched types --> $DIR/bad-if-let-suggestion.rs:5:8 | LL | if let x = 1 && i = 2 {} | ^^^^^^^^^^^^^^^^^^ expected `bool`, found `()` -error: aborting due to 8 previous errors +error: aborting due to 7 previous errors -Some errors have detailed explanations: E0308, E0425, E0658. +Some errors have detailed explanations: E0308, E0425. For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/ui/mir/issue-92893.rs b/src/test/ui/mir/issue-92893.rs index 635050f376c8a..c2827c7e37fcb 100644 --- a/src/test/ui/mir/issue-92893.rs +++ b/src/test/ui/mir/issue-92893.rs @@ -1,6 +1,5 @@ struct Bug { //~^ `let` expressions are not supported here - //~| `let` expressions in this position are unstable [E0658] //~| expected expression, found `let` statement a: A } diff --git a/src/test/ui/mir/issue-92893.stderr b/src/test/ui/mir/issue-92893.stderr index 4a0fcce31d7c7..bd4654edf4b34 100644 --- a/src/test/ui/mir/issue-92893.stderr +++ b/src/test/ui/mir/issue-92893.stderr @@ -12,15 +12,5 @@ LL | struct Bug { | = note: only supported directly in conditions of `if` and `while` expressions -error[E0658]: `let` expressions in this position are unstable - --> $DIR/issue-92893.rs:1:22 - | -LL | struct Bug { - | ^^^^^^^^^^ - | - = note: see issue #53667 for more information - = help: add `#![feature(let_chains)]` to the crate attributes to enable - -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/mir/mir_let_chains_drop_order.rs b/src/test/ui/mir/mir_let_chains_drop_order.rs index 6498a51957194..21e7b5070af62 100644 --- a/src/test/ui/mir/mir_let_chains_drop_order.rs +++ b/src/test/ui/mir/mir_let_chains_drop_order.rs @@ -4,7 +4,6 @@ // See `mir_drop_order.rs` for more information -#![feature(let_chains)] #![allow(irrefutable_let_patterns)] use std::cell::RefCell; diff --git a/src/test/ui/rfc-2294-if-let-guard/feature-gate.rs b/src/test/ui/rfc-2294-if-let-guard/feature-gate.rs index d8febd273c96e..689fdcebbfba4 100644 --- a/src/test/ui/rfc-2294-if-let-guard/feature-gate.rs +++ b/src/test/ui/rfc-2294-if-let-guard/feature-gate.rs @@ -8,47 +8,33 @@ fn _if_let_guard() { //~^ ERROR `if let` guards are experimental () if (let 0 = 1) => {} - //~^ ERROR `let` expressions in this position are unstable - //~| ERROR expected expression, found `let` statement + //~^ ERROR expected expression, found `let` statement () if (((let 0 = 1))) => {} - //~^ ERROR `let` expressions in this position are unstable - //~| ERROR expected expression, found `let` statement + //~^ ERROR expected expression, found `let` statement () if true && let 0 = 1 => {} //~^ ERROR `if let` guards are experimental - //~| ERROR `let` expressions in this position are unstable () if let 0 = 1 && true => {} //~^ ERROR `if let` guards are experimental - //~| ERROR `let` expressions in this position are unstable () if (let 0 = 1) && true => {} - //~^ ERROR `let` expressions in this position are unstable - //~| ERROR expected expression, found `let` statement + //~^ ERROR expected expression, found `let` statement () if true && (let 0 = 1) => {} - //~^ ERROR `let` expressions in this position are unstable - //~| ERROR expected expression, found `let` statement + //~^ ERROR expected expression, found `let` statement () if (let 0 = 1) && (let 0 = 1) => {} - //~^ ERROR `let` expressions in this position are unstable - //~| ERROR `let` expressions in this position are unstable - //~| ERROR expected expression, found `let` statement + //~^ ERROR expected expression, found `let` statement //~| ERROR expected expression, found `let` statement () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {} //~^ ERROR `if let` guards are experimental - //~| ERROR `let` expressions in this position are unstable - //~| ERROR `let` expressions in this position are unstable - //~| ERROR `let` expressions in this position are unstable - //~| ERROR `let` expressions in this position are unstable - //~| ERROR `let` expressions in this position are unstable //~| ERROR expected expression, found `let` statement () if let Range { start: _, end: _ } = (true..true) && false => {} //~^ ERROR `if let` guards are experimental - //~| ERROR `let` expressions in this position are unstable _ => {} } @@ -64,11 +50,9 @@ fn _macros() { } } use_expr!((let 0 = 1 && 0 == 0)); - //~^ ERROR `let` expressions in this position are unstable - //~| ERROR expected expression, found `let` statement + //~^ ERROR expected expression, found `let` statement use_expr!((let 0 = 1)); - //~^ ERROR `let` expressions in this position are unstable - //~| ERROR expected expression, found `let` statement + //~^ ERROR expected expression, found `let` statement match () { #[cfg(FALSE)] () if let 0 = 1 => {} diff --git a/src/test/ui/rfc-2294-if-let-guard/feature-gate.stderr b/src/test/ui/rfc-2294-if-let-guard/feature-gate.stderr index 52b5bca628ac7..b61041050a8a1 100644 --- a/src/test/ui/rfc-2294-if-let-guard/feature-gate.stderr +++ b/src/test/ui/rfc-2294-if-let-guard/feature-gate.stderr @@ -5,55 +5,55 @@ LL | () if (let 0 = 1) => {} | ^^^ error: expected expression, found `let` statement - --> $DIR/feature-gate.rs:14:18 + --> $DIR/feature-gate.rs:13:18 | LL | () if (((let 0 = 1))) => {} | ^^^ error: expected expression, found `let` statement - --> $DIR/feature-gate.rs:26:16 + --> $DIR/feature-gate.rs:22:16 | LL | () if (let 0 = 1) && true => {} | ^^^ error: expected expression, found `let` statement - --> $DIR/feature-gate.rs:30:24 + --> $DIR/feature-gate.rs:25:24 | LL | () if true && (let 0 = 1) => {} | ^^^ error: expected expression, found `let` statement - --> $DIR/feature-gate.rs:34:16 + --> $DIR/feature-gate.rs:28:16 | LL | () if (let 0 = 1) && (let 0 = 1) => {} | ^^^ error: expected expression, found `let` statement - --> $DIR/feature-gate.rs:34:31 + --> $DIR/feature-gate.rs:28:31 | LL | () if (let 0 = 1) && (let 0 = 1) => {} | ^^^ error: expected expression, found `let` statement - --> $DIR/feature-gate.rs:40:42 + --> $DIR/feature-gate.rs:32:42 | LL | () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {} | ^^^ error: expected expression, found `let` statement - --> $DIR/feature-gate.rs:66:16 + --> $DIR/feature-gate.rs:52:16 | LL | use_expr!((let 0 = 1 && 0 == 0)); | ^^^ error: expected expression, found `let` statement - --> $DIR/feature-gate.rs:69:16 + --> $DIR/feature-gate.rs:54:16 | LL | use_expr!((let 0 = 1)); | ^^^ error: no rules expected the token `let` - --> $DIR/feature-gate.rs:78:15 + --> $DIR/feature-gate.rs:62:15 | LL | macro_rules! use_expr { | --------------------- when calling this macro @@ -72,7 +72,7 @@ LL | () if let 0 = 1 => {} = help: you can write `if matches!(, )` instead of `if let = ` error[E0658]: `if let` guards are experimental - --> $DIR/feature-gate.rs:18:12 + --> $DIR/feature-gate.rs:16:12 | LL | () if true && let 0 = 1 => {} | ^^^^^^^^^^^^^^^^^^^^ @@ -82,7 +82,7 @@ LL | () if true && let 0 = 1 => {} = help: you can write `if matches!(, )` instead of `if let = ` error[E0658]: `if let` guards are experimental - --> $DIR/feature-gate.rs:22:12 + --> $DIR/feature-gate.rs:19:12 | LL | () if let 0 = 1 && true => {} | ^^^^^^^^^^^^^^^^^^^^ @@ -92,7 +92,7 @@ LL | () if let 0 = 1 && true => {} = help: you can write `if matches!(, )` instead of `if let = ` error[E0658]: `if let` guards are experimental - --> $DIR/feature-gate.rs:40:12 + --> $DIR/feature-gate.rs:32:12 | LL | () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -102,7 +102,7 @@ LL | () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = = help: you can write `if matches!(, )` instead of `if let = ` error[E0658]: `if let` guards are experimental - --> $DIR/feature-gate.rs:49:12 + --> $DIR/feature-gate.rs:36:12 | LL | () if let Range { start: _, end: _ } = (true..true) && false => {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -112,7 +112,7 @@ LL | () if let Range { start: _, end: _ } = (true..true) && false => {} = help: you can write `if matches!(, )` instead of `if let = ` error[E0658]: `if let` guards are experimental - --> $DIR/feature-gate.rs:74:12 + --> $DIR/feature-gate.rs:58:12 | LL | () if let 0 = 1 => {} | ^^^^^^^^^^^^ @@ -121,150 +121,6 @@ LL | () if let 0 = 1 => {} = help: add `#![feature(if_let_guard)]` to the crate attributes to enable = help: you can write `if matches!(, )` instead of `if let = ` -error[E0658]: `let` expressions in this position are unstable - --> $DIR/feature-gate.rs:10:16 - | -LL | () if (let 0 = 1) => {} - | ^^^^^^^^^ - | - = note: see issue #53667 for more information - = help: add `#![feature(let_chains)]` to the crate attributes to enable - -error[E0658]: `let` expressions in this position are unstable - --> $DIR/feature-gate.rs:14:18 - | -LL | () if (((let 0 = 1))) => {} - | ^^^^^^^^^ - | - = note: see issue #53667 for more information - = help: add `#![feature(let_chains)]` to the crate attributes to enable - -error[E0658]: `let` expressions in this position are unstable - --> $DIR/feature-gate.rs:18:23 - | -LL | () if true && let 0 = 1 => {} - | ^^^^^^^^^ - | - = note: see issue #53667 for more information - = help: add `#![feature(let_chains)]` to the crate attributes to enable - -error[E0658]: `let` expressions in this position are unstable - --> $DIR/feature-gate.rs:22:15 - | -LL | () if let 0 = 1 && true => {} - | ^^^^^^^^^ - | - = note: see issue #53667 for more information - = help: add `#![feature(let_chains)]` to the crate attributes to enable - -error[E0658]: `let` expressions in this position are unstable - --> $DIR/feature-gate.rs:26:16 - | -LL | () if (let 0 = 1) && true => {} - | ^^^^^^^^^ - | - = note: see issue #53667 for more information - = help: add `#![feature(let_chains)]` to the crate attributes to enable - -error[E0658]: `let` expressions in this position are unstable - --> $DIR/feature-gate.rs:30:24 - | -LL | () if true && (let 0 = 1) => {} - | ^^^^^^^^^ - | - = note: see issue #53667 for more information - = help: add `#![feature(let_chains)]` to the crate attributes to enable - -error[E0658]: `let` expressions in this position are unstable - --> $DIR/feature-gate.rs:34:16 - | -LL | () if (let 0 = 1) && (let 0 = 1) => {} - | ^^^^^^^^^ - | - = note: see issue #53667 for more information - = help: add `#![feature(let_chains)]` to the crate attributes to enable - -error[E0658]: `let` expressions in this position are unstable - --> $DIR/feature-gate.rs:34:31 - | -LL | () if (let 0 = 1) && (let 0 = 1) => {} - | ^^^^^^^^^ - | - = note: see issue #53667 for more information - = help: add `#![feature(let_chains)]` to the crate attributes to enable - -error[E0658]: `let` expressions in this position are unstable - --> $DIR/feature-gate.rs:40:15 - | -LL | () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {} - | ^^^^^^^^^ - | - = note: see issue #53667 for more information - = help: add `#![feature(let_chains)]` to the crate attributes to enable - -error[E0658]: `let` expressions in this position are unstable - --> $DIR/feature-gate.rs:40:28 - | -LL | () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {} - | ^^^^^^^^^ - | - = note: see issue #53667 for more information - = help: add `#![feature(let_chains)]` to the crate attributes to enable - -error[E0658]: `let` expressions in this position are unstable - --> $DIR/feature-gate.rs:40:42 - | -LL | () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {} - | ^^^^^^^^^ - | - = note: see issue #53667 for more information - = help: add `#![feature(let_chains)]` to the crate attributes to enable - -error[E0658]: `let` expressions in this position are unstable - --> $DIR/feature-gate.rs:40:55 - | -LL | () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {} - | ^^^^^^^^^ - | - = note: see issue #53667 for more information - = help: add `#![feature(let_chains)]` to the crate attributes to enable - -error[E0658]: `let` expressions in this position are unstable - --> $DIR/feature-gate.rs:40:68 - | -LL | () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {} - | ^^^^^^^^^ - | - = note: see issue #53667 for more information - = help: add `#![feature(let_chains)]` to the crate attributes to enable - -error[E0658]: `let` expressions in this position are unstable - --> $DIR/feature-gate.rs:49:15 - | -LL | () if let Range { start: _, end: _ } = (true..true) && false => {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #53667 for more information - = help: add `#![feature(let_chains)]` to the crate attributes to enable - -error[E0658]: `let` expressions in this position are unstable - --> $DIR/feature-gate.rs:66:16 - | -LL | use_expr!((let 0 = 1 && 0 == 0)); - | ^^^^^^^^^ - | - = note: see issue #53667 for more information - = help: add `#![feature(let_chains)]` to the crate attributes to enable - -error[E0658]: `let` expressions in this position are unstable - --> $DIR/feature-gate.rs:69:16 - | -LL | use_expr!((let 0 = 1)); - | ^^^^^^^^^ - | - = note: see issue #53667 for more information - = help: add `#![feature(let_chains)]` to the crate attributes to enable - -error: aborting due to 32 previous errors +error: aborting due to 16 previous errors For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/rfc-2497-if-let-chains/allowed-syntax.rs b/src/test/ui/rfc-2497-if-let-chains/allowed-syntax.rs new file mode 100644 index 0000000000000..ffe0499fda23a --- /dev/null +++ b/src/test/ui/rfc-2497-if-let-chains/allowed-syntax.rs @@ -0,0 +1,30 @@ +// check-pass + +#![allow(irrefutable_let_patterns)] + +use std::ops::Range; + +fn _if() { + if let 0 = 1 {} + + if true && let 0 = 1 {} + + if let 0 = 1 && true {} + + if let Range { start: _, end: _ } = (true..true) && false {} + + if let 1 = 1 && let true = { true } && false { + } +} + +fn _while() { + while let 0 = 1 {} + + while true && let 0 = 1 {} + + while let 0 = 1 && true {} + + while let Range { start: _, end: _ } = (true..true) && false {} +} + +fn main() {} diff --git a/src/test/ui/rfc-2497-if-let-chains/ast-lowering-does-not-wrap-let-chains.rs b/src/test/ui/rfc-2497-if-let-chains/ast-lowering-does-not-wrap-let-chains.rs index d851fac8e644f..82164bda4897d 100644 --- a/src/test/ui/rfc-2497-if-let-chains/ast-lowering-does-not-wrap-let-chains.rs +++ b/src/test/ui/rfc-2497-if-let-chains/ast-lowering-does-not-wrap-let-chains.rs @@ -1,6 +1,5 @@ // run-pass -#![feature(let_chains)] #![allow(irrefutable_let_patterns)] fn main() { diff --git a/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.rs b/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.rs index 069d2dc414dea..a89c58785e358 100644 --- a/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.rs +++ b/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.rs @@ -17,8 +17,6 @@ // // To that end, we check some positions which is not part of the language above. -#![feature(let_chains)] // Avoid inflating `.stderr` with overzealous gates in this test. - #![allow(irrefutable_let_patterns)] use std::ops::Range; @@ -100,6 +98,12 @@ fn _macros() { //~^ ERROR `let` expressions are not supported here //~| ERROR `let` expressions are not supported here //~| ERROR expected expression, found `let` statement + use_expr!(true && let 0 = 1); + //~^ ERROR expected expression, found `let` statement + + macro_rules! noop_expr { ($e:expr) => {}; } + noop_expr!((let 0 = 1)); + //~^ ERROR expected expression, found `let` statement } fn nested_within_if_expr() { @@ -467,4 +471,7 @@ fn with_parenthesis() { ([1, 2, 3][let _ = ()]) //~^ ERROR expected expression, found `let` statement } + + #[cfg(FALSE)] (let 0 = 1); + //~^ ERROR expected expression, found `let` statement } 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 cca5310ee0f3a..5e5289f169331 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 @@ -1,353 +1,353 @@ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:29:9 + --> $DIR/disallowed-positions.rs:27:9 | LL | if (let 0 = 1) {} | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:33:11 + --> $DIR/disallowed-positions.rs:31:11 | LL | if (((let 0 = 1))) {} | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:37:9 + --> $DIR/disallowed-positions.rs:35:9 | LL | if (let 0 = 1) && true {} | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:41:17 + --> $DIR/disallowed-positions.rs:39:17 | LL | if true && (let 0 = 1) {} | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:45:9 + --> $DIR/disallowed-positions.rs:43:9 | LL | if (let 0 = 1) && (let 0 = 1) {} | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:45:24 + --> $DIR/disallowed-positions.rs:43:24 | LL | if (let 0 = 1) && (let 0 = 1) {} | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:51:35 + --> $DIR/disallowed-positions.rs:49:35 | LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {} | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:59:12 + --> $DIR/disallowed-positions.rs:57:12 | LL | while (let 0 = 1) {} | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:63:14 + --> $DIR/disallowed-positions.rs:61:14 | LL | while (((let 0 = 1))) {} | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:67:12 + --> $DIR/disallowed-positions.rs:65:12 | LL | while (let 0 = 1) && true {} | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:71:20 + --> $DIR/disallowed-positions.rs:69:20 | LL | while true && (let 0 = 1) {} | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:75:12 + --> $DIR/disallowed-positions.rs:73:12 | LL | while (let 0 = 1) && (let 0 = 1) {} | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:75:27 + --> $DIR/disallowed-positions.rs:73:27 | LL | while (let 0 = 1) && (let 0 = 1) {} | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:81:38 + --> $DIR/disallowed-positions.rs:79:38 | LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {} | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:106:9 + --> $DIR/disallowed-positions.rs:110:9 | LL | if &let 0 = 0 {} | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:111:9 + --> $DIR/disallowed-positions.rs:115:9 | LL | if !let 0 = 0 {} | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:114:9 + --> $DIR/disallowed-positions.rs:118:9 | LL | if *let 0 = 0 {} | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:118:9 + --> $DIR/disallowed-positions.rs:122:9 | LL | if -let 0 = 0 {} | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:128:9 + --> $DIR/disallowed-positions.rs:132:9 | LL | if (let 0 = 0)? {} | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:134:16 + --> $DIR/disallowed-positions.rs:138:16 | LL | if true || let 0 = 0 {} | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:137:17 + --> $DIR/disallowed-positions.rs:141:17 | LL | if (true || let 0 = 0) {} | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:140:25 + --> $DIR/disallowed-positions.rs:144:25 | LL | if true && (true || let 0 = 0) {} | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:147:12 + --> $DIR/disallowed-positions.rs:151:12 | LL | if x = let 0 = 0 {} | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:152:15 + --> $DIR/disallowed-positions.rs:156:15 | LL | if true..(let 0 = 0) {} | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:156:11 + --> $DIR/disallowed-positions.rs:160:11 | LL | if ..(let 0 = 0) {} | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:160:9 + --> $DIR/disallowed-positions.rs:164:9 | LL | if (let 0 = 0).. {} | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:191:19 + --> $DIR/disallowed-positions.rs:195:19 | LL | if let true = let true = true {} | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:197:12 + --> $DIR/disallowed-positions.rs:201:12 | LL | while &let 0 = 0 {} | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:202:12 + --> $DIR/disallowed-positions.rs:206:12 | LL | while !let 0 = 0 {} | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:205:12 + --> $DIR/disallowed-positions.rs:209:12 | LL | while *let 0 = 0 {} | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:209:12 + --> $DIR/disallowed-positions.rs:213:12 | LL | while -let 0 = 0 {} | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:219:12 + --> $DIR/disallowed-positions.rs:223:12 | LL | while (let 0 = 0)? {} | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:225:19 + --> $DIR/disallowed-positions.rs:229:19 | LL | while true || let 0 = 0 {} | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:228:20 + --> $DIR/disallowed-positions.rs:232:20 | LL | while (true || let 0 = 0) {} | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:231:28 + --> $DIR/disallowed-positions.rs:235:28 | LL | while true && (true || let 0 = 0) {} | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:238:15 + --> $DIR/disallowed-positions.rs:242:15 | LL | while x = let 0 = 0 {} | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:243:18 + --> $DIR/disallowed-positions.rs:247:18 | LL | while true..(let 0 = 0) {} | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:247:14 + --> $DIR/disallowed-positions.rs:251:14 | LL | while ..(let 0 = 0) {} | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:251:12 + --> $DIR/disallowed-positions.rs:255:12 | LL | while (let 0 = 0).. {} | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:282:22 + --> $DIR/disallowed-positions.rs:286:22 | LL | while let true = let true = true {} | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:298:6 + --> $DIR/disallowed-positions.rs:302:6 | LL | &let 0 = 0; | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:302:6 + --> $DIR/disallowed-positions.rs:306:6 | LL | !let 0 = 0; | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:305:6 + --> $DIR/disallowed-positions.rs:309:6 | LL | *let 0 = 0; | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:309:6 + --> $DIR/disallowed-positions.rs:313:6 | LL | -let 0 = 0; | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:319:6 + --> $DIR/disallowed-positions.rs:323:6 | LL | (let 0 = 0)?; | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:325:13 + --> $DIR/disallowed-positions.rs:329:13 | LL | true || let 0 = 0; | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:328:14 + --> $DIR/disallowed-positions.rs:332:14 | LL | (true || let 0 = 0); | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:331:22 + --> $DIR/disallowed-positions.rs:335:22 | LL | true && (true || let 0 = 0); | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:336:9 + --> $DIR/disallowed-positions.rs:340:9 | LL | x = let 0 = 0; | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:340:12 + --> $DIR/disallowed-positions.rs:344:12 | LL | true..(let 0 = 0); | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:343:8 + --> $DIR/disallowed-positions.rs:347:8 | LL | ..(let 0 = 0); | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:346:6 + --> $DIR/disallowed-positions.rs:350:6 | LL | (let 0 = 0)..; | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:350:6 + --> $DIR/disallowed-positions.rs:354:6 | LL | (let Range { start: _, end: _ } = true..true || false); | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:355:6 + --> $DIR/disallowed-positions.rs:359:6 | LL | (let true = let true = true); | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:355:17 + --> $DIR/disallowed-positions.rs:359:17 | LL | (let true = let true = true); | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:362:25 + --> $DIR/disallowed-positions.rs:366:25 | LL | let x = true && let y = 1; | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:368:19 + --> $DIR/disallowed-positions.rs:372:19 | LL | [1, 2, 3][let _ = ()] | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:373:6 + --> $DIR/disallowed-positions.rs:377:6 | LL | &let 0 = 0 | ^^^ error: expressions must be enclosed in braces to be used as const generic arguments - --> $DIR/disallowed-positions.rs:406:9 + --> $DIR/disallowed-positions.rs:410:9 | LL | true && let 1 = 1 | ^^^^^^^^^^^^^^^^^ @@ -358,371 +358,389 @@ LL | { true && let 1 = 1 } | + + error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:415:9 + --> $DIR/disallowed-positions.rs:419:9 | LL | if (let Some(a) = opt && true) { | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:420:9 + --> $DIR/disallowed-positions.rs:424:9 | LL | if (let Some(a) = opt) && true { | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:424:9 + --> $DIR/disallowed-positions.rs:428:9 | LL | if (let Some(a) = opt) && (let Some(b) = a) { | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:424:32 + --> $DIR/disallowed-positions.rs:428:32 | LL | if (let Some(a) = opt) && (let Some(b) = a) { | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:433:9 + --> $DIR/disallowed-positions.rs:437:9 | LL | if (let Some(a) = opt && (let Some(b) = a)) && b == 1 { | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:433:31 + --> $DIR/disallowed-positions.rs:437:31 | LL | if (let Some(a) = opt && (let Some(b) = a)) && b == 1 { | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:439:9 + --> $DIR/disallowed-positions.rs:443:9 | LL | if (let Some(a) = opt && (let Some(b) = a)) && true { | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:439:31 + --> $DIR/disallowed-positions.rs:443:31 | LL | if (let Some(a) = opt && (let Some(b) = a)) && true { | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:445:9 + --> $DIR/disallowed-positions.rs:449:9 | LL | if (let Some(a) = opt && (true)) && true { | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:462:22 + --> $DIR/disallowed-positions.rs:466:22 | LL | let x = (true && let y = 1); | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:467:20 + --> $DIR/disallowed-positions.rs:471:20 | LL | ([1, 2, 3][let _ = ()]) | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:95:16 + --> $DIR/disallowed-positions.rs:475:20 + | +LL | #[cfg(FALSE)] (let 0 = 1); + | ^^^ + +error: expected expression, found `let` statement + --> $DIR/disallowed-positions.rs:93:16 | LL | use_expr!((let 0 = 1 && 0 == 0)); | ^^^ error: expected expression, found `let` statement - --> $DIR/disallowed-positions.rs:99:16 + --> $DIR/disallowed-positions.rs:97:16 | LL | use_expr!((let 0 = 1)); | ^^^ +error: expected expression, found `let` statement + --> $DIR/disallowed-positions.rs:101:23 + | +LL | use_expr!(true && let 0 = 1); + | ^^^ + +error: expected expression, found `let` statement + --> $DIR/disallowed-positions.rs:105:17 + | +LL | noop_expr!((let 0 = 1)); + | ^^^ + error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:29:9 + --> $DIR/disallowed-positions.rs:27:9 | LL | if (let 0 = 1) {} | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:29:9 + --> $DIR/disallowed-positions.rs:27:9 | LL | if (let 0 = 1) {} | ^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:33:11 + --> $DIR/disallowed-positions.rs:31:11 | LL | if (((let 0 = 1))) {} | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:33:11 + --> $DIR/disallowed-positions.rs:31:11 | LL | if (((let 0 = 1))) {} | ^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:37:9 + --> $DIR/disallowed-positions.rs:35:9 | LL | if (let 0 = 1) && true {} | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:37:9 + --> $DIR/disallowed-positions.rs:35:9 | LL | if (let 0 = 1) && true {} | ^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:41:17 + --> $DIR/disallowed-positions.rs:39:17 | LL | if true && (let 0 = 1) {} | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:41:17 + --> $DIR/disallowed-positions.rs:39:17 | LL | if true && (let 0 = 1) {} | ^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:45:9 + --> $DIR/disallowed-positions.rs:43:9 | LL | if (let 0 = 1) && (let 0 = 1) {} | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:45:9 + --> $DIR/disallowed-positions.rs:43:9 | LL | if (let 0 = 1) && (let 0 = 1) {} | ^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:45:24 + --> $DIR/disallowed-positions.rs:43:24 | LL | if (let 0 = 1) && (let 0 = 1) {} | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:45:24 + --> $DIR/disallowed-positions.rs:43:24 | LL | if (let 0 = 1) && (let 0 = 1) {} | ^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:51:35 + --> $DIR/disallowed-positions.rs:49:35 | LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {} | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:51:35 + --> $DIR/disallowed-positions.rs:49:35 | LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:51:48 + --> $DIR/disallowed-positions.rs:49:48 | LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {} | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:51:35 + --> $DIR/disallowed-positions.rs:49:35 | LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:51:61 + --> $DIR/disallowed-positions.rs:49:61 | LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {} | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:51:35 + --> $DIR/disallowed-positions.rs:49:35 | LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:59:12 + --> $DIR/disallowed-positions.rs:57:12 | LL | while (let 0 = 1) {} | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:59:12 + --> $DIR/disallowed-positions.rs:57:12 | LL | while (let 0 = 1) {} | ^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:63:14 + --> $DIR/disallowed-positions.rs:61:14 | LL | while (((let 0 = 1))) {} | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:63:14 + --> $DIR/disallowed-positions.rs:61:14 | LL | while (((let 0 = 1))) {} | ^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:67:12 + --> $DIR/disallowed-positions.rs:65:12 | LL | while (let 0 = 1) && true {} | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:67:12 + --> $DIR/disallowed-positions.rs:65:12 | LL | while (let 0 = 1) && true {} | ^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:71:20 + --> $DIR/disallowed-positions.rs:69:20 | LL | while true && (let 0 = 1) {} | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:71:20 + --> $DIR/disallowed-positions.rs:69:20 | LL | while true && (let 0 = 1) {} | ^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:75:12 + --> $DIR/disallowed-positions.rs:73:12 | LL | while (let 0 = 1) && (let 0 = 1) {} | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:75:12 + --> $DIR/disallowed-positions.rs:73:12 | LL | while (let 0 = 1) && (let 0 = 1) {} | ^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:75:27 + --> $DIR/disallowed-positions.rs:73:27 | LL | while (let 0 = 1) && (let 0 = 1) {} | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:75:27 + --> $DIR/disallowed-positions.rs:73:27 | LL | while (let 0 = 1) && (let 0 = 1) {} | ^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:81:38 + --> $DIR/disallowed-positions.rs:79:38 | LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {} | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:81:38 + --> $DIR/disallowed-positions.rs:79:38 | LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:81:51 + --> $DIR/disallowed-positions.rs:79:51 | LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {} | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:81:38 + --> $DIR/disallowed-positions.rs:79:38 | LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:81:64 + --> $DIR/disallowed-positions.rs:79:64 | LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {} | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:81:38 + --> $DIR/disallowed-positions.rs:79:38 | LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:95:16 + --> $DIR/disallowed-positions.rs:93:16 | LL | use_expr!((let 0 = 1 && 0 == 0)); | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:95:16 + --> $DIR/disallowed-positions.rs:93:16 | LL | use_expr!((let 0 = 1 && 0 == 0)); | ^^^^^^^^^^^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:95:16 + --> $DIR/disallowed-positions.rs:93:16 | LL | use_expr!((let 0 = 1 && 0 == 0)); | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:95:16 + --> $DIR/disallowed-positions.rs:93:16 | LL | use_expr!((let 0 = 1 && 0 == 0)); | ^^^^^^^^^^^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:99:16 + --> $DIR/disallowed-positions.rs:97:16 | LL | use_expr!((let 0 = 1)); | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:99:16 + --> $DIR/disallowed-positions.rs:97:16 | LL | use_expr!((let 0 = 1)); | ^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:99:16 + --> $DIR/disallowed-positions.rs:97:16 | LL | use_expr!((let 0 = 1)); | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:99:16 + --> $DIR/disallowed-positions.rs:97:16 | LL | use_expr!((let 0 = 1)); | ^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:106:9 + --> $DIR/disallowed-positions.rs:110:9 | LL | if &let 0 = 0 {} | ^^^^^^^^^ @@ -730,7 +748,7 @@ LL | if &let 0 = 0 {} = note: only supported directly in conditions of `if` and `while` expressions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:111:9 + --> $DIR/disallowed-positions.rs:115:9 | LL | if !let 0 = 0 {} | ^^^^^^^^^ @@ -738,7 +756,7 @@ LL | if !let 0 = 0 {} = note: only supported directly in conditions of `if` and `while` expressions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:114:9 + --> $DIR/disallowed-positions.rs:118:9 | LL | if *let 0 = 0 {} | ^^^^^^^^^ @@ -746,7 +764,7 @@ LL | if *let 0 = 0 {} = note: only supported directly in conditions of `if` and `while` expressions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:118:9 + --> $DIR/disallowed-positions.rs:122:9 | LL | if -let 0 = 0 {} | ^^^^^^^^^ @@ -754,72 +772,72 @@ LL | if -let 0 = 0 {} = note: only supported directly in conditions of `if` and `while` expressions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:128:9 + --> $DIR/disallowed-positions.rs:132:9 | LL | if (let 0 = 0)? {} | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:128:9 + --> $DIR/disallowed-positions.rs:132:9 | LL | if (let 0 = 0)? {} | ^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:134:16 + --> $DIR/disallowed-positions.rs:138:16 | LL | if true || let 0 = 0 {} | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `||` operators are not supported in let chain expressions - --> $DIR/disallowed-positions.rs:134:13 + --> $DIR/disallowed-positions.rs:138:13 | LL | if true || let 0 = 0 {} | ^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:137:17 + --> $DIR/disallowed-positions.rs:141:17 | LL | if (true || let 0 = 0) {} | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `||` operators are not supported in let chain expressions - --> $DIR/disallowed-positions.rs:137:14 + --> $DIR/disallowed-positions.rs:141:14 | LL | if (true || let 0 = 0) {} | ^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:140:25 + --> $DIR/disallowed-positions.rs:144:25 | LL | if true && (true || let 0 = 0) {} | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `||` operators are not supported in let chain expressions - --> $DIR/disallowed-positions.rs:140:22 + --> $DIR/disallowed-positions.rs:144:22 | LL | if true && (true || let 0 = 0) {} | ^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:143:25 + --> $DIR/disallowed-positions.rs:147:25 | LL | if true || (true && let 0 = 0) {} | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:143:17 + --> $DIR/disallowed-positions.rs:147:17 | LL | if true || (true && let 0 = 0) {} | ^^^^^^^^^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:147:12 + --> $DIR/disallowed-positions.rs:151:12 | LL | if x = let 0 = 0 {} | ^^^^^^^^^ @@ -827,46 +845,46 @@ LL | if x = let 0 = 0 {} = note: only supported directly in conditions of `if` and `while` expressions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:152:15 + --> $DIR/disallowed-positions.rs:156:15 | LL | if true..(let 0 = 0) {} | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:152:15 + --> $DIR/disallowed-positions.rs:156:15 | LL | if true..(let 0 = 0) {} | ^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:156:11 + --> $DIR/disallowed-positions.rs:160:11 | LL | if ..(let 0 = 0) {} | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:156:11 + --> $DIR/disallowed-positions.rs:160:11 | LL | if ..(let 0 = 0) {} | ^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:160:9 + --> $DIR/disallowed-positions.rs:164:9 | LL | if (let 0 = 0).. {} | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:160:9 + --> $DIR/disallowed-positions.rs:164:9 | LL | if (let 0 = 0).. {} | ^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:166:8 + --> $DIR/disallowed-positions.rs:170:8 | LL | if let Range { start: _, end: _ } = true..true && false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -874,7 +892,7 @@ LL | if let Range { start: _, end: _ } = true..true && false {} = note: only supported directly in conditions of `if` and `while` expressions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:170:8 + --> $DIR/disallowed-positions.rs:174:8 | LL | if let Range { start: _, end: _ } = true..true || false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -882,7 +900,7 @@ LL | if let Range { start: _, end: _ } = true..true || false {} = note: only supported directly in conditions of `if` and `while` expressions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:177:8 + --> $DIR/disallowed-positions.rs:181:8 | LL | if let Range { start: F, end } = F..|| true {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -890,7 +908,7 @@ LL | if let Range { start: F, end } = F..|| true {} = note: only supported directly in conditions of `if` and `while` expressions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:185:8 + --> $DIR/disallowed-positions.rs:189:8 | LL | if let Range { start: true, end } = t..&&false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -898,7 +916,7 @@ LL | if let Range { start: true, end } = t..&&false {} = note: only supported directly in conditions of `if` and `while` expressions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:191:19 + --> $DIR/disallowed-positions.rs:195:19 | LL | if let true = let true = true {} | ^^^^^^^^^^^^^^^ @@ -906,7 +924,7 @@ LL | if let true = let true = true {} = note: only supported directly in conditions of `if` and `while` expressions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:197:12 + --> $DIR/disallowed-positions.rs:201:12 | LL | while &let 0 = 0 {} | ^^^^^^^^^ @@ -914,7 +932,7 @@ LL | while &let 0 = 0 {} = note: only supported directly in conditions of `if` and `while` expressions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:202:12 + --> $DIR/disallowed-positions.rs:206:12 | LL | while !let 0 = 0 {} | ^^^^^^^^^ @@ -922,7 +940,7 @@ LL | while !let 0 = 0 {} = note: only supported directly in conditions of `if` and `while` expressions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:205:12 + --> $DIR/disallowed-positions.rs:209:12 | LL | while *let 0 = 0 {} | ^^^^^^^^^ @@ -930,7 +948,7 @@ LL | while *let 0 = 0 {} = note: only supported directly in conditions of `if` and `while` expressions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:209:12 + --> $DIR/disallowed-positions.rs:213:12 | LL | while -let 0 = 0 {} | ^^^^^^^^^ @@ -938,72 +956,72 @@ LL | while -let 0 = 0 {} = note: only supported directly in conditions of `if` and `while` expressions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:219:12 + --> $DIR/disallowed-positions.rs:223:12 | LL | while (let 0 = 0)? {} | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:219:12 + --> $DIR/disallowed-positions.rs:223:12 | LL | while (let 0 = 0)? {} | ^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:225:19 + --> $DIR/disallowed-positions.rs:229:19 | LL | while true || let 0 = 0 {} | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `||` operators are not supported in let chain expressions - --> $DIR/disallowed-positions.rs:225:16 + --> $DIR/disallowed-positions.rs:229:16 | LL | while true || let 0 = 0 {} | ^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:228:20 + --> $DIR/disallowed-positions.rs:232:20 | LL | while (true || let 0 = 0) {} | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `||` operators are not supported in let chain expressions - --> $DIR/disallowed-positions.rs:228:17 + --> $DIR/disallowed-positions.rs:232:17 | LL | while (true || let 0 = 0) {} | ^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:231:28 + --> $DIR/disallowed-positions.rs:235:28 | LL | while true && (true || let 0 = 0) {} | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `||` operators are not supported in let chain expressions - --> $DIR/disallowed-positions.rs:231:25 + --> $DIR/disallowed-positions.rs:235:25 | LL | while true && (true || let 0 = 0) {} | ^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:234:28 + --> $DIR/disallowed-positions.rs:238:28 | LL | while true || (true && let 0 = 0) {} | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:234:20 + --> $DIR/disallowed-positions.rs:238:20 | LL | while true || (true && let 0 = 0) {} | ^^^^^^^^^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:238:15 + --> $DIR/disallowed-positions.rs:242:15 | LL | while x = let 0 = 0 {} | ^^^^^^^^^ @@ -1011,46 +1029,46 @@ LL | while x = let 0 = 0 {} = note: only supported directly in conditions of `if` and `while` expressions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:243:18 + --> $DIR/disallowed-positions.rs:247:18 | LL | while true..(let 0 = 0) {} | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:243:18 + --> $DIR/disallowed-positions.rs:247:18 | LL | while true..(let 0 = 0) {} | ^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:247:14 + --> $DIR/disallowed-positions.rs:251:14 | LL | while ..(let 0 = 0) {} | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:247:14 + --> $DIR/disallowed-positions.rs:251:14 | LL | while ..(let 0 = 0) {} | ^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:251:12 + --> $DIR/disallowed-positions.rs:255:12 | LL | while (let 0 = 0).. {} | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:251:12 + --> $DIR/disallowed-positions.rs:255:12 | LL | while (let 0 = 0).. {} | ^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:257:11 + --> $DIR/disallowed-positions.rs:261:11 | LL | while let Range { start: _, end: _ } = true..true && false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1058,7 +1076,7 @@ LL | while let Range { start: _, end: _ } = true..true && false {} = note: only supported directly in conditions of `if` and `while` expressions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:261:11 + --> $DIR/disallowed-positions.rs:265:11 | LL | while let Range { start: _, end: _ } = true..true || false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1066,7 +1084,7 @@ LL | while let Range { start: _, end: _ } = true..true || false {} = note: only supported directly in conditions of `if` and `while` expressions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:268:11 + --> $DIR/disallowed-positions.rs:272:11 | LL | while let Range { start: F, end } = F..|| true {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1074,7 +1092,7 @@ LL | while let Range { start: F, end } = F..|| true {} = note: only supported directly in conditions of `if` and `while` expressions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:276:11 + --> $DIR/disallowed-positions.rs:280:11 | LL | while let Range { start: true, end } = t..&&false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1082,7 +1100,7 @@ LL | while let Range { start: true, end } = t..&&false {} = note: only supported directly in conditions of `if` and `while` expressions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:282:22 + --> $DIR/disallowed-positions.rs:286:22 | LL | while let true = let true = true {} | ^^^^^^^^^^^^^^^ @@ -1090,7 +1108,7 @@ LL | while let true = let true = true {} = note: only supported directly in conditions of `if` and `while` expressions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:298:6 + --> $DIR/disallowed-positions.rs:302:6 | LL | &let 0 = 0; | ^^^^^^^^^ @@ -1098,7 +1116,7 @@ LL | &let 0 = 0; = note: only supported directly in conditions of `if` and `while` expressions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:302:6 + --> $DIR/disallowed-positions.rs:306:6 | LL | !let 0 = 0; | ^^^^^^^^^ @@ -1106,7 +1124,7 @@ LL | !let 0 = 0; = note: only supported directly in conditions of `if` and `while` expressions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:305:6 + --> $DIR/disallowed-positions.rs:309:6 | LL | *let 0 = 0; | ^^^^^^^^^ @@ -1114,7 +1132,7 @@ LL | *let 0 = 0; = note: only supported directly in conditions of `if` and `while` expressions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:309:6 + --> $DIR/disallowed-positions.rs:313:6 | LL | -let 0 = 0; | ^^^^^^^^^ @@ -1122,59 +1140,59 @@ LL | -let 0 = 0; = note: only supported directly in conditions of `if` and `while` expressions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:319:6 + --> $DIR/disallowed-positions.rs:323:6 | LL | (let 0 = 0)?; | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:319:6 + --> $DIR/disallowed-positions.rs:323:6 | LL | (let 0 = 0)?; | ^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:325:13 + --> $DIR/disallowed-positions.rs:329:13 | LL | true || let 0 = 0; | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `||` operators are not supported in let chain expressions - --> $DIR/disallowed-positions.rs:325:10 + --> $DIR/disallowed-positions.rs:329:10 | LL | true || let 0 = 0; | ^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:328:14 + --> $DIR/disallowed-positions.rs:332:14 | LL | (true || let 0 = 0); | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `||` operators are not supported in let chain expressions - --> $DIR/disallowed-positions.rs:328:11 + --> $DIR/disallowed-positions.rs:332:11 | LL | (true || let 0 = 0); | ^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:331:22 + --> $DIR/disallowed-positions.rs:335:22 | LL | true && (true || let 0 = 0); | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `||` operators are not supported in let chain expressions - --> $DIR/disallowed-positions.rs:331:19 + --> $DIR/disallowed-positions.rs:335:19 | LL | true && (true || let 0 = 0); | ^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:336:9 + --> $DIR/disallowed-positions.rs:340:9 | LL | x = let 0 = 0; | ^^^^^^^^^ @@ -1182,46 +1200,46 @@ LL | x = let 0 = 0; = note: only supported directly in conditions of `if` and `while` expressions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:340:12 + --> $DIR/disallowed-positions.rs:344:12 | LL | true..(let 0 = 0); | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:340:12 + --> $DIR/disallowed-positions.rs:344:12 | LL | true..(let 0 = 0); | ^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:343:8 + --> $DIR/disallowed-positions.rs:347:8 | LL | ..(let 0 = 0); | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:343:8 + --> $DIR/disallowed-positions.rs:347:8 | LL | ..(let 0 = 0); | ^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:346:6 + --> $DIR/disallowed-positions.rs:350:6 | LL | (let 0 = 0)..; | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:346:6 + --> $DIR/disallowed-positions.rs:350:6 | LL | (let 0 = 0)..; | ^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:350:6 + --> $DIR/disallowed-positions.rs:354:6 | LL | (let Range { start: _, end: _ } = true..true || false); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1229,20 +1247,20 @@ LL | (let Range { start: _, end: _ } = true..true || false); = note: only supported directly in conditions of `if` and `while` expressions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:355:6 + --> $DIR/disallowed-positions.rs:359:6 | LL | (let true = let true = true); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:355:6 + --> $DIR/disallowed-positions.rs:359:6 | LL | (let true = let true = true); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:373:6 + --> $DIR/disallowed-positions.rs:377:6 | LL | &let 0 = 0 | ^^^^^^^^^ @@ -1250,7 +1268,7 @@ LL | &let 0 = 0 = note: only supported directly in conditions of `if` and `while` expressions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:385:17 + --> $DIR/disallowed-positions.rs:389:17 | LL | true && let 1 = 1 | ^^^^^^^^^ @@ -1258,7 +1276,7 @@ LL | true && let 1 = 1 = note: only supported directly in conditions of `if` and `while` expressions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:390:17 + --> $DIR/disallowed-positions.rs:394:17 | LL | true && let 1 = 1 | ^^^^^^^^^ @@ -1266,7 +1284,7 @@ LL | true && let 1 = 1 = note: only supported directly in conditions of `if` and `while` expressions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:395:17 + --> $DIR/disallowed-positions.rs:399:17 | LL | true && let 1 = 1 | ^^^^^^^^^ @@ -1274,7 +1292,7 @@ LL | true && let 1 = 1 = note: only supported directly in conditions of `if` and `while` expressions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:406:17 + --> $DIR/disallowed-positions.rs:410:17 | LL | true && let 1 = 1 | ^^^^^^^^^ @@ -1282,124 +1300,124 @@ LL | true && let 1 = 1 = note: only supported directly in conditions of `if` and `while` expressions error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:415:9 + --> $DIR/disallowed-positions.rs:419:9 | LL | if (let Some(a) = opt && true) { | ^^^^^^^^^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:415:9 + --> $DIR/disallowed-positions.rs:419:9 | LL | if (let Some(a) = opt && true) { | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:420:9 + --> $DIR/disallowed-positions.rs:424:9 | LL | if (let Some(a) = opt) && true { | ^^^^^^^^^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:420:9 + --> $DIR/disallowed-positions.rs:424:9 | LL | if (let Some(a) = opt) && true { | ^^^^^^^^^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:424:9 + --> $DIR/disallowed-positions.rs:428:9 | LL | if (let Some(a) = opt) && (let Some(b) = a) { | ^^^^^^^^^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:424:9 + --> $DIR/disallowed-positions.rs:428:9 | LL | if (let Some(a) = opt) && (let Some(b) = a) { | ^^^^^^^^^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:424:32 + --> $DIR/disallowed-positions.rs:428:32 | LL | if (let Some(a) = opt) && (let Some(b) = a) { | ^^^^^^^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:424:32 + --> $DIR/disallowed-positions.rs:428:32 | LL | if (let Some(a) = opt) && (let Some(b) = a) { | ^^^^^^^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:433:9 + --> $DIR/disallowed-positions.rs:437:9 | LL | if (let Some(a) = opt && (let Some(b) = a)) && b == 1 { | ^^^^^^^^^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:433:9 + --> $DIR/disallowed-positions.rs:437:9 | LL | if (let Some(a) = opt && (let Some(b) = a)) && b == 1 { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:433:31 + --> $DIR/disallowed-positions.rs:437:31 | LL | if (let Some(a) = opt && (let Some(b) = a)) && b == 1 { | ^^^^^^^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:433:31 + --> $DIR/disallowed-positions.rs:437:31 | LL | if (let Some(a) = opt && (let Some(b) = a)) && b == 1 { | ^^^^^^^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:439:9 + --> $DIR/disallowed-positions.rs:443:9 | LL | if (let Some(a) = opt && (let Some(b) = a)) && true { | ^^^^^^^^^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:439:9 + --> $DIR/disallowed-positions.rs:443:9 | LL | if (let Some(a) = opt && (let Some(b) = a)) && true { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:439:31 + --> $DIR/disallowed-positions.rs:443:31 | LL | if (let Some(a) = opt && (let Some(b) = a)) && true { | ^^^^^^^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:439:31 + --> $DIR/disallowed-positions.rs:443:31 | LL | if (let Some(a) = opt && (let Some(b) = a)) && true { | ^^^^^^^^^^^^^^^ error: `let` expressions are not supported here - --> $DIR/disallowed-positions.rs:445:9 + --> $DIR/disallowed-positions.rs:449:9 | LL | if (let Some(a) = opt && (true)) && true { | ^^^^^^^^^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions note: `let`s wrapped in parentheses are not supported in a context with let chains - --> $DIR/disallowed-positions.rs:445:9 + --> $DIR/disallowed-positions.rs:449:9 | LL | if (let Some(a) = opt && (true)) && true { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:106:8 + --> $DIR/disallowed-positions.rs:110:8 | LL | if &let 0 = 0 {} | ^^^^^^^^^^ expected `bool`, found `&bool` @@ -1411,19 +1429,19 @@ LL + if let 0 = 0 {} | error[E0614]: type `bool` cannot be dereferenced - --> $DIR/disallowed-positions.rs:114:8 + --> $DIR/disallowed-positions.rs:118:8 | LL | if *let 0 = 0 {} | ^^^^^^^^^^ error[E0600]: cannot apply unary operator `-` to type `bool` - --> $DIR/disallowed-positions.rs:118:8 + --> $DIR/disallowed-positions.rs:122:8 | LL | if -let 0 = 0 {} | ^^^^^^^^^^ cannot apply unary operator `-` error[E0277]: the `?` operator can only be applied to values that implement `Try` - --> $DIR/disallowed-positions.rs:128:8 + --> $DIR/disallowed-positions.rs:132:8 | LL | if (let 0 = 0)? {} | ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool` @@ -1431,7 +1449,7 @@ LL | if (let 0 = 0)? {} = help: the trait `Try` is not implemented for `bool` error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`) - --> $DIR/disallowed-positions.rs:128:19 + --> $DIR/disallowed-positions.rs:132:19 | LL | / fn nested_within_if_expr() { LL | | if &let 0 = 0 {} @@ -1448,7 +1466,7 @@ LL | | } = help: the trait `FromResidual<_>` is not implemented for `()` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:147:8 + --> $DIR/disallowed-positions.rs:151:8 | LL | if x = let 0 = 0 {} | ^^^^^^^^^^^^^ expected `bool`, found `()` @@ -1459,7 +1477,7 @@ LL | if x == let 0 = 0 {} | ~~ error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:152:8 + --> $DIR/disallowed-positions.rs:156:8 | LL | if true..(let 0 = 0) {} | ^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range` @@ -1468,7 +1486,7 @@ LL | if true..(let 0 = 0) {} found struct `std::ops::Range` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:156:8 + --> $DIR/disallowed-positions.rs:160:8 | LL | if ..(let 0 = 0) {} | ^^^^^^^^^^^^^ expected `bool`, found struct `RangeTo` @@ -1477,7 +1495,7 @@ LL | if ..(let 0 = 0) {} found struct `RangeTo` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:160:8 + --> $DIR/disallowed-positions.rs:164:8 | LL | if (let 0 = 0).. {} | ^^^^^^^^^^^^^ expected `bool`, found struct `RangeFrom` @@ -1486,7 +1504,7 @@ LL | if (let 0 = 0).. {} found struct `RangeFrom` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:166:12 + --> $DIR/disallowed-positions.rs:170:12 | LL | if let Range { start: _, end: _ } = true..true && false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool` @@ -1497,7 +1515,7 @@ LL | if let Range { start: _, end: _ } = true..true && false {} found struct `std::ops::Range<_>` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:166:8 + --> $DIR/disallowed-positions.rs:170:8 | LL | if let Range { start: _, end: _ } = true..true && false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range` @@ -1506,7 +1524,7 @@ LL | if let Range { start: _, end: _ } = true..true && false {} found struct `std::ops::Range` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:170:12 + --> $DIR/disallowed-positions.rs:174:12 | LL | if let Range { start: _, end: _ } = true..true || false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool` @@ -1517,7 +1535,7 @@ LL | if let Range { start: _, end: _ } = true..true || false {} found struct `std::ops::Range<_>` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:170:8 + --> $DIR/disallowed-positions.rs:174:8 | LL | if let Range { start: _, end: _ } = true..true || false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range` @@ -1526,7 +1544,7 @@ LL | if let Range { start: _, end: _ } = true..true || false {} found struct `std::ops::Range` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:177:12 + --> $DIR/disallowed-positions.rs:181:12 | LL | if let Range { start: F, end } = F..|| true {} | ^^^^^^^^^^^^^^^^^^^^^^^ - this expression has type `fn() -> bool` @@ -1537,20 +1555,20 @@ LL | if let Range { start: F, end } = F..|| true {} found struct `std::ops::Range<_>` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:177:41 + --> $DIR/disallowed-positions.rs:181:41 | LL | if let Range { start: F, end } = F..|| true {} | ^^^^^^^ expected `bool`, found closure | = note: expected type `bool` - found closure `[closure@$DIR/disallowed-positions.rs:177:41: 177:43]` + found closure `[closure@$DIR/disallowed-positions.rs:181:41: 181:43]` help: use parentheses to call this closure | LL | if let Range { start: F, end } = F..(|| true)() {} | + +++ error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:177:8 + --> $DIR/disallowed-positions.rs:181:8 | LL | if let Range { start: F, end } = F..|| true {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range` @@ -1559,7 +1577,7 @@ LL | if let Range { start: F, end } = F..|| true {} found struct `std::ops::Range` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:185:12 + --> $DIR/disallowed-positions.rs:189:12 | LL | if let Range { start: true, end } = t..&&false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - this expression has type `&&bool` @@ -1570,7 +1588,7 @@ LL | if let Range { start: true, end } = t..&&false {} found struct `std::ops::Range<_>` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:185:44 + --> $DIR/disallowed-positions.rs:189:44 | LL | if let Range { start: true, end } = t..&&false {} | ^^^^^^^ expected `bool`, found `&&bool` @@ -1582,7 +1600,7 @@ LL + if let Range { start: true, end } = t..false {} | error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:185:8 + --> $DIR/disallowed-positions.rs:189:8 | LL | if let Range { start: true, end } = t..&&false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range` @@ -1591,7 +1609,7 @@ LL | if let Range { start: true, end } = t..&&false {} found struct `std::ops::Range` error[E0277]: the `?` operator can only be applied to values that implement `Try` - --> $DIR/disallowed-positions.rs:124:20 + --> $DIR/disallowed-positions.rs:128:20 | LL | if let 0 = 0? {} | ^^ the `?` operator cannot be applied to type `{integer}` @@ -1599,7 +1617,7 @@ LL | if let 0 = 0? {} = help: the trait `Try` is not implemented for `{integer}` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:197:11 + --> $DIR/disallowed-positions.rs:201:11 | LL | while &let 0 = 0 {} | ^^^^^^^^^^ expected `bool`, found `&bool` @@ -1611,19 +1629,19 @@ LL + while let 0 = 0 {} | error[E0614]: type `bool` cannot be dereferenced - --> $DIR/disallowed-positions.rs:205:11 + --> $DIR/disallowed-positions.rs:209:11 | LL | while *let 0 = 0 {} | ^^^^^^^^^^ error[E0600]: cannot apply unary operator `-` to type `bool` - --> $DIR/disallowed-positions.rs:209:11 + --> $DIR/disallowed-positions.rs:213:11 | LL | while -let 0 = 0 {} | ^^^^^^^^^^ cannot apply unary operator `-` error[E0277]: the `?` operator can only be applied to values that implement `Try` - --> $DIR/disallowed-positions.rs:219:11 + --> $DIR/disallowed-positions.rs:223:11 | LL | while (let 0 = 0)? {} | ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool` @@ -1631,7 +1649,7 @@ LL | while (let 0 = 0)? {} = help: the trait `Try` is not implemented for `bool` error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`) - --> $DIR/disallowed-positions.rs:219:22 + --> $DIR/disallowed-positions.rs:223:22 | LL | / fn nested_within_while_expr() { LL | | while &let 0 = 0 {} @@ -1648,7 +1666,7 @@ LL | | } = help: the trait `FromResidual<_>` is not implemented for `()` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:238:11 + --> $DIR/disallowed-positions.rs:242:11 | LL | while x = let 0 = 0 {} | ^^^^^^^^^^^^^ expected `bool`, found `()` @@ -1659,7 +1677,7 @@ LL | while x == let 0 = 0 {} | ~~ error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:243:11 + --> $DIR/disallowed-positions.rs:247:11 | LL | while true..(let 0 = 0) {} | ^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range` @@ -1668,7 +1686,7 @@ LL | while true..(let 0 = 0) {} found struct `std::ops::Range` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:247:11 + --> $DIR/disallowed-positions.rs:251:11 | LL | while ..(let 0 = 0) {} | ^^^^^^^^^^^^^ expected `bool`, found struct `RangeTo` @@ -1677,7 +1695,7 @@ LL | while ..(let 0 = 0) {} found struct `RangeTo` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:251:11 + --> $DIR/disallowed-positions.rs:255:11 | LL | while (let 0 = 0).. {} | ^^^^^^^^^^^^^ expected `bool`, found struct `RangeFrom` @@ -1686,7 +1704,7 @@ LL | while (let 0 = 0).. {} found struct `RangeFrom` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:257:15 + --> $DIR/disallowed-positions.rs:261:15 | LL | while let Range { start: _, end: _ } = true..true && false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool` @@ -1697,7 +1715,7 @@ LL | while let Range { start: _, end: _ } = true..true && false {} found struct `std::ops::Range<_>` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:257:11 + --> $DIR/disallowed-positions.rs:261:11 | LL | while let Range { start: _, end: _ } = true..true && false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range` @@ -1706,7 +1724,7 @@ LL | while let Range { start: _, end: _ } = true..true && false {} found struct `std::ops::Range` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:261:15 + --> $DIR/disallowed-positions.rs:265:15 | LL | while let Range { start: _, end: _ } = true..true || false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool` @@ -1717,7 +1735,7 @@ LL | while let Range { start: _, end: _ } = true..true || false {} found struct `std::ops::Range<_>` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:261:11 + --> $DIR/disallowed-positions.rs:265:11 | LL | while let Range { start: _, end: _ } = true..true || false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range` @@ -1726,7 +1744,7 @@ LL | while let Range { start: _, end: _ } = true..true || false {} found struct `std::ops::Range` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:268:15 + --> $DIR/disallowed-positions.rs:272:15 | LL | while let Range { start: F, end } = F..|| true {} | ^^^^^^^^^^^^^^^^^^^^^^^ - this expression has type `fn() -> bool` @@ -1737,20 +1755,20 @@ LL | while let Range { start: F, end } = F..|| true {} found struct `std::ops::Range<_>` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:268:44 + --> $DIR/disallowed-positions.rs:272:44 | LL | while let Range { start: F, end } = F..|| true {} | ^^^^^^^ expected `bool`, found closure | = note: expected type `bool` - found closure `[closure@$DIR/disallowed-positions.rs:268:44: 268:46]` + found closure `[closure@$DIR/disallowed-positions.rs:272:44: 272:46]` help: use parentheses to call this closure | LL | while let Range { start: F, end } = F..(|| true)() {} | + +++ error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:268:11 + --> $DIR/disallowed-positions.rs:272:11 | LL | while let Range { start: F, end } = F..|| true {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range` @@ -1759,7 +1777,7 @@ LL | while let Range { start: F, end } = F..|| true {} found struct `std::ops::Range` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:276:15 + --> $DIR/disallowed-positions.rs:280:15 | LL | while let Range { start: true, end } = t..&&false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - this expression has type `&&bool` @@ -1770,7 +1788,7 @@ LL | while let Range { start: true, end } = t..&&false {} found struct `std::ops::Range<_>` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:276:47 + --> $DIR/disallowed-positions.rs:280:47 | LL | while let Range { start: true, end } = t..&&false {} | ^^^^^^^ expected `bool`, found `&&bool` @@ -1782,7 +1800,7 @@ LL + while let Range { start: true, end } = t..false {} | error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:276:11 + --> $DIR/disallowed-positions.rs:280:11 | LL | while let Range { start: true, end } = t..&&false {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range` @@ -1791,7 +1809,7 @@ LL | while let Range { start: true, end } = t..&&false {} found struct `std::ops::Range` error[E0277]: the `?` operator can only be applied to values that implement `Try` - --> $DIR/disallowed-positions.rs:215:23 + --> $DIR/disallowed-positions.rs:219:23 | LL | while let 0 = 0? {} | ^^ the `?` operator cannot be applied to type `{integer}` @@ -1799,19 +1817,19 @@ LL | while let 0 = 0? {} = help: the trait `Try` is not implemented for `{integer}` error[E0614]: type `bool` cannot be dereferenced - --> $DIR/disallowed-positions.rs:305:5 + --> $DIR/disallowed-positions.rs:309:5 | LL | *let 0 = 0; | ^^^^^^^^^^ error[E0600]: cannot apply unary operator `-` to type `bool` - --> $DIR/disallowed-positions.rs:309:5 + --> $DIR/disallowed-positions.rs:313:5 | LL | -let 0 = 0; | ^^^^^^^^^^ cannot apply unary operator `-` error[E0277]: the `?` operator can only be applied to values that implement `Try` - --> $DIR/disallowed-positions.rs:319:5 + --> $DIR/disallowed-positions.rs:323:5 | LL | (let 0 = 0)?; | ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool` @@ -1819,7 +1837,7 @@ LL | (let 0 = 0)?; = help: the trait `Try` is not implemented for `bool` error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`) - --> $DIR/disallowed-positions.rs:319:16 + --> $DIR/disallowed-positions.rs:323:16 | LL | / fn outside_if_and_while_expr() { LL | | &let 0 = 0; @@ -1836,7 +1854,7 @@ LL | | } = help: the trait `FromResidual<_>` is not implemented for `()` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:350:10 + --> $DIR/disallowed-positions.rs:354:10 | LL | (let Range { start: _, end: _ } = true..true || false); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool` @@ -1847,7 +1865,7 @@ LL | (let Range { start: _, end: _ } = true..true || false); found struct `std::ops::Range<_>` error[E0308]: mismatched types - --> $DIR/disallowed-positions.rs:373:5 + --> $DIR/disallowed-positions.rs:377:5 | LL | fn outside_if_and_while_expr() { | - help: try adding a return type: `-> &bool` @@ -1856,14 +1874,14 @@ LL | &let 0 = 0 | ^^^^^^^^^^ expected `()`, found `&bool` error[E0277]: the `?` operator can only be applied to values that implement `Try` - --> $DIR/disallowed-positions.rs:315:17 + --> $DIR/disallowed-positions.rs:319:17 | LL | let 0 = 0?; | ^^ the `?` operator cannot be applied to type `{integer}` | = help: the trait `Try` is not implemented for `{integer}` -error: aborting due to 205 previous errors +error: aborting due to 208 previous errors Some errors have detailed explanations: E0277, E0308, E0600, E0614. For more information about an error, try `rustc --explain E0277`. diff --git a/src/test/ui/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.rs b/src/test/ui/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.rs index 12befc637c787..deef4240d4da7 100644 --- a/src/test/ui/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.rs +++ b/src/test/ui/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.rs @@ -1,4 +1,4 @@ -#![feature(let_chains, let_else)] +#![feature(let_else)] fn main() { let opt = Some(1i32); diff --git a/src/test/ui/rfc-2497-if-let-chains/feature-gate.rs b/src/test/ui/rfc-2497-if-let-chains/feature-gate.rs deleted file mode 100644 index 2b407ef510c52..0000000000000 --- a/src/test/ui/rfc-2497-if-let-chains/feature-gate.rs +++ /dev/null @@ -1,62 +0,0 @@ -// gate-test-let_chains - -// Here we test feature gating for ´let_chains`. -// See `disallowed-positions.rs` for the grammar -// defining the language for gated allowed positions. - -#![allow(irrefutable_let_patterns)] - -use std::ops::Range; - -fn _if() { - if let 0 = 1 {} // Stable! - - if true && let 0 = 1 {} - //~^ ERROR `let` expressions in this position are unstable [E0658] - - if let 0 = 1 && true {} - //~^ ERROR `let` expressions in this position are unstable [E0658] - - if let Range { start: _, end: _ } = (true..true) && false {} - //~^ ERROR `let` expressions in this position are unstable [E0658] - - if let 1 = 1 && let true = { true } && false { - //~^ ERROR `let` expressions in this position are unstable [E0658] - //~| ERROR `let` expressions in this position are unstable [E0658] - } -} - -fn _while() { - while let 0 = 1 {} // Stable! - - while true && let 0 = 1 {} - //~^ ERROR `let` expressions in this position are unstable [E0658] - - while let 0 = 1 && true {} - //~^ ERROR `let` expressions in this position are unstable [E0658] - - while let Range { start: _, end: _ } = (true..true) && false {} - //~^ ERROR `let` expressions in this position are unstable [E0658] -} - -fn _macros() { - macro_rules! noop_expr { ($e:expr) => {}; } - - noop_expr!((let 0 = 1)); - //~^ ERROR `let` expressions in this position are unstable [E0658] - //~| ERROR expected expression, found `let` statement - - macro_rules! use_expr { - ($e:expr) => { - if $e {} - while $e {} - } - } - #[cfg(FALSE)] (let 0 = 1); - //~^ ERROR `let` expressions in this position are unstable [E0658] - //~| ERROR expected expression, found `let` statement - use_expr!(let 0 = 1); - //~^ ERROR no rules expected the token `let` -} - -fn main() {} diff --git a/src/test/ui/rfc-2497-if-let-chains/feature-gate.stderr b/src/test/ui/rfc-2497-if-let-chains/feature-gate.stderr deleted file mode 100644 index feea1c254d8da..0000000000000 --- a/src/test/ui/rfc-2497-if-let-chains/feature-gate.stderr +++ /dev/null @@ -1,114 +0,0 @@ -error: expected expression, found `let` statement - --> $DIR/feature-gate.rs:55:20 - | -LL | #[cfg(FALSE)] (let 0 = 1); - | ^^^ - -error: expected expression, found `let` statement - --> $DIR/feature-gate.rs:45:17 - | -LL | noop_expr!((let 0 = 1)); - | ^^^ - -error: no rules expected the token `let` - --> $DIR/feature-gate.rs:58:15 - | -LL | macro_rules! use_expr { - | --------------------- when calling this macro -... -LL | use_expr!(let 0 = 1); - | ^^^ no rules expected this token in macro call - -error[E0658]: `let` expressions in this position are unstable - --> $DIR/feature-gate.rs:14:16 - | -LL | if true && let 0 = 1 {} - | ^^^^^^^^^ - | - = note: see issue #53667 for more information - = help: add `#![feature(let_chains)]` to the crate attributes to enable - -error[E0658]: `let` expressions in this position are unstable - --> $DIR/feature-gate.rs:17:8 - | -LL | if let 0 = 1 && true {} - | ^^^^^^^^^ - | - = note: see issue #53667 for more information - = help: add `#![feature(let_chains)]` to the crate attributes to enable - -error[E0658]: `let` expressions in this position are unstable - --> $DIR/feature-gate.rs:20:8 - | -LL | if let Range { start: _, end: _ } = (true..true) && false {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #53667 for more information - = help: add `#![feature(let_chains)]` to the crate attributes to enable - -error[E0658]: `let` expressions in this position are unstable - --> $DIR/feature-gate.rs:23:8 - | -LL | if let 1 = 1 && let true = { true } && false { - | ^^^^^^^^^ - | - = note: see issue #53667 for more information - = help: add `#![feature(let_chains)]` to the crate attributes to enable - -error[E0658]: `let` expressions in this position are unstable - --> $DIR/feature-gate.rs:23:21 - | -LL | if let 1 = 1 && let true = { true } && false { - | ^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #53667 for more information - = help: add `#![feature(let_chains)]` to the crate attributes to enable - -error[E0658]: `let` expressions in this position are unstable - --> $DIR/feature-gate.rs:32:19 - | -LL | while true && let 0 = 1 {} - | ^^^^^^^^^ - | - = note: see issue #53667 for more information - = help: add `#![feature(let_chains)]` to the crate attributes to enable - -error[E0658]: `let` expressions in this position are unstable - --> $DIR/feature-gate.rs:35:11 - | -LL | while let 0 = 1 && true {} - | ^^^^^^^^^ - | - = note: see issue #53667 for more information - = help: add `#![feature(let_chains)]` to the crate attributes to enable - -error[E0658]: `let` expressions in this position are unstable - --> $DIR/feature-gate.rs:38:11 - | -LL | while let Range { start: _, end: _ } = (true..true) && false {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #53667 for more information - = help: add `#![feature(let_chains)]` to the crate attributes to enable - -error[E0658]: `let` expressions in this position are unstable - --> $DIR/feature-gate.rs:55:20 - | -LL | #[cfg(FALSE)] (let 0 = 1); - | ^^^^^^^^^ - | - = note: see issue #53667 for more information - = help: add `#![feature(let_chains)]` to the crate attributes to enable - -error[E0658]: `let` expressions in this position are unstable - --> $DIR/feature-gate.rs:45:17 - | -LL | noop_expr!((let 0 = 1)); - | ^^^^^^^^^ - | - = note: see issue #53667 for more information - = help: add `#![feature(let_chains)]` to the crate attributes to enable - -error: aborting due to 13 previous errors - -For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/rfc-2497-if-let-chains/invalid-let-in-a-valid-let-context.rs b/src/test/ui/rfc-2497-if-let-chains/invalid-let-in-a-valid-let-context.rs index a942d1f4cafbf..7bc6d43a7276a 100644 --- a/src/test/ui/rfc-2497-if-let-chains/invalid-let-in-a-valid-let-context.rs +++ b/src/test/ui/rfc-2497-if-let-chains/invalid-let-in-a-valid-let-context.rs @@ -1,5 +1,3 @@ -#![feature(let_chains)] - fn main() { let _opt = Some(1i32); diff --git a/src/test/ui/rfc-2497-if-let-chains/invalid-let-in-a-valid-let-context.stderr b/src/test/ui/rfc-2497-if-let-chains/invalid-let-in-a-valid-let-context.stderr index d1ce83c723329..d1552a0b2d5ad 100644 --- a/src/test/ui/rfc-2497-if-let-chains/invalid-let-in-a-valid-let-context.stderr +++ b/src/test/ui/rfc-2497-if-let-chains/invalid-let-in-a-valid-let-context.stderr @@ -1,35 +1,35 @@ error: expected expression, found `let` statement - --> $DIR/invalid-let-in-a-valid-let-context.rs:8:19 + --> $DIR/invalid-let-in-a-valid-let-context.rs:6:19 | LL | let _ = &&let Some(x) = Some(42); | ^^^ error: expected expression, found `let` statement - --> $DIR/invalid-let-in-a-valid-let-context.rs:13:47 + --> $DIR/invalid-let-in-a-valid-let-context.rs:11:47 | LL | if let Some(elem) = _opt && [1, 2, 3][let _ = &&let Some(x) = Some(42)] = 1 { | ^^^ error: expected expression, found `let` statement - --> $DIR/invalid-let-in-a-valid-let-context.rs:13:57 + --> $DIR/invalid-let-in-a-valid-let-context.rs:11:57 | LL | if let Some(elem) = _opt && [1, 2, 3][let _ = &&let Some(x) = Some(42)] = 1 { | ^^^ error: expected expression, found `let` statement - --> $DIR/invalid-let-in-a-valid-let-context.rs:23:23 + --> $DIR/invalid-let-in-a-valid-let-context.rs:21:23 | LL | [1, 2, 3][let _ = ()]; | ^^^ error: expected expression, found `let` statement - --> $DIR/invalid-let-in-a-valid-let-context.rs:32:47 + --> $DIR/invalid-let-in-a-valid-let-context.rs:30:47 | LL | if let Some(elem) = _opt && [1, 2, 3][let _ = ()] = 1 { | ^^^ error: expected expression, found `let` statement - --> $DIR/invalid-let-in-a-valid-let-context.rs:40:21 + --> $DIR/invalid-let-in-a-valid-let-context.rs:38:21 | LL | let x = let y = 1; | ^^^ diff --git a/src/test/ui/rfc-2497-if-let-chains/irrefutable-lets.rs b/src/test/ui/rfc-2497-if-let-chains/irrefutable-lets.rs index 3d1626e8ffb9a..1ef4bc56e5252 100644 --- a/src/test/ui/rfc-2497-if-let-chains/irrefutable-lets.rs +++ b/src/test/ui/rfc-2497-if-let-chains/irrefutable-lets.rs @@ -1,7 +1,7 @@ // revisions: allowed disallowed //[allowed] check-pass -#![feature(if_let_guard, let_chains)] +#![feature(if_let_guard)] #![cfg_attr(allowed, allow(irrefutable_let_patterns))] #![cfg_attr(disallowed, deny(irrefutable_let_patterns))] diff --git a/src/test/ui/rfc-2497-if-let-chains/issue-90722.rs b/src/test/ui/rfc-2497-if-let-chains/issue-90722.rs index 6b7d883565085..34302ba96d3a2 100644 --- a/src/test/ui/rfc-2497-if-let-chains/issue-90722.rs +++ b/src/test/ui/rfc-2497-if-let-chains/issue-90722.rs @@ -1,7 +1,5 @@ // check-pass -#![feature(let_chains)] - fn main() { let x = Some(vec!["test"]); diff --git a/src/test/ui/rfc-2497-if-let-chains/issue-92145.rs b/src/test/ui/rfc-2497-if-let-chains/issue-92145.rs index 7c7e31f4db400..6938062fa35f0 100644 --- a/src/test/ui/rfc-2497-if-let-chains/issue-92145.rs +++ b/src/test/ui/rfc-2497-if-let-chains/issue-92145.rs @@ -1,7 +1,5 @@ // check-pass -#![feature(let_chains)] - fn main() { let opt = Some("foo bar"); diff --git a/src/test/ui/rfc-2497-if-let-chains/issue-93150.rs b/src/test/ui/rfc-2497-if-let-chains/issue-93150.rs index f90b9ab0d40f0..f6de37867d855 100644 --- a/src/test/ui/rfc-2497-if-let-chains/issue-93150.rs +++ b/src/test/ui/rfc-2497-if-let-chains/issue-93150.rs @@ -2,7 +2,6 @@ fn main() { match true { _ if let true = true && true => {} //~^ ERROR `if let` guards are - //~| ERROR `let` expressions in this _ => {} } } diff --git a/src/test/ui/rfc-2497-if-let-chains/issue-93150.stderr b/src/test/ui/rfc-2497-if-let-chains/issue-93150.stderr index b25f299a2190f..0d620df96f610 100644 --- a/src/test/ui/rfc-2497-if-let-chains/issue-93150.stderr +++ b/src/test/ui/rfc-2497-if-let-chains/issue-93150.stderr @@ -8,15 +8,6 @@ LL | _ if let true = true && true => {} = help: add `#![feature(if_let_guard)]` to the crate attributes to enable = help: you can write `if matches!(, )` instead of `if let = ` -error[E0658]: `let` expressions in this position are unstable - --> $DIR/issue-93150.rs:3:14 - | -LL | _ if let true = true && true => {} - | ^^^^^^^^^^^^^^^ - | - = note: see issue #53667 for more information - = help: add `#![feature(let_chains)]` to the crate attributes to enable - -error: aborting due to 2 previous errors +error: aborting due to previous error For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/rfc-2497-if-let-chains/then-else-blocks.rs b/src/test/ui/rfc-2497-if-let-chains/then-else-blocks.rs index e061174f667d9..beaca33d56364 100644 --- a/src/test/ui/rfc-2497-if-let-chains/then-else-blocks.rs +++ b/src/test/ui/rfc-2497-if-let-chains/then-else-blocks.rs @@ -1,6 +1,6 @@ // run-pass -#![feature(if_let_guard, let_chains)] +#![feature(if_let_guard)] fn check_if_let(opt: Option>>, value: i32) -> bool { if let Some(first) = opt diff --git a/src/tools/clippy/clippy_dev/src/lib.rs b/src/tools/clippy/clippy_dev/src/lib.rs index 81e807cf10c7c..fe69284ab10e4 100644 --- a/src/tools/clippy/clippy_dev/src/lib.rs +++ b/src/tools/clippy/clippy_dev/src/lib.rs @@ -1,4 +1,4 @@ -#![feature(let_chains)] +#![cfg_attr(bootstrap, feature(let_chains))] #![feature(let_else)] #![feature(once_cell)] #![feature(rustc_private)] diff --git a/src/tools/clippy/clippy_lints/src/lib.rs b/src/tools/clippy/clippy_lints/src/lib.rs index 172fdf8c85269..884baaea02926 100644 --- a/src/tools/clippy/clippy_lints/src/lib.rs +++ b/src/tools/clippy/clippy_lints/src/lib.rs @@ -4,7 +4,7 @@ #![feature(control_flow_enum)] #![feature(drain_filter)] #![feature(iter_intersperse)] -#![feature(let_chains)] +#![cfg_attr(bootstrap, feature(let_chains))] #![feature(let_else)] #![feature(lint_reasons)] #![feature(never_type)] diff --git a/src/tools/clippy/clippy_utils/src/lib.rs b/src/tools/clippy/clippy_utils/src/lib.rs index 242d4315378e3..0089e1b64006f 100644 --- a/src/tools/clippy/clippy_utils/src/lib.rs +++ b/src/tools/clippy/clippy_utils/src/lib.rs @@ -1,7 +1,7 @@ #![feature(box_patterns)] #![feature(control_flow_enum)] #![feature(let_else)] -#![feature(let_chains)] +#![cfg_attr(bootstrap, feature(let_chains))] #![feature(lint_reasons)] #![feature(once_cell)] #![feature(rustc_private)] diff --git a/src/tools/clippy/tests/ui/needless_late_init.fixed b/src/tools/clippy/tests/ui/needless_late_init.fixed index fee8e3030b808..4c98e1827bdbb 100644 --- a/src/tools/clippy/tests/ui/needless_late_init.fixed +++ b/src/tools/clippy/tests/ui/needless_late_init.fixed @@ -1,5 +1,4 @@ // run-rustfix -#![feature(let_chains)] #![allow( unused, clippy::assign_op_pattern, diff --git a/src/tools/clippy/tests/ui/needless_late_init.rs b/src/tools/clippy/tests/ui/needless_late_init.rs index 402d9f9ef7f81..25e1e0214fb44 100644 --- a/src/tools/clippy/tests/ui/needless_late_init.rs +++ b/src/tools/clippy/tests/ui/needless_late_init.rs @@ -1,5 +1,4 @@ // run-rustfix -#![feature(let_chains)] #![allow( unused, clippy::assign_op_pattern, diff --git a/src/tools/clippy/tests/ui/needless_late_init.stderr b/src/tools/clippy/tests/ui/needless_late_init.stderr index 313cdbbeba183..97f0f7019a9df 100644 --- a/src/tools/clippy/tests/ui/needless_late_init.stderr +++ b/src/tools/clippy/tests/ui/needless_late_init.stderr @@ -1,5 +1,5 @@ error: unneeded late initialization - --> $DIR/needless_late_init.rs:23:5 + --> $DIR/needless_late_init.rs:22:5 | LL | let a; | ^^^^^^ created here @@ -13,7 +13,7 @@ LL | let a = "zero"; | ~~~~~ error: unneeded late initialization - --> $DIR/needless_late_init.rs:26:5 + --> $DIR/needless_late_init.rs:25:5 | LL | let b; | ^^^^^^ created here @@ -27,7 +27,7 @@ LL | let b = 1; | ~~~~~ error: unneeded late initialization - --> $DIR/needless_late_init.rs:27:5 + --> $DIR/needless_late_init.rs:26:5 | LL | let c; | ^^^^^^ created here @@ -41,7 +41,7 @@ LL | let c = 2; | ~~~~~ error: unneeded late initialization - --> $DIR/needless_late_init.rs:31:5 + --> $DIR/needless_late_init.rs:30:5 | LL | let d: usize; | ^^^^^^^^^^^^^ created here @@ -54,7 +54,7 @@ LL | let d: usize = 1; | ~~~~~~~~~~~~ error: unneeded late initialization - --> $DIR/needless_late_init.rs:34:5 + --> $DIR/needless_late_init.rs:33:5 | LL | let e; | ^^^^^^ created here @@ -67,7 +67,7 @@ LL | let e = format!("{}", d); | ~~~~~ error: unneeded late initialization - --> $DIR/needless_late_init.rs:39:5 + --> $DIR/needless_late_init.rs:38:5 | LL | let a; | ^^^^^^ @@ -88,7 +88,7 @@ LL | }; | + error: unneeded late initialization - --> $DIR/needless_late_init.rs:48:5 + --> $DIR/needless_late_init.rs:47:5 | LL | let b; | ^^^^^^ @@ -109,7 +109,7 @@ LL | }; | + error: unneeded late initialization - --> $DIR/needless_late_init.rs:55:5 + --> $DIR/needless_late_init.rs:54:5 | LL | let d; | ^^^^^^ @@ -130,7 +130,7 @@ LL | }; | + error: unneeded late initialization - --> $DIR/needless_late_init.rs:63:5 + --> $DIR/needless_late_init.rs:62:5 | LL | let e; | ^^^^^^ @@ -151,7 +151,7 @@ LL | }; | + error: unneeded late initialization - --> $DIR/needless_late_init.rs:70:5 + --> $DIR/needless_late_init.rs:69:5 | LL | let f; | ^^^^^^ @@ -167,7 +167,7 @@ LL + 1 => "three", | error: unneeded late initialization - --> $DIR/needless_late_init.rs:76:5 + --> $DIR/needless_late_init.rs:75:5 | LL | let g: usize; | ^^^^^^^^^^^^^ @@ -187,7 +187,7 @@ LL | }; | + error: unneeded late initialization - --> $DIR/needless_late_init.rs:84:5 + --> $DIR/needless_late_init.rs:83:5 | LL | let x; | ^^^^^^ created here @@ -201,7 +201,7 @@ LL | let x = 1; | ~~~~~ error: unneeded late initialization - --> $DIR/needless_late_init.rs:88:5 + --> $DIR/needless_late_init.rs:87:5 | LL | let x; | ^^^^^^ created here @@ -215,7 +215,7 @@ LL | let x = SignificantDrop; | ~~~~~ error: unneeded late initialization - --> $DIR/needless_late_init.rs:92:5 + --> $DIR/needless_late_init.rs:91:5 | LL | let x; | ^^^^^^ created here @@ -229,7 +229,7 @@ LL | let x = SignificantDrop; | ~~~~~ error: unneeded late initialization - --> $DIR/needless_late_init.rs:111:5 + --> $DIR/needless_late_init.rs:110:5 | LL | let a; | ^^^^^^ @@ -250,7 +250,7 @@ LL | }; | + error: unneeded late initialization - --> $DIR/needless_late_init.rs:128:5 + --> $DIR/needless_late_init.rs:127:5 | LL | let a; | ^^^^^^ From a94e6c78a2f2ceefbfc8781d885eb74a69a5d542 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Sun, 17 Jul 2022 08:50:41 +0900 Subject: [PATCH 9/9] Add regression test for #95829 Signed-off-by: Yuki Okushi --- src/test/ui/extern/issue-95829.rs | 10 +++++++++ src/test/ui/extern/issue-95829.stderr | 32 +++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 src/test/ui/extern/issue-95829.rs create mode 100644 src/test/ui/extern/issue-95829.stderr diff --git a/src/test/ui/extern/issue-95829.rs b/src/test/ui/extern/issue-95829.rs new file mode 100644 index 0000000000000..3379148ae7bb0 --- /dev/null +++ b/src/test/ui/extern/issue-95829.rs @@ -0,0 +1,10 @@ +// edition:2018 + +extern { + async fn L() { //~ ERROR: incorrect function inside `extern` block + //~^ ERROR: functions in `extern` blocks cannot have qualifiers + async fn M() {} + } +} + +fn main() {} diff --git a/src/test/ui/extern/issue-95829.stderr b/src/test/ui/extern/issue-95829.stderr new file mode 100644 index 0000000000000..b902f0ef8f5c0 --- /dev/null +++ b/src/test/ui/extern/issue-95829.stderr @@ -0,0 +1,32 @@ +error: incorrect function inside `extern` block + --> $DIR/issue-95829.rs:4:14 + | +LL | extern { + | ------ `extern` blocks define existing foreign functions and functions inside of them cannot have a body +LL | async fn L() { + | ______________^___- + | | | + | | cannot have a body +LL | | +LL | | async fn M() {} +LL | | } + | |_____- help: remove the invalid body: `;` + | + = help: you might have meant to write a function accessible through FFI, which can be done by writing `extern fn` outside of the `extern` block + = note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html + +error: functions in `extern` blocks cannot have qualifiers + --> $DIR/issue-95829.rs:4:14 + | +LL | extern { + | ------ in this `extern` block +LL | async fn L() { + | ^ + | +help: remove the qualifiers + | +LL | fn L() { + | ~~ + +error: aborting due to 2 previous errors +