Autolinking Rust package names doesn't work with inline tables

Summary

If a Rust dependency is using inline tables syntax, they don't get automatically linked. For example:

serde = { version = "1.0.104", features = ["derive"] }

This doesn't happen when using [dependencies.serde] syntax.

Steps to reproduce

Check out https://gitlab.com/pastebinrun/pastebinrun/blob/4fd763a5a3c074c8d8f983e16c214b595b112b41/Cargo.toml. Notice serde is not being linked.

Example Project

https://gitlab.com/pastebinrun/pastebinrun/blob/4fd763a5a3c074c8d8f983e16c214b595b112b41/Cargo.toml

What is the current bug behavior?

serde package is not linked

What is the expected correct behavior?

serde package should be linked.

Relevant logs and/or screenshots

image

Output of checks

This bug happens on GitLab.com

Possible fixes

(If you can, link to the line of code that might be responsible for the problem)

https://gitlab.com/gitlab-org/gitlab/blob/67d0d86f4547d7242a2938c4dd547e27ea291e20/lib/gitlab/dependency_linker/cargo_toml_linker.rb#L33

Edited by 🤖 GitLab Bot 🤖