Skip to content

Commit e8b1029

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

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
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!

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ note: the lint level is defined here
1010
LL | #![deny(rustc::bad_opt_access)]
1111
| ^^^^^^^^^^^^^^^^^^^^^
1212

13-
error: use `Session::crate_types` instead of this field
13+
error: use `TyCtxt::crate_types` instead of this field
1414
--> $DIR/bad_opt_access.rs:17:13
1515
|
1616
LL | let _ = sess.opts.crate_types;

0 commit comments

Comments
 (0)