Context. Streaming instability is a possible mechanism to form icy planetesimals. It requires special local conditions such as a high solid-to-gas ratio at the midplane and typically more than a centimeter in size (Stokes number >0.01). Silicate grains cannot grow to such a size through pairwise collisions. It is important to clarify where and when rocky and icy planetesimals are formed in a viscously evolving disk. Aims. We wish to understand how local runaway pile-up of solids (silicate and water ice) occurs inside or outside the snow line. Methods. We assumed an icy pebble contains micron-sized silicate grains that are uniformly mixed with ice and are released during the ice sublimation. Using a local one-dimensional code, we solved the radial drift and the turbulent diffusion of solids and the water vapor, taking account of their sublimation and condensation around the snow line. We systematically investigated the effects of back-reactions of solids to gas on the radial drift and diffusion of solids, scale height evolution of the released silicate particles, and possible differences in effective viscous parameters between those for turbulent diffusion (αtur) and those for the gas accretion rate onto the central star (αacc). We also studied the dependence on the ratio of the solid mass flux to the gas (Fp/g). Results. We show that the favorable locations for the pile-up of silicate grains and icy pebbles are the regions in the proximity of, both inside and outside, the water snow line, respectively. We find that runaway pile-ups occur when both the back-reactions for radial drift and diffusion are included. In the case with only the back-reaction for the radial drift, runaway pile-up is not found except in extremely high pebble flux, while the condition of streaming instability can be satisfied for relatively large Fp/g as found in the past literature. If the back-reaction for radial diffusion is considered, the runaway pile-up occurs for a reasonable value of pebble flux. The runaway pile-up of silicate grains that would lead to formation of rocky planetesimals occurs for αtur ≪ αacc, while the runaway pile-up of icy pebbles is favored for αtur ~ αacc. Based on these results, we discuss timings and locations of rocky and icy planetesimals in an evolving disk.