Auto merge of #87963 - GuillaumeGomez:rollup-e54sbez, r=GuillaumeGomez
Rollup of 4 pull requests Successful merges: - #87819 (Use a more accurate span on assoc types WF checks) - #87863 (Fix Windows Command::env("PATH")) - #87885 (Link to edition guide instead of issues for 2021 lints.) - #87941 (Fix/improve rustdoc-js tool) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
4498e300e4
54 changed files with 189 additions and 161 deletions
|
@ -32,7 +32,7 @@ declare_lint! {
|
|||
Warn,
|
||||
"detects calling `into_iter` on arrays in Rust 2015 and 2018",
|
||||
@future_incompatible = FutureIncompatibleInfo {
|
||||
reference: "issue #66145 <https://github.com/rust-lang/rust/issues/66145>",
|
||||
reference: "<https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>",
|
||||
reason: FutureIncompatibilityReason::EditionSemanticsChange(Edition::Edition2021),
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1680,7 +1680,7 @@ declare_lint! {
|
|||
Warn,
|
||||
"`...` range patterns are deprecated",
|
||||
@future_incompatible = FutureIncompatibleInfo {
|
||||
reference: "issue #80165 <https://github.com/rust-lang/rust/issues/80165>",
|
||||
reference: "<https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>",
|
||||
reason: FutureIncompatibilityReason::EditionError(Edition::Edition2021),
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1605,7 +1605,7 @@ declare_lint! {
|
|||
Warn,
|
||||
"suggest using `dyn Trait` for trait objects",
|
||||
@future_incompatible = FutureIncompatibleInfo {
|
||||
reference: "issue #80165 <https://github.com/rust-lang/rust/issues/80165>",
|
||||
reference: "<https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>",
|
||||
reason: FutureIncompatibilityReason::EditionError(Edition::Edition2021),
|
||||
};
|
||||
}
|
||||
|
@ -3247,7 +3247,7 @@ declare_lint! {
|
|||
Allow,
|
||||
"detects usage of old versions of or-patterns",
|
||||
@future_incompatible = FutureIncompatibleInfo {
|
||||
reference: "issue #84869 <https://github.com/rust-lang/rust/issues/84869>",
|
||||
reference: "<https://doc.rust-lang.org/nightly/edition-guide/rust-2021/or-patterns-macro-rules.html>",
|
||||
reason: FutureIncompatibilityReason::EditionError(Edition::Edition2021),
|
||||
};
|
||||
}
|
||||
|
@ -3296,7 +3296,7 @@ declare_lint! {
|
|||
"detects the usage of trait methods which are ambiguous with traits added to the \
|
||||
prelude in future editions",
|
||||
@future_incompatible = FutureIncompatibleInfo {
|
||||
reference: "issue #85684 <https://github.com/rust-lang/rust/issues/85684>",
|
||||
reference: "<https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>",
|
||||
reason: FutureIncompatibilityReason::EditionError(Edition::Edition2021),
|
||||
};
|
||||
}
|
||||
|
@ -3331,7 +3331,7 @@ declare_lint! {
|
|||
Allow,
|
||||
"identifiers that will be parsed as a prefix in Rust 2021",
|
||||
@future_incompatible = FutureIncompatibleInfo {
|
||||
reference: "issue #84978 <https://github.com/rust-lang/rust/issues/84978>",
|
||||
reference: "<https://doc.rust-lang.org/nightly/edition-guide/rust-2021/reserving-syntax.html>",
|
||||
reason: FutureIncompatibilityReason::EditionError(Edition::Edition2021),
|
||||
};
|
||||
crate_level_only
|
||||
|
|
|
@ -194,12 +194,13 @@ pub fn check_trait_item(tcx: TyCtxt<'_>, def_id: LocalDefId) {
|
|||
let hir_id = tcx.hir().local_def_id_to_hir_id(def_id);
|
||||
let trait_item = tcx.hir().expect_trait_item(hir_id);
|
||||
|
||||
let method_sig = match trait_item.kind {
|
||||
hir::TraitItemKind::Fn(ref sig, _) => Some(sig),
|
||||
_ => None,
|
||||
let (method_sig, span) = match trait_item.kind {
|
||||
hir::TraitItemKind::Fn(ref sig, _) => (Some(sig), trait_item.span),
|
||||
hir::TraitItemKind::Type(_bounds, Some(ty)) => (None, ty.span),
|
||||
_ => (None, trait_item.span),
|
||||
};
|
||||
check_object_unsafe_self_trait_by_name(tcx, &trait_item);
|
||||
check_associated_item(tcx, trait_item.hir_id(), trait_item.span, method_sig);
|
||||
check_associated_item(tcx, trait_item.hir_id(), span, method_sig);
|
||||
}
|
||||
|
||||
fn could_be_self(trait_def_id: LocalDefId, ty: &hir::Ty<'_>) -> bool {
|
||||
|
@ -268,12 +269,13 @@ pub fn check_impl_item(tcx: TyCtxt<'_>, def_id: LocalDefId) {
|
|||
let hir_id = tcx.hir().local_def_id_to_hir_id(def_id);
|
||||
let impl_item = tcx.hir().expect_impl_item(hir_id);
|
||||
|
||||
let method_sig = match impl_item.kind {
|
||||
hir::ImplItemKind::Fn(ref sig, _) => Some(sig),
|
||||
_ => None,
|
||||
let (method_sig, span) = match impl_item.kind {
|
||||
hir::ImplItemKind::Fn(ref sig, _) => (Some(sig), impl_item.span),
|
||||
hir::ImplItemKind::TyAlias(ty) => (None, ty.span),
|
||||
_ => (None, impl_item.span),
|
||||
};
|
||||
|
||||
check_associated_item(tcx, impl_item.hir_id(), impl_item.span, method_sig);
|
||||
check_associated_item(tcx, impl_item.hir_id(), span, method_sig);
|
||||
}
|
||||
|
||||
fn check_param_wf(tcx: TyCtxt<'_>, param: &hir::GenericParam<'_>) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue