Coder Social home page Coder Social logo

Comments (10)

panstromek avatar panstromek commented on June 3, 2024 2

Note about ptr_offset_from stabilization:

Method wrapping_offset_from (which is often used in c2rust output) has been deprecated since 1.46 and it is being removed in ptr_offset_from stabilization PR: rust-lang/rust#74238

from c2rust.

XVilka avatar XVilka commented on June 3, 2024 2

I think it worth to pin this issue, otherwise it's easy to miss and one of the most important, imho.

from c2rust.

chrysn avatar chrysn commented on June 3, 2024 1

Assembly is now tracked at rust-lang/rust#70173 -- but without any plan for stabilization; see #306. Unless the asm transpilation is significantly reworked (to produce Rust asm rather than llvm_asm), this now falls in the "unlikely to be stabilized" category.

from c2rust.

rinon avatar rinon commented on June 3, 2024

Since libc is on crates.io and rustc errors when we use the internal version, we should drop that off the list of nightly features.

from c2rust.

bjorn3 avatar bjorn3 commented on June 3, 2024

Intrinsics for atomic operations - core_intrinsics - Unlikely to ever be stabilized itself, no tracking issue

Maybe cast the pointer from say *mut u64 to *mut AtomicU64 and then use the normal AtomicU64 methods on it.

from c2rust.

OvermindDL1 avatar OvermindDL1 commented on June 3, 2024

Method wrapping_offset_from (which is often used in c2rust output) has been deprecated since 1.46 and it is being removed in ptr_offset_from stabilization PR: rust-lang/rust#74238

And looks like it's entirely gone now, says the feature doesn't exist and the wrapping_offset_from call no longer exists in the source.

from c2rust.

fanninpm avatar fanninpm commented on June 3, 2024

And looks like it's entirely gone now, says the feature doesn't exist and the wrapping_offset_from call no longer exists in the source.

It was removed in August.

from c2rust.

kkysen avatar kkysen commented on June 3, 2024

A bunch of these features have since been stabilized or removed:

  • asm! is stabilized since 1.59.0: core::arch::asm!
  • wrapping_offset_from was removed but offset_from was added in 1.47.0. It is const unstable.
  • const_raw_ptr_to_usize_cast was removed since it is unsafe at compile time. Why do we need this? You can't const cast a pointer to an integer in C either, even if the pointer was originally cast from an integer: https://godbolt.org/z/xKrhfG7z6. These are errors because they try to be variable-length array declarations:
#include <stdint.h>

int a[(uintptr_t) (char *) 0];
int b[(uintptr_t) ""];
  • const_slice_as_ptr works on stable now: [].as_ptr() has been const since 1.32.0.

from c2rust.

pitaj avatar pitaj commented on June 3, 2024

It appears that core_intrinsics is also used for rotate_left and rotate_right. Is there a reason these can't just use the inherent methods instead?

from c2rust.

mewmew avatar mewmew commented on June 3, 2024

the feature label_break_value has been stable since 1.65.0 and no longer requires an attribute to enable

ref: rust-lang/rust#99332

Thus, #![feature(label_break_value)] can be removed from transpiled code output.

from c2rust.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.