# Minus sign disappears in lstlisting if I import the semantic package

I am using the lstlisting package and the semantic package. Now whenever I write a - (minus) inside a lstlisting it disappears after the compilation. Here is a minimal example:

\documentclass{article}

\usepackage{listings}
\usepackage{semantic}

\begin{document}
\begin{lstlisting}
->
\end{lstlisting}
\end{document}


How do I get this fixed?

A similar thread already exists, but the solutions shown there do not work for my problem.

Package semantic adds special treatment for some characters. In this example you can disable the behavior by \mathligsoff:

\documentclass{article}

\usepackage{listings}
\usepackage{semantic}

\begin{document}
\mathligsoff
\begin{lstlisting}
->
\end{lstlisting}
\mathligson
\end{document}


The command can also be put into an init hook of lstlistings:

\documentclass{article}

\usepackage{listings}
\usepackage{semantic}

\makeatletter
$->$ and \lstinline|->|