Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 10 pull requests #132094

Merged
merged 25 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
7a3a98d
Fix target_vendor in QNX Neutrino targets
madsmtm Oct 2, 2024
b89751b
clean up `*dyn` casts (with principals)
Oct 18, 2024
ab4222a
Prevent overflowing enum cast from ICEing
clubby789 Oct 18, 2024
98c4d96
Reduce visibility of coverage FFI functions/types
Zalathar Oct 19, 2024
d1bf77e
Pass coverage mappings to LLVM as separate structs
Zalathar Oct 19, 2024
46cc5e9
elaborate why dropping principal in `*dyn` casts is non-trivial
Oct 18, 2024
8f85b90
Rename Receiver -> LegacyReceiver
adetaylor Sep 11, 2024
0304809
stop hashing compile-time constant
RalfJung Oct 23, 2024
2e3091d
Don't allow test revisions that conflict with built in cfgs
clubby789 Oct 19, 2024
dab76ec
fix a couple clippy:complexitys
matthiaskrgr Oct 12, 2024
464f405
fix some manual_map
matthiaskrgr Oct 12, 2024
d84d659
clone range in a more obvious way
matthiaskrgr Oct 12, 2024
4e1b3ab
Print safety correctly in extern static items
compiler-errors Oct 24, 2024
1920c66
Plumb through param_env to note_type_err
compiler-errors Oct 15, 2024
4217b87
Deeply normalize type trace in type error reporting
compiler-errors Oct 15, 2024
9c73bcf
Rollup merge of #130225 - adetaylor:rename-old-receiver, r=wesleywiser
Zalathar Oct 24, 2024
40d7872
Rollup merge of #131169 - madsmtm:target-info-nto-vendor, r=wesleywiser
Zalathar Oct 24, 2024
77f2c57
Rollup merge of #131623 - matthiaskrgr:clippy_sat, r=Nadrieril
Zalathar Oct 24, 2024
ad43be3
Rollup merge of #131756 - compiler-errors:deeply-normalize-type-err, …
Zalathar Oct 24, 2024
4c0bab3
Rollup merge of #131898 - lukas-code:ptr-cast-cleanup, r=compiler-errors
Zalathar Oct 24, 2024
4b02d64
Rollup merge of #131909 - clubby789:enum-overflow-cast, r=compiler-er…
Zalathar Oct 24, 2024
f7f411d
Rollup merge of #131930 - clubby789:revision-cfg-collide, r=jieyouxu
Zalathar Oct 24, 2024
8f354fc
Rollup merge of #131956 - Zalathar:llvm-counters, r=compiler-errors,S…
Zalathar Oct 24, 2024
006a142
Rollup merge of #132076 - RalfJung:feature-hashing, r=nnethercote,Mar…
Zalathar Oct 24, 2024
7e2bbc3
Rollup merge of #132088 - compiler-errors:extern-static, r=jieyouxu
Zalathar Oct 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading