about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2021-08-12Avoid ICE caused by suggestionEsteban Küber-1/+30
When suggesting dereferencing something that can be iterable in a `for` loop, erase lifetimes and use a fresh `ty::ParamEnv` to avoid 'region constraints already solved' panic. Fix #87657.
2021-08-12Auto merge of #85296 - bjorn3:plugin_cleanup, r=petrochenkovbors-438/+274
Plugin interface cleanup The first commit performs two uncontroversial cleanups. The second commit removes `#[plugin_registrar]` and instead requires you to export a `__rustc_plugin_registrar` function, this will require a change to servo's script_plugins (cc `@jdm)`
2021-08-11update clippyEsteban Kuber-906/+961
2021-08-11Modify structured suggestion outputEsteban Küber-3301/+4516
* On suggestions that include deletions, use a diff inspired output format * When suggesting addition, use `+` as underline * Color highlight modified span
2021-08-11Auto merge of #87587 - oli-obk:lazy_tait, r=spastorinobors-105/+63
Various refactorings of the TAIT infrastructure Before this PR we used to store the opaque type knowledge outside the `InferCtxt`, so it got recomputed on every opaque type instantiation. I also removed a feature gate check that makes no sense in the planned lazy TAIT resolution scheme Each commit passes all tests, so this PR is best reviewed commit by commit. r? `@spastorino`
2021-08-11Auto merge of #87254 - ↵bors-6/+20
rusticstuff:rustc_codegen_llvm_dont_emit_zero_sized_padding, r=eddyb LLVM codegen: Don't emit zero-sized padding for fields Currently padding is emitted before fields of a struct and at the end of the struct regardless of the ABI. Even if no padding is required zero-sized padding fields are emitted. This is not useful and - more importantly - it make it impossible to generate the exact vector types that LLVM expects for certain ARM SIMD intrinsics. This change should unblock the implementation of many ARM intrinsics using the `unadjusted` ABI, see https://github.com/rust-lang/stdarch/issues/1143#issuecomment-827404092. This is a proof of concept only because the field lookup now takes O(number of fields) time compared to O(1) before since it recalculates the mapping at every lookup. I would like to find out how big the performance impact actually is before implementing caching or restricting this behavior to the `unadjusted` ABI. cc `@SparrowLii` `@bjorn3` ([Discussion on internals](https://internals.rust-lang.org/t/feature-request-add-a-way-in-rustc-for-generating-struct-type-llvm-ir-without-paddings/15007))
2021-08-11Rollup merge of #87895 - TheWastl:issue-87872, r=estebankYuki Okushi-0/+48
typeck: don't suggest inaccessible fields in struct literals and suggest ignoring inaccessible fields in struct patterns Fixes #87872. This PR adjusts the missing field diagnostic logic in typeck so that when any of the missing fields in a struct literal or pattern is inaccessible then the error is less confusing, even if some of the missing fields are accessible. See also #76524.
2021-08-11Rollup merge of #87889 - estebank:method-call-disambiguate, r=oli-obkYuki Okushi-14/+16
Use smaller spans when suggesting method call disambiguation Use smaller spans when suggesting method call disambiguation.
2021-08-11Rollup merge of #87881 - badboy:platform-support-formatting, r=ehussYuki Okushi-1/+1
Proper table row formatting in platform support Also moves the target into alphabetical order
2021-08-11Rollup merge of #87865 - tsoutsman:master, r=GuillaumeGomezYuki Okushi-22/+24
Clarify terms in rustdoc book Fixes #70898 I chose to completely remove the term directive over attribute because rustdoc has a lint called `invalid_codeblock_attributes` and the term attributes is used throughout the book. I slightly changed the introductory sentence to describe the relationship between annotations and attributes. I also moved the text explaining the example from below the blocks to above the blocks which is more in line with the rest of the book. I also changed the description for the `should_panic` attribute as I found it a little confusing. Finally, some of the blocks were `text` and some were `rust` so I changed them all to `text` which is in line with the rest of the book.
2021-08-11Rollup merge of #87861 - tsoutsman:patch-1, r=GuillaumeGomezYuki Okushi-1/+1
Fix heading colours in Ayu theme Closes #87828 The issue seems to stem from #87210 where code headings were changed from a heading containing a `code` element to a heading with the `code-header` class. `rustdoc.css` was updated, but `ayu.css` was missed.
2021-08-11Rollup merge of #87854 - BoxyUwU:var-None, r=oli-obkYuki Okushi-0/+24
correctly handle enum variants in `opt_const_param_of` Fixes #87542 `opt_const_param_of` was returning `None` for args on an enum variant `Enum::Variant::<10>` because we called `generics_of` on the enum variant which has no generics. r? `@oli-obk`
2021-08-11Rollup merge of #87811 - estebank:issue-87549, r=oli-obkYuki Okushi-0/+45
Do not ICE on HIR based WF check when involving lifetimes Fix #87549.
2021-08-10typeck: better diagnostics for missing inaccessible fields in struct ↵TheWastl-0/+48
literals/patterns - typeck/expr: don't suggest adding fields in struct literals with inaccessible fields - typeck/pat: suggest ignoring inaccessible fields in struct patterns
2021-08-10Replace #[plugin_registrar] with exporting __rustc_plugin_registrarbjorn3-438/+274
2021-08-09Use smaller spans when suggesting method call disambiguationEsteban Kuber-14/+16
2021-08-09Proper table row formatting in platform supportJan-Erik Rediger-1/+1
Also moves the target into alphabetical order
2021-08-09Auto merge of #85357 - Andy-Python-Programmer:aarch64_uefi_target, ↵bors-0/+1
r=petrochenkov Add `aarch64-unknown-uefi` target This pull request adds the `aarch64-unknown-uefi` target.
2021-08-09Do not ICE on HIR based WF check when involving lifetimesEsteban Küber-0/+45
Fix #87549.
2021-08-09Add the aarch64-unknown-uefi targetunknown-0/+1
* This commit adds the aarch64-unknown-uefi target and also adds it into the supported targets list under the tier-3 target table. * Uses the small code model by default Signed-off-by: Andy-Python-Programmer <andypythonappdeveloper@gmail.com>
2021-08-09Auto merge of #87619 - 12101111:fix-native_link_modifiers_bundle, r=petrochenkovbors-13/+18
Fix feature gate checking of static-nobundle and native_link_modifiers Feature native_link_modifiers_bundle don't need feature static-nobundle to work. Also check the feature gates when using native_link_modifiers from command line options. Current nighly compiler don't check those feature gate. ``` > touch lib.rs > rustc +nightly lib.rs -L /usr/lib -l static:+bundle=dl --crate-type=rlib > rustc +nightly lib.rs -L /usr/lib -l dylib:+as-needed=dl --crate-type=dylib -Ctarget-feature=-crt-static > rustc +nightly lib.rs -L /usr/lib -l static:-bundle=dl --crate-type=rlib error[E0658]: kind="static-nobundle" is unstable | = note: see issue #37403 <https://github.com/rust-lang/rust/issues/37403> for more information = help: add `#![feature(static_nobundle)]` to the crate attributes to enable error: aborting due to previous error For more information about this error, try `rustc --explain E0658`. ``` First found this in https://github.com/rust-lang/rust/pull/85600#discussion_r676612655
2021-08-09Clarify terms in rustdoc bookKlim Tsoutsman-22/+24
Change code blocks to Rust
2021-08-08Auto merge of #87235 - poliorcetics:issue-87217-fn-quali-order, r=nagisabors-3/+150
Improve diagnostics for wrongly ordered keywords in function declaration Fix #87217 `@rustbot` label A-diagnostics T-compiler
2021-08-08Auto merge of #87697 - GuillaumeGomez:add-e0784, r=nagisabors-10/+10
Assign E0784 error code for union expression errors
2021-08-08 Fix feature gate checking of static-nobundle and native_link_modifiers12101111-13/+18
2021-08-08Auto merge of #87827 - eddyb:wrapperless-mem-replace, r=m-ou-sebors-30/+40
Avoid using the `copy_nonoverlapping` wrapper through `mem::replace`. This is a much simpler way to achieve the pre-#86003 behavior of `mem::replace` not needing dynamically-sized `memcpy`s (at least before inlining), than re-doing #81238 (which needs #86699 or something similar). I didn't notice it until recently, but `ptr::write` already explicitly avoided using the wrapper, while `ptr::read` just called the wrapper (and was the reason for us observing any behavior change from #86003 in Rust-GPU). <hr/> The codegen test I've added fails without the change to `core::ptr::read` like this (ignore the `v0` mangling, I was using a worktree with it turned on by default, for this): ```llvm 13: ; core::intrinsics::copy_nonoverlapping::<u8> 14: ; Function Attrs: inlinehint nonlazybind uwtable 15: define internal void `@_RINvNtCscK5tvALCJol_4core10intrinsics19copy_nonoverlappinghECsaS4X3EinRE8_25mem_replace_direct_memcpy(i8*` %src, i8* %dst, i64 %count) unnamed_addr #0 { 16: start: 17: %0 = mul i64 %count, 1 18: call void `@llvm.memcpy.p0i8.p0i8.i64(i8*` align 1 %dst, i8* align 1 %src, i64 %0, i1 false) not:17 !~~~~~~~~~~~~~~~~~~~~~ error: no match expected 19: ret void 20: } ``` With the `core::ptr::read` change, `core::intrinsics::copy_nonoverlapping` doesn't get instantiated and the test passes. <hr/> r? `@m-ou-se` cc `@nagisa` (codegen test) `@oli-obk` / `@RalfJung` (miri diagnostic changes)
2021-08-08Fix heading colours in Ayu themeKlim Tsoutsman-1/+1
Closes #87828 The issue seems to stem from #87210 where code headings were changed from a heading containing code to a heading with the `code-header` class. `rustdoc.css` was updated, but `ayu.css` was missed.
2021-08-08Avoid using the `copy_nonoverlapping` wrapper through `mem::replace`.Eduard-Mihai Burtescu-30/+40
2021-08-08Auto merge of #87815 - BoxyUwU:cec-generics-of-ice, r=eddybbors-0/+81
encode `generics_of` for fields and ty params Fixes #87674 Fixes #87603 ICE was caused by calling `generics_of` on a `DefId` without any `generics_of` results. This was happening when we call `generics_of` on parent `DefId`s of an unevaluated const when we evaluate it. r? `@lcnr`
2021-08-07Auto merge of #87772 - npmccallum:naked_abi, r=Amanieubors-14/+8
Move naked function ABI check to its own lint This check was previously categorized under the lint named `UNSUPPORTED_NAKED_FUNCTIONS`. That lint is future incompatible and will be turned into an error in a future release. However, as defined in the Constrained Naked Functions RFC, this check should only be a warning. This is because it is possible for a naked function to be implemented in such a way that it does not break even the undefined ABI. For example, a `jmp` to a `const`. Therefore, this patch defines a new lint named `UNDEFINED_NAKED_FUNCTION_ABI` which contains just this single check. Unlike `UNSUPPORTED_NAKED_FUNCTIONS`, `UNDEFINED_NAKED_FUNCTION_ABI` will not be converted to an error in the future. rust-lang/rfcs#2774 rust-lang/rfcs#2972
2021-08-07fmtEllen-1/+1
2021-08-07Auto merge of #87851 - JohnTitor:rollup-odvmr47, r=JohnTitorbors-9/+34
Rollup of 6 pull requests Successful merges: - #87744 (Add x.py option to --force-rerun compiletest tests) - #87789 (Make vec-shrink-panic test compatible with v0 mangling) - #87833 (Fix typo -- "The" -> "They") - #87834 (Fix small typo) - #87838 (Document that fs::read_dir skips . and ..) - #87842 (Fix intra doc link in hidden doc of Iterator::__iterator_get_unchecked) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-08-07less opt in const param ofEllen-0/+24
2021-08-08Rollup merge of #87834 - camelid:span-typo, r=CraftSpiderYuki Okushi-1/+1
Fix small typo The closing backtick was outside the closing bracket, which is why the intra-doc link wasn't working.
2021-08-08Rollup merge of #87833 - m-rsha:patch-1, r=Aaron1011Yuki Okushi-1/+1
Fix typo -- "The" -> "They" I was reading through source code to try to learn more about the language and how to make the most of it when I ran into a small typo, so I figured I'd offer up a fix! I'm pretty new now, but hopefully I can offer up more substantial changes later. :D
2021-08-08Rollup merge of #87789 - tmiasko:panik, r=Mark-SimulacrumYuki Okushi-0/+0
Make vec-shrink-panic test compatible with v0 mangling The v0 mangling includes an instantiating crate in a mangled name, which crates a false positive match for a word `panic`. Rename crate name / test case to avoid the issue.
2021-08-08Rollup merge of #87744 - Smittyvb:xpy-test-force-rerun, r=Mark-SimulacrumYuki Okushi-7/+32
Add x.py option to --force-rerun compiletest tests This can be used like `./x.py test src/test/ui/abi/ --force-rerun`, and is useful when verifying that newly blessed tests don't change between test runs (such as due to being dependent on the current time or memory layout or RNG), without needing to change the test file or find the right file in `build` to remove.
2021-08-07update MiriRalf Jung-8/+8
2021-08-06Fix small typoNoah Lev-1/+1
The closing backtick was outside the closing bracket, which is why the intra-doc link wasn't working.
2021-08-06Fix typo -- "The" -> "They"await Marsha-1/+1
I was reading through source code to try to learn more about the language and how to make the most of it when I ran into a small typo, so I figured I'd offer up a fix! I'm pretty new now, but hopefully I can offer up more substantial changes later. :D
2021-08-06Auto merge of #87822 - JohnTitor:rollup-kxojii0, r=JohnTitorbors-3/+85
Rollup of 7 pull requests Successful merges: - #85807 (bootstrap: Disable initial-exec TLS model on powerpc) - #87761 (Fix overflow in rustc happening if the `err_count()` is reduced in a stage.) - #87775 (Add hint for unresolved associated trait items if the trait has a single item) - #87779 (Remove special case for statement `NodeId` assignment) - #87787 (Use `C-unwind` ABI for `__rust_start_panic` in `panic_abort`) - #87809 (Fix typo in the ptr documentation) - #87816 (Sync rustc_codegen_cranelift) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-08-07Rollup merge of #87775 - Kobzol:single-associated-item-hint, r=oli-obkYuki Okushi-2/+84
Add hint for unresolved associated trait items if the trait has a single item This PR introduces a special-cased hint for unresolved trait items paths. It is shown if: - the path was not resolved to any existing trait item - and no existing trait item's name was reasonably close with regard to edit distance - and the trait only has a single item in the corresponding namespace I didn't know where I should put tests, therefore so far I just managed to bless two existing tests. I would be glad for hints where should tests for a hint like this be created, how should they be named (with reference to the original issue?) and what tests should I create (is it enough to test it just for types? or create separate tests also for functions and constants?). It could also be turned into a machine applicable suggestion I suppose. This is my first `rustc` PR, so please go easy on me :) Fixes: https://github.com/rust-lang/rust/issues/87638
2021-08-07Rollup merge of #85807 - glaubitz:powerpc-disable-initial-exec-tls, ↵Yuki Okushi-1/+1
r=Mark-Simulacrum bootstrap: Disable initial-exec TLS model on powerpc Fixes #81334.
2021-08-06Auto merge of #87784 - rusticstuff:bootstrap_config_overflow_checks, ↵bors-0/+20
r=Mark-Simulacrum Add config.toml options for enabling overflow checks in rustc and std The names are `overflow-checks` and `overflow-checks-std` and they work similar to `debug-assertions` and `debug-assertions-std`. Once added we can measure how big the performance impact actually is and maybe enable them for CI tests. Enabling them already makes two ui tests fail: ``` failures: [ui] ui/parser/item-free-const-no-body-semantic-fail.rs [ui] ui/parser/item-free-static-no-body-semantic-fail.rs ``` (See #84219 and #87761.)
2021-08-06uwuEllen-1/+1
2021-08-06*sprinkles some dust everywhere*Ellen-1/+2
2021-08-06encode `generics_of` of fields and ty paramsEllen-0/+80
2021-08-06Add options for enabling overflow checks in rustc and std.Hans Kratz-0/+20
The options are `overflow-checks` and `overflow-checks-std` defaulting to false.
2021-08-06bless some nll testsOli Scherer-26/+2
2021-08-06Point to the value instead of the TAIT declaration for obligation failuresOli Scherer-38/+40