about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorAapo Alasuutari <aapo.alasuutari@gmail.com>2025-08-21 23:42:46 +0300
committerAapo Alasuutari <aapo.alasuutari@gmail.com>2025-08-21 23:53:25 +0300
commit5af359162e5ebf6c9ad318e7e45ac2f2b47b4b74 (patch)
tree821d9e67a6720d313cef07375e8a883f8a9438cf /compiler
parent719880dd2a3081ca69fd41eac82f45d84b90bb06 (diff)
downloadrust-5af359162e5ebf6c9ad318e7e45ac2f2b47b4b74.tar.gz
rust-5af359162e5ebf6c9ad318e7e45ac2f2b47b4b74.zip
Introduce Reborrow lang item and trait
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_feature/src/unstable.rs2
-rw-r--r--compiler/rustc_hir/src/lang_items.rs3
-rw-r--r--compiler/rustc_span/src/symbol.rs1
3 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_feature/src/unstable.rs b/compiler/rustc_feature/src/unstable.rs
index 6a7370c2472..d70d15b6815 100644
--- a/compiler/rustc_feature/src/unstable.rs
+++ b/compiler/rustc_feature/src/unstable.rs
@@ -614,7 +614,7 @@ declare_features! (
     (unstable, proc_macro_hygiene, "1.30.0", Some(54727)),
     /// Allows the use of raw-dylibs on ELF platforms
     (incomplete, raw_dylib_elf, "1.87.0", Some(135694)),
-    (unstable, reborrow, "CURRENT_RUSTC_VERSION", None),
+    (unstable, reborrow, "CURRENT_RUSTC_VERSION", Some(145612)),
     /// Makes `&` and `&mut` patterns eat only one layer of references in Rust 2024.
     (incomplete, ref_pat_eat_one_layer_2024, "1.79.0", Some(123076)),
     /// Makes `&` and `&mut` patterns eat only one layer of references in Rust 2024—structural variant
diff --git a/compiler/rustc_hir/src/lang_items.rs b/compiler/rustc_hir/src/lang_items.rs
index 905b84a8cbe..0464665b41f 100644
--- a/compiler/rustc_hir/src/lang_items.rs
+++ b/compiler/rustc_hir/src/lang_items.rs
@@ -437,6 +437,9 @@ language_item_table! {
     DefaultTrait1,           sym::default_trait1,      default_trait1_trait,       Target::Trait,          GenericRequirement::None;
 
     ContractCheckEnsures,     sym::contract_check_ensures,      contract_check_ensures_fn,      Target::Fn, GenericRequirement::None;
+
+    // Reborrowing related lang-items
+    Reborrow,                sym::reborrow,            reborrow,                   Target::Trait,          GenericRequirement::Exact(0);
 }
 
 /// The requirement imposed on the generics of a lang item
diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs
index dcb1becc957..8465845d792 100644
--- a/compiler/rustc_span/src/symbol.rs
+++ b/compiler/rustc_span/src/symbol.rs
@@ -1754,6 +1754,7 @@ symbols! {
         readonly,
         realloc,
         reason,
+        reborrow,
         receiver,
         receiver_target,
         recursion_limit,