Skip to content

Commit e030eb1

Browse files
committed
Make Box::new use owned_box_new lang item
1 parent 0459d2f commit e030eb1

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

compiler/rustc_hir/src/lang_items.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ language_item_table! {
276276
EhCatchTypeinfo, sym::eh_catch_typeinfo, eh_catch_typeinfo, Target::Static, GenericRequirement::None;
277277

278278
OwnedBox, sym::owned_box, owned_box, Target::Struct, GenericRequirement::Minimum(1);
279+
OwnedBoxNew, sym::owned_box_new, owned_box_new, Target::Method(MethodKind::Inherent), GenericRequirement::None;
279280

280281
PhantomData, sym::phantom_data, phantom_data, Target::Struct, GenericRequirement::Exact(1);
281282

compiler/rustc_span/src/symbol.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,6 +1037,7 @@ symbols! {
10371037
out,
10381038
overlapping_marker_traits,
10391039
owned_box,
1040+
owned_box_new,
10401041
packed,
10411042
panic,
10421043
panic_2015,

library/alloc/src/boxed.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ impl<T> Box<T> {
207207
/// let five = Box::new(5);
208208
/// ```
209209
#[cfg(all(not(no_global_oom_handling)))]
210+
#[lang = "owned_box_new"]
210211
#[inline(always)]
211212
#[stable(feature = "rust1", since = "1.0.0")]
212213
#[must_use]

0 commit comments

Comments
 (0)