From 38968da1160b8a34aed13e058ade6492571bc044 Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Sat, 29 Oct 2022 11:20:07 -0400 Subject: [PATCH] Add test validating successful fix --- src/test/ui/const-generics/issue-103243.rs | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/test/ui/const-generics/issue-103243.rs diff --git a/src/test/ui/const-generics/issue-103243.rs b/src/test/ui/const-generics/issue-103243.rs new file mode 100644 index 0000000000000..78c73522bb507 --- /dev/null +++ b/src/test/ui/const-generics/issue-103243.rs @@ -0,0 +1,37 @@ +// build-pass + +pub trait CSpace: Sized { + type Traj; +} + +pub trait FullTrajectory {} + +pub struct Const; + +pub trait Obstacle +where + CS: CSpace, +{ + fn trajectory_free(&self, t: &FT) + where + FT: FullTrajectory; +} + +// ----- + +const N: usize = 4; + +struct ObstacleSpace2df32; + +impl Obstacle for ObstacleSpace2df32 +where + CS: CSpace, +{ + fn trajectory_free(&self, t: &TF) + where + TF: FullTrajectory, + { + } +} + +fn main() {}