At 6th level, a fighter who has both crossbow expert and sharpshooter will not have a 20 Dex. He will have a 16 Dex. Which means the bonus action attack from crossbow expert will only deal 1d6 + 3 damage, not 1d6+5. At 8th level, both the fighter and the ranger can have the same feat compliment...