Skip to content

Commit

Permalink
Rollup merge of rust-lang#68626 - Zoxc:termize, r=estebank
Browse files Browse the repository at this point in the history
Use termize instead of term_size

`termize` is a fork of `term_size` which uses `winapi` 0.3 instead of 0.2. This is a step towards removing the `winapi` 0.2 dependency.

r? @Mark-Simulacrum
  • Loading branch information
Dylan-DPC authored Jan 30, 2020
2 parents f837c73 + b0b11d3 commit 4af33a9
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
12 changes: 11 additions & 1 deletion Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3540,8 +3540,8 @@ dependencies = [
"rustc_data_structures",
"rustc_span",
"serialize",
"term_size",
"termcolor",
"termize",
"unicode-width",
"winapi 0.3.8",
]
Expand Down Expand Up @@ -4580,6 +4580,16 @@ dependencies = [
"redox_termios",
]

[[package]]
name = "termize"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1706be6b564323ce7092f5f7e6b118a14c8ef7ed0e69c8c5329c914a9f101295"
dependencies = [
"libc",
"winapi 0.3.8",
]

[[package]]
name = "test"
version = "0.0.0"
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_errors/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ unicode-width = "0.1.4"
atty = "0.2"
termcolor = "1.0"
annotate-snippets = "0.6.1"
term_size = "0.3.1"
termize = "0.1.1"

[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3", features = ["handleapi", "synchapi", "winbase"] }
2 changes: 1 addition & 1 deletion src/librustc_errors/emitter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1367,7 +1367,7 @@ impl EmitterWriter {
} else if self.ui_testing {
140
} else {
term_size::dimensions()
termize::dimensions()
.map(|(w, _)| w.saturating_sub(code_offset))
.unwrap_or(std::usize::MAX)
};
Expand Down
2 changes: 1 addition & 1 deletion src/tools/tidy/src/deps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ const WHITELIST: &[Crate<'_>] = &[
Crate("termcolor"),
Crate("terminon"),
Crate("termion"),
Crate("term_size"),
Crate("termize"),
Crate("thread_local"),
Crate("ucd-util"),
Crate("unicode-normalization"),
Expand Down

0 comments on commit 4af33a9

Please sign in to comment.