Actually, only the handgrip was subcontracted to Mattel as they had the plastic molding capabilities. It had no effect on the actual functioning of the rifle.
The handgrip of the M16 rifle was made by Mattel. When the gun was first introduced in Vietnam, soldiers noticed the toy company’s logo embossed on the handgrip and complained. Later shipments arrived without the imprint, but the grips were still manufactured by Mattel.