Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4d1241f

Browse files
committedFeb 10, 2020
Auto merge of #69012 - Dylan-DPC:rollup-13qn0fq, r=Dylan-DPC
Rollup of 6 pull requests Successful merges: - #68694 (Reduce the number of `RefCell`s in `InferCtxt`.) - #68966 (Improve performance of coherence checks) - #68976 (Make `num::NonZeroX::new` an unstable `const fn`) - #68992 (Correctly parse `mut a @ b`) - #69005 (Small graphviz improvements for the new dataflow framework) - #69006 (parser: Keep current and previous tokens precisely) Failed merges: r? @ghost
2 parents 840bdc3 + 18c6d39 commit 4d1241f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+606
-445
lines changed
 

‎src/libcore/num/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@ assert_eq!(size_of::<Option<core::num::", stringify!($Ty), ">>(), size_of::<", s
6969

7070
/// Creates a non-zero if the given value is not zero.
7171
#[$stability]
72+
#[rustc_const_unstable(feature = "const_nonzero_int_methods", issue = "53718")]
7273
#[inline]
73-
pub fn new(n: $Int) -> Option<Self> {
74+
pub const fn new(n: $Int) -> Option<Self> {
7475
if n != 0 {
7576
// SAFETY: we just checked that there's no `0`
7677
Some(unsafe { Self(n) })

‎src/libgraphviz/lib.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,8 @@ pub enum RenderOption {
597597
NoNodeLabels,
598598
NoEdgeStyles,
599599
NoNodeStyles,
600+
601+
Monospace,
600602
}
601603

602604
/// Returns vec holding all the default render options.
@@ -626,6 +628,14 @@ where
626628
W: Write,
627629
{
628630
writeln!(w, "digraph {} {{", g.graph_id().as_slice())?;
631+
632+
// Global graph properties
633+
if options.contains(&RenderOption::Monospace) {
634+
writeln!(w, r#" graph[fontname="monospace"];"#)?;
635+
writeln!(w, r#" node[fontname="monospace"];"#)?;
636+
writeln!(w, r#" edge[fontname="monospace"];"#)?;
637+
}
638+
629639
for n in g.nodes().iter() {
630640
write!(w, " ")?;
631641
let id = g.node_id(n);

0 commit comments

Comments
 (0)
Please sign in to comment.