Skip to content

Commit feaac19

Browse files
committed
Auto merge of rust-lang#83547 - JohnTitor:rollup-qh7j6hg, r=JohnTitor
Rollup of 9 pull requests Successful merges: - rust-lang#83239 (Remove/replace some outdated crates from the dependency tree) - rust-lang#83328 (Fixes to inline assmebly tests) - rust-lang#83343 (Simplify and fix byte skipping in format! string parser) - rust-lang#83388 (Make # pretty print format easier to discover) - rust-lang#83431 (Tell GitHub to highlight `config.toml.example` as TOML) - rust-lang#83508 (Use the direct link to the platform support page) - rust-lang#83511 (compiletest: handle llvm_version with suffix like "12.0.0libcxx") - rust-lang#83524 (Document that the SocketAddr memory representation is not stable) - rust-lang#83525 (fix doc comment for `ty::Dynamic`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents f811f14 + 1b01e0d commit feaac19

File tree

14 files changed

+82
-57
lines changed

14 files changed

+82
-57
lines changed

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
src/etc/installer/gfx/* binary
1010
src/vendor/** -text
1111
Cargo.lock linguist-generated=false
12+
config.toml.example linguist-language=TOML
1213

1314
# Older git versions try to fix line endings on images and fonts, this prevents it.
1415
*.png binary

Cargo.lock

+19-22
Original file line numberDiff line numberDiff line change
@@ -254,11 +254,11 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7"
254254

255255
[[package]]
256256
name = "bytecount"
257-
version = "0.6.0"
257+
version = "0.6.2"
258258
source = "registry+https://github.com/rust-lang/crates.io-index"
259-
checksum = "b0017894339f586ccb943b01b9555de56770c11cda818e7e3d8bd93f4ed7f46e"
259+
checksum = "72feb31ffc86498dacdbd0fcebb56138e7177a8cc5cea4516031d15ae85a742e"
260260
dependencies = [
261-
"packed_simd",
261+
"packed_simd_2",
262262
]
263263

264264
[[package]]
@@ -629,15 +629,6 @@ dependencies = [
629629
"unicode-normalization",
630630
]
631631

632-
[[package]]
633-
name = "cloudabi"
634-
version = "0.1.0"
635-
source = "registry+https://github.com/rust-lang/crates.io-index"
636-
checksum = "4344512281c643ae7638bbabc3af17a11307803ec8f0fcad9fae512a8bf36467"
637-
dependencies = [
638-
"bitflags",
639-
]
640-
641632
[[package]]
642633
name = "cmake"
643634
version = "0.1.44"
@@ -1939,6 +1930,12 @@ dependencies = [
19391930
"pkg-config",
19401931
]
19411932

1933+
[[package]]
1934+
name = "libm"
1935+
version = "0.1.4"
1936+
source = "registry+https://github.com/rust-lang/crates.io-index"
1937+
checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a"
1938+
19421939
[[package]]
19431940
name = "libnghttp2-sys"
19441941
version = "0.1.4+1.41.0"
@@ -2482,12 +2479,13 @@ dependencies = [
24822479
]
24832480

24842481
[[package]]
2485-
name = "packed_simd"
2486-
version = "0.3.3"
2482+
name = "packed_simd_2"
2483+
version = "0.3.4"
24872484
source = "registry+https://github.com/rust-lang/crates.io-index"
2488-
checksum = "a85ea9fc0d4ac0deb6fe7911d38786b32fc11119afd9e9d38b84ff691ce64220"
2485+
checksum = "3278e0492f961fd4ae70909f56b2723a7e8d01a228427294e19cdfdebda89a17"
24892486
dependencies = [
24902487
"cfg-if 0.1.10",
2488+
"libm",
24912489
]
24922490

24932491
[[package]]
@@ -2530,9 +2528,9 @@ dependencies = [
25302528

25312529
[[package]]
25322530
name = "parking_lot"
2533-
version = "0.11.0"
2531+
version = "0.11.1"
25342532
source = "registry+https://github.com/rust-lang/crates.io-index"
2535-
checksum = "a4893845fa2ca272e647da5d0e46660a314ead9c2fdd9a883aabc32e481a8733"
2533+
checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb"
25362534
dependencies = [
25372535
"instant",
25382536
"lock_api",
@@ -2541,15 +2539,14 @@ dependencies = [
25412539

25422540
[[package]]
25432541
name = "parking_lot_core"
2544-
version = "0.8.0"
2542+
version = "0.8.3"
25452543
source = "registry+https://github.com/rust-lang/crates.io-index"
2546-
checksum = "c361aa727dd08437f2f1447be8b59a33b0edd15e0fcee698f935613d9efbca9b"
2544+
checksum = "fa7a782938e745763fe6907fc6ba86946d72f49fe7e21de074e08128a99fb018"
25472545
dependencies = [
2548-
"cfg-if 0.1.10",
2549-
"cloudabi",
2546+
"cfg-if 1.0.0",
25502547
"instant",
25512548
"libc",
2552-
"redox_syscall 0.1.57",
2549+
"redox_syscall 0.2.5",
25532550
"smallvec 1.6.1",
25542551
"winapi 0.3.9",
25552552
]

RELEASES.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Compiler
3535
- [Added tier 3 support for `i386-unknown-linux-gnu` and `i486-unknown-linux-gnu` targets.][80662]
3636
- [The `target-cpu=native` option will now detect individual features of CPUs.][80749]
3737

38-
\* Refer to Rust's [platform support page][forge-platform-support] for more
38+
\* Refer to Rust's [platform support page][platform-support-doc] for more
3939
information on Rust's tiered platform support.
4040

4141
Libraries
@@ -183,7 +183,7 @@ Compiler
183183
- [The `x86_64-unknown-freebsd` is now built with the full toolset.][79484]
184184
- [Dropped support for all cloudabi targets.][78439]
185185

186-
\* Refer to Rust's [platform support page][forge-platform-support] for more
186+
\* Refer to Rust's [platform support page][platform-support-doc] for more
187187
information on Rust's tiered platform support.
188188

189189
Libraries
@@ -360,7 +360,7 @@ Compiler
360360
- [Output from threads spawned in tests is now captured.][78227]
361361
- [Change os and vendor values to "none" and "unknown" for some targets][78951]
362362

363-
\* Refer to Rust's [platform support page][forge-platform-support] for more
363+
\* Refer to Rust's [platform support page][platform-support-doc] for more
364364
information on Rust's tiered platform support.
365365

366366
Libraries
@@ -465,7 +465,7 @@ Compiler
465465
Note: If you're using cargo you must explicitly pass the `--target` flag.
466466
- [Added tier 2\* support for `aarch64-unknown-linux-musl`.][76420]
467467

468-
\* Refer to Rust's [platform support page][forge-platform-support] for more
468+
\* Refer to Rust's [platform support page][platform-support-doc] for more
469469
information on Rust's tiered platform support.
470470

471471
Libraries
@@ -604,7 +604,7 @@ Compiler
604604
- [Upgrade the FreeBSD toolchain to version 11.4][75204]
605605
- [`RUST_BACKTRACE`'s output is now more compact.][75048]
606606

607-
\* Refer to Rust's [platform support page][forge-platform-support] for more
607+
\* Refer to Rust's [platform support page][platform-support-doc] for more
608608
information on Rust's tiered platform support.
609609

610610
Libraries
@@ -889,7 +889,7 @@ Compiler
889889
- [Added tier 3 support for the `thumbv7a-uwp-windows-msvc` target.][72133]
890890
- [Upgraded to LLVM 10.][67759]
891891

892-
\* Refer to Rust's [platform support page][forge-platform-support] for more
892+
\* Refer to Rust's [platform support page][platform-support-doc] for more
893893
information on Rust's tiered platform support.
894894

895895

@@ -1398,7 +1398,7 @@ Compiler
13981398
pointing to the location where they were called, rather than
13991399
`core`'s internals. ][67887]
14001400

1401-
\* Refer to Rust's [platform support page][forge-platform-support] for more
1401+
\* Refer to Rust's [platform support page][platform-support-doc] for more
14021402
information on Rust's tiered platform support.
14031403

14041404
Libraries
@@ -1496,7 +1496,7 @@ Compiler
14961496
- [You can now provide `--extern` flag without a path, indicating that it is
14971497
available from the search path or specified with an `-L` flag.][64882]
14981498

1499-
\* Refer to Rust's [platform support page][forge-platform-support] for more
1499+
\* Refer to Rust's [platform support page][platform-support-doc] for more
15001500
information on Rust's tiered platform support.
15011501

15021502
[argfile-docs]: https://doc.rust-lang.org/nightly/rustc/command-line-arguments.html#path-load-command-line-flags-from-a-path
@@ -1620,7 +1620,7 @@ Compiler
16201620
- [Added tier 3 support for the `mips64-unknown-linux-muslabi64`, and
16211621
`mips64el-unknown-linux-muslabi64` targets.][65843]
16221622

1623-
\* Refer to Rust's [platform support page][forge-platform-support] for more
1623+
\* Refer to Rust's [platform support page][platform-support-doc] for more
16241624
information on Rust's tiered platform support.
16251625

16261626
Libraries
@@ -1770,7 +1770,7 @@ Compiler
17701770
output of successful tests.][62600]
17711771

17721772

1773-
\* Refer to Rust's [platform support page][forge-platform-support] for more
1773+
\* Refer to Rust's [platform support page][platform-support-doc] for more
17741774
information on Rust's tiered platform support.
17751775

17761776
Libraries
@@ -1864,7 +1864,7 @@ Compiler
18641864
- [Added tier 3 support for the `riscv32i-unknown-none-elf` target.][62784]
18651865
- [Upgraded to LLVM 9.][62592]
18661866

1867-
\* Refer to Rust's [platform support page][forge-platform-support] for more
1867+
\* Refer to Rust's [platform support page][platform-support-doc] for more
18681868
information on Rust's tiered platform support.
18691869

18701870
Libraries
@@ -1951,7 +1951,7 @@ Compatibility Notes
19511951
[`Duration::mul_f32`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.mul_f32
19521952
[`Duration::mul_f64`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.mul_f64
19531953
[`any::type_name`]: https://doc.rust-lang.org/std/any/fn.type_name.html
1954-
[forge-platform-support]: https://forge.rust-lang.org/release/platform-support.html
1954+
[platform-support-doc]: https://doc.rust-lang.org/nightly/rustc/platform-support.html
19551955
[pipeline-internals]: https://internals.rust-lang.org/t/evaluating-pipelined-rustc-compilation/10199
19561956

19571957
Version 1.37.0 (2019-08-15)

compiler/rustc_middle/src/ty/sty.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ pub enum TyKind<'tcx> {
160160
/// ```
161161
FnPtr(PolyFnSig<'tcx>),
162162

163-
/// A trait, defined with `trait`.
163+
/// A trait object. Written as `dyn for<'b> Trait<'b, Assoc = u32> + Send + 'a`.
164164
Dynamic(&'tcx List<Binder<ExistentialPredicate<'tcx>>>, ty::Region<'tcx>),
165165

166166
/// The anonymous type of a closure. Used to represent the type of

compiler/rustc_parse_format/src/lib.rs

+9-14
Original file line numberDiff line numberDiff line change
@@ -735,25 +735,24 @@ fn find_skips_from_snippet(
735735
};
736736

737737
fn find_skips(snippet: &str, is_raw: bool) -> Vec<usize> {
738-
let mut eat_ws = false;
739738
let mut s = snippet.char_indices().peekable();
740739
let mut skips = vec![];
741740
while let Some((pos, c)) = s.next() {
742741
match (c, s.peek()) {
743742
// skip whitespace and empty lines ending in '\\'
744743
('\\', Some((next_pos, '\n'))) if !is_raw => {
745-
eat_ws = true;
746744
skips.push(pos);
747745
skips.push(*next_pos);
748746
let _ = s.next();
749-
}
750-
('\\', Some((next_pos, '\n' | 'n' | 't'))) if eat_ws => {
751-
skips.push(pos);
752-
skips.push(*next_pos);
753-
let _ = s.next();
754-
}
755-
(' ' | '\n' | '\t', _) if eat_ws => {
756-
skips.push(pos);
747+
748+
while let Some((pos, c)) = s.peek() {
749+
if matches!(c, ' ' | '\n' | '\t') {
750+
skips.push(*pos);
751+
let _ = s.next();
752+
} else {
753+
break;
754+
}
755+
}
757756
}
758757
('\\', Some((next_pos, 'n' | 't' | 'r' | '0' | '\\' | '\'' | '\"'))) => {
759758
skips.push(*next_pos);
@@ -804,10 +803,6 @@ fn find_skips_from_snippet(
804803
}
805804
}
806805
}
807-
_ if eat_ws => {
808-
// `take_while(|c| c.is_whitespace())`
809-
eat_ws = false;
810-
}
811806
_ => {}
812807
}
813808
}

library/alloc/src/fmt.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
//! format!("{value}", value=4); // => "4"
2020
//! format!("{} {}", 1, 2); // => "1 2"
2121
//! format!("{:04}", 42); // => "0042" with leading zeros
22+
//! format!("{:#?}", (100, 200)); // => "(
23+
//! // 100,
24+
//! // 200,
25+
//! // )"
2226
//! ```
2327
//!
2428
//! From these, you can see that the first argument is a format string. It is
@@ -163,7 +167,7 @@
163167
//! * `-` - Currently not used
164168
//! * `#` - This flag indicates that the "alternate" form of printing should
165169
//! be used. The alternate forms are:
166-
//! * `#?` - pretty-print the [`Debug`] formatting
170+
//! * `#?` - pretty-print the [`Debug`] formatting (adds linebreaks and indentation)
167171
//! * `#x` - precedes the argument with a `0x`
168172
//! * `#X` - precedes the argument with a `0x`
169173
//! * `#b` - precedes the argument with a `0b`

library/std/src/net/addr.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ pub enum SocketAddr {
5757
/// See [`SocketAddr`] for a type encompassing both IPv4 and IPv6 socket addresses.
5858
///
5959
/// The size of a `SocketAddrV4` struct may vary depending on the target operating
60-
/// system.
60+
/// system. Do not assume that this type has the same memory layout as the underlying
61+
/// system representation.
6162
///
6263
/// [IETF RFC 793]: https://tools.ietf.org/html/rfc793
6364
/// [`IPv4` address]: Ipv4Addr
@@ -76,6 +77,8 @@ pub enum SocketAddr {
7677
#[derive(Copy)]
7778
#[stable(feature = "rust1", since = "1.0.0")]
7879
pub struct SocketAddrV4 {
80+
// Do not assume that this struct is implemented as the underlying system representation.
81+
// The memory layout is not part of the stable interface that std exposes.
7982
inner: c::sockaddr_in,
8083
}
8184

@@ -88,7 +91,8 @@ pub struct SocketAddrV4 {
8891
/// See [`SocketAddr`] for a type encompassing both IPv4 and IPv6 socket addresses.
8992
///
9093
/// The size of a `SocketAddrV6` struct may vary depending on the target operating
91-
/// system.
94+
/// system. Do not assume that this type has the same memory layout as the underlying
95+
/// system representation.
9296
///
9397
/// [IETF RFC 2553, Section 3.3]: https://tools.ietf.org/html/rfc2553#section-3.3
9498
/// [`IPv6` address]: Ipv6Addr
@@ -107,6 +111,8 @@ pub struct SocketAddrV4 {
107111
#[derive(Copy)]
108112
#[stable(feature = "rust1", since = "1.0.0")]
109113
pub struct SocketAddrV6 {
114+
// Do not assume that this struct is implemented as the underlying system representation.
115+
// The memory layout is not part of the stable interface that std exposes.
110116
inner: c::sockaddr_in6,
111117
}
112118

src/test/ui/asm/srcloc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// min-llvm-version: 10.0.1
22
// only-x86_64
33
// build-fail
4-
4+
// compile-flags: -Ccodegen-units=1
55
#![feature(asm)]
66

77
// Checks that inline asm errors are mapped to the correct line in the source code.

src/test/ui/asm/sym.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,5 @@ fn main() {
7676
std::thread::spawn(|| {
7777
assert_eq!(static_addr!(S1), &S1 as *const u32);
7878
assert_eq!(static_tls_addr!(S2), &S2 as *const u32);
79-
});
79+
}).join().unwrap();
8080
}

src/test/ui/macros/issue-83340.rs

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// check-fail
2+
3+
fn main() {
4+
println!(
5+
"\
6+
\n {} │", //~ ERROR: 1 positional argument in format string, but no arguments were given
7+
);
8+
}

src/test/ui/macros/issue-83340.stderr

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: 1 positional argument in format string, but no arguments were given
2+
--> $DIR/issue-83340.rs:6:4
3+
|
4+
LL | \n {} │",
5+
| ^^
6+
7+
error: aborting due to previous error
8+

src/tools/compiletest/src/header.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -973,7 +973,11 @@ fn parse_normalization_string(line: &mut &str) -> Option<String> {
973973
}
974974

975975
pub fn extract_llvm_version(version: &str) -> Option<u32> {
976-
let version_without_suffix = version.trim_end_matches("git").split('-').next().unwrap();
976+
let pat = |c: char| !c.is_ascii_digit() && c != '.';
977+
let version_without_suffix = match version.find(pat) {
978+
Some(pos) => &version[..pos],
979+
None => version,
980+
};
977981
let components: Vec<u32> = version_without_suffix
978982
.split('.')
979983
.map(|s| s.parse().expect("Malformed version component"))

src/tools/compiletest/src/tests.rs

+4
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,8 @@ fn test_extract_llvm_version() {
6868
assert_eq!(extract_llvm_version("9.0.1-rust-1.43.0-dev"), Some(90001));
6969
assert_eq!(extract_llvm_version("9.3.1-rust-1.43.0-dev"), Some(90301));
7070
assert_eq!(extract_llvm_version("10.0.0-rust"), Some(100000));
71+
assert_eq!(extract_llvm_version("11.1.0"), Some(110100));
72+
assert_eq!(extract_llvm_version("12.0.0libcxx"), Some(120000));
73+
assert_eq!(extract_llvm_version("12.0.0-rc3"), Some(120000));
74+
assert_eq!(extract_llvm_version("13.0.0git"), Some(130000));
7175
}

src/tools/tidy/src/deps.rs

-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ const EXCEPTIONS: &[(&str, &str)] = &[
3232
("fuchsia-zircon", "BSD-3-Clause"), // rustdoc, rustc, cargo (jobserver & tempdir)
3333
("colored", "MPL-2.0"), // rustfmt
3434
("ordslice", "Apache-2.0"), // rls
35-
("cloudabi", "BSD-2-Clause"), // (rls -> crossbeam-channel 0.2 -> rand 0.5)
3635
("ryu", "Apache-2.0 OR BSL-1.0"), // rls/cargo/... (because of serde)
3736
("bytesize", "Apache-2.0"), // cargo
3837
("im-rc", "MPL-2.0+"), // cargo
@@ -76,7 +75,6 @@ const PERMITTED_DEPENDENCIES: &[&str] = &[
7675
"cfg-if",
7776
"chalk-derive",
7877
"chalk-ir",
79-
"cloudabi",
8078
"cmake",
8179
"compiler_builtins",
8280
"cpuid-bool",

0 commit comments

Comments
 (0)