about summary refs log tree commit diff
path: root/src/librustc_error_codes/error_codes
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-12-23 21:49:44 +0000
committerbors <bors@rust-lang.org>2019-12-23 21:49:44 +0000
commita4cd03dee2b57216b5c95084a0b46de130946ad7 (patch)
treef7b088dc1993e10a614283fbecc7a7bef4d6e552 /src/librustc_error_codes/error_codes
parent9ae6cedb8d1e37469be1434642a3e403fce50a03 (diff)
parentacfe58272cb188e2da69d2bf1285bf2d954de9a2 (diff)
downloadrust-a4cd03dee2b57216b5c95084a0b46de130946ad7.tar.gz
rust-a4cd03dee2b57216b5c95084a0b46de130946ad7.zip
Auto merge of #66296 - Centril:bindings_after_at-init, r=pnkfelix
Initial implementation of `#![feature(bindings_after_at)]`

Following up on #16053, under the gate `#![feature(bindings_after_at)]`, `x @ Some(y)` is allowed subject to restrictions necessary for soundness.

The implementation and test suite should be fairly complete now.

One aspect that is not covered is the interaction with nested `#![feature(or_patterns)]`.
This is not possible to test at the moment in a good way because that feature has not progressed sufficiently and has fatal errors in MIR building. We should make sure to add such tests before we stabilize both features (but shipping one of them is fine).

r? @pnkfelix
cc @nikomatsakis @matthewjasper @pcwalton
cc https://github.com/rust-lang/rust/issues/65490
Diffstat (limited to 'src/librustc_error_codes/error_codes')
-rw-r--r--src/librustc_error_codes/error_codes/E0303.md10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/librustc_error_codes/error_codes/E0303.md b/src/librustc_error_codes/error_codes/E0303.md
index 20a6c078f4f..700a66438e0 100644
--- a/src/librustc_error_codes/error_codes/E0303.md
+++ b/src/librustc_error_codes/error_codes/E0303.md
@@ -1,10 +1,18 @@
+#### Note: this error code is no longer emitted by the compiler.
+
+Sub-bindings, e.g. `ref x @ Some(ref y)` are now allowed under
+`#![feature(bindings_after_at)]` and checked to make sure that
+memory safety is upheld.
+
+--------------
+
 In certain cases it is possible for sub-bindings to violate memory safety.
 Updates to the borrow checker in a future version of Rust may remove this
 restriction, but for now patterns must be rewritten without sub-bindings.
 
 Before:
 
-```compile_fail,E0303
+```compile_fail
 match Some("hi".to_string()) {
     ref op_string_ref @ Some(s) => {},
     None => {},