Repository: intellij-rust/intellij-rust
Issue: `yield` syntax is experimental error with multiple features

This code shows no errors in the editor, as expected:

```rust
#![feature(generators)]

fn main() {
    let _generator = || {
        yield 1_u32;
    };
}
```

However, if you add more features next to the `generators` feature line, then an erroneous error is shown, as in the following:

```rust
#![feature(generators, box_syntax)] // <- another feature added to the same line

fn main() {
    let _generator = || {
        yield 1_u32; // `yield` syntax is experimental error
    };
}
```

## Environment

* **Intellij-Rust plugin version:** 0.2.97.2123-191
* **Rust toolchain version:** rustc 1.36.0-nightly (7d5aa4332 2019-05-16)
* **IDE name and version:** CLion 2019.1.2
* **Operating system:** Windows 10 x64

Changed files:
src/main/kotlin/org/rust/lang/core/stubs/index/RsFeatureIndex.kt, src/main/kotlin/org/rust/lang/core/stubs/StubImplementations.kt, src/test/kotlin/org/rust/ide/annotator/RsErrorAnnotatorTest.kt

diff --git a/src/main/kotlin/org/rust/lang/core/stubs/StubImplementations.kt b/src/main/kotlin/org/rust/lang/core/stubs/StubImplementations.kt
index 4365a16ba..e696a06a5 100644
--- a/src/main/kotlin/org/rust/lang/core/stubs/StubImplementations.kt
+++ b/src/main/kotlin/org/rust/lang/core/stubs/StubImplementations.kt
@@ -35,7 +35,7 @@ class RsFileStub : PsiFileStubImpl<RsFile> {
 
     object Type : IStubFileElementType<RsFileStub>(RsLanguage) {
         // Bump this number if Stub structure changes
-        override fun getStubVersion(): Int = 164
+        override fun getStubVersion(): Int = 165
 
         override fun getBuilder(): StubBuilder = object : DefaultStubBuilder() {
             override fun createStubForFile(file: PsiFile): StubElement<*> = RsFileStub(file as RsFile)
diff --git a/src/main/kotlin/org/rust/lang/core/stubs/index/RsFeatureIndex.kt b/src/main/kotlin/org/rust/lang/core/stubs/index/RsFeatureIndex.kt
index 0aa6adafc..ae19c39bf 100644
--- a/src/main/kotlin/org/rust/lang/core/stubs/index/RsFeatureIndex.kt
+++ b/src/main/kotlin/org/rust/lang/core/stubs/index/RsFeatureIndex.kt
@@ -28,8 +28,11 @@ class RsFeatureIndex : StringStubIndexExtension<RsInnerAttr>() {
         fun index(stub: RsInnerAttrStub, sink: IndexSink) {
             val metaItem = stub.psi.metaItem
             if (metaItem.name == "feature") {
-                val featureName = metaItem.metaItemArgs?.metaItemList?.singleOrNull()?.name ?: return
-                sink.occurrence(KEY, featureName)
+                val features = metaItem.metaItemArgs?.metaItemList.orEmpty()
+                for (feature in features) {
+                    val featureName = feature.name ?: continue
+                    sink.occurrence(KEY, featureName)
+                }
             }
         }
 
diff --git a/src/test/kotlin/org/rust/ide/annotator/RsErrorAnnotatorTest.kt b/src/test/kotlin/org/rust/ide/annotator/RsErrorAnnotatorTest.kt
index 6663d08e5..1fa0dac1b 100644
--- a/src/test/kotlin/org/rust/ide/annotator/RsErrorAnnotatorTest.kt
+++ b/src/test/kotlin/org/rust/ide/annotator/RsErrorAnnotatorTest.kt
@@ -1326,6 +1326,18 @@ class RsErrorAnnotatorTest : RsAnnotatorTestBase(RsErrorAnnotator::class.java) {
         }
     """)
 
+    @MockRustcVersion("1.21.0-nightly")
+    fun `test yield syntax feature E0658 3`() = checkErrors("""
+        #![feature(generators, box_syntax)]
+
+        fn main() {
+            let mut generator = || {
+                yield 1;
+                return "foo"
+            };
+        }
+    """)
+
     @MockRustcVersion("1.0.0")
     fun `test box expression feature E0658 1`() = checkErrors("""
         struct S;