Subject: bug#15326: 24.3; Incorrect "variable not left unused" in destructuring cl-loop

From: Christopher Wellons <[email-masked]>
Date: Wed, 11 Sep 2013 00:47:54 -0400

Stefan Monnier <[email-masked]> writes:
> A `setq' does not *use* a variable.  It just sets it, affecting
> later uses.

I mean that the compiler counts the setq as a use even in this simple
expression:

    (let (_)
      (setq _ t))
    ;; Warning: variable `_' not left unused

> If there's no later uses, the setq is just a no-op.

Without bothering to dig into the bytecode for it, it seems that the
compiler is still emitting code for the setq:

    (defun foo ()
      (let (_)
        (setq _ t)))

    (defun bar ()
      (let (_)))

    (equal (byte-compile 'foo)
           (byte-compile 'bar))
    ;; => nil

Maybe I'm not understanding what you mean by "no-op" here.