Commit graph

160417 commits

Author SHA1 Message Date
bors
83b15bfe1c Auto merge of #92352 - matthiaskrgr:rollup-19fbq7u, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #92076 (Ignore other `PredicateKind`s in rustdoc auto trait finder)
 - #92219 (Remove VCVARS_BAT)
 - #92238 (Add a test suite for stringify macro)
 - #92330 (Add myself to .mailmap)
 - #92333 (Tighten span when suggesting lifetime on path)
 - #92335 (Document units for `std::column`)
 - #92344 (⬆️ rust-analyzer)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-12-28 16:59:56 +00:00
BB
d5c4119d42 Fixed issues with to_radians and to_degrees lints 2021-12-28 17:49:18 +01:00
Alex Ozdemir
ee6d5c5cda contants peel_refs to catch x << &0 2021-12-28 08:32:55 -08:00
Alex Ozdemir
bc0579f5bf test 2021-12-28 08:19:58 -08:00
bors
442248d6bc Auto merge of #92153 - petrochenkov:foreignchild, r=cjgillot
rustc_metadata: Merge items from `extern` blocks into their parent modules during metadata encoding rather than during metadata decoding
2021-12-28 13:47:22 +00:00
Matthias Krüger
11c71d24aa
Rollup merge of #92344 - lnicola:rust-analyzer-2021-12-28, r=lnicola
⬆️ rust-analyzer

r? ``@ghost``
2021-12-28 13:59:27 +01:00
Matthias Krüger
c9cc9e589c
Rollup merge of #92335 - ecstatic-morse:std-column-unicode, r=Manishearth
Document units for `std::column`

Fixes #92301.

r? ``@Manishearth`` (for the terminology and the Chinese)
2021-12-28 13:59:26 +01:00
Matthias Krüger
98c61b673e
Rollup merge of #92333 - compiler-errors:elided-lifetime-spans, r=cjgillot
Tighten span when suggesting lifetime on path

This is kind of a hack.

Really the issue here is that we want to suggest the segment's span if the path resolves to something defined outside of the macro, and the macro's span if it resolves to something defined within.. I'll look into seeing if we can do something like that.

Fixes #92324

r? `@cjgillot`
2021-12-28 13:59:25 +01:00
Matthias Krüger
9aaa61b226
Rollup merge of #92330 - wesleywiser:mailmap, r=Mark-Simulacrum
Add myself to .mailmap
2021-12-28 13:59:24 +01:00
Matthias Krüger
0b0666e2b6
Rollup merge of #92238 - dtolnay:stringifytest, r=Mark-Simulacrum
Add a test suite for stringify macro

This attempts to cover the behavior of `stringify!` on various interpolated syntax tree nodes.

The pretty printer has a history of unsightly whitespace (double spaces, missing spaces, spaces where there shouldn't be spaces) &mdash; #91437, #91562, #91568. There are several such issues left; the test cases that I consider to be currently behaving incorrectly are marked with `// FIXME` in the PR.
2021-12-28 13:59:24 +01:00
Matthias Krüger
f1598edc3f
Rollup merge of #92219 - ehuss:remove-vcvars, r=Mark-Simulacrum
Remove VCVARS_BAT

This environment variable is no longer used.  It was used in the original Azure Pipelines configuration (#60777). When GitHub Actions were added (#70190), it was no longer used, and I suspect it was just an oversight while transitioning the configuration.
2021-12-28 13:59:23 +01:00
Matthias Krüger
bec499e08d
Rollup merge of #92076 - Aaron1011:rustdoc-auto-trait-ignore, r=cjgillot
Ignore other `PredicateKind`s in rustdoc auto trait finder

Fixes #92073

There's not really anything we can do with them, and they're
causing ICEs. I'm not using a wildcard match, as we should check
that any new `PredicateKind`s are handled properly by rustdoc.
2021-12-28 13:59:22 +01:00
TmLev
406d6d4028 docs(error-codes): Add long error explanation for E0227 2021-12-28 15:46:20 +03:00
bors
56ccd30a27 Auto merge of #8127 - dswij:8090, r=xFrednet
Fix `enum_variants` FP on prefixes that are not camel-case

closes #8090

Fix FP on `enum_variants` when prefixes are only a substring of a camel-case word. Also adds some util helpers on `str_utils` to help parsing camel-case strings.

This changes how the lint behaves:

1. previously if the Prefix is only a length of 1, it's going to get ignored, i.e. these were previously ignored and now is warned
```rust
enum Foo {
    cFoo,
    cBar,
    cBaz,
}

enum Something {
    CCall,
    CCreate,
    CCryogenize,
}
```

2. non-ascii characters that doesn't have casing will not be split,
```rust
enum NonCaps {
    PrefixXXX,
    PrefixTea,
    PrefixCake,
}
```
will be considered as `PrefixXXX`, `Prefix`, `Prefix`, so this won't lint as opposed to fired previously.

changelog: [`enum_variant_names`] Fix FP when first prefix are only a substring of a camel-case word.

---

 (Edited by `@xFrednet` removed some non ascii characters)
2021-12-28 12:01:21 +00:00
Vadim Petrochenkov
90e371027e rustc_metadata: Encode list of all crate's traits into metadata 2021-12-28 19:31:51 +08:00
bors
526fb6b7ea Auto merge of #8185 - dswij:8177, r=llogiq
`needless_return` suggest return unit type on void returns

closes #8177

previously, `needless_return` suggests an empty block `{}` to replace void `return` on match arms, this PR improve the suggestion by suggesting a unit instead.

changelog: `needless_return` suggests `()` instead of `{}` on match arms
2021-12-28 11:15:53 +00:00
bors
fc72e910fb needless_return suggest return unit type on void returns
closes #8177

previously, `needless_return` suggests an empty block `{}` to replace void `return` on match arms, this PR improve the suggestion by suggesting a unit instead.

changelog: `needless_return` suggests `()` instead of `{}` on match arms
2021-12-28 11:15:53 +00:00
bors
3c1b3ece99 Auto merge of #8175 - Kage-Yami:feature/document-8145, r=llogiq
Readme: note that config changes don't apply to already compiled code

*Please write a short comment explaining your change (or "none" for internal only changes)*

changelog: added a note to the Readme that config changes don't apply to already compiled code
2021-12-28 09:29:08 +00:00
bors
a11e5c210a Readme: note that config changes don't apply to already compiled code
*Please write a short comment explaining your change (or "none" for internal only changes)*

changelog: added a note to the Readme that config changes don't apply to already compiled code
2021-12-28 09:29:08 +00:00
Laurențiu Nicola
60c94031de ⬆️ rust-analyzer 2021-12-28 09:44:21 +02:00
Michael Goulet
e37d012a06 Tighten span when suggesting lifetime on path 2021-12-27 23:34:52 -08:00
bors
e91ad5fc62 Auto merge of #92159 - petrochenkov:decoditer, r=cjgillot
rustc_metadata: Switch crate data iteration from a callback to iterator

The iteration looks more conventional this way, and some allocations are avoided.
2021-12-28 07:32:43 +00:00
Vadim Petrochenkov
a5efceacd1 rustc_metadata: Merge items from extern blocks into their parent modules
during metadata encoding rather than during metadata decoding
2021-12-28 14:25:41 +08:00
bors
3354876876 Auto merge of #8182 - rust-lang:cache-test-items, r=giraffate
cache test item names

This avoids quadratic behavior (collecting all test item names for each `eq_op` instance within the module). However, it invests a good deal of memory to buy this speedup. If that becomes a problem, I may need to change the cache to only store the chain of last visited modules.

This hopefully fixes #8171.

---

changelog: none
2021-12-28 05:50:20 +00:00
Andre Bogus
8da9a823cb cache test item names 2021-12-28 06:39:21 +01:00
bors
cc65bf3ded Auto merge of #92088 - camelid:intra-doc-cleanup, r=Manishearth
intra-doc: Use an enum to represent URL fragments

This is a step in the direction of computing the links more lazily,
which I think will simplify the implementation of intra-doc links.
This will also make it easier to eventually use the actual `Res` for
associated items, enum variants, and fields, rather than their HTML
page's `Res`.

r? `@jyn514`
2021-12-28 04:19:01 +00:00
Noah Lev
5c8e8e565d Give clearer names to several search index functions 2021-12-27 19:19:56 -08:00
Noah Lev
afb77a959a Coalesce two arguments as &Function 2021-12-27 19:16:33 -08:00
Noah Lev
bd6692c50d Make search_index functions private where possible
Now the only two crate-public items are `build_index` and
`get_index_search_type` (because for some reason the latter is also used
in `formats::cache`).
2021-12-27 18:59:27 -08:00
Noah Lev
2b801dcdd3 Move ExternalLocation to clean::types
It was previously defined in `render::search_index` but wasn't used at
all there. `clean::types` seems like a better fit since that's where
`ExternalCrate` is defined.
2021-12-27 18:57:07 -08:00
Noah Lev
e19593f0e5 rustdoc: Remove some unnecessary cache parameters
Based on
https://github.com/rust-lang/rust/pull/80883#issuecomment-774437832.
The `tcx` parameters do seem to be used though, so I only removed the
`cache` parameters.
2021-12-27 18:53:00 -08:00
Noah Lev
60a1abe4c5 Rename rustdoc::html::render::cache to search_index
The old name wasn't very clear, while the new one makes it clear that
this is the code responsible for creating the search index.
2021-12-27 18:42:13 -08:00
Noah Lev
ae2bc69250 intra-doc: Use an enum to represent URL fragments
This is a step in the direction of computing the links more lazily,
which I think will simplify the implementation of intra-doc links.
This will also make it easier to eventually use the actual `Res` for
associated items, enum variants, and fields, rather than their HTML
page's `Res`.
2021-12-27 18:18:37 -08:00
Noah Lev
4472d9755b Remove needless return 2021-12-27 17:52:53 -08:00
bors
41ce641a40 Auto merge of #92130 - Kobzol:stable-hash-str, r=cjgillot
Use hash_stable for hashing str

This seemed like an oversight. With this change the hash can go through the `HashStable` machinery directly.
2021-12-28 01:04:33 +00:00
bors
5d194d1952 Auto merge of #8181 - ApamNapat:typos_fixes, r=giraffate
Fixed some typos in README and CONTRIBUTING

changelog: none
2021-12-28 00:29:24 +00:00
Caleb Cartwright
e8afb62c71 chore: reduce some vis. for updated unreachable_pub lint 2021-12-27 18:16:04 -06:00
Alex Ozdemir
ba70842c62 Limit the identity_op lint to integral operands.
If operands are being applied to non-integers, then the lint is likely
wrong.
2021-12-27 16:06:27 -08:00
Dylan MacKenzie
3115d8413a Document units for std::column 2021-12-27 15:39:35 -08:00
BB
b59ff5861a Fixed some typos in README and CONTRIBUTING 2021-12-28 00:08:25 +01:00
bors
4ee34f3551 Auto merge of #92329 - matthiaskrgr:rollup-l3b4fl1, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #90586 (Relax priv-in-pub lint on generic bounds and where clauses of trait impls.)
 - #92112 (Fix the error of checking `base_expr` twice in type_changing_struct_update)
 - #92147 (rustc_builtin_macros: make asm mod public for rustfmt)
 - #92161 (resolve: Minor miscellaneous cleanups from #89059)
 - #92264 (Remove `maybe_uninit_extra` feature from Vec docs)
 - #92303 (Add test cases for issue #26186)
 - #92307 (Fix minor typos)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-12-27 21:55:52 +00:00
bors
adba132411 Auto merge of #8170 - rust-lang:numbered-fields, r=xFrednet
new lint: `init-numbered-fields`

This fixes #7985.

r? `@xFrednet`

---

changelog: new lint: [`init_numbered_fields`]
2021-12-27 21:02:15 +00:00
bors
44719b5834 Auto merge of #8175 - Kage-Yami:feature/document-8145, r=llogiq
Readme: note that config changes don't apply to already compiled code

*Please write a short comment explaining your change (or "none" for internal only changes)*

changelog: added a note to the Readme that config changes don't apply to already compiled code
2021-12-27 20:43:48 +00:00
bors
c749b2d393 Readme: note that config changes don't apply to already compiled code
*Please write a short comment explaining your change (or "none" for internal only changes)*

changelog: added a note to the Readme that config changes don't apply to already compiled code
2021-12-27 20:43:48 +00:00
Matthias Krüger
eab81297f7
Rollup merge of #92307 - hiroshi-maybe:fix-minor-typos, r=camelid
Fix minor typos
2021-12-27 21:42:30 +01:00
Matthias Krüger
052eab54ec
Rollup merge of #92303 - Patrick-Poitras:issue-26186, r=jackh726
Add test cases for issue #26186

Closes #26186

It seems that issue #26186 has been solved at some point since the issue has been last updated. I've merged together the examples that were supplied by `@Osspial,` `@Mark-Simulacrum,` `@Diggsey,` `@eefriedman` and `@shepmaster,` so that we can add this to the testing suite and prevent these issues from re-occurring.
2021-12-27 21:42:29 +01:00
Matthias Krüger
4d8ba2193f
Rollup merge of #92264 - Shadlock0133:patch-1, r=the8472
Remove `maybe_uninit_extra` feature from Vec docs

In `Vec`, two doc tests are using `MaybeUninit::write` , stabilized in 1.55. This makes docs' usage of `maybe_uninit_extra` feature unnecessary.
2021-12-27 21:42:28 +01:00
Matthias Krüger
a11414d62e
Rollup merge of #92161 - petrochenkov:misclean, r=cjgillot
resolve: Minor miscellaneous cleanups from #89059

`@bors` rollup=always
2021-12-27 21:42:27 +01:00
Matthias Krüger
a7c79c08d6
Rollup merge of #92147 - calebcartwright:publicize-builtin_macro-asm, r=cjgillot
rustc_builtin_macros: make asm mod public for rustfmt

Follow up to #92016, as I'd completely missed that the mod we needed was internal
2021-12-27 21:42:26 +01:00
Matthias Krüger
bd77fbfef1
Rollup merge of #92112 - SparrowLii:issue92010, r=cjgillot
Fix the error of checking `base_expr` twice in type_changing_struct_update

Fixes #92010
2021-12-27 21:42:25 +01:00