                  ((rust-eat-re "[a-z_]+") (setf rust-tcat 'macro)))
            'font-lock-preprocessor-face)
       (def ((?a . ?z) (?A . ?Z) ?_)
-           (rust-eat-re "[a-zA-Z_][a-zA-Z0-9_]*")
-           (setf rust-tcat 'ident)
-           (if (and (eq (char-after) ?:) (eq (char-after (+ (point) 1)) ?:)
-                    (not (eq (char-after (+ (point) 2)) ?:)))
-               (progn (forward-char 2) 'font-lock-builtin-face)
-             (match-string 0)))
+           (rust-token-identifier))
       (def ((?0 . ?9))
            (rust-eat-re "0x[0-9a-fA-F_]+\\|0b[01_]+\\|[0-9_]+\\(\\.[0-9_]+\\)?\\(e[+\\-]?[0-9_]+\\)?")
            (setf rust-tcat 'atom)

           (setf rust-tcat 'op) nil)
      table)))

(defun rust-single-quote ()
  (forward-char)
  (setf rust-tcat 'atom)
  ; Is this a lifetime?
  (if (or (looking-at "[a-zA-Z_]$")
          (looking-at "[a-zA-Z_][^']"))
      ; If what we see is 'abc, use font-lock-type-face:
      (progn (rust-eat-re "[a-zA-Z_][a-zA-Z_0-9]*")
             'font-lock-type-face)
    ; Otherwise, handle as a character constant:
    (let ((is-escape (eq (char-after) ?\\))
          (start (point)))

             (not (member (get-text-property (point) 'face)
                          '(font-lock-comment-face font-lock-string-face))))
    (cm-indent)))

(defcustom rust-capitalized-idents-are-types t
  "If non-nil, capitalized identifiers will be treated as types for the purposes of font-lock mode"
  :type 'boolean
  :require 'rust-mode
  :group 'rust-mode)

(defvar rust-indent-unit 4)
(defvar rust-syntax-table (let ((table (make-syntax-table)))
