Skip to content

Commit eb42797

Browse files
committed
libgraphviz: deny warnings in doctests
1 parent 6123df8 commit eb42797

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

mk/tests.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ $(eval $(call RUST_CRATE,collectionstest))
2525
TEST_TARGET_CRATES = $(filter-out core rustc_unicode alloc_system \
2626
alloc_jemalloc,$(TARGET_CRATES)) \
2727
collectionstest coretest
28-
TEST_DOC_CRATES = $(DOC_CRATES) arena flate fmt_macros getopts
28+
TEST_DOC_CRATES = $(DOC_CRATES) arena flate fmt_macros getopts graphviz
2929
TEST_HOST_CRATES = $(filter-out rustc_typeck rustc_borrowck rustc_resolve \
3030
rustc_trans rustc_lint,\
3131
$(HOST_CRATES))

src/libgraphviz/lib.rs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
//! which is cyclic.
4848
//!
4949
//! ```rust
50-
//! #![feature(rustc_private, core, into_cow)]
50+
//! #![feature(rustc_private, into_cow)]
5151
//!
5252
//! use std::borrow::IntoCow;
5353
//! use std::io::Write;
@@ -150,9 +150,8 @@
150150
//! entity `&sube`).
151151
//!
152152
//! ```rust
153-
//! #![feature(rustc_private, core, into_cow)]
153+
//! #![feature(rustc_private)]
154154
//!
155-
//! use std::borrow::IntoCow;
156155
//! use std::io::Write;
157156
//! use graphviz as dot;
158157
//!
@@ -174,10 +173,10 @@
174173
//! dot::Id::new(format!("N{}", n)).unwrap()
175174
//! }
176175
//! fn node_label<'b>(&'b self, n: &Nd) -> dot::LabelText<'b> {
177-
//! dot::LabelText::LabelStr(self.nodes[*n].as_slice().into_cow())
176+
//! dot::LabelText::LabelStr(self.nodes[*n].into())
178177
//! }
179178
//! fn edge_label<'b>(&'b self, _: &Ed) -> dot::LabelText<'b> {
180-
//! dot::LabelText::LabelStr("&sube;".into_cow())
179+
//! dot::LabelText::LabelStr("&sube;".into())
181180
//! }
182181
//! }
183182
//!
@@ -209,9 +208,8 @@
209208
//! Hasse-diagram for the subsets of the set `{x, y}`.
210209
//!
211210
//! ```rust
212-
//! #![feature(rustc_private, core, into_cow)]
211+
//! #![feature(rustc_private)]
213212
//!
214-
//! use std::borrow::IntoCow;
215213
//! use std::io::Write;
216214
//! use graphviz as dot;
217215
//!
@@ -234,10 +232,10 @@
234232
//! }
235233
//! fn node_label<'b>(&'b self, n: &Nd<'b>) -> dot::LabelText<'b> {
236234
//! let &(i, _) = n;
237-
//! dot::LabelText::LabelStr(self.nodes[i].into_cow())
235+
//! dot::LabelText::LabelStr(self.nodes[i].into())
238236
//! }
239237
//! fn edge_label<'b>(&'b self, _: &Ed<'b>) -> dot::LabelText<'b> {
240-
//! dot::LabelText::LabelStr("&sube;".into_cow())
238+
//! dot::LabelText::LabelStr("&sube;".into())
241239
//! }
242240
//! }
243241
//!
@@ -283,7 +281,8 @@
283281
#![crate_type = "dylib"]
284282
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
285283
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
286-
html_root_url = "https://doc.rust-lang.org/nightly/")]
284+
html_root_url = "https://doc.rust-lang.org/nightly/",
285+
test(attr(allow(unused_variables), deny(warnings))))]
287286

288287
#![feature(into_cow)]
289288
#![feature(str_escape)]

0 commit comments

Comments
 (0)