Skip to content

Commit 7e15b23

Browse files
committed
Auto merge of #91263 - Mark-Simulacrum:beta-next, r=Mark-Simulacrum
[beta] backports * relate lifetime in TypeOutlives bounds on drop impls #90840 * [beta] [1.57] Disable LLVM newPM by default #91189 r? `@Mark-Simulacrum`
2 parents ef1a3b9 + 150bd8b commit 7e15b23

File tree

4 files changed

+40
-10
lines changed

4 files changed

+40
-10
lines changed

compiler/rustc_codegen_llvm/src/back/write.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -378,18 +378,14 @@ fn get_pgo_sample_use_path(config: &ModuleConfig) -> Option<CString> {
378378
}
379379

380380
pub(crate) fn should_use_new_llvm_pass_manager(
381-
cgcx: &CodegenContext<LlvmCodegenBackend>,
381+
_cgcx: &CodegenContext<LlvmCodegenBackend>,
382382
config: &ModuleConfig,
383383
) -> bool {
384-
// The new pass manager is enabled by default for LLVM >= 13.
385-
// This matches Clang, which also enables it since Clang 13.
386-
387-
// FIXME: There are some perf issues with the new pass manager
388-
// when targeting s390x, so it is temporarily disabled for that
389-
// arch, see https://github.com/rust-lang/rust/issues/89609
384+
// The new pass manager is causing significant performance issues such as #91128, and is
385+
// therefore disabled in stable versions of rustc by default.
390386
config
391387
.new_llvm_pass_manager
392-
.unwrap_or_else(|| cgcx.target_arch != "s390x" && llvm_util::get_version() >= (13, 0, 0))
388+
.unwrap_or(false)
393389
}
394390

395391
pub(crate) unsafe fn optimize_with_new_llvm_pass_manager(

compiler/rustc_typeck/src/check/dropck.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,12 @@ fn ensure_drop_predicates_are_implied_by_item_defn<'tcx>(
239239
ty::PredicateKind::ConstEvaluatable(a),
240240
ty::PredicateKind::ConstEvaluatable(b),
241241
) => tcx.try_unify_abstract_consts((a, b)),
242-
(ty::PredicateKind::TypeOutlives(a), ty::PredicateKind::TypeOutlives(b)) => {
243-
relator.relate(predicate.rebind(a.0), p.rebind(b.0)).is_ok()
242+
(
243+
ty::PredicateKind::TypeOutlives(ty::OutlivesPredicate(ty_a, lt_a)),
244+
ty::PredicateKind::TypeOutlives(ty::OutlivesPredicate(ty_b, lt_b)),
245+
) => {
246+
relator.relate(predicate.rebind(ty_a), p.rebind(ty_b)).is_ok()
247+
&& relator.relate(predicate.rebind(lt_a), p.rebind(lt_b)).is_ok()
244248
}
245249
_ => predicate == p,
246250
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
struct Wrapper<'a, T>(&'a T)
2+
where
3+
T: 'a;
4+
5+
impl<'a, T> Drop for Wrapper<'a, T>
6+
where
7+
T: 'static,
8+
//~^ error: `Drop` impl requires `T: 'static` but the struct it is implemented for does not
9+
{
10+
fn drop(&mut self) {}
11+
}
12+
13+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
error[E0367]: `Drop` impl requires `T: 'static` but the struct it is implemented for does not
2+
--> $DIR/relate_lt_in_type_outlives_bound.rs:7:8
3+
|
4+
LL | T: 'static,
5+
| ^^^^^^^
6+
|
7+
note: the implementor must specify the same requirement
8+
--> $DIR/relate_lt_in_type_outlives_bound.rs:1:1
9+
|
10+
LL | / struct Wrapper<'a, T>(&'a T)
11+
LL | | where
12+
LL | | T: 'a;
13+
| |__________^
14+
15+
error: aborting due to previous error
16+
17+
For more information about this error, try `rustc --explain E0367`.

0 commit comments

Comments
 (0)