Skip to content

Commit d31b6fb

Browse files
committed
Auto merge of rust-lang#122690 - matthiaskrgr:rollup-43fggl0, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - rust-lang#122480 (Avoid various uses of `Option<Span>` in favor of using `DUMMY_SP` in the few cases that used `None`) - rust-lang#122567 (Remove fixme about LLVM basic block naming) - rust-lang#122588 (less useless filter calls in imported_source_file) - rust-lang#122647 (add_retag: ensure box-to-raw-ptr casts are preserved for Miri) - rust-lang#122649 (Update the minimum external LLVM to 17) - rust-lang#122680 (Do not eat nested expressions' results in `MayContainYieldPoint` format args visitor) - rust-lang#122683 (add missing test: expected paren or brace in macro) - rust-lang#122689 (Add missing `try_visit` calls in visitors.) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 3cdcdaf + 9011e67 commit d31b6fb

File tree

75 files changed

+241
-365
lines changed

Some content is hidden

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

75 files changed

+241
-365
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
- name: mingw-check-tidy
5959
os: ubuntu-20.04-4core-16gb
6060
env: {}
61-
- name: x86_64-gnu-llvm-16
61+
- name: x86_64-gnu-llvm-17
6262
env:
6363
ENABLE_GCC_CODEGEN: "1"
6464
os: ubuntu-20.04-16core-64gb
@@ -323,10 +323,6 @@ jobs:
323323
env:
324324
RUST_BACKTRACE: 1
325325
os: ubuntu-20.04-8core-32gb
326-
- name: x86_64-gnu-llvm-16
327-
env:
328-
RUST_BACKTRACE: 1
329-
os: ubuntu-20.04-8core-32gb
330326
- name: x86_64-gnu-nopt
331327
os: ubuntu-20.04-4core-16gb
332328
env: {}

compiler/rustc_ast/src/visit.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ pub fn walk_assoc_item<'a, V: Visitor<'a>>(
755755
}
756756
AssocItemKind::Delegation(box Delegation { id, qself, path, body }) => {
757757
if let Some(qself) = qself {
758-
visitor.visit_ty(&qself.ty);
758+
try_visit!(visitor.visit_ty(&qself.ty));
759759
}
760760
try_visit!(visitor.visit_path(path, *id));
761761
visit_opt!(visitor, visit_block, body);
@@ -994,7 +994,7 @@ pub fn walk_expr<'a, V: Visitor<'a>>(visitor: &mut V, expression: &'a Expr) -> V
994994
ExprKind::InlineAsm(asm) => try_visit!(visitor.visit_inline_asm(asm)),
995995
ExprKind::FormatArgs(f) => try_visit!(visitor.visit_format_args(f)),
996996
ExprKind::OffsetOf(container, fields) => {
997-
visitor.visit_ty(container);
997+
try_visit!(visitor.visit_ty(container));
998998
walk_list!(visitor, visit_ident, fields.iter().copied());
999999
}
10001000
ExprKind::Yield(optional_expression) => {

compiler/rustc_ast_lowering/src/format.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -604,8 +604,7 @@ fn may_contain_yield_point(e: &ast::Expr) -> bool {
604604
if let ast::ExprKind::Await(_, _) | ast::ExprKind::Yield(_) = e.kind {
605605
ControlFlow::Break(())
606606
} else {
607-
visit::walk_expr(self, e);
608-
ControlFlow::Continue(())
607+
visit::walk_expr(self, e)
609608
}
610609
}
611610

compiler/rustc_codegen_cranelift/src/constant.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ pub(crate) fn eval_mir_constant<'tcx>(
7474
let cv = fx.monomorphize(constant.const_);
7575
// This cannot fail because we checked all required_consts in advance.
7676
let val = cv
77-
.eval(fx.tcx, ty::ParamEnv::reveal_all(), Some(constant.span))
77+
.eval(fx.tcx, ty::ParamEnv::reveal_all(), constant.span)
7878
.expect("erroneous constant missed by mono item collection");
7979
(val, cv.ty())
8080
}

compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -728,8 +728,10 @@ fn codegen_regular_intrinsic_call<'tcx>(
728728
| sym::variant_count => {
729729
intrinsic_args!(fx, args => (); intrinsic);
730730

731-
let const_val =
732-
fx.tcx.const_eval_instance(ParamEnv::reveal_all(), instance, None).unwrap();
731+
let const_val = fx
732+
.tcx
733+
.const_eval_instance(ParamEnv::reveal_all(), instance, source_info.span)
734+
.unwrap();
733735
let val = crate::constant::codegen_const_value(fx, const_val, ret.layout().ty);
734736
ret.write_cvalue(fx, val);
735737
}

compiler/rustc_codegen_cranelift/src/intrinsics/simd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
131131

132132
let idx = generic_args[2]
133133
.expect_const()
134-
.eval(fx.tcx, ty::ParamEnv::reveal_all(), Some(span))
134+
.eval(fx.tcx, ty::ParamEnv::reveal_all(), span)
135135
.unwrap()
136136
.unwrap_branch();
137137

compiler/rustc_codegen_llvm/src/context.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -126,17 +126,6 @@ pub unsafe fn create_module<'ll>(
126126

127127
let mut target_data_layout = sess.target.data_layout.to_string();
128128
let llvm_version = llvm_util::get_version();
129-
if llvm_version < (17, 0, 0) {
130-
if sess.target.arch.starts_with("powerpc") {
131-
// LLVM 17 specifies function pointer alignment for ppc:
132-
// https://reviews.llvm.org/D147016
133-
target_data_layout = target_data_layout
134-
.replace("-Fn32", "")
135-
.replace("-Fi32", "")
136-
.replace("-Fn64", "")
137-
.replace("-Fi64", "");
138-
}
139-
}
140129
if llvm_version < (18, 0, 0) {
141130
if sess.target.arch == "x86" || sess.target.arch == "x86_64" {
142131
// LLVM 18 adjusts i128 to be 128-bit aligned on x86 variants.

compiler/rustc_codegen_llvm/src/intrinsic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,7 @@ fn generic_simd_intrinsic<'ll, 'tcx>(
11291129
if name == sym::simd_shuffle_generic {
11301130
let idx = fn_args[2]
11311131
.expect_const()
1132-
.eval(tcx, ty::ParamEnv::reveal_all(), Some(span))
1132+
.eval(tcx, ty::ParamEnv::reveal_all(), span)
11331133
.unwrap()
11341134
.unwrap_branch();
11351135
let n = idx.len() as u64;

compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ use rustc_hir::{CoroutineDesugaring, CoroutineKind, CoroutineSource, Mutability}
1919
use rustc_middle::ty::layout::{IntegerExt, TyAndLayout};
2020
use rustc_middle::ty::{self, ExistentialProjection, ParamEnv, Ty, TyCtxt};
2121
use rustc_middle::ty::{GenericArgKind, GenericArgsRef};
22+
use rustc_span::DUMMY_SP;
2223
use rustc_target::abi::Integer;
2324
use smallvec::SmallVec;
2425

@@ -704,7 +705,7 @@ fn push_const_param<'tcx>(tcx: TyCtxt<'tcx>, ct: ty::Const<'tcx>, output: &mut S
704705
// avoiding collisions and will make the emitted type names shorter.
705706
let hash_short = tcx.with_stable_hashing_context(|mut hcx| {
706707
let mut hasher = StableHasher::new();
707-
let ct = ct.eval(tcx, ty::ParamEnv::reveal_all(), None).unwrap();
708+
let ct = ct.eval(tcx, ty::ParamEnv::reveal_all(), DUMMY_SP).unwrap();
708709
hcx.while_hashing_spans(false, |hcx| ct.hash_stable(hcx, &mut hasher));
709710
hasher.finish::<Hash64>()
710711
});

compiler/rustc_codegen_ssa/src/mir/block.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1688,7 +1688,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
16881688
pub fn try_llbb(&mut self, bb: mir::BasicBlock) -> Option<Bx::BasicBlock> {
16891689
match self.cached_llbbs[bb] {
16901690
CachedLlbb::None => {
1691-
// FIXME(eddyb) only name the block if `fewer_names` is `false`.
16921691
let llbb = Bx::append_block(self.cx, self.llfn, &format!("{bb:?}"));
16931692
self.cached_llbbs[bb] = CachedLlbb::Some(llbb);
16941693
Some(llbb)

0 commit comments

Comments
 (0)