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

Default method results in: error: internal compiler error: method not found in AST map?! #7339

Closed
DaGenix opened this issue Jun 24, 2013 · 2 comments

Comments

@DaGenix
Copy link

DaGenix commented Jun 24, 2013

Updated with a simpler test case:

ast_map_issue1.rs:

pub trait Digest {
    fn input(&mut self, in: &str);

    fn input_str(&mut self, in: &str) {
        self.input(in);        
    }
}

struct Sha2;

impl Sha2 {
    pub fn new() -> Sha2 {
        return Sha2;
    }
}

impl Digest for Sha2 {
    fn input(&mut self, in: &str) {

    }
}

ast_map_issue2.rs:

use ast_map_issue1::*;
mod ast_map_issue1;

#[main]
fn main() {
    let s = Sha2::new();
    s.input_str("hi");
}

This is producing the same error I saw before when using: 8883099.

Original:

While working on a SHA-2 implementation, I was trying to create some utility default methods on the Digest trait. However, I ended up getting the following error:

rust/src/libextra/workcache.rs:253:4: 253:37 error: internal compiler error: method not found in AST map?!
rust/src/libextra/workcache.rs:253 (sha).input_str(json_encode(t));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make: *
* [x86_64-unknown-linux-gnu/stage0/test/extratest-x86_64-unknown-linux-gnu] Error 101

I don't have a simple test case yet, but I'll try to develop one in the next few days.

In the meantime, the sha2-default-method-issue branch of https://github.com/DaGenix/rust.git will trigger this issue.

@huonw
Copy link
Member

huonw commented Jul 3, 2013

Possibly the same bug as #7481.

@msullivan
Copy link
Contributor

Oh, yeah. Same bug. Hadn't noticed this one, though, and discussion is on the other. Whoops. Closing as dupe.

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

3 participants