This thread evolves from my discussion here. Minimal example
\documentclass{article}
\usepackage{mathtools}
\usepackage{polyglossia} % also loads package fontspec
\usepackage{unicode-math} % if you also need maths
\setmainlanguage{english} % loads language hyphenation rules and such
% TODO problem with finding good fonts with good support
% https://tex.stackexchange.com/a/218102/13173
%\setmainfont{Minion Pro} % or whatever OTF you have on your system
%\setmathfont{Cambria Math} % or whatever math OTF you have on your
% Problem with these declarations which I like to use
\DeclarePairedDelimiter{\abs}{\lvert}{\rvert}
\DeclarePairedDelimiter{\norm}{\lVert}{\rVert}
% This is causing the bug!
\usepackage{doi}
\begin{document}
% this test case does not work
\section{Complex pathogenesis $\to$ complicated classification}
% This test case works because of disabling above fonts and loading amssymb
\begin{equation}
\norm{x} + \abs{y} = 1 \mdlgwhtsquare
\end{equation}
\end{document}
Hacking approach which works
\usepackage{amsmath, amsfonts, textcomp, mathtools, xparse}
\usepackage[T4, OT1]{fontenc}
but I cannot understand why.
Error messages
Auto-detecting the appropriate typesetting chain...
*************************************************
* unicode-math warning: "mathtools-colon"
*
* I'm going to overwrite the following commands from the `mathtools' package:
*
* \dblcolon, \coloneqq, \Coloneqq, \eqqcolon.
*
* Note that since I won't overwrite the other colon-like commands, using them
* will lead to inconsistencies.
*************************************************
---
*************************************************
* unicode-math warning: "mathtools-overbracket"
*
* Using \overbracket and \underbracket from `mathtools' package.
*
* Use \Uoverbracket and \Uunderbracket for original `unicode-math' definition.
*************************************************
---
Package hyperref Warning: Rerun to get /PageLabels entry.
(/usr/local/texlive/2014/texmf-dist/tex/latex/amsfonts/umsa.fd)
(/usr/local/texlive/2014/texmf-dist/tex/latex/amsfonts/umsb.fd)
Package hyperref Warning: Token not allowed in a PDF string (Unicode):
(hyperref) removing `math shift' on input line 24.
Package hyperref Warning: Token not allowed in a PDF string (Unicode):
(hyperref) removing `math shift' on input line 24.
./poistettuja.tex:24: Improper alphabetic constant.
<to be read again>
\rightarrow
l.24 ...ogenesis $\to$ complicated classification}
./poistettuja.tex:24: Missing = inserted for \ifnum.
<to be read again>
\rightarrow
l.24 ...ogenesis $\to$ complicated classification}
./poistettuja.tex:24: Extra \fi.
<recently read> \fi
l.24 ...ogenesis $\to$ complicated classification}
./poistettuja.tex:24: Extra \fi.
<argument> ...er \the \numexpr 1024\fi \relax \fi
\fi -(64-1)/2)/64*64\rela...
l.24 ...ogenesis $\to$ complicated classification}
./poistettuja.tex:24: Extra \fi.
<argument> ...the \numexpr 1024\fi \relax \fi \fi
-(64-1)/2)/64*64\relax \f...
l.24 ...ogenesis $\to$ complicated classification}
(That makes 100 errors; please try again.)
No pages of output.
Transcript written on /Users/masi/Dropbox/paper/.texp
adtmp/poistettuja.log.
/usr/texbin/xelatex -file-line-error -interaction=nonstopmode -synctex=1 -output-directory=/Users/masi/Dropbox/paper/.texpadtmp poistettuja.tex
This is XeTeX, Version 3.14159265-2.6-0.99991 (TeX Live 2014) (preloaded format=xelatex)
restricted \write18 enabled.
entering extended mode
(./poistettuja.tex
LaTeX2e <2014/05/01>
Babel <3.9l> and hyphenation patterns for 79 languages loaded.
(/usr/local/texlive/2014/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/local/texlive/2014/texmf-dist/tex/latex/base/size10.clo))
---
*************************************************
* unicode-math warning: "mathtools-colon"
*
* I'm going to overwrite the following commands from the `mathtools' package:
*
* \dblcolon, \coloneqq, \Coloneqq, \eqqcolon.
*
* Note that since I won't overwrite the other colon-like commands, using them
* will lead to inconsistencies.
*************************************************
)) (/usr/local/texlive/2014/texmf-dist/tex/latex/polyglossia/gloss-english.ldf)
---
(/usr/local/texlive/2014/texmf-dist/tex/latex/url/url.sty))
Package hyperref Message: Driver (autodetected): hxetex.
(/usr/local/texlive/2014/texmf-dist/tex/latex/hyperref/hxetex.def
---
) (/usr/local/texlive/2014/texmf-dist/tex/latex/tipa/t3cmr.fd)
*************************************************
* unicode-math warning: "mathtools-overbracket"
*
* Using \overbracket and \underbracket from `mathtools' package.
*
* Use \Uoverbracket and \Uunderbracket for original `unicode-math' definition.
*************************************************
(/usr/local/texlive/2014/texmf-dist/tex/latex/hyperref/nameref.sty
---
Package hyperref Warning: Rerun to get /PageLabels entry.
(/usr/local/texlive/2014/texmf-dist/tex/latex/amsfonts/umsa.fd)
(/usr/local/texlive/2014/texmf-dist/tex/latex/amsfonts/umsb.fd)
Package hyperref Warning: Token not allowed in a PDF string (Unicode):
(hyperref) removing `math shift' on input line 24.
Package hyperref Warning: Token not allowed in a PDF string (Unicode):
(hyperref) removing `math shift' on input line 24.
./poistettuja.tex:24: Improper alphabetic constant.
<to be read again>
\rightarrow
l.24 ...ogenesis $\to$ complicated classification}
---
l.24 ...ogenesis $\to$ complicated classification}
./poistettuja.tex:24: Extra \fi.
<argument> ...er \the \numexpr 1024\fi \relax \fi
\fi 0\else \the \numexpr...
l.24 ...ogenesis $\to$ complicated classification}
./poistettuja.tex:24: Extra \fi.
<argument> ...the \numexpr 1024\fi \relax \fi \fi
0\else \the \numexpr 0<\...
l.24 ...ogenesis $\to$ complicated classification}
./poistettuja.tex:24: Extra \else.
<argument> ...xpr 1024\fi \relax \fi \fi 0\else
\the \numexpr 0<\z@ \expan...
l.24 ...ogenesis $\to$ complicated classification}
./poistettuja.tex:24: Extra \fi.
<argument> ...62144-1)/2)/262144*262144\relax \fi
\fi \expandafter \else \e...
l.24 ...ogenesis $\to$ complicated classification}
./poistettuja.tex:24: Extra \fi.
<argument> ...4-1)/2)/262144*262144\relax \fi \fi
\expandafter \else \expan...
l.24 ...ogenesis $\to$ complicated classification}
./poistettuja.tex:24: Extra \else.
<recently read> \else
l.24 ...ogenesis $\to$ complicated classification}
./poistettuja.tex:24: Extra \fi.
<argument> ...62144-1)/2)/262144*262144\relax \fi
\fi \expandafter \fi \exp...
l.24 ...ogenesis $\to$ complicated classification}
./poistettuja.tex:24: Extra \fi.
<argument> ...4-1)/2)/262144*262144\relax \fi \fi
\expandafter \fi \expanda...
l.24 ...ogenesis $\to$ complicated classification}
./poistettuja.tex:24: Extra \fi.
<recently read> \fi
l.24 ...ogenesis $\to$ complicated classification}
./poistettuja.tex:24: Extra \fi.
<argument> ...er \the \numexpr 1024\fi \relax \fi
\fi -(0<\z@ \expandafter ...
l.24 ...ogenesis $\to$ complicated classification}
./poistettuja.tex:24: Extra \fi.
<argument> ...the \numexpr 1024\fi \relax \fi \fi
-(0<\z@ \expandafter -\nu...
l.24 ...ogenesis $\to$ complicated classification}
./poistettuja.tex:24: Extra \fi.
<argument> ...62144-1)/2)/262144*262144\relax \fi
\fi \expandafter \else \e...
l.24 ...ogenesis $\to$ complicated classification}
./poistettuja.tex:24: Extra \fi.
<argument> ...4-1)/2)/262144*262144\relax \fi \fi
\expandafter \else \expan...
l.24 ...ogenesis $\to$ complicated classification}
./poistettuja.tex:24: Extra \else.
<recently read> \else
---
./poistettuja.tex:24: Extra \fi.
<argument> ...er \the \numexpr 1024\fi \relax \fi
\fi -(64-1)/2)/64*64\rela...
l.24 ...ogenesis $\to$ complicated classification}
./poistettuja.tex:24: Extra \fi.
<argument> ...the \numexpr 1024\fi \relax \fi \fi
-(64-1)/2)/64*64\relax \f...
l.24 ...ogenesis $\to$ complicated classification}
(That makes 100 errors; please try again.)
No pages of output.
Transcript written on /Users/masi/Dropbox/paper/.texp
adtmp/poistettuja.log.
How can you make the minimal example work?
DOI
With DOI which loads Hyperref, no output and errors as in above log message

Without DOI that is without Hyperref, correct output

Any possible changes to the package hyperref itself? Why has this behaviour been designed so?
.logyou need to use something like\texorpdfstring. See (duplicate):hyperrefwarning - Token not allowed in a PDF string – Werner Dec 15 '14 at 19:48hyperref(unless that is hidden in other packages). You really should post the entire.log– daleif Dec 15 '14 at 19:49\texorpdfstring{$\to$}{->}... – Werner Dec 15 '14 at 19:59doipackage has nothing to do with this; if you load insteadhyperrefyou get the same behavior. It has nothing to do withamssymbeither, which, as I said, should not be loaded along withunicode-math. The question is indeed a duplicate. – egreg Dec 17 '14 at 00:48doibut *with*hyperref, of course: I said that the problem is withhyperref, didn't I? – egreg Dec 17 '14 at 08:00\documentclass{article} \usepackage{unicode-math} \usepackage{hyperref} \begin{document} \section{$\to$} \end{document}– egreg Dec 17 '14 at 08:14Complex pathogenesis → complicated classification(or spelling out the title) would avoid the problem. If you don't know how to input→, type\textrightarrow{}. – egreg Dec 17 '14 at 08:15