rust: Fix rust_bindgen implicits

rust_bindgen implicits currently include dependency-exported include
directories. This is incorrect, and causes issues when the include
directory is a generated directory.

Instead, remove the dependency-exported include directories from the
implicits list, and also add dependency-exported headers to the
implicits to handle these correctly.

Bug: 166779501
Test: Rust projects continue to build, test-case no longer failing.
Change-Id: Ia2da25de9e712b7306f19603dc9d14de6bac3fb3
diff --git a/rust/rust.go b/rust/rust.go
index 5c6cdb7..4cba6d6 100644
--- a/rust/rust.go
+++ b/rust/rust.go
@@ -258,6 +258,7 @@
 	// Used by bindgen modules which call clang
 	depClangFlags         []string
 	depIncludePaths       android.Paths
+	depGeneratedHeaders   android.Paths
 	depSystemIncludePaths android.Paths
 
 	coverageFiles android.Paths
@@ -875,6 +876,7 @@
 				if mod, ok := ccDep.(*cc.Module); ok {
 					depPaths.depSystemIncludePaths = append(depPaths.depSystemIncludePaths, mod.ExportedSystemIncludeDirs()...)
 					depPaths.depClangFlags = append(depPaths.depClangFlags, mod.ExportedFlags()...)
+					depPaths.depGeneratedHeaders = append(depPaths.depGeneratedHeaders, mod.ExportedGeneratedHeaders()...)
 				}
 				depPaths.coverageFiles = append(depPaths.coverageFiles, ccDep.CoverageFiles()...)
 				directStaticLibDeps = append(directStaticLibDeps, ccDep)
@@ -886,6 +888,7 @@
 				if mod, ok := ccDep.(*cc.Module); ok {
 					depPaths.depSystemIncludePaths = append(depPaths.depSystemIncludePaths, mod.ExportedSystemIncludeDirs()...)
 					depPaths.depClangFlags = append(depPaths.depClangFlags, mod.ExportedFlags()...)
+					depPaths.depGeneratedHeaders = append(depPaths.depGeneratedHeaders, mod.ExportedGeneratedHeaders()...)
 				}
 				directSharedLibDeps = append(directSharedLibDeps, ccDep)
 				mod.Properties.AndroidMkSharedLibs = append(mod.Properties.AndroidMkSharedLibs, depName)