| Age | Commit message (Collapse) | Author | Lines |
|
|
|
Rename `def_span` to `guess_head_span`
r? @eddyb
|
|
|
|
correctly normalize constants
closes #70317
implements https://github.com/rust-lang/rust/issues/70125#issuecomment-602133708
r? eddyb cc @varkor
|
|
|
|
|
|
|
|
|
|
Rename rustc guide
This is in preparation for https://github.com/rust-lang/rustc-guide/issues/470
Needs to be merged after we actually rename the guide.
Have used this to rename:
`git grep -l 'rustc_guide' | xargs sed -i 's/rustc_guide/rustc_dev_guide/g'`
`git grep -l 'rustc-guide' | xargs sed -i 's/rustc-guide/rustc-dev-guide/g'`
`git grep -l 'rustc guide' | xargs sed -i 's/rustc guide/rustc dev guide/g'`
|
|
|
|
|
|
|
|
|
|
Some(y)) (clippy::option_and_then_some)
|
|
more cleanups
* use starts_with() instead of chars().next() == Some(x)
* use subsec_micros() instead of subsec_nanos() / 1000
* use for (idx, item) in iter.enumerate() instead of manually counting loop iterations with variables
* use values() or keys() respectively when iterating only over keys or values of maps.
|
|
|
|
of maps.
|
|
|
|
Surface associated type projection bounds that could not be fulfilled in
E0599 errors. Always present the list of unfulfilled trait bounds,
regardless of whether we're pointing at the ADT or trait that didn't
satisfy it.
|
|
example:
let s: String = format!("hello").into();
|
|
Querify object_safety_violations.
Split from #69076
r? @Zoxc
|
|
|
|
|
|
|
|
|
|
Use a `ParamEnvAnd<Predicate>` for caching in `ObligationForest`
Previously, we used a plain `Predicate` to cache results (e.g. successes
and failures) in ObligationForest. However, fulfillment depends on the
precise `ParamEnv` used, so this is unsound in general.
This commit changes the impl of `ForestObligation` for
`PendingPredicateObligation` to use `ParamEnvAnd<Predicate>` instead of
`Predicate` for the associated type. The associated type and method are
renamed from 'predicate' to 'cache_key' to reflect the fact that type is
no longer just a predicate.
|
|
Same idea for `Unsafety` & use new span for better diagnostics.
|
|
When expecting `BoxFuture` and using `async {}`, suggest `Box::pin`
Fix #68197, cc #69083.
|
|
|
|
|
|
Improve `ty.needs_drop`
* Handle cycles in `needs_drop` correctly
* Normalize types when computing `needs_drop`
* Move queries from rustc to rustc_ty
* Avoid query in simple cases
reopens #65918
|
|
|
|
|
|
Rollup of 8 pull requests
Successful merges:
- #66498 (Remove unused feature gates)
- #68816 (Tweak borrow error on `FnMut` when `Fn` is expected)
- #68824 (Enable Control Flow Guard in rustbuild)
- #69022 (traits: preallocate 2 Vecs of known initial size)
- #69031 (Use `dyn Trait` more in tests)
- #69044 (Don't run coherence twice for future-compat lints)
- #69047 (Don't rustfmt check the vendor directory.)
- #69055 (Clean up E0307 explanation)
Failed merges:
r? @ghost
|
|
Don't run coherence twice for future-compat lints
This fixes the regression introduced by https://github.com/rust-lang/rust/pull/65232 (which I mentioned in https://github.com/rust-lang/rust/pull/65232#issuecomment-583739037).
Old algorithm:
* Run coherence with all future-incompatible checks off, reporting errors on any overlap.
* If there's no overlap (common case), run it *again*, with the future-incompatible checks on. Report warnings for any overlap found.
New algorithm:
* Run coherence with all additional future-incompatible checks *on*, which means that we'll find *all* potentially overlapping impls immediately.
* If this found overlap, run coherence again, with the future-incompatible checks off. If that *still* gives an error, we report it. If not, it ought to be a warning.
This reduces time spent in coherence checking for the nrf52810-pac by roughly 50% relative to current master.
|
|
traits: preallocate 2 Vecs of known initial size
The 2 preallocations are pretty obvious; both vectors will be as big as or larger than the collections they are created from.
In `WfPredicates::normalize` the change from a functional style improves readability and should be perf-friendly, too.
|
|
|
|
Caller now passes in a `decorate` function, which is only run if the
lint is allowed.
|
|
Make issue references consistent
Fixes https://github.com/rust-lang/rust/issues/62976
cc https://github.com/rust-lang/rust/pull/63008
r? @varkor because you reviewed the original pr
|
|
|
|
|
|
Rollup of 6 pull requests
Successful merges:
- #68694 (Reduce the number of `RefCell`s in `InferCtxt`.)
- #68966 (Improve performance of coherence checks)
- #68976 (Make `num::NonZeroX::new` an unstable `const fn`)
- #68992 (Correctly parse `mut a @ b`)
- #69005 (Small graphviz improvements for the new dataflow framework)
- #69006 (parser: Keep current and previous tokens precisely)
Failed merges:
r? @ghost
|
|
Improve performance of coherence checks
The biggest perf improvement in here is expected to come from the removal of the remaining #43355 warning code since that effectively runs the expensive parts of coherence *twice*, which can even be visualized by obtaining a flamegraph:

|
|
Reduce the number of `RefCell`s in `InferCtxt`.
`InferCtxt` contains six structures within `RefCell`s. Every time we
create and dispose of (commit or rollback) a snapshot we have to
`borrow_mut` each one of them.
This commit moves the six structures under a single `RefCell`, which
gives significant speed-ups by reducing the number of `borrow_mut`
calls. To avoid runtime errors I had to reduce the lifetimes of dynamic
borrows in a couple of places.
r? @varkor
|
|
This was previously a future-compat warning that has since been turned into
hard error, but without actually removing all the code.
Avoids a call to `traits::overlapping_impls`, which is expensive.
|
|
Improve reporting errors and suggestions for trait bounds
Fix #66802
- When printing errors for unsized function parameter, properly point at the parameter instead of function's body.
- Improve `consider further restricting this bound` (and related) messages by separating human-oriented hints from the machine-oriented ones.
|
|
`InferCtxt` contains six structures within `RefCell`s. Every time we
create and dispose of (commit or rollback) a snapshot we have to
`borrow_mut` each one of them.
This commit moves the six structures under a single `RefCell`, which
gives significant speed-ups by reducing the number of `borrow_mut`
calls. To avoid runtime errors I had to reduce the lifetimes of dynamic
borrows in a couple of places.
|
|
|
|
Speed up the inherent impl overlap check
This gives a ~7% improvement in compile times for the stm32f0(x2) crate.
Also addresses @eddyb's comment in https://github.com/rust-lang/rust/pull/68837#discussion_r375701767.
|
|
|