Comments (10)
Thanks @compiler-errors. Just want to add that some other intrinsics also ICE.
For example:
fn main() {
read_via_copy();
}
extern "rust-intrinsic" fn read_via_copy() {}
ICEs as well.
from rust.
Please try to minimize the example as much as possible:
fn main() {
transmute();
}
extern "rust-intrinsic" fn transmute() {}
from rust.
@rustbot claim
from rust.
@gurry: heads up that @estebank already put up a fix
from rust.
Interesting @gurry -- I wonder if we should perhaps fix this in a less specific way than #123526. I wonder if we should instead detect that the extern "rust-intrinsic"
declaration is not valid b/c feature(intrinsics)
has not been enabled in the crate...
If not, then I'd be glad to review a PR that fixes whatever other intrinsics you find to make too many assumptions in the compiler.
from rust.
I wonder if we should instead detect that the
extern "rust-intrinsic"
declaration is not valid b/cfeature(intrinsics)
has not been enabled in the crate...
Even adding feature(intrinsics)
does not prevent the ICE unfortunately.
It happens in lower_intrinsics.rs
due to the wrong number of arguments e.g. here for read_via_copy
:
rust/compiler/rustc_mir_transform/src/lower_intrinsics.rs
Lines 176 to 178 in af25253
span_bug!(..., "Wrong number of arguments...")
occurs for a lot of intrinsics in this file. I'm guessing all of them will ICE under the conditions in this issue.
To fix it, we could extend what's done for transmute
in #123526 to all intrinsics, maybe leveraging this code to know how many args are expected for any given intrinsic:
from rust.
I have opened #123587
from rust.
Looks like intrinsics are expected to ICE if used wrongly (see comment: #123587 (comment)) so #123587 I opened has been rightly closed.
But that mean that transmute
should also ICE in these conditions. However, in the present issue it was ICEing for the wrong reason i.e. out of bound access . So #123526 does the right thing by stopping that. However, IMHO it should not taint the context and let it go to MIR lowering and then let it ICE there. That keeps transmute
consistent with other intrinsics' behaviour as noted above.
Thoughts @estebank & @compiler-errors? If you guys agree I can open a PR to remove the tainting.
from rust.
See #123603 which takes a different approach
from rust.
Nice!
from rust.
Related Issues (20)
- Debuginfo tests sometimes run with the wrong Python version on MacOS HOT 8
- New error on nightly 'overflow evaluating the requirement' HOT 1
- Codegen significantly worse when using u128 rather than two u64 HOT 3
- ICE: `No HirID for DefId(...)` with feature `generic_assert` HOT 2
- Nonsensical suggested type using chumsky select! (E0284) HOT 4
- Confusing error message on using `step_by` and `take` on infinite iterator
- ICE: kcfi: `expected item, found (root_crate)` HOT 1
- ICE: kcfi: `unexpected parent of trait or impl item or item not found: ForeignMod` HOT 1
- ICE: kcfi: `cannot get associated-item of DefKey..` HOT 3
- patterns: wrong tracking issue? HOT 20
- Tracking Issue for pattern types HOT 1
- Async closure internal compiler error HOT 2
- ICE: `unexpected bound var resolution for HirId(...): None` HOT 1
- Figure out the interaction of GVN and function/vtable pointers HOT 8
- rustdoc doesn't support reading from STDIN via the fake path `-` (dash)
- Rustdoc incorrectly fires `redundant_explicit_link` warning
- ICE: kcfi: `args not compatible with generics for Foo::Bar`
- ICE: kcfi: `encode_region: unexpected ''static'`
- RUST_BACKTRACE=full panic causes infinite loop on aarch64-pc-windows-msvc HOT 3
- Test failure when enabling vendoring HOT 1
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 rust.