diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-3668.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-3668.rs b/src/test/ui/issues/issue-3668.rs new file mode 100644 index 000000000..0e1f19a75 --- /dev/null +++ b/src/test/ui/issues/issue-3668.rs @@ -0,0 +1,14 @@ +struct P { child: Option<Box<P>> } +trait PTrait { + fn getChildOption(&self) -> Option<Box<P>>; +} + +impl PTrait for P { + fn getChildOption(&self) -> Option<Box<P>> { + static childVal: Box<P> = self.child.get(); + //~^ ERROR attempt to use a non-constant value in a constant + panic!(); + } +} + +fn main() {} |