We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 39b6253 commit 3eb1d9dCopy full SHA for 3eb1d9d
src/liballoc/str.rs
@@ -213,7 +213,8 @@ impl ToOwned for str {
213
}
214
215
/// Methods for string slices.
216
-#[lang = "str_alloc"]
+#[cfg_attr(bootstrap, lang = "str_alloc")]
217
+#[cfg_attr(not(bootstrap), lang = "str_alloc_impl")]
218
#[cfg(not(test))]
219
impl str {
220
/// Converts a `Box<str>` into a `Box<[u8]>` without copying or allocating.
src/libcore/str/mod.rs
@@ -2224,7 +2224,8 @@ fn slice_error_fail(s: &str, begin: usize, end: usize) -> ! {
2224
);
2225
2226
2227
-#[lang = "str"]
+#[cfg_attr(bootstrap, lang = "str")]
2228
+#[cfg_attr(not(bootstrap), lang = "str_impl")]
2229
2230
2231
/// Returns the length of `self`.
src/librustc_hir/lang_items.rs
@@ -127,10 +127,10 @@ language_item_table! {
127
// Variant name, Name, Method name, Target;
128
BoolImplItem, "bool", bool_impl, Target::Impl;
129
CharImplItem, "char", char_impl, Target::Impl;
130
- StrImplItem, "str", str_impl, Target::Impl;
+ StrImplItem, "str_impl", str_impl, Target::Impl;
131
SliceImplItem, "slice", slice_impl, Target::Impl;
132
SliceU8ImplItem, "slice_u8", slice_u8_impl, Target::Impl;
133
- StrAllocImplItem, "str_alloc", str_alloc_impl, Target::Impl;
+ StrAllocImplItem, "str_alloc_impl", str_alloc_impl, Target::Impl;
134
SliceAllocImplItem, "slice_alloc", slice_alloc_impl, Target::Impl;
135
SliceU8AllocImplItem, "slice_u8_alloc", slice_u8_alloc_impl, Target::Impl;
136
ConstPtrImplItem, "const_ptr", const_ptr_impl, Target::Impl;
src/librustc_typeck/coherence/inherent_impls.rs
@@ -87,7 +87,7 @@ impl ItemLikeVisitor<'v> for InherentCollect<'tcx> {
87
def_id,
88
lang_items.str_impl(),
89
lang_items.str_alloc_impl(),
90
- "str",
+ "str_impl",
91
"str",
92
item.span,
93
src/test/rustdoc/issue-23511.rs
@@ -4,7 +4,7 @@
4
pub mod str {
5
#![doc(primitive = "str")]
6
7
- #[lang = "str_alloc"]
+ #[lang = "str_alloc_impl"]
8
9
// @has search-index.js foo
10
pub fn foo(&self) {}
src/test/ui/single-primitive-inherent-impl.rs
@@ -5,9 +5,9 @@
#![no_std]
// OK
+#[lang = "str_alloc_impl"]
impl str {}
11
12
-//~^ error: only a single inherent implementation marked with `#[lang = "str"]` is allowed for the `str` primitive
+//~^ error: only a single inherent implementation marked with `#[lang = "str_impl"]` is allowed for the `str` primitive
13
src/test/ui/single-primitive-inherent-impl.stderr
@@ -1,4 +1,4 @@
1
-error[E0390]: only a single inherent implementation marked with `#[lang = "str"]` is allowed for the `str` primitive
+error[E0390]: only a single inherent implementation marked with `#[lang = "str_impl"]` is allowed for the `str` primitive
2
--> $DIR/single-primitive-inherent-impl.rs:11:1
3
|
LL | / impl str {
0 commit comments