Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit d95d4f0

Browse files
committed
Auto merge of rust-lang#81678 - jackh726:rollup-3nerni4, r=jackh726
Rollup of 14 pull requests Successful merges: - rust-lang#80593 (Upgrade Chalk) - rust-lang#81260 (Add .editorconfig) - rust-lang#81455 (Add AArch64 big-endian and ILP32 targets) - rust-lang#81517 (Remove remnants of the santizer runtime crates from bootstrap) - rust-lang#81530 (sys: use `process::abort()` instead of `arch::wasm32::unreachable()`) - rust-lang#81544 (Add better diagnostic for unbounded Abst. Const) - rust-lang#81588 (Add doc aliases for "delete") - rust-lang#81603 (rustbuild: Don't build compiler twice for error-index-generator.) - rust-lang#81634 (Add long explanation e0521) - rust-lang#81636 (Directly use `Option<&[T]>` instead of converting from `Option<&Vec<T>>` later on) - rust-lang#81647 (Fix bug with assert!() calling the wrong edition of panic!().) - rust-lang#81655 (Improve wording of suggestion about accessing field) - rust-lang#81665 (Fix out of date `Scalar` documentation) - rust-lang#81671 (Add more associated type tests) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 3682750 + 81c64b3 commit d95d4f0

File tree

79 files changed

+645
-202
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+645
-202
lines changed

.editorconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# editorconfig.org
4+
5+
root = true
6+
7+
[*]
8+
end_of_line = lf
9+
charset = utf-8
10+
trim_trailing_whitespace = true
11+
insert_final_newline = true
12+
indent_style = space
13+
indent_size = 4
14+
15+
[*.md]
16+
# double whitespace at end of line
17+
# denotes a line break in Markdown
18+
trim_trailing_whitespace = false
19+
20+
[*.yml]
21+
indent_size = 2

Cargo.lock

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -496,9 +496,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
496496

497497
[[package]]
498498
name = "chalk-derive"
499-
version = "0.36.0"
499+
version = "0.55.0"
500500
source = "registry+https://github.com/rust-lang/crates.io-index"
501-
checksum = "9f88ce4deae1dace71e49b7611cfae2d5489de3530d6daba5758043c47ac3a10"
501+
checksum = "3983193cacd81f0f924acb666b7fe5e1a0d81db9f113fa69203eda7ea8ce8b6c"
502502
dependencies = [
503503
"proc-macro2",
504504
"quote",
@@ -508,9 +508,9 @@ dependencies = [
508508

509509
[[package]]
510510
name = "chalk-engine"
511-
version = "0.36.0"
511+
version = "0.55.0"
512512
source = "registry+https://github.com/rust-lang/crates.io-index"
513-
checksum = "0e34c9b1b10616782143d7f49490f91ae94afaf2202de3ab0b2835e78b4f0ccc"
513+
checksum = "05a171ce5abbf0fbd06f221ab80ab182c7ef78603d23b858bc44e7ce8a86a396"
514514
dependencies = [
515515
"chalk-derive",
516516
"chalk-ir",
@@ -521,19 +521,20 @@ dependencies = [
521521

522522
[[package]]
523523
name = "chalk-ir"
524-
version = "0.36.0"
524+
version = "0.55.0"
525525
source = "registry+https://github.com/rust-lang/crates.io-index"
526-
checksum = "63362c629c2014ab639b04029070763fb8224df136d1363d30e9ece4c8877da3"
526+
checksum = "a522f53af971e7678f472d687e053120157b3ae26e2ebd5ecbc0f5ab124f2cb6"
527527
dependencies = [
528+
"bitflags",
528529
"chalk-derive",
529530
"lazy_static",
530531
]
531532

532533
[[package]]
533534
name = "chalk-solve"
534-
version = "0.36.0"
535+
version = "0.55.0"
535536
source = "registry+https://github.com/rust-lang/crates.io-index"
536-
checksum = "cac338a67af52a7f50bb2f8232e730a3518ce432dbe303246acfe525ddd838c7"
537+
checksum = "cdf79fb77a567e456a170f7ec84ea6584163d4ba3f13660cd182013d34ca667c"
537538
dependencies = [
538539
"chalk-derive",
539540
"chalk-ir",
@@ -1783,9 +1784,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
17831784

17841785
[[package]]
17851786
name = "libc"
1786-
version = "0.2.79"
1787+
version = "0.2.85"
17871788
source = "registry+https://github.com/rust-lang/crates.io-index"
1788-
checksum = "2448f6066e80e3bfc792e9c98bf705b4b0fc6e8ef5b43e5889aff0eaa9c58743"
1789+
checksum = "7ccac4b00700875e6a07c6cde370d44d32fa01c5a65cdd2fca6858c479d28bb3"
17891790
dependencies = [
17901791
"rustc-std-workspace-core",
17911792
]
@@ -4313,6 +4314,7 @@ dependencies = [
43134314
"chalk-ir",
43144315
"chalk-solve",
43154316
"rustc_ast",
4317+
"rustc_attr",
43164318
"rustc_data_structures",
43174319
"rustc_hir",
43184320
"rustc_index",

compiler/rustc_builtin_macros/src/assert.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ pub fn expand_assert<'cx>(
2929

3030
let panic_call = if let Some(tokens) = custom_message {
3131
let path = if span.rust_2021() {
32-
// On edition 2021, we always call `$crate::panic!()`.
32+
// On edition 2021, we always call `$crate::panic::panic_2021!()`.
3333
Path {
3434
span: sp,
3535
segments: cx
36-
.std_path(&[sym::panic])
36+
.std_path(&[sym::panic, sym::panic_2021])
3737
.into_iter()
3838
.map(|ident| PathSegment::from_ident(ident))
3939
.collect(),

compiler/rustc_codegen_llvm/src/va_arg.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ fn emit_aapcs_va_arg(
105105
let mut end = bx.build_sibling_block("va_arg.end");
106106
let zero = bx.const_i32(0);
107107
let offset_align = Align::from_bytes(4).unwrap();
108-
assert_eq!(bx.tcx().sess.target.endian, Endian::Little);
109108

110109
let gr_type = target_ty.is_any_ptr() || target_ty.is_integral();
111110
let (reg_off, reg_top_index, slot_size) = if gr_type {
@@ -144,9 +143,14 @@ fn emit_aapcs_va_arg(
144143
let top = in_reg.load(top, bx.tcx().data_layout.pointer_align.abi);
145144

146145
// reg_value = *(@top + reg_off_v);
147-
let top = in_reg.gep(top, &[reg_off_v]);
148-
let top = in_reg.bitcast(top, bx.cx.type_ptr_to(layout.llvm_type(bx)));
149-
let reg_value = in_reg.load(top, layout.align.abi);
146+
let mut reg_addr = in_reg.gep(top, &[reg_off_v]);
147+
if bx.tcx().sess.target.endian == Endian::Big && layout.size.bytes() != slot_size {
148+
// On big-endian systems the value is right-aligned in its slot.
149+
let offset = bx.const_i32((slot_size - layout.size.bytes()) as i32);
150+
reg_addr = in_reg.gep(reg_addr, &[offset]);
151+
}
152+
let reg_addr = in_reg.bitcast(reg_addr, bx.cx.type_ptr_to(layout.llvm_type(bx)));
153+
let reg_value = in_reg.load(reg_addr, layout.align.abi);
150154
in_reg.br(&end.llbb());
151155

152156
// On Stack block

compiler/rustc_error_codes/src/error_codes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ E0516: include_str!("./error_codes/E0516.md"),
267267
E0517: include_str!("./error_codes/E0517.md"),
268268
E0518: include_str!("./error_codes/E0518.md"),
269269
E0520: include_str!("./error_codes/E0520.md"),
270+
E0521: include_str!("./error_codes/E0521.md"),
270271
E0522: include_str!("./error_codes/E0522.md"),
271272
E0524: include_str!("./error_codes/E0524.md"),
272273
E0525: include_str!("./error_codes/E0525.md"),
@@ -597,7 +598,6 @@ E0780: include_str!("./error_codes/E0780.md"),
597598
E0514, // metadata version mismatch
598599
E0519, // local crate and dependency have same (crate-name, disambiguator)
599600
// two dependencies have same (crate-name, disambiguator) but different SVH
600-
E0521, // borrowed data escapes outside of closure
601601
E0523,
602602
// E0526, // shuffle indices are not constant
603603
// E0540, // multiple rustc_deprecated attributes
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Borrowed data escapes outside of closure.
2+
3+
Erroneous code example:
4+
5+
```compile_fail,E0521
6+
let mut list: Vec<&str> = Vec::new();
7+
8+
let _add = |el: &str| {
9+
list.push(el); // error: `el` escapes the closure body here
10+
};
11+
```
12+
13+
A type anotation of a closure parameter implies a new lifetime declaration.
14+
Consider to drop it, the compiler is reliably able to infer them.
15+
16+
```
17+
let mut list: Vec<&str> = Vec::new();
18+
19+
let _add = |el| {
20+
list.push(el);
21+
};
22+
```
23+
24+
See the [Closure type inference and annotation][closure-infere-annotation] and
25+
[Lifetime elision][lifetime-elision] sections of the Book for more details.
26+
27+
[closure-infere-annotation]: https://doc.rust-lang.org/book/ch13-01-closures.html#closure-type-inference-and-annotation
28+
[lifetime-elision]: https://doc.rust-lang.org/reference/lifetime-elision.html

compiler/rustc_infer/src/infer/canonical/canonicalizer.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -353,10 +353,8 @@ impl<'cx, 'tcx> TypeFolder<'tcx> for Canonicalizer<'cx, 'tcx> {
353353
// `TyVar(vid)` is unresolved, track its universe index in the canonicalized
354354
// result.
355355
Err(mut ui) => {
356-
if !self.infcx.unwrap().tcx.sess.opts.debugging_opts.chalk {
357-
// FIXME: perf problem described in #55921.
358-
ui = ty::UniverseIndex::ROOT;
359-
}
356+
// FIXME: perf problem described in #55921.
357+
ui = ty::UniverseIndex::ROOT;
360358
self.canonicalize_ty_var(
361359
CanonicalVarInfo {
362360
kind: CanonicalVarKind::Ty(CanonicalTyVarKind::General(ui)),
@@ -440,10 +438,8 @@ impl<'cx, 'tcx> TypeFolder<'tcx> for Canonicalizer<'cx, 'tcx> {
440438
// `ConstVar(vid)` is unresolved, track its universe index in the
441439
// canonicalized result
442440
Err(mut ui) => {
443-
if !self.infcx.unwrap().tcx.sess.opts.debugging_opts.chalk {
444-
// FIXME: perf problem described in #55921.
445-
ui = ty::UniverseIndex::ROOT;
446-
}
441+
// FIXME: perf problem described in #55921.
442+
ui = ty::UniverseIndex::ROOT;
447443
return self.canonicalize_const_var(
448444
CanonicalVarInfo { kind: CanonicalVarKind::Const(ui) },
449445
ct,

compiler/rustc_infer/src/infer/error_reporting/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1855,7 +1855,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
18551855
diag.span_suggestion(
18561856
span,
18571857
&format!(
1858-
"you might have meant to use field `{}` of type `{}`",
1858+
"you might have meant to use field `{}` whose type is `{}`",
18591859
name, ty
18601860
),
18611861
suggestion,

compiler/rustc_middle/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ rustc_index = { path = "../rustc_index" }
2626
rustc_serialize = { path = "../rustc_serialize" }
2727
rustc_ast = { path = "../rustc_ast" }
2828
rustc_span = { path = "../rustc_span" }
29-
chalk-ir = "0.36.0"
29+
chalk-ir = "0.55.0"
3030
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
3131
measureme = "9.0.0"
3232
rustc_session = { path = "../rustc_session" }

compiler/rustc_middle/src/mir/interpret/value.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ impl<'tcx> ConstValue<'tcx> {
9696
}
9797

9898
/// A `Scalar` represents an immediate, primitive value existing outside of a
99-
/// `memory::Allocation`. It is in many ways like a small chunk of a `Allocation`, up to 8 bytes in
99+
/// `memory::Allocation`. It is in many ways like a small chunk of a `Allocation`, up to 16 bytes in
100100
/// size. Like a range of bytes in an `Allocation`, a `Scalar` can either represent the raw bytes
101101
/// of a simple value or a pointer into another `Allocation`
102102
#[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd, TyEncodable, TyDecodable, Hash)]

0 commit comments

Comments
 (0)