In 1992, last time I was at the Roskilde festival, it did work like that.
The police were there to maintain order and catch thieves, as long as you did not blow smoke in their faces they would pretend not to notice the hashish being smoked.
It worked fine.
That's what happens when you have stupid laws. Police and other people can ignore them.
By the way, it's -- I think -- still formally illegal for an American Indian to enter Boston (the original law passed in the colonial times was, apparently, never officially repealed). But I haven't heard of any arrests.
It would be cool if an Indian would make a point of walking in Boston and demand to be arrested so as to get the law off the books once and for all, come to think of it.