Skip to content

Commit 20724ef

Browse files
Improve error messages
1 parent 9d7e579 commit 20724ef

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

compiler/rustc_error_messages/locales/en-US/passes.ftl

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ passes_doc_alias_malformed =
7777
7878
passes_doc_auto_cfg_malformed = `#![doc({$attr_str})]` attribute doesn't expect a value
7979
80-
passes_doc_both_auto_cfg = please don't specify both `doc(auto_cfg)` and `doc(no_auto_cfg)`
80+
passes_doc_both_auto_cfg = conflicting attributes `doc(auto_cfg)` and `doc(no_auto_cfg)`
8181
.label = the other is specified here
8282
8383
passes_doc_no_auto_cfg_enabled_by_default = `doc(no_auto_cfg)` is enabled by default before the 2024 edition

src/librustdoc/visit_ast.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
168168
.sess()
169169
.diagnostic()
170170
.struct_warn(
171-
"the `doc_auto_cfg` feature is used but `#![doc(auto_cfg)]` isn't so it \
172-
won't do anything",
171+
"feature `doc_auto_cfg` now requires attribute `#![doc(auto_cfg)]` to \
172+
enable the behavior",
173173
)
174174
.emit();
175175
}
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
warning: the `doc_auto_cfg` feature is used but `#![doc(auto_cfg)]` isn't so it won't do anything
1+
warning: feature `doc_auto_cfg` now requires attribute `#![doc(auto_cfg)]` to enable the behavior
22

33
warning: 1 warning emitted
44

src/test/rustdoc-ui/doc_no_auto_cfg.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ error: `doc(no_auto_cfg)` is enabled by default before the 2024 edition
4646
LL | #![doc(auto_cfg, no_auto_cfg)]
4747
| ^^^^^^^^^^^
4848

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

0 commit comments

Comments
 (0)