diff --git a/highfive/configs/rust-lang/rust.json b/highfive/configs/rust-lang/rust.json
index f056f32..0f62ab3 100644
--- a/highfive/configs/rust-lang/rust.json
+++ b/highfive/configs/rust-lang/rust.json
@@ -5,7 +5,6 @@
             "@estebank",
             "@matthewjasper",
             "@petrochenkov",
-            "@varkor",
             "@davidtwco",
             "@oli-obk",
             "@nagisa"
diff --git a/highfive/newpr.py b/highfive/newpr.py
index 60c56cf..8b00b72 100644
--- a/highfive/newpr.py
+++ b/highfive/newpr.py
@@ -33,7 +33,7 @@ surprise_branch_warning = "Pull requests are usually filed against the %s branch
 review_with_reviewer = 'r? @%s\n\n(rust-highfive has picked a reviewer for you, use r? to override)'
 review_without_reviewer = '@%s: no appropriate reviewer found, use r? to override'
 
-reviewer_re = re.compile("\\b[rR]\?[:\- ]*@([a-zA-Z0-9\-]+)")
+reviewer_re = re.compile("\\b[rR]\?[:\- ]*@(?:([a-zA-Z0-9\-]+)/)?([a-zA-Z0-9\-]+)")
 submodule_re = re.compile(".*\+Subproject\scommit\s.*", re.DOTALL | re.MULTILINE)
 target_re = re.compile("^[+-]{3} [ab]/compiler/rustc_target/src/spec/", re.MULTILINE)
 
@@ -230,27 +230,46 @@ class HighfiveHandler(object):
             else:
                 raise e
 
-    def find_reviewer(self, msg):
+    def get_groups(self):
+        groups = deepcopy(self.repo_config['groups'])
+
+        # fill in the default groups, ensuring that overwriting is an
+        # error.
+        global_ = self._load_json_file('_global.json')
+        for name, people in global_['groups'].items():
+            assert name not in groups, "group %s overlaps with _global.json" % name
+            groups[name] = people
+
+        return groups
+
+    def find_reviewer(self, msg, exclude):
         """
         If the user specified a reviewer, return the username, otherwise returns
         None.
         """
         if msg is not None:
             match = reviewer_re.search(msg)
-            return match.group(1) if match else None
+            if match:
+                if match.group(1):
+                    # assign someone from the specified team
+                    groups = self.get_groups()
+                    potential = groups.get(match.group(2))
+                    if potential is None:
+                        potential = groups.get("%s/%s" % (match.group(1), match.group(2)))
+                    if potential is None:
+                        potential = groups["all"]
+                    else:
+                        potential.extend(groups["all"])
+
+                    return self.pick_reviewer(groups, potential, exclude)
+                else:
+                    return match.group(2)
 
     def choose_reviewer(self, repo, owner, diff, exclude):
         """Choose a reviewer for the PR."""
         # Get JSON data on reviewers.
         dirs = self.repo_config.get('dirs', {})
-        groups = deepcopy(self.repo_config['groups'])
-
-        # fill in the default groups, ensuring that overwriting is an
-        # error.
-        global_ = self._load_json_file('_global.json')
-        for name, people in global_['groups'].items():
-            assert name not in groups, "group %s overlaps with _global.json" % name
-            groups[name] = people
+        groups = self.get_groups()
 
         most_changed = None
         # If there's directories with specially assigned groups/users
@@ -293,6 +312,9 @@ class HighfiveHandler(object):
         if not potential:
             potential = groups['core']
 
+        return self.pick_reviewer(groups, potential, exclude)
+
+    def pick_reviewer(self, groups, potential, exclude):
         # expand the reviewers list by group
         reviewers = []
         seen = {"all"}
@@ -382,7 +404,7 @@ class HighfiveHandler(object):
         if not self.payload['pull_request', 'assignees']:
             # Only try to set an assignee if one isn't already set.
             msg = self.payload['pull_request', 'body']
-            reviewer = self.find_reviewer(msg)
+            reviewer = self.find_reviewer(msg, author)
             post_msg = False
 
             if not reviewer:
@@ -437,7 +459,7 @@ class HighfiveHandler(object):
 
         # Check for r? and set the assignee.
         msg = self.payload['comment', 'body']
-        reviewer = self.find_reviewer(msg)
+        reviewer = self.find_reviewer(msg, author)
         if reviewer:
             issue = str(self.payload['issue', 'number'])
             self.set_assignee(

diff --git a/highfive/tests/fakes.py b/highfive/tests/fakes.py
index ec7cf8f..7fb5604 100644
--- a/highfive/tests/fakes.py
+++ b/highfive/tests/fakes.py
@@ -75,6 +75,9 @@ def get_repo_configs():
                     "reviewers": ["@JohnTitor"],
                 }
             }
+        },
+        'teams': {
+            "groups": {"all": [], "a": ["@pnkfelix"], "b/c": ["@nrc"]}
         }
     }
 
diff --git a/highfive/tests/test_newpr.py b/highfive/tests/test_newpr.py
index 3634ede..c72ca00 100644
--- a/highfive/tests/test_newpr.py
+++ b/highfive/tests/test_newpr.py
@@ -351,11 +351,11 @@ Please see [the contribution instructions](%s) for more information.
         handler = HighfiveHandlerMock(Payload({})).handler
 
         for (msg, reviewer) in found_cases:
-            assert handler.find_reviewer(msg) == reviewer, \
+            assert handler.find_reviewer(msg, None) == reviewer, \
                 "expected '%s' from '%s'" % (reviewer, msg)
 
         for msg in not_found_cases:
-            assert handler.find_reviewer(msg) is None, \
+            assert handler.find_reviewer(msg, None) is None, \
                 "expected '%s' to have no reviewer extracted" % msg
 
 class TestApiReq(TestNewPR):
@@ -792,7 +792,7 @@ class TestNewPrFunction(TestNewPR):
         self.mocks['api_req'].assert_called_once_with(
             'GET', 'https://the.url/', None, 'application/vnd.github.v3.diff'
         )
-        self.mocks['find_reviewer'].assert_called_once_with('The PR comment.')
+        self.mocks['find_reviewer'].assert_called_once_with('The PR comment.', 'prAuthor')
         self.mocks['set_assignee'].assert_called_once_with(
             reviewer, 'repo-owner', 'repo-name', '7', self.user, 'prAuthor',
             to_mention
@@ -1052,7 +1052,7 @@ class TestNewComment(TestNewPR):
         self.mocks['find_reviewer'].return_value = None
         handler.new_comment()
         self.mocks['is_collaborator'].assert_not_called()
-        self.mocks['find_reviewer'].assert_called_with('comment!')
+        self.mocks['find_reviewer'].assert_called_with('comment!', 'userA')
         self.mocks['set_assignee'].assert_not_called()
 
     def test_has_reviewer(self):
@@ -1061,7 +1061,7 @@ class TestNewComment(TestNewPR):
         self.mocks['find_reviewer'].return_value = 'userD'
         handler.new_comment()
         self.mocks['is_collaborator'].assert_not_called()
-        self.mocks['find_reviewer'].assert_called_with('comment!')
+        self.mocks['find_reviewer'].assert_called_with('comment!', 'userA')
         self.mocks['set_assignee'].assert_called_with(
             'userD', 'repo-owner', 'repo-name', '7', 'integrationUser',
             'userA', None
@@ -1260,6 +1260,31 @@ class TestChooseReviewer(TestNewPR):
         )
         assert set(["@JohnTitor"]) == mentions
 
+    def test_with_team_ping(self):
+        """Test choosing a reviewer when passed a team ping"""
+        handler = HighfiveHandlerMock(
+            Payload({}), repo_config=self.fakes['config']['teams']
+        ).handler
+
+        found_cases = (
+            ("r? @foo/a", "pnkfelix"),
+            ("r? @b/c", "nrc"),
+        )
+
+        not_found_cases = (
+            "r? @/a",
+            "r? @a/b",
+        )
+
+        for (msg, reviewer) in found_cases:
+            assert handler.find_reviewer(msg, None) == reviewer, \
+                "expected '%s' from '%s'" % (reviewer, msg)
+
+        for msg in not_found_cases:
+            assert handler.find_reviewer(msg, None) is None, \
+                "expected '%s' to have no reviewer extracted" % msg
+
+
 class TestRun(TestNewPR):
     @pytest.fixture(autouse=True)
     def make_mocks(cls, patcherize):

Assign a random team member with r+ priviliges on r? @rust-lang/<team>
If someone writes:
```
r? @rust-lang/docs 
```
Then we could for example assign steveklabnik since they have r+ rights.

This mistake happens from time to time; what happens now when someone writes the above is to leave the PR without a reviewer...

cc https://github.com/rust-lang/rust/pull/57357#issuecomment-451675541
highfive/tests/test_newpr.py::TestNewPRGeneral::test_find_reviewer highfive/tests/test_newpr.py::TestChooseReviewer::test_with_team_ping highfive/tests/test_newpr.py::TestNewPrFunction::test_msg_reviewer_repeat_contributor highfive/tests/test_newpr.py::TestNewPrFunction::test_no_msg_reviewer_repeat_contributor highfive/tests/test_newpr.py::TestNewPrFunction::test_empty_pr_labels highfive/tests/test_newpr.py::TestNewPrFunction::test_no_msg_reviewer_new_contributor highfive/tests/test_newpr.py::TestNewPrFunction::test_no_pr_labels_specified highfive/tests/test_newpr.py::TestNewComment::test_has_reviewer highfive/tests/test_newpr.py::TestNewComment::test_no_reviewer
highfive/tests/test_newpr.py::TestRun::test_unsupported_payload highfive/tests/test_newpr.py::TestRun::test_newpr highfive/tests/test_newpr.py::TestRun::test_new_comment highfive/tests/test_newpr.py::TestHighfiveHandler::test_load_repo_config_unsupported highfive/tests/test_newpr.py::TestHighfiveHandler::test_init highfive/tests/test_newpr.py::TestHighfiveHandler::test_load_repo_config_supported highfive/tests/test_newpr.py::TestPostWarnings::test_unexpected_branch_modifies_submodule highfive/tests/test_newpr.py::TestPostWarnings::test_no_warnings highfive/tests/test_newpr.py::TestPostWarnings::test_unexpected_branch highfive/tests/test_newpr.py::TestPostWarnings::test_modifies_submodule highfive/tests/test_newpr.py::TestPostWarnings::test_unexpected_branch_modifies_submodule_and_targets highfive/tests/test_newpr.py::TestApiReq::test5 highfive/tests/test_newpr.py::TestApiReq::test6 highfive/tests/test_newpr.py::TestApiReq::test4 highfive/tests/test_newpr.py::TestApiReq::test1 highfive/tests/test_newpr.py::TestApiReq::test2 highfive/tests/test_newpr.py::TestApiReq::test3 highfive/tests/test_newpr.py::TestNewPRGeneral::test_welcome_msg highfive/tests/test_newpr.py::TestNewPRGeneral::test_expected_branch_default_expected_no_match highfive/tests/test_newpr.py::TestNewPRGeneral::test_post_comment_error highfive/tests/test_newpr.py::TestNewPRGeneral::test_is_collaborator_true highfive/tests/test_newpr.py::TestNewPRGeneral::test_submodule highfive/tests/test_newpr.py::TestNewPRGeneral::test_load_json_file highfive/tests/test_newpr.py::TestNewPRGeneral::test_add_labels_success highfive/tests/test_newpr.py::TestNewPRGeneral::test_post_comment_error_201 highfive/tests/test_newpr.py::TestNewPRGeneral::test_is_collaborator_error highfive/tests/test_newpr.py::TestNewPRGeneral::test_expected_branch_custom_expected_no_match highfive/tests/test_newpr.py::TestNewPRGeneral::test_review_msg highfive/tests/test_newpr.py::TestNewPRGeneral::test_add_labels_error highfive/tests/test_newpr.py::TestNewPRGeneral::test_targets highfive/tests/test_newpr.py::TestNewPRGeneral::test_post_comment_success highfive/tests/test_newpr.py::TestNewPRGeneral::test_is_collaborator_false highfive/tests/test_newpr.py::TestNewPRGeneral::test_expected_branch_custom_expected_match highfive/tests/test_newpr.py::TestNewPRGeneral::test_expected_branch_default_expected_match highfive/tests/test_newpr.py::TestChooseReviewer::test_no_potential_reviewers highfive/tests/test_newpr.py::TestChooseReviewer::test_mentions highfive/tests/test_newpr.py::TestChooseReviewer::test_global_core highfive/tests/test_newpr.py::TestChooseReviewer::test_circular_groups highfive/tests/test_newpr.py::TestChooseReviewer::test_mentions_without_dirs highfive/tests/test_newpr.py::TestChooseReviewer::test_global_group_overlap highfive/tests/test_newpr.py::TestChooseReviewer::test_with_dirs highfive/tests/test_newpr.py::TestChooseReviewer::test_with_dirs_no_intersection highfive/tests/test_newpr.py::TestChooseReviewer::test_individuals_no_dirs_1 highfive/tests/test_newpr.py::TestChooseReviewer::test_individuals_no_dirs_2 highfive/tests/test_newpr.py::TestChooseReviewer::test_with_files highfive/tests/test_newpr.py::TestIsNewContributor::test_is_new_contributor_has_commits highfive/tests/test_newpr.py::TestIsNewContributor::test_is_new_contributor_no_commits highfive/tests/test_newpr.py::TestIsNewContributor::test_is_new_contributor_nonexistent_user highfive/tests/test_newpr.py::TestIsNewContributor::test_is_new_contributor_fork highfive/tests/test_newpr.py::TestIsNewContributor::test_is_new_contributor_error highfive/tests/test_newpr.py::TestNewPrFunction::test_assignee_already_set highfive/tests/test_newpr.py::TestNewComment::test_unauthorized_assigner highfive/tests/test_newpr.py::TestNewComment::test_authorized_assigner_commenter_is_assignee highfive/tests/test_newpr.py::TestNewComment::test_authorized_assigner_author_is_commenter highfive/tests/test_newpr.py::TestNewComment::test_not_pr highfive/tests/test_newpr.py::TestNewComment::test_authorized_assigner_commenter_is_collaborator highfive/tests/test_newpr.py::TestNewComment::test_not_open highfive/tests/test_newpr.py::TestNewComment::test_commenter_is_integration_user highfive/tests/test_newpr.py::TestSetAssignee::test_has_to_mention highfive/tests/test_newpr.py::TestSetAssignee::test_has_nick highfive/tests/test_newpr.py::TestSetAssignee::test_no_assignee highfive/tests/test_newpr.py::TestSetAssignee::test_api_req_error highfive/tests/test_newpr.py::TestSetAssignee::test_api_req_201 highfive/tests/test_newpr.py::TestSetAssignee::test_api_req_good