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

classes fail to compile with non-trivial modules #2563

Closed
jesse99 opened this issue Jun 10, 2012 · 5 comments
Closed

classes fail to compile with non-trivial modules #2563

jesse99 opened this issue Jun 10, 2012 · 5 comments

Comments

@jesse99
Copy link
Contributor

jesse99 commented Jun 10, 2012

The following single file compiles fine:


// rustc --test klass2.rs
use std;
import std::map::hashmap; 

type namespace = {prefix: str, path: str};

class store
{
    new(namespaces: [namespace])
    {
        self.namespaces = [];
        self.namespaces += namespaces;
    }

    priv
    {
        let mut namespaces: [namespace];
    }
}

But the exact same class fails to compile if an rc file is used (see the follow up).

@jesse99
Copy link
Contributor Author

jesse99 commented Jun 10, 2012

klass.rc

// rustc -g --test klass.rc
#[link(name = "klass", vers = "0.1", uuid = "04400014-FB9C-44DD-B5DD-A49BE5613BD8")];
#[crate_type = "lib"];

#[warn(no_non_implicitly_copyable_typarams, no_vecs_not_implicitly_copyable)];

use std;

mod types;

klass.rs

import types::*;

export namespace, store;

types.rs

import std::map::hashmap; 

type namespace = {prefix: str, path: str};

class store
{
    new(namespaces: [namespace])
    {
        self.namespaces = [];
        self.namespaces += namespaces;
    }

    priv
    {
        let mut namespaces: [namespace];
    }
}

@jesse99
Copy link
Contributor Author

jesse99 commented Jun 10, 2012

Forgot to mention that the error is:
./types.rs:7:1: 11:2 error: internal compiler error: create_function: expected a resource ctor here

@catamorphism
Copy link
Contributor

Have you tried compiling without -g? Debuginfo isn't implemented yet for classes (see #2194).

@ghost ghost assigned catamorphism Jun 13, 2012
@catamorphism
Copy link
Contributor

Without more info, I'm considering this a dup of #2194. If you try compiling without -g and get a different error, please reopen this!

@jesse99
Copy link
Contributor Author

jesse99 commented Jun 15, 2012

It compiles without -g

oli-obk pushed a commit to oli-obk/rust that referenced this issue Sep 28, 2022
run all extern-so tests consistently without dependencies
RalfJung pushed a commit to RalfJung/rust that referenced this issue Oct 4, 2022
run all extern-so tests consistently without dependencies
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