Skip to content

Commit 03c199a

Browse files
committed
Auto merge of #116054 - matthiaskrgr:rollup-3pusno6, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #114379 (Command: also print removed env vars) - #116034 (add UI test for delimiter errors) - #116036 (tests/ui: Split large_moves.rs and move to lint/large_assignments) - #116038 (Fall back to _SC_NPROCESSORS_ONLN if sched_getaffinity returns an empty mask) - #116039 (Account for nested `impl Trait` in TAIT) - #116041 (Add note to `is_known_rigid`) - #116049 (give FutureIncompatibilityReason variants more explicit names) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 5a4e47e + 1a18ec0 commit 03c199a

29 files changed

+374
-136
lines changed

compiler/rustc_errors/src/diagnostic.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,12 @@ impl fmt::Display for DiagnosticLocation {
151151
#[derive(Clone, Debug, PartialEq, Eq, Hash, Encodable, Decodable)]
152152
pub enum DiagnosticId {
153153
Error(String),
154-
Lint { name: String, has_future_breakage: bool, is_force_warn: bool },
154+
Lint {
155+
name: String,
156+
/// Indicates whether this lint should show up in cargo's future breakage report.
157+
has_future_breakage: bool,
158+
is_force_warn: bool,
159+
},
155160
}
156161

157162
/// A "sub"-diagnostic attached to a parent diagnostic.
@@ -301,6 +306,7 @@ impl Diagnostic {
301306
}
302307
}
303308

309+
/// Indicates whether this diagnostic should show up in cargo's future breakage report.
304310
pub fn has_future_breakage(&self) -> bool {
305311
match self.code {
306312
Some(DiagnosticId::Lint { has_future_breakage, .. }) => has_future_breakage,

compiler/rustc_hir_analysis/src/collect/type_of/opaque.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use rustc_errors::StashKey;
22
use rustc_hir::def_id::LocalDefId;
33
use rustc_hir::intravisit::{self, Visitor};
4-
use rustc_hir::{self as hir, Expr, ImplItem, Item, Node, TraitItem};
4+
use rustc_hir::{self as hir, def, Expr, ImplItem, Item, Node, TraitItem};
55
use rustc_middle::hir::nested_filter;
66
use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitableExt};
77
use rustc_span::DUMMY_SP;
@@ -74,9 +74,14 @@ pub(super) fn find_opaque_ty_constraints_for_tait(tcx: TyCtxt<'_>, def_id: Local
7474

7575
hidden.ty
7676
} else {
77+
let mut parent_def_id = def_id;
78+
while tcx.def_kind(parent_def_id) == def::DefKind::OpaqueTy {
79+
// Account for `type Alias = impl Trait<Foo = impl Trait>;` (#116031)
80+
parent_def_id = tcx.local_parent(parent_def_id);
81+
}
7782
let reported = tcx.sess.emit_err(UnconstrainedOpaqueType {
7883
span: tcx.def_span(def_id),
79-
name: tcx.item_name(tcx.local_parent(def_id).to_def_id()),
84+
name: tcx.item_name(parent_def_id.to_def_id()),
8085
what: match tcx.hir().get(scope) {
8186
_ if scope == hir::CRATE_HIR_ID => "module",
8287
Node::Item(hir::Item { kind: hir::ItemKind::Mod(_), .. }) => "module",

compiler/rustc_lint/src/array_into_iter.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ declare_lint! {
3434
Warn,
3535
"detects calling `into_iter` on arrays in Rust 2015 and 2018",
3636
@future_incompatible = FutureIncompatibleInfo {
37-
reference: "<https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>",
3837
reason: FutureIncompatibilityReason::EditionSemanticsChange(Edition::Edition2021),
38+
reference: "<https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>",
3939
};
4040
}
4141

compiler/rustc_lint/src/builtin.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -844,8 +844,8 @@ declare_lint! {
844844
Warn,
845845
"detects anonymous parameters",
846846
@future_incompatible = FutureIncompatibleInfo {
847-
reference: "issue #41686 <https://github.com/rust-lang/rust/issues/41686>",
848847
reason: FutureIncompatibilityReason::EditionError(Edition::Edition2018),
848+
reference: "issue #41686 <https://github.com/rust-lang/rust/issues/41686>",
849849
};
850850
}
851851

@@ -1669,8 +1669,8 @@ declare_lint! {
16691669
Warn,
16701670
"`...` range patterns are deprecated",
16711671
@future_incompatible = FutureIncompatibleInfo {
1672-
reference: "<https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>",
16731672
reason: FutureIncompatibilityReason::EditionError(Edition::Edition2021),
1673+
reference: "<https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>",
16741674
};
16751675
}
16761676

@@ -1804,8 +1804,8 @@ declare_lint! {
18041804
Allow,
18051805
"detects edition keywords being used as an identifier",
18061806
@future_incompatible = FutureIncompatibleInfo {
1807-
reference: "issue #49716 <https://github.com/rust-lang/rust/issues/49716>",
18081807
reason: FutureIncompatibilityReason::EditionError(Edition::Edition2018),
1808+
reference: "issue #49716 <https://github.com/rust-lang/rust/issues/49716>",
18091809
};
18101810
}
18111811

compiler/rustc_lint/src/deref_into_dyn_supertrait.rs

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use crate::{
55

66
use rustc_hir as hir;
77
use rustc_middle::{traits::util::supertraits, ty};
8+
use rustc_session::lint::FutureIncompatibilityReason;
89
use rustc_span::sym;
910

1011
declare_lint! {
@@ -48,6 +49,7 @@ declare_lint! {
4849
Warn,
4950
"`Deref` implementation usage with a supertrait trait object for output might be shadowed in the future",
5051
@future_incompatible = FutureIncompatibleInfo {
52+
reason: FutureIncompatibilityReason::FutureReleaseErrorDontReportInDeps,
5153
reference: "issue #89460 <https://github.com/rust-lang/rust/issues/89460>",
5254
};
5355
}

0 commit comments

Comments
 (0)