A “treaty” (made by POTUS w/ Congressional consent) and legislation (a US law made and passed by Congress) are distinctly different.
A “treaty” is an international agreement between the US and another country. The Constitution distinguishes “The Laws of the United States” and “Treaties” (US Const., Art. VI, Cl. 2).
A (valid) US Law is an internal regulation pursuant to fulfilling the Constitution.
By constitutional law, POTUS, the Executive Branch, cannot make US law - only Congress the Legislative Branch may make US law and ONLY if the law conforms to the Constitution as written and originally understood and intended.
So, whatever U.S. laws come pursuant to their “treaty” must comply with the Constitution (Id.). Otherwise these and ANY US law that violates the Constitution is null and void, unenforceable, and must be repealed.
And a “treaty” that requires the U.S. to make law contrary to the Constitution is null and void as well.