From f8453e4a0af24d35a020c213f7c76abd5671f169 Mon Sep 17 00:00:00 2001
From: Connor Skees <connor1skees@gmail.com>
Date: Wed, 15 Jul 2020 13:20:50 -0400
Subject: [PATCH] disallow interpolation in the name of mixin declarations

---
 src/parse/mixin.rs |  2 +-
 tests/mixins.rs    | 11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/parse/mixin.rs b/src/parse/mixin.rs
index e9868b9..1e3466c 100644
--- a/src/parse/mixin.rs
+++ b/src/parse/mixin.rs
@@ -17,7 +17,7 @@ use super::{common::ContextFlags, Parser, Stmt};
 impl<'a> Parser<'a> {
     pub(super) fn parse_mixin(&mut self) -> SassResult<()> {
         self.whitespace();
-        let Spanned { node: name, span } = self.parse_identifier()?;
+        let Spanned { node: name, span } = self.parse_identifier_no_interpolation(false)?;
 
         if self.flags.in_mixin() {
             return Err(("Mixins may not contain mixin declarations.", span).into());
diff --git a/tests/mixins.rs b/tests/mixins.rs
index 266a820..5d58f6a 100644
--- a/tests/mixins.rs
+++ b/tests/mixins.rs
@@ -478,3 +478,14 @@ error!(
     }",
     "Error: Mixins may not be declared in control directives."
 );
+error!(
+    does_not_allow_interpolation_in_name_of_declaration,
+    "@mixin n#{a}me {
+        color: red;
+    }
+
+    a {
+        @include name;
+    }",
+    "Error: expected \"{\"."
+);