Skip to content

Commit 875933e

Browse files
committed
reword "boundary use" to just "non-consuming"
1 parent 1696769 commit 875933e

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

include/swift/AST/DiagnosticsSIL.def

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -779,8 +779,6 @@ ERROR(sil_moveonlychecker_cannot_destructure_has_deinit, none,
779779

780780
NOTE(sil_moveonlychecker_partial_consume_here, none,
781781
"partial consume here", ())
782-
NOTE(sil_moveonlychecker_boundary_use, none,
783-
"boundary use here", ())
784782
NOTE(sil_moveonlychecker_consuming_use_here, none,
785783
"consuming use here", ())
786784
NOTE(sil_moveonlychecker_other_consuming_use_here, none,
@@ -791,8 +789,14 @@ NOTE(sil_moveonlychecker_consuming_and_non_consuming_uses_here, none,
791789
"consuming and non-consuming uses here", ())
792790
NOTE(sil_moveonlychecker_consuming_closure_use_here, none,
793791
"closure capture here", ())
792+
793+
// TODO: a lot of these "non-consuming use" notes are just emitted to point out
794+
// an "invalid use after consume". I'd say most of them are for that.
795+
// In the other narrow cases where that's not quite right, we could go with
796+
// something vague like "use here"
794797
NOTE(sil_moveonlychecker_nonconsuming_use_here, none,
795798
"non-consuming use here", ())
799+
796800
NOTE(sil_movekillscopyablevalue_value_cyclic_consumed_in_loop_here, none,
797801
"consuming in loop use here", ())
798802
NOTE(sil_moveonlychecker_deinit_here, none,

lib/SILOptimizer/Mandatory/MoveOnlyDiagnostics.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ void DiagnosticEmitter::emitObjectDestructureNeededWithinBorrowBoundary(
563563
[&](unsigned index) { return pair.second.test(index); })) {
564564
LLVM_DEBUG(llvm::dbgs()
565565
<< " Destructure Boundary Use: " << *pair.first);
566-
diagnose(astContext, pair.first, diag::sil_moveonlychecker_boundary_use);
566+
diagnose(astContext, pair.first, diag::sil_moveonlychecker_nonconsuming_use_here);
567567
}
568568
}
569569
registerDiagnosticEmitted(markedValue);

test/SILOptimizer/moveonly_borrow_to_destructure_transform_diagnostics.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ bb0(%0 : @guaranteed $AggStruct2):
7878
destroy_value %2 : $AggStruct2
7979
%9 = function_ref @moveonlyklass_consume : $@convention(thin) (@owned MoveOnlyKlass) -> ()
8080
apply %9(%7) : $@convention(thin) (@owned MoveOnlyKlass) -> () // expected-note {{partial consume here}}
81-
apply %9(%7a) : $@convention(thin) (@owned MoveOnlyKlass) -> () // expected-note {{boundary use here}}
81+
apply %9(%7a) : $@convention(thin) (@owned MoveOnlyKlass) -> () // expected-note {{non-consuming use here}}
8282
%9999 = tuple()
8383
return %9999 : $()
8484
}

test/SILOptimizer/moveonly_objectchecker_diagnostics.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4184,7 +4184,7 @@ func testStructContainingEmptyStruct() {
41844184
func testGuaranteedArg7a(_ x: borrowing StructContainingEmptyStruct) {
41854185
// expected-error @-1 {{cannot use 'x' after partial consume}}
41864186
x.x.doSomething3() // expected-note {{partial consume here}}
4187-
x.x.doSomething3() // expected-note {{boundary use here}}
4187+
x.x.doSomething3() // expected-note {{non-consuming use here}}
41884188
}
41894189
}
41904190

0 commit comments

Comments
 (0)