Add source collision test, rust_bindgen doc.

Bug: 159064919
Test: Soong tests pass (and fail if error is modified).
Change-Id: Id4f76e53e11e46ae495f9613a2699c598e7daea4
diff --git a/rust/builder.go b/rust/builder.go
index d1d1012..4872709 100644
--- a/rust/builder.go
+++ b/rust/builder.go
@@ -219,15 +219,16 @@
 	}
 
 	if len(deps.SrcDeps) > 0 {
-		moduleGenDir := android.PathForModuleOut(ctx, "out/")
+		genSubDir := "out/"
+		moduleGenDir := android.PathForModuleOut(ctx, genSubDir)
 		var outputs android.WritablePaths
 
 		for _, genSrc := range deps.SrcDeps {
-			if android.SuffixInList(outputs.Strings(), "out/"+genSrc.Base()) {
+			if android.SuffixInList(outputs.Strings(), genSubDir+genSrc.Base()) {
 				ctx.PropertyErrorf("srcs",
 					"multiple source providers generate the same filename output: "+genSrc.Base())
 			}
-			outputs = append(outputs, android.PathForModuleOut(ctx, "out/"+genSrc.Base()))
+			outputs = append(outputs, android.PathForModuleOut(ctx, genSubDir+genSrc.Base()))
 		}
 
 		ctx.Build(pctx, android.BuildParams{