Giter VIP home page Giter VIP logo

Comments (22)

troindx avatar troindx commented on June 27, 2024 1

from rust.

troindx avatar troindx commented on June 27, 2024

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.

pacak avatar pacak commented on June 27, 2024

A smaller example with no external dependencies

https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=c346d5fb3036183f8f013b5e678ca2ec

from rust.

workingjubilee avatar workingjubilee commented on June 27, 2024

@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.

pacak avatar pacak commented on June 27, 2024

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.

pacak avatar pacak commented on June 27, 2024

Made a single file version again, trying to minimize

from rust.

pacak avatar pacak commented on June 27, 2024

https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=5d8590bc8f1bcd2bd578b0b80474de78

from rust.

pacak avatar pacak commented on June 27, 2024

original file

from rust.

troindx avatar troindx commented on June 27, 2024

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.

troindx avatar troindx commented on June 27, 2024

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.

pacak avatar pacak commented on June 27, 2024

..... 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.

troindx avatar troindx commented on June 27, 2024

from rust.

troindx avatar troindx commented on June 27, 2024

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.

pacak avatar pacak commented on June 27, 2024

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.

troindx avatar troindx commented on June 27, 2024

from rust.

pacak avatar pacak commented on June 27, 2024

Where is that original file?

#125328 (comment)

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.

workingjubilee avatar workingjubilee commented on June 27, 2024

@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.

workingjubilee avatar workingjubilee commented on June 27, 2024

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.

troindx avatar troindx commented on June 27, 2024

from rust.

troindx avatar troindx commented on June 27, 2024

I learned why this happened. thanks for accompanying me in my path to becoming a rustacean.

from rust.

pacak avatar pacak commented on June 27, 2024

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.

troindx avatar troindx commented on June 27, 2024

sure.

from rust.

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.