Skip to content

Commit 81f14f6

Browse files
committed
Auto merge of #103375 - matthiaskrgr:rollup-4xrs7f2, r=matthiaskrgr
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
2 parents 196431f + dd27b4e commit 81f14f6

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

alloc/src/vec/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1999,9 +1999,7 @@ impl<T, A: Allocator> Vec<T, A> {
19991999
unsafe {
20002000
// set self.vec length's to start, to be safe in case Drain is leaked
20012001
self.set_len(start);
2002-
// Use the borrow in the IterMut to indicate borrowing behavior of the
2003-
// whole Drain iterator (like &mut T).
2004-
let range_slice = slice::from_raw_parts_mut(self.as_mut_ptr().add(start), end - start);
2002+
let range_slice = slice::from_raw_parts(self.as_ptr().add(start), end - start);
20052003
Drain {
20062004
tail_start: end,
20072005
tail_len: len - end,

test/src/term.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ pub(crate) fn stdout() -> Option<Box<StdoutTerminal>> {
3939
pub(crate) fn stdout() -> Option<Box<StdoutTerminal>> {
4040
TerminfoTerminal::new(io::stdout())
4141
.map(|t| Box::new(t) as Box<StdoutTerminal>)
42-
.or_else(|| WinConsole::new(io::stdout()).ok().map(|t| Box::new(t) as Box<StdoutTerminal>))
42+
.or_else(|| Some(Box::new(WinConsole::new(io::stdout())) as Box<StdoutTerminal>))
4343
}
4444

4545
/// Terminal color definitions

test/src/term/win.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ impl<T: Write + Send + 'static> WinConsole<T> {
113113
}
114114
}
115115

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

120119
let fg;
@@ -132,13 +131,13 @@ impl<T: Write + Send + 'static> WinConsole<T> {
132131
bg = color::BLACK;
133132
}
134133
}
135-
Ok(WinConsole {
134+
WinConsole {
136135
buf: out,
137136
def_foreground: fg,
138137
def_background: bg,
139138
foreground: fg,
140139
background: bg,
141-
})
140+
}
142141
}
143142
}
144143

0 commit comments

Comments
 (0)