When I attempt to assign to a variable of type &fn(&B), other than in the declaration of the variable, I get an unexpected panic in the compiler.
I tried this code:
struct B;
impl B {
fn func(&self) { }
}
fn main() {
let mut y = &B::func;
y = &B::func;
}
I expected to see this happen: It should compile.
Instead, this happened: I got an internal compiler error:
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'path not fully resolved: PathResolution { base_def: DefTy(DefId { krate: 0, node: 4 }, false), last_private: LastMod(AllPublic), depth: 1 }', /home/mag/prog/rust/src/librustc/middle/def.rs:80
When I attempt to assign to a variable of type
&fn(&B)
, other than in the declaration of the variable, I get an unexpected panic in the compiler.I tried this code:
I expected to see this happen: It should compile.
Instead, this happened: I got an internal compiler error:
Meta
rustc --version --verbose
:Backtrace:
This issue could be related to a similar issue I also discovered: https://github.com/rust-lang/rust/issues/24322