Skip to content

Instantly share code, notes, and snippets.

hash9.rs:23:9: 23:40 error: cannot determine a type for this bounded type parameter: unconstrained type
hash9.rs:23 self.input_stream(&mut stream);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@erickt
erickt / hash.rs
Last active August 29, 2015 13:56
#[feature(macro_rules)];
#[feature(default_type_params)];
#[allow(default_type_param_usage)];
use std::cast;
use std::rc::Rc;
use std::unstable::intrinsics;
trait Hash<S = SumState> {
fn hash(&self, state: &mut S) -> u64;
error: auxiliary build of /Users/erickt/rust/rust-master/src/test/auxiliary/macro_crate_test.rs failed to compile:
command: x86_64-apple-darwin/stage2/bin/rustc /Users/erickt/rust/rust-master/src/test/auxiliary/macro_crate_test.rs -L x86_64-apple-darwin/test/run-pass --target=x86_64-apple-darwin --crate-type=dylib -L x86_64-apple-darwin/test/run-pass/phase-syntax-link-does-resolve.stage2-x86_64-apple-darwin.libaux --out-dir x86_64-apple-darwin/test/run-pass/phase-syntax-link-does-resolve.stage2-x86_64-apple-darwin.libaux --cfg rtopt --cfg debug -C prefer-dynamic -O -L x86_64-apple-darwin/rt
stdout:
------------------------------------------
------------------------------------------
stderr:
------------------------------------------
/Users/erickt/rust/rust-master/src/test/auxiliary/macro_crate_test.rs:15:1: 15:19 error: can't find crate for `syntax`
/Users/erickt/rust/rust-master/src/test/auxiliary/macro_crate_test.rs:15 extern mod syntax;
trait Iterable<'a, T, Iter: Iterator<&'a T>> {
fn iter(&self) -> Iter;
}
trait MutIterable<'a, T, Iter: Iterator<&'a mut T>> {
fn iter(&mut self) -> Iter;
}
trait MoveIterable<T, Iter: Iterator<T>> {
fn iter(&self) -> Iter;
~[2, 3, 4]
foo.rs:8:18: 8:19 error: internal compiler error: cannot relate bound region: ReFree(60, BrNamed(syntax::ast::DefId{krate: 0u32, node: 33u32}, a)) <= ReLateBound(21, BrNamed(syntax::ast::DefId{krate: 0u32, node: 33u32}, a))
This message reflects a bug in the Rust compiler.
We would appreciate a bug report: http://static.rust-lang.org/doc/master/complement-bugreport.html
foo.rs:8 iter.map(f).collect()
^
use std::vec;
trait Iterable<'a, T, Iter: Iterator<&'a T>> {
fn iter(&'a self) -> Iter;
fn map<U, Out: FromIterator<U>>(&'a self, f: 'a |&'a T| -> U) -> Out {
self.iter().map(f).collect()
}
}
trait IntoIterator<T, Iter: Iterator<T>> {
fn into_iterator(self) -> Iter;
}
impl<T, Iter: Iterator<T>> IntoIterator<T, Iter> for Iter {
fn into_iterator(self) -> Iter {
self
}
}
Y.do_foo
foo
Z.do_foo
foo
subfoo
#[deriving(Serializable)]
struct Foo {
x: int,
y: ~str,
}
// generates...
impl<T, E> Serializable<T, E> for Foo {
fn serialize<S: Serializer>(&self, &mut s: S, data: T) -> Result<T, E> {
s.serialize_struct("Foo", |s| {