Skip to content

Commit 5958825

Browse files
committed
Auto merge of rust-lang#136613 - workingjubilee:rollup-ry6rw0m, r=workingjubilee
Rollup of 13 pull requests Successful merges: - rust-lang#133932 (Avoid using make_direct_deprecated() in extern "ptx-kernel") - rust-lang#136269 (Pass spans around new solver) - rust-lang#136550 (Fix `rustc_hidden_type_of_opaques` for RPITITs with no default body) - rust-lang#136558 (Document minimum supported host tooling on macOS) - rust-lang#136563 (Clean up `Trivial*Impls` macros) - rust-lang#136566 (Fix link in from_fn.rs) - rust-lang#136573 (Document why some "type mismatches" exist) - rust-lang#136583 (Only highlight unmatchable parameters at the definition site) - rust-lang#136587 (Update browser-ui-test version to `0.20.2`) - rust-lang#136590 (Implement RustcInternal for RawPtrKind) - rust-lang#136591 (Add `rustc_hir_pretty::expr_to_string` function) - rust-lang#136595 (Fix `unreachable_pub` lint for hermit target) - rust-lang#136611 (cg_llvm: Remove the `mod llvm_` hack, which should no longer be necessary) Failed merges: - rust-lang#136565 (compiler: Clean up weird `rustc_abi` reexports) r? `@ghost` `@rustbot` modify labels: rollup
2 parents c753cb9 + c549268 commit 5958825

File tree

70 files changed

+613
-594
lines changed

Some content is hidden

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

70 files changed

+613
-594
lines changed

compiler/rustc_codegen_llvm/src/lib.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,9 @@ mod debuginfo;
7171
mod declare;
7272
mod errors;
7373
mod intrinsic;
74-
75-
// The following is a workaround that replaces `pub mod llvm;` and that fixes issue 53912.
76-
#[path = "llvm/mod.rs"]
77-
mod llvm_;
78-
pub mod llvm {
79-
pub use super::llvm_::*;
80-
}
81-
74+
// FIXME(Zalathar): Fix all the unreachable-pub warnings that would occur if
75+
// this isn't pub, then make it not pub.
76+
pub mod llvm;
8277
mod llvm_util;
8378
mod mono_item;
8479
mod type_;

compiler/rustc_codegen_llvm/src/llvm/mod.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,9 @@ use libc::c_uint;
1010
use rustc_abi::{Align, Size, WrappingRange};
1111
use rustc_llvm::RustString;
1212

13-
pub use self::AtomicRmwBinOp::*;
1413
pub use self::CallConv::*;
1514
pub use self::CodeGenOptSize::*;
16-
pub use self::IntPredicate::*;
17-
pub use self::Linkage::*;
1815
pub use self::MetadataType::*;
19-
pub use self::RealPredicate::*;
2016
pub use self::ffi::*;
2117
use crate::common::AsCCharPtr;
2218

compiler/rustc_hir_analysis/src/collect/dump.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ pub(crate) fn opaque_hidden_types(tcx: TyCtxt<'_>) {
1111
}
1212

1313
for id in tcx.hir_crate_items(()).opaques() {
14+
if let hir::OpaqueTyOrigin::FnReturn { parent: fn_def_id, .. }
15+
| hir::OpaqueTyOrigin::AsyncFn { parent: fn_def_id, .. } =
16+
tcx.hir().expect_opaque_ty(id).origin
17+
&& let hir::Node::TraitItem(trait_item) = tcx.hir_node_by_def_id(fn_def_id)
18+
&& let (_, hir::TraitFn::Required(..)) = trait_item.expect_fn()
19+
{
20+
continue;
21+
}
22+
1423
let ty = tcx.type_of(id).instantiate_identity();
1524
let span = tcx.def_span(id);
1625
tcx.dcx().emit_err(crate::errors::TypeOf { span, ty });

compiler/rustc_hir_pretty/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,10 @@ pub fn pat_to_string(ann: &dyn PpAnn, pat: &hir::Pat<'_>) -> String {
321321
to_string(ann, |s| s.print_pat(pat))
322322
}
323323

324+
pub fn expr_to_string(ann: &dyn PpAnn, pat: &hir::Expr<'_>) -> String {
325+
to_string(ann, |s| s.print_expr(pat))
326+
}
327+
324328
impl<'a> State<'a> {
325329
fn bclose_maybe_open(&mut self, span: rustc_span::Span, close_box: bool) {
326330
self.maybe_print_comment(span.hi());

compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs

Lines changed: 158 additions & 161 deletions
Large diffs are not rendered by default.

compiler/rustc_infer/src/infer/at.rs

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ impl<'a, 'tcx> At<'a, 'tcx> {
137137
expected,
138138
ty::Contravariant,
139139
actual,
140+
self.cause.span,
140141
)
141142
.map(|goals| self.goals_to_obligations(goals))
142143
} else {
@@ -163,8 +164,15 @@ impl<'a, 'tcx> At<'a, 'tcx> {
163164
T: ToTrace<'tcx>,
164165
{
165166
if self.infcx.next_trait_solver {
166-
NextSolverRelate::relate(self.infcx, self.param_env, expected, ty::Covariant, actual)
167-
.map(|goals| self.goals_to_obligations(goals))
167+
NextSolverRelate::relate(
168+
self.infcx,
169+
self.param_env,
170+
expected,
171+
ty::Covariant,
172+
actual,
173+
self.cause.span,
174+
)
175+
.map(|goals| self.goals_to_obligations(goals))
168176
} else {
169177
let mut op = TypeRelating::new(
170178
self.infcx,
@@ -208,8 +216,15 @@ impl<'a, 'tcx> At<'a, 'tcx> {
208216
T: Relate<TyCtxt<'tcx>>,
209217
{
210218
if self.infcx.next_trait_solver {
211-
NextSolverRelate::relate(self.infcx, self.param_env, expected, ty::Invariant, actual)
212-
.map(|goals| self.goals_to_obligations(goals))
219+
NextSolverRelate::relate(
220+
self.infcx,
221+
self.param_env,
222+
expected,
223+
ty::Invariant,
224+
actual,
225+
self.cause.span,
226+
)
227+
.map(|goals| self.goals_to_obligations(goals))
213228
} else {
214229
let mut op = TypeRelating::new(
215230
self.infcx,

compiler/rustc_infer/src/infer/context.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use rustc_middle::ty::fold::TypeFoldable;
55
use rustc_middle::ty::relate::RelateResult;
66
use rustc_middle::ty::relate::combine::PredicateEmittingRelation;
77
use rustc_middle::ty::{self, Ty, TyCtxt};
8-
use rustc_span::{DUMMY_SP, ErrorGuaranteed};
8+
use rustc_span::{DUMMY_SP, ErrorGuaranteed, Span};
99

1010
use super::{BoundRegionConversionTime, InferCtxt, RegionVariableOrigin, SubregionOrigin};
1111

@@ -203,23 +203,23 @@ impl<'tcx> rustc_type_ir::InferCtxtLike for InferCtxt<'tcx> {
203203
self.probe(|_| probe())
204204
}
205205

206-
fn sub_regions(&self, sub: ty::Region<'tcx>, sup: ty::Region<'tcx>) {
206+
fn sub_regions(&self, sub: ty::Region<'tcx>, sup: ty::Region<'tcx>, span: Span) {
207207
self.inner.borrow_mut().unwrap_region_constraints().make_subregion(
208-
SubregionOrigin::RelateRegionParamBound(DUMMY_SP, None),
208+
SubregionOrigin::RelateRegionParamBound(span, None),
209209
sub,
210210
sup,
211211
);
212212
}
213213

214-
fn equate_regions(&self, a: ty::Region<'tcx>, b: ty::Region<'tcx>) {
214+
fn equate_regions(&self, a: ty::Region<'tcx>, b: ty::Region<'tcx>, span: Span) {
215215
self.inner.borrow_mut().unwrap_region_constraints().make_eqregion(
216-
SubregionOrigin::RelateRegionParamBound(DUMMY_SP, None),
216+
SubregionOrigin::RelateRegionParamBound(span, None),
217217
a,
218218
b,
219219
);
220220
}
221221

222-
fn register_ty_outlives(&self, ty: Ty<'tcx>, r: ty::Region<'tcx>) {
223-
self.register_region_obligation_with_cause(ty, r, &ObligationCause::dummy());
222+
fn register_ty_outlives(&self, ty: Ty<'tcx>, r: ty::Region<'tcx>, span: Span) {
223+
self.register_region_obligation_with_cause(ty, r, &ObligationCause::dummy_with_span(span));
224224
}
225225
}

compiler/rustc_middle/src/infer/canonical.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,6 @@ impl<'tcx, R> QueryResponse<'tcx, R> {
142142
pub type QueryOutlivesConstraint<'tcx> =
143143
(ty::OutlivesPredicate<'tcx, GenericArg<'tcx>>, ConstraintCategory<'tcx>);
144144

145-
TrivialTypeTraversalImpls! {
146-
crate::infer::canonical::Certainty,
147-
}
148-
149145
#[derive(Default)]
150146
pub struct CanonicalParamEnvCache<'tcx> {
151147
map: Lock<

compiler/rustc_middle/src/mir/basic_blocks.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ impl<'tcx> graph::Predecessors for BasicBlocks<'tcx> {
163163
}
164164
}
165165

166+
// Done here instead of in `structural_impls.rs` because `Cache` is private, as is `basic_blocks`.
166167
TrivialTypeTraversalImpls! { Cache }
167168

168169
impl<S: Encoder> Encodable<S> for Cache {

compiler/rustc_middle/src/mir/interpret/error.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,6 @@ impl From<ReportedErrorInfo> for ErrorGuaranteed {
9595
}
9696
}
9797

98-
TrivialTypeTraversalImpls! { ErrorHandled }
99-
10098
pub type EvalToAllocationRawResult<'tcx> = Result<ConstAlloc<'tcx>, ErrorHandled>;
10199
pub type EvalStaticInitializerRawResult<'tcx> = Result<ConstAllocation<'tcx>, ErrorHandled>;
102100
pub type EvalToConstValueResult<'tcx> = Result<ConstValue<'tcx>, ErrorHandled>;

0 commit comments

Comments
 (0)