about summary refs log tree commit diff
path: root/compiler/rustc_span
AgeCommit message (Collapse)AuthorLines
2022-04-08Split `fuzzy_provenance_casts` into lossy and fuzzy, feature gate and test itniluxv-0/+1
* split `fuzzy_provenance_casts` into a ptr2int and a int2ptr lint * feature gate both lints * update documentation to be more realistic short term * add tests for these lints
2022-04-05span: move `MultiSpan`David Wood-137/+0
`MultiSpan` contains labels, which are more complicated with the introduction of diagnostic translation and will use types from `rustc_errors` - however, `rustc_errors` depends on `rustc_span` so `rustc_span` cannot use types like `DiagnosticMessage` without dependency cycles. Introduce a new `rustc_error_messages` crate that can contain `DiagnosticMessage` and `MultiSpan`. Signed-off-by: David Wood <david.wood@huawei.com>
2022-04-04Mention implementers of unsatisfied traitEsteban Kuber-0/+4
When encountering an unsatisfied trait bound, if there are no other suggestions, mention all the types that *do* implement that trait: ``` error[E0277]: the trait bound `f32: Foo` is not satisfied --> $DIR/impl_wf.rs:22:6 | LL | impl Baz<f32> for f32 { } | ^^^^^^^^ the trait `Foo` is not implemented for `f32` | = help: the following other types implement trait `Foo`: Option<T> i32 str note: required by a bound in `Baz` --> $DIR/impl_wf.rs:18:31 | LL | trait Baz<U: ?Sized> where U: Foo { } | ^^^ required by this bound in `Baz` ``` Mention implementers of traits in `ImplObligation`s. Do not mention other `impl`s for closures, ranges and `?`.
2022-04-03Improve method name suggestionsOliver Downard-2/+82
Attempts to improve method name suggestions when a matching method name is not found. The approach taken is use the Levenshtein distance and account for substrings having a high distance but can sometimes be very close to the intended method (eg. empty vs is_empty).
2022-04-02Create 2024 editionJacob Pratt-2/+35
2022-03-31Rollup merge of #95497 - nyurik:compiler-spell-comments, r=compiler-errorsDylan DPC-3/+3
Spellchecking compiler comments This PR cleans up the rest of the spelling mistakes in the compiler comments. This PR does not change any literal or code spelling issues.
2022-03-31Rollup merge of #95011 - michaelwoerister:awaitee_field, r=tmandryDylan DPC-1/+1
async: Give predictable name to binding generated from .await expressions. This name makes it to debuginfo and allows debuggers to identify such bindings and their captured versions in suspended async fns. This will be useful for async stack traces, as discussed in https://internals.rust-lang.org/t/async-debugging-logical-stack-traces-setting-goals-collecting-examples/15547. I don't know if this needs some discussion by ````@rust-lang/compiler,```` e.g. about the name of the binding (`__awaitee`) or about the fact that this PR introduces a (soft) guarantee about a compiler generated name. Although, regarding the later, I think the same reasoning applies here as it does for debuginfo in general. r? ````@tmandry````
2022-03-31Rollup merge of #94869 - jackh726:gats_extended, r=compiler-errorsDylan DPC-0/+1
Add the generic_associated_types_extended feature Right now, this only ignore obligations that reference new placeholders in `poly_project_and_unify_type`. In the future, this might do other things, like allowing object-safe GATs. **This feature is *incomplete* and quite likely unsound. This is mostly just for testing out potential future APIs using a "relaxed" set of rules until we figure out *proper* rules.** Also drive by cleanup of adding a `ProjectAndUnifyResult` enum instead of using a `Result<Result<Option>>`. r? `@nikomatsakis`
2022-03-30Add the generic_associated_types_extended featureJack Huey-0/+1
2022-03-30Spellchecking compiler commentsYuri Astrakhan-3/+3
This PR cleans up the rest of the spelling mistakes in the compiler comments. This PR does not change any literal or code spelling issues.
2022-03-30remove now unnecessary lang itemslcnr-10/+0
2022-03-30rework implementation for inherent impls for builtin typeslcnr-0/+2
2022-03-30async: Give predictable, reserved name to binding generated from .await ↵Michael Woerister-1/+1
expressions. This name makes it to debuginfo and allows debuggers to identify such bindings and their captured versions in suspended async fns.
2022-03-27Make fatal DiagnosticBuilder yield neverMichael Goulet-1/+1
2022-03-24add diagnostic items for clippy'sMax Baumann-0/+4
2022-03-21Rename `~const Drop` to `~const Destruct`Deadbeef-1/+1
2022-03-21Add `Destructible` for replacing `~const Drop`Deadbeef-0/+1
2022-03-15Add deprecated_safe feature gate and attribute, cc #94978skippy10110-0/+1
2022-03-14Rollup merge of #90621 - adamgemmell:dev/stabilise-target-feature, r=AmanieuMatthias Krüger-0/+1
Stabilise `aarch64_target_feature` This PR stabilises `aarch64_target_feature` - see https://github.com/rust-lang/rust/issues/90620
2022-03-14Stabilise `aarch64_target_feature`Adam Gemmell-0/+1
2022-03-10Rollup merge of #94368 - c410-f3r:metaaaaaaaaaaaaaaaaaaaaaaaaaaa, r=petrochenkovDylan DPC-0/+1
[1/2] Implement macro meta-variable expressions See https://github.com/rust-lang/rust/pull/93545#issuecomment-1050963295 The logic behind `length`, `index` and `count` was removed but the parsing code is still present, i.e., everything is simply ignored like `ignored`. r? ``@petrochenkov``
2022-03-10Rollup merge of #94274 - djkoloski:unknown_unstable_lints, r=tmandryDylan DPC-0/+1
Treat unstable lints as unknown This change causes unstable lints to be ignored if the `unknown_lints` lint is allowed. To achieve this, it also changes lints to apply as soon as they are processed. Previously, lints in the same set were processed as a batch and then all simultaneously applied. Implementation of https://github.com/rust-lang/compiler-team/issues/469
2022-03-10Rollup merge of #94635 - jhpratt:merge-deprecated-attrs, r=davidtwcoMatthias Krüger-0/+1
Merge `#[deprecated]` and `#[rustc_deprecated]` The first commit makes "reason" an alias for "note" in `#[rustc_deprecated]`, while still prohibiting it in `#[deprecated]`. The second commit changes "suggestion" to not just be a feature of `#[rustc_deprecated]`. This is placed behind the new `deprecated_suggestion` feature. This needs a tracking issue; let me know if this PR will be approved and I can create one. The third commit is what permits `#[deprecated]` to be used when `#![feature(staged_api)]` is enabled. This isn't yet used in stdlib (only tests), as it would require duplicating all deprecation attributes until a bootstrap occurs. I intend to submit a follow-up PR that replaces all uses and removes the remaining `#[rustc_deprecated]` code after the next bootstrap. `@rustbot` label +T-libs-api +C-feature-request +A-attributes +S-waiting-on-review
2022-03-10Auto merge of #94787 - matthiaskrgr:rollup-yyou15f, r=matthiaskrgrbors-0/+1
Rollup of 8 pull requests Successful merges: - #91804 (Make some `Clone` impls `const`) - #92541 (Mention intent of `From` trait in its docs) - #93057 (Add Iterator::collect_into) - #94739 (Suggest `if let`/`let_else` for refutable pat in `let`) - #94754 (Warn users about `||` in let chain expressions) - #94763 (Add documentation about lifetimes to thread::scope.) - #94768 (Ignore `close_read_wakes_up` test on SGX platform) - #94772 (Add miri to the well known conditional compilation names and values) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-03-09New `deprecated_suggestion` feature, use in testsJacob Pratt-0/+1
2022-03-09Implement macro meta-variable expressionsCaio-0/+1
2022-03-09Add miri to the well known conditional compilation names and valuesLoïc BRANSTETT-0/+1
2022-03-08Treat unstable lints as unknownDavid Koloski-0/+1
This change causes unstable lints to be ignored if the `unknown_lints` lint is allowed. To achieve this, it also changes lints to apply as soon as they are processed. Previously, lints in the same set were processed as a batch and then all simultaneously applied. Implementation of https://github.com/rust-lang/compiler-team/issues/469
2022-03-08add `#[rustc_pass_by_value]` to more typeslcnr-2/+3
2022-03-07Rollup merge of #94614 - pierwill:localexpnid-noord, r=lcnrMatthias Krüger-0/+7
Remove ordering traits from `rustc_span::hygiene::LocalExpnId` Part of work on #90317. Also adds a negative impl block as a form of documentation and a roadblock to regression.
2022-03-04Rollup merge of #94362 - Urgau:check-cfg-values, r=petrochenkovDylan DPC-0/+1
Add well known values to `--check-cfg` implementation This pull-request adds well known values for the well known names via `--check-cfg=values()`. [RFC 3013: Checking conditional compilation at compile time](https://rust-lang.github.io/rfcs/3013-conditional-compilation-checking.html#checking-conditional-compilation-at-compile-time) doesn't define this at all, but this seems a nice improvement. The activation is done by a empty `values()` (new syntax) similar to `names()` except that `names(foo)` also activate well known names while `values(aa, "aa", "kk")` would not. As stated this use a different activation logic because well known values for the well known names are not always sufficient. In fact this is problematic for every `target_*` cfg because of non builtin targets, as the current implementation use those built-ins targets to create the list the well known values. The implementation is straight forward, first we gather (if necessary) all the values (lazily or not) and then we apply them. r? ```@petrochenkov```
2022-03-04Remove ordering traits from `rustc_span::hygiene::LocalExpnId`pierwill-0/+7
2022-03-04Add well known values to --check-cfg implementationLoïc BRANSTETT-0/+1
2022-03-04Rollup merge of #94339 - Amanieu:arm-d32, r=nagisaDylan DPC-0/+1
ARM: Only allow using d16-d31 with asm! when supported by the target Support can be determined by checking for the "d32" LLVM feature. r? ```````````````@nagisa```````````````
2022-02-28Auto merge of #94427 - cjgillot:inline-fresh-expn, r=oli-obkbors-13/+8
Only create a single expansion for each inline integration. The inlining integrator used to create one expansion for each span from the callee body. This PR reverses the logic to create a single expansion for the whole call, which is more consistent with how macro expansions work for macros. This should remove the large memory regression in #91743.
2022-02-27Only create a single expansion for each inline integration.Camille GILLOT-13/+8
2022-02-25Enable rustc_pass_by_value for SpanMark Rousskov-2/+2
2022-02-25Switch bootstrap cfgsMark Rousskov-10/+3
2022-02-24ARM: Only allow using d16-d31 with asm! when supported by the targetAmanieu d'Antras-0/+1
Support can be determined by checking for the "d32" LLVM feature.
2022-02-22Rollup merge of #94169 - Amanieu:asm_stuff, r=nagisaMatthias Krüger-1/+0
Fix several asm! related issues This is a combination of several fixes, each split into a separate commit. Splitting these into PRs is not practical since they conflict with each other. Fixes #92378 Fixes #85247 r? ``@nagisa``
2022-02-21On ARM, use relocation_model to detect whether r9 should be reservedAmanieu d'Antras-1/+0
The previous approach of checking for the reserve-r9 target feature didn't actually work because LLVM only sets this feature very late when initializing the per-function subtarget.
2022-02-20Delete Decoder::read_struct_fieldMark Rousskov-20/+14
2022-02-20Delete Decoder::read_structMark Rousskov-62/+57
2022-02-20Rollup merge of #94146 - est31:let_else, r=cjgillotMatthias Krüger-7/+4
Adopt let else in more places Continuation of #89933, #91018, #91481, #93046, #93590, #94011. I have extended my clippy lint to also recognize tuple passing and match statements. The diff caused by fixing it is way above 1 thousand lines. Thus, I split it up into multiple pull requests to make reviewing easier. This is the biggest of these PRs and handles the changes outside of rustdoc, rustc_typeck, rustc_const_eval, rustc_trait_selection, which were handled in PRs #94139, #94142, #94143, #94144.
2022-02-19Adopt let else in more placesest31-7/+4
2022-02-18Rollup merge of #93915 - Urgau:rfc-3013, r=petrochenkovMatthias Krüger-0/+2
Implement --check-cfg option (RFC 3013), take 2 This pull-request implement RFC 3013: Checking conditional compilation at compile time (https://github.com/rust-lang/rfcs/pull/3013) and is based on the previous attempt https://github.com/rust-lang/rust/pull/89346 by `@mwkmwkmwk` that was closed due to inactivity. I have address all the review comments from the previous attempt and added some more tests. cc https://github.com/rust-lang/rust/issues/82450 r? `@petrochenkov`
2022-02-18Rollup merge of #91675 - ivanloz:memtagsan, r=nagisaMatthias Krüger-0/+1
Add MemTagSanitizer Support Add support for the LLVM [MemTagSanitizer](https://llvm.org/docs/MemTagSanitizer.html). On hardware which supports it (see caveats below), the MemTagSanitizer can catch bugs similar to AddressSanitizer and HardwareAddressSanitizer, but with lower overhead. On a tag mismatch, a SIGSEGV is signaled with code SEGV_MTESERR / SEGV_MTEAERR. # Usage `-Zsanitizer=memtag -C target-feature="+mte"` # Comments/Caveats * MemTagSanitizer is only supported on AArch64 targets with hardware support * Requires `-C target-feature="+mte"` * LLVM MemTagSanitizer currently only performs stack tagging. # TODO * Tests * Example
2022-02-16Destabilize cfg(target_has_atomic_load_store = ...)Mark Rousskov-0/+1
This was not intended to be stabilized yet.
2022-02-16MemTagSanitizer SupportIvan Lozano-0/+1
Adds support for the LLVM MemTagSanitizer.
2022-02-16Implement --check-cfg option (RFC 3013)Loïc BRANSTETT-0/+2
Co-authored-by: Urgau <lolo.branstett@numericable.fr> Co-authored-by: Marcelina Kościelnicka <mwk@0x04.net>