You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
null as a method-call argument gets no pointer type context: 's.m(null)' / 'S.k(null)' → 'null requires pointer type context' #1496
type S { n: i32 }
impl S:
fn m(p: *mut i8) -> i32: self.n
fn S.k(p: *mut i8) -> i32: 1
fn main:
let s = S { n: 3 }
let a = s.m(null)
let b = S.k(null)
print(f"{a} {b}")
Expected:3 1. Actual:
error: null requires pointer type context
--> nul3.w:7:17
7 | let a = s.m(null)
error: null requires pointer type context
--> nul3.w:8:17
8 | let b = S.k(null)
A free function fn f(p: *mut i8) called as f(null) works, so the method-call argument path (instance and static Type.fn) does not hand the parameter type to null as its expected type.
Impact: every facade-rendered method or constructor with a pointer parameter the caller wants to leave NULL — db.sqlite3_exec(sql, null, null, null), Statement.sqlite3_prepare_v2(db, sql, -1, null) (the pzTail out pointer) — needs a typed local (let tail: *mut *const i8 = null) to pass NULL.
Activity
ehartford commentedon Sep 26, 2026
Verified fixed on main 55739d4 (release binary): s.m(null) and S.k(null) accepted, prints 3 1.