mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 09:31:04 +01:00
Implement unused pattern bindings, continued (#6518)
Implementation of unused pattern bindings #2022, continued. Whereas previous PR #6460 took care of parsing, and PR #6479 prepared the stage by using _ in some test cases, this PR has the the actual implementation, using a simple dataflow analysis. --------- Co-authored-by: Burak Emir <bqe@google.com> Co-authored-by: jonmeow <jperkins@google.com>
This commit is contained in:
co-authored by
Burak Emir
jonmeow
parent
bea24a8bee
commit
fdb188ccfd
+4
-4
@@ -32,7 +32,7 @@ class B {}
|
||||
class C {}
|
||||
|
||||
impl A as Action(B) {
|
||||
fn Op[self: Self]() {}
|
||||
fn Op[unused self: Self]() {}
|
||||
}
|
||||
|
||||
fn F(a: A) { a.(Action(B).Op)(); }
|
||||
@@ -514,9 +514,9 @@ fn InstanceC(a: A) -> C {
|
||||
// CHECK:STDOUT: %Main.import_ref.450 = import_ref Main//action, inst{{[0-9A-F]+}} [no loc], unloaded
|
||||
// CHECK:STDOUT: %Main.import_ref.d04: type = import_ref Main//action, loc12_6, loaded [concrete = constants.%A]
|
||||
// CHECK:STDOUT: %Main.import_ref.5ad: type = import_ref Main//action, loc12_19, loaded [concrete = constants.%Action.type.879]
|
||||
// CHECK:STDOUT: %Main.import_ref.018 = import_ref Main//action, loc13_23, unloaded
|
||||
// CHECK:STDOUT: %Main.import_ref.018 = import_ref Main//action, loc13_30, unloaded
|
||||
// CHECK:STDOUT: %Main.import_ref.04b = import_ref Main//action, loc5_22, unloaded
|
||||
// CHECK:STDOUT: %Main.import_ref.4e3: %A.as.Action.impl.Op.type = import_ref Main//action, loc13_23, loaded [concrete = constants.%A.as.Action.impl.Op]
|
||||
// CHECK:STDOUT: %Main.import_ref.4e3: %A.as.Action.impl.Op.type = import_ref Main//action, loc13_30, loaded [concrete = constants.%A.as.Action.impl.Op]
|
||||
// CHECK:STDOUT: %Action.impl_witness_table = impl_witness_table (%Main.import_ref.4e3), @A.as.Action.impl [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -706,7 +706,7 @@ fn InstanceC(a: A) -> C {
|
||||
// CHECK:STDOUT: %Main.import_ref.450 = import_ref Main//action, inst{{[0-9A-F]+}} [no loc], unloaded
|
||||
// CHECK:STDOUT: %Main.import_ref.d04: type = import_ref Main//action, loc12_6, loaded [concrete = constants.%A]
|
||||
// CHECK:STDOUT: %Main.import_ref.5ad: type = import_ref Main//action, loc12_19, loaded [concrete = constants.%Action.type.879]
|
||||
// CHECK:STDOUT: %Main.import_ref.018 = import_ref Main//action, loc13_23, unloaded
|
||||
// CHECK:STDOUT: %Main.import_ref.018 = import_ref Main//action, loc13_30, unloaded
|
||||
// CHECK:STDOUT: %Main.import_ref.8f24d3.3: <witness> = import_ref Main//action, loc10_10, loaded [concrete = constants.%complete_type]
|
||||
// CHECK:STDOUT: %Main.import_ref.743 = import_ref Main//action, inst{{[0-9A-F]+}} [no loc], unloaded
|
||||
// CHECK:STDOUT: %Main.import_ref.04b = import_ref Main//action, loc5_22, unloaded
|
||||
|
||||
Reference in New Issue
Block a user