1 // compile-flags: -Z unstable-options
3 // Test that accessing command line options by field access triggers a lint for those fields
4 // that have wrapper functions which should be used.
7 #![feature(rustc_private)]
8 #![deny(rustc::bad_opt_access)]
10 extern crate rustc_session;
11 use rustc_session::Session;
13 pub fn access_bad_option(sess: Session) {
14 let _ = sess.opts.cg.split_debuginfo;
15 //~^ ERROR use `Session::split_debuginfo` instead of this field
17 let _ = sess.opts.crate_types;
18 //~^ ERROR use `Session::crate_types` instead of this field
20 let _ = sess.opts.crate_name;