Skip to content

Commit e748032

Browse files
committed
Return mutable string from non-const std::string::data()
1 parent 52749e3 commit e748032

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

rules/string/ir_unsafe.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1548,21 +1548,21 @@
15481548
{
15491549
"placeholder": {
15501550
"arg": "a0",
1551-
"access": "read"
1551+
"access": "write"
15521552
}
15531553
}
15541554
],
15551555
"body": [
15561556
{
1557-
"text": ".as_ptr()"
1557+
"text": ".as_mut_ptr()"
15581558
}
15591559
]
15601560
}
15611561
}
15621562
],
15631563
"params": {
15641564
"a0": {
1565-
"type": "Vec<u8>"
1565+
"type": "&mut Vec<u8>"
15661566
}
15671567
},
15681568
"return_type": {

rules/string/tgt_unsafe.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ unsafe fn f4(a0: &mut Vec<u8>, a1: *mut u8, a2: usize) {
3535
unsafe fn f5(a0: Vec<u8>) -> *const u8 {
3636
a0.as_ptr()
3737
}
38-
unsafe fn f6(a0: Vec<u8>) -> *const u8 {
39-
a0.as_ptr()
38+
unsafe fn f6(a0: &mut Vec<u8>) -> *const u8 {
39+
a0.as_mut_ptr()
4040
}
4141
unsafe fn f7(a0: *const u8, a1: usize) -> Vec<u8> {
4242
std::slice::from_raw_parts(a0, a1 as usize)

0 commit comments

Comments
 (0)