about summary refs log tree commit diff
path: root/tests/ui/methods/suggest-convert-ptr-to-ref.rs
blob: ccce3c65470dfe5c8667526f896f3cff81ec8497 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
fn main() {
    let mut x = 8u8;
    let z: *const u8 = &x;
    // issue #21596
    println!("{}", z.to_string()); //~ ERROR E0599

    let t: *mut u8 = &mut x;
    println!("{}", t.to_string()); //~ ERROR E0599
    t.make_ascii_lowercase(); //~ ERROR E0599

    // suggest `as_mut` simply because the name is similar
    let _ = t.as_mut_ref(); //~ ERROR E0599
    let _ = t.as_ref_mut(); //~ ERROR E0599

    // no ptr-to-ref suggestion
    z.make_ascii_lowercase(); //~ ERROR E0599
}