Skip to content

Commit

Permalink
Auto merge of #83185 - jyn514:remove-dead-code, r=oli-obk
Browse files Browse the repository at this point in the history
Remove (lots of) dead code

Builds on
- [ ] rust-lang/rust#83161
- [x] rust-lang/rust#83230
- [x] rust-lang/rust#83197.

Found with https://github.com/est31/warnalyzer.
See rust-lang/rust#77739 for a similar change in the past.

Dubious changes:
- Maybe some of the dead code in rustc_data_structures should be kept, in case someone wants to use it in the future?

TODO:
- [ ] check if any of the comments on the deleted code should be kept.
- [x] update the compiler documentation; right now it fails to build
- [x] finish moving `cfg(test)` changes into rust-lang/rust#83197

cc `@est31`
  • Loading branch information
bors committed Mar 29, 2021
2 parents 0c96f42 + d3697c8 commit 50061d5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
18 changes: 0 additions & 18 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,10 +413,6 @@ impl<'a> Id<'a> {
pub fn as_slice(&'a self) -> &'a str {
&*self.name
}

pub fn name(self) -> Cow<'a, str> {
self.name
}
}

/// Each instance of a type that implements `Label<C>` maps to a
Expand Down Expand Up @@ -484,10 +480,6 @@ impl<'a> LabelText<'a> {
LabelStr(s.into())
}

pub fn escaped<S: Into<Cow<'a, str>>>(s: S) -> LabelText<'a> {
EscStr(s.into())
}

pub fn html<S: Into<Cow<'a, str>>>(s: S) -> LabelText<'a> {
HtmlStr(s.into())
}
Expand Down Expand Up @@ -543,11 +535,6 @@ impl<'a> LabelText<'a> {
}
}

/// Puts `prefix` on a line above this label, with a blank line separator.
pub fn prefix_line(self, prefix: LabelText<'_>) -> LabelText<'static> {
prefix.suffix_line(self)
}

/// Puts `suffix` on a line below this label, with a blank line separator.
pub fn suffix_line(self, suffix: LabelText<'_>) -> LabelText<'static> {
let mut prefix = self.pre_escaped_content().into_owned();
Expand Down Expand Up @@ -602,11 +589,6 @@ pub enum RenderOption {
DarkTheme,
}

/// Returns vec holding all the default render options.
pub fn default_options() -> Vec<RenderOption> {
vec![]
}

/// Renders directed graph `g` into the writer `w` in DOT syntax.
/// (Simple wrapper around `render_opts` that passes a default set of options.)
pub fn render<'a, N, E, G, W>(g: &'a G, w: &mut W) -> io::Result<()>
Expand Down
2 changes: 1 addition & 1 deletion src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ impl<'a> Labeller<'a> for LabelledGraph {
fn node_label(&'a self, n: &Node) -> LabelText<'a> {
match self.node_labels[*n] {
Some(l) => LabelStr(l.into()),
None => LabelStr(id_name(n).name()),
None => LabelStr(id_name(n).name),
}
}
fn edge_label(&'a self, e: &&'a Edge) -> LabelText<'a> {
Expand Down

0 comments on commit 50061d5

Please sign in to comment.