fix(tvix/eval): unsafeDiscardStringContext is a no-op

... not just a TODO.

Most use-cases of unsafeDiscardStringContext are for cases where a
string is processed in some ways and no longer contains a "physical"
reference, but still has its context attached in C++ Nix.

We don't need to do this. This does diverge in behaviour in use-cases
related to build scheduling, but that whole behaviour will be
different in Tvix.

Change-Id: I4056d4c09f62d44d6bd52b791db03fe5556672b5
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8016
Reviewed-by: flokli <flokli@flokli.de>
Autosubmit: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
This commit is contained in:
Vincent Ambo 2023-02-02 15:47:51 +03:00 committed by clbot
parent 75d1b72b7c
commit 503e6810e7

View file

@ -1011,12 +1011,10 @@ mod placeholder_builtins {
#[builtin("unsafeDiscardStringContext")] #[builtin("unsafeDiscardStringContext")]
fn builtin_unsafe_discard_string_context( fn builtin_unsafe_discard_string_context(
vm: &mut VM, _: &mut VM,
#[lazy] s: Value, #[lazy] s: Value,
) -> Result<Value, ErrorKind> { ) -> Result<Value, ErrorKind> {
vm.emit_warning(WarningKind::NotImplemented( // Tvix does not manually track contexts, and this is a no-op for us.
"builtins.unsafeDiscardStringContext",
));
Ok(s) Ok(s)
} }