What does “Looking for a function” mean?

sometimes when doing release builds with the new 5.9 toolchain, i get some debug-ish compiler output that looks like:

Looking for a function: $s5MongoAAO0A6DriverE7SessionC3run7command7against2on2by4withq_x_8DatabaseQzAbCE14ReadPreferenceOs15ContinuousClockV7InstantVSgq_AbCE6CursorVy_7ElementQzGYaKXEtYaKAC0A15IterableCommandRzr0_lFAB0A7LibraryE4FindVy_AVy_8UnidocDB13PackageRecordVGG_ytTg5
Expected type: @convention(method) @async (@guaranteed Mongo.Find<Mongo.Cursor<PackageRecord>>, @guaranteed Mongo.Database, @guaranteed Mongo.ReadPreference, @in_guaranteed Optional<ContinuousClock.Instant>, @guaranteed @noescape @async @callee_guaranteed @substituted <τ_0_0, τ_0_1 where τ_0_0 : BSONDecodable, τ_0_0 : Sendable> (@guaranteed Mongo.Cursor<τ_0_0>) -> (@out τ_0_1, @error Error) for <PackageRecord, ()>, @guaranteed Mongo.Session) -> (@out (), @error Error)
Found    type: @convention(method) @async (@guaranteed Mongo.Find<Mongo.Cursor<PackageRecord>>, @guaranteed Mongo.Database, @guaranteed Mongo.ReadPreference, @in_guaranteed Optional<ContinuousClock.Instant>, @guaranteed @noescape @async @callee_guaranteed @substituted <τ_0_0, τ_0_1 where τ_0_0 : BSONDecodable, τ_0_0 : Sendable> (@guaranteed Mongo.Cursor<τ_0_0>) -> (@out τ_0_1, @error Error) for <PackageRecord, ()>, @guaranteed Mongo.Session) -> (@out (), @error Error)
Looking for a function: $s5MongoAAO0A7LibraryE4FindVACs5NeverOSg6StrideRtzAG7TailingRtzrlE_11readConcern5limit4skip4withAEy_xGAB0A6SchemaE10CollectionV_AB0A6DriverE04ReadH0OSgS2iSgyAQzKXEtKcfCAbCE11SingleBatchOy_8UnidocDB13PackageRecordVG_Tg5
Expected type: @convention(method) (@owned Mongo.Collection, Optional<Mongo.ReadConcern>, Int, Optional<Int>, @guaranteed @noescape @callee_guaranteed @substituted <τ_0_0 where τ_0_0 : MongoReadEffect> (@inout Mongo.Find<τ_0_0>) -> @error Error for <Mongo.SingleBatch<PackageRecord>>, @thin Mongo.Find<Mongo.SingleBatch<PackageRecord>>.Type) -> (@owned Mongo.Find<Mongo.SingleBatch<PackageRecord>>, @error Error)
Found    type: @convention(method) (@owned Mongo.Collection, Optional<Mongo.ReadConcern>, Int, Optional<Int>, @guaranteed @noescape @callee_guaranteed @substituted <τ_0_0 where τ_0_0 : MongoReadEffect> (@inout Mongo.Find<τ_0_0>) -> @error Error for <Mongo.SingleBatch<PackageRecord>>, @thin Mongo.Find<Mongo.SingleBatch<PackageRecord>>.Type) -> (@owned Mongo.Find<Mongo.SingleBatch<PackageRecord>>, @error Error)

what does this output mean, and are we supposed to be seeing it?

Appears to be coming from the GenericsSpecializer in the SIL optimization pipeline. The fact that you're seeing this output is indicative of a condition that would cause an assertion failure with an asserts build of the compiler so I think this is worth filing a GitHub issue about. Is the project you're building something that a compiler engineer would be able to try building?

the project, swift-unidoc, is open source, and the message has been showing up in CI logs for the past few commits or so.