Skip to content

Commit 55b7f8e

Browse files
committed
Auto merge of #132094 - Zalathar:rollup-5r1ppqt, r=Zalathar
Rollup of 10 pull requests Successful merges: - #130225 (Rename Receiver -> LegacyReceiver) - #131169 (Fix `target_vendor` in QNX Neutrino targets) - #131623 (misc cleanups) - #131756 (Deeply normalize `TypeTrace` when reporting type error in new solver) - #131898 (minor `*dyn` cast cleanup) - #131909 (Prevent overflowing enum cast from ICEing) - #131930 (Don't allow test revisions that conflict with built in cfgs) - #131956 (coverage: Pass coverage mappings to LLVM as separate structs) - #132076 (HashStable for rustc_feature::Features: stop hashing compile-time constant) - #132088 (Print safety correctly in extern static items) r? `@ghost` `@rustbot` modify labels: rollup
2 parents b8bb296 + 7e2bbc3 commit 55b7f8e

File tree

64 files changed

+619
-586
lines changed

Some content is hidden

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

64 files changed

+619
-586
lines changed

compiler/rustc_ast_pretty/src/pprust/state/item.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ impl<'a> State<'a> {
3838
self.print_fn_full(sig, ident, generics, vis, *defaultness, body.as_deref(), attrs);
3939
}
4040
ast::ForeignItemKind::Static(box ast::StaticItem { ty, mutability, expr, safety }) => {
41-
self.print_safety(*safety);
4241
self.print_item_const(
4342
ident,
4443
Some(*mutability),
4544
&ast::Generics::default(),
4645
ty,
4746
expr.as_deref(),
4847
vis,
48+
*safety,
4949
ast::Defaultness::Final,
5050
)
5151
}
@@ -84,10 +84,12 @@ impl<'a> State<'a> {
8484
ty: &ast::Ty,
8585
body: Option<&ast::Expr>,
8686
vis: &ast::Visibility,
87+
safety: ast::Safety,
8788
defaultness: ast::Defaultness,
8889
) {
8990
self.head("");
9091
self.print_visibility(vis);
92+
self.print_safety(safety);
9193
self.print_defaultness(defaultness);
9294
let leading = match mutbl {
9395
None => "const",
@@ -181,6 +183,7 @@ impl<'a> State<'a> {
181183
ty,
182184
body.as_deref(),
183185
&item.vis,
186+
ast::Safety::Default,
184187
ast::Defaultness::Final,
185188
);
186189
}
@@ -192,6 +195,7 @@ impl<'a> State<'a> {
192195
ty,
193196
expr.as_deref(),
194197
&item.vis,
198+
ast::Safety::Default,
195199
*defaultness,
196200
);
197201
}
@@ -549,6 +553,7 @@ impl<'a> State<'a> {
549553
ty,
550554
expr.as_deref(),
551555
vis,
556+
ast::Safety::Default,
552557
*defaultness,
553558
);
554559
}

compiler/rustc_attr/src/builtin.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -619,11 +619,11 @@ pub fn eval_condition(
619619
// we can't use `try_gate_cfg` as symbols don't differentiate between `r#true`
620620
// and `true`, and we want to keep the former working without feature gate
621621
gate_cfg(
622-
&((
622+
&(
623623
if *b { kw::True } else { kw::False },
624624
sym::cfg_boolean_literals,
625625
|features: &Features| features.cfg_boolean_literals(),
626-
)),
626+
),
627627
cfg.span(),
628628
sess,
629629
features,

compiler/rustc_borrowck/src/diagnostics/bound_region_errors.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ impl<'tcx> UniverseInfo<'tcx> {
6565
UniverseInfoInner::RelateTys { expected, found } => {
6666
let err = mbcx.infcx.err_ctxt().report_mismatched_types(
6767
&cause,
68+
mbcx.param_env,
6869
expected,
6970
found,
7071
TypeError::RegionsPlaceholderMismatch,
@@ -480,12 +481,11 @@ fn try_extract_error_from_region_constraints<'a, 'tcx>(
480481
.try_report_from_nll()
481482
.or_else(|| {
482483
if let SubregionOrigin::Subtype(trace) = cause {
483-
Some(
484-
infcx.err_ctxt().report_and_explain_type_error(
485-
*trace,
486-
TypeError::RegionsPlaceholderMismatch,
487-
),
488-
)
484+
Some(infcx.err_ctxt().report_and_explain_type_error(
485+
*trace,
486+
infcx.tcx.param_env(generic_param_scope),
487+
TypeError::RegionsPlaceholderMismatch,
488+
))
489489
} else {
490490
None
491491
}

compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs

+3-7
Original file line numberDiff line numberDiff line change
@@ -959,13 +959,9 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
959959
None
960960
}
961961
}
962-
hir::ExprKind::MethodCall(_, _, args, span) => {
963-
if let Some(def_id) = typeck_results.type_dependent_def_id(*hir_id) {
964-
Some((def_id, *span, *args))
965-
} else {
966-
None
967-
}
968-
}
962+
hir::ExprKind::MethodCall(_, _, args, span) => typeck_results
963+
.type_dependent_def_id(*hir_id)
964+
.map(|def_id| (def_id, *span, *args)),
969965
_ => None,
970966
}
971967
};

compiler/rustc_borrowck/src/region_infer/opaque_types.rs

+1
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,7 @@ fn check_opaque_type_well_formed<'tcx>(
360360
.err_ctxt()
361361
.report_mismatched_types(
362362
&ObligationCause::misc(definition_span, def_id),
363+
param_env,
363364
opaque_ty,
364365
definition_ty,
365366
err,

compiler/rustc_codegen_cranelift/example/mini_core.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ impl<T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<*const U> for *const T {}
4747
impl<T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<*mut U> for *mut T {}
4848
impl<T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<Box<U>> for Box<T> {}
4949

50-
#[lang = "receiver"]
51-
pub trait Receiver {}
50+
#[lang = "legacy_receiver"]
51+
pub trait LegacyReceiver {}
5252

53-
impl<T: ?Sized> Receiver for &T {}
54-
impl<T: ?Sized> Receiver for &mut T {}
55-
impl<T: ?Sized> Receiver for Box<T> {}
53+
impl<T: ?Sized> LegacyReceiver for &T {}
54+
impl<T: ?Sized> LegacyReceiver for &mut T {}
55+
impl<T: ?Sized> LegacyReceiver for Box<T> {}
5656

5757
#[lang = "copy"]
5858
pub unsafe trait Copy {}

compiler/rustc_codegen_gcc/example/mini_core.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ impl<T: ?Sized+Unsize<U>, U: ?Sized> DispatchFromDyn<*const U> for *const T {}
4444
impl<T: ?Sized+Unsize<U>, U: ?Sized> DispatchFromDyn<*mut U> for *mut T {}
4545
impl<T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<Box<U, ()>> for Box<T, ()> {}
4646

47-
#[lang = "receiver"]
48-
pub trait Receiver {}
47+
#[lang = "legacy_receiver"]
48+
pub trait LegacyReceiver {}
4949

50-
impl<T: ?Sized> Receiver for &T {}
51-
impl<T: ?Sized> Receiver for &mut T {}
52-
impl<T: ?Sized, A: Allocator> Receiver for Box<T, A> {}
50+
impl<T: ?Sized> LegacyReceiver for &T {}
51+
impl<T: ?Sized> LegacyReceiver for &mut T {}
52+
impl<T: ?Sized, A: Allocator> LegacyReceiver for Box<T, A> {}
5353

5454
#[lang = "copy"]
5555
pub unsafe trait Copy {}

0 commit comments

Comments
 (0)