Auto merge of #6126 - flip1995:rustup, r=flip1995
Rustup Supersedes #6121. There was another breakage. r? `@ghost` changelog: none
This commit is contained in:
commit
1a4175bcec
@ -155,7 +155,7 @@ pub fn lit_to_constant(lit: &LitKind, ty: Option<Ty<'_>>) -> Constant {
|
||||
match *lit {
|
||||
LitKind::Str(ref is, _) => Constant::Str(is.to_string()),
|
||||
LitKind::Byte(b) => Constant::Int(u128::from(b)),
|
||||
LitKind::ByteStr(ref s) => Constant::Binary(Lrc::from(s.as_slice())),
|
||||
LitKind::ByteStr(ref s) => Constant::Binary(Lrc::clone(s)),
|
||||
LitKind::Char(c) => Constant::Char(c),
|
||||
LitKind::Int(n, _) => Constant::Int(n),
|
||||
LitKind::Float(ref is, LitFloatType::Suffixed(fty)) => match fty {
|
||||
|
@ -3,6 +3,7 @@ use rustc_hir::intravisit::FnKind;
|
||||
use rustc_hir::{Body, FnDecl, HirId};
|
||||
use rustc_infer::infer::TyCtxtInferExt;
|
||||
use rustc_lint::{LateContext, LateLintPass};
|
||||
use rustc_middle::ty::subst::Subst;
|
||||
use rustc_middle::ty::{Opaque, PredicateAtom::Trait};
|
||||
use rustc_session::{declare_lint_pass, declare_tool_lint};
|
||||
use rustc_span::{sym, Span};
|
||||
@ -62,9 +63,10 @@ impl<'tcx> LateLintPass<'tcx> for FutureNotSend {
|
||||
}
|
||||
let ret_ty = utils::return_ty(cx, hir_id);
|
||||
if let Opaque(id, subst) = *ret_ty.kind() {
|
||||
let preds = cx.tcx.predicates_of(id).instantiate(cx.tcx, subst);
|
||||
let preds = cx.tcx.explicit_item_bounds(id);
|
||||
let mut is_future = false;
|
||||
for p in preds.predicates {
|
||||
for &(p, _span) in preds {
|
||||
let p = p.subst(cx.tcx, subst);
|
||||
if let Some(trait_ref) = p.to_opt_poly_trait_ref() {
|
||||
if Some(trait_ref.def_id()) == cx.tcx.lang_items().future_trait() {
|
||||
is_future = true;
|
||||
|
@ -1667,7 +1667,7 @@ impl<'tcx> LateLintPass<'tcx> for Methods {
|
||||
// if return type is impl trait, check the associated types
|
||||
if let ty::Opaque(def_id, _) = *ret_ty.kind() {
|
||||
// one of the associated types must be Self
|
||||
for &(predicate, _span) in cx.tcx.predicates_of(def_id).predicates {
|
||||
for &(predicate, _span) in cx.tcx.explicit_item_bounds(def_id) {
|
||||
if let ty::PredicateAtom::Projection(projection_predicate) = predicate.skip_binders() {
|
||||
// walk the associated type and check for Self
|
||||
if contains_ty(projection_predicate.ty, self_ty) {
|
||||
|
@ -1276,7 +1276,7 @@ pub fn is_must_use_ty<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> bool {
|
||||
},
|
||||
ty::Tuple(ref substs) => substs.types().any(|ty| is_must_use_ty(cx, ty)),
|
||||
ty::Opaque(ref def_id, _) => {
|
||||
for (predicate, _) in cx.tcx.predicates_of(*def_id).predicates {
|
||||
for (predicate, _) in cx.tcx.explicit_item_bounds(*def_id) {
|
||||
if let ty::PredicateAtom::Trait(trait_predicate, _) = predicate.skip_binders() {
|
||||
if must_use_attr(&cx.tcx.get_attrs(trait_predicate.trait_ref.def_id)).is_some() {
|
||||
return true;
|
||||
|
@ -3,7 +3,6 @@
|
||||
// Test that the whole restriction group is not enabled
|
||||
#![warn(clippy::restriction)]
|
||||
#![deny(clippy::restriction)]
|
||||
#![forbid(clippy::restriction)]
|
||||
#![allow(clippy::missing_docs_in_private_items, clippy::panic, clippy::unreachable)]
|
||||
|
||||
#[inline(always)]
|
||||
|
@ -1,5 +1,5 @@
|
||||
error: you have declared `#[inline(always)]` on `test_attr_lint`. This is usually a bad idea
|
||||
--> $DIR/attrs.rs:9:1
|
||||
--> $DIR/attrs.rs:8:1
|
||||
|
|
||||
LL | #[inline(always)]
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
@ -7,7 +7,7 @@ LL | #[inline(always)]
|
||||
= note: `-D clippy::inline-always` implied by `-D warnings`
|
||||
|
||||
error: the since field must contain a semver-compliant version
|
||||
--> $DIR/attrs.rs:29:14
|
||||
--> $DIR/attrs.rs:28:14
|
||||
|
|
||||
LL | #[deprecated(since = "forever")]
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
@ -15,7 +15,7 @@ LL | #[deprecated(since = "forever")]
|
||||
= note: `-D clippy::deprecated-semver` implied by `-D warnings`
|
||||
|
||||
error: the since field must contain a semver-compliant version
|
||||
--> $DIR/attrs.rs:32:14
|
||||
--> $DIR/attrs.rs:31:14
|
||||
|
|
||||
LL | #[deprecated(since = "1")]
|
||||
| ^^^^^^^^^^^
|
||||
@ -37,13 +37,5 @@ LL | #![deny(clippy::restriction)]
|
||||
|
|
||||
= help: try enabling only the lints you really need
|
||||
|
||||
error: restriction lints are not meant to be all enabled
|
||||
--> $DIR/attrs.rs:6:11
|
||||
|
|
||||
LL | #![forbid(clippy::restriction)]
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: try enabling only the lints you really need
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
error: aborting due to 5 previous errors
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user