Changes:
````
Apply suggestions from code review
Simplify if_chain.
Move NumericLiteral to its own module.
Included binary and octal cases.
Resolve false positives for hex int cast.
Test for unnecessary_cast of hex int literal.
run-rustfix
Lint `if let Some` in question_mark lint
Add restrictive pat use in full binded struct
Update test case answers to match cargo dev fmt
Ran cargo dev fmt
Rustup to rust-lang/rust#69506
Recommended changes from flip1995
Revive rls integration test
use question mark operator
Add regression test
Use `try_eval_usize` over `eval_usize`
Add path for display trait
Use lang items instead of get_trait_def_id where possible
Update stderr
Don't lint debug formatting in debug impl
Whitelist unused attribute for use items.
Fix one last test issue
Refactor suggested by krishna-veerareddy
Fixed compile error from merging
Changed test output to reflect cargo fmt
Run cargo dev fmt
Finished checking for cases of absolute values
add test for #5238
Some bugfixing
Created floating point abs lint and test, but not yet run
````
For all of the methods that pick off the first or last element, we can
use subslice patterns to implement them directly, rather than relying on
deeper indexing function calls. At a minimum, this means the generated
code will rely less on inlining for performance, but in some cases it
also optimizes better.
nightly: bootstrap from 1.42.0-beta.5 (4e1c5f0e9 2020-02-28)
This beta snapshot has the llvm miscompilation fix included and is bootstrapped from a stable version that also has it included.
Stabilize assoc_int_consts associated int/float constants
The next step in RFC https://github.com/rust-lang/rfcs/pull/2700 (tracking issue #68490). Stabilizing the associated constants that were added in #68325.
* Stabilize all constants under the `assoc_int_consts` feature flag.
* Update documentation on old constants to say they are soft-deprecated and the new ones should be preferred.
* Update documentation examples to use new constants.
* Remove `uint_macro` and use `int_macro` for all integer types since the macros were identical anyway.
r? @LukasKalbertodt
Invoke OptimizerLastEPCallbacks in PreLinkThinLTO
The default ThinLTO pre-link pipeline does not include optimizer last
extension points. Thus, when using the new LLVM pass manager & ThinLTO
& sanitizers on any opt-level different from zero, the sanitizer
function passes would be omitted from the pipeline.
Add optimizer last extensions points manually to the pipeline, but guard
registration with stage check in the case this behaviour changes in the
future.
cleanup more iterator usages (and other things)
* Improve weird formatting by moving comment inside else-code block.
* Use .any(x) instead of .find(x).is_some() on iterators.
* Use .nth(x) instead of .skip(x).next() on iterators.
* Simplify conditions like x + 1 <= y to x < y
* Use let instead of match to get value of enum with single variant.
miri engine: turn some debug_assert into assert
@eddyb said to avoid debug assertions in rustc. These checks here look like they are probably not too expensive. Cc @oli-obk
encode `;` stmt without expr as `StmtKind::Empty`
Instead of encoding `;` statements without a an expression as a tuple in AST, encode it as `ast::StmtKind::Empty`.
r? @petrochenkov
PR #69562, which fixed a bug that was causing clippy to ICE, passed the
place for the *result* of `Rvalue::Discriminant` instead of the
*operand* to `apply_discriminant_switch_effect`. As a result, no effect
was applied at all, and we lost the perf benefits from marking
inactive enum variants as uninitialized.
Improve linking of crates with circular dependencies
Previously, the code responsible for handling the cycles between crates
introduces through weak lang items, would keep a set of missing language
items:
* extending it with items missing from the current crate,
* removing items provided by the current crate,
* grouping the crates when the set changed from non-empty back to empty.
This could produce incorrect results, if a lang item was missing from a
crate that comes after the crate that provides it (in the loop iteration
order). In that case the grouping would not take place.
The changes here address this specific failure scenario by keeping track
of two separate sets of crates. Those that are required to link successfully,
and those that are available for linking.
Verified using test case from #69368.
Polonius: update `polonius-engine` to 0.12.0
Since @albins won't have the time to finish up #68993 for a while, I'll take care of the trivial remaining tasks (rebasing, taking care of tidy/rustfmt).
I'll r? @nikomatsakis since they're assigned to #68993, but have actually [already reviewed it pre-rebase](https://github.com/rust-lang/rust/pull/68993#issuecomment-586413089).
When CI passes: I'll notify bors and close#68993, since this PR supersedes it.
Previously, the code responsible for handling the cycles between crates
introduces through weak lang items, would keep a set of missing language
items:
* extending it with items missing from the current crate,
* removing items provided by the current crate,
* grouping the crates when the set changed from non-empty back to empty.
This could produce incorrect results, if a lang item was missing from a
crate that comes after the crate that provides it (in the loop iteration
order). In that case the grouping would not take place.
The changes here address this specific failure scenario by keeping track
of two separate sets of crates. Those that are required to link successfully,
and those that are available for linking.
Verified using test case from 69368.
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.