]>
git.proxmox.com Git - rustc.git/blob - src/test/run-pass/methods/method-normalize-bounds-issue-20604.rs
1 // Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
13 #![allow(unused_variables)]
14 #![allow(stable_features)]
16 // Test that we handle projection types which wind up important for
17 // resolving methods. This test was reduced from a larger example; the
18 // call to `foo()` at the end was failing to resolve because the
19 // winnowing stage of method resolution failed to handle an associated
22 // pretty-expanded FIXME #23616
24 #![feature(associated_types)]
28 fn finish(&self) -> Self::Output
;
31 trait Hash
<H
: Hasher
> {
32 fn hash(&self, h
: &mut H
);
37 fn hasher(&self) -> Self::Wut
;
41 impl Hasher
for SipHasher
{
43 fn finish(&self) -> u64 { 4 }
46 impl Hash
<SipHasher
> for isize {
47 fn hash(&self, h
: &mut SipHasher
) {}
51 impl HashState
for SipState
{
53 fn hasher(&self) -> SipHasher { SipHasher }
62 <S
as HashState
>::Wut
: Hasher
<Output
=u64>,
64 fn foo
<K
>(&self, k
: K
) where K
: Hash
< <S
as HashState
>::Wut
> {}
67 fn foo
<K
: Hash
<SipHasher
>>(map
: &Map
<SipState
>) {