Skip to content

Commit

Permalink
Fix error message for direct usage of sess.opts.crate_types
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn3 committed Nov 10, 2024
1 parent 0a619db commit 996e728
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_session/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ top_level_options!(
pub struct Options {
/// The crate config requested for the session, which may be combined
/// with additional crate configurations during the compile process.
#[rustc_lint_opt_deny_field_access("use `Session::crate_types` instead of this field")]
#[rustc_lint_opt_deny_field_access("use `TyCtxt::crate_types` instead of this field")]
crate_types: Vec<CrateType> [TRACKED],
optimize: OptLevel [TRACKED],
/// Include the `debug_assertions` flag in dependency tracking, since it
Expand Down
2 changes: 1 addition & 1 deletion tests/ui-fulldeps/internal-lints/bad_opt_access.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub fn access_bad_option(sess: Session) {
//~^ ERROR use `Session::split_debuginfo` instead of this field

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

let _ = sess.opts.crate_name;
// okay!
Expand Down

0 comments on commit 996e728

Please sign in to comment.