Self referential struct with references

I am playing around with some unsafe code and Pin to try and create a self referential struct. Using the documentation of Pin I managed to get this self referntial struct to work using raw pointers:

use std::{marker::PhantomPinned, pin::Pin, ptr::NonNull};

pub struct Something {
    number: usize,
}

pub struct Data {
    something: Something,
    reference: NonNull<Something>,
    _pin: PhantomPinned,
}

impl Data {
    pub fn new() -> Pin<Box<Self>> {
        let ret = Data { something: Something{number: 5}, reference: NonNull::dangling(), _pin: PhantomPinned};

        let mut boxed = Box::pin(ret);
        let reference = NonNull::from(&boxed.something);
        
        // we know this is safe because modifying a field doesn't move the whole struct
        unsafe {
            let mut_ref: Pin<&mut Self> = Pin::as_mut(&mut boxed);
            Pin::get_unchecked_mut(mut_ref).reference = reference;
        }

        boxed
    }

    pub fn increase_through_ref(self: &mut Pin<Box<Self>>) {
        unsafe {
            let reference:NonNull<Something> = self.as_mut().get_unchecked_mut().reference;
            (*reference.as_ptr()).number = 7;
        }
    }


}

fn main() {
    let mut data = Data::new();
    println!("data something: {}",data.something.number);

    data.increase_through_ref();

    println!("data something: {}",data.something.number);
    return;
}

Now I am trying to do the same but instead of using raw pointers I would like to use references. I have the following implementation:

use std::{marker::PhantomPinned, pin::Pin};

pub struct Something {
    number: usize,
}

pub struct Data<'data> {
    something: Something, // since something is owned directly by data, it doesn't need seperate pinning
    reference: Option<&'data mut Something>,
    _pin: PhantomPinned,
}

impl<'data> Data<'data> {
    pub fn new() -> Pin<Box<Self>> {
        let ret = Data { something: Something{number: 5}, reference: None, _pin: PhantomPinned};

        let mut boxed = Box::pin(ret);

        // we know this is safe because modifying a field doesn't move the whole struct
        unsafe {
            let reference = &mut boxed.as_mut().get_unchecked_mut().something;

            let mut_ref: Pin<&mut Self> = Pin::as_mut(&mut boxed);
            Pin::get_unchecked_mut(mut_ref).reference = Some(reference);
        }

        boxed
    }

    pub fn increase_through_ref(self: &mut Pin<Box<Self>>) {
        unsafe {
            let reference = self.as_mut().get_unchecked_mut().reference.as_mut().unwrap(); // we have a double pointer because &mut T is not Copy
            (**reference).number = 7;
        }
    }
}

fn main() {
    let mut data = Data::new();
    println!("data something: {}",data.something.number);
    
    data.increase_through_ref();

    println!("data something: {}",data.something.number);
    return;
}

However whatever I try, I can't make it work. Is this conceptually just not possible, or how could I get this to work?

Thanks in advance

References must reference something outside the struct. They cannot be used to write self-referential structs.