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

Commit 242f20d

Browse files
committed
Auto merge of rust-lang#132972 - matthiaskrgr:rollup-456osr7, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - rust-lang#132702 (CFI: Append debug location to CFI blocks) - rust-lang#132851 (Update the doc comment of `ASCII_CASE_MASK`) - rust-lang#132948 (stabilize const_unicode_case_lookup) - rust-lang#132950 (Use GNU ld on m68k-unknown-linux-gnu) - rust-lang#132962 (triagebot: add codegen reviewers) - rust-lang#132966 (stabilize const_option_ext) - rust-lang#132970 (Add tracking issue number to unsigned_nonzero_div_ceil feature) r? `@ghost` `@rustbot` modify labels: rollup
2 parents b420d92 + d83de7e commit 242f20d

File tree

17 files changed

+68
-16
lines changed

17 files changed

+68
-16
lines changed

compiler/rustc_codegen_gcc/src/debuginfo.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ impl<'a, 'gcc, 'tcx> DebugInfoBuilderMethods for Builder<'a, 'gcc, 'tcx> {
5252
fn clear_dbg_loc(&mut self) {
5353
self.location = None;
5454
}
55+
56+
fn get_dbg_loc(&self) -> Option<Self::DILocation> {
57+
self.location
58+
}
5559
}
5660

5761
/// Generate the `debug_context` in an MIR Body.

compiler/rustc_codegen_llvm/src/builder.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,6 +1574,7 @@ impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx> {
15741574
cfi::typeid_for_fnabi(self.tcx, fn_abi, options)
15751575
};
15761576
let typeid_metadata = self.cx.typeid_metadata(typeid).unwrap();
1577+
let dbg_loc = self.get_dbg_loc();
15771578

15781579
// Test whether the function pointer is associated with the type identifier.
15791580
let cond = self.type_test(llfn, typeid_metadata);
@@ -1582,10 +1583,16 @@ impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx> {
15821583
self.cond_br(cond, bb_pass, bb_fail);
15831584

15841585
self.switch_to_block(bb_fail);
1586+
if let Some(dbg_loc) = dbg_loc {
1587+
self.set_dbg_loc(dbg_loc);
1588+
}
15851589
self.abort();
15861590
self.unreachable();
15871591

15881592
self.switch_to_block(bb_pass);
1593+
if let Some(dbg_loc) = dbg_loc {
1594+
self.set_dbg_loc(dbg_loc);
1595+
}
15891596
}
15901597
}
15911598

compiler/rustc_codegen_llvm/src/debuginfo/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,10 @@ impl<'ll> DebugInfoBuilderMethods for Builder<'_, 'll, '_> {
206206
}
207207
}
208208

209+
fn get_dbg_loc(&self) -> Option<&'ll DILocation> {
210+
unsafe { llvm::LLVMGetCurrentDebugLocation2(self.llbuilder) }
211+
}
212+
209213
fn insert_reference_to_gdb_debug_scripts_section_global(&mut self) {
210214
gdb::insert_reference_to_gdb_debug_scripts_section_global(self)
211215
}

compiler/rustc_codegen_llvm/src/llvm/ffi.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,6 +1063,7 @@ unsafe extern "C" {
10631063

10641064
// Metadata
10651065
pub fn LLVMSetCurrentDebugLocation2<'a>(Builder: &Builder<'a>, Loc: *const Metadata);
1066+
pub fn LLVMGetCurrentDebugLocation2<'a>(Builder: &Builder<'a>) -> Option<&'a Metadata>;
10661067

10671068
// Terminators
10681069
pub fn LLVMBuildRetVoid<'a>(B: &Builder<'a>) -> &'a Value;

compiler/rustc_codegen_ssa/src/traits/debuginfo.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ pub trait DebugInfoBuilderMethods: BackendTypes {
8181
);
8282
fn set_dbg_loc(&mut self, dbg_loc: Self::DILocation);
8383
fn clear_dbg_loc(&mut self);
84+
fn get_dbg_loc(&self) -> Option<Self::DILocation>;
8485
fn insert_reference_to_gdb_debug_scripts_section_global(&mut self);
8586
fn set_var_name(&mut self, value: Self::Value, name: &str);
8687
}

compiler/rustc_target/src/spec/targets/m68k_unknown_linux_gnu.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::abi::Endian;
2-
use crate::spec::{Target, TargetOptions, base};
2+
use crate::spec::{LinkSelfContainedDefault, Target, TargetOptions, base};
33

44
pub(crate) fn target() -> Target {
55
let mut base = base::linux_gnu::opts();
@@ -17,6 +17,13 @@ pub(crate) fn target() -> Target {
1717
pointer_width: 32,
1818
data_layout: "E-m:e-p:32:16:32-i8:8:8-i16:16:16-i32:16:32-n8:16:32-a:0:16-S16".into(),
1919
arch: "m68k".into(),
20-
options: TargetOptions { endian: Endian::Big, mcount: "_mcount".into(), ..base },
20+
options: TargetOptions {
21+
endian: Endian::Big,
22+
mcount: "_mcount".into(),
23+
24+
// LLD currently does not have support for M68k
25+
link_self_contained: LinkSelfContainedDefault::False,
26+
..base
27+
},
2128
}
2229
}

library/core/src/char/methods.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -775,13 +775,12 @@ impl char {
775775
/// In a const context:
776776
///
777777
/// ```
778-
/// #![feature(const_unicode_case_lookup)]
779778
/// const CAPITAL_DELTA_IS_LOWERCASE: bool = 'Δ'.is_lowercase();
780779
/// assert!(!CAPITAL_DELTA_IS_LOWERCASE);
781780
/// ```
782781
#[must_use]
783782
#[stable(feature = "rust1", since = "1.0.0")]
784-
#[rustc_const_unstable(feature = "const_unicode_case_lookup", issue = "101400")]
783+
#[rustc_const_stable(feature = "const_unicode_case_lookup", since = "1.84.0")]
785784
#[inline]
786785
pub const fn is_lowercase(self) -> bool {
787786
match self {
@@ -817,13 +816,12 @@ impl char {
817816
/// In a const context:
818817
///
819818
/// ```
820-
/// #![feature(const_unicode_case_lookup)]
821819
/// const CAPITAL_DELTA_IS_UPPERCASE: bool = 'Δ'.is_uppercase();
822820
/// assert!(CAPITAL_DELTA_IS_UPPERCASE);
823821
/// ```
824822
#[must_use]
825823
#[stable(feature = "rust1", since = "1.0.0")]
826-
#[rustc_const_unstable(feature = "const_unicode_case_lookup", issue = "101400")]
824+
#[rustc_const_stable(feature = "const_unicode_case_lookup", since = "1.84.0")]
827825
#[inline]
828826
pub const fn is_uppercase(self) -> bool {
829827
match self {

library/core/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@
120120
#![feature(const_float_methods)]
121121
#![feature(const_heap)]
122122
#![feature(const_nonnull_new)]
123-
#![feature(const_option_ext)]
124123
#![feature(const_pin_2)]
125124
#![feature(const_ptr_is_null)]
126125
#![feature(const_ptr_sub_ptr)]
@@ -134,7 +133,6 @@
134133
#![feature(const_type_name)]
135134
#![feature(const_typed_swap)]
136135
#![feature(const_ub_checks)]
137-
#![feature(const_unicode_case_lookup)]
138136
#![feature(core_intrinsics)]
139137
#![feature(coverage_attribute)]
140138
#![feature(do_not_recommend)]

library/core/src/num/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ impl isize {
528528
midpoint_impl! { isize, signed }
529529
}
530530

531-
/// If the 6th bit is set ascii is lower case.
531+
/// If the bit selected by this mask is set, ascii is lower case.
532532
const ASCII_CASE_MASK: u8 = 0b0010_0000;
533533

534534
impl u8 {

library/core/src/num/nonzero.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1233,7 +1233,7 @@ macro_rules! nonzero_integer_signedness_dependent_impls {
12331233
#[doc = concat!("let three = NonZero::new(3", stringify!($Int), ").unwrap();")]
12341234
/// assert_eq!(three.div_ceil(two), two);
12351235
/// ```
1236-
#[unstable(feature = "unsigned_nonzero_div_ceil", issue = "none")]
1236+
#[unstable(feature = "unsigned_nonzero_div_ceil", issue = "132968")]
12371237
#[must_use = "this returns the result of the operation, \
12381238
without modifying the original"]
12391239
#[inline]

0 commit comments

Comments
 (0)