There's some scary Supreme Court precedent just handed down. The cop can be ignorant of the law, i.e., think you broke a law when you didn't, and then conduct a search, and that search is now legal thanks to a brand new Supreme Court decision. That's right, ignorance of the law is no excuse, except for cops.
Pick your poison:
Of course this is supposed to be limited to "reasonable" ignorance, but look at Smith v. Maryland. A one time, short term, metadata collection on a specific individual where there was certainly probable cause for a warrant if the cops had not been lazy, is today interpreted to mean that all metadata can be collected for every person, for all time, in the absence of probable cause. Or how the Executive branch interprets "imminent" to include "maybe possibly at some point of time in not so near future." This ruling is a free pass for the cops to do whatever the hell they want and claim ignorance of the law. Just give it 30 years.