Skip to content

Commit 996e728

Browse files
committed
Fix error message for direct usage of sess.opts.crate_types
1 parent 0a619db commit 996e728

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/rustc_session/src/options.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ top_level_options!(
130130
pub struct Options {
131131
/// The crate config requested for the session, which may be combined
132132
/// with additional crate configurations during the compile process.
133-
#[rustc_lint_opt_deny_field_access("use `Session::crate_types` instead of this field")]
133+
#[rustc_lint_opt_deny_field_access("use `TyCtxt::crate_types` instead of this field")]
134134
crate_types: Vec<CrateType> [TRACKED],
135135
optimize: OptLevel [TRACKED],
136136
/// Include the `debug_assertions` flag in dependency tracking, since it

tests/ui-fulldeps/internal-lints/bad_opt_access.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub fn access_bad_option(sess: Session) {
1515
//~^ ERROR use `Session::split_debuginfo` instead of this field
1616

1717
let _ = sess.opts.crate_types;
18-
//~^ ERROR use `Session::crate_types` instead of this field
18+
//~^ ERROR use `TyCtxt::crate_types` instead of this field
1919

2020
let _ = sess.opts.crate_name;
2121
// okay!

0 commit comments

Comments
 (0)