Skip to content

Commit ac893b8

Browse files
committed
add test for should_inline incorrect param_env
1 parent 32739a2 commit ac893b8

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// run-pass
2+
// compile-flags:-Zmir-opt-level=2
3+
4+
struct Cursor {}
5+
struct TokenTree {}
6+
7+
impl Iterator for Cursor {
8+
type Item = TokenTree;
9+
10+
fn next(&mut self) -> Option<TokenTree> {
11+
None
12+
}
13+
}
14+
15+
fn tokenstream_probably_equal_for_proc_macro() {
16+
fn break_tokens(_tree: TokenTree) -> impl Iterator<Item = TokenTree> {
17+
let token_trees: Vec<TokenTree> = vec![];
18+
token_trees.into_iter()
19+
}
20+
21+
let c1 = Cursor {};
22+
let c2 = Cursor {};
23+
24+
let mut t1 = c1.flat_map(break_tokens);
25+
let mut t2 = c2.flat_map(break_tokens);
26+
27+
for (_t1, _t2) in t1.by_ref().zip(t2.by_ref()) {}
28+
}
29+
30+
fn main() {
31+
tokenstream_probably_equal_for_proc_macro();
32+
}

0 commit comments

Comments
 (0)