Skip to content

Commit 0a0f014

Browse files
committed
test
1 parent 7175980 commit 0a0f014

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pub struct Foo<'a, const N: usize, T: 'a + ?Sized>(pub &'a T, [(); N]);
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// aux-build:trait_object_lt_defaults_lib.rs
2+
// run-pass
3+
#![allow(dead_code)]
4+
extern crate trait_object_lt_defaults_lib;
5+
6+
// Tests that `A<'a, 3, dyn Test>` is short for `A<'a, 3, dyn Test + 'a>`
7+
// and `Foo<'a, 3, dyn Test>` is short for `Foo<'a, 3, dyn Test + 'a>`
8+
// Test is in `const-generics/defaults` because it relies on param ordering
9+
10+
trait Test {}
11+
12+
struct A<'a, const N: usize, T: ?Sized + 'a>(&'a T, [(); N]);
13+
fn blah<'a>(mut a: A<'a, 3, dyn Test>, arg: &'a (dyn Test + 'a)) {
14+
a.0 = arg;
15+
}
16+
17+
fn other_blah<'a>(
18+
mut a: trait_object_lt_defaults_lib::Foo<'a, 3, dyn Test>,
19+
arg: &'a (dyn Test + 'a),
20+
) {
21+
a.0 = arg;
22+
}
23+
24+
fn main() {}

0 commit comments

Comments
 (0)