In 1903, Panama ceded its sovereign rights over the Panama Canal to the United States in perpetuity. The 1930 London Naval Treaty required submarines to comply with the contemporary law of war, including the prohibition on neutralizing enemy merchant vessels without having first ensured the safety of their passengers and crew. In 1945, the United Nations Charter prohibited its members from threatening or using force against another state, save for two limited exceptions. And, in 1969, Spain and Morocco concluded a permanent fisheries convention, setting the limit of their territorial seas at twelve miles.
Some of these treaties were bilateral agreements between two states; some were limited multilateral arrangements clarifying the legal rights and duties of a few states; some were general multilateral agreements aspiring to universal participation. Some were meant to be temporary descriptions of the states' respective legal duties; others were intended to be permanent. Some were concluded before the U.N. Charter restructured the international legal order; some afterward---one is the U.N. Charter itself. Their subject matter spans such diverse areas as trade law, the law of armed conflict, and the law of the sea. But for all of their diversity in structure, parties, subject matter, and dates, these treaties have one trait in common: they all include provisions that are difficult to square with subsequent state action. However, this conflicting state action is not critiqued as unlawful; rather, it is accepted and thus apparently acceptable. [..]
Rebecca Crootof, Change Without Consent: How Customary International Law Modifies Treaties, 41 Yale J. Int'l L. 237 (2016).