|
| 1 | +//@ run-rustfix |
| 2 | + |
| 3 | +#![allow(unused)] |
| 4 | + |
| 5 | +pub const P1: const* u8 = 0 as _; |
| 6 | +//~^ ERROR: raw pointer type must have a star before the mutability keyword |
| 7 | +//~| HELP: move it to the other side |
| 8 | + |
| 9 | +pub const P2: mut* u8 = 1 as _; |
| 10 | +//~^ ERROR: raw pointer type must have a star before the mutability keyword |
| 11 | +//~| HELP: move it to the other side |
| 12 | + |
| 13 | +pub const P3: const* i32 = std::ptr::null(); |
| 14 | +//~^ ERROR: raw pointer type must have a star before the mutability keyword |
| 15 | +//~| HELP: move it to the other side |
| 16 | + |
| 17 | +pub const P4: const* i32 = std::ptr::null(); |
| 18 | +//~^ ERROR: raw pointer type must have a star before the mutability keyword |
| 19 | +//~| HELP: move it to the other side |
| 20 | + |
| 21 | +pub const P5: mut* i32 = std::ptr::null_mut(); |
| 22 | +//~^ ERROR: raw pointer type must have a star before the mutability keyword |
| 23 | +//~| HELP: move it to the other side |
| 24 | + |
| 25 | +pub const P6: mut* i32 = std::ptr::null_mut(); |
| 26 | +//~^ ERROR: raw pointer type must have a star before the mutability keyword |
| 27 | +//~| HELP: move it to the other side |
| 28 | + |
| 29 | +pub const P7: const* Vec<u8> = std::ptr::null(); |
| 30 | +//~^ ERROR: raw pointer type must have a star before the mutability keyword |
| 31 | +//~| HELP: move it to the other side |
| 32 | + |
| 33 | +pub const P8: const* std::collections::HashMap<String, i32> = std::ptr::null(); |
| 34 | +//~^ ERROR: raw pointer type must have a star before the mutability keyword |
| 35 | +//~| HELP: move it to the other side |
| 36 | + |
| 37 | +fn func1(p: const* u8) {} |
| 38 | +//~^ ERROR: raw pointer type must have a star before the mutability keyword |
| 39 | +//~| HELP: move it to the other side |
| 40 | + |
| 41 | +fn func2(p: mut* u8) {} |
| 42 | +//~^ ERROR: raw pointer type must have a star before the mutability keyword |
| 43 | +//~| HELP: move it to the other side |
| 44 | + |
| 45 | +fn func3() -> const* u8 { std::ptr::null() } |
| 46 | +//~^ ERROR: raw pointer type must have a star before the mutability keyword |
| 47 | +//~| HELP: move it to the other side |
| 48 | + |
| 49 | +fn func4() -> mut* u8 { std::ptr::null_mut() } |
| 50 | +//~^ ERROR: raw pointer type must have a star before the mutability keyword |
| 51 | +//~| HELP: move it to the other side |
| 52 | + |
| 53 | +struct S1 { |
| 54 | + field: const* u8, |
| 55 | + //~^ ERROR: raw pointer type must have a star before the mutability keyword |
| 56 | + //~| HELP: move it to the other side |
| 57 | +} |
| 58 | + |
| 59 | +struct S2 { |
| 60 | + field: mut* u8, |
| 61 | + //~^ ERROR: raw pointer type must have a star before the mutability keyword |
| 62 | + //~| HELP: move it to the other side |
| 63 | +} |
| 64 | + |
| 65 | +type Tuple1 = (const* u8, i32); |
| 66 | +//~^ ERROR: raw pointer type must have a star before the mutability keyword |
| 67 | +//~| HELP: move it to the other side |
| 68 | + |
| 69 | +type Tuple2 = (mut* u8, i32); |
| 70 | +//~^ ERROR: raw pointer type must have a star before the mutability keyword |
| 71 | +//~| HELP: move it to the other side |
| 72 | + |
| 73 | +type Array1 = [const* u8; 10]; |
| 74 | +//~^ ERROR: raw pointer type must have a star before the mutability keyword |
| 75 | +//~| HELP: move it to the other side |
| 76 | + |
| 77 | +type Array2 = [mut* u8; 10]; |
| 78 | +//~^ ERROR: raw pointer type must have a star before the mutability keyword |
| 79 | +//~| HELP: move it to the other side |
| 80 | + |
| 81 | +type Alias1 = const* u8; |
| 82 | +//~^ ERROR: raw pointer type must have a star before the mutability keyword |
| 83 | +//~| HELP: move it to the other side |
| 84 | + |
| 85 | +type Alias2 = mut* u8; |
| 86 | +//~^ ERROR: raw pointer type must have a star before the mutability keyword |
| 87 | +//~| HELP: move it to the other side |
| 88 | + |
| 89 | +pub const P9: const *u8 = std::ptr::null(); |
| 90 | +//~^ ERROR: raw pointer type must have a star before the mutability keyword |
| 91 | +//~| HELP: move it to the other side |
| 92 | + |
| 93 | +pub const P10: const * u8 = std::ptr::null(); |
| 94 | +//~^ ERROR: raw pointer type must have a star before the mutability keyword |
| 95 | +//~| HELP: move it to the other side |
| 96 | + |
| 97 | +impl S1 { |
| 98 | + fn method(self, size: const* u32) {} |
| 99 | + //~^ ERROR: raw pointer type must have a star before the mutability keyword |
| 100 | + //~| HELP: move it to the other side |
| 101 | +} |
| 102 | + |
| 103 | +trait Trait1 { |
| 104 | + fn method(p: const* u8); |
| 105 | + //~^ ERROR: raw pointer type must have a star before the mutability keyword |
| 106 | + //~| HELP: move it to the other side |
| 107 | +} |
| 108 | + |
| 109 | +fn generic_func<T>() -> const* T { std::ptr::null() } |
| 110 | +//~^ ERROR: raw pointer type must have a star before the mutability keyword |
| 111 | +//~| HELP: move it to the other side |
| 112 | + |
| 113 | +fn main() {} |
0 commit comments