Ground rod for detached sub panel
You didn't say where you live, but the National Electrical Code applies to most areas of the USA. Check your state and local codes for any modification to this. The NEC is clear on this subject.
If the re-bar is not connected by tie wires to the rest of the re-bar and is less than 20 feet long you will need another grounding electrode. It also needs to be in the concrete footing or slab that is in direct contact with the earth, it cannot be separated from the earth by a vapor barrier (plastic) or insulation. Check the informational note.
From the National Electrical Code 250.52(A)

(3) Concrete-Encased Electrode. A concrete-encased electrode shall consist of at least 6.0 m (20 ft) of either (1) or (2):
(1) One or more bare or zinc galvanized or other electrically conductive coated steel reinforcing bars or rods of not less than 13 mm (1⁄2 in.) in diameter, installed in one continuous 6.0 m (20 ft) length, or if in multiple pieces connected together by the usual steel tie wires, exothermic welding, welding, or other effective means to create a 6.0 m (20 ft) or greater length; or
(2) Bare copper conductor not smaller than 4 AWG
Metallic components shall be encased by at least 50 mm (2 in.) of concrete and shall be located horizontally within that portion of a concrete foundation or footing that is in direct contact with the earth or within vertical foundations or structural components or members that are in direct contact with the earth. If multiple concrete-encased electrodes are present at a building or structure, it shall be permissible to bond only one into the grounding electrode system.
Informational Note: Concrete installed with insulation, vapor barriers, films or similar items separating the concrete from the earth is not considered to be in “direct contact” with the earth.

Good luck!