Skip to content

Instantly share code, notes, and snippets.

Running target/debug/parser-4592a6b517fc46f5
running 5 tests
test mdo::test::mdo ... ok
test mdo::test::mdo_closure ... ok
test monad::test::associativity ... ok
test monad::test::right_identity ... ok
test monad::test::left_identity ... ok
test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured
#![crate_name = "parser"]
#![crate_type = "lib"]
use std::ops::Add;
/// ```
/// use parser::test;
///
/// assert_eq!(test::<i32>(1)(2), 3);
/// ```
[package]
name = "test"
version = "0.1.0"
authors = ["Martin Wernstål <m4rw3r@gmail.com>"]
[dependencies.parser]
path = "/Users/m4rw3r/Projects/Self/rust_parser"
error: internal compiler error: fictitious type impl Parser<u8, &'static [u8], error::Error<u8>> + Sized + 'static in sizing_type_of()
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
thread 'rustc' panicked at 'Box<Any>', src/libsyntax/diagnostic.rs:253
stack backtrace:
1: 0x1070328f5 - sys::backtrace::write::hbde7a04ac5266f40Cxs
2: 0x10703b9fe - panicking::on_panic::hebff0ba18b62efb1kYw
3: 0x106ff53e2 - rt::unwind::begin_unwind_inner::hda386695be757df8vGw
4: 0x104c6741f - rt::unwind::begin_unwind::h4700935743387377434
error: internal compiler error: fictitious type impl Parser<u8, &'static [u8], error::Error<u8>> + Sized + 'static in sizing_type_of()
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
thread 'rustc' panicked at 'Box<Any>', src/libsyntax/diagnostic.rs:253
stack backtrace:
1: 0x1080028f5 - sys::backtrace::write::ha0bc4a9bddc6a867Cxs
2: 0x10800b9fe - panicking::on_panic::ha9dfbe03b50c004akYw
3: 0x107fc53e2 - rt::unwind::begin_unwind_inner::hca93a9fd146d03e3vGw
diff --git a/src/librustc_trans/trans/base.rs b/src/librustc_trans/trans/base.rs
index 61e81d7..69328e8 100644
--- a/src/librustc_trans/trans/base.rs
+++ b/src/librustc_trans/trans/base.rs
@@ -2343,6 +2343,8 @@ pub fn get_item_val(ccx: &CrateContext, id: ast::NodeId) -> ValueRef {
let val = match item {
ast_map::NodeItem(i) => {
let ty = ccx.tcx().node_id_to_type(i.id);
+ let ty = monomorphize::normalize_associated_type(ccx.tcx(), &ty);
+
➜ rust_parser git:(unboxed-closures_http_parser) RUST_LOG=rustc_trans::trans::type_of cargo build
Compiling parser v0.0.1 (file:///Users/m4rw3r/Projects/Self/rust_parser)
DEBUG:rustc_trans::trans::type_of: type_of &'static [&'static str]
DEBUG:rustc_trans::trans::type_of: type_of [&'static str]
DEBUG:rustc_trans::trans::type_of: type_of &'static str
DEBUG:rustc_trans::trans::type_of: --> mapped t=&'static str &'static str to llty=%str_slice = type { i8*, i64 }
DEBUG:rustc_trans::trans::type_of: --> mapped t=[&'static str] [&'static str] to llty=%str_slice = type { i8*, i64 }
DEBUG:rustc_trans::trans::type_of: --> mapped t=&'static [&'static str] &'static [&'static str] to llty={ %str_slice*, i64 }
DEBUG:rustc_trans::trans::type_of: type_of u8
DEBUG:rustc_trans::trans::type_of: --> mapped t=u8 u8 to llty=i8
@m4rw3r
m4rw3r / gist:161f67e3ebeb88dc04c4
Created September 6, 2015 12:22
Output of RUST_LOG=rustc_trans::base with added logging around monomorphize before calls to register_fn. Node..., pre and Node..., post are before and after monomorphization.
Compiling parser v0.0.1 (file:///Users/m4rw3r/Projects/Self/rust_parser)
DEBUG:rustc_trans::trans::base: new InsnCtxt: text
DEBUG:rustc_trans::trans::base: new InsnCtxt: trans_mod
DEBUG:rustc_trans::trans::base: new InsnCtxt: trans_item
DEBUG:rustc_trans::trans::base: new InsnCtxt: trans_item
DEBUG:rustc_trans::trans::base: new InsnCtxt: trans_item
DEBUG:rustc_trans::trans::base: new InsnCtxt: trans_item
DEBUG:rustc_trans::trans::base: new InsnCtxt: trans_mod
DEBUG:rustc_trans::trans::base: new InsnCtxt: trans_item
DEBUG:rustc_trans::trans::base: new InsnCtxt: trans_item
@m4rw3r
m4rw3r / gist:813ac04d1dc494a1b119
Created September 6, 2015 12:47
Output of RUST_LOG=rustc_trans::base with added logging around monomorphize before calls to register_fn. Node..., pre and Node..., post are before and after monomorphization. Includes result from ty.has_anonymized_types().
Compiling parser v0.0.1 (file:///Users/m4rw3r/Projects/Self/rust_parser)
DEBUG:rustc_trans::trans::base: new InsnCtxt: text
DEBUG:rustc_trans::trans::base: new InsnCtxt: trans_mod
DEBUG:rustc_trans::trans::base: new InsnCtxt: trans_item
DEBUG:rustc_trans::trans::base: new InsnCtxt: trans_item
DEBUG:rustc_trans::trans::base: new InsnCtxt: trans_item
DEBUG:rustc_trans::trans::base: new InsnCtxt: trans_item
DEBUG:rustc_trans::trans::base: new InsnCtxt: trans_mod
DEBUG:rustc_trans::trans::base: new InsnCtxt: trans_item
DEBUG:rustc_trans::trans::base: new InsnCtxt: trans_item
DEBUG:rustc::middle::infer: normalize_associated_type(t=FnConverging(impl Parser<'static, u8, u8, error::Error<u8>> + Sized + 'static))
DEBUG:rustc::middle::infer: normalize_associated_types(infcx.deanonymize=true)
DEBUG:rustc::middle::infer: erase_regions(FnConverging(impl Parser<'static, u8, u8, error::Error<u8>> + Sized + 'static)) = FnConverging(impl Parser<u8, u8, error::Error<u8>> + Sized + 'static)
DEBUG:rustc::middle::traits::project: AssociatedTypeNormalizer::fold(value=FnConverging(impl Parser<u8, u8, error::Error<u8>> + Sized + 'static), has_projection_types=false, deanonymize=true, has_associated_types=true)
DEBUG:rustc::middle::traits::project: AssociatedTypeNormalizer::fold_ty(ty=impl Parser<u8, u8, error::Error<u8>> + Sized + 'static)
DEBUG:rustc::middle::traits::project: AssociatedTypeNormalizer::fold_ty(ty=u8)
DEBUG:rustc::middle::traits::project: AssociatedTypeNormalizer::fold_ty(ty=u8)
DEBUG:rustc::middle::traits::project: AssociatedTypeNormalizer::fold_ty(ty=error::Error<u8>)
DEBUG:rustc::