]> git.lizzy.rs Git - rust.git/blob - src/test/ui/traits/issue-22019.rs
Auto merge of #84959 - camsteffen:lint-suggest-group, r=estebank
[rust.git] / src / test / ui / traits / issue-22019.rs
1 // run-pass
2 // Test an issue where global caching was causing free regions from
3 // distinct scopes to be compared (`'g` and `'h`). The only important
4 // thing is that compilation succeeds here.
5
6 // pretty-expanded FIXME #23616
7
8 #![allow(missing_copy_implementations)]
9 #![allow(unused_variables)]
10
11 use std::borrow::ToOwned;
12
13 pub struct CFGNode;
14
15 pub type Node<'a> = &'a CFGNode;
16
17 pub trait GraphWalk<'c, N> {
18     /// Returns all the nodes in this graph.
19     fn nodes(&'c self) where [N]:ToOwned<Owned=Vec<N>>;
20 }
21
22 impl<'g> GraphWalk<'g, Node<'g>> for u32
23 {
24     fn nodes(&'g self) where [Node<'g>]:ToOwned<Owned=Vec<Node<'g>>>
25     { loop { } }
26 }
27
28 impl<'h> GraphWalk<'h, Node<'h>> for u64
29 {
30     fn nodes(&'h self) where [Node<'h>]:ToOwned<Owned=Vec<Node<'h>>>
31     { loop { } }
32 }
33
34 fn main()  { }