Skip to content
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

"can't monomorphize ..." ICE with use of generic intrinsic as a value #20318

Closed
huonw opened this issue Dec 30, 2014 · 3 comments
Closed

"can't monomorphize ..." ICE with use of generic intrinsic as a value #20318

huonw opened this issue Dec 30, 2014 · 3 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@huonw
Copy link
Member

huonw commented Dec 30, 2014

fn main() {
    let _f = std::intrinsics::offset::<u8>;
}
error: internal compiler error: can't monomorphize a NodeForeignItem(ForeignItem { ident: "offset"(63)#0, attrs: [Spanned { node: Attribute_ { id: AttrId(1061), style: AttrOuter, value: Spanned { node: MetaNameValue(doc, Spanned { node: LitStr(/// Calculates the offset from a pointer. The offset *must* be in-bounds of, CookedStr), span: Span { lo: BytePos(0), hi: BytePos(0), expn_id: ExpnId(4294967295) } }), span: Span { lo: BytePos(0), hi: BytePos(0), expn_id: ExpnId(4294967295) } }, is_sugared_doc: true }, span: Span { lo: BytePos(0), hi: BytePos(0), expn_id: ExpnId(4294967295) } }, Spanned { node: Attribute_ { id: AttrId(1062), style: AttrOuter, value: Spanned { node: MetaNameValue(doc, Spanned { node: LitStr(/// the object, or one-byte-past-the-end. An arithmetic overflow is also, CookedStr), span: Span { lo: BytePos(0), hi: BytePos(0), expn_id: ExpnId(4294967295) } }), span: Span { lo: BytePos(0), hi: BytePos(0), expn_id: ExpnId(4294967295) } }, is_sugared_doc: true }, span: Span { lo: BytePos(0), hi: BytePos(0), expn_id: ExpnId(4294967295) } }, Spanned { node: Attribute_ { id: AttrId(1063), style: AttrOuter, value: Spanned { node: MetaNameValue(doc, Spanned { node: LitStr(/// undefined behaviour., CookedStr), span: Span { lo: BytePos(0), hi: BytePos(0), expn_id: ExpnId(4294967295) } }), span: Span { lo: BytePos(0), hi: BytePos(0), expn_id: ExpnId(4294967295) } }, is_sugared_doc: true }, span: Span { lo: BytePos(0), hi: BytePos(0), expn_id: ExpnId(4294967295) } }, Spanned { node: Attribute_ { id: AttrId(1064), style: AttrOuter, value: Spanned { node: MetaNameValue(doc, Spanned { node: LitStr(///, CookedStr), span: Span { lo: BytePos(0), hi: BytePos(0), expn_id: ExpnId(4294967295) } }), span: Span { lo: BytePos(0), hi: BytePos(0), expn_id: ExpnId(4294967295) } }, is_sugared_doc: true }, span: Span { lo: BytePos(0), hi: BytePos(0), expn_id: ExpnId(4294967295) } }, Spanned { node: Attribute_ { id: AttrId(1065), style: AttrOuter, value: Spanned { node: MetaNameValue(doc, Spanned { node: LitStr(/// This is implemented as an intrinsic to avoid converting to and from an, CookedStr), span: Span { lo: BytePos(0), hi: BytePos(0), expn_id: ExpnId(4294967295) } }), span: Span { lo: BytePos(0), hi: BytePos(0), expn_id: ExpnId(4294967295) } }, is_sugared_doc: true }, span: Span { lo: BytePos(0), hi: BytePos(0), expn_id: ExpnId(4294967295) } }, Spanned { node: Attribute_ { id: AttrId(1066), style: AttrOuter, value: Spanned { node: MetaNameValue(doc, Spanned { node: LitStr(/// integer, since the conversion would throw away aliasing information., CookedStr), span: Span { lo: BytePos(0), hi: BytePos(0), expn_id: ExpnId(4294967295) } }), span: Span { lo: BytePos(0), hi: BytePos(0), expn_id: ExpnId(4294967295) } }, is_sugared_doc: true }, span: Span { lo: BytePos(0), hi: BytePos(0), expn_id: ExpnId(4294967295) } }], node: ForeignItemFn(FnDecl { inputs: [Arg { ty: Ty { id: 18, node: TyPtr(MutTy { ty: Ty { id: 19, node: TyPath(Path { span: Span { lo: BytePos(0), hi: BytePos(0), expn_id: ExpnId(4294967295) }, global: false, segments: [PathSegment { identifier: "T"(212)#0, parameters: AngleBracketedParameters(AngleBracketedParameterData { lifetimes: [], types: [], bindings: [] }) }] }, 20), span: Span { lo: BytePos(0), hi: BytePos(0), expn_id: ExpnId(4294967295) } }, mutbl: MutImmutable }), span: Span { lo: BytePos(0), hi: BytePos(0), expn_id: ExpnId(4294967295) } }, pat: Pat { id: 17, node: PatIdent(BindByValue(MutImmutable), Spanned { node: "dst"(144)#0, span: Span { lo: BytePos(0), hi: BytePos(0), expn_id: ExpnId(4294967295) } }, None), span: Span { lo: BytePos(0), hi: BytePos(0), expn_id: ExpnId(4294967295) } }, id: 16 }, Arg { ty: Ty { id: 23, node: TyPath(Path { span: Span { lo: BytePos(0), hi: BytePos(0), expn_id: ExpnId(4294967295) }, global: false, segments: [PathSegment { identifier: "int"(335)#0, parameters: AngleBracketedParameters(AngleBracketedParameterData { lifetimes: [], types: [], bindings: [] }) }] }, 24), span: Span { lo: BytePos(0), hi: BytePos(0), expn_id: ExpnId(4294967295) } }, pat: Pat { id: 22, node: PatIdent(BindByValue(MutImmutable), Spanned { node: "offset"(63)#0, span: Span { lo: BytePos(0), hi: BytePos(0), expn_id: ExpnId(4294967295) } }, None), span: Span { lo: BytePos(0), hi: BytePos(0), expn_id: ExpnId(4294967295) } }, id: 21 }], output: Return(Ty { id: 25, node: TyPtr(MutTy { ty: Ty { id: 26, node: TyPath(Path { span: Span { lo: BytePos(0), hi: BytePos(0), expn_id: ExpnId(4294967295) }, global: false, segments: [PathSegment { identifier: "T"(212)#0, parameters: AngleBracketedParameters(AngleBracketedParameterData { lifetimes: [], types: [], bindings: [] }) }] }, 27), span: Span { lo: BytePos(0), hi: BytePos(0), expn_id: ExpnId(4294967295) } }, mutbl: MutImmutable }), span: Span { lo: BytePos(0), hi: BytePos(0), expn_id: ExpnId(4294967295) } }), variadic: false }, Generics { lifetimes: [], ty_params: [TyParam { ident: "T"(212)#0, id: 28, bounds: [], unbound: None, default: None, span: Span { lo: BytePos(0), hi: BytePos(0), expn_id: ExpnId(4294967295) } }], where_clause: WhereClause { id: 29, predicates: [] } }), id: 15, span: Span { lo: BytePos(0), hi: BytePos(0), expn_id: ExpnId(4294967295) }, vis: Public })
note: the compiler unexpectedly panicked. 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
thread 'rustc' panicked at 'Box<Any>', /build/rust-git/src/rust/src/libsyntax/diagnostic.rs:182

cc #20319

@huonw huonw added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Dec 30, 2014
@huonw huonw changed the title ICE with use of generic intrinsic as a value "can't monomorphize ..." ICE with use of generic intrinsic as a value Dec 30, 2014
@tamird
Copy link
Contributor

tamird commented Apr 21, 2015

triage: still panics

@strega-nil
Copy link
Contributor

still panics

bltavares pushed a commit to bltavares/glacier that referenced this issue Oct 24, 2015
"can't monomorphize ..." ICE with use of generic intrinsic as a value
Refenrece rust-lang/rust#20318
@huonw
Copy link
Member Author

huonw commented Jan 14, 2016

Dupe of #15694.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

3 participants