libsyntax: Make deriving also respect where bounds.

Fixes #19358.