]> git.proxmox.com Git - rustc.git/blame - src/test/ui/specialization/issue-52050.rs
New upstream version 1.31.0~beta.4+dfsg1
[rustc.git] / src / test / ui / specialization / issue-52050.rs
CommitLineData
8faf50e0
XL
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.
4//
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.
10
11#![feature(specialization)]
12
13// Regression test for #52050: when inserting the blanket impl `I`
14// into the tree, we had to replace the child node for `Foo`, which
0bf4aa26 15// led to the structure of the tree being messed up.
8faf50e0
XL
16
17use std::iter::Iterator;
18
19trait IntoPyDictPointer { }
20
21struct Foo { }
22
23impl Iterator for Foo {
24 type Item = ();
25 fn next(&mut self) -> Option<()> {
26 None
27 }
28}
29
30impl IntoPyDictPointer for Foo { }
31
32impl<I> IntoPyDictPointer for I
33where
34 I: Iterator,
35{
36}
37
38impl IntoPyDictPointer for () //~ ERROR conflicting implementations
39{
40}
41
42fn main() { }