Skip to content

Commit 3d86494

Browse files
committedMay 24, 2025·
Auto merge of #141518 - GuillaumeGomez:rollup-ivjep2j, r=GuillaumeGomez
Rollup of 6 pull requests Successful merges: - #140066 (Stabilize `<[T; N]>::as_mut_slice` as `const`) - #141105 (additional edge cases tests for `path.rs` 🧪 ) - #141487 (Update askama to `0.14.0`) - #141498 (Use C-string literals to reduce boilerplate) - #141505 (rename internal panicking::try to catch_unwind) - #141511 (Cleanup CodegenFnAttrFlags) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 5e16c66 + 7cd749d commit 3d86494

File tree

26 files changed

+155
-112
lines changed

26 files changed

+155
-112
lines changed
 

‎Cargo.lock

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,20 @@ version = "0.13.1"
183183
source = "registry+https://github.com/rust-lang/crates.io-index"
184184
checksum = "5d4744ed2eef2645831b441d8f5459689ade2ab27c854488fbab1fbe94fce1a7"
185185
dependencies = [
186-
"askama_derive",
186+
"askama_derive 0.13.1",
187+
"itoa",
188+
"percent-encoding",
189+
"serde",
190+
"serde_json",
191+
]
192+
193+
[[package]]
194+
name = "askama"
195+
version = "0.14.0"
196+
source = "registry+https://github.com/rust-lang/crates.io-index"
197+
checksum = "f75363874b771be265f4ffe307ca705ef6f3baa19011c149da8674a87f1b75c4"
198+
dependencies = [
199+
"askama_derive 0.14.0",
187200
"itoa",
188201
"percent-encoding",
189202
"serde",
@@ -196,7 +209,24 @@ version = "0.13.1"
196209
source = "registry+https://github.com/rust-lang/crates.io-index"
197210
checksum = "d661e0f57be36a5c14c48f78d09011e67e0cb618f269cca9f2fd8d15b68c46ac"
198211
dependencies = [
199-
"askama_parser",
212+
"askama_parser 0.13.0",
213+
"basic-toml",
214+
"memchr",
215+
"proc-macro2",
216+
"quote",
217+
"rustc-hash 2.1.1",
218+
"serde",
219+
"serde_derive",
220+
"syn 2.0.101",
221+
]
222+
223+
[[package]]
224+
name = "askama_derive"
225+
version = "0.14.0"
226+
source = "registry+https://github.com/rust-lang/crates.io-index"
227+
checksum = "129397200fe83088e8a68407a8e2b1f826cf0086b21ccdb866a722c8bcd3a94f"
228+
dependencies = [
229+
"askama_parser 0.14.0",
200230
"basic-toml",
201231
"memchr",
202232
"proc-macro2",
@@ -219,6 +249,18 @@ dependencies = [
219249
"winnow 0.7.10",
220250
]
221251

252+
[[package]]
253+
name = "askama_parser"
254+
version = "0.14.0"
255+
source = "registry+https://github.com/rust-lang/crates.io-index"
256+
checksum = "d6ab5630b3d5eaf232620167977f95eb51f3432fc76852328774afbd242d4358"
257+
dependencies = [
258+
"memchr",
259+
"serde",
260+
"serde_derive",
261+
"winnow 0.7.10",
262+
]
263+
222264
[[package]]
223265
name = "autocfg"
224266
version = "1.4.0"
@@ -540,7 +582,7 @@ name = "clippy"
540582
version = "0.1.89"
541583
dependencies = [
542584
"anstream",
543-
"askama",
585+
"askama 0.13.1",
544586
"cargo_metadata 0.18.1",
545587
"clippy_config",
546588
"clippy_lints",
@@ -1389,7 +1431,7 @@ name = "generate-copyright"
13891431
version = "0.1.0"
13901432
dependencies = [
13911433
"anyhow",
1392-
"askama",
1434+
"askama 0.14.0",
13931435
"cargo_metadata 0.18.1",
13941436
"serde",
13951437
"serde_json",
@@ -4622,7 +4664,7 @@ name = "rustdoc"
46224664
version = "0.0.0"
46234665
dependencies = [
46244666
"arrayvec",
4625-
"askama",
4667+
"askama 0.14.0",
46264668
"base64",
46274669
"expect-test",
46284670
"indexmap",

‎compiler/rustc_codegen_gcc/src/consts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ impl<'gcc, 'tcx> StaticCodegenMethods for CodegenCx<'gcc, 'tcx> {
154154
// TODO(antoyo): set link section.
155155
}
156156

157-
if attrs.flags.contains(CodegenFnAttrFlags::USED)
157+
if attrs.flags.contains(CodegenFnAttrFlags::USED_COMPILER)
158158
|| attrs.flags.contains(CodegenFnAttrFlags::USED_LINKER)
159159
{
160160
self.add_used_global(global.to_rvalue());

‎compiler/rustc_codegen_llvm/src/consts.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ impl<'ll> CodegenCx<'ll, '_> {
527527

528528
base::set_variable_sanitizer_attrs(g, attrs);
529529

530-
if attrs.flags.contains(CodegenFnAttrFlags::USED) {
530+
if attrs.flags.contains(CodegenFnAttrFlags::USED_COMPILER) {
531531
// `USED` and `USED_LINKER` can't be used together.
532532
assert!(!attrs.flags.contains(CodegenFnAttrFlags::USED_LINKER));
533533

@@ -551,7 +551,7 @@ impl<'ll> CodegenCx<'ll, '_> {
551551
}
552552
if attrs.flags.contains(CodegenFnAttrFlags::USED_LINKER) {
553553
// `USED` and `USED_LINKER` can't be used together.
554-
assert!(!attrs.flags.contains(CodegenFnAttrFlags::USED));
554+
assert!(!attrs.flags.contains(CodegenFnAttrFlags::USED_COMPILER));
555555

556556
self.add_used_global(g);
557557
}

‎compiler/rustc_codegen_ssa/src/back/symbol_export.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ fn reachable_non_generics_provider(tcx: TyCtxt<'_>, _: LocalCrate) -> DefIdMap<S
128128
} else {
129129
SymbolExportKind::Text
130130
},
131-
used: codegen_attrs.flags.contains(CodegenFnAttrFlags::USED)
131+
used: codegen_attrs.flags.contains(CodegenFnAttrFlags::USED_COMPILER)
132132
|| codegen_attrs.flags.contains(CodegenFnAttrFlags::USED_LINKER)
133133
|| used,
134134
};

‎compiler/rustc_codegen_ssa/src/codegen_attrs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs {
189189
)
190190
.emit();
191191
}
192-
codegen_fn_attrs.flags |= CodegenFnAttrFlags::USED;
192+
codegen_fn_attrs.flags |= CodegenFnAttrFlags::USED_COMPILER;
193193
}
194194
Some(_) => {
195195
tcx.dcx().emit_err(errors::ExpectedUsedSymbol { span: attr.span() });
@@ -220,7 +220,7 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs {
220220
|| tcx.sess.target.is_like_windows
221221
|| tcx.sess.target.is_like_wasm);
222222
codegen_fn_attrs.flags |= if is_like_elf {
223-
CodegenFnAttrFlags::USED
223+
CodegenFnAttrFlags::USED_COMPILER
224224
} else {
225225
CodegenFnAttrFlags::USED_LINKER
226226
};

‎compiler/rustc_middle/src/middle/codegen_fn_attrs.rs

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -96,49 +96,46 @@ bitflags::bitflags! {
9696
/// `#[cold]`: a hint to LLVM that this function, when called, is never on
9797
/// the hot path.
9898
const COLD = 1 << 0;
99-
/// `#[rustc_allocator]`: a hint to LLVM that the pointer returned from this
100-
/// function is never null and the function has no side effects other than allocating.
101-
const ALLOCATOR = 1 << 1;
102-
/// An indicator that function will never unwind. Will become obsolete
103-
/// once C-unwind is fully stabilized.
104-
const NEVER_UNWIND = 1 << 3;
99+
/// `#[rustc_nounwind]`: An indicator that function will never unwind.
100+
const NEVER_UNWIND = 1 << 1;
105101
/// `#[naked]`: an indicator to LLVM that no function prologue/epilogue
106102
/// should be generated.
107-
const NAKED = 1 << 4;
103+
const NAKED = 1 << 2;
108104
/// `#[no_mangle]`: an indicator that the function's name should be the same
109105
/// as its symbol.
110-
const NO_MANGLE = 1 << 5;
106+
const NO_MANGLE = 1 << 3;
111107
/// `#[rustc_std_internal_symbol]`: an indicator that this symbol is a
112108
/// "weird symbol" for the standard library in that it has slightly
113109
/// different linkage, visibility, and reachability rules.
114-
const RUSTC_STD_INTERNAL_SYMBOL = 1 << 6;
110+
const RUSTC_STD_INTERNAL_SYMBOL = 1 << 4;
115111
/// `#[thread_local]`: indicates a static is actually a thread local
116112
/// piece of memory
117-
const THREAD_LOCAL = 1 << 8;
118-
/// `#[used]`: indicates that LLVM can't eliminate this function (but the
113+
const THREAD_LOCAL = 1 << 5;
114+
/// `#[used(compiler)]`: indicates that LLVM can't eliminate this function (but the
119115
/// linker can!).
120-
const USED = 1 << 9;
116+
const USED_COMPILER = 1 << 6;
117+
/// `#[used(linker)]`:
118+
/// indicates that neither LLVM nor the linker will eliminate this function.
119+
const USED_LINKER = 1 << 7;
121120
/// `#[track_caller]`: allow access to the caller location
122-
const TRACK_CALLER = 1 << 10;
121+
const TRACK_CALLER = 1 << 8;
123122
/// #[ffi_pure]: applies clang's `pure` attribute to a foreign function
124123
/// declaration.
125-
const FFI_PURE = 1 << 11;
124+
const FFI_PURE = 1 << 9;
126125
/// #[ffi_const]: applies clang's `const` attribute to a foreign function
127126
/// declaration.
128-
const FFI_CONST = 1 << 12;
129-
// (Bit 13 was used for `#[cmse_nonsecure_entry]`, but is now unused.)
130-
// (Bit 14 was used for `#[coverage(off)]`, but is now unused.)
131-
/// `#[used(linker)]`:
132-
/// indicates that neither LLVM nor the linker will eliminate this function.
133-
const USED_LINKER = 1 << 15;
127+
const FFI_CONST = 1 << 10;
128+
/// `#[rustc_allocator]`: a hint to LLVM that the pointer returned from this
129+
/// function is never null and the function has no side effects other than allocating.
130+
const ALLOCATOR = 1 << 11;
134131
/// `#[rustc_deallocator]`: a hint to LLVM that the function only deallocates memory.
135-
const DEALLOCATOR = 1 << 16;
132+
const DEALLOCATOR = 1 << 12;
136133
/// `#[rustc_reallocator]`: a hint to LLVM that the function only reallocates memory.
137-
const REALLOCATOR = 1 << 17;
134+
const REALLOCATOR = 1 << 13;
138135
/// `#[rustc_allocator_zeroed]`: a hint to LLVM that the function only allocates zeroed memory.
139-
const ALLOCATOR_ZEROED = 1 << 18;
136+
const ALLOCATOR_ZEROED = 1 << 14;
140137
/// `#[no_builtins]`: indicates that disable implicit builtin knowledge of functions for the function.
141-
const NO_BUILTINS = 1 << 19;
138+
const NO_BUILTINS = 1 << 15;
142139
}
143140
}
144141
rustc_data_structures::external_bitflags_debug! { CodegenFnAttrFlags }

‎compiler/rustc_passes/src/dead.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ fn has_allow_dead_code_or_lang_attr(
707707
// #[used], #[no_mangle], #[export_name], etc also keeps the item alive
708708
// forcefully, e.g., for placing it in a specific section.
709709
cg_attrs.contains_extern_indicator()
710-
|| cg_attrs.flags.contains(CodegenFnAttrFlags::USED)
710+
|| cg_attrs.flags.contains(CodegenFnAttrFlags::USED_COMPILER)
711711
|| cg_attrs.flags.contains(CodegenFnAttrFlags::USED_LINKER)
712712
}
713713
}

‎compiler/rustc_passes/src/reachable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ fn has_custom_linkage(tcx: TyCtxt<'_>, def_id: LocalDefId) -> bool {
427427
// FIXME(nbdd0121): `#[used]` are marked as reachable here so it's picked up by
428428
// `linked_symbols` in cg_ssa. They won't be exported in binary or cdylib due to their
429429
// `SymbolExportLevel::Rust` export level but may end up being exported in dylibs.
430-
|| codegen_attrs.flags.contains(CodegenFnAttrFlags::USED)
430+
|| codegen_attrs.flags.contains(CodegenFnAttrFlags::USED_COMPILER)
431431
|| codegen_attrs.flags.contains(CodegenFnAttrFlags::USED_LINKER)
432432
}
433433

‎library/core/src/array/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ impl<T, const N: usize> [T; N] {
588588
/// Returns a mutable slice containing the entire array. Equivalent to
589589
/// `&mut s[..]`.
590590
#[stable(feature = "array_as_slice", since = "1.57.0")]
591-
#[rustc_const_unstable(feature = "const_array_as_mut_slice", issue = "133333")]
591+
#[rustc_const_stable(feature = "const_array_as_mut_slice", since = "CURRENT_RUSTC_VERSION")]
592592
pub const fn as_mut_slice(&mut self) -> &mut [T] {
593593
self
594594
}

‎library/core/src/ffi/c_str.rs

Lines changed: 7 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -511,13 +511,8 @@ impl CStr {
511511
/// # Examples
512512
///
513513
/// ```
514-
/// use std::ffi::CStr;
515-
///
516-
/// let cstr = CStr::from_bytes_with_nul(b"foo\0").unwrap();
517-
/// assert_eq!(cstr.count_bytes(), 3);
518-
///
519-
/// let cstr = CStr::from_bytes_with_nul(b"\0").unwrap();
520-
/// assert_eq!(cstr.count_bytes(), 0);
514+
/// assert_eq!(c"foo".count_bytes(), 3);
515+
/// assert_eq!(c"".count_bytes(), 0);
521516
/// ```
522517
#[inline]
523518
#[must_use]
@@ -533,19 +528,8 @@ impl CStr {
533528
/// # Examples
534529
///
535530
/// ```
536-
/// use std::ffi::CStr;
537-
/// # use std::ffi::FromBytesWithNulError;
538-
///
539-
/// # fn main() { test().unwrap(); }
540-
/// # fn test() -> Result<(), FromBytesWithNulError> {
541-
/// let cstr = CStr::from_bytes_with_nul(b"foo\0")?;
542-
/// assert!(!cstr.is_empty());
543-
///
544-
/// let empty_cstr = CStr::from_bytes_with_nul(b"\0")?;
545-
/// assert!(empty_cstr.is_empty());
531+
/// assert!(!c"foo".is_empty());
546532
/// assert!(c"".is_empty());
547-
/// # Ok(())
548-
/// # }
549533
/// ```
550534
#[inline]
551535
#[stable(feature = "cstr_is_empty", since = "1.71.0")]
@@ -569,10 +553,7 @@ impl CStr {
569553
/// # Examples
570554
///
571555
/// ```
572-
/// use std::ffi::CStr;
573-
///
574-
/// let cstr = CStr::from_bytes_with_nul(b"foo\0").expect("CStr::from_bytes_with_nul failed");
575-
/// assert_eq!(cstr.to_bytes(), b"foo");
556+
/// assert_eq!(c"foo".to_bytes(), b"foo");
576557
/// ```
577558
#[inline]
578559
#[must_use = "this returns the result of the operation, \
@@ -598,10 +579,7 @@ impl CStr {
598579
/// # Examples
599580
///
600581
/// ```
601-
/// use std::ffi::CStr;
602-
///
603-
/// let cstr = CStr::from_bytes_with_nul(b"foo\0").expect("CStr::from_bytes_with_nul failed");
604-
/// assert_eq!(cstr.to_bytes_with_nul(), b"foo\0");
582+
/// assert_eq!(c"foo".to_bytes_with_nul(), b"foo\0");
605583
/// ```
606584
#[inline]
607585
#[must_use = "this returns the result of the operation, \
@@ -623,10 +601,8 @@ impl CStr {
623601
///
624602
/// ```
625603
/// #![feature(cstr_bytes)]
626-
/// use std::ffi::CStr;
627604
///
628-
/// let cstr = CStr::from_bytes_with_nul(b"foo\0").expect("CStr::from_bytes_with_nul failed");
629-
/// assert!(cstr.bytes().eq(*b"foo"));
605+
/// assert!(c"foo".bytes().eq(*b"foo"));
630606
/// ```
631607
#[inline]
632608
#[unstable(feature = "cstr_bytes", issue = "112115")]
@@ -645,10 +621,7 @@ impl CStr {
645621
/// # Examples
646622
///
647623
/// ```
648-
/// use std::ffi::CStr;
649-
///
650-
/// let cstr = CStr::from_bytes_with_nul(b"foo\0").expect("CStr::from_bytes_with_nul failed");
651-
/// assert_eq!(cstr.to_str(), Ok("foo"));
624+
/// assert_eq!(c"foo".to_str(), Ok("foo"));
652625
/// ```
653626
#[stable(feature = "cstr_to_str", since = "1.4.0")]
654627
#[rustc_const_stable(feature = "const_cstr_methods", since = "1.72.0")]

‎library/std/src/panic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ pub use core::panic::abort_unwind;
356356
/// ```
357357
#[stable(feature = "catch_unwind", since = "1.9.0")]
358358
pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
359-
unsafe { panicking::r#try(f) }
359+
unsafe { panicking::catch_unwind(f) }
360360
}
361361

362362
/// Triggers a panic without invoking the panic hook.

‎library/std/src/panicking.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -499,13 +499,13 @@ pub use realstd::rt::panic_count;
499499

500500
/// Invoke a closure, capturing the cause of an unwinding panic if one occurs.
501501
#[cfg(feature = "panic_immediate_abort")]
502-
pub unsafe fn r#try<R, F: FnOnce() -> R>(f: F) -> Result<R, Box<dyn Any + Send>> {
502+
pub unsafe fn catch_unwind<R, F: FnOnce() -> R>(f: F) -> Result<R, Box<dyn Any + Send>> {
503503
Ok(f())
504504
}
505505

506506
/// Invoke a closure, capturing the cause of an unwinding panic if one occurs.
507507
#[cfg(not(feature = "panic_immediate_abort"))]
508-
pub unsafe fn r#try<R, F: FnOnce() -> R>(f: F) -> Result<R, Box<dyn Any + Send>> {
508+
pub unsafe fn catch_unwind<R, F: FnOnce() -> R>(f: F) -> Result<R, Box<dyn Any + Send>> {
509509
union Data<F, R> {
510510
f: ManuallyDrop<F>,
511511
r: ManuallyDrop<R>,
@@ -541,7 +541,7 @@ pub unsafe fn r#try<R, F: FnOnce() -> R>(f: F) -> Result<R, Box<dyn Any + Send>>
541541
let data_ptr = (&raw mut data) as *mut u8;
542542
// SAFETY:
543543
//
544-
// Access to the union's fields: this is `std` and we know that the `r#try`
544+
// Access to the union's fields: this is `std` and we know that the `catch_unwind`
545545
// intrinsic fills in the `r` or `p` union field based on its return value.
546546
//
547547
// The call to `intrinsics::catch_unwind` is made safe by:
@@ -602,7 +602,7 @@ pub unsafe fn r#try<R, F: FnOnce() -> R>(f: F) -> Result<R, Box<dyn Any + Send>>
602602
// This function cannot be marked as `unsafe` because `intrinsics::catch_unwind`
603603
// expects normal function pointers.
604604
#[inline]
605-
#[rustc_nounwind] // `intrinsic::r#try` requires catch fn to be nounwind
605+
#[rustc_nounwind] // `intrinsic::catch_unwind` requires catch fn to be nounwind
606606
fn do_catch<F: FnOnce() -> R, R>(data: *mut u8, payload: *mut u8) {
607607
// SAFETY: this is the responsibility of the caller, see above.
608608
//

‎library/std/tests/path.rs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1976,3 +1976,34 @@ fn clone_to_uninit() {
19761976
unsafe { a.clone_to_uninit(ptr::from_mut::<Path>(&mut b).cast()) };
19771977
assert_eq!(a, &*b);
19781978
}
1979+
1980+
// Test: Only separators (e.g., "/" or "\\")
1981+
// This test checks how Path handles a string that consists only of path separators.
1982+
// It should recognize the root and not treat it as a normal component.
1983+
#[test]
1984+
fn test_only_separators() {
1985+
let path = Path::new("/////");
1986+
assert!(path.has_root());
1987+
assert_eq!(path.iter().count(), 1);
1988+
assert_eq!(path.parent(), None);
1989+
}
1990+
1991+
// Test: Non-ASCII/Unicode
1992+
// This test verifies that Path can handle Unicode and non-ASCII characters in the path.
1993+
// It ensures that such paths are not rejected or misinterpreted.
1994+
#[test]
1995+
fn test_non_ascii_unicode() {
1996+
let path = Path::new("/tmp/❤/🚀/file.txt");
1997+
assert!(path.to_str().is_some());
1998+
assert_eq!(path.file_name(), Some(OsStr::new("file.txt")));
1999+
}
2000+
2001+
// Test: Embedded newlines
2002+
// This test verifies that newlines within path components are preserved and do not break path parsing.
2003+
// It ensures that Path treats newlines as normal characters.
2004+
#[test]
2005+
fn test_embedded_newline() {
2006+
let path = Path::new("foo\nbar");
2007+
assert_eq!(path.file_name(), Some(OsStr::new("foo\nbar")));
2008+
assert_eq!(path.to_str(), Some("foo\nbar"));
2009+
}

‎src/ci/citool/Cargo.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change

‎src/ci/citool/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ edition = "2021"
55

66
[dependencies]
77
anyhow = "1"
8-
askama = "0.13"
8+
askama = "0.14"
99
clap = { version = "4.5", features = ["derive"] }
1010
csv = "1"
1111
diff = "0.1"

‎src/librustdoc/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ path = "lib.rs"
99

1010
[dependencies]
1111
arrayvec = { version = "0.7", default-features = false }
12-
askama = { version = "0.13", default-features = false, features = ["alloc", "config", "derive"] }
12+
askama = { version = "0.14", default-features = false, features = ["alloc", "config", "derive"] }
1313
base64 = "0.21.7"
1414
itertools = "0.12"
1515
indexmap = "2"

‎src/librustdoc/html/render/sidebar.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ pub(crate) mod filters {
127127
use askama::filters::Safe;
128128

129129
use crate::html::escape::EscapeBodyTextWithWbr;
130-
pub(crate) fn wrapped<T>(v: T) -> askama::Result<Safe<impl Display>>
130+
pub(crate) fn wrapped<T, V: askama::Values>(v: T, _: V) -> askama::Result<Safe<impl Display>>
131131
where
132132
T: Display,
133133
{

‎src/tools/generate-copyright/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description = "Produces a manifest of all the copyrighted materials in the Rust
88

99
[dependencies]
1010
anyhow = "1.0.65"
11-
askama = "0.13.0"
11+
askama = "0.14.0"
1212
cargo_metadata = "0.18.1"
1313
serde = { version = "1.0.147", features = ["derive"] }
1414
serde_json = "1.0.85"

‎src/tools/miri/src/bin/miri.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ impl rustc_driver::Callbacks for MiriBeRustCompilerCalls {
281281
}
282282
let codegen_fn_attrs = tcx.codegen_fn_attrs(local_def_id);
283283
if codegen_fn_attrs.contains_extern_indicator()
284-
|| codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::USED)
284+
|| codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::USED_COMPILER)
285285
|| codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::USED_LINKER)
286286
{
287287
Some((

‎src/tools/miri/src/helpers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ pub fn iter_exported_symbols<'tcx>(
135135
let codegen_attrs = tcx.codegen_fn_attrs(def_id);
136136
codegen_attrs.contains_extern_indicator()
137137
|| codegen_attrs.flags.contains(CodegenFnAttrFlags::RUSTC_STD_INTERNAL_SYMBOL)
138-
|| codegen_attrs.flags.contains(CodegenFnAttrFlags::USED)
138+
|| codegen_attrs.flags.contains(CodegenFnAttrFlags::USED_COMPILER)
139139
|| codegen_attrs.flags.contains(CodegenFnAttrFlags::USED_LINKER)
140140
};
141141
if exported {

‎src/tools/miri/src/shims/panic.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
5656
interp_ok(())
5757
}
5858

59-
/// Handles the `try` intrinsic, the underlying implementation of `std::panicking::try`.
59+
/// Handles the `catch_unwind` intrinsic.
6060
fn handle_catch_unwind(
6161
&mut self,
6262
args: &[OpTy<'tcx>],
@@ -66,7 +66,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
6666
let this = self.eval_context_mut();
6767

6868
// Signature:
69-
// fn r#try(try_fn: fn(*mut u8), data: *mut u8, catch_fn: fn(*mut u8, *mut u8)) -> i32
69+
// fn catch_unwind(try_fn: fn(*mut u8), data: *mut u8, catch_fn: fn(*mut u8, *mut u8)) -> i32
7070
// Calls `try_fn` with `data` as argument. If that executes normally, returns 0.
7171
// If that unwinds, calls `catch_fn` with the first argument being `data` and
7272
// then second argument being a target-dependent `payload` (i.e. it is up to us to define
@@ -120,14 +120,14 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
120120
// We only care about `catch_panic` if we're unwinding - if we're doing a normal
121121
// return, then we don't need to do anything special.
122122
if let (true, Some(catch_unwind)) = (unwinding, extra.catch_unwind.take()) {
123-
// We've just popped a frame that was pushed by `try`,
123+
// We've just popped a frame that was pushed by `catch_unwind`,
124124
// and we are unwinding, so we should catch that.
125125
trace!(
126126
"unwinding: found catch_panic frame during unwinding: {:?}",
127127
this.frame().instance()
128128
);
129129

130-
// We set the return value of `try` to 1, since there was a panic.
130+
// We set the return value of `catch_unwind` to 1, since there was a panic.
131131
this.write_scalar(Scalar::from_i32(1), &catch_unwind.dest)?;
132132

133133
// The Thread's `panic_payload` holds what was passed to `miri_start_unwind`.
@@ -142,7 +142,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
142142
ExternAbi::Rust,
143143
&[catch_unwind.data, payload],
144144
None,
145-
// Directly return to caller of `try`.
145+
// Directly return to caller of `catch_unwind`.
146146
StackPopCleanup::Goto {
147147
ret: catch_unwind.ret,
148148
// `catch_fn` must not unwind.

‎src/tools/miri/tests/fail/panic/bad_unwind.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ LL | std::panic::catch_unwind(|| unwind()).unwrap_err();
1313
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
1414
= note: BACKTRACE:
1515
= note: inside closure at tests/fail/panic/bad_unwind.rs:LL:CC
16-
= note: inside `std::panicking::r#try::do_call::<{closure@tests/fail/panic/bad_unwind.rs:LL:CC}, ()>` at RUSTLIB/std/src/panicking.rs:LL:CC
17-
= note: inside `std::panicking::r#try::<(), {closure@tests/fail/panic/bad_unwind.rs:LL:CC}>` at RUSTLIB/std/src/panicking.rs:LL:CC
16+
= note: inside `std::panicking::catch_unwind::do_call::<{closure@tests/fail/panic/bad_unwind.rs:LL:CC}, ()>` at RUSTLIB/std/src/panicking.rs:LL:CC
17+
= note: inside `std::panicking::catch_unwind::<(), {closure@tests/fail/panic/bad_unwind.rs:LL:CC}>` at RUSTLIB/std/src/panicking.rs:LL:CC
1818
= note: inside `std::panic::catch_unwind::<{closure@tests/fail/panic/bad_unwind.rs:LL:CC}, ()>` at RUSTLIB/std/src/panic.rs:LL:CC
1919
note: inside `main`
2020
--> tests/fail/panic/bad_unwind.rs:LL:CC

‎src/tools/miri/tests/fail/tail_calls/cc-mismatch.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ LL | extern "rust-call" fn call_once(self, args: Args) -> Self::Output;
1111
= note: inside `std::sys::backtrace::__rust_begin_short_backtrace::<fn(), ()>` at RUSTLIB/std/src/sys/backtrace.rs:LL:CC
1212
= note: inside closure at RUSTLIB/std/src/rt.rs:LL:CC
1313
= note: inside `std::ops::function::impls::<impl std::ops::FnOnce<()> for &dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe>::call_once` at RUSTLIB/core/src/ops/function.rs:LL:CC
14-
= note: inside `std::panicking::r#try::do_call::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>` at RUSTLIB/std/src/panicking.rs:LL:CC
15-
= note: inside `std::panicking::r#try::<i32, &dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe>` at RUSTLIB/std/src/panicking.rs:LL:CC
14+
= note: inside `std::panicking::catch_unwind::do_call::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>` at RUSTLIB/std/src/panicking.rs:LL:CC
15+
= note: inside `std::panicking::catch_unwind::<i32, &dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe>` at RUSTLIB/std/src/panicking.rs:LL:CC
1616
= note: inside `std::panic::catch_unwind::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32>` at RUSTLIB/std/src/panic.rs:LL:CC
1717
= note: inside closure at RUSTLIB/std/src/rt.rs:LL:CC
18-
= note: inside `std::panicking::r#try::do_call::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>` at RUSTLIB/std/src/panicking.rs:LL:CC
19-
= note: inside `std::panicking::r#try::<isize, {closure@std::rt::lang_start_internal::{closure#0}}>` at RUSTLIB/std/src/panicking.rs:LL:CC
18+
= note: inside `std::panicking::catch_unwind::do_call::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>` at RUSTLIB/std/src/panicking.rs:LL:CC
19+
= note: inside `std::panicking::catch_unwind::<isize, {closure@std::rt::lang_start_internal::{closure#0}}>` at RUSTLIB/std/src/panicking.rs:LL:CC
2020
= note: inside `std::panic::catch_unwind::<{closure@std::rt::lang_start_internal::{closure#0}}, isize>` at RUSTLIB/std/src/panic.rs:LL:CC
2121
= note: inside `std::rt::lang_start_internal` at RUSTLIB/std/src/rt.rs:LL:CC
2222
= note: inside `std::rt::lang_start::<()>` at RUSTLIB/std/src/rt.rs:LL:CC

‎src/tools/miri/tests/pass/backtrace/backtrace-api-v1.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ RUSTLIB/core/src/ops/function.rs:LL:CC (<fn() as std::ops::FnOnce<()>>::call_onc
77
RUSTLIB/std/src/sys/backtrace.rs:LL:CC (std::sys::backtrace::__rust_begin_short_backtrace)
88
RUSTLIB/std/src/rt.rs:LL:CC (std::rt::lang_start::{closure#0})
99
RUSTLIB/core/src/ops/function.rs:LL:CC (std::ops::function::impls::call_once)
10-
RUSTLIB/std/src/panicking.rs:LL:CC (std::panicking::r#try::do_call)
11-
RUSTLIB/std/src/panicking.rs:LL:CC (std::panicking::r#try)
10+
RUSTLIB/std/src/panicking.rs:LL:CC (std::panicking::catch_unwind::do_call)
11+
RUSTLIB/std/src/panicking.rs:LL:CC (std::panicking::catch_unwind)
1212
RUSTLIB/std/src/panic.rs:LL:CC (std::panic::catch_unwind)
1313
RUSTLIB/std/src/rt.rs:LL:CC (std::rt::lang_start_internal::{closure#0})
14-
RUSTLIB/std/src/panicking.rs:LL:CC (std::panicking::r#try::do_call)
15-
RUSTLIB/std/src/panicking.rs:LL:CC (std::panicking::r#try)
14+
RUSTLIB/std/src/panicking.rs:LL:CC (std::panicking::catch_unwind::do_call)
15+
RUSTLIB/std/src/panicking.rs:LL:CC (std::panicking::catch_unwind)
1616
RUSTLIB/std/src/panic.rs:LL:CC (std::panic::catch_unwind)
1717
RUSTLIB/std/src/rt.rs:LL:CC (std::rt::lang_start_internal)
1818
RUSTLIB/std/src/rt.rs:LL:CC (std::rt::lang_start)

‎src/tools/miri/tests/pass/backtrace/backtrace-global-alloc.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@
88
at RUSTLIB/std/src/rt.rs:LL:CC
99
4: std::ops::function::impls::call_once
1010
at RUSTLIB/core/src/ops/function.rs:LL:CC
11-
5: std::panicking::r#try::do_call
11+
5: std::panicking::catch_unwind::do_call
1212
at RUSTLIB/std/src/panicking.rs:LL:CC
13-
6: std::panicking::r#try
13+
6: std::panicking::catch_unwind
1414
at RUSTLIB/std/src/panicking.rs:LL:CC
1515
7: std::panic::catch_unwind
1616
at RUSTLIB/std/src/panic.rs:LL:CC
1717
8: std::rt::lang_start_internal::{closure#0}
1818
at RUSTLIB/std/src/rt.rs:LL:CC
19-
9: std::panicking::r#try::do_call
19+
9: std::panicking::catch_unwind::do_call
2020
at RUSTLIB/std/src/panicking.rs:LL:CC
21-
10: std::panicking::r#try
21+
10: std::panicking::catch_unwind
2222
at RUSTLIB/std/src/panicking.rs:LL:CC
2323
11: std::panic::catch_unwind
2424
at RUSTLIB/std/src/panic.rs:LL:CC

‎src/tools/miri/tests/pass/backtrace/backtrace-std.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@
1616
at RUSTLIB/std/src/rt.rs:LL:CC
1717
8: std::ops::function::impls::call_once
1818
at RUSTLIB/core/src/ops/function.rs:LL:CC
19-
9: std::panicking::r#try::do_call
19+
9: std::panicking::catch_unwind::do_call
2020
at RUSTLIB/std/src/panicking.rs:LL:CC
21-
10: std::panicking::r#try
21+
10: std::panicking::catch_unwind
2222
at RUSTLIB/std/src/panicking.rs:LL:CC
2323
11: std::panic::catch_unwind
2424
at RUSTLIB/std/src/panic.rs:LL:CC
2525
12: std::rt::lang_start_internal::{closure#0}
2626
at RUSTLIB/std/src/rt.rs:LL:CC
27-
13: std::panicking::r#try::do_call
27+
13: std::panicking::catch_unwind::do_call
2828
at RUSTLIB/std/src/panicking.rs:LL:CC
29-
14: std::panicking::r#try
29+
14: std::panicking::catch_unwind
3030
at RUSTLIB/std/src/panicking.rs:LL:CC
3131
15: std::panic::catch_unwind
3232
at RUSTLIB/std/src/panic.rs:LL:CC

0 commit comments

Comments
 (0)
Please sign in to comment.