Skip to content

Commit

Permalink
Auto merge of #103375 - matthiaskrgr:rollup-4xrs7f2, r=matthiaskrgr
Browse files Browse the repository at this point in the history
Rollup of 9 pull requests

Successful merges:

 - #102635 (make `order_dependent_trait_objects` show up in future-breakage reports)
 - #103335 (Replaced wrong test with the correct mcve)
 - #103339 (Fix some typos)
 - #103340 (WinConsole::new is not actually fallible)
 - #103341 (Add test for issue 97607)
 - #103351 (Require Drop impls to have the same constness on its bounds as the bounds on the struct have)
 - #103359 (Remove incorrect comment in `Vec::drain`)
 - #103364 (rustdoc: clean up rustdoc-toggle CSS)
 - #103370 (rustdoc: remove unused CSS `.out-of-band { font-weight: normal }`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
  • Loading branch information
bors committed Oct 21, 2022
2 parents 196431f + dd27b4e commit 81f14f6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
4 changes: 1 addition & 3 deletions alloc/src/vec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1999,9 +1999,7 @@ impl<T, A: Allocator> Vec<T, A> {
unsafe {
// set self.vec length's to start, to be safe in case Drain is leaked
self.set_len(start);
// Use the borrow in the IterMut to indicate borrowing behavior of the
// whole Drain iterator (like &mut T).
let range_slice = slice::from_raw_parts_mut(self.as_mut_ptr().add(start), end - start);
let range_slice = slice::from_raw_parts(self.as_ptr().add(start), end - start);
Drain {
tail_start: end,
tail_len: len - end,
Expand Down
2 changes: 1 addition & 1 deletion test/src/term.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub(crate) fn stdout() -> Option<Box<StdoutTerminal>> {
pub(crate) fn stdout() -> Option<Box<StdoutTerminal>> {
TerminfoTerminal::new(io::stdout())
.map(|t| Box::new(t) as Box<StdoutTerminal>)
.or_else(|| WinConsole::new(io::stdout()).ok().map(|t| Box::new(t) as Box<StdoutTerminal>))
.or_else(|| Some(Box::new(WinConsole::new(io::stdout())) as Box<StdoutTerminal>))
}

/// Terminal color definitions
Expand Down
7 changes: 3 additions & 4 deletions test/src/term/win.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ impl<T: Write + Send + 'static> WinConsole<T> {
}
}

/// Returns `None` whenever the terminal cannot be created for some reason.
pub(crate) fn new(out: T) -> io::Result<WinConsole<T>> {
pub(crate) fn new(out: T) -> WinConsole<T> {
use std::mem::MaybeUninit;

let fg;
Expand All @@ -132,13 +131,13 @@ impl<T: Write + Send + 'static> WinConsole<T> {
bg = color::BLACK;
}
}
Ok(WinConsole {
WinConsole {
buf: out,
def_foreground: fg,
def_background: bg,
foreground: fg,
background: bg,
})
}
}
}

Expand Down

0 comments on commit 81f14f6

Please sign in to comment.