-
Notifications
You must be signed in to change notification settings - Fork 187
Closed
Labels
Milestone
Description
extern "C" {
fn puts(s: *const i8);
}
fn main() {
unsafe {
puts("foo\0" as *const str as *const i8);
}
}
as is this gives
<source>:6:5: fatal error: Failed to lower expr: [UnsafeBlockExpr:
outer attributes: noneBlockExpr:
outer attributes: none
inner attributes: none
statements:
ExprStmtWithoutBlock:
CallExpr:
outer attributes: none
Function expr: puts
Call params:
foo as *const str as *const i8
final expression: none
]
6 | unsafe {
| ^
compilation terminated.
without unsafe
block it gives
<source>:6:5: error: unknown root segment in path puts lookup puts
6 | puts("foo\0" as *const str as *const i8);
| ^