library(rlang)
library(tidyselect)
eval_select(expr(c(foo = mpg, bar = cyl)), mtcars, allow_rename = FALSE)
#> Error:
#> ! Can't rename variables in this context.
# uh oh
eval_select(expr(c(foo = mpg, cyl)), mtcars, allow_rename = FALSE)
#> foo cyl
#> 1 2
Created on 2022-08-26 by the reprex package (v2.0.1)
Created on 2022-08-26 by the reprex package (v2.0.1)