Are there known bug lists for stable releases


#1

I’ve just come across what appears to be a major bug in 1.11’s handling of references to statics and was wondering if there is an easy to check list of bugs somewhere. Looking through the main issue tracker I can’t find anything related so not sure if this was purposely fixed or if it is just incidental that it works on 1.12.1 and might regress.


#2

Also, in case anyone has actually seen anything to do with this bug. It seems if you reference a dereferenced static it just returns the existing reference instead of creating a new clone to it, which you can then modify which will change the value of the static reference.

Running the below works with 1.12.1 and fails on the third variant with 1.11.0.

use std::io;

static BYTES: &'static [u8] = include_bytes!("main.rs");
static BYTES2: &'static [u8] = include_bytes!("main.rs");
static BYTES3: &'static [u8] = include_bytes!("main.rs");

pub fn foo<R: io::Read>(mut r: R) -> io::Result<()> {
    let mut b = [0; 32];
    r.read_exact(&mut b)
}

fn main() {
    assert_eq!(BYTES.len(), 810);
    println!("Access via cursor");
    foo(io::Cursor::new(BYTES)).unwrap();
    assert_eq!(BYTES.len(), 810);
    println!("works");

    assert_eq!(BYTES2.len(), 810);
    println!("Access via ref-index");
    foo(&mut &BYTES2[..]).unwrap();
    assert_eq!(BYTES2.len(), 810);
    println!("works");

    assert_eq!(BYTES3.len(), 810);
    println!("Access via ref-deref");
    foo(&mut &*BYTES3).unwrap();
    assert_eq!(BYTES3.len(), 810);
    println!("works");
}

#3

In short, no.


#4

Does it work correctly with older compilers? If so it should be tagged a stable-to-stable-regression. Maybe rust should add a test for it to avoid it regressing again?