--enable-warnings-as-errors fails due to -D unused-doc-comments and -D unused-mut with Rust 1.36

RESOLVED FIXED in Firefox 68

Status

()

defect
RESOLVED FIXED
3 months ago
2 months ago

People

(Reporter: jbeich, Assigned: myk)

Tracking

unspecified
mozilla68
Points:
---

Firefox Tracking Flags

(firefox68 fixed)

Details

Attachments

(1 attachment)

$ rustc -vV
rustc 1.36.0-nightly
binary: rustc
commit-hash: 00859e3e653973120006aaf3227823062dde1ba7
commit-date: 2019-04-29
host: x86_64-unknown-freebsd
release: 1.36.0-nightly
LLVM version: 8.0

$ echo "ac_add_options --enable-warnings-as-errors # mimic MOZ_AUTOMATION" >>.mozconfig
$ ./mach build
[...]
error: unused doc comment
--> toolkit/components/xulstore/src/persist.rs:18:1
|
18 | / /// The XULStore API is synchronous for both C++ and JS consumers and accessed
19 | | /// on the main thread, so we persist its data to disk on a background thread
20 | | /// to avoid janking the UI.
21 | | ///
... |
27 | | /// expensive when there are many of them in quick succession, we batch changes
28 | | /// and write them in batches.
| |_____________________________^
29 |
30 | / lazy_static! {
31 | | /// A map of key/value pairs to persist. Values are Options so we can
32 | | /// use the same structure for both puts and deletes, with a None value
33 | | /// identifying a key that should be deleted from the database.
... |
63 | | };
64 | | }
| |
- rustdoc does not generate documentation for macro expansions
|
= note: -D unused-doc-comments implied by -D warnings
= help: to document an item produced by a macro, the macro must produce the documentation as part of its expansion
error: aborting due to previous error
error: Could not compile xulstore.

error: variable does not need to be mutable
--> toolkit/components/xulstore/src/lib.rs:195:17
|
195 | let mut ids: Vec<String> = ids.keys().cloned().collect();
| ----^^^
| |
| help: remove this mut
|
= note: -D unused-mut implied by -D warnings
error: variable does not need to be mutable
--> toolkit/components/xulstore/src/lib.rs:214:21
|
214 | let mut attrs: Vec<String> = attrs.keys().cloned().collect();
| ----^^^^^
| |
| help: remove this mut
error: aborting due to 2 previous errors
error: Could not compile xulstore.

Summary: --enable-warnings-as-errors fails due to -D unused-doc-comments with Rust 1.36 → --enable-warnings-as-errors fails due to -D unused-doc-comments and -D unused-mut with Rust 1.36
See Also: → 1548197

Myk, can you advise where the comment is supposed to go? I can write patches for the mut issues, but am not quite sure what to do about the comment.

Flags: needinfo?(myk)

Whoops. That should be an inner doc comment for the persist module in persist.rs. So it should go above the use items in the file, and its lines should start with //!. (That still doesn't cause the documentation to show up in the output of cargo doc, but that's a different issue that can be addressed separately).

I've submitted a patch to fix these warnings/errors to Phabricator as D30570, but feel free to subsume it into a broader patch to fix warnings/errors across the non-third-party Rust code in mozilla-central, if that'd work better.

Flags: needinfo?(myk)
Pushed by myk@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6166be9aa866
fix xulstore warnings/errors on Rust 1.36 r=froydnj
Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
You need to log in before you can comment on or make changes to this bug.