Skip to content

Commit cc581bf

Browse files
committed
remove old error and add an explanation
1 parent ec48b4e commit cc581bf

File tree

2 files changed

+13
-49
lines changed

2 files changed

+13
-49
lines changed

src/test/ui/impl-trait/needs_least_region_or_bound.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
1+
// run-pass
2+
13
use std::fmt::Debug;
24

35
trait MultiRegionTrait<'a, 'b> {}
46
impl<'a, 'b> MultiRegionTrait<'a, 'b> for (&'a u32, &'b u32) {}
57

68
fn no_least_region<'a, 'b>(x: &'a u32, y: &'b u32) -> impl MultiRegionTrait<'a, 'b> {
7-
//~^ ERROR ambiguous lifetime bound
9+
// Here we have a constraint that:
10+
//
11+
// (x, y) has type (&'0 u32, &'1 u32)
12+
//
13+
// where
14+
//
15+
// 'a: '0
16+
//
17+
// then we require that `('0 u32, &'1 u32): MultiRegionTrait<'a,
18+
// 'b>`, which winds up imposing a requirement that `'0 = 'a` and
19+
// `'1 = 'b`.
820
(x, y)
921
}
1022

src/test/ui/impl-trait/needs_least_region_or_bound.stderr

Lines changed: 0 additions & 48 deletions
This file was deleted.

0 commit comments

Comments
 (0)