Comments (22)
from rust.
query stack during panic:
#0 [resolver_for_lowering_raw] getting the resolver for lowering
end of query stack
error: could not compile oxidize
(bin "oxidize")
from rust.
A smaller example with no external dependencies
from rust.
@pacak Your example seems to be a different ICE, as it has a different query stack and panics in a different place:
query stack during panic:
0 [typeck] type-checking<impl at src/lib.rs:21:1: 21:14>::finalize
1 [analysis] running analysis passes on this crate
end of query stack
the issue gets reported as:
error: internal compiler error: compiler/rustc_infer/src/infer/at.rs:400:21: relating different kinds: (?2t,) ReEarlyParam(DefId(0:7 ~ playground[c60f]::{impl#0}::'r), 0, 'r)
from rust.
has a different query stack and panics in a different place:
Hmm... I wonder when it changed. Will try again. I guess both ICEs should be fixed.
from rust.
Made a single file version again, trying to minimize
from rust.
from rust.
from rust.
hi back. thanks for the quick responses . i'll investigate all that you have provided me and reach back
.. .. in this context.
..... what is an ICE?
from rust.
i ... don't know where or how to continue... is this something I'm doing wrong? is it a bug from compiler?
I cant tell where I'm making the error. I try to prune the project and reinstall all dependencies but it doesn't seem to work properly. I'm unsure of how to continue. any suggestions as to what should I try to do to continue? or how to debug ? any comment in advance would be amazing.
from rust.
..... what is an ICE?
Internal Compiler Error, you are doing something compiler doesn't expect
is this something I'm doing wrong? is it a bug from compiler?
You are doing something unexpected, this is a bug in the compiler. I'm not sure what the best path forward would be though.
from rust.
from rust.
how can I see, or know, where is this bug coming from? so I can... undo stuff.,.. program things in a different way so that the bug does not happen again?
i have removed all Options<> and it still does not work
from rust.
You can take my "original file" link and whack at it until it stops panicking. devs at rocket might be of some help...
from rust.
from rust.
Where is that original file?
I see the link that you provided and I read the file but I'm not sure of how to include it in my code
You don't really include in your code. Its a smaller example of whatever causes compiler to panic that doesn't have any external dependencies. So paste it into a new crate and start experimenting. If you manage to convince rustc to compile it without problems - you'll need to apply similar change to your project.
from rust.
@troindx The code you are working with includes macros, which can expand to large implementations that themselves may induce compiler errors. Basically, nothing you personally wrote was independently responsible for the error, but rather the macro author's code has inflicted this on you.
You can see this by applying the following diff, which cures your compilation issues:
diff --git a/src/modules/user/dto.rs b/src/modules/user/dto.rs
index be80520..6cbe8e2 100644
--- a/src/modules/user/dto.rs
+++ b/src/modules/user/dto.rs
@@ -32,7 +32,7 @@ impl<'v> FromFormField<'v> for UserId {
}
}
-#[derive(Debug, Deserialize, Serialize,Clone, FromForm)]
+#[derive(Debug, Deserialize, Serialize,Clone)]
pub struct User<'r> {
pub email : &'r str ,
pub password : &'r str,
@@ -49,10 +49,10 @@ pub enum UserRole {
Admin
}
-#[derive(Debug, FromForm, Deserialize, Serialize,Clone)]
+#[derive(Debug, Deserialize, Serialize,Clone)]
pub struct UserDTO<'a> {
pub user : 'a+ User,
pub jwt_secret : String,
#[serde(rename = "_id", skip_serializing_if = "Option::is_none")]
pub id : Option <String>
-}
\ No newline at end of file
+}
I mean, the code fails typechecking still, but it doesn't ICE.
from rust.
The following more significant diff, makes the macros stop producing ICE-generating code:
diff --git a/src/modules/user/dto.rs b/src/modules/user/dto.rs
index be80520..f7cc922 100644
--- a/src/modules/user/dto.rs
+++ b/src/modules/user/dto.rs
@@ -33,10 +33,10 @@ impl<'v> FromFormField<'v> for UserId {
}
#[derive(Debug, Deserialize, Serialize,Clone, FromForm)]
-pub struct User<'r> {
- pub email : &'r str ,
- pub password : &'r str,
- pub description : &'r str,
+pub struct User {
+ pub email : String,
+ pub password : String,
+ pub description : String,
pub role : u8,
#[serde(rename = "_id", skip_serializing_if = "Option::is_none")]
pub _id : Option <UserId>
@@ -50,9 +50,9 @@ pub enum UserRole {
}
#[derive(Debug, FromForm, Deserialize, Serialize,Clone)]
-pub struct UserDTO<'a> {
- pub user : 'a+ User,
+pub struct UserDTO {
+ pub user : User,
pub jwt_secret : String,
#[serde(rename = "_id", skip_serializing_if = "Option::is_none")]
pub id : Option <String>
-}
\ No newline at end of file
+}
@troindx I recommend you apply that for now.
from rust.
from rust.
I learned why this happened. thanks for accompanying me in my path to becoming a rustacean.
from rust.
I learned why this happened. thanks for accompanying me in my path to becoming a rustacean.
You solved your problem, but compiler shouldn't panic on invalid input either, this ticket needs to be reopened.
from rust.
sure.
from rust.
Related Issues (20)
- mimatched type when using a `let` binding with the same name as a struct HOT 2
- Tracking Issue for externally implementable items
- error: internal compiler error: ...: opaque types got hidden types registered from within subtype predicate
- `print-type-size` somtimes prints incorrect output HOT 1
- Compiling this code caused the compiler to block
- Segmentation fault installing rust on clean Ubuntu 24.04 amd64 HOT 5
- Poor interaction between NLL-borrowck, async, and c_variadic's `...` desugaring (`VaListImpl<'_>`)
- ICE : called `Option::unwrap()` on a `None` value in compiler/rustc_hir_typeck/src/method/confirm.rs HOT 2
- `&T -> *const T` or `&mut T -> *mut T` should be considered a use of inner fields HOT 2
- Remark `TMP`, `TEMP` and `USERPROFILE` env vars can influence `env::temp_dir` on Windows HOT 1
- Add SIMD operations that use f16 and f128 HOT 5
- Warn for `cfg!(target_* = "whatever")` usage in build scripts HOT 1
- UTF_16BE encode decode result does not match HOT 2
- Error when `fn` keyword is missing could be more explicit HOT 3
- How to enable rust-lld on stable? HOT 3
- Failure to recognize `&String` as equivalent to `&str` HOT 2
- need to show help for `adding an explicit lifetime bound`.
- ICE: `this path really should be doomed`
- Tracking issue for migrating from Glacier to compiletest ICE/crash tracking HOT 3
- `check_type_length_limit` is broken HOT 2
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.