about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2022-09-29Rollup merge of #102393 - Rageking8:add-regression-test-for-issue-94923, ↵Yuki Okushi-0/+49
r=JohnTitor Add regression test for issue 94923 Fixes #94923
2022-09-29Rollup merge of #102368 - beetrees:nano-niche, r=joshtriplettYuki Okushi-2/+2
Add a niche to `Duration`, unix `SystemTime`, and non-apple `Instant` As the nanoseconds fields is always between `0` and `(NANOS_PER_SEC - 1)` inclusive, use the `rustc_layout_scalar_valid_range` attributes to create a niche in the nanosecond field of `Duration` and `Timespec` (which is used to implement unix `SystemTime` and non-apple unix `Instant`; windows `Instant` is implemented with `Duration` and therefore will also benefit). This change has the benefit of making `Option<T>` the same size as `T` for the previously mentioned types. Also shrinks the nanoseconds field of `Timespec` to a `u32` as nanoseconds do not need the extra range of an `i64`, shrinking `Timespec` by 4 bytes on 32-bit platforms. r? ```@joshtriplett```
2022-09-29Rollup merge of #102351 - Rageking8:improve-E0585, r=wesleywiserYuki Okushi-19/+19
Improve E0585 help
2022-09-29Rollup merge of #98368 - sunfishcode:sunfishcode/std-os-fd, r=joshtriplettYuki Okushi-3/+3
Make `std::os::fd` public. `std::os::fd` defines types like `OwnedFd` and `RawFd` and is common between Unix and non-Unix platforms that share a basic file-descriptor concept. Rust currently uses this internally to simplify its own code, but it would be useful for external users in the same way, so make it public. This means that `OwnedFd` etc. will all appear in three places, for example on unix platforms: - `std::os::fd::OwnedFd` - `std::os::unix::io::OwnedFd` - `std::os::unix::prelude::OwnedFd` r? `````@joshtriplett`````
2022-09-28Auto merge of #102384 - camelid:extrainfo, r=GuillaumeGomezbors-31/+20
rustdoc: Remove `clean::TraitWithExtraInfo` and queryify `is_notable_trait` cc `@notriddle` `@GuillaumeGomez`
2022-09-28Auto merge of #100719 - CohenArthur:rust-safe-intrinsic-attribute, r=wesleywiserbors-4/+46
Add `#[rustc_safe_intrinsic]` This PR adds the `#[rustc_safe_intrinsic]` attribute as mentionned on Zulip. The goal of this attribute is to avoid keeping a list of symbols as the source for stable intrinsics, and instead rely on an attribute. This is similar to `#[rustc_const_stable]` and `#[rustc_const_unstable]`, which among other things, are used to mark the constness of intrinsic functions.
2022-09-28Add a niche to `Duration`, unix `SystemTime`, and non-apple `Instant`beetrees-2/+2
2022-09-29improve E0585 helpRageking8-19/+19
2022-09-28Auto merge of #101454 - cjgillot:concat-binders, r=estebankbors-6/+67
Do not overwrite lifetime binders for another HirId. This PR makes higher-ranked bounds in where clauses a bit more principled. We used to conflate `for<'a> T: Trait` with `(for<'a> T): Trait`. This PR separates both binders. This caused issued with fn types, which have their own binder, causing us to overwrite the predicates's binders with `fn`'s binders, ICEing. Fixes https://github.com/rust-lang/rust/issues/98594
2022-09-28Auto merge of #101619 - Xiretza:rustc_parse-session-diagnostics, r=davidtwcobors-25/+39
Migrate more of rustc_parse to SessionDiagnostic Still far from complete, but I thought I'd add a checkpoint here because rebasing was starting to get annoying.
2022-09-28add regression testRageking8-0/+49
2022-09-28Auto merge of #102302 - nnethercote:more-lexer-improvements, r=matkladbors-3/+6
More lexer improvements A follow-up to #99884. r? `@matklad`
2022-09-28rustc_safe_intrinsic: Add UI testArthur Cohen-0/+25
2022-09-28Auto merge of #102388 - JohnTitor:rollup-mbyw6fl, r=JohnTitorbors-26/+386
Rollup of 8 pull requests Successful merges: - #100747 (Add long description and test for E0311) - #102232 (Stabilize bench_black_box) - #102288 (Suggest unwrapping `???<T>` if a method cannot be found on it but is present on `T`.) - #102338 (Deny associated type bindings within associated type bindings) - #102347 (Unescaping cleanups) - #102348 (Tweak `FulfillProcessor`.) - #102378 (Use already resolved `self_ty` in `confirm_fn_pointer_candidate`) - #102380 (rustdoc: remove redundant mobile `.source > .sidebar` CSS) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-09-28Rollup merge of #102380 - notriddle:notriddle/rustdoc-source-sidebar, r=camelidYuki Okushi-3/+0
rustdoc: remove redundant mobile `.source > .sidebar` CSS When the source sidebar and standard sidebar had most of their code merged in 07e3f998b1ceb4b8d2a7992782e60f5e776aa114, the properties `z-index: 11`, `margin: 0`, and `position: fixed` were already being set on the `.sidebar` class, so no need to repeat them. https://github.com/rust-lang/rust/blob/57ee5cf5a93923dae9c98bffb11545fc3a31368d/src/librustdoc/html/static/css/rustdoc.css#L1742-L1754
2022-09-28Rollup merge of #102378 - compiler-errors:issue-102289, r=jackh726Yuki Okushi-0/+54
Use already resolved `self_ty` in `confirm_fn_pointer_candidate` Fixes #102289
2022-09-28Rollup merge of #102338 - ↵Yuki Okushi-2/+73
compiler-errors:assoc-ty-binding-in-assoc-ty-binding, r=cjgillot Deny associated type bindings within associated type bindings Fixes #102335 This was made worse by #100865, which unified the way we generate substs for GATs and non-generic associated types. However, the issue was not _caused_ by #100865, evidenced by the test I added for GATs: ```rust trait T { type A: S<C<(), i32 = ()> = ()>; //~^ ERROR associated type bindings are not allowed here } trait Q {} trait S { type C<T>: Q; } fn main() {} ``` ^ which passes on beta (where GATs are stable) and presumably ever since GATs support was added to `create_substs_for_associated_item` in astconv.
2022-09-28Rollup merge of #102288 - mejrs:inner, r=compiler-errorsYuki Okushi-0/+218
Suggest unwrapping `???<T>` if a method cannot be found on it but is present on `T`. This suggests various ways to get inside wrapper types if the method cannot be found on the wrapper type, but is present on the wrappee. For this PR, those wrapper types include `Localkey`, `MaybeUninit`, `RefCell`, `RwLock` and `Mutex`.
2022-09-28Rollup merge of #102232 - Urgau:stabilize-bench_black_box, r=TaKO8KiYuki Okushi-20/+5
Stabilize bench_black_box This PR stabilize `feature(bench_black_box)`. ```rust pub fn black_box<T>(dummy: T) -> T; ``` The FCP was completed in https://github.com/rust-lang/rust/issues/64102. `@rustbot` label +T-libs-api -T-libs
2022-09-28Rollup merge of #100747 - ↵Yuki Okushi-1/+36
MatthewPeterKelly:mpk/add-long-error-message-for-E0311, r=MatthewPeterKelly Add long description and test for E0311 Adds a long description and unit test for the E0311 compiler error. Fixes one line-item in https://github.com/rust-lang/rust/issues/61137.
2022-09-28Auto merge of #100996 - m-ou-se:format-args-2, r=estebankbors-229/+202
Rewrite and refactor format_args!() builtin macro. This is a near complete rewrite of `compiler/rustc_builtin_macros/src/format.rs`. This gets rid of the massive unmaintanable [`Context` struct](https://github.com/rust-lang/rust/blob/76531befc4b0352247ada67bd225e8cf71ee5686/compiler/rustc_builtin_macros/src/format.rs#L176-L263), and splits the macro expansion into three parts: 1. First, `parse_args` will parse the `(literal, arg, arg, name=arg, name=arg)` syntax, but doesn't parse the template (the literal) itself. 2. Second, `make_format_args` will parse the template, the format options, resolve argument references, produce diagnostics, and turn the whole thing into a `FormatArgs` structure. 3. Finally, `expand_parsed_format_args` will turn that `FormatArgs` structure into the expression that the macro expands to. In other words, the `format_args` builtin macro used to be a hard-to-maintain 'single pass compiler', which I've split into a three phase compiler with a parser/tokenizer (step 1), semantic analysis (step 2), and backend (step 3). (It's compilers all the way down. ^^) This can serve as a great starting point for https://github.com/rust-lang/rust/issues/99012, which will only need to change the implementation of 3, while leaving step 1 and 2 unchanged. It also makes https://github.com/rust-lang/compiler-team/issues/541 easier, which could then upgrade the new `FormatArgs` struct to an `ast` node and remove step 3, moving that step to later in the compilation process. It also fixes a few diagnostics bugs. This also [significantly reduces](https://gist.github.com/m-ou-se/b67b2d54172c4837a5ab1b26fa3e5284) the amount of generated code for cases with arguments in non-default order without formatting options, like `"{1} {0}"` or `"{a} {}"`, etc.
2022-09-28Address review comments.Nicholas Nethercote-1/+1
2022-09-27rustdoc: Queryify `is_notable_trait`Noah Lev-2/+2
This might help with #102375.
2022-09-28Deduplicate some logicmejrs-15/+15
2022-09-27Auto merge of #102377 - matthiaskrgr:rollup-1zvj50t, r=matthiaskrgrbors-149/+444
Rollup of 9 pull requests Successful merges: - #101555 (Stabilize `#![feature(mixed_integer_ops)]`) - #102253 (rustdoc: use CSS containment to speed up render) - #102281 (make invalid_value lint a bit smarter around enums) - #102284 (Structured suggestion for missing `mut`/`const` in raw pointer) - #102330 (rustdoc: remove no-op CSS `.srclink { font-weight; font-size }`) - #102337 (Avoid LLVM-deprecated `Optional::hasValue`) - #102356 (session: remove now-unnecessary lint `#[allow]`s) - #102367 (rustdoc: remove redundant `#help-button` CSS) - #102369 (Fix search result colors) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-09-27rustdoc: remove redundant mobile `.source > .sidebar` CSSMichael Howell-3/+0
When the source sidebar and standard sidebar had most of their code merged in 07e3f998b1ceb4b8d2a7992782e60f5e776aa114, the properties `z-index: 11`, `margin: 0`, and `position: fixed` were already being set on the `.sidebar` class, so no need to repeat them.
2022-09-27Add newlinemejrs-3/+3
2022-09-27Use already resolved self_ty in confirm_fn_pointer_candidateMichael Goulet-0/+54
2022-09-27Rollup merge of #102369 - GuillaumeGomez:results-colors, r=notriddleMatthias Krüger-5/+155
Fix search result colors Fixes regression introduced in https://github.com/rust-lang/rust/commit/99c00714cff0d13b6c5092c9949cb4e93a121346. As you can see, ayu lost some colors for its search results: beta/nightly: ![Screenshot from 2022-09-27 19-46-49](https://user-images.githubusercontent.com/3050060/192606456-e7bb58dd-cf76-49a0-b1ae-28565adb1dc6.png) stable: ![Screenshot from 2022-09-27 19-46-36](https://user-images.githubusercontent.com/3050060/192606453-e720e219-a336-4ff1-989b-2fdb76e789eb.png) We'll need to backport it to beta too to prevent it reaching stable. r? `@notriddle`
2022-09-27Rollup merge of #102367 - notriddle:notriddle/help-text-align, r=GuillaumeGomezMatthias Krüger-5/+0
rustdoc: remove redundant `#help-button` CSS When the separate top and bottom styles were added in cd3f4da244578a2ab4d17d10016c61b9191b21e4, some of the CSS rules were needlessly duplicated. The `text-align: initial` rule on `.side-by-side` was always redundant, since the rules that centered the text were set on children, not parents.
2022-09-27Rollup merge of #102330 - notriddle:notriddle/srclink, r=GuillaumeGomezMatthias Krüger-7/+0
rustdoc: remove no-op CSS `.srclink { font-weight; font-size }` When this CSS was added in 34bd2b845b3acd84c5a9bddae3ff8081c19ec5e9, source links were nested below headers. https://github.com/rust-lang/rust/blob/34bd2b845b3acd84c5a9bddae3ff8081c19ec5e9/src/librustdoc/html/render.rs#L4015-L4019 Now, thanks to 458e7219bc2a62f72368279945cfda632a016da1, they are now siblings of headers, and thanks to 270d09dca9aae263671c4d32bbc7cb60dc378af8, they have the same font size that they would've had anyway.
2022-09-27Rollup merge of #102284 - compiler-errors:missing-type-in-raw-ptr, r=davidtwcoMatthias Krüger-4/+31
Structured suggestion for missing `mut`/`const` in raw pointer Fixes #102261
2022-09-27Rollup merge of #102281 - RalfJung:invalid-enums, r=cjgillotMatthias Krüger-112/+226
make invalid_value lint a bit smarter around enums Fixes https://github.com/rust-lang/rust/issues/102043
2022-09-27Address feedbackmejrs-12/+64
2022-09-27Wrapper suggestionsmejrs-0/+166
2022-09-27rustdoc: remove `clean::TraitWithExtraInfo`Michael Howell-32/+21
Instead, it gathers the extra info later, when it's actually requested.
2022-09-27Bless stats.Camille GILLOT-6/+6
2022-09-27Rework "inner attribute not permitted" errorsXiretza-1/+1
2022-09-27Migrate more rustc_parse diagnostics to diagnostic structsXiretza-4/+4
2022-09-27Migrate "invalid literal suffix" diagnostic to diagnostic structsXiretza-18/+18
2022-09-27Migrate more diagnostics in rustc_parse to diagnostic structsXiretza-2/+2
2022-09-27Allow raw identifiers to be used as fluent argumentsXiretza-0/+14
2022-09-27Add GUI regression test for search results colorsGuillaume Gomez-4/+152
2022-09-27Fix regression for results colorsGuillaume Gomez-1/+3
2022-09-27rustdoc: remove redundant `#help-button` CSSMichael Howell-5/+0
When the separate top and bottom styles were added in cd3f4da244578a2ab4d17d10016c61b9191b21e4, some of the CSS rules were needlessly duplicated. The `text-align: initial` rule on `.side-by-side` was always redundant, since the rules that centered the text were set on children, not parents.
2022-09-27Update src/test/rustdoc-gui/sidebar-mobile-scroll.gomlJacob Hoffman-Andrews-3/+3
Co-authored-by: Michael Howell <michael@notriddle.com>
2022-09-27Deny associated type bindings within associated type bindingsMichael Goulet-2/+73
2022-09-27Do not overwrite binders for another HirId.Camille GILLOT-0/+61
2022-09-27Update cargoWeihang Lo-0/+0
22 commits in 73ba3f35e0205844418260722c11602113179c4a..f5fed93ba24607980647962c59863bbabb03ce14 2022-09-18 06:38:16 +0000 to 2022-09-27 12:03:57 +0000 - build-scripts.md: Use em dash consistently. (rust-lang/cargo#11150) - Indicate how Cargo locates the manifest (rust-lang/cargo#10770) - Reduce references to `[project]` within cargo (rust-lang/cargo#11135) - Iteratively construct target cfg (rust-lang/cargo#11114) - update comment about `CARGO_BIN_EXE_` (rust-lang/cargo#11146) - Call out that not all config values can be set via env vars (rust-lang/cargo#11139) - Bump to 0.67.0, update changelog (rust-lang/cargo#11137) - ci: update toolchain for building api doc (rust-lang/cargo#11134) - Http publish not noop (rust-lang/cargo#11111) - Improve errors for TOML fields that support workspace inheritance (rust-lang/cargo#11113) - switch to `std::task::ready!()` where possible (rust-lang/cargo#11130) - Report cmd aliasing failure with more contexts (rust-lang/cargo#11087) - minor: remove unused mut (rust-lang/cargo#11127) - fix(cli): Forward non-UTF8 arguments to external subcommands (rust-lang/cargo#11118) - This change adds an example to the authors attribute in the manifest. (rust-lang/cargo#10938) - Add support for relative git submodule paths (rust-lang/cargo#11106) - make unknown features on `cargo add` more discoverable (rust-lang/cargo#11098) - Unlink old final artifacts before compilation (rust-lang/cargo#11122) - refactor(cli): Prepare for clap v4 (rust-lang/cargo#11116) - fix(cli): Error trailing args rather than ignore (rust-lang/cargo#11119) - Add a minor clarification (rust-lang/cargo#11093) - doc(changelog): mention CVE fixes (rust-lang/cargo#11104)
2022-09-27rustdoc: use CSS containment to speed up renderJacob Hoffman-Andrews-16/+32
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Containment This affected layout a little and required adjustments to the CSS to keep spacing the same. In particular, the margins of adjacent items usually overlap with each other. However, when an item has contain: layout, any margins of child nodes push out the size of the item itself. This was making spacing between items a little too big. To solve that, I removed margins in some places: in particular for certain classes that often occur at the end of a `details.rustdoc-toggle` block, I removed their bottom margin. Generally, the margins provided by the next item down are sufficient. Also remove an unnecessary margin-top on .code-header.