compiler: Check module paths in safe helpers

6168daf0c4421a793f250ab847793045c1a4f9606ed20873bde05f8508dcbaa3
Alexis Sellier committed ago 1 parent 6895879f
lib/std/lang/resolver.rad +2 -2
3278 3278
}
3279 3279
3280 3280
/// Flatten an identifier or scope access chain into an array of name segments.
3281 3281
/// Examples: `fnord` -> `&["fnord"]`, `a::b::c` -> `&["a", "b", "c"]`.
3282 3282
/// Return the number of segments written to the buffer.
3283 -
unsafe fn flattenPath 'arena (
3283 +
fn flattenPath 'arena (
3284 3284
    self: &mut Resolver 'arena,
3285 3285
    node: *ast::Node,
3286 3286
    buf: &mut [*[u8]]
3287 3287
) -> u32 throws (ResolveError) {
3288 3288
    let mut out: u32 = 0;
3365 3365
    return self.moduleScopes[parentId as u32];
3366 3366
}
3367 3367
3368 3368
/// Check if a node has `super` at its root (e.g. `super::x` or `super::Union::Variant`).
3369 3369
/// Returns the parent scope and the original node so `flattenPath` can strip `super`.
3370 -
unsafe fn checkSuperAccess 'arena (
3370 +
fn checkSuperAccess 'arena (
3371 3371
    self: &mut Resolver 'arena,
3372 3372
    node: *ast::Node
3373 3373
) -> ?SuperAccessResult throws (ResolveError) {
3374 3374
    // TODO: Maybe we should deal with `super` after the path is flattened.
3375 3375
    if let case ast::NodeValue::ScopeAccess(access) = node.value {