Rivera has played both third base and first base for the Royals this year while hitting .237/.284/.399 in 211 plate appearances.
The 26-year-old was originally selected by the Royals in the 19th round of the 2015 MLB Draft and made his big league debut for them last season.
Weaver was part of the D-backs return from the Cardinals in the trade that sent Paul Goldschmidt to St. Louis in December 2018.
Weaver’s career in Arizona got off to a great start when he compiled a 2.98 ERA in his first eight starts of 2019. The right-hander, though, injured his elbow in a May 26 start against the Giants and threw just two more innings the rest of the season.
Since returning in 2020, Weaver has struggled to recapture that form and has spent time on the injured list. The D-backs switched him to the bullpen this year and he had begun pitching better with a 1.13 ERA in his past eight appearances.