W1001

W1001 — Unused variable binding

What the compiler reports

W1001
[parallel-frontend] emitted module with -j 2
exit=0

The fragments the test suite holds the compiler to. An ellipsis marks text the test does not constrain; the emitted message also carries a source location.

A program that triggers it

//
// Part of the Vx Project, under the Apache License v2.0 with LLVM Exceptions.
// See LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
// The parallel frontend holds its warnings until it knows its output will be used, so that a
// program it declines does not have them printed twice. This program is inside the flat subset,
// so nothing else compiles it and nothing else would print them: if the held warnings were
// dropped rather than printed, the compile would go quiet about a binding the programmer left
// unused.
//

fn main() -> i32 {
  let unused_here = 5;
  return 0;
}

From tests/frontend/pass/jobs_warns_on_the_path_it_took.vx, which asserts this diagnostic on every commit.

Related