about summary refs log tree commit diff
path: root/library/alloc/src
diff options
context:
space:
mode:
authorUrgau <urgau@numericable.fr>2024-03-30 16:00:28 +0100
committerUrgau <urgau@numericable.fr>2025-04-20 11:36:22 +0200
commit1632f624fbcda1a3134ca4946af75e116c143261 (patch)
treed814c7a823630faa7de66b6b9862543bf786cf07 /library/alloc/src
parent191df20fcad9331d3a948aa8e8556775ec3fe69d (diff)
Add `#[rustc_no_implicit_autorefs]` and apply it to std methods
Diffstat (limited to 'library/alloc/src')
-rw-r--r--library/alloc/src/string.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/library/alloc/src/string.rs b/library/alloc/src/string.rs
index 9a161d057db..cd9e04a915a 100644
--- a/library/alloc/src/string.rs
+++ b/library/alloc/src/string.rs
@@ -1832,6 +1832,7 @@ impl String {
     #[stable(feature = "rust1", since = "1.0.0")]
     #[rustc_const_stable(feature = "const_vec_string_slice", since = "1.87.0")]
     #[rustc_confusables("length", "size")]
+    #[cfg_attr(not(bootstrap), rustc_no_implicit_autorefs)]
     pub const fn len(&self) -> usize {
         self.vec.len()
     }
@@ -1851,6 +1852,7 @@ impl String {
     #[must_use]
     #[stable(feature = "rust1", since = "1.0.0")]
     #[rustc_const_stable(feature = "const_vec_string_slice", since = "1.87.0")]
+    #[cfg_attr(not(bootstrap), rustc_no_implicit_autorefs)]
     pub const fn is_empty(&self) -> bool {
         self.len() == 0
     }