Skip to content

Commit a1b0650

Browse files
committed
Add const_ptr lang item mappings
const_ptr is a lang item used as part of the slice implemenation this adds it to our mappings so we do not error with an unknown lang item.
1 parent 77a4950 commit a1b0650

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

gcc/rust/util/rust-lang-item.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ class RustLangItem
6868
RANGE_INCLUSIVE,
6969
RANGE_TO_INCLUSIVE,
7070

71+
// https://github.com/rust-lang/rust/blob/master/library/core/src/ptr/const_ptr.rs
72+
CONST_PTR,
73+
7174
UNKNOWN,
7275
};
7376

@@ -201,6 +204,10 @@ class RustLangItem
201204
{
202205
return ItemType::RANGE_TO_INCLUSIVE;
203206
}
207+
else if (item.compare ("const_ptr") == 0)
208+
{
209+
return ItemType::CONST_PTR;
210+
}
204211

205212
return ItemType::UNKNOWN;
206213
}
@@ -273,6 +280,8 @@ class RustLangItem
273280
return "RangeInclusive";
274281
case RANGE_TO_INCLUSIVE:
275282
return "RangeToInclusive";
283+
case CONST_PTR:
284+
return "const_ptr";
276285

277286
case UNKNOWN:
278287
return "<UNKNOWN>";

0 commit comments

Comments
 (0)