Skip to content

Commit

Permalink
Auto merge of #132094 - Zalathar:rollup-5r1ppqt, r=Zalathar
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bors committed Oct 24, 2024
2 parents b8bb296 + 7e2bbc3 commit 55b7f8e
Show file tree
Hide file tree
Showing 64 changed files with 619 additions and 586 deletions.
7 changes: 6 additions & 1 deletion compiler/rustc_ast_pretty/src/pprust/state/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ impl<'a> State<'a> {
self.print_fn_full(sig, ident, generics, vis, *defaultness, body.as_deref(), attrs);
}
ast::ForeignItemKind::Static(box ast::StaticItem { ty, mutability, expr, safety }) => {
self.print_safety(*safety);
self.print_item_const(
ident,
Some(*mutability),
&ast::Generics::default(),
ty,
expr.as_deref(),
vis,
*safety,
ast::Defaultness::Final,
)
}
Expand Down Expand Up @@ -84,10 +84,12 @@ impl<'a> State<'a> {
ty: &ast::Ty,
body: Option<&ast::Expr>,
vis: &ast::Visibility,
safety: ast::Safety,
defaultness: ast::Defaultness,
) {
self.head("");
self.print_visibility(vis);
self.print_safety(safety);
self.print_defaultness(defaultness);
let leading = match mutbl {
None => "const",
Expand Down Expand Up @@ -181,6 +183,7 @@ impl<'a> State<'a> {
ty,
body.as_deref(),
&item.vis,
ast::Safety::Default,
ast::Defaultness::Final,
);
}
Expand All @@ -192,6 +195,7 @@ impl<'a> State<'a> {
ty,
expr.as_deref(),
&item.vis,
ast::Safety::Default,
*defaultness,
);
}
Expand Down Expand Up @@ -549,6 +553,7 @@ impl<'a> State<'a> {
ty,
expr.as_deref(),
vis,
ast::Safety::Default,
*defaultness,
);
}
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_attr/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -619,11 +619,11 @@ pub fn eval_condition(
// we can't use `try_gate_cfg` as symbols don't differentiate between `r#true`
// and `true`, and we want to keep the former working without feature gate
gate_cfg(
&((
&(
if *b { kw::True } else { kw::False },
sym::cfg_boolean_literals,
|features: &Features| features.cfg_boolean_literals(),
)),
),
cfg.span(),
sess,
features,
Expand Down
12 changes: 6 additions & 6 deletions compiler/rustc_borrowck/src/diagnostics/bound_region_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ impl<'tcx> UniverseInfo<'tcx> {
UniverseInfoInner::RelateTys { expected, found } => {
let err = mbcx.infcx.err_ctxt().report_mismatched_types(
&cause,
mbcx.param_env,
expected,
found,
TypeError::RegionsPlaceholderMismatch,
Expand Down Expand Up @@ -480,12 +481,11 @@ fn try_extract_error_from_region_constraints<'a, 'tcx>(
.try_report_from_nll()
.or_else(|| {
if let SubregionOrigin::Subtype(trace) = cause {
Some(
infcx.err_ctxt().report_and_explain_type_error(
*trace,
TypeError::RegionsPlaceholderMismatch,
),
)
Some(infcx.err_ctxt().report_and_explain_type_error(
*trace,
infcx.tcx.param_env(generic_param_scope),
TypeError::RegionsPlaceholderMismatch,
))
} else {
None
}
Expand Down
10 changes: 3 additions & 7 deletions compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -959,13 +959,9 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
None
}
}
hir::ExprKind::MethodCall(_, _, args, span) => {
if let Some(def_id) = typeck_results.type_dependent_def_id(*hir_id) {
Some((def_id, *span, *args))
} else {
None
}
}
hir::ExprKind::MethodCall(_, _, args, span) => typeck_results
.type_dependent_def_id(*hir_id)
.map(|def_id| (def_id, *span, *args)),
_ => None,
}
};
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_borrowck/src/region_infer/opaque_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ fn check_opaque_type_well_formed<'tcx>(
.err_ctxt()
.report_mismatched_types(
&ObligationCause::misc(definition_span, def_id),
param_env,
opaque_ty,
definition_ty,
err,
Expand Down
10 changes: 5 additions & 5 deletions compiler/rustc_codegen_cranelift/example/mini_core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ impl<T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<*const U> for *const T {}
impl<T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<*mut U> for *mut T {}
impl<T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<Box<U>> for Box<T> {}

#[lang = "receiver"]
pub trait Receiver {}
#[lang = "legacy_receiver"]
pub trait LegacyReceiver {}

impl<T: ?Sized> Receiver for &T {}
impl<T: ?Sized> Receiver for &mut T {}
impl<T: ?Sized> Receiver for Box<T> {}
impl<T: ?Sized> LegacyReceiver for &T {}
impl<T: ?Sized> LegacyReceiver for &mut T {}
impl<T: ?Sized> LegacyReceiver for Box<T> {}

#[lang = "copy"]
pub unsafe trait Copy {}
Expand Down
10 changes: 5 additions & 5 deletions compiler/rustc_codegen_gcc/example/mini_core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ impl<T: ?Sized+Unsize<U>, U: ?Sized> DispatchFromDyn<*const U> for *const T {}
impl<T: ?Sized+Unsize<U>, U: ?Sized> DispatchFromDyn<*mut U> for *mut T {}
impl<T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<Box<U, ()>> for Box<T, ()> {}

#[lang = "receiver"]
pub trait Receiver {}
#[lang = "legacy_receiver"]
pub trait LegacyReceiver {}

impl<T: ?Sized> Receiver for &T {}
impl<T: ?Sized> Receiver for &mut T {}
impl<T: ?Sized, A: Allocator> Receiver for Box<T, A> {}
impl<T: ?Sized> LegacyReceiver for &T {}
impl<T: ?Sized> LegacyReceiver for &mut T {}
impl<T: ?Sized, A: Allocator> LegacyReceiver for Box<T, A> {}

#[lang = "copy"]
pub unsafe trait Copy {}
Expand Down
Loading

0 comments on commit 55b7f8e

Please sign in to comment.