query
On this page

unsafeDiscardStringContext

builtins.unsafeDiscardStringContext

Primop
Docs pulled from | This Revision | about 11 hours ago


Nix manual

Takes 1 arguments

s

Discard the string context from a value that can be coerced to a string.

Noogle detected

Aliases

Implementation

This function is implemented in c++ and is part of the native nix runtime.

src/libexpr/primops/context.cc:9

static void prim_unsafeDiscardStringContext(EvalState & state, const PosIdx pos, Value ** args, Value & v)
{
    NixStringContext context;
    auto s = state.coerceToString(
        pos, *args[0], context, "while evaluating the argument passed to builtins.unsafeDiscardStringContext");
    v.mkString(*s, state.mem);
}