Skip to content

Commit 6c34855

Browse files
committed
Auto merge of #127156 - matthiaskrgr:rollup-jjfd464, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - #126705 (Updated docs on `#[panic_handler]` in `library/core/src/lib.rs`) - #126876 (Add `.ignore` file to make `config.toml` searchable in vscode) - #126906 (Small fixme in core now that split_first has no codegen issues) - #127023 (CI: rename Rust for Linux CI job) - #127131 (Remove unused `rustc_trait_selection` dependencies) - #127134 (Print `TypeId` as a `u128` for `Debug`) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 2975a21 + f2c287f commit 6c34855

File tree

10 files changed

+24
-25
lines changed

10 files changed

+24
-25
lines changed

.ignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Make vscode *not* count `config.toml` as ignored, so it is included in search
2+
!/config.toml

.reuse/dep5

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Files: compiler/*
3636
.gitignore
3737
.gitmodules
3838
.mailmap
39+
.ignore
3940
Copyright: The Rust Project Developers (see https://thanks.rust-lang.org)
4041
License: MIT or Apache-2.0
4142

Cargo.lock

-4
Original file line numberDiff line numberDiff line change
@@ -4760,8 +4760,6 @@ checksum = "8ba09476327c4b70ccefb6180f046ef588c26a24cf5d269a9feba316eb4f029f"
47604760
name = "rustc_trait_selection"
47614761
version = "0.0.0"
47624762
dependencies = [
4763-
"bitflags 2.5.0",
4764-
"derivative",
47654763
"itertools",
47664764
"rustc_ast",
47674765
"rustc_ast_ir",
@@ -4770,7 +4768,6 @@ dependencies = [
47704768
"rustc_errors",
47714769
"rustc_fluent_macro",
47724770
"rustc_hir",
4773-
"rustc_index",
47744771
"rustc_infer",
47754772
"rustc_macros",
47764773
"rustc_middle",
@@ -4783,7 +4780,6 @@ dependencies = [
47834780
"rustc_target",
47844781
"rustc_transmute",
47854782
"rustc_type_ir",
4786-
"rustc_type_ir_macros",
47874783
"smallvec",
47884784
"tracing",
47894785
]

compiler/rustc_trait_selection/Cargo.toml

-4
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ edition = "2021"
55

66
[dependencies]
77
# tidy-alphabetical-start
8-
bitflags = "2.4.1"
9-
derivative = "2.2.0"
108
itertools = "0.12"
119
rustc_ast = { path = "../rustc_ast" }
1210
rustc_ast_ir = { path = "../rustc_ast_ir" }
@@ -15,7 +13,6 @@ rustc_data_structures = { path = "../rustc_data_structures" }
1513
rustc_errors = { path = "../rustc_errors" }
1614
rustc_fluent_macro = { path = "../rustc_fluent_macro" }
1715
rustc_hir = { path = "../rustc_hir" }
18-
rustc_index = { path = "../rustc_index" }
1916
rustc_infer = { path = "../rustc_infer" }
2017
rustc_macros = { path = "../rustc_macros" }
2118
rustc_middle = { path = "../rustc_middle" }
@@ -28,7 +25,6 @@ rustc_span = { path = "../rustc_span" }
2825
rustc_target = { path = "../rustc_target" }
2926
rustc_transmute = { path = "../rustc_transmute", features = ["rustc"] }
3027
rustc_type_ir = { path = "../rustc_type_ir" }
31-
rustc_type_ir_macros = { path = "../rustc_type_ir_macros" }
3228
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
3329
tracing = "0.1"
3430
# tidy-alphabetical-end

library/core/src/any.rs

+12-1
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ impl dyn Any + Send + Sync {
602602
/// While `TypeId` implements `Hash`, `PartialOrd`, and `Ord`, it is worth
603603
/// noting that the hashes and ordering will vary between Rust releases. Beware
604604
/// of relying on them inside of your code!
605-
#[derive(Clone, Copy, Debug, Eq, PartialOrd, Ord)]
605+
#[derive(Clone, Copy, Eq, PartialOrd, Ord)]
606606
#[stable(feature = "rust1", since = "1.0.0")]
607607
pub struct TypeId {
608608
// We avoid using `u128` because that imposes higher alignment requirements on many platforms.
@@ -644,6 +644,10 @@ impl TypeId {
644644
let t2 = t as u64;
645645
TypeId { t: (t1, t2) }
646646
}
647+
648+
fn as_u128(self) -> u128 {
649+
u128::from(self.t.0) << 64 | u128::from(self.t.1)
650+
}
647651
}
648652

649653
#[stable(feature = "rust1", since = "1.0.0")]
@@ -666,6 +670,13 @@ impl hash::Hash for TypeId {
666670
}
667671
}
668672

673+
#[stable(feature = "rust1", since = "1.0.0")]
674+
impl fmt::Debug for TypeId {
675+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
676+
f.debug_tuple("TypeId").field(&self.as_u128()).finish()
677+
}
678+
}
679+
669680
/// Returns the name of a type as a string slice.
670681
///
671682
/// # Note

library/core/src/lib.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,9 @@
3434
//! Rust user code is to call the functions provided by this library instead (such as
3535
//! `ptr::copy`).
3636
//!
37-
//! * `rust_begin_panic` - This function takes four arguments, a
38-
//! `fmt::Arguments`, a `&'static str`, and two `u32`'s. These four arguments
39-
//! dictate the panic message, the file at which panic was invoked, and the
40-
//! line and column inside the file. It is up to consumers of this core
37+
//! * Panic handler - This function takes one argument, a `&panic::PanicInfo`. It is up to consumers of this core
4138
//! library to define this panic function; it is only required to never
42-
//! return. This requires a `lang` attribute named `panic_impl`.
39+
//! return. You should mark your implementation using `#[panic_handler]`.
4340
//!
4441
//! * `rust_eh_personality` - is used by the failure mechanisms of the
4542
//! compiler. This is often mapped to GCC's personality function, but crates

library/core/src/num/dec2flt/common.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ impl ByteSlice for [u8] {
3939
fn parse_digits(&self, mut func: impl FnMut(u8)) -> &Self {
4040
let mut s = self;
4141

42-
// FIXME: Can't use s.split_first() here yet,
43-
// see https://github.com/rust-lang/rust/issues/109328
44-
while let [c, s_next @ ..] = s {
42+
while let Some((c, s_next)) = s.split_first() {
4543
let c = c.wrapping_sub(b'0');
4644
if c < 10 {
4745
func(c);

library/core/src/num/dec2flt/parse.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ fn try_parse_19digits(s_ref: &mut &[u8], x: &mut u64) {
5151
let mut s = *s_ref;
5252

5353
while *x < MIN_19DIGIT_INT {
54-
// FIXME: Can't use s.split_first() here yet,
55-
// see https://github.com/rust-lang/rust/issues/109328
56-
if let [c, s_next @ ..] = s {
54+
if let Some((c, s_next)) = s.split_first() {
5755
let digit = c.wrapping_sub(b'0');
5856

5957
if digit < 10 {

src/ci/github-actions/jobs.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,11 @@ auto:
215215
only_on_channel: nightly
216216
<<: *job-linux-8c
217217

218+
# Tests integration with Rust for Linux.
219+
# Builds stage 1 compiler and tries to compile a few RfL examples with it.
220+
- image: x86_64-rust-for-linux
221+
<<: *job-linux-8c
222+
218223
- image: x86_64-gnu
219224
<<: *job-linux-4c
220225

@@ -465,8 +470,3 @@ auto:
465470
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-extended --enable-profiler
466471
SCRIPT: python x.py dist bootstrap --include-default-paths
467472
<<: *job-windows-8c
468-
469-
# Tests integration with Rust for Linux.
470-
# Builds stage 1 compiler and tries to compile a few RfL examples with it.
471-
- image: rfl
472-
<<: *job-linux-8c

0 commit comments

Comments
 (0)