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

ICE Unimplemented selecting <Inner as FooTrait> during trans #17915

Closed
dbalchev opened this issue Oct 10, 2014 · 1 comment
Closed

ICE Unimplemented selecting <Inner as FooTrait> during trans #17915

dbalchev opened this issue Oct 10, 2014 · 1 comment

Comments

@dbalchev
Copy link

Compiled on Windows 8.1 with 64-bit compiler rustc 0.12.0-nightly (b5ba2f5 2014-10-06 20:27:14 +0000).

struct Inner {
    x:int
}
type Foo = Box<Inner>;

struct Bar;

trait FooTrait {
    fn foo_fun(&self);
}
trait BarTrait {
    fn bar_fun(&Self, &FooTrait);
}
impl FooTrait for Foo {
    fn foo_fun(&self) {

    }
}
impl BarTrait for Bar {
    fn bar_fun(b:&Bar, f: &FooTrait) {

    }
}

fn main() {
    BarTrait::bar_fun(&Bar, &box Inner{x:72});
}

Errors:
bughunt.rs:1:1: 1:1 error: internal compiler error: Encountered error Unimplemented selecting <Inner as FooTrait> during trans
bughunt.rs:1

         ^

note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with RUST_BACKTRACE=1 for a backtrace

Backtrace:
task 'rustc' failed at 'Box', C:\bot\slave\nightly-win-64\build\src\libsyntax\diagnostic.rs:113

stack backtrace:
1: 0x66be29a8 - ZN2rt9backtrace3imp5write20hc5b481d5cd57af2aE9qE
2: 0x66be641b - ZN2rt4init20hffee7254612f46fffnrE
3: 0x668461cd - ZN6unwind18begin_unwind_inner20h484cd690c7389d13QhdE
4: 0x6a675f76 - ZN10diagnostic11SpanHandler8span_bug20h61400d8c039e9bc6GMFE
5: 0x6a675f20 - ZN10diagnostic11SpanHandler8span_bug20h61400d8c039e9bc6GMFE
6: 0x6d4c437a - ZN6driver7session7Session8span_bug20h2168907c2e4ca091kyxE
7: 0x6d6eccf6 - ZN6middle5trans6common18fulfill_obligation20heb3710fb7ef945524B6E
8: 0x6d76abbb - ZN6middle5trans5type_4Type6vtable20hd46d323115ea795edrvE
9: 0x6d76c320 - ZN4util5ppaux17ty..BareFnTy.Repr4repr20h89c8f0a6d9a94237TIGE
10: 0x6d6d0e03 - ZN6middle5trans4meth10get_vtable20h3e74db9548c22210KGkE
11: 0x6d6cff80 - ZN6middle2ty34AutoAdjustment...std..clone..Clone5clone20h9b1b6280b278f7184syE
12: 0x6d6d207a - ZN6middle2ty9unsize_ty20h89062c559ef98902zfGE
13: 0x6d6d2208 - ZN6middle2ty7mk_rptr20h0c96f17a65cdda7dwiEE
14: 0x6d6cf59a - ZN6middle2ty34AutoAdjustment...std..clone..Clone5clone20h9b1b6280b278f7184syE
15: 0x6d6cee3c - ZN6middle2ty34AutoAdjustment...std..clone..Clone5clone20h9b1b6280b278f7184syE
16: 0x6d693572 - ZN6middle5trans4expr5trans20ha48b94e0db233834pN2E
17: 0x6d6c41c4 - ZN6middle5trans6callee10trans_args20h88999b8991f24ca4kk2E
18: 0x6d699a70 - ZN6middle5trans6callee16trans_call_inner20hf94d81b3cc0dc994nZ1E
19: 0x6d6bd5e0 - ZN6middle5trans6callee10trans_call20h61df90c183273a62IT1E
20: 0x6d6cce3b - ZN6middle2ty9expr_kind20h949e0064a45a1e82ilGE
21: 0x6d691723 - ZN6middle5trans4expr10trans_into20h96733f5255894c9dvJ2E
22: 0x6d690ad0 - ZN6middle5trans11controlflow15trans_stmt_semi20h65a5128923d5c87e9VYE
23: 0x6d6901b9 - ZN6middle5trans11controlflow10trans_stmt20h6a327ed75a825439WRYE
24: 0x6d691969 - ZN6middle5trans11controlflow11trans_block20hc018d4181ef5114d2WYE
25: 0x6d735c90 - ZN6middle5trans4base13trans_closure20hfb78e3f15b7b784dTQeE
26: 0x6d68411d - ZN6middle5trans4base8trans_fn20h94c1533573410e77h2eE
27: 0x6d6817ec - ZN6middle5trans4base10trans_item20h7a9c36ad77c3fd91AlfE
28: 0x6d73f009 - ZN6middle5trans4base11trans_crate20ha6d41362f46fe1abQlgE
29: 0x6db6daf9 - ZN6driver6driver25phase_4_translate_to_llvm20hc8eefbd8dad9706cjZwE
30: 0x6db661f4 - ZN6driver6driver13compile_input20h0eef3c908953a111ewwE
31: 0x6dbe2dff - ZN6driver7monitor20hcdaa282087678b71SaBE
32: 0x6dbe1170 - ZN6driver7monitor20hcdaa282087678b71SaBE
33: 0x6d33bf55 - ZN6driver6driver35OutputFilenames...std..clone..Clone5clone20h22daf11eed536512ElxE
34: 0x6d33be97 - ZN6driver6driver35OutputFilenames...std..clone..Clone5clone20h22daf11eed536512ElxE
35: 0x7072945c - ZN4task10spawn_opts20hae91090f93dc8031FteE
36: 0x668aab5f - rust_try
37: 0x668aab39 - rust_try
38: 0x6684432e - ZN6unwind3try20hba110656f3557a7bU4cE
39: 0x66844189 - ZN4task4Task3run20hdb858a047ca67fa4kzcE
40: 0x707292b6 - ZN4task10spawn_opts20hae91090f93dc8031FteE
41: 0x66845807 - ZN4task11BlockedTask14cast_from_uint20hffe040d42c989c01XRcE
42: 0x7ff9177a16ad - BaseThreadInitThunk

Edit: The bug persists on compiler version: rustc 0.13.0-nightly (15dd90b 2014-10-30 00:27:02 +0000)

Edit 2: after some tracing with RUST_LOG=rustc::middle::traits::select=5, the following is reached

        if candidates.len() == 0 {
            return Err(Unimplemented);
        }

with candidates.len() = 0.
link to line: https://github.com/rust-lang/rust/blob/master/src/librustc/middle/traits/select.rs#L835
the error is printed by this line:

format!("Encountered error `{}` selecting `{}` during trans",

@dbalchev
Copy link
Author

dbalchev commented Dec 9, 2014

As of rustc 0.13.0-nightly (8bca470 2014-12-08 00:12:30 +0000) the bug is fixed.

@dbalchev dbalchev closed this as completed Dec 9, 2014
lnicola pushed a commit to lnicola/rust that referenced this issue Aug 29, 2024
feat: Make rust-analyzer work partially when offline

Helps out with rust-lang/rust-analyzer#12499 a bit
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

1 participant