Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LLVM assert instantiating mutually recursive struct #3909

Closed
brson opened this issue Nov 2, 2012 · 3 comments
Closed

LLVM assert instantiating mutually recursive struct #3909

brson opened this issue Nov 2, 2012 · 3 comments

Comments

@brson
Copy link
Contributor

brson commented Nov 2, 2012

struct TestNode {
    data: @TestData
}

struct TestData {
    parent: Option<TestNode>
}

fn main() {
    let node = TestNode {
        data: @TestData {
            parent: None
        }
    };
}
rustc: /home/brian/dev/rust/src/llvm/lib/Target/TargetData.cpp:468: uint64_t llvm::TargetData::getTypeSizeInBits(llvm::Type*) const: Assertion `Ty->isSized() && "Cannot getTypeInfo() on a type that is unsized!"' failed.


@brson
Copy link
Contributor Author

brson commented Nov 2, 2012

Removing the boxes yields a different error - an out of stack ICE

struct TestNode {
    data: @TestData
}

struct TestData {
    parent: Option<TestNode>
}

fn main() {
    let node = TestNode {
        data: @TestData {
            parent: None
        }
    };
}

@catamorphism
Copy link
Contributor

The error with the removed boxes is #3779 .

@catamorphism
Copy link
Contributor

And the original bug is a dup of #3778 .

flip1995 pushed a commit to flip1995/rust that referenced this issue Feb 25, 2021
Rework use_self impl based on ty::Ty comparison rust-lang#3410 | Take 2

This builds on top of rust-lang#5531

I already reviewed and approved the commits by `@montrivo.` So only the review of my commits should be necessary.

I would also appreciate your review `@montrivo,` since you are familiar with the challenges here.

Fixes rust-lang#3410 and Fixes rust-lang#4143 (same problem)
Fixes rust-lang#2843
Fixes rust-lang#3859
Fixes rust-lang#4734 and fixes rust-lang#6221
Fixes rust-lang#4305
Fixes rust-lang#5078 (even at expression level now 🎉)
Fixes rust-lang#3881 and Fixes rust-lang#4887 (same problem)
Fixes rust-lang#3909

Not yet: rust-lang#4140 (test added)

All the credit for the fixes goes to `@montrivo.` I only refactored and copy and pasted his code.

changelog: rewrite [`use_self`] lint and fix multiple (8) FPs. One to go.
RalfJung pushed a commit to RalfJung/rust that referenced this issue Sep 29, 2024
Scope CI permissions to the job that needs it

I scoped the permissions only to the job that requires them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants