about summary refs log tree commit diff
path: root/compiler/rustc_span
AgeCommit message (Collapse)AuthorLines
2021-12-13Add run-make-fulldeps testpierwill-5/+14
Implement RUSTC_FORCE_INCR_COMP_ARTIFACT_HEADER Also makes minor docs edits.
2021-12-13Include rustc version in `rustc_span::StableCrateId`pierwill-5/+11
Normalize symbol hashes in compiletest. Remove DefId sorting
2021-12-10Rollup merge of #91625 - est31:remove_indexes, r=oli-obkMatthias Krüger-2/+2
Remove redundant [..]s
2021-12-10manually implement `Hash` for `DefId`Andre Bogus-5/+31
This also reorders the fields to reduce the assembly operations for hashing and changes two UI tests that depended on the former ordering because of hashmap iteration order.
2021-12-09Auto merge of #91692 - matthiaskrgr:rollup-u7dvh0n, r=matthiaskrgrbors-1/+1
Rollup of 6 pull requests Successful merges: - #87599 (Implement concat_bytes!) - #89999 (Update std::env::temp_dir to use GetTempPath2 on Windows when available.) - #90796 (Remove the reg_thumb register class for asm! on ARM) - #91042 (Use Vec extend instead of repeated pushes on several places) - #91634 (Do not attempt to suggest help for overly malformed struct/function call) - #91685 (Install llvm tools to sysroot when assembling local toolchain) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-12-09Rollup merge of #90796 - Amanieu:remove_reg_thumb, r=joshtriplettMatthias Krüger-1/+0
Remove the reg_thumb register class for asm! on ARM Also restricts r8-r14 from being used on Thumb1 targets as per #90736. cc ``@Lokathor`` r? ``@joshtriplett``
2021-12-09Rollup merge of #87599 - Smittyvb:concat_bytes, r=Mark-SimulacrumMatthias Krüger-0/+1
Implement concat_bytes! This implements the unstable `concat_bytes!` macro, which has tracking issue #87555. It can be used like: ```rust #![feature(concat_bytes)] fn main() { assert_eq!(concat_bytes!(), &[]); assert_eq!(concat_bytes!(b'A', b"BC", [68, b'E', 70]), b"ABCDEF"); } ``` If strings or characters are used where byte strings or byte characters are required, it suggests adding a `b` prefix. If a number is used outside of an array it suggests arrayifying it. If a boolean is used it suggests replacing it with the numeric value of that number. Doubly nested arrays of bytes are disallowed.
2021-12-09Rollup merge of #91476 - m-ou-se:ferris-identifier, r=estebankMatthias Krüger-0/+1
Improve 'cannot contain emoji' error. Before: ``` error: identifiers cannot contain emoji: `🦀` --> src/main.rs:2:9 | 2 | let 🦀 = 1; | ^^ ``` After: ``` error: Ferris cannot be used as an identifier --> src/main.rs:2:9 | 2 | let 🦀 = 1; | ^^ help: try using their name instead: `ferris` ``` r? `@estebank`
2021-12-09Remove redundant [..]sest31-2/+2
2021-12-07Remove the reg_thumb register class for asm! on ARMAmanieu d'Antras-1/+0
Also restricts r8-r14 from being used on Thumb1 targets as per #90736.
2021-12-07Auto merge of #91224 - couchand:2021-11/avr-asm, r=Amanieubors-0/+4
Support AVR for inline asm! A first pass at support for the AVR platform in inline `asm!`. Passes the initial compiler tests, have not yet done more complete verification. In particular, the register classes could use a lot more fleshing out, this draft PR so far only includes the most basic. cc `@Amanieu` `@dylanmckay`
2021-12-07Rollup merge of #87614 - notriddle:notriddle-count2len, r=Mark-SimulacrumMatthias Krüger-0/+1
Recommend fix `count()` -> `len()` on slices Fixes #87302
2021-12-06Recommend fix `count()` -> `len()` on slicesMichael Howell-0/+1
Fixes #87302
2021-12-06Implement concat_bytes!Smitty-0/+1
The tracking issue for this is #87555.
2021-12-06Implement inline asm! for AVR platformAndrew Dona-Couch-0/+4
2021-12-05Rollup merge of #91355 - alexcrichton:stabilize-thread-local-const, r=m-ou-seMatthias Krüger-1/+0
std: Stabilize the `thread_local_const_init` feature This commit is intended to follow the stabilization disposition of the FCP that has now finished in #84223. This stabilizes the ability to flag thread local initializers as `const` expressions which enables the macro to generate more efficient code for accessing it, notably removing runtime checks for initialization. More information can also be found in #84223 as well as the tests where the feature usage was removed in this PR. Closes #84223
2021-12-04Rollup merge of #90519 - estebank:issue-84003, r=petrochenkovMatthias Krüger-0/+10
Keep spans for generics in `#[derive(_)]` desugaring Keep the spans for generics coming from a `derive`d Item, so that errors and suggestions have better detail. Fix #84003.
2021-12-03add `unwind_asm` feature gate for `may_unwind` optioncynecx-0/+1
2021-12-03Add initial AST and MIR support for unwinding from inline assemblyAmanieu d'Antras-0/+1
2021-12-03Auto merge of #90737 - eholk:intofuture, r=tmandrybors-0/+2
Reintroduce `into_future` in `.await` desugaring This is a reintroduction of the remaining parts from https://github.com/rust-lang/rust/pull/65244 that have not been relanded yet. This isn't quite ready to merge yet. The last attempt was reverting due to performance regressions, so we need to make sure this does not introduce those issues again. Issues #67644, #67982 /cc `@yoshuawuyts`
2021-12-03Annotate `derive`d spans and move span suggestion codeEsteban Kuber-0/+10
* Annotate `derive`d spans from the user's code with the appropciate context * Add `Span::can_be_used_for_suggestion` to query if the underlying span at the users' code
2021-12-03Improve 'cannot contain emoji' error.Mara Bos-0/+1
2021-12-03Improve the comments in `Symbol::interner`.Nicholas Nethercote-6/+13
2021-11-29std: Stabilize the `thread_local_const_init` featureAlex Crichton-1/+0
This commit is intended to follow the stabilization disposition of the FCP that has now finished in #84223. This stabilizes the ability to flag thread local initializers as `const` expressions which enables the macro to generate more efficient code for accessing it, notably removing runtime checks for initialization. More information can also be found in #84223 as well as the tests where the feature usage was removed in this PR. Closes #84223
2021-11-28Add parent crate assert to register_expn_idCameron Steffen-0/+1
2021-11-28Add fast path to is_descendant_ofCameron Steffen-2/+19
2021-11-25Rollup merge of #91096 - compiler-errors:elaborate_opaque_trait, r=estebankMatthias Krüger-0/+1
Print associated types on opaque `impl Trait` types This PR generalizes #91021, printing associated types for all opaque `impl Trait` types instead of just special-casing for future. before: ``` error[E0271]: type mismatch resolving `<impl Iterator as Iterator>::Item == u32` ``` after: ``` error[E0271]: type mismatch resolving `<impl Iterator<Item = usize> as Iterator>::Item == u32` ``` --- Questions: 1. I'm kinda lost in binders hell with this one. Is all of the `rebind`ing necessary? 2. Is there a map collection type that will give me a stable iteration order? Doesn't seem like TraitRef is Ord, so I can't just sort later.. 3. I removed the logic that suppresses printing generator projection types. It creates outputs like this [gist](https://gist.github.com/compiler-errors/d6f12fb30079feb1ad1d5f1ab39a3a8d). Should I put that back? 4. I also added spaces between traits, `impl A+B` -> `impl A + B`. I quite like this change, but is there a good reason to keep it like that? r? ````@estebank````
2021-11-24Rollup merge of #90420 - GuillaumeGomez:rustdoc-internals-feature, r=camelidGuillaume Gomez-0/+1
Create rustdoc_internals feature gate As suggested by ``@camelid`` [here](https://github.com/rust-lang/rust/pull/90398#issuecomment-955093851), since `doc_keyword` and `doc_primitive` aren't meant to be stabilized, we could put them behind a same feature flag. This is pretty much what it would look like (needs to update the tests too). The tracking issue is https://github.com/rust-lang/rust/issues/90418. What do you think ``@rust-lang/rustdoc`` ?
2021-11-24Create rustdoc_internals feature gateGuillaume Gomez-0/+1
2021-11-23Add generator lang-itemMichael Goulet-0/+1
2021-11-23Rollup merge of #91140 - nbdd0121:const_typeck, r=oli-obkMatthias Krüger-0/+1
Split inline const to two feature gates and mark expression position inline const complete This PR splits inline const in pattern position into its own `#![feature(inline_const_pat)]` feature gate, and make the usage in expression position complete. I think I have resolved most outstanding issues related to `inline_const` with #89561 and other PRs. The only thing left that I am aware of is #90150 and the lack of lifetime checks when inline const is used in pattern position (FIXME in #89561). Implementation-wise when used in pattern position it has to be lowered during MIR building while in expression position it's evaluated only when monomorphizing (just like normal consts), so it makes some sense to separate it into two feature gates so one can progress without being blocked by another. ``@rustbot`` label: T-compiler F-inline_const
2021-11-23Rollup merge of #90856 - ↵Matthias Krüger-0/+1
ken-matsui:suggestion-to-wrap-vec-allocator-api-in-tuple, r=davidtwco Suggestion to wrap inner types using 'allocator_api' in tuple This PR provides a suggestion to wrap the inner types in tuple when being along with 'allocator_api'. Closes https://github.com/rust-lang/rust/issues/83250 ```rust fn main() { let _vec: Vec<u8, _> = vec![]; //~ ERROR use of unstable library feature 'allocator_api' } ``` ```diff error[E0658]: use of unstable library feature 'allocator_api' --> $DIR/suggest-vec-allocator-api.rs:2:23 | LL | let _vec: Vec<u8, _> = vec![]; - | ^ + | ----^ + | | + | help: consider wrapping the inner types in tuple: `(u8, _)` | = note: see issue #32838 <https://github.com/rust-lang/rust/issues/32838> for more information = help: add `#![feature(allocator_api)]` to the crate attributes to enable ```
2021-11-24Suggestion to wrap inner types using `allocator_api` in tupleKen Matsui-0/+1
2021-11-22Reintroduce `into_future` in `.await` desugaringEric Holk-0/+2
This is a reintroduction of the remaining parts from https://github.com/rust-lang/rust/pull/65244 that have not been relanded yet. Issues GH-67644, GH-67982
2021-11-22Split inline const to two feature gatesGary Guo-0/+1
2021-11-21Simplify for loop desugarCameron Steffen-11/+3
2021-11-20Rollup merge of #90930 - Nilstrieb:fix-non-const-value-ice, r=estebankMatthias Krüger-0/+1
Fix `non-constant value` ICE (#90878) This also fixes the same suggestion, which was kind of broken, because it just searched for the last occurence of `const` to replace with a `let`. This works great in some cases, but when there is no const and a leading space to the file, it doesn't work and panic with overflow because it thought that it had found a const. I also changed the suggestion to only trigger if the `const` and the non-constant value are on the same line, because if they aren't, the suggestion is very likely to be wrong. Also don't trigger the suggestion if the found `const` is on line 0, because that triggers the ICE. Asking Esteban to review since he was the last one to change the relevant code. r? ``@estebank`` Fixes #90878
2021-11-20Rollup merge of #90575 - m-ou-se:compatible-variant-improvements, r=estebankMatthias Krüger-7/+12
Improve suggestions for compatible variants on type mismatch. Fixes #90553. Before: ![image](https://user-images.githubusercontent.com/783247/140385675-6ff41090-eca2-41bc-b161-99c5dabfec61.png) After: ![image](https://user-images.githubusercontent.com/783247/140385748-20cf26b5-ea96-4e56-8af2-5fe1ab16fd3b.png) r? `````@estebank`````
2021-11-18rustc: Remove `#[rustc_synthetic]`Vadim Petrochenkov-1/+0
This function parameter attribute was introduced in https://github.com/rust-lang/rust/pull/44866 as an intermediate step in implementing `impl Trait`, it's not necessary or used anywhere by itself.
2021-11-16Add SourceMap::indentation_before.Mara Bos-7/+12
2021-11-15Fix `non-constant value` ICE (#90878)Nilstrieb-0/+1
This also fixes the same suggestion, which was kind of broken, because it just searched for the last occurence of `const` to replace with a `let`. This works great in some cases, but when there is no const and a leading space to the file, it doesn't work and panic with overflow because it thought that it had found a const. I also changed the suggestion to only trigger if the `const` and the non-constant value are on the same line, because if they aren't, the suggestion is very likely to be wrong. Also don't trigger the suggestion if the found `const` is on line 0, because that triggers the ICE.
2021-11-09Auto merge of #90485 - camsteffen:fmt-args-less-bind, r=m-ou-sebors-0/+1
Don't destructure args tuple in format_args! This allows Clippy to parse the HIR more simply since `arg0` is changed to `_args.0`. (cc rust-lang/rust-clippy#7843). From rustc's perspective, I think this is something between a lateral move and a tiny improvement since there are fewer bindings. r? `@m-ou-se`
2021-11-07Auto merge of #90668 - matthiaskrgr:clippy_nov7, r=jyn514bors-10/+5
more clippy fixes
2021-11-07more clippy fixesMatthias Krüger-10/+5
2021-11-07Auto merge of #90348 - Amanieu:asm_feature_gates, r=joshtriplettbors-0/+3
Add features gates for experimental asm features This PR splits off parts of `asm!` into separate features because they are not ready for stabilization. Specifically this adds: - `asm_const` for `const` operands. - `asm_sym` for `sym` operands. - `asm_experimental_arch` for architectures other than x86, x86_64, arm, aarch64 and riscv. r? `@nagisa`
2021-11-07Add features gates for experimental asm featuresAmanieu d'Antras-0/+3
2021-11-06Don't destructure args tuple in format_args!Cameron Steffen-0/+1
2021-11-03Remove `MaybeMutBorrowedLocals`Tomasz Miąsko-1/+0
2021-11-02Split doc_cfg and doc_auto_cfg featuresGuillaume Gomez-0/+1
2021-10-30Rollup merge of #90202 - matthewjasper:xcrate-hygiene, r=petrochenkovGuillaume Gomez-1/+1
Improve and test cross-crate hygiene - Decode the parent expansion for traits and enums in `rustc_resolve`, this was already being used for resolution in typeck - Avoid suggesting importing names with def-site hygiene, since it's often not useful - Add more tests r? `@petrochenkov`