about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2022-12-14rustdoc: remove unnecessary CSS `kbd { cursor: default }`Michael Howell-2/+0
Added along with theme picker changes in e78f1392b79779fa184f9a63e7be04ac7074a1c2, but no reason seems to have been given at the time for why this particular rule was added. Removing this rule results in `<kbd>` elements getting an I-bar, while the rule causes them to use the "default" arrow, but since selecting the text in these elements works fine, the I-bar is not misleading.
2022-12-14Auto merge of #105690 - matthiaskrgr:rollup-khtq97k, r=matthiaskrgrbors-11/+35
Rollup of 6 pull requests Successful merges: - #105642 (Minor grammar nit.) - #105658 (Remove ..X from RELEASES.md) - #105663 (Adjust log line in `fuchsia-test-runner.py`) - #105664 (rustdoc: apply `pre-wrap` CSS to code-wrapped links) - #105665 (rustdoc: simplify popover CSS) - #105676 (rustdoc: add CSS margin between `impl` docblock and its items) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-14Rollup merge of #105676 - notriddle:notriddle/impl-docblock, r=GuillaumeGomezMatthias Krüger-0/+18
rustdoc: add CSS margin between `impl` docblock and its items ## Before ![image](https://user-images.githubusercontent.com/1593513/207471025-c27c298b-4d48-461b-918b-a965b09db4f1.png) ## After ![image](https://user-images.githubusercontent.com/1593513/207471759-1bbabf71-0932-441c-b044-ad0e392ba552.png)
2022-12-14Rollup merge of #105665 - notriddle:notriddle/popover-css-merge, ↵Matthias Krüger-6/+3
r=GuillaumeGomez rustdoc: simplify popover CSS * Merge the color-changing block into the regular rules, which was probably written that way because it used to be in the theme files, but has no reason to be written this way now that it's in rustdoc.css * Get rid of redundant `display: block`, since `position: absolute` blockifies the layout anyway.
2022-12-14Rollup merge of #105664 - notriddle:notriddle/linkwrap, r=GuillaumeGomezMatthias Krüger-2/+11
rustdoc: apply `pre-wrap` CSS to code-wrapped links This is common syntax used for intra-doc links, so fixing it should help with doc formatting.
2022-12-14Rollup merge of #105663 - andrewpollack:patch-1, r=tmandryMatthias Krüger-1/+1
Adjust log line in `fuchsia-test-runner.py` * Adjusting log line in `fuchsia-test-runner.py` to refer to self r? ``@tmandry``
2022-12-14Rollup merge of #105658 - tronta:patch-2, r=Mark-SimulacrumMatthias Krüger-1/+1
Remove ..X from RELEASES.md this is not yet supported: ..X => https://github.com/rust-lang/rust/issues/37854 is still open
2022-12-14Rollup merge of #105642 - uberFoo:master, r=Dylan-DPCMatthias Krüger-1/+1
Minor grammar nit. I was browsing the documentation and noticed that this should be an adverb.
2022-12-14Auto merge of #105686 - matthiaskrgr:rollup-bedfk3j, r=matthiaskrgrbors-189/+637
Rollup of 7 pull requests Successful merges: - #103644 (Add docs for question mark operator for Option) - #105161 (Refine when invalid prefix case error arises) - #105491 (Illegal sized bounds: only suggest mutability change if needed) - #105502 (Suggest impl in the scenario of typo with fn) - #105523 (Suggest `collect`ing into `Vec<_>`) - #105595 (Suggest dereferencing receiver arguments properly) - #105611 (fold instead of obliterating args) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-14Rollup merge of #105611 - BoxyUwU:more_granular_placeholderification, ↵Matthias Krüger-15/+67
r=wesleywiser fold instead of obliterating args Fixes #105608 we call `const_eval_resolve` on the following constant: ``` def: playground::{impl#0}::and::{constant#0}, substs: [ ConstKind::Unevaluated { def: playground::{impl#0}::and::{constant#0}, substs: [ ConstKind::Value(0x0), _, ] } _, ], ``` when expanded out to `ConstKind::Expr` there are no infer vars so we attempt to evaluate it after replacing infer vars with garbage, however the current logic for replacing with garbage replaces _the whole arg containing the infer var_ rather than just the infer var. This means that after garbage replacement has occured we attempt to evaluate: ``` def: playground::{impl#0}::and::{constant#0}, substs: [ PLACEHOLDER, PLACEHOLDER, ], ``` Which then leads to ctfe being unable to evaluate the const. With this PR we attempt to evaluate: ``` def: playground::{impl#0}::and::{constant#0}, substs: [ ConstKind::Unevaluated { def: playground::{impl#0}::and::{constant#0}, substs: [ ConstKind::Value(0x0), PLACEHOLDER, ] } PLACEHOLDER, ], ``` which ctfe _can_ handle. I am not entirely sure why this function is supposed to replace params with placeholders rather than just inference vars :thinking:
2022-12-14Rollup merge of #105595 - TaKO8Ki:suggest-dereferencing-receiver-argument, ↵Matthias Krüger-6/+71
r=compiler-errors Suggest dereferencing receiver arguments properly Fixes #105429
2022-12-14Rollup merge of #105523 - estebank:suggest-collect-vec, r=compiler-errorsMatthias Krüger-151/+168
Suggest `collect`ing into `Vec<_>` Fix #105510.
2022-12-14Rollup merge of #105502 - chenyukang:yukang/fix-105366-impl, r=estebankMatthias Krüger-2/+66
Suggest impl in the scenario of typo with fn Fixes #105366
2022-12-14Rollup merge of #105491 - sulami:master, r=compiler-errorsMatthias Krüger-1/+111
Illegal sized bounds: only suggest mutability change if needed In a scenario like ```rust struct Type; pub trait Trait { fn function(&mut self) where Self: Sized; } impl Trait for Type { fn function(&mut self) {} } fn main() { (&mut Type as &mut dyn Trait).function(); } ``` the problem is Sized, not the mutability of self. Thus don't emit the "you need &T instead of &mut T" note, or the other way around, as all it does is just invert the mutability of whatever was supplied. Fixes #103622.
2022-12-14Rollup merge of #105161 - cassaundra:numeric-literal-error, r=nnethercoteMatthias Krüger-10/+107
Refine when invalid prefix case error arises Fix cases where the "invalid base prefix for number literal" error arises with suffixes that look erroneously capitalized but which are actually invalid.
2022-12-14Rollup merge of #103644 - catlee:catlee/option-question-mark-docs, ↵Matthias Krüger-4/+47
r=workingjubilee Add docs for question mark operator for Option As a beginner learning rust, it took me a while to figure out what `?` was doing with Options. I think the documentation of this could be improved. I've used the question mark documentation from the `Result` type as a template here, and tried to come up with a simple example as well.
2022-12-14Auto merge of #105221 - alex:fat-archive-cleanup, r=bjorn3bors-46/+38
Avoid a temporary file when processing macOS fat archives r? `@bjorn3`
2022-12-14Auto merge of #104875 - chenyukang:yukang/fix-104867-inc, r=estebankbors-65/+386
Properly handle postfix inc/dec in standalone and subexpr scenarios Fixes #104867 r? `@estebank`
2022-12-14Auto merge of #104986 - compiler-errors:opaques, r=oli-obkbors-674/+632
Combine `ty::Projection` and `ty::Opaque` into `ty::Alias` Implements https://github.com/rust-lang/types-team/issues/79. This PR consolidates `ty::Projection` and `ty::Opaque` into a single `ty::Alias`, with an `AliasKind` and `AliasTy` type (renamed from `ty::ProjectionTy`, which is the inner data of `ty::Projection`) defined as so: ``` enum AliasKind { Projection, Opaque, } struct AliasTy<'tcx> { def_id: DefId, substs: SubstsRef<'tcx>, } ``` Since we don't have access to `TyCtxt` in type flags computation, and because repeatedly calling `DefKind` on the def-id is expensive, these two types are distinguished with `ty::AliasKind`, conveniently glob-imported into `ty::{Projection, Opaque}`. For example: ```diff match ty.kind() { - ty::Opaque(..) => + ty::Alias(ty::Opaque, ..) => {} _ => {} } ``` This PR also consolidates match arms that treated `ty::Opaque` and `ty::Projection` identically. r? `@ghost`
2022-12-13rustdoc: add CSS margin between `impl` docblock and its itemsMichael Howell-0/+18
2022-12-13Auto merge of #105667 - matthiaskrgr:rollup-fexlc0b, r=matthiaskrgrbors-3397/+3398
Rollup of 7 pull requests Successful merges: - #105147 (Allow unsafe through inline const) - #105438 (Move some codegen-y methods from `rustc_hir_analysis::collect` -> `rustc_codegen_ssa`) - #105464 (Support #[track_caller] on async closures) - #105476 (Change pattern borrowing suggestions to be verbose and remove invalid suggestion) - #105500 (Make some diagnostics not depend on the source of what they reference being available) - #105628 (Small doc fixes) - #105659 (Don't require owned data in `MaybeStorageLive`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-13rename argumentEsteban Küber-2/+6
2022-12-13Improve wording for Option and ResultChris AtLee-8/+6
2022-12-13Add docs for question mark operator for OptionChris AtLee-0/+45
2022-12-13review commentsEsteban Küber-98/+96
2022-12-13Rollup merge of #105659 - JakobDegen:storage-live-borrow, r=davidtwcoMatthias Krüger-9/+10
Don't require owned data in `MaybeStorageLive` Small improvement that avoids a clone. I don't expect this to have any noticeable perf effects, but better to have it than not to. r? ``@tmiasko``
2022-12-13Rollup merge of #105628 - spastorino:small-doc-fixes, r=compiler-errorsMatthias Krüger-10/+7
Small doc fixes r? `@compiler-errors`
2022-12-13Rollup merge of #105500 - oli-obk:unhide_unknown_spans, r=estebankMatthias Krüger-1666/+381
Make some diagnostics not depend on the source of what they reference being available r? `@estebank` follow up to https://github.com/rust-lang/rust/pull/104449
2022-12-13Rollup merge of #105476 - estebank:moves-n-borrows, r=compiler-errorsMatthias Krüger-816/+1842
Change pattern borrowing suggestions to be verbose and remove invalid suggestion Synthesize a more accurate span and use verbose suggestion output to make the message clearer. Do not suggest borrowing binding in pattern in let else. Fix #104838.
2022-12-13Rollup merge of #105464 - nbdd0121:hir, r=compiler-errorsMatthias Krüger-49/+124
Support #[track_caller] on async closures Follow up on #105180 r? ```@compiler-errors``` cc ```@cjgillot```
2022-12-13Rollup merge of #105438 - compiler-errors:move-methods, r=estebankMatthias Krüger-828/+857
Move some codegen-y methods from `rustc_hir_analysis::collect` -> `rustc_codegen_ssa` Unclear if they should live here, but they seem codegen-y enough, and `rustc_hir_analysis::collect` is extremely long, so it should probably lose some methods.
2022-12-13Rollup merge of #105147 - nbdd0121:inline_const_unsafe, r=oli-obkMatthias Krüger-19/+177
Allow unsafe through inline const Handle similar to closures. Address https://github.com/rust-lang/rust/pull/104087#issuecomment-1324173328 Note that this PR does not fix the issue for `unsafe { [0; function_requiring_unsafe()] }`. This is fundamentally unfixable for MIR unsafeck IMO. This PR also does not fix unsafety checking for inline const in pattern position. It actually breaks it, allowing unsafe functions to be used in inline const in pattern position without unsafe blocks. Inline const in pattern position is not visible in MIR so ignored by MIR unsafety checking (currently it is also not checked by borrow checker, which is the reason why it's considered an incomplete feature). `@rustbot` label: +T-lang +F-inline_const
2022-12-14suggest dereferencing receiver arguments properlyTakayuki Maeda-6/+71
fix a stderr
2022-12-13Auto merge of #102813 - ↵bors-14/+137
Akida31:issue-64915/simpler_diagnostic_when_passing_arg_to_closure_and_missing_borrow, r=estebank Simpler diagnostic when passing arg to closure and missing borrow fixes #64915 I followed roughly the instructions and the older PR #76362. The number of references for the expected and the found types will be compared and depending on which has more the diagnostic will be emitted. I'm not quite sure if my approach with the many `span_bug!`s is good, it could lead to some ICEs. Would it be better if those errors are ignored? As far as I know the following code works similarly but in a different context. Is this probably reusable since it looks like it would emit better diagnostics? https://github.com/rust-lang/rust/blob/a688a0305fad9219505a8f2576446510601bafe8/compiler/rustc_hir_analysis/src/check/demand.rs#L713-L1061 When running the tests locally, a codegen test failed. Is there something I can/ should do about that? If you have some improvements/ corrections please say so and I will happily include them. r? `@estebank` (as you added the mentoring instructions to the issue)
2022-12-13Suggest `: Type` instead of `: _`Esteban Küber-75/+79
2022-12-13Mention implementations that satisfy the traitEsteban Küber-3/+40
2022-12-13Remove unnecessary code and account for turbofish suggestionEsteban Küber-87/+43
Remove previously existing fallback that tried to give a good turbofish suggestion, `need_type_info` is already good enough. Special case `::<Vec<_>` suggestion for `Iterator::collect`.
2022-12-13Suggest `collect`ing into `Vec<_>`Esteban Küber-31/+49
2022-12-13Account for dereference expressionsEsteban Küber-140/+208
2022-12-13Fix span for `&mut ` removal suggestionEsteban Küber-29/+30
2022-12-13Suggest `ref` for some patterns as a fallbackEsteban Küber-63/+476
2022-12-13Do not suggest borrowing binding in pattern in let elseEsteban Küber-14/+15
Fix #104838.
2022-12-13Change pattern borrowing suggestions to be verboseEsteban Küber-766/+1309
Synthesize a more accurate span and use verbose suggestion output to make the message clearer.
2022-12-13rustdoc: simplify popover CSSMichael Howell-6/+3
* Merge the color-changing block into the regular rules, which was probably written that way because it used to be in the theme files, but has no reason to be written this way now that it's in rustdoc.css * Get rid of redundant `display: block`, since `position: absolute` blockifies the layout anyway.
2022-12-13Address a few more nitsMichael Goulet-11/+12
2022-12-13Address nitsMichael Goulet-15/+5
Co-authored-by: Oli Scherer <github35764891676564198441@oli-obk.de>
2022-12-13Remove chalk lowering for AliasTyMichael Goulet-11/+10
2022-12-13nit: docsMichael Goulet-3/+12
2022-12-13Combine OfOpaque and OfProjectionMichael Goulet-14/+6
2022-12-13Combine identical alias armsMichael Goulet-120/+69