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 7 pull requests #116054

Merged
merged 22 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
f2b139f
Command: also print removed env vars
RalfJung Aug 2, 2023
396cbe6
make unsetting env vars print as executable command
RalfJung Aug 3, 2023
3a28887
fix a typo in env_clear docs
RalfJung Aug 3, 2023
53a29e0
also print clearing the environment entirely
RalfJung Aug 3, 2023
fc75f72
also use 'env' for printing unsetting
RalfJung Aug 3, 2023
98c94ec
fix typo
RalfJung Sep 6, 2023
f7cd892
add UI test for delimiter errors
chenyukang Sep 21, 2023
afdd468
tests/ui: Fix large_moves attribute cfg
Enselic Sep 21, 2023
f2ede49
Account for nested `impl Trait` in TAIT
estebank Sep 21, 2023
31cfa4a
Fall back to _SC_NPROCESSORS_ONLN if sched_getaffinity returns an emp…
the8472 Sep 21, 2023
d016e9a
tests/ui: Split large_moves.rs and move to lint/large_assignments
Enselic Sep 21, 2023
7fc081b
Add note to is_known_rigid
compiler-errors Sep 21, 2023
e888d47
give FutureIncompatibilityReason variants more explicit names
RalfJung Sep 22, 2023
5586c2a
make the reason: field mandatory for @future_incompatible lints
RalfJung Sep 22, 2023
7abbb9a
hide rustc line numbers in test
RalfJung Sep 22, 2023
9887dfa
Rollup merge of #114379 - RalfJung:command-removed-env-vars, r=m-ou-se
matthiaskrgr Sep 22, 2023
d5e7df3
Rollup merge of #116034 - chenyukang:yukang-98601-add-ui-testcase, r=…
matthiaskrgr Sep 22, 2023
06608c7
Rollup merge of #116036 - Enselic:split-large_moves, r=oli-obk
matthiaskrgr Sep 22, 2023
faf13dd
Rollup merge of #116038 - the8472:panic-on-sched_getaffinity-bug, r=c…
matthiaskrgr Sep 22, 2023
fc4cfe0
Rollup merge of #116039 - estebank:nested-tait, r=compiler-errors
matthiaskrgr Sep 22, 2023
66f272d
Rollup merge of #116041 - compiler-errors:rigid-note, r=RalfJung
matthiaskrgr Sep 22, 2023
1a18ec0
Rollup merge of #116049 - RalfJung:future-incompat, r=Nilstrieb
matthiaskrgr Sep 22, 2023
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
8 changes: 7 additions & 1 deletion compiler/rustc_errors/src/diagnostic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,12 @@ impl fmt::Display for DiagnosticLocation {
#[derive(Clone, Debug, PartialEq, Eq, Hash, Encodable, Decodable)]
pub enum DiagnosticId {
Error(String),
Lint { name: String, has_future_breakage: bool, is_force_warn: bool },
Lint {
name: String,
/// Indicates whether this lint should show up in cargo's future breakage report.
has_future_breakage: bool,
is_force_warn: bool,
},
}

/// A "sub"-diagnostic attached to a parent diagnostic.
Expand Down Expand Up @@ -301,6 +306,7 @@ impl Diagnostic {
}
}

/// Indicates whether this diagnostic should show up in cargo's future breakage report.
pub fn has_future_breakage(&self) -> bool {
match self.code {
Some(DiagnosticId::Lint { has_future_breakage, .. }) => has_future_breakage,
Expand Down
9 changes: 7 additions & 2 deletions compiler/rustc_hir_analysis/src/collect/type_of/opaque.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use rustc_errors::StashKey;
use rustc_hir::def_id::LocalDefId;
use rustc_hir::intravisit::{self, Visitor};
use rustc_hir::{self as hir, Expr, ImplItem, Item, Node, TraitItem};
use rustc_hir::{self as hir, def, Expr, ImplItem, Item, Node, TraitItem};
use rustc_middle::hir::nested_filter;
use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitableExt};
use rustc_span::DUMMY_SP;
Expand Down Expand Up @@ -74,9 +74,14 @@ pub(super) fn find_opaque_ty_constraints_for_tait(tcx: TyCtxt<'_>, def_id: Local

hidden.ty
} else {
let mut parent_def_id = def_id;
while tcx.def_kind(parent_def_id) == def::DefKind::OpaqueTy {
// Account for `type Alias = impl Trait<Foo = impl Trait>;` (#116031)
parent_def_id = tcx.local_parent(parent_def_id);
}
let reported = tcx.sess.emit_err(UnconstrainedOpaqueType {
span: tcx.def_span(def_id),
name: tcx.item_name(tcx.local_parent(def_id).to_def_id()),
name: tcx.item_name(parent_def_id.to_def_id()),
what: match tcx.hir().get(scope) {
_ if scope == hir::CRATE_HIR_ID => "module",
Node::Item(hir::Item { kind: hir::ItemKind::Mod(_), .. }) => "module",
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/array_into_iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ declare_lint! {
Warn,
"detects calling `into_iter` on arrays in Rust 2015 and 2018",
@future_incompatible = FutureIncompatibleInfo {
reference: "<https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>",
reason: FutureIncompatibilityReason::EditionSemanticsChange(Edition::Edition2021),
reference: "<https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>",
};
}

Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_lint/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -844,8 +844,8 @@ declare_lint! {
Warn,
"detects anonymous parameters",
@future_incompatible = FutureIncompatibleInfo {
reference: "issue #41686 <https://github.com/rust-lang/rust/issues/41686>",
reason: FutureIncompatibilityReason::EditionError(Edition::Edition2018),
reference: "issue #41686 <https://github.com/rust-lang/rust/issues/41686>",
};
}

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

Expand Down Expand Up @@ -1804,8 +1804,8 @@ declare_lint! {
Allow,
"detects edition keywords being used as an identifier",
@future_incompatible = FutureIncompatibleInfo {
reference: "issue #49716 <https://github.com/rust-lang/rust/issues/49716>",
reason: FutureIncompatibilityReason::EditionError(Edition::Edition2018),
reference: "issue #49716 <https://github.com/rust-lang/rust/issues/49716>",
};
}

Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_lint/src/deref_into_dyn_supertrait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use crate::{

use rustc_hir as hir;
use rustc_middle::{traits::util::supertraits, ty};
use rustc_session::lint::FutureIncompatibilityReason;
use rustc_span::sym;

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