Skip to content

Commit 57cb10a

Browse files
committed
Auto merge of #155324 - jhpratt:rollup-BNB8Pcb, r=jhpratt
Rollup of 13 pull requests Successful merges: - #154882 (Gate tuple const params behind `min_adt_const_params` feature) - #155259 (explicit-tail-calls: disable two tests on LoongArch) - #155293 (fix arch names in cfg pretty printer) - #155314 (`BorrowedBuf`: Update outdated safety comments in `set_init` users.) - #153469 (docs: clarify path search behavior in std::process::Command::new) - #154765 (Clarify ascii whitespace exclusion of vertical tab in the doc) - #155172 (Some small nits for supertrait_item_shadowing, and additional testing) - #155279 (Test/lexer unicode pattern white space) - #155280 (Tests for precise-capture through RPIT and TAIT) - #155301 (Delete unused `rustc_trait_selection` errors.) - #155303 (remove ibraheemdev from review rotation) - #155304 (remove PointeeParser) - #155319 (Remove dead diagnostic structs.)
2 parents bd1e7c7 + aeaa849 commit 57cb10a

File tree

87 files changed

+566
-397
lines changed

Some content is hidden

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

87 files changed

+566
-397
lines changed

compiler/rustc_attr_parsing/src/attributes/traits.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ use super::prelude::*;
44
use crate::attributes::{NoArgsAttributeParser, OnDuplicate, SingleAttributeParser};
55
use crate::context::{AcceptContext, Stage};
66
use crate::parser::ArgParser;
7+
use crate::target_checking::AllowedTargets;
78
use crate::target_checking::Policy::{Allow, Warn};
8-
use crate::target_checking::{ALL_TARGETS, AllowedTargets};
99

1010
pub(crate) struct RustcSkipDuringMethodDispatchParser;
1111
impl<S: Stage> SingleAttributeParser<S> for RustcSkipDuringMethodDispatchParser {
@@ -141,11 +141,3 @@ impl<S: Stage> NoArgsAttributeParser<S> for FundamentalParser {
141141
AllowedTargets::AllowList(&[Allow(Target::Struct), Allow(Target::Trait)]);
142142
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::Fundamental;
143143
}
144-
145-
pub(crate) struct PointeeParser;
146-
impl<S: Stage> NoArgsAttributeParser<S> for PointeeParser {
147-
const PATH: &[Symbol] = &[sym::pointee];
148-
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
149-
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(ALL_TARGETS); //FIXME Still checked fully in `check_attr.rs`
150-
const CREATE: fn(Span) -> AttributeKind = AttributeKind::Pointee;
151-
}

compiler/rustc_attr_parsing/src/context.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@ attribute_parsers!(
269269
Single<WithoutArgs<PanicHandlerParser>>,
270270
Single<WithoutArgs<PanicRuntimeParser>>,
271271
Single<WithoutArgs<PinV2Parser>>,
272-
Single<WithoutArgs<PointeeParser>>,
273272
Single<WithoutArgs<PreludeImportParser>>,
274273
Single<WithoutArgs<ProcMacroAttributeParser>>,
275274
Single<WithoutArgs<ProcMacroParser>>,

compiler/rustc_hir/src/attrs/data_structures.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,9 +1233,6 @@ pub enum AttributeKind {
12331233
/// Represents `#[pin_v2]`
12341234
PinV2(Span),
12351235

1236-
/// Represents `#[pointee]`
1237-
Pointee(Span),
1238-
12391236
/// Represents `#[prelude_import]`
12401237
PreludeImport,
12411238

compiler/rustc_hir/src/attrs/encode_cross_crate.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ impl AttributeKind {
8686
Path(..) => No,
8787
PatternComplexityLimit { .. } => No,
8888
PinV2(..) => Yes,
89-
Pointee(..) => No,
9089
PreludeImport => No,
9190
ProcMacro(..) => No,
9291
ProcMacroAttribute(..) => No,

compiler/rustc_hir_analysis/src/check/wfcheck.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ fn check_param_wf(tcx: TyCtxt<'_>, param: &ty::GenericParamDef) -> Result<(), Er
904904
) => None,
905905
Err(ConstParamTyImplementationError::UnsizedConstParamsFeatureRequired) => {
906906
Some(vec![
907-
(adt_const_params_feature_string, sym::adt_const_params),
907+
(adt_const_params_feature_string, sym::min_adt_const_params),
908908
(
909909
" references to implement the `ConstParamTy` trait".into(),
910910
sym::unsized_const_params,
@@ -931,11 +931,13 @@ fn check_param_wf(tcx: TyCtxt<'_>, param: &ty::GenericParamDef) -> Result<(), Er
931931

932932
ty_is_local(ty).then_some(vec![(
933933
adt_const_params_feature_string,
934-
sym::adt_const_params,
934+
sym::min_adt_const_params,
935935
)])
936936
}
937937
// Implements `ConstParamTy`, suggest adding the feature to enable.
938-
Ok(..) => Some(vec![(adt_const_params_feature_string, sym::adt_const_params)]),
938+
Ok(..) => {
939+
Some(vec![(adt_const_params_feature_string, sym::min_adt_const_params)])
940+
}
939941
};
940942
if let Some(features) = may_suggest_feature {
941943
tcx.disabled_nightly_features(&mut diag, features);

compiler/rustc_hir_typeck/src/method/probe.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2377,8 +2377,8 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
23772377
continue;
23782378
}
23792379

2380-
// This pick is not a supertrait of the `child_pick`.
2381-
// Check if it's a subtrait of the `child_pick`, instead.
2380+
// This candidate is not a supertrait of the `child_trait`.
2381+
// Check if it's a subtrait of the `child_trait`, instead.
23822382
// If it is, then it must have been a subtrait of every
23832383
// other pick we've eliminated at this point. It will
23842384
// take over at this point.
@@ -2392,7 +2392,8 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
23922392
continue;
23932393
}
23942394

2395-
// `child_pick` is not a supertrait of this pick.
2395+
// Neither `child_trait` or the current candidate are
2396+
// supertraits of each other.
23962397
// Don't bail here, since we may be comparing two supertraits
23972398
// of a common subtrait. These two supertraits won't be related
23982399
// at all, but we will pick them up next round when we find their

compiler/rustc_metadata/src/errors.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -233,16 +233,6 @@ pub struct ConflictingAllocErrorHandler {
233233
)]
234234
pub struct GlobalAllocRequired;
235235

236-
#[derive(Diagnostic)]
237-
#[diag(
238-
"the crate `{$crate_name}` cannot depend on a crate that needs {$needs_crate_name}, but it depends on `{$deps_crate_name}`"
239-
)]
240-
pub struct NoTransitiveNeedsDep<'a> {
241-
pub crate_name: Symbol,
242-
pub needs_crate_name: &'a str,
243-
pub deps_crate_name: Symbol,
244-
}
245-
246236
#[derive(Diagnostic)]
247237
#[diag("failed to write {$filename}: {$err}")]
248238
pub struct FailedWriteError {

compiler/rustc_middle/src/error.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,6 @@ pub(crate) struct OpaqueHiddenTypeMismatch<'tcx> {
3636
pub sub: TypeMismatchReason,
3737
}
3838

39-
#[derive(Diagnostic)]
40-
#[diag("we don't support unions yet: '{$ty_name}'")]
41-
pub struct UnsupportedUnion {
42-
pub ty_name: String,
43-
}
44-
45-
// FIXME(autodiff): I should get used somewhere
46-
#[derive(Diagnostic)]
47-
#[diag("reading from a `Duplicated` const {$ty} is unsafe")]
48-
pub struct AutodiffUnsafeInnerConstRef<'tcx> {
49-
#[primary_span]
50-
pub span: Span,
51-
pub ty: Ty<'tcx>,
52-
}
53-
5439
#[derive(Subdiagnostic)]
5540
pub enum TypeMismatchReason {
5641
#[label("this expression supplies two conflicting concrete types for the same opaque type")]

compiler/rustc_passes/src/check_attr.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
281281
| AttributeKind::Path(..)
282282
| AttributeKind::PatternComplexityLimit { .. }
283283
| AttributeKind::PinV2(..)
284-
| AttributeKind::Pointee(..)
285284
| AttributeKind::PreludeImport
286285
| AttributeKind::ProfilerRuntime
287286
| AttributeKind::RecursionLimit { .. }

compiler/rustc_trait_selection/src/errors.rs

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,6 @@ pub struct UnableToConstructConstantValue<'a> {
2828
pub unevaluated: ty::UnevaluatedConst<'a>,
2929
}
3030

31-
#[derive(Diagnostic)]
32-
#[diag("this attribute must have a value", code = E0232)]
33-
#[note("e.g. `#[rustc_on_unimplemented(message=\"foo\")]`")]
34-
pub struct NoValueInOnUnimplemented {
35-
#[primary_span]
36-
#[label("expected value here")]
37-
pub span: Span,
38-
}
39-
4031
pub struct NegativePositiveConflict<'tcx> {
4132
pub impl_span: Span,
4233
pub trait_desc: ty::TraitRef<'tcx>,
@@ -1201,60 +1192,6 @@ pub struct TraitImplDiff {
12011192
pub found: String,
12021193
}
12031194

1204-
pub struct DynTraitConstraintSuggestion {
1205-
pub span: Span,
1206-
pub ident: Ident,
1207-
}
1208-
1209-
impl Subdiagnostic for DynTraitConstraintSuggestion {
1210-
fn add_to_diag<G: EmissionGuarantee>(self, diag: &mut Diag<'_, G>) {
1211-
let mut multi_span: MultiSpan = vec![self.span].into();
1212-
multi_span.push_span_label(
1213-
self.span,
1214-
msg!("this has an implicit `'static` lifetime requirement"),
1215-
);
1216-
multi_span.push_span_label(
1217-
self.ident.span,
1218-
msg!("calling this method introduces the `impl`'s `'static` requirement"),
1219-
);
1220-
let msg = msg!("the used `impl` has a `'static` requirement");
1221-
diag.span_note(multi_span, msg);
1222-
let msg = msg!("consider relaxing the implicit `'static` requirement");
1223-
diag.span_suggestion_verbose(
1224-
self.span.shrink_to_hi(),
1225-
msg,
1226-
" + '_",
1227-
Applicability::MaybeIncorrect,
1228-
);
1229-
}
1230-
}
1231-
1232-
pub struct ReqIntroducedLocations {
1233-
pub span: MultiSpan,
1234-
pub spans: Vec<Span>,
1235-
pub fn_decl_span: Span,
1236-
pub cause_span: Span,
1237-
pub add_label: bool,
1238-
}
1239-
1240-
impl Subdiagnostic for ReqIntroducedLocations {
1241-
fn add_to_diag<G: EmissionGuarantee>(mut self, diag: &mut Diag<'_, G>) {
1242-
for sp in self.spans {
1243-
self.span.push_span_label(sp, msg!("`'static` requirement introduced here"));
1244-
}
1245-
1246-
if self.add_label {
1247-
self.span.push_span_label(
1248-
self.fn_decl_span,
1249-
msg!("requirement introduced by this return type"),
1250-
);
1251-
}
1252-
self.span.push_span_label(self.cause_span, msg!("because of this returned expression"));
1253-
let msg = msg!("\"`'static` lifetime requirement introduced by the return type");
1254-
diag.span_note(self.span, msg);
1255-
}
1256-
}
1257-
12581195
#[derive(Diagnostic)]
12591196
#[diag("{$has_param_name ->
12601197
[true] `{$param_name}`

0 commit comments

Comments
 (0)