mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-01 22:18:23 +03:00
Merge pull request #324 from oli-obk/align_offset
Implement `align_offset` intrinsic and thus enabling `from_utf8`
This commit is contained in:
@@ -34,6 +34,12 @@ fn call_intrinsic(
|
||||
|
||||
let intrinsic_name = &self.tcx.item_name(instance.def_id()).as_str()[..];
|
||||
match intrinsic_name {
|
||||
"align_offset" => {
|
||||
// FIXME: return a real value in case the target allocation has an
|
||||
// alignment bigger than the one requested
|
||||
self.write_primval(dest, PrimVal::Bytes(u128::max_value()), dest_ty)?;
|
||||
},
|
||||
|
||||
"add_with_overflow" => {
|
||||
self.intrinsic_with_overflow(
|
||||
mir::BinOp::Add,
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
fn main() {
|
||||
let _ = ::std::str::from_utf8(b"a");
|
||||
}
|
||||
Reference in New Issue
Block a user