In most cases, dumpster diving does not constitute trespassing as long as the dumpster is located on public property or accessible areas. However, if the dumpster is on private property and you enter without permission, you may be considered trespassing, which is illegal.