From 6cf57c1eaa8e7148a57c88c545d27de78e5faf43 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Mon, 22 Jun 2026 13:17:43 +0100 Subject: [PATCH 1/5] Fix #6863 --- src/check_expr.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 24ee86810..cd38ff69a 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -10179,6 +10179,10 @@ gb_internal ExprKind check_or_branch_expr(CheckerContext *c, Operand *o, Ast *no } } + if (c->in_defer) { + error(node, "'%.*s' cannot be used within a 'defer'", LIT(name)); + } + return Expr_Expr; } From 778d3b97b68fd06dc165986a79c1eba298374fdf Mon Sep 17 00:00:00 2001 From: Jeroen van Rijn Date: Mon, 22 Jun 2026 15:40:21 +0200 Subject: [PATCH 2/5] Add comment to `odin root` about why there's no newline Add comment to `odin root` about why there's no newline, and why we closed #6834 and #6871. Future such pull requests will be closed without comment. --- src/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 3a72c2a9c..75640809e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3842,6 +3842,10 @@ int main(int arg_count, char const **arg_ptr) { usage(args[0]); return 1; } + // NOTE(Jeroen): `odin root` omits it on purpose so that it can be used in scripts. + // e.g. `ODIN_CORE="$(odin root)core"`. + // Human convenience is not a consideration. + // Further pull requests to a newline will be closed without comment. gb_printf("%.*s", LIT(odin_root_dir())); return 0; } else if (command == "clear-cache") { From 8148b04a6cc12d0b0bfffcdabce4f03962662535 Mon Sep 17 00:00:00 2001 From: Jeroen van Rijn Date: Mon, 22 Jun 2026 15:44:11 +0200 Subject: [PATCH 3/5] Add missing word. --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 75640809e..6932d029f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3845,7 +3845,7 @@ int main(int arg_count, char const **arg_ptr) { // NOTE(Jeroen): `odin root` omits it on purpose so that it can be used in scripts. // e.g. `ODIN_CORE="$(odin root)core"`. // Human convenience is not a consideration. - // Further pull requests to a newline will be closed without comment. + // Further pull requests to add a newline will be closed without comment. gb_printf("%.*s", LIT(odin_root_dir())); return 0; } else if (command == "clear-cache") { From 6bae6eb3f1f8f2b62f1e763814888657ac25d2f2 Mon Sep 17 00:00:00 2001 From: Jeroen van Rijn Date: Mon, 22 Jun 2026 15:46:02 +0200 Subject: [PATCH 4/5] Clarify "it" --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 6932d029f..51dade656 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3842,7 +3842,7 @@ int main(int arg_count, char const **arg_ptr) { usage(args[0]); return 1; } - // NOTE(Jeroen): `odin root` omits it on purpose so that it can be used in scripts. + // NOTE(Jeroen): `odin root` omits a newline on purpose so that it can be used in scripts. // e.g. `ODIN_CORE="$(odin root)core"`. // Human convenience is not a consideration. // Further pull requests to add a newline will be closed without comment. From d16a37e649a332ddd980effc332b2da3f4a15275 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Mon, 22 Jun 2026 15:41:43 +0100 Subject: [PATCH 5/5] Add warning to help very large return values (partially fixes #6568) --- src/checker.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/checker.cpp b/src/checker.cpp index 2f66d3e60..0624c65ac 100644 --- a/src/checker.cpp +++ b/src/checker.cpp @@ -791,7 +791,10 @@ gb_internal void check_scope_usage_internal(Checker *c, Scope *scope, u64 vet_fl array_add(&vetted_entities, ve_unused); } else if (is_shadowed) { array_add(&vetted_entities, ve_shadowed); - } else if (e->kind == Entity_Variable && (e->flags & (EntityFlag_Param|EntityFlag_Using|EntityFlag_Static|EntityFlag_Field)) == 0 && !e->Variable.is_global) { + } else if (e->kind == Entity_Variable && + ((e->flags & (EntityFlag_Param|EntityFlag_Using|EntityFlag_Static|EntityFlag_Field)) == 0 || + (e->flags & EntityFlag_Result) != 0) && + !e->Variable.is_global) { i64 sz = type_size_of(e->type); // TODO(bill): When is a good size warn? // Is >256 KiB good enough?