2
3
Fork
You've already forked ncsu
0

fix new "var never mutated" error on Zig 0.12.0-dev.1663+6b1a823b2 #231

Closed
BratishkaErik wants to merge 0 commits from refs/pull/231/head into zig
pull from: refs/pull/231/head
merge into: selfisekai:zig
selfisekai:zig
selfisekai:zig0.16
selfisekai:master
selfisekai:zig-threaded
selfisekai:openat
selfisekai:chdir
selfisekai:clear
selfisekai:compll
BratishkaErik commented 2023年11月20日 09:46:18 +01:00 (Migrated from code.blicky.net)
Copy link

Fixes these errors (introduced in https://github.com/ziglang/zig/pull/18017
and github.com/ziglang/zig@6b1a823b2b ):

src/main.zig:290:13: error: local variable is never mutated
 var line_ = line_fbs.getWritten();
 ^~~~~
src/main.zig:290:13: note: consider using 'const'
src/main.zig:450:17: error: local variable is never mutated
 var path = std.fs.path.joinZ(allocator, &.{p, "ncdu", "config"}) catch unreachable;
 ^~~~
src/main.zig:450:17: note: consider using 'const'
...

Will be included in future Zig 0.12, this fix is backward compatible:
ncdu still builds and runs fine on Zig 0.11.0.

Signed-off-by: Eric Joldasov bratishkaerik@getgoogleoff.me

Fixes these errors (introduced in https://github.com/ziglang/zig/pull/18017 and https://github.com/ziglang/zig/commit/6b1a823b2b30d9318c9877dbdbd3d02fa939fba0 ): ``` src/main.zig:290:13: error: local variable is never mutated var line_ = line_fbs.getWritten(); ^~~~~ src/main.zig:290:13: note: consider using 'const' src/main.zig:450:17: error: local variable is never mutated var path = std.fs.path.joinZ(allocator, &.{p, "ncdu", "config"}) catch unreachable; ^~~~ src/main.zig:450:17: note: consider using 'const' ... ``` Will be included in future Zig 0.12, this fix is backward compatible: ncdu still builds and runs fine on Zig 0.11.0. Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
yorhel commented 2023年11月20日 09:59:14 +01:00 (Migrated from code.blicky.net)
Copy link

Pulled.

(I still have this faint hope that they'll eventually change silly lint issues into warnings instead of their current insistence on a -Werror approach. shrug)

Pulled. (I still have this faint hope that they'll eventually change silly lint issues into warnings instead of their current insistence on a `-Werror` approach. *shrug*)
BratishkaErik commented 2023年11月20日 10:12:30 +01:00 (Migrated from code.blicky.net)
Copy link

Pulled.

(I still have this faint hope that they'll eventually change silly lint issues into warnings instead of their current insistence on a -Werror approach. shrug)

Well, ZLS has some collection of autofixes for these (削除) warnings (削除ここまで) errors, but yes, it's rather unfortunate...

> Pulled. > > (I still have this faint hope that they'll eventually change silly lint issues into warnings instead of their current insistence on a `-Werror` approach. *shrug*) Well, ZLS has some collection of autofixes for these ~~warnings~~ errors, but yes, it's rather unfortunate...

Pull request closed

This pull request cannot be reopened because the branch was deleted.
Sign in to join this conversation.
No reviewers
No labels
1.x
2.x
bug
feature
imported
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
selfisekai/ncsu!231
Reference in a new issue
selfisekai/ncsu
No description provided.
Delete branch "refs/pull/231/head"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?