Foreshadowing

Definition
A warning or indication of an event that will happen in the future. It's typically something subtle that gives a hint that something may happen.

Example
There will boulders on the castle rock that forshadowed the death of Piggy.