about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2022-08-09Add error if link_ordinal used without raw-dylibDaniel Paoliello-0/+41
2022-08-09Rollup merge of #100305 - ↵Dylan DPC-0/+43
TaKO8Ki:suggest-adding-appropriate-missing-pattern-excluding-comments, r=compiler-errors Suggest adding an appropriate missing pattern excluding comments fixes #100272
2022-08-09Rollup merge of #100228 - luqmana:suggestion-ice, r=estebankDylan DPC-0/+49
Don't ICE while suggesting updating item path. When an item isn't found, we may suggest an appropriate import to `use`. Along with that, we also suggest updating the path to work with the `use`. Unfortunately, if the code in question originates from a macro, the span used to indicate which part of the path needs updating may not be suitable and cause an ICE (*). Since, such code is not adjustable directly by the user without modifying the macro, just skip the suggestion in such cases. (*) The ICE happens because the emitter want to indicate to the user what code to delete by referencing a certain span. But in this case, said span has `lo == hi == 0` which means it thinks it's a dummy span. Adding a space before the proc macro attribute is enough to stop it from ICE'ing but even then the suggestion doesn't really make any sense: ``` help: if you import `DataStore`, refer to it directly | 1 - #[dbstruct::dbstruct] 1 + #[dbstruct::dbstruct] ``` Since suggestions are best-effort, I just gated this one on `can_be_used_for_suggestions` which catches cases like this. Fixes #100199
2022-08-09Rollup merge of #100221 - compiler-errors:impossible-trait-items, ↵Dylan DPC-0/+29
r=lcnr,notriddle,camelid Don't document impossible to call default trait items on impls Closes #100176 This only skips documenting _default_ trait items on impls, not ones that are written inside the impl block. This is a conservative approach, since I think we should document all items written in an impl block (I guess unless hidden or whatever), but the existence of this new query I added makes this easy to extend to other rustdoc cases.
2022-08-09Rollup merge of #100181 - RalfJung:alloc-ref-mutability, r=jackh726Dylan DPC-0/+4
add method to get the mutability of an AllocId Miri needs this for https://github.com/rust-lang/miri/issues/2463.
2022-08-09Rollup merge of #99787 - aDotInTheVoid:rdj-dyn, ↵Dylan DPC-77/+159
r=camelid,notriddle,GuillaumeGomez Rustdoc-Json: Document HRTB's on DynTrait Closes https://github.com/rust-lang/rust/issues/99118 Probably best reviewed commit by commit. `@rustbot` modify labels: +A-rustdoc-json cc `@Enselic` r? `@CraftSpider`
2022-08-09Rollup merge of #96478 - WaffleLapkin:rustc_default_body_unstable, r=Aaron1011Dylan DPC-0/+125
Implement `#[rustc_default_body_unstable]` This PR implements a new stability attribute — `#[rustc_default_body_unstable]`. `#[rustc_default_body_unstable]` controls the stability of default bodies in traits. For example: ```rust pub trait Trait { #[rustc_default_body_unstable(feature = "feat", isssue = "none")] fn item() {} } ``` In order to implement `Trait` user needs to either - implement `item` (even though it has a default implementation) - enable `#![feature(feat)]` This is useful in conjunction with [`#[rustc_must_implement_one_of]`](https://github.com/rust-lang/rust/pull/92164), we may want to relax requirements for a trait, for example allowing implementing either of `PartialEq::{eq, ne}`, but do so in a safe way — making implementation of only `PartialEq::ne` unstable. r? `@Aaron1011` cc `@nrc` (iirc you were interested in this wrt `read_buf`), `@danielhenrymantilla` (you were interested in the related `#[rustc_must_implement_one_of]`) P.S. This is my first time working with stability attributes, so I'm not sure if I did everything right 😅
2022-08-09Auto merge of #100304 - matthiaskrgr:rollup-gs56vlw, r=matthiaskrgrbors-443/+1829
Rollup of 6 pull requests Successful merges: - #100163 (Refactor: remove an unnecessary string search) - #100212 (Remove more Clean trait implementations) - #100238 (Further improve error message for E0081) - #100268 (Add regression test for #79148) - #100294 (Update Duration::as_secs doc to point to as_secs_f64/32 for including fractional part) - #100303 (:arrow_up: rust-analyzer) Failed merges: - #100281 (Remove more Clean trait implementations) r? `@ghost` `@rustbot` modify labels: rollup
2022-08-09suggest adding an appropriate missing pattern excluding commentsTakayuki Maeda-0/+43
2022-08-09Rollup merge of #100303 - lnicola:rust-analyzer-2022-08-09, r=lnicolaMatthias Krüger-281/+1636
:arrow_up: rust-analyzer r? `@ghost`
2022-08-09Rollup merge of #100268 - TaKO8Ki:add-regression-test-for-79148, ↵Matthias Krüger-0/+45
r=Mark-Simulacrum Add regression test for #79148 closes #79148
2022-08-09Rollup merge of #100238 - Bryysen:master, r=cjgillotMatthias Krüger-101/+78
Further improve error message for E0081 Closes #97533
2022-08-09Rollup merge of #100212 - GuillaumeGomez:rm-clean-impls, r=Dylan-DPCMatthias Krüger-58/+64
Remove more Clean trait implementations Follow-up of https://github.com/rust-lang/rust/pull/99638. r? `@notriddle`
2022-08-09Rollup merge of #100163 - TaKO8Ki:remove-unnecessary-string-search, ↵Matthias Krüger-3/+6
r=wesleywiser Refactor: remove an unnecessary string search
2022-08-09Auto merge of #100205 - cjgillot:noice-doc, r=camelidbors-10/+39
Avoid ICE in rustdoc when using `Fn` bounds Fixes https://github.com/rust-lang/rust/issues/100143
2022-08-09:arrow_up: rust-analyzerLaurențiu Nicola-281/+1636
2022-08-08Add regression test commentNoah Lev-0/+2
2022-08-08Fix plural form of `variant` in error message not formatting correctlyBryysen-32/+26
due to ordering, added/improved comments and removed redundant test already caught by `E0081.rs`
2022-08-08Synthetize a trait ref when none is available.Camille GILLOT-7/+15
2022-08-08add regression test for #79148Takayuki Maeda-0/+45
2022-08-08Auto merge of #98863 - compiler-errors:projection-msg, r=estebankbors-65/+75
Implement special-cased projection error message for some common traits Not sure what the best phrasing is, but I feel like these are more clear than the plain `<Type as Iterator>::Output == Type` messages. If this is actually a good idea, are there any other traits this could benefit?
2022-08-08Auto merge of #98489 - cjgillot:naked-nohir, r=davidtwco,tmiaskobors-58/+45
Only fetch HIR for naked functions that have the attribute.
2022-08-08Auto merge of #100207 - notriddle:notriddle/skipped-inline-module, r=Manishearthbors-21/+70
rustdoc: do not mark the contents of a skipped module as inlined Fixes #100204
2022-08-08Adjust wordingMichael Goulet-65/+74
2022-08-07Implement special-cased projection error message for some common traitsMichael Goulet-30/+31
2022-08-07Don't document impossible to call default trait items on implsMichael Goulet-0/+29
2022-08-07Add UI test for #100199Luqman Aden-0/+49
2022-08-07Rollup merge of #100244 - Lokathor:add-armv4t-none-eabi-take2, r=jackh726Matthias Krüger-0/+71
Add armv4t-none-eabi take2 This is the same as the previous PR (https://github.com/rust-lang/rust/pull/99226) but i just made a fresh branch without a merge commit in it. --- ### armv4t-none-eabi target quiz > A tier 3 target must have a designated developer or developers (the "target maintainers") on record to be CCed when issues arise regarding the target. That's me! > Targets must use naming consistent with any existing targets We're using the existing name as recognized by LLVM and GCC > Tier 3 targets may have unusual requirements to build or use, but must not create legal issues or impose onerous legal terms for the Rust project or for Rust developers or users. No legal issues here. >> The target must not introduce license incompatibilities. No license requirements here. >> Anything added to the Rust repository must be under the standard Rust license (MIT OR Apache-2.0). check >> The target must not cause the Rust tools or libraries built for any other host (even when supporting cross-compilation to the target) to depend on any new dependency less permissive than the Rust licensing policy. no new deps, we're just adding a rustc target description file for a target llvm already knows about. >> Compiling, linking, and emitting functional binaries, libraries, or other code for the target (whether hosted on the target itself or cross-compiling from another target) must not depend on proprietary (non-FOSS) libraries. bare-metal target, doesn't rely on any libs at all. > Tier 3 targets should attempt to implement as much of the standard libraries as possible and appropriate `core` only here. You could build `alloc` too, but you'd have to bring your own global allocator. > The target must provide documentation for the Rust community explaining how to build for the target, using cross-compilation if possible. LLVM knows how to do it, you just need the GNU Binutils linker because LLVM's linker doesn't work that far back. That's in the docs as part of this PR. > Tier 3 targets must not impose burden on the authors of pull requests, or other developers in the community, to maintain the target. No burdens, LLVM already knows how to do this. Further, because this is a cpu-feature variant of an existing tier3 target the `compiler-builtins` crate has already been updated as necessary to fix any missing builtin function gaps. > Patches adding or updating tier 3 targets must not break any existing tier 2 or tier 1 target, and must not knowingly break another tier 3 target without approval of either the compiler team or the maintainers of the other tier 3 target. check.
2022-08-07Rollup merge of #100230 - cjgillot:noice-multibyte-amp, r=compiler-errorsMatthias Krüger-0/+33
Use start_point instead of next_point to point to elided lifetime amp… Using `next_point` creates a span which points inside the multibyte token, ICEing. Fixes https://github.com/rust-lang/rust/issues/100224
2022-08-07Rollup merge of #100194 - est31:box_syntax_tests, r=Mark-SimulacrumMatthias Krüger-212/+154
Remove even more box syntax uses from src/test Prior work, notably #88316 has removed box syntax from most of the testsuite. However, some tests were left out. This commit removes box_syntax uses from more locations in src/test. This migrates the tests where `box` is mostly an "implementation detail" and not the primary thing being tested by the test. Furthermore, some tests from the mir-opt test suite are not being migrated.
2022-08-07Rollup merge of #100019 - ↵Matthias Krüger-0/+181
TaKO8Ki:suggest-boxed-trait-objects-instead-of-impl-trait, r=compiler-errors Revive suggestions for boxed trait objects instead of impl Trait The suggestion implemented in #75608 was not working properly, so I fixed it.
2022-08-07Update SUMMARY.mdLokathor-0/+1
2022-08-07Create armv4t_none_eabi.mdLokathor-0/+70
2022-08-07Auto merge of #99833 - andrewpollack:fuchsia-rust-ci-zircon-lib-improvement, ↵bors-53/+65
r=Mark-Simulacrum Fuchsia CI zircon lib improvement Removing Zircon build process, instead pulling `sysroot` and related libs directly from Fuchsia SDK cc. `@tmandry` `@djkoloski`
2022-08-07Further improve error message for E0081Bryysen-77/+60
Multiple duplicate assignments of the same discriminant are now reported in the samme error. We now point out the incrementation start point for discriminants that are not explicitly assigned that are also duplicates. Removed old test related to E0081 that is now covered by error-codes/E0081.rs. Also refactored parts of the `check_enum` function.
2022-08-07Shifting CI to pull Zircon libraries directly from Fuchsia SDKAndrew Pollack-53/+65
PR feedback PR Followups Updating clang download Updating clang download Restructuring env used Restructuring env used Adding chmod Adding chmod Adding chmod
2022-08-07Use start_point instead of next_point to point to elided lifetime ampersand.Camille GILLOT-0/+33
2022-08-07fix wrong suggestions for boxed trait objects instead of impl traitTakayuki Maeda-4/+88
2022-08-07revive suggestions for boxed trait objects instead of impl TraitTakayuki Maeda-0/+97
2022-08-07Auto merge of #100091 - chenyukang:add-check-for-link-ordinal, ↵bors-0/+54
r=michaelwoerister Check link ordinal to make sure it is targetted for foreign function Fix #100009, when link ordinal is not target for foreign functions, emit an error. cc `@dpaoliello`
2022-08-07Auto merge of #100004 - jyn514:exclude-single-test, r=Mark-Simulacrumbors-14/+5
Move `x test --skip` to be part of `--exclude` `--skip` is inconsistent with the rest of the interface and redundant with `--exclude`. Fix --exclude to work properly for files and directories rather than having a separate flag. Fixes https://github.com/rust-lang/rust/issues/96342. cc https://github.com/rust-lang/rust/pull/96493#issuecomment-1200521720 r? `@Mark-Simulacrum`
2022-08-07Remove even more box syntax uses from src/testest31-212/+154
Prior work, notably 6550021124451628b1efc60c59284465b109e3aa from #88316 has removed box syntax from most of the testsuite. However, some tests were left out. This commit removes box_syntax uses from more locations in src/test. Some tests that are very box syntax specific are not being migrated.
2022-08-07Rollup merge of #100130 - compiler-errors:erroneous-return-span, r=lcnrMatthias Krüger-15/+136
Avoid pointing out `return` span if it has nothing to do with type error This code: ```rust fn f(_: String) {} fn main() { let x = || { if true { return (); } f(""); }; } ``` Emits this: ``` Compiling playground v0.0.1 (/playground) error[E0308]: mismatched types --> src/main.rs:8:11 | 8 | f(""); | ^^- help: try using a conversion method: `.to_string()` | | | expected struct `String`, found `&str` | note: return type inferred to be `String` here --> src/main.rs:6:20 | 6 | return (); | ^^ ``` Specifically, that note has nothing to do with the type error in question. This is because the change implemented in #84244 tries to point out the `return` span on _any_ type coercion error within a closure that happens after a `return` statement, regardless of if the error has anything to do with it. This is really easy to trigger -- just needs a closure (or an `async`) and an early return (or any other form, e.g. `?` operator suffices) -- and super distracting in production codebases. I'm letting #84128 regress because that issue is much harder to fix correctly, and I can re-open that issue after this lands. As a drive-by, I added a `resolve_vars_if_possible` to the coercion error logic, which leads to some error improvements. Unrelated to the issue above, though.
2022-08-07remove Clean trait implementation for ty::PredicateGuillaume Gomez-22/+23
2022-08-07remove Clean trait implementation for hir::WherePredicateGuillaume Gomez-36/+41
2022-08-06rustdoc: do not mark the contents of a skipped module as inlinedMichael Howell-21/+70
2022-08-06Avoid ICE in rustdoc.Camille GILLOT-5/+24
2022-08-06Auto merge of #100195 - matthiaskrgr:rollup-ovzyyb0, r=matthiaskrgrbors-50/+128
Rollup of 4 pull requests Successful merges: - #100094 (Detect type mismatch due to loop that might never iterate) - #100132 (Use (actually) dummy place for let-else divergence) - #100167 (Recover `require`, `include` instead of `use` in item) - #100193 (Remove more Clean trait implementations) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-08-06Rollup merge of #100193 - GuillaumeGomez:rm-clean-impls, r=notriddleMatthias Krüger-48/+42
Remove more Clean trait implementations Follow-up of https://github.com/rust-lang/rust/pull/99638. r? `@notriddle`
2022-08-06Rollup merge of #100167 - chenyukang:require-suggestion, r=estebankMatthias Krüger-2/+30
Recover `require`, `include` instead of `use` in item Fix #100140