about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2021-04-25Auto merge of #84147 - cuviper:array-method-dispatch, r=nikomatsakis,m-ou-sebors-150/+118
Cautiously add IntoIterator for arrays by value Add the attribute described in #84133, `#[rustc_skip_array_during_method_dispatch]`, which effectively hides a trait from method dispatch when the receiver type is an array. Then cherry-pick `IntoIterator for [T; N]` from #65819 and gate it with that attribute. Arrays can now be used as `IntoIterator` normally, but `array.into_iter()` has edition-dependent behavior, returning `slice::Iter` for 2015 and 2018 editions, or `array::IntoIter` for 2021 and later. r? `@nikomatsakis` cc `@LukasKalbertodt` `@rust-lang/libs`
2021-04-25Auto merge of #80339 - jyn514:no-span, r=GuillaumeGomezbors-55/+80
Calculate `span` info on-demand - Add helper `attr_span` for common reused function - Stop storing `Span`s on `Item` directly; calculate them on demand instead - Special case modules, which have different spans depending on whether you use inner or outer attributes - Special case impls with fake IDs, which can have either dummy spans (for auto traits) or the DefId of the impl block (for blanket impls) - Use a fake ID for primitives instead of the ID of the crate; this lets `source()` know that it should use a dummy span instead of the span of the crate. This shrinks `Item` from 48 to 40 bytes. Helps with https://github.com/rust-lang/rust/issues/76382.
2021-04-24Finally (finally) ((finally!!!!)) fix spans for the standard libraryJoshua Nelson-1/+5
2021-04-24Get rid of `item.span`Joshua Nelson-36/+44
- Remove `span` field, adding `Item::span()` instead - Special-case `Impl` and `Module` items - Use dummy spans for primitive items
2021-04-24Do the hard part firstJoshua Nelson-20/+33
The only bit failing was the module, so change that before removing the `span` field.
2021-04-24Auto merge of #84310 - RalfJung:const-fn-feature-flags, r=oli-obkbors-48/+139
further split up const_fn feature flag This continues the work on splitting up `const_fn` into separate feature flags: * `const_fn_trait_bound` for `const fn` with trait bounds * `const_fn_unsize` for unsizing coercions in `const fn` (looks like only `dyn` unsizing is still guarded here) I don't know if there are even any things left that `const_fn` guards... at least libcore and liballoc do not need it any more. `@oli-obk` are you currently able to do reviews?
2021-04-24Add attr_span helper functionJoshua Nelson-17/+17
2021-04-24update rustc-perf version that is used for PGORalf Jung-1/+1
2021-04-24Auto merge of #84511 - davidhewitt:revert-84445, r=GuillaumeGomezbors-44/+6
Revert "rustdoc: Hide `#text` in doc-tests" See discussion in #84502 - I'm worried that #84445 may cause a lot of breakages if this were to hit stable, so I think it's safer to revert and work on the known correct fix #84478.
2021-04-24Auto merge of #84525 - JohnTitor:rollup-t2qigt3, r=JohnTitorbors-1746/+4858
Rollup of 8 pull requests Successful merges: - #83519 (Implement a lint that highlights all moves larger than a configured limit) - #84105 (stabilize `core::array::{from_ref,from_mut}` in `1.53.0`) - #84179 (Explicitly implement `!Send` and `!Sync` for `sys::{Args, Env}`) - #84427 (Update Clippy) - #84459 (rustdoc: Turn `JsonRenderer::mod_item_in` into `unreachable!()`) - #84460 (rustdoc: Remove unnecessary `is_crate` field from doctree::Module and clean::Module) - #84464 (rustdoc: Get rid of `clean::TypeKind`) - #84518 (Clean up DOM strings) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-04-25Rollup merge of #84518 - GuillaumeGomez:cleanup-up-dom-string, r=jshaYuki Okushi-4/+9
Clean up DOM strings Follow-up of #84320. r? ``@jsha``
2021-04-25Rollup merge of #84464 - jyn514:type-kind, r=CraftSpiderYuki Okushi-134/+93
rustdoc: Get rid of `clean::TypeKind` It does exactly the same thing as ItemType.
2021-04-25Rollup merge of #84460 - jyn514:doctree-is-crate, r=camelidYuki Okushi-42/+26
rustdoc: Remove unnecessary `is_crate` field from doctree::Module and clean::Module It can be calculated on-demand even without a TyCtxt. This also changed `json::conversions::from_item_kind` to take a whole item, which avoids having to add more and more parameters. Helps with https://github.com/rust-lang/rust/issues/76382. r? ```@camelid```
2021-04-25Rollup merge of #84459 - jyn514:json-mod, r=aDotInTheVoidYuki Okushi-15/+2
rustdoc: Turn `JsonRenderer::mod_item_in` into `unreachable!()` The JSON renderer no longer gets called on modules (since https://github.com/rust-lang/rust/pull/83055). r? ``@aDotInTheVoid``
2021-04-25Rollup merge of #84427 - flip1995:clippyup, r=ManishearthYuki Okushi-1551/+4649
Update Clippy r? ```@Manishearth``` Biweekly Clippy update.
2021-04-25Rollup merge of #83519 - oli-obk:assign_shrink_your_normal_code, r=pnkfelixYuki Okushi-0/+79
Implement a lint that highlights all moves larger than a configured limit Tracking issue: #83518 [MCP 420](https://github.com/rust-lang/compiler-team/issues/420) still ~blazing~ in progress r? ```@pnkfelix``` The main open issue I see with this minimal impl of the feature is that the lint is immediately "stable" (so it can be named on stable), even if it is never executed on stable. I don't think we have the concept of unstable lint names or hiding lint names without an active feature gate, so that would be a bigger change.
2021-04-24rustdoc: Turn `JsonRenderer::mod_item_in` into `unreachable!()`Joshua Nelson-15/+2
The JSON renderer no longer gets called on modules.
2021-04-24Auto merge of #84412 - ehuss:update-cargo, r=ehussbors-0/+0
Update cargo, rls ## cargo 18 commits in 65d57e6f384c2317f76626eac116f683e2b63665..0ed318d182e465cd66071b91ac3d265af63ef8a1 2021-04-04 15:07:52 +0000 to 2021-04-23 20:54:54 +0000 - Restore crates.io's `SourceId` hash value to before (rust-lang/cargo#9397) - Fix loading `branch=master` patches in the v3 lock transition (rust-lang/cargo#9392) - Update changelog for 1.52 beta changes. (rust-lang/cargo#9396) - Fix build-std updating the index on every build. (rust-lang/cargo#9393) - Fix typo in profile docs (rust-lang/cargo#9386) - Fix disagreement about lockfile ordering on stable/nightly (rust-lang/cargo#9384) - Don't give a hard error when the end-user specifies RUSTC_BOOTSTRAP=crate_name (rust-lang/cargo#9365) - Fix rust-lang/cargo#9350 (cargo build -Z help is missing options) (rust-lang/cargo#9369) - an struct -> a struct (rust-lang/cargo#9379) - Handle man pages better on Windows. (rust-lang/cargo#9378) - fix: better error message when dependency/workspace member missing (rust-lang/cargo#9368) - Fix typo in book (rust-lang/cargo#9376) - Don't re-use rustc cache when RUSTC_WRAPPER changes (rust-lang/cargo#9348) - doc: add split-debuginfo doc in config chapter (rust-lang/cargo#9372) - refactor: remove `CargoResultExt` (rust-lang/cargo#9367) - Track "CARGO" in environment fingerprint. (rust-lang/cargo#9363) - Update clippy lint allow set. (rust-lang/cargo#9356) - Fix 'suport' typo in documentation (rust-lang/cargo#9338) ## rls 3 commits in 32c0fe006dcdc13e1ca0ca31de543e4436c1299e..74d1800c25498689c5b5120a1e8495fce0cd0d0d 2021-04-12 11:21:12 +0000 to 2021-04-22 21:29:51 +0000 - Bump default integration test message timeout to 30s (rust-lang-nursery/rls#1731) - itertools = 0.9, fst = 0.4 (rust-lang-nursery/rls#1729) - Update cargo (rust-lang-nursery/rls#1728)
2021-04-24Clean up DOM stringsGuillaume Gomez-4/+9
2021-04-24Revert "rustdoc: Hide `#text` in doc-tests"David Hewitt-44/+6
This reverts commit af6c3201fc3d5ec2559836454ea4f43eec583fa2.
2021-04-24Rollup merge of #84496 - marmeladema:specialization-test, r=JohnTitorYuki Okushi-0/+91
Add some specialization tests Closes #33017 Closes #51892 r? `@JohnTitor`
2021-04-24Rollup merge of #84492 - jyn514:span, r=camelidYuki Okushi-3/+4
rustdoc: Remove unnecessary dummy span Follow-up to https://github.com/rust-lang/rust/pull/84460#discussion_r619447655. r? `@camelid`
2021-04-24Rollup merge of #84485 - marmeladema:trait-tests, r=jackh726Yuki Okushi-0/+81
Add some associated type bounds tests Closes #83017 Closes #81193 r? `@jackh726`
2021-04-24Rollup merge of #84458 - jyn514:cleanup-after-krate, r=GuillaumeGomezYuki Okushi-79/+39
Remove unnecessary fields and parameters in rustdoc r? `@GuillaumeGomez`
2021-04-24Rollup merge of #84320 - jsha:details-implementors, ↵Yuki Okushi-66/+68
r=Manishearth,Nemo157,GuillaumeGomez Use details tag for trait implementors. Part of #83332 and following on from #83337 and #83355. This removes one category of JS-generated toggles (implementors), and replaces them with a `<details>` tag. This simplifies the JS, and fixes some bugs where things that were supposed to be hidden by the toggle were not hidden. Compare https://hoffman-andrews.com/rust/details-implementors/std/io/trait.Read.html#impl-Read vs https://doc.rust-lang.org/nightly/std/io/trait.Read.html#implementors. This introduces a `left: -23px` to put the toggle in the correct place, matching the current style for `.collapse-toggle`. It's worth noting this introduces a slight behavior change: since the entire line is now a `<summary>`, any part of the line is clickable. So for instance, in `impl Read for File`, clicking `impl` or `for` will collapse / expand the docs. Clicking `Read` or `File` still links to the appropriate documentation as before.
2021-04-24Rollup merge of #84250 - jclulow:illumos-bash-bootstrap, r=Mark-SimulacrumYuki Okushi-1/+6
bootstrap: use bash on illumos to run install scripts The default illumos shell ("sh" in the default PATH) is ksh93, rather than bash, and does not support constructs like "local" that came from bash. The bootstrap function for invoking "install.sh" scripts should use "bash" explicitly there to avoid issues.
2021-04-23Auto merge of #83729 - JohnTitor:issue-43913, r=estebankbors-16/+53
Add a suggestion when using a type alias instead of trait alias Fixes #43913 r? `@estebank`
2021-04-23Update cargo, rlsEric Huss-0/+0
2021-04-23Add test for issue #51892marmeladema-0/+29
2021-04-23Add test for issue #33017marmeladema-0/+62
2021-04-23Auto merge of #84490 - JohnTitor:rollup-wrdj4ko, r=JohnTitorbors-31/+51
Rollup of 11 pull requests Successful merges: - #80805 (Improve `Iterator::by_ref` example) - #84248 (Remove duplicated fn(Box<[T]>) -> Vec<T>) - #84321 (rustdoc: Convert sub-variant toggle to HTML) - #84359 (:arrow_up: rust-analyzer) - #84374 (Clean up .gitignore) - #84387 (Move `sys_common::poison` to `sync::poison`) - #84430 (doc/platform-support: clarify UEFI support) - #84433 (Prevent control, shift and alt keys to make search input lose focus) - #84444 (doc: Get rid of "[+] show undocumented items" toggle on numeric From impls) - #84456 (Fix ICE if original_span(fn_sig) returns a span not in body sourcefile) - #84469 (Update comment on `PrimTy::name_str`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-04-23Fix macro bug in `impl From<DefKind> for ItemType`Joshua Nelson-1/+5
This was missed a while ago when support for proc-macro attributes was first added.
2021-04-23Don't repeat `hir::def::DefKind` so muchJoshua Nelson-33/+33
2021-04-23Remove unused `impl Clean<ItemType> for DefKind`Joshua Nelson-6/+0
2021-04-23Remove `TypeKind`Joshua Nelson-53/+0
2021-04-23Use ItemType in cacheJoshua Nelson-32/+11
2021-04-23Take ItemType instead of TypeKind in record_extern_fqnJoshua Nelson-49/+84
2021-04-23rustdoc: Remove unnecessary dummy spanJoshua Nelson-3/+4
2021-04-23rustdoc: Remove unnecessary `is_crate` field from doctree::Module and ↵Joshua Nelson-42/+26
clean::Module It can be calculated on-demand even without a TyCtxt. This also changed `from_item_kind` to take a whole item, which avoids having to add more and more parameters.
2021-04-24Rollup merge of #84433 - GuillaumeGomez:search-input-blur, r=jshaYuki Okushi-3/+6
Prevent control, shift and alt keys to make search input lose focus Part of #84384. r? ````@jsha````
2021-04-24Rollup merge of #84430 - dvdhrm:rw/uefidoc, r=AmanieuYuki Okushi-2/+2
doc/platform-support: clarify UEFI support Add missing information on what standard-library features are supported by the UEFI targets. All current UEFI targets (which is i686 and x86_64) only support no_std cross-compilations. `std` support has not been worked on and is unlikely to emerge anytime soon, due to the much restricted environment that UEFI provides.
2021-04-24Rollup merge of #84359 - lnicola:rust-analyzer-2021-04-20, r=jonas-schievinkYuki Okushi-18/+17
:arrow_up: rust-analyzer
2021-04-24Rollup merge of #84321 - Swatinem:subvariant-details, r=GuillaumeGomezYuki Okushi-8/+26
rustdoc: Convert sub-variant toggle to HTML Instead of creating a JS toggle, this injects details/summary for sub-variants of enums. This also fixes the CSS so that the toggle button does not jump when expanding/collapsing. Takes inspiration from #83337 and should be considered part of #83332. Not quite sure if the `.sub-variant` selectors could be further simplified? AFAICS it is only used in that place, and that does not seem to allow any recursion.
2021-04-23Auto merge of #84339 - alexcrichton:llvm-fptoint-sat, r=nagisabors-173/+12
rustc: Use LLVM's new saturating float-to-int intrinsics This commit updates rustc, with an applicable LLVM version, to use LLVM's new `llvm.fpto{u,s}i.sat.*.*` intrinsics to implement saturating floating-point-to-int conversions. This results in a little bit tighter codegen for x86/x86_64, but the main purpose of this is to prepare for upcoming changes to the WebAssembly backend in LLVM where wasm's saturating float-to-int instructions will now be implemented with these intrinsics. This change allows simplifying a good deal of surrounding code, namely removing a lot of wasm-specific behavior. WebAssembly no longer has any special-casing of saturating arithmetic instructions and the need for `fptoint_may_trap` is gone and all handling code for that is now removed. This means that the only wasm-specific logic is in the `fpto{s,u}i` instructions which only get used for "out of bounds is undefined behavior". This does mean that for the WebAssembly target specifically the Rust compiler will no longer be 100% compatible with pre-LLVM 12 versions, but it seems like that's unlikely to be relied on by too many folks. Note that this change does immediately regress the codegen of saturating float-to-int casts on WebAssembly due to the specialization of the LLVM intrinsic not being present in our LLVM fork just yet. I'll be following up with an LLVM update to pull in those patches, but affects a few other SIMD things in flight for WebAssembly so I wanted to separate this change. Eventually the entire `cast_float_to_int` function can be removed when LLVM 12 is the minimum version, but that will require sinking the complexity of it into other backends such as Cranelfit.
2021-04-23Add test for issue #81193marmeladema-0/+15
2021-04-23Add test for issue #83017marmeladema-0/+66
2021-04-23improve wordingArpad Borsos-2/+8
2021-04-23Update wasm test assertionsAlex Crichton-173/+12
2021-04-23Auto merge of #84457 - jyn514:cleanup-crate, r=GuillaumeGomezbors-132/+150
rustdoc: Remove most fields from ExternalCrate Once https://github.com/rust-lang/rust/issues/84304 is fixed, I can get rid of ExternCrate altogether in favor of CrateNum, but in the meantime, this shrinks ExternalCrate quite a lot. This might hurt compile-times; if it does, I can add `primitive` and `keyword` queries. I expect this to improve compilemem. Helps with https://github.com/rust-lang/rust/issues/76382. r? GuillaumeGomez
2021-04-23Auto merge of #84445 - jyn514:hidden, r=<try>bors-6/+44
rustdoc: Hide `#text` in doc-tests Since `#![attr]` and `#[attr]` are the only valid syntax that start with `#`, we can just special case those two tokens. Fixes https://github.com/rust-lang/rust/issues/83284.