Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
68a58f2
Add postfix-match experimental feature
RossSmyth Feb 16, 2024
78b3bf9
Add MatchKind member to the Match expr for pretty printing & fmt
RossSmyth Feb 17, 2024
d4ba888
Add basic rustfmt implementation & test
RossSmyth Feb 17, 2024
567c98b
Add postfix match MatchSource to HIR
RossSmyth Mar 3, 2024
7be47b2
interpret/allocation: fix aliasing issue in interpreter and refactor …
RalfJung Mar 15, 2024
3c70d60
Gracefully handle AnonConst in diagnostic_hir_wf_check()
gurry Mar 19, 2024
4250216
Add `NonNull::<[T]>::is_empty` as insta-stable.
zachs18 Mar 20, 2024
453676f
Split out ImplPolarity and PredicatePolarity
compiler-errors Mar 21, 2024
76ad048
Use != Positive rather than == Negative
compiler-errors Mar 21, 2024
08d8cd5
Fix clippy
compiler-errors Mar 21, 2024
dae3c43
Further simplifications
compiler-errors Mar 21, 2024
60891ca
Use less hacky STACK_SIZE
workingjubilee Mar 21, 2024
5425338
Suggest using RUST_MIN_STACK if rustc overflowed
workingjubilee Mar 21, 2024
1b95760
Not insta-stable
zachs18 Mar 21, 2024
861e470
Fix Itanium mangling usizes
workingjubilee Mar 22, 2024
91aae58
coverage: Clean up marker statements that aren't needed later
Zalathar Mar 15, 2024
05f612d
Rollup merge of #121619 - RossSmyth:pfix_match, r=petrochenkov
matthiaskrgr Mar 22, 2024
665c7a2
Rollup merge of #122370 - gurry:122199-ice-unexpected-node, r=davidtwco
matthiaskrgr Mar 22, 2024
d141d9a
Rollup merge of #122537 - RalfJung:interpret-allocation, r=oli-obk
matthiaskrgr Mar 22, 2024
2a54c13
Rollup merge of #122542 - Zalathar:cleanup, r=oli-obk
matthiaskrgr Mar 22, 2024
75fa268
Rollup merge of #122800 - zachs18:nonnull-slice-is_empty, r=Amanieu
matthiaskrgr Mar 22, 2024
0947f2e
Rollup merge of #122839 - compiler-errors:predicate-polarity, r=lcnr
matthiaskrgr Mar 22, 2024
61561fe
Rollup merge of #122847 - workingjubilee:suggest-rust-min-stack-worka…
matthiaskrgr Mar 22, 2024
e5fcc6a
Rollup merge of #122855 - workingjubilee:mangle-64-bit-chauvinism, r=…
matthiaskrgr Mar 22, 2024
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
Prev Previous commit
Next Next commit
Fix clippy
  • Loading branch information
compiler-errors committed Mar 21, 2024
commit 08d8cd56c2ff232b82803ecc56bd353c4e692b5b
4 changes: 2 additions & 2 deletions src/tools/clippy/clippy_lints/src/derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use rustc_lint::{LateContext, LateLintPass};
use rustc_middle::hir::nested_filter;
use rustc_middle::traits::Reveal;
use rustc_middle::ty::{
self, ClauseKind, GenericArgKind, GenericParamDefKind, ImplPolarity, ParamEnv, ToPredicate, TraitPredicate, Ty,
self, ClauseKind, GenericArgKind, GenericParamDefKind, ParamEnv, ToPredicate, TraitPredicate, Ty,
TyCtxt,
};
use rustc_session::declare_lint_pass;
Expand Down Expand Up @@ -502,7 +502,7 @@ fn param_env_for_derived_eq(tcx: TyCtxt<'_>, did: DefId, eq_trait_id: DefId) ->
params.iter().filter(|&&(_, needs_eq)| needs_eq).map(|&(param, _)| {
ClauseKind::Trait(TraitPredicate {
trait_ref: ty::TraitRef::new(tcx, eq_trait_id, [tcx.mk_param_from_def(param)]),
polarity: ImplPolarity::Positive,
polarity: ty::PredicatePolarity::Positive,
})
.to_predicate(tcx)
}),
Expand Down
4 changes: 2 additions & 2 deletions src/tools/clippy/clippy_lints/src/eta_reduction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use rustc_hir::{BindingAnnotation, Expr, ExprKind, FnRetTy, Param, PatKind, QPat
use rustc_infer::infer::TyCtxtInferExt;
use rustc_lint::{LateContext, LateLintPass};
use rustc_middle::ty::{
self, Binder, ClosureArgs, ClosureKind, FnSig, GenericArg, GenericArgKind, ImplPolarity, List, Region, RegionKind,
self, Binder, ClosureArgs, ClosureKind, FnSig, GenericArg, GenericArgKind, List, Region, RegionKind,
Ty, TypeVisitableExt, TypeckResults,
};
use rustc_session::declare_lint_pass;
Expand Down Expand Up @@ -173,7 +173,7 @@ impl<'tcx> LateLintPass<'tcx> for EtaReduction {
if let Ok((ClosureKind::FnMut, _)) = cx.tcx.infer_ctxt().build().type_implements_fn_trait(
cx.param_env,
Binder::bind_with_vars(callee_ty_adjusted, List::empty()),
ImplPolarity::Positive,
ty::PredicatePolarity::Positive,
) && path_to_local(callee).map_or(false, |l| {
local_used_in(cx, l, args) || local_used_after_expr(cx, l, expr)
}) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use rustc_lint::LateContext;
use rustc_middle::mir::Mutability;
use rustc_middle::ty::adjustment::{Adjust, Adjustment, OverloadedDeref};
use rustc_middle::ty::{
self, ClauseKind, GenericArg, GenericArgKind, GenericArgsRef, ImplPolarity, ParamTy, ProjectionPredicate,
self, ClauseKind, GenericArg, GenericArgKind, GenericArgsRef, ParamTy, ProjectionPredicate,
TraitPredicate, Ty,
};
use rustc_span::{sym, Symbol};
Expand Down Expand Up @@ -669,7 +669,7 @@ fn check_borrow_predicate<'tcx>(cx: &LateContext<'tcx>, expr: &Expr<'tcx>) {
&& let Some(borrow_id) = cx.tcx.get_diagnostic_item(sym::Borrow)
&& cx.tcx.predicates_of(method_def_id).predicates.iter().any(|(pred, _)| {
if let ClauseKind::Trait(trait_pred) = pred.kind().skip_binder()
&& trait_pred.polarity == ImplPolarity::Positive
&& trait_pred.polarity == ty::PredicatePolarity::Positive
&& trait_pred.trait_ref.def_id == borrow_id
{
true
Expand Down