Comments (10)
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.
I think it worth to pin this issue, otherwise it's easy to miss and one of the most important, imho.
from c2rust.
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.
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.
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.
Method
wrapping_offset_from
(which is often used in c2rust output) has been deprecated since1.46
and it is being removed inptr_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.
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.
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 butoffset_from
was added in 1.47.0. It isconst
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 beenconst
since 1.32.0.
from c2rust.
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.
- Labels for breaks in relooper - label_break_value - rust-lang/rust#48594
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)
- Aggregate libc functions into one file. HOT 1
- FYI: fatal runtime error: Rust cannot catch foreign exceptions
- Readme example of transpile for main.c doesn't work HOT 1
- Transpile `#include` as `include!()` HOT 4
- C2Rust transpiler emits features removed in recent nightlies HOT 1
- Switch case with ranges HOT 2
- rust-toolchain.toml is too old for 1.75 rust HOT 4
- cargo install c2rust failed: Could not find a configuration file for package "LLVM" that exactly matches requested version "16.0.6". HOT 2
- Build not matching clang version (Fedora 39, Clang 17.0.6) HOT 3
- cargo install c2rust failed: Error 2 HOT 2
- In the while loop body using a volatile variable, the generated code will lack a semicolon.
- why do you not support windows HOT 1
- Build fails with LLVM 18 and tip-of-tree HOT 1
- fail build on archlinux HOT 2
- Casting bool to pointer type results in invalid Rust
- Fatal error: 'stddef.h' file not found HOT 4
- ast_exporter can't convert a c code to ast HOT 2
- (Question) Do you plan to support C++ ? HOT 1
- Missing parentheses on reference applied to a cast
- Translate glsl
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from c2rust.