]> git.proxmox.com Git - rustc.git/blame - src/test/ui/dep-graph/dep-graph-trait-impl-two-traits.rs
Update unsuspicious file list
[rustc.git] / src / test / ui / dep-graph / dep-graph-trait-impl-two-traits.rs
CommitLineData
9cc50fc6
SL
1// Test that adding an impl to a trait `Foo` does not affect functions
2// that only use `Bar`, so long as they do not have methods in common.
3
c295e0f8
XL
4// incremental
5// compile-flags: -Z query-dep-graph
9cc50fc6
SL
6
7#![feature(rustc_attrs)]
8#![allow(warnings)]
9
10fn main() { }
11
12pub trait Foo: Sized {
13 fn foo(self) { }
14}
15
16pub trait Bar: Sized {
17 fn bar(self) { }
18}
19
20mod x {
21 use {Foo, Bar};
22
23 #[rustc_if_this_changed]
24 impl Foo for char { }
25
26 impl Bar for char { }
27}
28
29mod y {
30 use {Foo, Bar};
31
04454e1e 32 #[rustc_then_this_would_need(typeck)] //~ ERROR OK
9cc50fc6
SL
33 pub fn call_bar() {
34 char::bar('a');
35 }
36}
37
38mod z {
39 use y;
40
3dfed10e 41 #[rustc_then_this_would_need(typeck)] //~ ERROR no path
9cc50fc6
SL
42 pub fn z() {
43 y::call_bar();
44 }
45}