about summary refs log tree commit diff
path: root/compiler
AgeCommit message (Collapse)AuthorLines
2020-11-04Auto merge of #78280 - bugadani:span, r=lcnrbors-23/+18
Codegen: Query span as late as possible
2020-11-04Auto merge of #77227 - oli-obk:const_val_🌳_prelude, r=RalfJungbors-279/+457
Refactorings in preparation for const value trees cc #72396 This PR changes the `Scalar::Bits { data: u128, size: u8 }` variant to `Scalar::Bits(ScalarInt)` where `ScalarInt` contains the same information, but is `repr(packed)`. The reason for using a packed struct is to allow enum variant packing to keep the original size of `Scalar` instead of adding another word to its size due to padding. Other than that the PR just gets rid of all the inspection of the internal fields of `Scalar::Bits` which were frankly scary. These fields have invariants that we need to uphold and we can't do that without making the fields private. r? `@ghost`
2020-11-04Update compiler/rustc_target/src/abi/mod.rsOli Scherer-1/+1
Co-authored-by: Ralf Jung <post@ralfj.de>
2020-11-04Update compiler/rustc_target/src/abi/mod.rsOli Scherer-1/+1
Co-authored-by: Ralf Jung <post@ralfj.de>
2020-11-04`u64::try_from` will now fail if `ScalarInt` isn't exactly 64 bits, thus we ↵oli-1/+1
use `to_bits` with the correct size
2020-11-04Make `ScalarInt` entirely independent of MIR interpretationoli-4/+3
2020-11-04Document an `unwrap`oli-1/+4
2020-11-04`u128` truncation and sign extension are not just interpreter relatedoli-87/+71
2020-11-04Auto merge of #78677 - Aaron1011:fix/capture-inner-attrs, r=petrochenkovbors-29/+14
Use reparsed `TokenStream` if we captured any inner attributes Fixes #78675 We now bail out of `prepend_attrs` if we ended up capturing any inner attributes (which can happen in several places, due to token capturing for `macro_rules!` arguments.
2020-11-04Move ZST constant to the top of the impl blockoli-2/+2
2020-11-04Update compiler/rustc_middle/src/ty/consts/int.rsOli Scherer-1/+1
Co-authored-by: Ralf Jung <post@ralfj.de>
2020-11-04Simplify `assert_bits` imploli-4/+3
2020-11-04Do not raise interp errors from the scalar int moduleoli-20/+23
2020-11-04Add helper for getting an `int` out of a `Scalar`oli-4/+9
2020-11-04Add `is_null` helperoli-2/+7
This is cheaper than creating a null-`ScalarInt` and comparing and then just throwing it away.
2020-11-04Explain why we forward to self-printing during self-printingoli-1/+2
2020-11-04catch conversion errors during `ptr_sized_op`oli-1/+1
2020-11-04Replace `Scalar::zst` with a `Scalar::ZST` constantoli-10/+7
2020-11-04No need for a `zst` constructor method when we can have a constantoli-6/+1
2020-11-04Update commentoli-3/+2
2020-11-04Unaligned reads are UB in Rust irrelevant on which platform we areoli-4/+4
2020-11-04Remove outdated FIXMEoli-1/+0
2020-11-04s/Scalar::Raw/Scalar::Intoli-47/+47
2020-11-04Fix cranelift buildoli-10/+28
2020-11-04Explain the use of blocks around `self.data` accessesoli-0/+14
2020-11-04Use packed struct instead of manually packing into an arrayoli-36/+39
2020-11-0432 bit platforms don't have 64 bit pointersOliver Scherer-2/+3
2020-11-04Encode `ScalarInt::bytes` as `u128` instead of `[u8; 16]` to see if that ↵Oliver Scherer-1/+15
caused the performance regression
2020-11-04Split the "raw integer bytes" part out of `Scalar`Oliver Scherer-170/+309
2020-11-03Auto merge of #78711 - m-ou-se:rollup-pxqnny7, r=m-ou-sebors-433/+727
Rollup of 7 pull requests Successful merges: - #77950 (Add support for SHA256 source file hashing) - #78624 (Sync rustc_codegen_cranelift) - #78626 (Improve errors about #[deprecated] attribute) - #78659 (Corrected suggestion for generic parameters in `function_item_references` lint) - #78687 (Suggest library/std when running all stage 0 tests) - #78699 (Show more error information in lldb_batchmode) - #78709 (Fix panic in bootstrap for non-workspace path dependencies.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2020-11-03Rollup merge of #78659 - ayrtonm:fn-ref-lint-fix, r=oli-obkMara Bos-18/+36
Corrected suggestion for generic parameters in `function_item_references` lint This commit handles functions with generic type parameters like you pointed out as well as const generics. Also this is probably a minor thing, but the type alias you used in the example doesn't show up so the suggestion right now would be `size_of::<[u8; 16]> as fn() ->`. This is because the lint checker works with MIR instead of HIR. I don't think we can get the alias at that point, but let me know if I'm wrong and there's a way to fix this. Also I put you as the reviewer, but I'm not sure if you want to review it or if it makes more sense to ask one of the original reviewers of this lint. closes #78571
2020-11-03Rollup merge of #78626 - fusion-engineering-forks:deprecated-trait-impl, ↵Mara Bos-23/+60
r=estebank Improve errors about #[deprecated] attribute This change: 1. Turns `#[deprecated]` on a trait impl block into an error, which fixes #78625; 2. Changes these and other errors about `#[deprecated]` to use the span of the attribute instead of the item; and 3. Turns this error into a lint, to make sure it can be capped with `--cap-lints` and doesn't break any existing dependencies. Can be reviewed per commit. --- Example: ```rust struct X; #[deprecated = "a"] impl Default for X { #[deprecated = "b"] fn default() -> Self { X } } ``` Before: ``` error: This deprecation annotation is useless --> src/main.rs:6:5 | 6 | / fn default() -> Self { 7 | | X 8 | | } | |_____^ ``` After: ``` error: this `#[deprecated]' annotation has no effect --> src/main.rs:3:1 | 3 | #[deprecated = "a"] | ^^^^^^^^^^^^^^^^^^^ help: try removing the deprecation attribute | = note: `#[deny(useless_deprecated)]` on by default error: this `#[deprecated]' annotation has no effect --> src/main.rs:5:5 | 5 | #[deprecated = "b"] | ^^^^^^^^^^^^^^^^^^^ help: try removing the deprecation attribute ```
2020-11-03Rollup merge of #78624 - bjorn3:update_cg_clif-2020-11-01, r=jyn514Mara Bos-388/+612
Sync rustc_codegen_cranelift This fixes bootstrapping of rustc using cg_clif again. It regressed a while before #77975 got merged. Fixes https://github.com/bjorn3/rustc_codegen_cranelift/issues/743
2020-11-03Rollup merge of #77950 - arlosi:sha256, r=eddybMara Bos-4/+19
Add support for SHA256 source file hashing Adds support for `-Z src-hash-algorithm sha256`, which became available in LLVM 11. Using an older version of LLVM will cause an error `invalid checksum kind` if the hash algorithm is set to sha256. r? `@eddyb` cc #70401 `@est31`
2020-11-03Auto merge of #76931 - oli-obk:const_prop_inline_lint_madness, r=wesleywiserbors-4/+27
Properly handle lint spans after MIR inlining The first commit shows what happens when we apply mir inlining and then cause lints on the inlined MIR. The second commit fixes that. r? `@wesleywiser`
2020-11-03Auto merge of #78597 - RalfJung:raw-retag, r=oli-obkbors-6/+20
Retagging: do not retag 'raw reborrows' When doing `&raw const (*raw_ptr).field`, we do not want any retagging; the original provenance should be fully preserved. Fixes https://github.com/rust-lang/miri/issues/1608 Test added by https://github.com/rust-lang/miri/pull/1614 Not sure whom to ask for review on this... `@oli-obk` can you have a look? Or maybe highfive makes a good choice.^^
2020-11-03Merge commit '03f01bbe901d60b71cf2c5ec766aef5e532ab79d' into ↵bjorn3-388/+612
update_cg_clif-2020-11-01
2020-11-03Auto merge of #78489 - bugadani:array, r=estebankbors-44/+39
Minor cleanup around incremental compilation * Remove some short lived vectors * Fix some typos * Avoid some reallocations
2020-11-03Auto merge of #78697 - JohnTitor:rollup-q0fchpv, r=JohnTitorbors-88/+165
Rollup of 8 pull requests Successful merges: - #78376 (Treat trailing semicolon as a statement in macro call) - #78400 (Fix unindent in doc comments) - #78575 (Add a test for compiletest rustc-env & unset-rustc-env directives) - #78616 (Document -Zinstrument-coverage) - #78663 (Fix ICE when a future-incompat-report has its command-line level capped) - #78664 (Fix intrinsic size_of stable link) - #78668 (inliner: Remove redundant loop) - #78676 (add mipsel-unknown-none target) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2020-11-03Rollup merge of #78676 - kiffie:embedded-bare-mipsr2, r=jonas-schievinkYuki Okushi-0/+43
add mipsel-unknown-none target This adds a target for bare MIPS32r2, little endian, softfloat. This target can be used for PIC32 microcontrollers (or possibly for other devices that have a MIPS MCU core such as the M4K core). Tried to find a name for the target that is in line with the naming scheme apparently used for the other MIPS targets. r? `@jonas-schievink`
2020-11-03Rollup merge of #78668 - tmiasko:inline, r=oli-obkYuki Okushi-77/+60
inliner: Remove redundant loop No functional changes intended.
2020-11-03Rollup merge of #78663 - Aaron1011:fix/cap-future-compat, r=tmandryYuki Okushi-10/+13
Fix ICE when a future-incompat-report has its command-line level capped Fixes #78660 With PR https://github.com/rust-lang/rust/pull/75534 merged, we now run more lint-related code for future-incompat-report, even when their final level is Allow. Some lint-related code was not expecting `Level::Allow`, and had an explicit panic. This PR explicitly tracks the lint level set on the command line before `--cap-lints` is applied. This is used to emit a more precise error note (e.g. we don't say that `-W lint-name` was specified on the command line just because a lint was capped to Warn). As a result, we can now correctly emit a note that `-A` was used if we got `Level::Allow` from the command line (before the cap is applied).
2020-11-03Rollup merge of #78376 - Aaron1011:feature/consistent-empty-expr, r=petrochenkovYuki Okushi-1/+49
Treat trailing semicolon as a statement in macro call See #61733 (comment) We now preserve the trailing semicolon in a macro invocation, even if the macro expands to nothing. As a result, the following code no longer compiles: ```rust macro_rules! empty { () => { } } fn foo() -> bool { //~ ERROR mismatched { true } //~ ERROR mismatched empty!(); } ``` Previously, `{ true }` would be considered the trailing expression, even though there's a semicolon in `empty!();` This makes macro expansion more token-based.
2020-11-03Auto merge of #78448 - rylev:cache-foreign_modules, r=wesleywiserbors-14/+17
foreign_modules query hash table lookups When compiling a large monolithic crate we're seeing huge times in the `foreign_modules` query due to repeated iteration over foreign modules (in order to find a module by its id). This implements hash table lookups so that which massively reduces time spent in that query in this particular case. We'll need to see if the overhead of creating the hash table has a negative impact on performance in more normal compilation scenarios. I'm working with `@wesleywiser` on this.
2020-11-02indicate calling conventionStephan-1/+1
2020-11-02improve commentsStephan-2/+3
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2020-11-03Expand `NtExpr` tokens only in key-value attributesVadim Petrochenkov-76/+102
2020-11-02add blacklist for unsupported calling conventionsStephan-0/+9
2020-11-02Use reparsed `TokenStream` if we captured any inner attributesAaron Hill-29/+14
Fixes #78675 We now bail out of `prepend_attrs` if we ended up capturing any inner attributes (which can happen in several places, due to token capturing for `macro_rules!` arguments.
2020-11-02add mipsel_unknown_none targetStephan-0/+33