Camille GILLOT
c58a6fa422
Iterate DefId to encode spans.
2021-01-23 13:44:02 +01:00
Camille GILLOT
0b6c9e9f88
Encode DefKind directly.
2021-01-23 13:42:56 +01:00
oli
819b008d8b
Put dynamic check tests into their own file
2021-01-23 12:35:45 +00:00
Camille GILLOT
064a351953
Infallible version of def_span.
2021-01-23 13:35:22 +01:00
oli
cd09871157
Cover more cases in the test suite
2021-01-23 11:58:58 +00:00
bjorn3
c3367dbc6f
Add some comments to PassMode
2021-01-23 12:57:35 +01:00
oli
14f39aa81a
Do not allow arbitrary mutable references in static mut
, just keep with the existing exceptions
2021-01-23 11:33:45 +00:00
oli
00e62fabf1
Adjust wording of a diagnostic
2021-01-23 11:33:45 +00:00
oli
3cd0b46bac
Fix a comment that only made sense in the context of a dataflow based mutability check
2021-01-23 11:33:45 +00:00
oli
b217fab960
Rename tests to what their code actually does
2021-01-23 11:33:45 +00:00
oli
d118021f8b
Permit mutable references in all const contexts
2021-01-23 11:33:45 +00:00
Bastian Kauschke
688cf6406a
replace RefCell with Cell in FnCtxt
2021-01-23 11:47:38 +01:00
bjorn3
794880c6b5
Don't provide backend_optimization_level query for extern crates
2021-01-23 11:11:51 +01:00
bjorn3
a93dace55c
Never create an temporary PassMode::Direct when it is not a valid pass mode for a type
2021-01-23 10:30:39 +01:00
bjorn3
ba484de538
Move some code around
2021-01-23 10:30:39 +01:00
bjorn3
da0309c711
Use PassMode::Pair by default for Abi::ScalarPair for all abi's and in return position
...
Abi::ScalarPair is only ever used for types that don't have a stable
layout anyway so this doesn't break any FFI. It does however reduce the
amount of special casing on the abi outside of the code responsible for
abi specific adjustments to the pass mode.
2021-01-23 10:30:38 +01:00
bjorn3
2bde7d21cc
Remove unused dependency
2021-01-23 10:30:38 +01:00
bors
4153fa82ff
Auto merge of #80715 - JulianKnodt:skip_opt, r=nagisa
...
Change branching in `iter.skip()`
Optimize branching in `Skip`, which was brought up in #80416 .
This assumes that if `next` is called, it's likely that there will be more calls to `next`, and the branch for skip will only be hit once thus it's unlikely to take that path. Even w/o the `unlikely` intrinsic, it compiles more efficiently, I believe because the path where `next` is called is always taken.
It should be noted there are very few places in the compiler where `Skip` is used, so probably won't have a noticeable perf impact.
[New impl](https://godbolt.org/z/85rdj4 )
[Old impl](https://godbolt.org/z/Wc74rh )
[Some additional asm examples](https://godbolt.org/z/feKzoz ) although they really don't have a ton of difference between them.
2021-01-23 09:25:11 +00:00
bors
1986b58c64
Auto merge of #80065 - b-naber:parse-angle-arg-diagnostics, r=petrochenkov
...
Improve diagnostics when parsing angle args
https://github.com/rust-lang/rust/pull/79266 introduced parsing of generic arguments in associated type constraints, this however resulted in possibly very confusing error messages in cases in which closing angle brackets were missing such as in `Vec<(u32, _, _) = vec![]`, which outputs an incorrectly parsed equality constraint error, as noted by `@cynecx.`
This PR tries to provide better error messages in such cases.
r? `@petrochenkov`
2021-01-23 06:27:21 +00:00
Dhruv Jauhar
e94cf57c3e
Make functional record update/struct update syntax works inside closures when feature capture_disjoint_fields is enabled
2021-01-22 23:10:24 -05:00
bors
fe0fa59b50
Auto merge of #76391 - danii:master, r=cuviper
...
Split up core/test/iter.rs into multiple files
This PR removes the `// ignore-tidy-filelength` at the top of [iter.rs](04f44fb923/library/core/tests/iter.rs
) by splitting it into several sub files. I have split the file per test, based on what I felt the test was really trying to test.
Addresses issue #60302 .
- [associated_util.rs](d29180a8ed/library/core/tests/iter/associated_util.rs
) - For testing the module level functions. (Maybe should be renamed?)
- [collection.rs](d29180a8ed/library/core/tests/iter/collection.rs
) - For testing methods that use the values of all the items in an iterator, and creates one value from them, whether it be a Vec of all the values, or a number that represents the sum.
- [mod.rs](d29180a8ed/library/core/tests/iter/mod.rs
) - For utility structs used in all tests, and other tests I didn't know where to place.
- [range.rs](d29180a8ed/library/core/tests/iter/range.rs
) - For testing ranges.
- [transformation.rs](d29180a8ed/library/core/tests/iter/transformation.rs
) - For testing methods that transform all the values in an iterator.
- [util.rs](d29180a8ed/library/core/tests/iter/util.rs
) - For testing methods that provide utility in more specific use cases.
"Programatically"
-----------------------
You may have noticed I "Programatically" split up the file. [This is how](https://gist.github.com/danii/a58b3bcafa9faf1c3e4b01ad7495baf4 ) I managed to do that. 😛 Hope that's fine.
2021-01-23 03:33:16 +00:00
Camelid
93e51b185a
rustdoc: Fix visibility of trait and impl items
2021-01-22 18:30:30 -08:00
Matthias Krüger
5b6a18362b
lintcheck: fix paths in the logs
2021-01-23 02:18:11 +01:00
Matthias Krüger
d0d28b11d7
update lintcheck-logs
2021-01-23 02:18:11 +01:00
Matthias Krüger
83fcf95f52
rename cargo dev crater to cargo dev lintcheck
2021-01-23 02:18:11 +01:00
Matthias Krüger
48fc948ca3
clippy dev crater: address more review commetns
...
make serde a feature-dep
save clippy version in the crater log
2021-01-23 02:18:11 +01:00
Matthias Krüger
94a73d7b11
add shortcut "dev-crater" command to build and run "cargo dev crater"
2021-01-23 02:18:11 +01:00
Matthias Krüger
ec1902ce43
cargo dev crater: throw an error if we can't find our specified crate in the .toml list
2021-01-23 02:18:11 +01:00
Matthias Krüger
b6ef1e282e
clippy dev crater: add option to only check a single one of the listed crates with --only crate
2021-01-23 02:18:11 +01:00
Matthias Krüger
d257101109
make stats stable
2021-01-23 02:18:11 +01:00
Matthias Krüger
e56c9a5253
cargo dev crater: gather and save lint statistics (how often a lint triggered)
2021-01-23 02:18:11 +01:00
Matthias Krüger
4ec9cb84bb
cargo dev crater: refactor to get a list of all ClippyWarnings
2021-01-23 02:18:11 +01:00
Matthias Krüger
6c5bf2778f
clippy dev crater: use and parse clippy messages as json message, to get the lint name of a warning
2021-01-23 02:18:11 +01:00
Matthias Krüger
62337f2842
remove duplicate code and other cleanup
2021-01-23 02:18:11 +01:00
Matthias Krüger
22824d21da
rename symbols: krate -> crate
2021-01-23 02:18:11 +01:00
Matthias Krüger
f986d78c5e
cargo dev crater: support multiple versions per crate
2021-01-23 02:18:11 +01:00
Matthias Krüger
588efa7da9
use a .toml file to list the crates we want to check
...
Also sort lint results alphabetically.
2021-01-23 02:18:11 +01:00
Matthias Krüger
a9fce6d2d0
allow clippy::filter_map
2021-01-23 02:18:11 +01:00
Matthias Krüger
ccfaa338ed
cargo dev crater: share target dir between clippy runs, enable pedantic and cargo lints, ignore tokei for now.
2021-01-23 02:18:11 +01:00
Matthias Krüger
1e5ac1dfd2
cargo dev crater: add more crates to be checked
2021-01-23 02:18:11 +01:00
Matthias Krüger
728dc06d88
add the log file
2021-01-23 02:18:11 +01:00
Matthias Krüger
dbb8c0020e
cargo dev crater: save all warnings into a file
2021-01-23 02:18:11 +01:00
Matthias Krüger
7314133722
cargo dev crater: cleanup, don't re-download and reextract crates on every run
2021-01-23 02:18:11 +01:00
Matthias Krüger
734d2052df
print all clippy warnings in the end
2021-01-23 02:18:11 +01:00
Matthias Krüger
2360a7cad0
cargo clippy dev: collecting one-line clippy warnings works now
2021-01-23 02:18:11 +01:00
Matthias Krüger
69c0757334
clippy cargo dev: fix checking of crates
2021-01-23 02:18:11 +01:00
Matthias Krüger
e69147486e
cargo clippy dev: fix extraction of downloaded crates
2021-01-23 02:18:11 +01:00
Matthias Krüger
63176834c2
cargo dev crater: fixes and debug prints
2021-01-23 02:18:11 +01:00
Matthias Krüger
30d85942cf
crater: hook into main.rs
2021-01-23 02:18:11 +01:00
Matthias Krüger
5353591b1b
cargo dev crater: work on downloading and extracting crate sources
2021-01-23 02:18:11 +01:00