Skip to content

Commit 2ee936f

Browse files
authored
fix compilation under rustc 1.77.2: missing unsafe (#60)
1 parent b025dfd commit 2ee936f

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/completion.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ impl<'r> CompletionString<'r> {
385385
iter!(
386386
clang_getCompletionNumAnnotations(self.ptr),
387387
clang_getCompletionAnnotation(self.ptr),
388-
).map(utility::to_string).collect()
388+
).map(|cxs| unsafe { utility::to_string(cxs) }).collect()
389389
}
390390

391391
/// Returns the availability of this completion string.

src/documentation.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ impl BlockCommand {
149149
let arguments = iter!(
150150
clang_BlockCommandComment_getNumArgs(raw),
151151
clang_BlockCommandComment_getArgText(raw),
152-
).map(utility::to_string).collect();
152+
).map(|cxs| unsafe { utility::to_string(cxs) }).collect();
153153
let paragraph = clang_BlockCommandComment_getParagraph(raw);
154154
let children = Comment::from_raw(paragraph).get_children();
155155
BlockCommand { command, arguments, children }
@@ -249,7 +249,7 @@ impl InlineCommand {
249249
let arguments = iter!(
250250
clang_InlineCommandComment_getNumArgs(raw),
251251
clang_InlineCommandComment_getArgText(raw),
252-
).map(utility::to_string).collect();
252+
).map(|cxs| unsafe { utility::to_string(cxs) }).collect();
253253
let style = match clang_InlineCommandComment_getRenderKind(raw) {
254254
CXCommentInlineCommandRenderKind_Normal => None,
255255
other => Some(mem::transmute(other)),

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1787,7 +1787,7 @@ impl<'cmds> CompileCommand<'cmds> {
17871787
clang_CompileCommand_getNumArgs(self.ptr),
17881788
clang_CompileCommand_getArg(self.ptr),
17891789
)
1790-
.map(utility::to_string)
1790+
.map(|cxs| unsafe { utility::to_string(cxs) })
17911791
.collect()
17921792
}
17931793

src/utility.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ pub unsafe fn to_string(clang: CXString) -> String {
273273
}
274274

275275
pub fn to_string_option(clang: CXString) -> Option<String> {
276-
clang.map(to_string).and_then(|s| {
276+
clang.map(|cxs| unsafe { to_string(cxs) }).and_then(|s| {
277277
if !s.is_empty() {
278278
Some(s)
279279
} else {

0 commit comments

Comments
 (0)