Skip to content

Commit 52d2c7a

Browse files
committed
Auto merge of #74817 - JohnTitor:rollup-0fchdye, r=JohnTitor
Rollup of 6 pull requests Successful merges: - #74088 (Avoid writes without any data in `Write::write_all_vectored`) - #74598 (Fix sync_once_cell_does_not_leak_partially_constructed_boxes) - #74750 (Clean up some uses of logging in ui tests) - #74783 (python codes cleanup) - #74790 (Don't italicize comments in ayu theme) - #74799 (Fixed typo in `closure`) Failed merges: r? @ghost
2 parents 9af6b3d + 7df242d commit 52d2c7a

16 files changed

+25
-37
lines changed

src/etc/htmldocck.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@
125125
from htmlentitydefs import name2codepoint
126126

127127
# "void elements" (no closing tag) from the HTML Standard section 12.1.2
128-
VOID_ELEMENTS = set(['area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'keygen',
129-
'link', 'menuitem', 'meta', 'param', 'source', 'track', 'wbr'])
128+
VOID_ELEMENTS = {'area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'keygen',
129+
'link', 'menuitem', 'meta', 'param', 'source', 'track', 'wbr'}
130130

131131
# Python 2 -> 3 compatibility
132132
try:
@@ -146,7 +146,7 @@ def __init__(self, target=None):
146146
self.__builder = target or ET.TreeBuilder()
147147

148148
def handle_starttag(self, tag, attrs):
149-
attrs = dict((k, v or '') for k, v in attrs)
149+
attrs = {k: v or '' for k, v in attrs}
150150
self.__builder.start(tag, attrs)
151151
if tag in VOID_ELEMENTS:
152152
self.__builder.end(tag)
@@ -155,7 +155,7 @@ def handle_endtag(self, tag):
155155
self.__builder.end(tag)
156156

157157
def handle_startendtag(self, tag, attrs):
158-
attrs = dict((k, v or '') for k, v in attrs)
158+
attrs = {k: v or '' for k, v in attrs}
159159
self.__builder.start(tag, attrs)
160160
self.__builder.end(tag)
161161

src/libcore/ops/function.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ pub trait FnMut<Args>: FnOnce<Args> {
160160
/// times. Because of this, if the only thing known about a type is that it
161161
/// implements `FnOnce`, it can only be called once.
162162
///
163-
/// `FnOnce` is implemented automatically by closure that might consume captured
163+
/// `FnOnce` is implemented automatically by closures that might consume captured
164164
/// variables, as well as all types that implement [`FnMut`], e.g., (safe)
165165
/// [function pointers] (since `FnOnce` is a supertrait of [`FnMut`]).
166166
///

src/librustdoc/html/static/themes/ayu.css

-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@ pre {
199199

200200
pre.rust .comment, pre.rust .doccomment {
201201
color: #788797;
202-
font-style: italic;
203202
}
204203

205204
nav:not(.sidebar) {

src/libstd/io/mod.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,6 @@
251251

252252
use crate::cmp;
253253
use crate::fmt;
254-
use crate::mem;
255254
use crate::memchr;
256255
use crate::ops::{Deref, DerefMut};
257256
use crate::ptr;
@@ -1435,12 +1434,15 @@ pub trait Write {
14351434
/// ```
14361435
#[unstable(feature = "write_all_vectored", issue = "70436")]
14371436
fn write_all_vectored(&mut self, mut bufs: &mut [IoSlice<'_>]) -> Result<()> {
1437+
// Guarantee that bufs is empty if it contains no data,
1438+
// to avoid calling write_vectored if there is no data to be written.
1439+
bufs = IoSlice::advance(bufs, 0);
14381440
while !bufs.is_empty() {
14391441
match self.write_vectored(bufs) {
14401442
Ok(0) => {
14411443
return Err(Error::new(ErrorKind::WriteZero, "failed to write whole buffer"));
14421444
}
1443-
Ok(n) => bufs = IoSlice::advance(mem::take(&mut bufs), n),
1445+
Ok(n) => bufs = IoSlice::advance(bufs, n),
14441446
Err(ref e) if e.kind() == ErrorKind::Interrupted => {}
14451447
Err(e) => return Err(e),
14461448
}
@@ -2958,6 +2960,7 @@ mod tests {
29582960
#[rustfmt::skip] // Becomes unreadable otherwise.
29592961
let tests: Vec<(_, &'static [u8])> = vec![
29602962
(vec![], &[]),
2963+
(vec![IoSlice::new(&[]), IoSlice::new(&[])], &[]),
29612964
(vec![IoSlice::new(&[1])], &[1]),
29622965
(vec![IoSlice::new(&[1, 2])], &[1, 2]),
29632966
(vec![IoSlice::new(&[1, 2, 3])], &[1, 2, 3]),

src/libstd/lazy.rs

+2
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,8 @@ mod tests {
827827
tx.send(msg).unwrap();
828828
break;
829829
}
830+
#[cfg(target_env = "sgx")]
831+
crate::thread::yield_now();
830832
}
831833
});
832834
}

src/test/ui/binding/func-arg-ref-pattern.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// run-pass
2-
// exec-env:RUST_POISON_ON_FREE=1
32

43
// Test argument patterns where we create refs to the inside of
54
// boxes. Make sure that we don't free the box as we match the

src/test/ui/issues/issue-18075.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// run-pass
2-
// exec-env:RUSTC_LOG=rustc::middle=debug
2+
// rustc-env:RUSTC_LOG=rustc::middle=debug
33

44
fn main() {
55
let b = 1isize;

src/test/ui/issues/issue-34932.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// run-pass
22
// compile-flags:--test
3-
// rustc-env:RUSTC_BOOTSTRAP_KEY=
43
#![cfg(any())] // This test should be configured away
54
#![feature(rustc_attrs)] // Test that this is allowed on stable/beta
65
#![feature(iter_arith_traits)] // Test that this is not unused

src/test/ui/logging-only-prints-once.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// run-pass
22
// ignore-windows
33
// ignore-emscripten no threads support
4-
// exec-env:RUSTC_LOG=debug
54

65
use std::cell::Cell;
76
use std::fmt;
@@ -19,10 +18,13 @@ impl fmt::Debug for Foo {
1918
}
2019

2120
pub fn main() {
22-
thread::spawn(move|| {
21+
thread::spawn(move || {
2322
let mut f = Foo(Cell::new(0));
2423
println!("{:?}", f);
2524
let Foo(ref mut f) = f;
2625
assert_eq!(f.get(), 1);
27-
}).join().ok().unwrap();
26+
})
27+
.join()
28+
.ok()
29+
.unwrap();
2830
}

src/test/ui/logging_before_rt_started.rs

-12
This file was deleted.

src/test/ui/mismatched_types/const-fn-in-trait.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// rustc-env:RUST_NEW_ERROR_FORMAT
2-
31
#![feature(const_fn)]
42

53
trait Foo {

src/test/ui/mismatched_types/const-fn-in-trait.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error[E0379]: functions in traits cannot be declared const
2-
--> $DIR/const-fn-in-trait.rs:7:5
2+
--> $DIR/const-fn-in-trait.rs:5:5
33
|
44
LL | const fn g();
55
| ^^^^^ functions in traits cannot be const
66

77
error[E0379]: functions in traits cannot be declared const
8-
--> $DIR/const-fn-in-trait.rs:11:5
8+
--> $DIR/const-fn-in-trait.rs:9:5
99
|
1010
LL | const fn f() -> u32 { 22 }
1111
| ^^^^^ functions in traits cannot be const

src/test/ui/mismatched_types/trait-impl-fn-incompatibility.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// rustc-env:RUST_NEW_ERROR_FORMAT
2-
31
trait Foo {
42
fn foo(x: u16);
53
fn bar(&mut self, bar: &mut Bar);

src/test/ui/mismatched_types/trait-impl-fn-incompatibility.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0053]: method `foo` has an incompatible type for trait
2-
--> $DIR/trait-impl-fn-incompatibility.rs:11:15
2+
--> $DIR/trait-impl-fn-incompatibility.rs:9:15
33
|
44
LL | fn foo(x: u16);
55
| --- type in trait
@@ -11,7 +11,7 @@ LL | fn foo(x: i16) { }
1111
found fn pointer `fn(i16)`
1212

1313
error[E0053]: method `bar` has an incompatible type for trait
14-
--> $DIR/trait-impl-fn-incompatibility.rs:12:28
14+
--> $DIR/trait-impl-fn-incompatibility.rs:10:28
1515
|
1616
LL | fn bar(&mut self, bar: &mut Bar);
1717
| -------- type in trait

src/test/ui/threads-sendsync/spawning-with-debug.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#![allow(unused_must_use)]
33
#![allow(unused_mut)]
44
// ignore-windows
5-
// exec-env:RUSTC_LOG=debug
5+
// exec-env:RUST_LOG=debug
66
// ignore-emscripten no threads support
77

88
// regression test for issue #10405, make sure we don't call println! too soon.
@@ -11,5 +11,5 @@ use std::thread::Builder;
1111

1212
pub fn main() {
1313
let mut t = Builder::new();
14-
t.spawn(move|| ());
14+
t.spawn(move || ());
1515
}

src/tools/compiletest/src/runtest.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ impl<'test> TestCx<'test> {
623623
.arg("-L")
624624
.arg(&aux_dir)
625625
.args(&self.props.compile_flags)
626-
.envs(self.props.exec_env.clone());
626+
.envs(self.props.rustc_env.clone());
627627
self.maybe_add_external_args(
628628
&mut rustc,
629629
self.split_maybe_args(&self.config.target_rustcflags),

0 commit comments

Comments
 (0)