Check if cart contains valid products for discount code
Try something like this:

{% set currentDiscount = craft.commerce.getDiscountByCode(cart.couponCode) %}

{% if currentDiscount %}

{% set cartProductIds = [] %}

{% for item in cart.lineItems %}
  {% set cartProductIds = cartProductIds|merge([item.purchasable.product.id]) %}
{% endfor %}

{% for product in currentDiscount.products %}
  {% if not product.id in cartProductIds %}{{ product.title }} not in cart.{% endif %}
{% endfor %}

{% endif %}