snix/tvix/eval/src
Florian Klink c9c8b10370 feat(tvix/eval): don't warn twice about dead code
We currently send two warnings in case of detecting dead code - W008
inside compile_dead_code, and a more detailed warning in all places that
invoke compile_dead_code:

```
warning[W007]: useless operation on boolean: this expression is always false
     --> /nix/store/qz3gjn95gazab4fkb7s8lm6hz17rdzzy-414z9nnj1wy66ymq6vgb693x9xjz6hf2-nixpkgs-src/pkgs/top-level/perl-packages.nix:12079:15
      |
12079 |     doCheck = false && !stdenv.isDarwin;
      |               ^^^^^^^^^^^^^^^^^^^^^^^^^

warning[W008]: this code will never be executed
     --> /nix/store/qz3gjn95gazab4fkb7s8lm6hz17rdzzy-414z9nnj1wy66ymq6vgb693x9xjz6hf2-nixpkgs-src/pkgs/top-level/perl-packages.nix:12079:24
      |
12079 |     doCheck = false && !stdenv.isDarwin;
      |                        ^^^^^^^^^^^^^^^^
```

The place invoking `compile_dead_code` has more context to why the code
is unused, so it's error message is much more useful.

Stop emitting the less informative warning inside compile_dead_code
(W008), and update the comment that we expect the caller to emit a
warning.

I kept W008 itself still around, in case we end up having places this
will get used again.

Change-Id: I2c5d84fc0cb4035872cd4b71cc3e9e34e120eb37
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8024
Tested-by: BuildkiteCI
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
2023-03-11 14:26:49 +00:00
..
builtins refactor(tvix/eval): remove VM argument from suspended native thunks 2023-03-04 15:53:36 +00:00
compiler feat(tvix/eval): don't warn twice about dead code 2023-03-11 14:26:49 +00:00
tests fix(tvix/eval): skip runtime completely on compiler errors 2023-02-13 16:21:47 +00:00
value feat(tvix/eval): introduce generators module 2023-03-07 22:04:59 +00:00
vm feat(tvix/eval): introduce generators module 2023-03-07 22:04:59 +00:00
chunk.rs refactor(tvix/eval): enhance debug output for bytecode dumps 2023-03-03 10:52:48 +00:00
errors.rs fix(tvix/eval): make fields of eval's Error type public 2023-02-13 16:21:46 +00:00
io.rs chore(tvix/eval): only use Rc with impure feature 2023-02-03 18:58:17 +00:00
lib.rs refactor(tvix/eval): insert storeDir "builtin" in eval startup 2023-03-04 15:53:36 +00:00
nix_search_path.rs fix(tvix/eval): fix current clippy warnings 2022-12-25 18:25:06 +00:00
observer.rs fix(tvix/eval): correctly print lambda address in observer 2023-02-14 08:02:40 +00:00
opcode.rs refactor(tvix/eval): merge OpCall & OpTailCall 2023-03-07 22:04:59 +00:00
pretty_ast.rs fix(tvix/eval): fix current clippy warnings 2022-12-25 18:25:06 +00:00
properties.rs refactor(tvix/eval): Don't (ab)use PartialEq for Nix equality 2022-09-18 22:03:41 +00:00
source.rs chore(tvix/eval): implement std::error::Error for tvix_eval::Error 2023-01-02 22:24:43 +00:00
spans.rs refactor(tvix/eval): implement From<Span> for LightSpan 2023-03-04 15:18:37 +00:00
systems.rs fix(tvix/eval): fix current clippy warnings 2022-12-25 18:25:06 +00:00
test_utils.rs test(tvix/eval): Add proof-of-concept test for Chunk 2022-09-18 17:55:06 +00:00
upvalues.rs fix(tvix/eval): remove impl PartialEq for Value 2022-11-04 00:30:13 +00:00
vm.rs feat(tvix/eval): introduce generators module 2023-03-07 22:04:59 +00:00
warnings.rs chore(tvix/eval): delete "useless parenthesis" warning/optimisation 2023-01-23 17:59:06 +00:00