This will be available for all users in the next few weeks.
Updated July 13, 2018: Well, looks like those "few weeks" ended up being a few months. Either way, this feature is now widely rolling out to all users. To access it, open the Phone app and go to Settings -> Caller ID & Spam and you'll see a new toggle labeled "Filter spam calls." Once you turn this on, you'll never be interrupted by a spam call again.
You know what's not fun? Spam calls. Picking up the phone to be told you've won an all-expense-paid cruise after simply handing over your credit card info gets old real fast, and to help filter these out of your day, the Google Phone app for Pixel and Nexus devices is getting a new direct-to-voicemail feature for them.
First spotted by 9to5Google, this will send any calls that are detected as spam right to your voicemail. You'll be able to listen to the messages on the voicemail tab in Google Phone and you'll see the calls show up in your call history, but your phone won't ring and you won't get a notification when a voicemail is left.
Google Phone already offers some protection against spam calls by showing a red screen when it detects one with a "Suspected spam caller" message, but this still rings your phone like a regular incoming call. Not being notified of these calls altogether is a big change, but it's one I imagine most people will be perfectly fine with.
You can access this now by signing up for the Google Phone beta testing program. If you're not a tester yet but want to become one, just find the Google Phone app in the Play Store, scroll down to the bottom of its page, and tap "I'm in" on the "Become a beta tester" card.
Alternatively, you can just wait for this to come to the public version of the app in the next few weeks.