Skip to content

Commit cacabef

Browse files
committed
docs autoderef-full-lval
1 parent f863638 commit cacabef

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/ui/autoref-autoderef/autoderef-box-no-add.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
//! Tests that auto-dereferencing does not allow addition of `Box<isize>` values.
2+
//!
3+
//! This test ensures that `Box<isize>` fields in structs (`Clam` and `Fish`) are not
4+
//! automatically dereferenced to `isize` during addition operations, as `Box<isize>`
5+
//! does not implement the `Add` trait. Attempts to add `Box<isize>` values should
6+
//! result in a compile error.
7+
18
struct Clam {
29
x: Box<isize>,
310
y: Box<isize>,

0 commit comments

Comments
 (0)