-
Notifications
You must be signed in to change notification settings - Fork 187
Closed
Description
I tried this code:
mod mem {
extern "rust-intrinsic" {
fn transmute<U, V>(_: U) -> V;
}
}
pub trait Hasher {
fn write(&mut self, bytes: &[u8]);
fn write_u16(&mut self, i: u16) {
self.write(&mem::transmute::<_, [u8; 2]>(i))
}
}
pub struct SipHasher;
impl Hasher for SipHasher {
#[inline]
fn write(&mut self, msg: &[u8]) {}
}
I expected to see this happen: explanation
Instead, this happened:
rust1: internal compiler error: in visit, at rust/typecheck/rust-hir-type-check-path.cc:144
0x204e319 internal_error(char const*, ...)
???:0
0x8027ef fancy_abort(char const*, int, char const*)
???:0
0xa10a9e Rust::Resolver::TypeCheckExpr::visit(Rust::HIR::PathInExpression&)
???:0
0x9c137c Rust::Resolver::TypeCheckExpr::Resolve(Rust::HIR::Expr*, bool)
???:0
0x9c2364 Rust::Resolver::TypeCheckExpr::visit(Rust::HIR::CallExpr&)
???:0
0x9c137c Rust::Resolver::TypeCheckExpr::Resolve(Rust::HIR::Expr*, bool)
???:0
0x9c4fca Rust::Resolver::TypeCheckExpr::visit(Rust::HIR::BorrowExpr&)
???:0
0x9c137c Rust::Resolver::TypeCheckExpr::Resolve(Rust::HIR::Expr*, bool)
???:0
0x9d5a10 Rust::TyTy::TypeCheckMethodCallExpr::visit(Rust::TyTy::FnType&)
???:0
0x9cd012 Rust::Resolver::TypeCheckExpr::visit(Rust::HIR::MethodCallExpr&)
???:0
0x9c137c Rust::Resolver::TypeCheckExpr::Resolve(Rust::HIR::Expr*, bool)
???:0
0x9b7b6a Rust::Resolver::TypeCheckExpr::visit(Rust::HIR::BlockExpr&)
???:0
0x9c137c Rust::Resolver::TypeCheckExpr::Resolve(Rust::HIR::Expr*, bool)
???:0
0x9be73b Rust::Resolver::TraitResolver::go(Rust::HIR::TypePath&)
???:0
0x9cd567 Rust::Resolver::TypeCheckItem::visit(Rust::HIR::ImplBlock&)
???:0
0x9b8d92 Rust::Resolver::TypeResolution::Resolve(Rust::HIR::Crate&)
???:0
0x8c88a8 Rust::Session::parse_file(char const*)
???:0
0x8c9548 Rust::Session::parse_files(int, char const**)
???:0
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Compiler returned: 1
or as variation:
mod mem {
extern "rust-intrinsic" {
fn transmute<U, V>(_: U) -> V;
}
}
pub trait Hasher {
fn write(&mut self, bytes: &[u8]);
fn write_u16(&mut self, i: u16) {
self.write(&mem::transmute::<_, [u8; 2]>(i))
}
}
rust1: internal compiler error: in visit_generic_predicates, at rust/privacy/rust-reachability.cc:56
0x204e319 internal_error(char const*, ...)
???:0
0x8027ef fancy_abort(char const*, int, char const*)
???:0
0x9ceb45 Rust::Privacy::Resolver::resolve(Rust::HIR::Crate&)
???:0
0x8c8927 Rust::Session::parse_file(char const*)
???:0
0x8c9548 Rust::Session::parse_files(int, char const**)
???:0
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Compiler returned: 1
Meta
- What version of Rust GCC were you using, git sha if possible.