Skip to content

Commit

Permalink
Improve error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Oct 10, 2022
1 parent 9d7e579 commit 20724ef
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_error_messages/locales/en-US/passes.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ passes_doc_alias_malformed =
passes_doc_auto_cfg_malformed = `#![doc({$attr_str})]` attribute doesn't expect a value
passes_doc_both_auto_cfg = please don't specify both `doc(auto_cfg)` and `doc(no_auto_cfg)`
passes_doc_both_auto_cfg = conflicting attributes `doc(auto_cfg)` and `doc(no_auto_cfg)`
.label = the other is specified here
passes_doc_no_auto_cfg_enabled_by_default = `doc(no_auto_cfg)` is enabled by default before the 2024 edition
Expand Down
4 changes: 2 additions & 2 deletions src/librustdoc/visit_ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
.sess()
.diagnostic()
.struct_warn(
"the `doc_auto_cfg` feature is used but `#![doc(auto_cfg)]` isn't so it \
won't do anything",
"feature `doc_auto_cfg` now requires attribute `#![doc(auto_cfg)]` to \
enable the behavior",
)
.emit();
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc-ui/doc_auto_cfg.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
warning: the `doc_auto_cfg` feature is used but `#![doc(auto_cfg)]` isn't so it won't do anything
warning: feature `doc_auto_cfg` now requires attribute `#![doc(auto_cfg)]` to enable the behavior

warning: 1 warning emitted

2 changes: 1 addition & 1 deletion src/test/rustdoc-ui/doc_no_auto_cfg.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ error: `doc(no_auto_cfg)` is enabled by default before the 2024 edition
LL | #![doc(auto_cfg, no_auto_cfg)]
| ^^^^^^^^^^^

error: please don't specify both `doc(auto_cfg)` and `doc(no_auto_cfg)`
error: conflicting attributes `doc(auto_cfg)` and `doc(no_auto_cfg)`
--> $DIR/doc_no_auto_cfg.rs:3:8
|
LL | #![doc(no_auto_cfg)]
Expand Down

0 comments on commit 20724ef

Please sign in to comment.