&takes a reference to the operand. This can be considered a discovery of the memory address in which the value is stored.
Your example works because it is +implemented using Addtrait , which has the following options:
impl Add<i32> for i32
impl<'a> Add<i32> for &'a i32
impl<'a> Add<&'a i32> for i32
impl<'a, 'b> Add<&'a i32> for &'b i32
That is, you can add any pair of links and not links. However, your second example will have two levels of indirection ( &&i32), and the attribute Addwill not be implemented for this set of link levels.
source
share