-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
compiler internal error: subtype error #17033
Comments
I shrunk this to a much smaller test case. rgsl.rs: use std::intrinsics::sinf64;
pub type function<T> = fn(x: f64, p: &mut T) -> f64;
struct InternParam<'r, T:'r> {
func: ::function<T>,
param: &'r mut T,
p2: f64
}
struct fn_fourier_params<'r, T:'r> {
omega: f64,
function: &'r mut ::function<T>,
arg: &'r mut T
}
unsafe fn fn_sin<T>(x: f64, p: &mut fn_fourier_params<T>) -> f64 {
let f = p.function;
let w = p.omega;
let wx = w * x;
let sinwx = sinf64(wx);
f(x, p.arg) * sinwx
} Build output: $ cargo build
Compiling rust-GSL v0.4.9 (file:///home/mdinger/Programs/gsl/rust-GSL)
src/rgsl.rs:23:5: 23:16 error: internal compiler error: &mut fn(f64, &mut T) -> f64 was a subtype of &mut fn(<generic #15>, <generic #16>) -> <generic #14> but now is not?
src/rgsl.rs:23 f(x, p.arg) * sinwx
^~~~~~~~~~~
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 'Box<Any>', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/libsyntax/ast_util.rs:776
Could not compile `rust-GSL`.
To learn more, run the command again with --verbose. [EDIT] |
It's a lot better like that, thanks ! |
Minimal: fn f<'r>(p: &'r mut fn(p: &mut ())) {
p(())
}
fn main() {} |
cc me |
Fixes #17033. Fixes #15965. cc @nikomatsakis
Fixes #17033. Fixes #15965. cc @nikomatsakis
Fixes #17033. Fixes #15965. cc @nikomatsakis
Hey, Code:
Report:
(On Mac 10.10 nightly installer) |
@cakey I don't see that error when checking with a local build (at least not anymore). You may want to upgrade. Note also that the code is illegal. A working version looks something like this (maybe there's a nicer way to do it, not sure):
UPDATE: fixed code example |
@nikomatsakis Seems to be fixed! Nice. |
Log flycheck errors Resolves rust-lang#16969 The non-cargo messages are appended to the error strings here; https://github.com/rust-lang/rust-analyzer/blob/7a8374c162c64c17e865b98aad282d16b16e96d6/crates/flycheck/src/lib.rs#L460-L482 that one is formatted into `Err` here; https://github.com/rust-lang/rust-analyzer/blob/7a8374c162c64c17e865b98aad282d16b16e96d6/crates/flycheck/src/command.rs#L144-L155 and finally, this PR appends it at the end of existing Flycheck error message
Log flycheck errors Resolves rust-lang#16969 The non-cargo messages are appended to the error strings here; https://github.com/rust-lang/rust-analyzer/blob/7a8374c162c64c17e865b98aad282d16b16e96d6/crates/flycheck/src/lib.rs#L460-L482 that one is formatted into `Err` here; https://github.com/rust-lang/rust-analyzer/blob/7a8374c162c64c17e865b98aad282d16b16e96d6/crates/flycheck/src/command.rs#L144-L155 and finally, this PR appends it at the end of existing Flycheck error message
Hey,
Here's the bug description :
And here is my rust compiler version :
> rustc -v rustc 0.12.0-pre-nightly (5419b2ca2 2014-08-29 22:16:20 +0000)
You can redo this bug with this
project
on the bug branch.The text was updated successfully, but these errors were encountered: