Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 10 pull requests #83545

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
79348f4
`cargo update -p parking_lot -p parking_lot_core`
JohnTitor Mar 17, 2021
2b0e27e
`cargo update -p bytecount`
JohnTitor Mar 17, 2021
addf680
Use a single codegen unit to reduce non-determinism in srcloc.rs test
tmiasko Mar 20, 2021
3d64f8d
Join test thread to make assertion effective in sym.rs test case
tmiasko Mar 8, 2021
ae8ef70
Simplify and fix byte skipping in format! string parser
osa1 Mar 21, 2021
6c45ebe
format macro argument parsing fix
osa1 Mar 21, 2021
18748c9
Make # format easier to discover
alamb Mar 22, 2021
93737dc
Update library/alloc/src/fmt.rs
alamb Mar 22, 2021
b3ae90b
Tell GitHub to highlight `config.toml.example` as TOML
camelid Mar 24, 2021
4590d54
Use the direct link to the platform support page
JohnTitor Mar 26, 2021
656f6ac
Handle llvm_version with suffix like "12.0.0libcxx"
12101111 Mar 26, 2021
147316a
Document that the SocketAddr memory representation is not stable
faern Mar 26, 2021
7ca2c98
fix doc comment for `ty::Dynamic
lcnr Mar 26, 2021
929e88a
Rollup merge of #83239 - JohnTitor:reduce-deps, r=Mark-Simulacrum
JohnTitor Mar 27, 2021
36e0a42
Rollup merge of #83328 - tmiasko:asm-test, r=joshtriplett
JohnTitor Mar 27, 2021
cfd81d9
Rollup merge of #83343 - osa1:issue83340, r=jackh726
JohnTitor Mar 27, 2021
188d53b
Rollup merge of #83348 - osa1:issue83344, r=jackh726
JohnTitor Mar 27, 2021
3de8fec
Rollup merge of #83388 - alamb:alamb/fmt-dcs, r=Mark-Simulacrum
JohnTitor Mar 27, 2021
dedf95b
Rollup merge of #83431 - camelid:config-example-gitattributes, r=Mark…
JohnTitor Mar 27, 2021
94c3605
Rollup merge of #83508 - JohnTitor:platform-support-link, r=joshtriplett
JohnTitor Mar 27, 2021
b11da2b
Rollup merge of #83511 - 12101111:fix-llvm-version-suffix, r=Mark-Sim…
JohnTitor Mar 27, 2021
3d5787b
Rollup merge of #83524 - faern:document-socketaddr-mem-layout, r=sfac…
JohnTitor Mar 27, 2021
597ef13
Rollup merge of #83525 - rust-lang:lcnr-doc-patch, r=jonas-schievink
JohnTitor Mar 27, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
src/etc/installer/gfx/* binary
src/vendor/** -text
Cargo.lock linguist-generated=false
config.toml.example linguist-language=TOML

# Older git versions try to fix line endings on images and fonts, this prevents it.
*.png binary
Expand Down
41 changes: 19 additions & 22 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,11 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7"

[[package]]
name = "bytecount"
version = "0.6.0"
version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b0017894339f586ccb943b01b9555de56770c11cda818e7e3d8bd93f4ed7f46e"
checksum = "72feb31ffc86498dacdbd0fcebb56138e7177a8cc5cea4516031d15ae85a742e"
dependencies = [
"packed_simd",
"packed_simd_2",
]

[[package]]
Expand Down Expand Up @@ -629,15 +629,6 @@ dependencies = [
"unicode-normalization",
]

[[package]]
name = "cloudabi"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4344512281c643ae7638bbabc3af17a11307803ec8f0fcad9fae512a8bf36467"
dependencies = [
"bitflags",
]

[[package]]
name = "cmake"
version = "0.1.44"
Expand Down Expand Up @@ -1939,6 +1930,12 @@ dependencies = [
"pkg-config",
]

[[package]]
name = "libm"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a"

[[package]]
name = "libnghttp2-sys"
version = "0.1.4+1.41.0"
Expand Down Expand Up @@ -2482,12 +2479,13 @@ dependencies = [
]

[[package]]
name = "packed_simd"
version = "0.3.3"
name = "packed_simd_2"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a85ea9fc0d4ac0deb6fe7911d38786b32fc11119afd9e9d38b84ff691ce64220"
checksum = "3278e0492f961fd4ae70909f56b2723a7e8d01a228427294e19cdfdebda89a17"
dependencies = [
"cfg-if 0.1.10",
"libm",
]

[[package]]
Expand Down Expand Up @@ -2530,9 +2528,9 @@ dependencies = [

[[package]]
name = "parking_lot"
version = "0.11.0"
version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4893845fa2ca272e647da5d0e46660a314ead9c2fdd9a883aabc32e481a8733"
checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb"
dependencies = [
"instant",
"lock_api",
Expand All @@ -2541,15 +2539,14 @@ dependencies = [

[[package]]
name = "parking_lot_core"
version = "0.8.0"
version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c361aa727dd08437f2f1447be8b59a33b0edd15e0fcee698f935613d9efbca9b"
checksum = "fa7a782938e745763fe6907fc6ba86946d72f49fe7e21de074e08128a99fb018"
dependencies = [
"cfg-if 0.1.10",
"cloudabi",
"cfg-if 1.0.0",
"instant",
"libc",
"redox_syscall 0.1.57",
"redox_syscall 0.2.5",
"smallvec 1.6.1",
"winapi 0.3.9",
]
Expand Down
24 changes: 12 additions & 12 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Compiler
- [Added tier 3 support for `i386-unknown-linux-gnu` and `i486-unknown-linux-gnu` targets.][80662]
- [The `target-cpu=native` option will now detect individual features of CPUs.][80749]

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

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

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

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

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

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

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

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

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

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

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


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

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

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

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

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

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

Libraries
Expand Down Expand Up @@ -1770,7 +1770,7 @@ Compiler
output of successful tests.][62600]


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

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

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

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

Version 1.37.0 (2019-08-15)
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/ty/sty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ pub enum TyKind<'tcx> {
/// ```
FnPtr(PolyFnSig<'tcx>),

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

/// The anonymous type of a closure. Used to represent the type of
Expand Down
33 changes: 15 additions & 18 deletions compiler/rustc_parse_format/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,13 @@ impl<'a> Iterator for Parser<'a> {
Some(String(self.string(pos + 1)))
} else {
let arg = self.argument();
if let Some(end) = self.must_consume('}') {
let start = self.to_span_index(pos);
let end = self.to_span_index(end + 1);
if let Some(rbrace_byte_idx) = self.must_consume('}') {
let lbrace_inner_offset = self.to_span_index(pos);
let rbrace_inner_offset = self.to_span_index(rbrace_byte_idx);
if self.is_literal {
self.arg_places.push(start.to(end));
self.arg_places.push(
lbrace_inner_offset.to(InnerOffset(rbrace_inner_offset.0 + 1)),
);
}
}
Some(NextArgument(arg))
Expand Down Expand Up @@ -735,25 +737,24 @@ fn find_skips_from_snippet(
};

fn find_skips(snippet: &str, is_raw: bool) -> Vec<usize> {
let mut eat_ws = false;
let mut s = snippet.char_indices().peekable();
let mut skips = vec![];
while let Some((pos, c)) = s.next() {
match (c, s.peek()) {
// skip whitespace and empty lines ending in '\\'
('\\', Some((next_pos, '\n'))) if !is_raw => {
eat_ws = true;
skips.push(pos);
skips.push(*next_pos);
let _ = s.next();
}
('\\', Some((next_pos, '\n' | 'n' | 't'))) if eat_ws => {
skips.push(pos);
skips.push(*next_pos);
let _ = s.next();
}
(' ' | '\n' | '\t', _) if eat_ws => {
skips.push(pos);

while let Some((pos, c)) = s.peek() {
if matches!(c, ' ' | '\n' | '\t') {
skips.push(*pos);
let _ = s.next();
} else {
break;
}
}
}
('\\', Some((next_pos, 'n' | 't' | 'r' | '0' | '\\' | '\'' | '\"'))) => {
skips.push(*next_pos);
Expand Down Expand Up @@ -804,10 +805,6 @@ fn find_skips_from_snippet(
}
}
}
_ if eat_ws => {
// `take_while(|c| c.is_whitespace())`
eat_ws = false;
}
_ => {}
}
}
Expand Down
6 changes: 5 additions & 1 deletion library/alloc/src/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
//! format!("{value}", value=4); // => "4"
//! format!("{} {}", 1, 2); // => "1 2"
//! format!("{:04}", 42); // => "0042" with leading zeros
//! format!("{:#?}", (100, 200)); // => "(
//! // 100,
//! // 200,
//! // )"
//! ```
//!
//! From these, you can see that the first argument is a format string. It is
Expand Down Expand Up @@ -163,7 +167,7 @@
//! * `-` - Currently not used
//! * `#` - This flag indicates that the "alternate" form of printing should
//! be used. The alternate forms are:
//! * `#?` - pretty-print the [`Debug`] formatting
//! * `#?` - pretty-print the [`Debug`] formatting (adds linebreaks and indentation)
//! * `#x` - precedes the argument with a `0x`
//! * `#X` - precedes the argument with a `0x`
//! * `#b` - precedes the argument with a `0b`
Expand Down
10 changes: 8 additions & 2 deletions library/std/src/net/addr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ pub enum SocketAddr {
/// See [`SocketAddr`] for a type encompassing both IPv4 and IPv6 socket addresses.
///
/// The size of a `SocketAddrV4` struct may vary depending on the target operating
/// system.
/// system. Do not assume that this type has the same memory layout as the underlying
/// system representation.
///
/// [IETF RFC 793]: https://tools.ietf.org/html/rfc793
/// [`IPv4` address]: Ipv4Addr
Expand All @@ -76,6 +77,8 @@ pub enum SocketAddr {
#[derive(Copy)]
#[stable(feature = "rust1", since = "1.0.0")]
pub struct SocketAddrV4 {
// Do not assume that this struct is implemented as the underlying system representation.
// The memory layout is not part of the stable interface that std exposes.
inner: c::sockaddr_in,
}

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

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/asm/srcloc.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// min-llvm-version: 10.0.1
// only-x86_64
// build-fail

// compile-flags: -Ccodegen-units=1
#![feature(asm)]

// Checks that inline asm errors are mapped to the correct line in the source code.
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/asm/sym.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,5 @@ fn main() {
std::thread::spawn(|| {
assert_eq!(static_addr!(S1), &S1 as *const u32);
assert_eq!(static_tls_addr!(S2), &S2 as *const u32);
});
}).join().unwrap();
}
8 changes: 8 additions & 0 deletions src/test/ui/macros/issue-83340.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// check-fail

fn main() {
println!(
"\
\n {} │", //~ ERROR: 1 positional argument in format string, but no arguments were given
);
}
8 changes: 8 additions & 0 deletions src/test/ui/macros/issue-83340.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
error: 1 positional argument in format string, but no arguments were given
--> $DIR/issue-83340.rs:6:4
|
LL | \n {} │",
| ^^

error: aborting due to previous error

6 changes: 6 additions & 0 deletions src/test/ui/macros/issue-83344.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// chekc-fail

fn main() {
println!("{}\
"); //~^ ERROR: 1 positional argument in format string, but no arguments were given
}
8 changes: 8 additions & 0 deletions src/test/ui/macros/issue-83344.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
error: 1 positional argument in format string, but no arguments were given
--> $DIR/issue-83344.rs:4:15
|
LL | println!("{}\
| ^^

error: aborting due to previous error

Loading