The sun breaks through the trees as a child rides a swing.
The child is riding a swing in the rain.
The sun implies nice weather with no rain, so you can't be swinging in the sun and swinging in the rain.
Typically, the sun does not shine while it is raining.
The sun is not typically out when there is rain.