Auto merge of #145923 - matthiaskrgr:rollup-rkejtos, r=matthiaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#144274 (add Option::reduce)
 - rust-lang/rust#145562 (Simplify macro generating ToString implementations for `&…&str`)
 - rust-lang/rust#145625 (improve float to_degrees/to_radians rounding comments and impl)
 - rust-lang/rust#145740 (Introduce a `[workspace.dependencies`] section in the top-level `Cargo.toml`)
 - rust-lang/rust#145885 (Inherit TCC in debuginfo tests on macOS)
 - rust-lang/rust#145905 (Stop calling unwrap when format foreign has trailing dollar)

r? `@ghost`
`@rustbot` modify labels: rollup
This commit is contained in:
bors
2025-08-27 12:35:21 +00:00
70 changed files with 302 additions and 167 deletions
+10
View File
@@ -59,6 +59,16 @@ exclude = [
"obj",
]
[workspace.dependencies]
# tidy-alphabetical-start
bitflags = "2.9.3"
itertools = "0.12.1"
memchr = "2.7.5"
rustc-literal-escaper = "0.0.5"
thin-vec = "0.2.14"
tracing = "0.1.37"
# tidy-alphabetical-end
[profile.release.package.rustc_thread_pool]
# The rustc fork of Rayon has deadlock detection code which intermittently
# causes overflows in the CI (see https://github.com/rust-lang/rust/issues/90227)
+2 -2
View File
@@ -5,7 +5,7 @@ edition = "2024"
[dependencies]
# tidy-alphabetical-start
bitflags = "2.4.1"
bitflags.workspace = true
rand = { version = "0.9.0", default-features = false, optional = true }
rand_xoshiro = { version = "0.7.0", optional = true }
rustc_data_structures = { path = "../rustc_data_structures", optional = true }
@@ -15,7 +15,7 @@ rustc_index = { path = "../rustc_index", default-features = false }
rustc_macros = { path = "../rustc_macros", optional = true }
rustc_serialize = { path = "../rustc_serialize", optional = true }
rustc_span = { path = "../rustc_span", optional = true }
tracing = "0.1"
tracing.workspace = true
# tidy-alphabetical-end
[features]
+4 -4
View File
@@ -5,9 +5,9 @@ edition = "2024"
[dependencies]
# tidy-alphabetical-start
bitflags = "2.4.1"
memchr = "2.7.4"
rustc-literal-escaper = "0.0.5"
bitflags.workspace = true
memchr.workspace = true
rustc-literal-escaper.workspace = true
rustc_ast_ir = { path = "../rustc_ast_ir" }
rustc_data_structures = { path = "../rustc_data_structures" }
rustc_index = { path = "../rustc_index" }
@@ -15,6 +15,6 @@ rustc_macros = { path = "../rustc_macros" }
rustc_serialize = { path = "../rustc_serialize" }
rustc_span = { path = "../rustc_span" }
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
thin-vec = "0.2.12"
thin-vec.workspace = true
tracing = "0.1"
# tidy-alphabetical-end
+2 -2
View File
@@ -24,6 +24,6 @@ rustc_session = { path = "../rustc_session" }
rustc_span = { path = "../rustc_span" }
rustc_target = { path = "../rustc_target" }
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
thin-vec = "0.2.12"
tracing = "0.1"
thin-vec.workspace = true
tracing.workspace = true
# tidy-alphabetical-end
+2 -2
View File
@@ -5,7 +5,7 @@ edition = "2024"
[dependencies]
# tidy-alphabetical-start
itertools = "0.12"
itertools.workspace = true
rustc_abi = { path = "../rustc_abi" }
rustc_ast = { path = "../rustc_ast" }
rustc_ast_pretty = { path = "../rustc_ast_pretty" }
@@ -18,5 +18,5 @@ rustc_macros = { path = "../rustc_macros" }
rustc_session = { path = "../rustc_session" }
rustc_span = { path = "../rustc_span" }
rustc_target = { path = "../rustc_target" }
thin-vec = "0.2.12"
thin-vec.workspace = true
# tidy-alphabetical-end
+2 -2
View File
@@ -5,7 +5,7 @@ edition = "2024"
[dependencies]
# tidy-alphabetical-start
itertools = "0.12"
itertools.workspace = true
rustc_ast = { path = "../rustc_ast" }
rustc_lexer = { path = "../rustc_lexer" }
rustc_span = { path = "../rustc_span" }
@@ -13,5 +13,5 @@ rustc_span = { path = "../rustc_span" }
[dev-dependencies]
# tidy-alphabetical-start
thin-vec = "0.2.12"
thin-vec.workspace = true
# tidy-alphabetical-end
+1 -1
View File
@@ -17,5 +17,5 @@ rustc_macros = { path = "../rustc_macros" }
rustc_parse = { path = "../rustc_parse" }
rustc_session = { path = "../rustc_session" }
rustc_span = { path = "../rustc_span" }
thin-vec = "0.2.12"
thin-vec.workspace = true
# tidy-alphabetical-end
+2 -2
View File
@@ -6,7 +6,7 @@ edition = "2024"
[dependencies]
# tidy-alphabetical-start
either = "1.5.0"
itertools = "0.12"
itertools.workspace = true
polonius-engine = "0.13.0"
rustc_abi = { path = "../rustc_abi" }
rustc_data_structures = { path = "../rustc_data_structures" }
@@ -25,5 +25,5 @@ rustc_span = { path = "../rustc_span" }
rustc_trait_selection = { path = "../rustc_trait_selection" }
rustc_traits = { path = "../rustc_traits" }
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
tracing = "0.1"
tracing.workspace = true
# tidy-alphabetical-end
+2 -2
View File
@@ -30,6 +30,6 @@ rustc_session = { path = "../rustc_session" }
rustc_span = { path = "../rustc_span" }
rustc_target = { path = "../rustc_target" }
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
thin-vec = "0.2.12"
tracing = "0.1"
thin-vec.workspace = true
tracing.workspace = true
# tidy-alphabetical-end
@@ -416,7 +416,7 @@ macro_rules! move_to {
// Yes, this *is* the parameter.
Some(('$', end2)) => {
state = Flags;
parameter = Some(at.slice_between(end).unwrap().parse().unwrap());
parameter = at.slice_between(end).unwrap().parse().ok();
move_to!(end2);
}
// Wait, no, actually, it's the width.
+3 -3
View File
@@ -8,11 +8,11 @@ test = false
[dependencies]
# tidy-alphabetical-start
bitflags = "2.4.1"
bitflags.workspace = true
# To avoid duplicate dependencies, this should match the version of gimli used
# by `rustc_codegen_ssa` via its `thorin-dwp` dependency.
gimli = "0.31"
itertools = "0.12"
itertools.workspace = true
libc = "0.2"
measureme = "12.0.1"
object = { version = "0.37.0", default-features = false, features = ["std", "read"] }
@@ -40,7 +40,7 @@ rustc_target = { path = "../rustc_target" }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
tracing = "0.1"
tracing.workspace = true
# tidy-alphabetical-end
[features]
+4 -4
View File
@@ -6,12 +6,12 @@ edition = "2024"
[dependencies]
# tidy-alphabetical-start
ar_archive_writer = "0.4.2"
bitflags = "2.4.1"
bitflags.workspace = true
bstr = "1.11.3"
# `cc` updates often break things, so we pin it here. Cargo enforces "max 1 semver-compat version
# per crate", so if you change this, you need to also change it in `rustc_llvm`.
cc = "=1.2.16"
itertools = "0.12"
itertools.workspace = true
pathdiff = "0.2.0"
regex = "1.4"
rustc_abi = { path = "../rustc_abi" }
@@ -40,9 +40,9 @@ rustc_trait_selection = { path = "../rustc_trait_selection" }
serde_json = "1.0.59"
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
tempfile = "3.2"
thin-vec = "0.2.12"
thin-vec.workspace = true
thorin-dwp = "0.9"
tracing = "0.1"
tracing.workspace = true
wasm-encoder = "0.219"
# tidy-alphabetical-end
+1 -1
View File
@@ -22,5 +22,5 @@ rustc_session = { path = "../rustc_session" }
rustc_span = { path = "../rustc_span" }
rustc_target = { path = "../rustc_target" }
rustc_trait_selection = { path = "../rustc_trait_selection" }
tracing = "0.1"
tracing.workspace = true
# tidy-alphabetical-end
+3 -3
View File
@@ -6,7 +6,7 @@ edition = "2024"
[dependencies]
# tidy-alphabetical-start
arrayvec = { version = "0.7", default-features = false }
bitflags = "2.4.1"
bitflags.workspace = true
either = "1.0"
elsa = "1.11.0"
ena = "0.14.3"
@@ -25,8 +25,8 @@ rustc_thread_pool = { path = "../rustc_thread_pool" }
smallvec = { version = "1.8.1", features = ["const_generics", "union", "may_dangle"] }
stacker = "0.1.17"
tempfile = "3.2"
thin-vec = "0.2.12"
tracing = "0.1"
thin-vec.workspace = true
tracing.workspace = true
# tidy-alphabetical-end
[dependencies.hashbrown]
+1 -1
View File
@@ -51,7 +51,7 @@ rustc_trait_selection = { path = "../rustc_trait_selection" }
rustc_ty_utils = { path = "../rustc_ty_utils" }
serde_json = "1.0.59"
shlex = "1.0"
tracing = { version = "0.1.35" }
tracing.workspace = true
# tidy-alphabetical-end
[target.'cfg(all(unix, any(target_env = "gnu", target_os = "macos")))'.dependencies]
+1 -1
View File
@@ -18,6 +18,6 @@ rustc_data_structures = { path = "../rustc_data_structures" }
rustc_macros = { path = "../rustc_macros" }
rustc_serialize = { path = "../rustc_serialize" }
rustc_span = { path = "../rustc_span" }
tracing = "0.1"
tracing.workspace = true
unic-langid = { version = "0.9.0", features = ["macros"] }
# tidy-alphabetical-end
+1 -1
View File
@@ -24,7 +24,7 @@ serde = { version = "1.0.125", features = ["derive"] }
serde_json = "1.0.59"
termcolor = "1.2.0"
termize = "0.2"
tracing = "0.1"
tracing.workspace = true
# tidy-alphabetical-end
[target.'cfg(windows)'.dependencies.windows]
+2 -2
View File
@@ -29,6 +29,6 @@ rustc_serialize = { path = "../rustc_serialize" }
rustc_session = { path = "../rustc_session" }
rustc_span = { path = "../rustc_span" }
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
thin-vec = "0.2.12"
tracing = "0.1"
thin-vec.workspace = true
tracing.workspace = true
# tidy-alphabetical-end
+3 -3
View File
@@ -5,7 +5,7 @@ edition = "2024"
[dependencies]
# tidy-alphabetical-start
bitflags = "2.9.1"
bitflags.workspace = true
odht = { version = "0.3.1", features = ["nightly"] }
rustc_abi = { path = "../rustc_abi" }
rustc_arena = { path = "../rustc_arena" }
@@ -21,6 +21,6 @@ rustc_serialize = { path = "../rustc_serialize" }
rustc_span = { path = "../rustc_span" }
rustc_target = { path = "../rustc_target" }
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
thin-vec = "0.2.12"
tracing = "0.1"
thin-vec.workspace = true
tracing.workspace = true
# tidy-alphabetical-end
+2 -2
View File
@@ -9,7 +9,7 @@ doctest = false
[dependencies]
# tidy-alphabetical-start
itertools = "0.12"
itertools.workspace = true
rustc_abi = { path = "../rustc_abi" }
rustc_arena = { path = "../rustc_arena" }
rustc_ast = { path = "../rustc_ast" }
@@ -29,5 +29,5 @@ rustc_span = { path = "../rustc_span" }
rustc_target = { path = "../rustc_target" }
rustc_trait_selection = { path = "../rustc_trait_selection" }
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
tracing = "0.1"
tracing.workspace = true
# tidy-alphabetical-end
+2 -2
View File
@@ -5,7 +5,7 @@ edition = "2024"
[dependencies]
# tidy-alphabetical-start
itertools = "0.12"
itertools.workspace = true
rustc_abi = { path = "../rustc_abi" }
rustc_ast = { path = "../rustc_ast" }
rustc_attr_parsing = { path = "../rustc_attr_parsing" }
@@ -25,5 +25,5 @@ rustc_span = { path = "../rustc_span" }
rustc_target = { path = "../rustc_target" }
rustc_trait_selection = { path = "../rustc_trait_selection" }
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
tracing = "0.1"
tracing.workspace = true
# tidy-alphabetical-end
+2 -2
View File
@@ -19,6 +19,6 @@ rustc_middle = { path = "../rustc_middle" }
rustc_serialize = { path = "../rustc_serialize" }
rustc_session = { path = "../rustc_session" }
rustc_span = { path = "../rustc_span" }
thin-vec = "0.2.12"
tracing = "0.1"
thin-vec.workspace = true
tracing.workspace = true
# tidy-alphabetical-end
+2 -2
View File
@@ -18,6 +18,6 @@ rustc_middle = { path = "../rustc_middle" }
rustc_span = { path = "../rustc_span" }
rustc_type_ir = { path = "../rustc_type_ir" }
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
thin-vec = "0.2.12"
tracing = "0.1"
thin-vec.workspace = true
tracing.workspace = true
# tidy-alphabetical-end
+1 -1
View File
@@ -46,7 +46,7 @@ rustc_thread_pool = { path = "../rustc_thread_pool" }
rustc_trait_selection = { path = "../rustc_trait_selection" }
rustc_traits = { path = "../rustc_traits" }
rustc_ty_utils = { path = "../rustc_ty_utils" }
tracing = "0.1"
tracing.workspace = true
# tidy-alphabetical-end
[dev-dependencies]
+1 -1
View File
@@ -14,7 +14,7 @@ Rust lexer used by rustc. No stability guarantees are provided.
# Note that this crate purposefully does not depend on other rustc crates
[dependencies]
memchr = "2.7.4"
memchr.workspace = true
unicode-xid = "0.2.0"
[dependencies.unicode-properties]
+1 -1
View File
@@ -24,6 +24,6 @@ rustc_span = { path = "../rustc_span" }
rustc_target = { path = "../rustc_target" }
rustc_trait_selection = { path = "../rustc_trait_selection" }
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
tracing = "0.1"
tracing.workspace = true
unicode-security = "0.1.0"
# tidy-alphabetical-end
+1 -1
View File
@@ -5,10 +5,10 @@ edition = "2024"
[dependencies]
# tidy-alphabetical-start
tracing = "0.1.28"
tracing-core = "=0.1.30" # FIXME(Nilstrieb) tracing has a deadlock: https://github.com/tokio-rs/tracing/issues/2635
tracing-subscriber = { version = "0.3.3", default-features = false, features = ["fmt", "env-filter", "smallvec", "parking_lot", "ansi"] }
tracing-tree = "0.3.1"
tracing.workspace = true
# tidy-alphabetical-end
[features]
+2 -2
View File
@@ -5,7 +5,7 @@ edition = "2024"
[dependencies]
# tidy-alphabetical-start
bitflags = "2.4.1"
bitflags.workspace = true
libloading = "0.8.0"
odht = { version = "0.3.1", features = ["nightly"] }
rustc_abi = { path = "../rustc_abi" }
@@ -31,7 +31,7 @@ rustc_session = { path = "../rustc_session" }
rustc_span = { path = "../rustc_span" }
rustc_target = { path = "../rustc_target" }
tempfile = "3.7.1"
tracing = "0.1"
tracing.workspace = true
# tidy-alphabetical-end
[target.'cfg(target_os = "aix")'.dependencies]
+3 -3
View File
@@ -5,7 +5,7 @@ edition = "2024"
[dependencies]
# tidy-alphabetical-start
bitflags = "2.4.1"
bitflags.workspace = true
either = "1.5.0"
gsgdt = "0.1.2"
polonius-engine = "0.13.0"
@@ -34,8 +34,8 @@ rustc_target = { path = "../rustc_target" }
rustc_thread_pool = { path = "../rustc_thread_pool" }
rustc_type_ir = { path = "../rustc_type_ir" }
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
thin-vec = "0.2.12"
tracing = "0.1"
thin-vec.workspace = true
tracing.workspace = true
# tidy-alphabetical-end
[features]
+2 -2
View File
@@ -5,7 +5,7 @@ edition = "2024"
[dependencies]
# tidy-alphabetical-start
itertools = "0.12"
itertools.workspace = true
rustc_abi = { path = "../rustc_abi" }
rustc_apfloat = "0.2.0"
rustc_arena = { path = "../rustc_arena" }
@@ -23,5 +23,5 @@ rustc_pattern_analysis = { path = "../rustc_pattern_analysis" }
rustc_session = { path = "../rustc_session" }
rustc_span = { path = "../rustc_span" }
rustc_trait_selection = { path = "../rustc_trait_selection" }
tracing = "0.1"
tracing.workspace = true
# tidy-alphabetical-end
+1 -1
View File
@@ -18,5 +18,5 @@ rustc_macros = { path = "../rustc_macros" }
rustc_middle = { path = "../rustc_middle" }
rustc_span = { path = "../rustc_span" }
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
tracing = "0.1"
tracing.workspace = true
# tidy-alphabetical-end
+2 -2
View File
@@ -6,7 +6,7 @@ edition = "2024"
[dependencies]
# tidy-alphabetical-start
either = "1"
itertools = "0.12"
itertools.workspace = true
rustc_abi = { path = "../rustc_abi" }
rustc_arena = { path = "../rustc_arena" }
rustc_ast = { path = "../rustc_ast" }
@@ -26,5 +26,5 @@ rustc_span = { path = "../rustc_span" }
rustc_target = { path = "../rustc_target" }
rustc_trait_selection = { path = "../rustc_trait_selection" }
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
tracing = "0.1"
tracing.workspace = true
# tidy-alphabetical-end
+1 -1
View File
@@ -17,5 +17,5 @@ rustc_span = { path = "../rustc_span" }
rustc_target = { path = "../rustc_target" }
serde = "1"
serde_json = "1"
tracing = "0.1"
tracing.workspace = true
# tidy-alphabetical-end
+1 -1
View File
@@ -11,7 +11,7 @@ rustc_index = { path = "../rustc_index", default-features = false }
rustc_macros = { path = "../rustc_macros", optional = true }
rustc_type_ir = { path = "../rustc_type_ir", default-features = false }
rustc_type_ir_macros = { path = "../rustc_type_ir_macros" }
tracing = "0.1"
tracing.workspace = true
# tidy-alphabetical-end
[features]
+4 -4
View File
@@ -5,8 +5,8 @@ edition = "2024"
[dependencies]
# tidy-alphabetical-start
bitflags = "2.4.1"
rustc-literal-escaper = "0.0.5"
bitflags.workspace = true
rustc-literal-escaper.workspace = true
rustc_ast = { path = "../rustc_ast" }
rustc_ast_pretty = { path = "../rustc_ast_pretty" }
rustc_data_structures = { path = "../rustc_data_structures" }
@@ -18,8 +18,8 @@ rustc_lexer = { path = "../rustc_lexer" }
rustc_macros = { path = "../rustc_macros" }
rustc_session = { path = "../rustc_session" }
rustc_span = { path = "../rustc_span" }
thin-vec = "0.2.12"
tracing = "0.1"
thin-vec.workspace = true
tracing.workspace = true
unicode-normalization = "0.1.11"
unicode-width = "0.2.0"
# tidy-alphabetical-end
+1 -1
View File
@@ -5,7 +5,7 @@ edition = "2024"
[dependencies]
# tidy-alphabetical-start
rustc-literal-escaper = "0.0.5"
rustc-literal-escaper.workspace = true
rustc_lexer = { path = "../rustc_lexer" }
# tidy-alphabetical-end
+1 -1
View File
@@ -24,5 +24,5 @@ rustc_session = { path = "../rustc_session" }
rustc_span = { path = "../rustc_span" }
rustc_target = { path = "../rustc_target" }
rustc_trait_selection = { path = "../rustc_trait_selection" }
tracing = "0.1"
tracing.workspace = true
# tidy-alphabetical-end
+1 -1
View File
@@ -19,7 +19,7 @@ rustc_middle = { path = "../rustc_middle", optional = true }
rustc_session = { path = "../rustc_session", optional = true }
rustc_span = { path = "../rustc_span", optional = true }
smallvec = { version = "1.8.1", features = ["union"] }
tracing = "0.1"
tracing.workspace = true
# tidy-alphabetical-end
[dev-dependencies]
+1 -1
View File
@@ -15,5 +15,5 @@ rustc_middle = { path = "../rustc_middle" }
rustc_session = { path = "../rustc_session" }
rustc_span = { path = "../rustc_span" }
rustc_ty_utils = { path = "../rustc_ty_utils" }
tracing = "0.1"
tracing.workspace = true
# tidy-alphabetical-end
+1 -1
View File
@@ -16,7 +16,7 @@ doctest = false
[dependencies]
# tidy-alphabetical-start
rustc-literal-escaper = "0.0.5"
rustc-literal-escaper.workspace = true
# tidy-alphabetical-end
[features]
+1 -1
View File
@@ -14,7 +14,7 @@ rustc_span = { path = "../rustc_span" }
rustc_target = { path = "../rustc_target" }
scoped-tls = "1.0"
serde = { version = "1.0.125", features = [ "derive" ] }
tracing = "0.1"
tracing.workspace = true
# tidy-alphabetical-end
[features]
+1 -1
View File
@@ -15,5 +15,5 @@ rustc_query_system = { path = "../rustc_query_system" }
rustc_serialize = { path = "../rustc_serialize" }
rustc_session = { path = "../rustc_session" }
rustc_span = { path = "../rustc_span" }
tracing = "0.1"
tracing.workspace = true
# tidy-alphabetical-end
+1 -1
View File
@@ -21,7 +21,7 @@ rustc_session = { path = "../rustc_session" }
rustc_span = { path = "../rustc_span" }
rustc_thread_pool = { path = "../rustc_thread_pool" }
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
tracing = "0.1"
tracing.workspace = true
# tidy-alphabetical-end
[dependencies.hashbrown]
+4 -4
View File
@@ -5,9 +5,9 @@ edition = "2024"
[dependencies]
# tidy-alphabetical-start
bitflags = "2.4.1"
bitflags.workspace = true
indexmap = "2.4.0"
itertools = "0.12"
itertools.workspace = true
pulldown-cmark = { version = "0.11", features = ["html"], default-features = false }
rustc_arena = { path = "../rustc_arena" }
rustc_ast = { path = "../rustc_ast" }
@@ -27,6 +27,6 @@ rustc_query_system = { path = "../rustc_query_system" }
rustc_session = { path = "../rustc_session" }
rustc_span = { path = "../rustc_span" }
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
thin-vec = "0.2.12"
tracing = "0.1"
thin-vec.workspace = true
tracing.workspace = true
# tidy-alphabetical-end
+2 -2
View File
@@ -5,7 +5,7 @@ edition = "2024"
[dependencies]
# tidy-alphabetical-start
bitflags = "2.5.0"
bitflags.workspace = true
rustc_abi = { path = "../rustc_abi" }
rustc_data_structures = { path = "../rustc_data_structures" }
rustc_hir = { path = "../rustc_hir" }
@@ -13,6 +13,6 @@ rustc_middle = { path = "../rustc_middle" }
rustc_span = { path = "../rustc_span" }
rustc_target = { path = "../rustc_target" }
rustc_trait_selection = { path = "../rustc_trait_selection" }
tracing = "0.1"
tracing.workspace = true
twox-hash = "1.6.3"
# tidy-alphabetical-end
+1 -1
View File
@@ -8,7 +8,7 @@ edition = "2024"
indexmap = "2.0.0"
rustc_hashes = { path = "../rustc_hashes" }
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
thin-vec = "0.2.12"
thin-vec.workspace = true
# tidy-alphabetical-end
[dev-dependencies]
+2 -2
View File
@@ -5,7 +5,7 @@ edition = "2024"
[dependencies]
# tidy-alphabetical-start
bitflags = "2.4.1"
bitflags.workspace = true
getopts = "0.2"
rand = "0.9.0"
rustc_abi = { path = "../rustc_abi" }
@@ -23,7 +23,7 @@ rustc_serialize = { path = "../rustc_serialize" }
rustc_span = { path = "../rustc_span" }
rustc_target = { path = "../rustc_target" }
termize = "0.2"
tracing = "0.1"
tracing.workspace = true
# tidy-alphabetical-end
[target.'cfg(unix)'.dependencies]
+1 -1
View File
@@ -19,6 +19,6 @@ rustc_serialize = { path = "../rustc_serialize" }
scoped-tls = "1.0"
sha1 = "0.10.0"
sha2 = "0.10.1"
tracing = "0.1"
tracing.workspace = true
unicode-width = "0.2.0"
# tidy-alphabetical-end
+1 -1
View File
@@ -15,5 +15,5 @@ rustc_hir = { path = "../rustc_hir" }
rustc_middle = { path = "../rustc_middle" }
rustc_session = { path = "../rustc_session" }
rustc_span = { path = "../rustc_span" }
tracing = "0.1"
tracing.workspace = true
# tidy-alphabetical-end
+2 -2
View File
@@ -5,7 +5,7 @@ edition = "2024"
[dependencies]
# tidy-alphabetical-start
bitflags = "2.4.1"
bitflags.workspace = true
rustc_abi = { path = "../rustc_abi" }
rustc_data_structures = { path = "../rustc_data_structures" }
rustc_error_messages = { path = "../rustc_error_messages" }
@@ -17,7 +17,7 @@ serde = "1.0.219"
serde_derive = "1.0.219"
serde_json = "1.0.59"
serde_path_to_error = "0.1.17"
tracing = "0.1"
tracing.workspace = true
# tidy-alphabetical-end
[dependencies.object]
+3 -3
View File
@@ -5,7 +5,7 @@ edition = "2024"
[dependencies]
# tidy-alphabetical-start
itertools = "0.12"
itertools.workspace = true
rustc_abi = { path = "../rustc_abi" }
rustc_ast = { path = "../rustc_ast" }
rustc_data_structures = { path = "../rustc_data_structures" }
@@ -21,6 +21,6 @@ rustc_session = { path = "../rustc_session" }
rustc_span = { path = "../rustc_span" }
rustc_transmute = { path = "../rustc_transmute", features = ["rustc"] }
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
thin-vec = "0.2"
tracing = "0.1"
thin-vec.workspace = true
tracing.workspace = true
# tidy-alphabetical-end
+1 -1
View File
@@ -10,5 +10,5 @@ rustc_infer = { path = "../rustc_infer" }
rustc_middle = { path = "../rustc_middle" }
rustc_span = { path = "../rustc_span" }
rustc_trait_selection = { path = "../rustc_trait_selection" }
tracing = "0.1"
tracing.workspace = true
# tidy-alphabetical-end
+2 -2
View File
@@ -11,12 +11,12 @@ rustc_hir = { path = "../rustc_hir", optional = true }
rustc_middle = { path = "../rustc_middle", optional = true }
rustc_span = { path = "../rustc_span", optional = true }
smallvec = "1.8.1"
tracing = "0.1"
tracing.workspace = true
# tidy-alphabetical-end
[dev-dependencies]
# tidy-alphabetical-start
itertools = "0.12"
itertools.workspace = true
# tidy-alphabetical-end
[features]
+2 -2
View File
@@ -5,7 +5,7 @@ edition = "2024"
[dependencies]
# tidy-alphabetical-start
itertools = "0.12"
itertools.workspace = true
rustc_abi = { path = "../rustc_abi" }
rustc_data_structures = { path = "../rustc_data_structures" }
rustc_errors = { path = "../rustc_errors" }
@@ -20,5 +20,5 @@ rustc_session = { path = "../rustc_session" }
rustc_span = { path = "../rustc_span" }
rustc_target = { path = "../rustc_target" }
rustc_trait_selection = { path = "../rustc_trait_selection" }
tracing = "0.1"
tracing.workspace = true
# tidy-alphabetical-end
+3 -3
View File
@@ -5,7 +5,7 @@ edition = "2024"
[dependencies]
# tidy-alphabetical-start
bitflags = "2.4.1"
bitflags.workspace = true
derive-where = "1.2.7"
ena = "0.14.3"
indexmap = "2.0.0"
@@ -19,8 +19,8 @@ rustc_serialize = { path = "../rustc_serialize", optional = true }
rustc_span = { path = "../rustc_span", optional = true }
rustc_type_ir_macros = { path = "../rustc_type_ir_macros" }
smallvec = { version = "1.8.1", default-features = false, features = ["const_generics"] }
thin-vec = "0.2.12"
tracing = "0.1"
thin-vec.workspace = true
tracing.workspace = true
# tidy-alphabetical-end
[features]
+23 -50
View File
@@ -2939,68 +2939,41 @@ fn spec_to_string(&self) -> String {
}
}
// Generic/generated code can sometimes have multiple, nested references
// for strings, including `&&&str`s that would never be written
// by hand. This macro generates twelve layers of nested `&`-impl
// for primitive strings.
#[cfg(not(no_global_oom_handling))]
macro_rules! to_string_str_wrap_in_ref {
{x $($x:ident)*} => {
&to_string_str_wrap_in_ref! { $($x)* }
};
{} => { str };
}
#[cfg(not(no_global_oom_handling))]
macro_rules! to_string_expr_wrap_in_deref {
{$self:expr ; x $($x:ident)*} => {
*(to_string_expr_wrap_in_deref! { $self ; $($x)* })
};
{$self:expr ;} => { $self };
}
#[cfg(not(no_global_oom_handling))]
macro_rules! to_string_str {
{$($($x:ident)*),+} => {
{$($type:ty,)*} => {
$(
impl SpecToString for to_string_str_wrap_in_ref!($($x)*) {
impl SpecToString for $type {
#[inline]
fn spec_to_string(&self) -> String {
String::from(to_string_expr_wrap_in_deref!(self ; $($x)*))
let s: &str = self;
String::from(s)
}
}
)+
)*
};
}
#[cfg(not(no_global_oom_handling))]
to_string_str! {
x x x x x x x x x x x x,
x x x x x x x x x x x,
x x x x x x x x x x,
x x x x x x x x x,
x x x x x x x x,
x x x x x x x,
x x x x x x,
x x x x x,
x x x x,
x x x,
x x,
x,
}
#[cfg(not(no_global_oom_handling))]
impl SpecToString for Cow<'_, str> {
#[inline]
fn spec_to_string(&self) -> String {
self[..].to_owned()
}
}
#[cfg(not(no_global_oom_handling))]
impl SpecToString for String {
#[inline]
fn spec_to_string(&self) -> String {
self.to_owned()
}
Cow<'_, str>,
String,
// Generic/generated code can sometimes have multiple, nested references
// for strings, including `&&&str`s that would never be written
// by hand.
&&&&&&&&&&&&str,
&&&&&&&&&&&str,
&&&&&&&&&&str,
&&&&&&&&&str,
&&&&&&&&str,
&&&&&&&str,
&&&&&&str,
&&&&&str,
&&&&str,
&&&str,
&&str,
&str,
str,
}
#[cfg(not(no_global_oom_handling))]
+20 -3
View File
@@ -630,6 +630,13 @@ pub const fn recip(self) -> Self {
/// Converts radians to degrees.
///
/// # Unspecified precision
///
/// The precision of this function is non-deterministic. This means it varies by platform,
/// Rust version, and can even differ within the same execution from one invocation to the next.
///
/// # Examples
///
/// ```
/// #![feature(f128)]
/// # // FIXME(f16_f128): remove when `eqtf2` is available
@@ -645,13 +652,22 @@ pub const fn recip(self) -> Self {
#[unstable(feature = "f128", issue = "116909")]
#[must_use = "this returns the result of the operation, without modifying the original"]
pub const fn to_degrees(self) -> Self {
// Use a literal for better precision.
const PIS_IN_180: f128 = 57.2957795130823208767981548141051703324054724665643215491602_f128;
// The division here is correctly rounded with respect to the true value of 180/π.
// Although π is irrational and already rounded, the double rounding happens
// to produce correct result for f128.
const PIS_IN_180: f128 = 180.0 / consts::PI;
self * PIS_IN_180
}
/// Converts degrees to radians.
///
/// # Unspecified precision
///
/// The precision of this function is non-deterministic. This means it varies by platform,
/// Rust version, and can even differ within the same execution from one invocation to the next.
///
/// # Examples
///
/// ```
/// #![feature(f128)]
/// # // FIXME(f16_f128): remove when `eqtf2` is available
@@ -668,7 +684,8 @@ pub const fn to_degrees(self) -> Self {
#[unstable(feature = "f128", issue = "116909")]
#[must_use = "this returns the result of the operation, without modifying the original"]
pub const fn to_radians(self) -> f128 {
// Use a literal for better precision.
// Use a literal to avoid double rounding, consts::PI is already rounded,
// and dividing would round again.
const RADS_PER_DEG: f128 =
0.0174532925199432957692369076848861271344287188854172545609719_f128;
self * RADS_PER_DEG
+18 -2
View File
@@ -625,6 +625,13 @@ pub const fn recip(self) -> Self {
/// Converts radians to degrees.
///
/// # Unspecified precision
///
/// The precision of this function is non-deterministic. This means it varies by platform,
/// Rust version, and can even differ within the same execution from one invocation to the next.
///
/// # Examples
///
/// ```
/// #![feature(f16)]
/// # // FIXME(f16_f128): extendhfsf2, truncsfhf2, __gnu_h2f_ieee, __gnu_f2h_ieee missing for many platforms
@@ -640,13 +647,21 @@ pub const fn recip(self) -> Self {
#[unstable(feature = "f16", issue = "116909")]
#[must_use = "this returns the result of the operation, without modifying the original"]
pub const fn to_degrees(self) -> Self {
// Use a literal for better precision.
// Use a literal to avoid double rounding, consts::PI is already rounded,
// and dividing would round again.
const PIS_IN_180: f16 = 57.2957795130823208767981548141051703_f16;
self * PIS_IN_180
}
/// Converts degrees to radians.
///
/// # Unspecified precision
///
/// The precision of this function is non-deterministic. This means it varies by platform,
/// Rust version, and can even differ within the same execution from one invocation to the next.
///
/// # Examples
///
/// ```
/// #![feature(f16)]
/// # // FIXME(f16_f128): extendhfsf2, truncsfhf2, __gnu_h2f_ieee, __gnu_f2h_ieee missing for many platforms
@@ -663,7 +678,8 @@ pub const fn to_degrees(self) -> Self {
#[unstable(feature = "f16", issue = "116909")]
#[must_use = "this returns the result of the operation, without modifying the original"]
pub const fn to_radians(self) -> f16 {
// Use a literal for better precision.
// Use a literal to avoid double rounding, consts::PI is already rounded,
// and dividing would round again.
const RADS_PER_DEG: f16 = 0.017453292519943295769236907684886_f16;
self * RADS_PER_DEG
}
+19 -1
View File
@@ -839,6 +839,13 @@ pub const fn recip(self) -> f32 {
/// Converts radians to degrees.
///
/// # Unspecified precision
///
/// The precision of this function is non-deterministic. This means it varies by platform,
/// Rust version, and can even differ within the same execution from one invocation to the next.
///
/// # Examples
///
/// ```
/// let angle = std::f32::consts::PI;
///
@@ -852,13 +859,21 @@ pub const fn recip(self) -> f32 {
#[rustc_const_stable(feature = "const_float_methods", since = "1.85.0")]
#[inline]
pub const fn to_degrees(self) -> f32 {
// Use a constant for better precision.
// Use a literal to avoid double rounding, consts::PI is already rounded,
// and dividing would round again.
const PIS_IN_180: f32 = 57.2957795130823208767981548141051703_f32;
self * PIS_IN_180
}
/// Converts degrees to radians.
///
/// # Unspecified precision
///
/// The precision of this function is non-deterministic. This means it varies by platform,
/// Rust version, and can even differ within the same execution from one invocation to the next.
///
/// # Examples
///
/// ```
/// let angle = 180.0f32;
///
@@ -872,6 +887,9 @@ pub const fn to_degrees(self) -> f32 {
#[rustc_const_stable(feature = "const_float_methods", since = "1.85.0")]
#[inline]
pub const fn to_radians(self) -> f32 {
// The division here is correctly rounded with respect to the true value of π/180.
// Although π is irrational and already rounded, the double rounding happens
// to produce correct result for f32.
const RADS_PER_DEG: f32 = consts::PI / 180.0;
self * RADS_PER_DEG
}
+22 -4
View File
@@ -856,6 +856,13 @@ pub const fn recip(self) -> f64 {
/// Converts radians to degrees.
///
/// # Unspecified precision
///
/// The precision of this function is non-deterministic. This means it varies by platform,
/// Rust version, and can even differ within the same execution from one invocation to the next.
///
/// # Examples
///
/// ```
/// let angle = std::f64::consts::PI;
///
@@ -869,14 +876,22 @@ pub const fn recip(self) -> f64 {
#[rustc_const_stable(feature = "const_float_methods", since = "1.85.0")]
#[inline]
pub const fn to_degrees(self) -> f64 {
// The division here is correctly rounded with respect to the true
// value of 180/π. (This differs from f32, where a constant must be
// used to ensure a correctly rounded result.)
self * (180.0f64 / consts::PI)
// The division here is correctly rounded with respect to the true value of 180/π.
// Although π is irrational and already rounded, the double rounding happens
// to produce correct result for f64.
const PIS_IN_180: f64 = 180.0 / consts::PI;
self * PIS_IN_180
}
/// Converts degrees to radians.
///
/// # Unspecified precision
///
/// The precision of this function is non-deterministic. This means it varies by platform,
/// Rust version, and can even differ within the same execution from one invocation to the next.
///
/// # Examples
///
/// ```
/// let angle = 180.0_f64;
///
@@ -890,6 +905,9 @@ pub const fn to_degrees(self) -> f64 {
#[rustc_const_stable(feature = "const_float_methods", since = "1.85.0")]
#[inline]
pub const fn to_radians(self) -> f64 {
// The division here is correctly rounded with respect to the true value of π/180.
// Although π is irrational and already rounded, the double rounding happens
// to produce correct result for f64.
const RADS_PER_DEG: f64 = consts::PI / 180.0;
self * RADS_PER_DEG
}
+36
View File
@@ -1961,6 +1961,42 @@ pub const fn zip_with<U, F, R>(self, other: Option<U>, f: F) -> Option<R>
_ => None,
}
}
/// Reduces two options into one, using the provided function if both are `Some`.
///
/// If `self` is `Some(s)` and `other` is `Some(o)`, this method returns `Some(f(s, o))`.
/// Otherwise, if only one of `self` and `other` is `Some`, that one is returned.
/// If both `self` and `other` are `None`, `None` is returned.
///
/// # Examples
///
/// ```
/// #![feature(option_reduce)]
///
/// let s12 = Some(12);
/// let s17 = Some(17);
/// let n = None;
/// let f = |a, b| a + b;
///
/// assert_eq!(s12.reduce(s17, f), Some(29));
/// assert_eq!(s12.reduce(n, f), Some(12));
/// assert_eq!(n.reduce(s17, f), Some(17));
/// assert_eq!(n.reduce(n, f), None);
/// ```
#[unstable(feature = "option_reduce", issue = "144273")]
pub fn reduce<U, R, F>(self, other: Option<U>, f: F) -> Option<R>
where
T: Into<R>,
U: Into<R>,
F: FnOnce(T, U) -> R,
{
match (self, other) {
(Some(a), Some(b)) => Some(f(a, b)),
(Some(a), _) => Some(a.into()),
(_, Some(b)) => Some(b.into()),
_ => None,
}
}
}
impl<T, U> Option<(T, U)> {
+1
View File
@@ -80,6 +80,7 @@
#![feature(next_index)]
#![feature(non_exhaustive_omitted_patterns_lint)]
#![feature(numfmt)]
#![feature(option_reduce)]
#![feature(pattern)]
#![feature(pointer_is_aligned_to)]
#![feature(portable_simd)]
+2 -2
View File
@@ -13,7 +13,7 @@ arrayvec = { version = "0.7", default-features = false }
askama = { version = "0.14", default-features = false, features = ["alloc", "config", "derive"] }
base64 = "0.21.7"
indexmap = "2"
itertools = "0.12"
itertools.workspace = true
minifier = { version = "0.3.5", default-features = false }
pulldown-cmark-escape = { version = "0.11.0", features = ["simd"] }
regex = "1"
@@ -24,8 +24,8 @@ smallvec = "1.8.1"
stringdex = { version = "0.0.1-alpha4" }
tempfile = "3"
threadpool = "1.8.1"
tracing = "0.1"
tracing-tree = "0.3.0"
tracing.workspace = true
unicode-segmentation = "1.9"
# tidy-alphabetical-end
+1 -1
View File
@@ -28,8 +28,8 @@ rustfix = "0.8.1"
semver = { version = "1.0.23", features = ["serde"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
tracing = "0.1"
tracing-subscriber = { version = "0.3.3", default-features = false, features = ["ansi", "env-filter", "fmt", "parking_lot", "smallvec"] }
tracing.workspace = true
unified-diff = "0.2.1"
walkdir = "2"
# tidy-alphabetical-end
@@ -395,6 +395,35 @@ fn run_debuginfo_lldb_test_no_opt(&self) {
// We don't want to hang when calling `quit` while the process is still running
let mut script_str = String::from("settings set auto-confirm true\n");
// macOS has a system for restricting access to files and peripherals
// called Transparency, Consent, and Control (TCC), which can be
// configured using the "Security & Privacy" tab in your settings.
//
// This system is provenance-based: if Terminal.app is given access to
// your Desktop, and you launch a binary within Terminal.app, the new
// binary also has access to the files on your Desktop.
//
// By default though, LLDB launches binaries in very isolated
// contexts. This includes resetting any TCC grants that might
// otherwise have been inherited.
//
// In effect, this means that if the developer has placed the rust
// repository under one of the system-protected folders, they will get
// a pop-up _for each binary_ asking for permissions to access the
// folder - quite annoying.
//
// To avoid this, we tell LLDB to spawn processes with TCC grants
// inherited from the parent process.
//
// Setting this also avoids unnecessary overhead from XprotectService
// when running with the Developer Tool grant.
//
// TIP: If you want to allow launching `lldb ~/Desktop/my_binary`
// without being prompted, you can put this in your `~/.lldbinit` too.
if self.config.host.contains("darwin") {
script_str.push_str("settings set target.inherit-tcc true\n");
}
// Make LLDB emit its version, so we have it documented in the test output
script_str.push_str("version\n");
+1 -1
View File
@@ -7,7 +7,7 @@ edition = "2021"
[dependencies]
anyhow = "1.0.71"
itertools = "0.12"
itertools.workspace = true
leb128 = "0.2.5"
md5 = { package = "md-5" , version = "0.10.5" }
miniz_oxide = "0.8.8"
+2 -2
View File
@@ -8,7 +8,7 @@ publish = false
[dependencies]
anyhow = "1.0"
tracing = "0.1"
tracing-subscriber = {version = "0.3.0", features = ["std"] }
tracing.workspace = true
tracing-subscriber = { version = "0.3.0", features = ["std"] }
clap = { version = "4.3", features = ["derive"] }
thiserror = "1.0.24"
-4
View File
@@ -1,4 +0,0 @@
//@ known-bug: #137580
fn main() {
println!("%65536$", 1);
}
@@ -0,0 +1,5 @@
// https://github.com/rust-lang/rust/issues/137580
fn main() {
println!("%65536$", 1);
//~^ ERROR never used
}
@@ -0,0 +1,16 @@
error: argument never used
--> $DIR/format-foreign-dollar-without-spec.rs:3:25
|
LL | println!("%65536$", 1);
| ^ argument never used
|
note: format specifiers use curly braces, and the conversion specifier `
` is unknown or unsupported
--> $DIR/format-foreign-dollar-without-spec.rs:3:15
|
LL | println!("%65536$", 1);
| ^^^^^^^^
= note: printf formatting is not supported; see the documentation for `std::fmt`
error: aborting due to 1 previous error