Skip to content

the compiler hit an unexpected failure path #16611

New issue

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

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

Already on GitHub? # to your account

Closed
ghost opened this issue Aug 19, 2014 · 7 comments
Closed

the compiler hit an unexpected failure path #16611

ghost opened this issue Aug 19, 2014 · 7 comments
Labels
E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@ghost
Copy link

ghost commented Aug 19, 2014

It's a little vague, but I ran into this bug today. I'm not sure how to classify this bug. I'm running Mac OS X 10.9.4, and building with the latest nightly.

$ make && make run

mkdir -p build

rustc src/main.rs -o build/tinier -L rustVM/build/

src/treetraverser.rs:15:12: 15:16 error: cannot determine a type for this bounded type parameter: unconstrained type

src/treetraverser.rs:15 #[deriving(Show)]

                                   ^~~~

note: in expansion of #[deriving]

src/treetraverser.rs:15:1: 15:18 note: expansion site

src/treetraverser.rs:15:12: 15:16 error: cannot determine a type for this bounded type parameter: unconstrained type

src/treetraverser.rs:15 #[deriving(Show)]

                                   ^~~~

note: in expansion of #[deriving]

src/treetraverser.rs:15:1: 15:18 note: expansion site

error: internal compiler error: unexpected failure

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

task 'rustc' failed at 't_f should be a trait', /Users/rustbuild/src/rust-buildbot/slave/nightly-mac/build/src/librustc/middle/typeck/check/vtable.rs:572


make: *** [build] Error 101
@alexcrichton
Copy link
Member

Can you provide the code that causes the ICE as well?

@ghost
Copy link
Author

ghost commented Aug 19, 2014

@huonw huonw added the I-ICE label Aug 19, 2014
@klutzy
Copy link
Contributor

klutzy commented Aug 20, 2014

Minimal example:

trait T {}
struct S;
impl<U> T for S {}

In @ueliem's code, #[deriving(Show)] enum VariableType<String, int> { ... } is expanded as

impl <String: ::std::fmt::Show, int: ::std::fmt::Show> ::std::fmt::Show for VariableType<String, int> { ... }

which triggers the ICE.

@klutzy
Copy link
Contributor

klutzy commented Aug 20, 2014

So this seems #16562.

@klutzy
Copy link
Contributor

klutzy commented Aug 20, 2014

The interesting point is that the first int in impl<...> is recognized as type parameter, but the second one in VariableType<..., int> is recognized as built-in type. So first u8 becomes unnecessary parameter which causes #16562.

(@ueliem In your example, you can remove <String, int> bound of enum definition if it is not intended)

@ghost
Copy link
Author

ghost commented Aug 21, 2014

Thanks, I removed that bit on the enum definition, and it compiled without the error.

@ghost ghost added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Oct 3, 2014
@ghost
Copy link

ghost commented Oct 16, 2014

Closing as a dupe of #16562.

@ghost ghost closed this as completed Oct 16, 2014
This issue was closed.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

3 participants