def METHOD_NAME(self, crate_type: CrateType, save_output: bool = False,
            extra_args: List[str] = []) -> Optional[LocalCommand]:
    current_dir, _ = os.path.split(self.path)
    extensionless_file, _ = os.path.splitext(self.path)
    # run rustc
    args = [
        "--crate-type={}".format(crate_type.value),
        "-L",
        current_dir
    ] + extra_args
    if save_output:
        args.append('-o')
        if crate_type == CrateType.Binary:
            args.append(extensionless_file)
        else:
            # REVIEW: Not sure if ext is correct
            args.append(extensionless_file + ".lib")
    args.append(self.path)
    # log the command in a format that's easy to re-run
    logging.debug("rustc compile command: %s", str(rustc[args]))
    retcode, stdout, stderr = rustc[args].run(retcode=None)
    logging.debug("stdout:\n%s", stdout)
    if retcode != 0:
        raise NonZeroReturn(stderr)
    if save_output:
        if crate_type == CrateType.Binary:
            return get_cmd_or_die(extensionless_file)
        # TODO: Support saving lib file
    return None