]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoGeneralize same_type_modulo_infer
Michael Goulet [Thu, 21 Jul 2022 15:45:35 +0000 (15:45 +0000)]
Generalize same_type_modulo_infer

2 years agoAnd for patterns too
Michael Goulet [Thu, 21 Jul 2022 01:26:00 +0000 (01:26 +0000)]
And for patterns too

2 years agoDo if-expression obligation stuff less eagerly
Michael Goulet [Thu, 21 Jul 2022 00:03:02 +0000 (00:03 +0000)]
Do if-expression obligation stuff less eagerly

2 years agoResolve vars in same_type_modulo_infer
Michael Goulet [Wed, 20 Jul 2022 23:42:24 +0000 (23:42 +0000)]
Resolve vars in same_type_modulo_infer

2 years agoAuto merge of #99540 - Mark-Simulacrum:bump-beta, r=jyn514
bors [Thu, 21 Jul 2022 03:17:38 +0000 (03:17 +0000)]
Auto merge of #99540 - Mark-Simulacrum:bump-beta, r=jyn514

Bump to latest beta bootstrap compiler

Hopefully this will address https://github.com/rust-lang/rust/issues/99538, but I'm not sure we can confirm that without rolling it out. Should be safe in general, so likely little risk to just landing this.

2 years agoBump to latest beta
Mark Rousskov [Thu, 21 Jul 2022 01:36:08 +0000 (01:36 +0000)]
Bump to latest beta

2 years agoAuto merge of #99058 - michaelwoerister:remove-stable-set-and-map, r=nagisa
bors [Wed, 20 Jul 2022 22:19:30 +0000 (22:19 +0000)]
Auto merge of #99058 - michaelwoerister:remove-stable-set-and-map, r=nagisa

Remove the unused StableSet and StableMap types from rustc_data_structures.

The current implementation is not "stable" in the same sense that `HashStable` and `StableHasher` are stable, i.e. across compilation sessions. So, in my opinion, it's better to remove those types (which are basically unused anyway) than to give the wrong impression that these are safe for incr. comp.

I plan to provide new "stable" collection types soon that can be used to replace `FxHashMap` and `FxHashSet` in query results (see [draft](https://github.com/michaelwoerister/rust/commit/69d03ac7a7d651a397ab793e9d78f8fce3edf7a6)). It's unsound that `HashMap` and `HashSet` implement `HashStable` (see https://github.com/rust-lang/rust/issues/98890 for a recent P-critical bug caused by this) -- so we should make some progress there.

2 years agoAuto merge of #99520 - matthiaskrgr:rollup-05uuv5s, r=matthiaskrgr
bors [Wed, 20 Jul 2022 19:37:17 +0000 (19:37 +0000)]
Auto merge of #99520 - matthiaskrgr:rollup-05uuv5s, r=matthiaskrgr

Rollup of 9 pull requests

Successful merges:

 - #99212 (introduce `implied_by` in `#[unstable]` attribute)
 - #99352 (Use `typeck_results` to avoid duplicate `ast_ty_to_ty` call)
 - #99355 (better error for bad depth parameter on macro metavar expr)
 - #99480 (Diagnostic width span is not added when '0$' is used as width in format strings)
 - #99488 (compiletest: Allow using revisions with debuginfo tests.)
 - #99489 (rustdoc UI fixes)
 - #99508 (Avoid `Symbol` to `String` conversions)
 - #99510 (adapt assembly/static-relocation-model test for LLVM change)
 - #99516 (Use new tracking issue for proc_macro::tracked_*.)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

2 years agoRollup merge of #99516 - m-ou-se:proc-macro-tracked-tracking-issue, r=Mark-Simulacrum
Matthias Krüger [Wed, 20 Jul 2022 16:58:22 +0000 (18:58 +0200)]
Rollup merge of #99516 - m-ou-se:proc-macro-tracked-tracking-issue, r=Mark-Simulacrum

Use new tracking issue for proc_macro::tracked_*.

2 years agoRollup merge of #99510 - krasimirgg:movb, r=nikic
Matthias Krüger [Wed, 20 Jul 2022 16:58:21 +0000 (18:58 +0200)]
Rollup merge of #99510 - krasimirgg:movb, r=nikic

adapt assembly/static-relocation-model test for LLVM change

After https://github.com/llvm/llvm-project/commit/f0dd12ec5c0169ba5b4363b62d59511181cf954a LLVM emits `movzbl` instead. Adapted this test case accordingly.

Discovered in our experimental rust + llvm at head ci:
https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/12104#0182195b-8791-4f88-853c-bb23a1e4b54c

2 years agoRollup merge of #99508 - TaKO8Ki:avoid-symbol-to-string-conversion-in-BuiltinLintDiag...
Matthias Krüger [Wed, 20 Jul 2022 16:58:20 +0000 (18:58 +0200)]
Rollup merge of #99508 - TaKO8Ki:avoid-symbol-to-string-conversion-in-BuiltinLintDiagnostics, r=compiler-errors

Avoid `Symbol` to `String` conversions

follow-up to #99342

2 years agoRollup merge of #99489 - GuillaumeGomez:gui-fixes, r=notriddle
Matthias Krüger [Wed, 20 Jul 2022 16:58:19 +0000 (18:58 +0200)]
Rollup merge of #99489 - GuillaumeGomez:gui-fixes, r=notriddle

rustdoc UI fixes

The first commit fixes this bug:

![Screenshot from 2022-07-20 02-54-26](https://user-images.githubusercontent.com/3050060/179879053-fc34f27a-6248-4f5c-9fcb-80adbfc1598c.png)
![Screenshot from 2022-07-20 03-00-03](https://user-images.githubusercontent.com/3050060/179879056-1c0973a0-d535-44e7-a48e-bad692034467.png)

The second one fixes the missing change of border color when the search input is focused.

cc `@jsha`
r? `@notriddle`

2 years agoRollup merge of #99488 - luqmana:debuginfo-revisions, r=tmiasko
Matthias Krüger [Wed, 20 Jul 2022 16:58:18 +0000 (18:58 +0200)]
Rollup merge of #99488 - luqmana:debuginfo-revisions, r=tmiasko

compiletest: Allow using revisions with debuginfo tests.

A small wart that came up in https://github.com/rust-lang/rust/pull/95685#issuecomment-1089184951.

2 years agoRollup merge of #99480 - miam-miam100:arg-format, r=oli-obk
Matthias Krüger [Wed, 20 Jul 2022 16:58:17 +0000 (18:58 +0200)]
Rollup merge of #99480 - miam-miam100:arg-format, r=oli-obk

Diagnostic width span is not added when '0$' is used as width in format strings

When the following code is run rustc does not add diagnostic spans for the width argument. Such spans are necessary for a clippy lint that I am currently writing.

```rust
println!("Hello {1:0$}!", 5, "x");
//                 ^^
// Should have a span here
```

2 years agoRollup merge of #99355 - compiler-errors:macro-metavar-less-than-zero, r=petrochenkov
Matthias Krüger [Wed, 20 Jul 2022 16:58:16 +0000 (18:58 +0200)]
Rollup merge of #99355 - compiler-errors:macro-metavar-less-than-zero, r=petrochenkov

better error for bad depth parameter on macro metavar expr

Fixes #99060

2 years agoRollup merge of #99352 - compiler-errors:tighter-spans-on-generic-call, r=spastorino
Matthias Krüger [Wed, 20 Jul 2022 16:58:15 +0000 (18:58 +0200)]
Rollup merge of #99352 - compiler-errors:tighter-spans-on-generic-call, r=spastorino

Use `typeck_results` to avoid duplicate `ast_ty_to_ty` call

Comes with a bunch of improvements in spans :heart_eyes:

2 years agoRollup merge of #99212 - davidtwco:partial-stability-implies, r=michaelwoerister
Matthias Krüger [Wed, 20 Jul 2022 16:58:14 +0000 (18:58 +0200)]
Rollup merge of #99212 - davidtwco:partial-stability-implies, r=michaelwoerister

introduce `implied_by` in `#[unstable]` attribute

Requested by the library team [on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/better.20support.20for.20partial.20stabilizations/near/285581519).

If part of a feature is stabilized and a new feature is added for the remaining parts, then the `implied_by` meta-item can be added to `#[unstable]` to indicate which now-stable feature was used previously.

```diagnostic
error: the feature `foo` has been partially stabilized since 1.62.0 and is succeeded by the feature `foobar`
  --> $DIR/stability-attribute-implies-using-unstable.rs:3:12
   |
LL | #![feature(foo)]
   |            ^^^
   |
note: the lint level is defined here
  --> $DIR/stability-attribute-implies-using-stable.rs:2:9
   |
LL | #![deny(stable_features)]
   |         ^^^^^^^^^^^^^^^
help: if you are using features which are still unstable, change to using `foobar`
   |
LL | #![feature(foobar)]
   |            ~~~~~~
help: if you are using features which are now stable, remove this line
   |
LL - #![feature(foo)]
   |
```

When a `#![feature(..)]` attribute still exists for the now-stable attribute, then there this has two effects:

- There will not be an stability error for uses of items from the implied feature which are still unstable (until the `#![feature(..)]` is removed or updated to the new feature).
- There will be an improved diagnostic for the remaining use of the feature attribute for the now-stable feature.

```rust
        /// If part of a feature is stabilized and a new feature is added for the remaining parts,
        /// then the `implied_by` attribute is used to indicate which now-stable feature previously
        /// contained a item.
        ///
        /// ```pseudo-Rust
        /// #[unstable(feature = "foo", issue = "...")]
        /// fn foo() {}
        /// #[unstable(feature = "foo", issue = "...")]
        /// fn foobar() {}
        /// ```
        ///
        /// ...becomes...
        ///
        /// ```pseudo-Rust
        /// #[stable(feature = "foo", since = "1.XX.X")]
        /// fn foo() {}
        /// #[unstable(feature = "foobar", issue = "...", implied_by = "foo")]
        /// fn foobar() {}
        /// ```
```

In the Zulip discussion, this was envisioned as `implies` on `#[stable]` but I went with `implied_by` on `#[unstable]` because it means that only the unstable attribute needs to be changed in future, not the new stable attribute, which seems less error-prone. It also isn't particularly feasible for me to detect whether items from the implied feature are used and then only suggest updating _or_ removing the `#![feature(..)]` as appropriate, so I always do both.

There's some new information in the cross-crate metadata as a result of this change, that's a little unfortunate, but without requiring that the `#[unstable]` and `#[stable]` attributes both contain the implication information, it's necessary:

```rust
    /// This mapping is necessary unless both the `#[stable]` and `#[unstable]` attributes should
    /// specify their implications (both `implies` and `implied_by`). If only one of the two
    /// attributes do (as in the current implementation, `implied_by` in `#[unstable]`), then this
    /// mapping is necessary for diagnostics. When a "unnecessary feature attribute" error is
    /// reported, only the `#[stable]` attribute information is available, so the map is necessary
    /// to know that the feature implies another feature. If it were reversed, and the `#[stable]`
    /// attribute had an `implies` meta item, then a map would be necessary when avoiding a "use of
    /// unstable feature" error for a feature that was implied.
```

I also change some comments to documentation comments in the compiler, add a helper for going from a `Span` to a `Span` for the entire line, and fix a incorrect part of the pre-existing stability attribute diagnostics.

cc `@yaahc`

2 years agoAuto merge of #99472 - RalfJung:provenance, r=oli-obk
bors [Wed, 20 Jul 2022 16:56:31 +0000 (16:56 +0000)]
Auto merge of #99472 - RalfJung:provenance, r=oli-obk

interpret: rename Tag/PointerTag to Prov/Provenance

We were pretty inconsistent with calling this the "tag" vs the "provenance" of the pointer; I think we should consistently call it "provenance".

r? `@oli-obk`

2 years agoUse new tracking issue for proc_macro::tracked_*.
Mara Bos [Wed, 20 Jul 2022 15:35:06 +0000 (17:35 +0200)]
Use new tracking issue for proc_macro::tracked_*.

2 years agopasses: check implied feature exists
David Wood [Wed, 20 Jul 2022 13:52:23 +0000 (14:52 +0100)]
passes: check implied feature exists

Add a check confirming that features referenced in `implied_by` meta
items actually exist.

Signed-off-by: David Wood <david.wood@huawei.com>
2 years agopasses: improved partial stabilization diagnostic
David Wood [Wed, 13 Jul 2022 14:10:19 +0000 (15:10 +0100)]
passes: improved partial stabilization diagnostic

Improves the diagnostic when a feature attribute is specified
unnecessarily but the feature implies another (i.e. it was partially
stabilized) to refer to the implied feature.

Signed-off-by: David Wood <david.wood@huawei.com>
2 years agospan: add `span_extend_to_line` helper
David Wood [Wed, 13 Jul 2022 14:02:23 +0000 (15:02 +0100)]
span: add `span_extend_to_line` helper

Adds a simple helper function to the `SourceMap` for extending a `Span`
to encompass the entire line it is on - useful for suggestions where
removing a line is the suggested action.

Signed-off-by: David Wood <david.wood@huawei.com>
2 years agomiddle: add `implies_by` to `#[unstable]`
David Wood [Wed, 13 Jul 2022 12:10:37 +0000 (13:10 +0100)]
middle: add `implies_by` to `#[unstable]`

If part of a feature is stabilized and a new feature is added for the
remaining parts, then the `implied_by` attribute can be used to indicate
which now-stable feature previously contained a item. If the now-stable
feature is still active (if the user has only just updated rustc, for
example) then there will not be an stability error for uses of the item
from the implied feature.

Signed-off-by: David Wood <david.wood@huawei.com>
2 years agoAuto merge of #99506 - Dylan-DPC:rollup-q3msucx, r=Dylan-DPC
bors [Wed, 20 Jul 2022 13:36:59 +0000 (13:36 +0000)]
Auto merge of #99506 - Dylan-DPC:rollup-q3msucx, r=Dylan-DPC

Rollup of 7 pull requests

Successful merges:

 - #98101 (stdlib support for Apple WatchOS)
 - #99345 (Do not allow typeck children items to constrain outer RPITs)
 - #99383 (Formalize defining_use_anchor)
 - #99436 (Add flag to configure `noalias` on `Box<T>`)
 - #99483 (Fix a numerical underflow in tuple wrap suggestion)
 - #99485 (Stop injecting `#[allow(unused_qualifications)]` in generated `derive` implementations)
 - #99486 (Refactor: remove a string comparison between types in `check_str_addition`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

2 years agoadapt assembly/static-relocation-model test for LLVM change
Krasimir Georgiev [Wed, 20 Jul 2022 12:56:42 +0000 (12:56 +0000)]
adapt assembly/static-relocation-model test for LLVM change

After
https://github.com/llvm/llvm-project/commit/f0dd12ec5c0169ba5b4363b62d59511181cf954a,
LLVM emits `movzbl` instead. Adapted this test case accordingly.

Discovered in our experimental rust + llvm at head ci:
https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/12104#0182195b-8791-4f88-853c-bb23a1e4b54c

2 years agoFix off by one error and add ui test.
miam-miam100 [Wed, 20 Jul 2022 12:40:45 +0000 (13:40 +0100)]
Fix off by one error and add ui test.

2 years agoAdd diagnostic width span when '0$' is used as width.
miam-miam100 [Tue, 19 Jul 2022 21:25:26 +0000 (22:25 +0100)]
Add diagnostic width span when '0$' is used as width.

2 years agoRemove unused StableMap and StableSet types from rustc_data_structures
Michael Woerister [Fri, 8 Jul 2022 16:06:18 +0000 (18:06 +0200)]
Remove unused StableMap and StableSet types from rustc_data_structures

2 years agoRollup merge of #99486 - TaKO8Ki:remove-type-string-comparison-in-check-str-addition...
Dylan DPC [Wed, 20 Jul 2022 10:47:23 +0000 (16:17 +0530)]
Rollup merge of #99486 - TaKO8Ki:remove-type-string-comparison-in-check-str-addition, r=compiler-errors

Refactor: remove a string comparison between types in `check_str_addition`

This patch removes remove a string of types comparison.

2 years agoRollup merge of #99485 - mdholloway:unused-qualifications-in-derive, r=oli-obk
Dylan DPC [Wed, 20 Jul 2022 10:47:22 +0000 (16:17 +0530)]
Rollup merge of #99485 - mdholloway:unused-qualifications-in-derive, r=oli-obk

Stop injecting `#[allow(unused_qualifications)]` in generated `derive` implementations

Currently, the `#[derive]` attribute always injects an `#[allow(unused_qualifications)]` attribute in the generated implementation. This results in an error when a derive is used in combination with `#![forbid(unused_qualifications)]`, because the `forbid` rule by definition cannot be overridden by `allow`.

It appears that the original issue that prompted the inclusion of `#[allow(unused_qualifications)]` (#19102) is no longer present in the current stable release, and the associated [test case](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-19102.rs) still passes, so the `allow` is simply removed here.

Fixes #71898.

2 years agoRollup merge of #99483 - compiler-errors:issue-99482, r=jyn514
Dylan DPC [Wed, 20 Jul 2022 10:47:21 +0000 (16:17 +0530)]
Rollup merge of #99483 - compiler-errors:issue-99482, r=jyn514

Fix a numerical underflow in tuple wrap suggestion

Fixes #99482

I'm a clown, I rewrote the arg mismatch algo to use well-typed indices to avoid things like this, but then I added my own indexing bug, lol.

2 years agoRollup merge of #99436 - Nilstrieb:toggle-box-noalias, r=fee1-dead
Dylan DPC [Wed, 20 Jul 2022 10:47:20 +0000 (16:17 +0530)]
Rollup merge of #99436 - Nilstrieb:toggle-box-noalias, r=fee1-dead

Add flag to configure `noalias` on `Box<T>`

The aliasing rules of `Box<T>` are still not decided, but currently, `Box<T>` is unique and gets `noalias`. To aid making an informed decision about the future of `Box<T>`, this PR adds a flag `-Zbox-noalias` to configure `noalias` for `Box<T>` (for example, for benchmarking). The same flag already exists for `&mut T` `noalias`, where it was added because it was the problem of various miscompilations in LLVM.

For more information, see rust-lang/unsafe-code-guidelines#326

2 years agoRollup merge of #99383 - ouz-a:issue_57961, r=oli-obk
Dylan DPC [Wed, 20 Jul 2022 10:47:19 +0000 (16:17 +0530)]
Rollup merge of #99383 - ouz-a:issue_57961, r=oli-obk

Formalize defining_use_anchor

This tackles issue #57961

Introduces new enum called `DefiningAnchor` that replaces `Option<LocalDefId>` of `defining_use_anchor`. Now every use of it is explicit and exhaustively matched, catching errors like one in the linked issue. This is not a perfect fix but it's a step in the right direction.

r? `@oli-obk`

2 years agoRollup merge of #99345 - compiler-errors:issue-99073-redux, r=oli-obk
Dylan DPC [Wed, 20 Jul 2022 10:47:18 +0000 (16:17 +0530)]
Rollup merge of #99345 - compiler-errors:issue-99073-redux, r=oli-obk

Do not allow typeck children items to constrain outer RPITs

Fixes #99073 in a simpler and more conservative way than #99079. Simply raise a mismatched types error if we try to constrain an RPIT in an item that isn't the RPIT's parent.

r? `@oli-obk`

2 years agoRollup merge of #98101 - vladimir-ea:stdlib_watch_os, r=thomcc
Dylan DPC [Wed, 20 Jul 2022 10:47:17 +0000 (16:17 +0530)]
Rollup merge of #98101 - vladimir-ea:stdlib_watch_os, r=thomcc

stdlib support for Apple WatchOS

This is a follow-up to https://github.com/rust-lang/rust/pull/95243 (Add Apple WatchOS compiler targets) that adds stdlib support for Apple WatchOS.

`@deg4uss3r`
`@nagisa`

2 years agoUse FxIndexMap instead of otherwise unused StableMap for WEAK_ITEMS_REFS.
Michael Woerister [Fri, 8 Jul 2022 15:45:55 +0000 (17:45 +0200)]
Use FxIndexMap instead of otherwise unused StableMap for WEAK_ITEMS_REFS.

2 years agoAuto merge of #99495 - oli-obk:revert_98582, r=oli-obk
bors [Wed, 20 Jul 2022 10:34:42 +0000 (10:34 +0000)]
Auto merge of #99495 - oli-obk:revert_98582, r=oli-obk

Revert "Rollup merge of #98582 - oli-obk:unconstrained_opaque_type, r…

…=estebank"

This reverts commit 6f8fb911ad504b77549cf3256a09465621beab9d, reversing
changes made to 7210e46dc69a4b197a313d093fe145722c248b7d.

r? `@ghost`

rebase of https://github.com/rust-lang/rust/pull/99368

2 years agoattr: fix expected meta-item for `#[stable]`
David Wood [Wed, 13 Jul 2022 09:36:12 +0000 (10:36 +0100)]
attr: fix expected meta-item for `#[stable]`

When an unexpected meta item is provided to `#[stable]`, the diagnostic
lists "since" and "note" as expected meta-items, however the surrounding
code actually expects "feature" and "since".

Signed-off-by: David Wood <david.wood@huawei.com>
2 years agoattr/passes: comment -> doc comment
David Wood [Wed, 13 Jul 2022 09:09:37 +0000 (10:09 +0100)]
attr/passes: comment -> doc comment

Change some regular comments into documentation comments.

Signed-off-by: David Wood <david.wood@huawei.com>
2 years agoAdd GUI tests for search input border color
Guillaume Gomez [Wed, 20 Jul 2022 01:52:16 +0000 (03:52 +0200)]
Add GUI tests for search input border color

2 years agoRemove CSS transition for search input border-color
Guillaume Gomez [Wed, 20 Jul 2022 10:19:17 +0000 (12:19 +0200)]
Remove CSS transition for search input border-color

2 years agouse def_id
ouz-a [Wed, 20 Jul 2022 09:51:07 +0000 (12:51 +0300)]
use def_id

2 years agotake opaq types
ouz-a [Sat, 2 Jul 2022 13:37:49 +0000 (16:37 +0300)]
take opaq types

2 years agoavoid `&str` to String conversions
Takayuki Maeda [Wed, 20 Jul 2022 09:19:57 +0000 (18:19 +0900)]
avoid `&str` to String conversions

2 years agoavoid a `Symbol` to `String` conversion
Takayuki Maeda [Wed, 20 Jul 2022 09:19:25 +0000 (18:19 +0900)]
avoid a `Symbol` to `String` conversion

2 years agoLibrary changes for Apple WatchOS
Vladimir Michael Eatwell [Wed, 23 Mar 2022 16:05:01 +0000 (16:05 +0000)]
Library changes for Apple WatchOS

2 years agoRevert "Rollup merge of #98582 - oli-obk:unconstrained_opaque_type, r=estebank"
Oli Scherer [Wed, 20 Jul 2022 07:55:58 +0000 (07:55 +0000)]
Revert "Rollup merge of #98582 - oli-obk:unconstrained_opaque_type, r=estebank"

This reverts commit 6f8fb911ad504b77549cf3256a09465621beab9d, reversing
changes made to 7210e46dc69a4b197a313d093fe145722c248b7d.

2 years agocompiletest: dedup revision line logic.
Luqman Aden [Wed, 20 Jul 2022 02:13:33 +0000 (19:13 -0700)]
compiletest: dedup revision line logic.

2 years agoUse revision support to remove near identical debuginfo test.
Luqman Aden [Wed, 20 Jul 2022 01:30:12 +0000 (18:30 -0700)]
Use revision support to remove near identical debuginfo test.

2 years agocompiletest: allow using revisions with debuginfo tests
Luqman Aden [Wed, 20 Jul 2022 01:27:33 +0000 (18:27 -0700)]
compiletest: allow using revisions with debuginfo tests

2 years agoAuto merge of #99493 - Dylan-DPC:rollup-lli4gcx, r=Dylan-DPC
bors [Wed, 20 Jul 2022 07:03:54 +0000 (07:03 +0000)]
Auto merge of #99493 - Dylan-DPC:rollup-lli4gcx, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #98784 (Suggest returning local on "expected `ty`, found `()`" due to expr-less block)
 - #98916 (Windows: Use `FindFirstFileW` for getting the metadata of locked system files)
 - #99433 (Erase regions before comparing signatures of foreign fns.)
 - #99452 (int_macros was only using to_xe_bytes_doc and not from_xe_bytes_doc)
 - #99481 (Add regression test for #71547)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

2 years agoRollup merge of #99481 - JohnTitor:issue-71547, r=compiler-errors
Dylan DPC [Wed, 20 Jul 2022 05:59:41 +0000 (11:29 +0530)]
Rollup merge of #99481 - JohnTitor:issue-71547, r=compiler-errors

Add regression test for #71547

Closes #71547
r? `@compiler-errors`

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2 years agoRollup merge of #99452 - Stargateur:fix/typo, r=JohnTitor
Dylan DPC [Wed, 20 Jul 2022 05:59:40 +0000 (11:29 +0530)]
Rollup merge of #99452 - Stargateur:fix/typo, r=JohnTitor

int_macros was only using to_xe_bytes_doc and not from_xe_bytes_doc

typo in doc [here](https://doc.rust-lang.org/std/primitive.isize.html#method.from_ne_bytes) "returns" => "takes"

`@rustbot` label +T-rustdoc

2 years agoRollup merge of #99433 - cjgillot:erase-foreign-sig, r=compiler-errors
Dylan DPC [Wed, 20 Jul 2022 05:59:39 +0000 (11:29 +0530)]
Rollup merge of #99433 - cjgillot:erase-foreign-sig, r=compiler-errors

Erase regions before comparing signatures of foreign fns.

Fixes https://github.com/rust-lang/rust/issues/99276

The version with explicit lifetimes is probably tracked in another bug, but I could not find it.

2 years agoRollup merge of #98916 - ChrisDenton:hiberfil.sys, r=thomcc
Dylan DPC [Wed, 20 Jul 2022 05:59:38 +0000 (11:29 +0530)]
Rollup merge of #98916 - ChrisDenton:hiberfil.sys, r=thomcc

Windows: Use `FindFirstFileW` for getting the metadata of locked system files

Fixes #96980

Usually opening a file handle with access set to metadata only will always succeed, even if the file is locked. However some special system files, such as `C:\hiberfil.sys`, are locked by the system in a way that denies even that. So as a fallback we try reading the cached metadata from the directory.

Note that the test is a bit iffy. I don't know if `hiberfil.sys` actually exists in the CI.

r? rust-lang/libs

2 years agoRollup merge of #98784 - compiler-errors:forgot-to-return-binding, r=estebank
Dylan DPC [Wed, 20 Jul 2022 05:59:37 +0000 (11:29 +0530)]
Rollup merge of #98784 - compiler-errors:forgot-to-return-binding, r=estebank

Suggest returning local on "expected `ty`, found `()`" due to expr-less block

Putting this up for _initial_ review. Notably, this doesn't consider if the value has possibly been moved, or whether the type is `Copy`. It also provides a structured suggestion if there's one "preferred" binding that matches the type (i.e. one binding in the block or its parent), otherwise it just points them out if there's fewer than 4 of them.

Fixes #98177

r? `@estebank`

2 years agoAuto merge of #98843 - Urgau:check-cfg-stage0, r=Mark-Simulacrum
bors [Wed, 20 Jul 2022 04:23:09 +0000 (04:23 +0000)]
Auto merge of #98843 - Urgau:check-cfg-stage0, r=Mark-Simulacrum

Enable check-cfg in stage0

Now that the bootstrap cargo supports `rustc-check-cfg` we can now enable it with `-Zcheck-cfg=output` and use it in `rustc_llvm` to unblock `--check-cfg` support in stage0.

r? `@Mark-Simulacrum`

2 years agoSuggest returning binding from block or enclosing scope on coerce_forced_unit error
Michael Goulet [Tue, 19 Jul 2022 02:54:51 +0000 (02:54 +0000)]
Suggest returning binding from block or enclosing scope on coerce_forced_unit error

2 years agoFix CSS on search input focus
Guillaume Gomez [Wed, 20 Jul 2022 01:28:19 +0000 (03:28 +0200)]
Fix CSS on search input focus

2 years agoFix crate filter select display
Guillaume Gomez [Wed, 20 Jul 2022 01:00:23 +0000 (03:00 +0200)]
Fix crate filter select display

2 years agoAuto merge of #99484 - ehuss:update-cargo, r=ehuss
bors [Wed, 20 Jul 2022 00:08:55 +0000 (00:08 +0000)]
Auto merge of #99484 - ehuss:update-cargo, r=ehuss

Update cargo

9 commits in 8827baaa781b37872134c1ba692a6f0aeb37890e..d8d30a75376f78bb0fabe3d28ee9d87aa8035309
2022-07-14 02:56:51 +0000 to 2022-07-19 13:59:17 +0000
- docs: fixing minor error in the default timing report filename (rust-lang/cargo#10879)
- Stabilize `--crate-type` flag for `cargo rustc` (rust-lang/cargo#10838)
- Stabilize `-Zmultitarget` (rust-lang/cargo#10766)
- Clean up leftover in unstable documentation (rust-lang/cargo#10874)
- Normalize path for `cargo vendor` output (rust-lang/cargo#10668)
- add a reason to `masquerade_as_nightly_cargo` so it is searchable (rust-lang/cargo#10868)
- Allow '.' in workspace.default-members in non-virtual workspaces. (rust-lang/cargo#10784)
- remove`.masquerade_as_nightly_cargo()` from various tests the no longer need it (rust-lang/cargo#10867)
- remove `.masquerade_as_nightly_cargo()` from build_script_extra_link_arg.rs (rust-lang/cargo#10866)

2 years agoUpdate cargo
Eric Huss [Wed, 20 Jul 2022 00:01:12 +0000 (17:01 -0700)]
Update cargo

2 years agoRemove #[allow(unused_qualifications)] lines from derive diff test
Michael Holloway [Tue, 19 Jul 2022 23:38:58 +0000 (19:38 -0400)]
Remove #[allow(unused_qualifications)] lines from derive diff test

2 years agoFix a numerical underflow in tuple wrap suggestion
Michael Goulet [Tue, 19 Jul 2022 22:47:00 +0000 (22:47 +0000)]
Fix a numerical underflow in tuple wrap suggestion

2 years agoremove a type string comparison in `check_str_addition`
Takayuki Maeda [Tue, 19 Jul 2022 22:07:18 +0000 (07:07 +0900)]
remove a type string comparison in `check_str_addition`

2 years agoAdd regression test for #71547
Yuki Okushi [Tue, 19 Jul 2022 21:42:35 +0000 (06:42 +0900)]
Add regression test for #71547

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2 years agointerpret: rename Tag/PointerTag to Prov/Provenance
Ralf Jung [Mon, 18 Jul 2022 22:47:31 +0000 (18:47 -0400)]
interpret: rename Tag/PointerTag to Prov/Provenance

Let's avoid using two different terms for the same thing -- let's just call it "provenance" everywhere.
In Miri, provenance consists of an AllocId and an SbTag (Stacked Borrows tag), which made this even more confusing.

2 years agoAuto merge of #98180 - notriddle:notriddle/rustdoc-fn, r=petrochenkov,GuillaumeGomez
bors [Tue, 19 Jul 2022 19:36:57 +0000 (19:36 +0000)]
Auto merge of #98180 - notriddle:notriddle/rustdoc-fn, r=petrochenkov,GuillaumeGomez

Improve the function pointer docs

This is #97842 but for function pointers instead of tuples. The concept is basically the same.

* Reduce duplicate impls; show `fn (T₁, T₂, …, Tₙ)` and include a sentence saying that there exists up to twelve of them.
* Show `Copy` and `Clone`.
* Show auto traits like `Send` and `Sync`, and blanket impls like `Any`.

https://notriddle.com/notriddle-rustdoc-test/std/primitive.fn.html

2 years agoErase regions before comparing signatures of foreign fns.
Camille GILLOT [Mon, 18 Jul 2022 18:41:27 +0000 (20:41 +0200)]
Erase regions before comparing signatures of foreign fns.

2 years agobetter error for bad depth on macro metavar expr
Michael Goulet [Sun, 17 Jul 2022 00:04:30 +0000 (00:04 +0000)]
better error for bad depth on macro metavar expr

2 years agoAuto merge of #99309 - RalfJung:no-large-copies, r=oli-obk
bors [Tue, 19 Jul 2022 16:33:45 +0000 (16:33 +0000)]
Auto merge of #99309 - RalfJung:no-large-copies, r=oli-obk

interpret: make some large types not Copy

Also remove some unused trait impls (mostly HashStable).

This didn't find any unnecessary copies that I managed to avoid, but it might still be better to require explicit clone for these types? Not sure.

r? `@oli-obk`

2 years agouse opaque_ty_origin_unchecked instead of destructuring HIR
Michael Goulet [Sun, 17 Jul 2022 17:37:23 +0000 (10:37 -0700)]
use opaque_ty_origin_unchecked instead of destructuring HIR

2 years agoDo not allow typeck children items to constrain outer RPITs
Michael Goulet [Sat, 16 Jul 2022 20:08:04 +0000 (20:08 +0000)]
Do not allow typeck children items to constrain outer RPITs

2 years agoUse `T` for all the function primitive docs lists
Michael Howell [Thu, 16 Jun 2022 21:44:09 +0000 (14:44 -0700)]
Use `T` for all the function primitive docs lists

2 years agoImprove the function pointer docs
Michael Howell [Thu, 16 Jun 2022 21:14:38 +0000 (14:14 -0700)]
Improve the function pointer docs

* Reduce duplicate impls; show only the `fn (T)` and include a sentence
  saying that there exists up to twelve of them.
* Show `Copy` and `Clone`.
* Show auto traits like `Send` and `Sync`, and blanket impls like `Any`.

2 years agoAdd flag to configure `noalias` on `Box<T>`
nils [Mon, 18 Jul 2022 16:17:27 +0000 (18:17 +0200)]
Add flag to configure `noalias` on `Box<T>`

To aid making an informed decision about the aliasing
rules of box, give users an option to remove `noalias`
from box.

2 years agoAuto merge of #99462 - matthiaskrgr:rollup-ihhwaru, r=matthiaskrgr
bors [Tue, 19 Jul 2022 13:49:56 +0000 (13:49 +0000)]
Auto merge of #99462 - matthiaskrgr:rollup-ihhwaru, r=matthiaskrgr

Rollup of 9 pull requests

Successful merges:

 - #98028 (Add E0790 as more specific variant of E0283)
 - #99384 (use body's param-env when checking if type needs drop)
 - #99401 (Avoid `Symbol` to `&str` conversions)
 - #99419 (Stabilize `core::task::ready!`)
 - #99435 (Revert "Stabilize $$ in Rust 1.63.0")
 - #99438 (Improve suggestions for `NonZeroT` <- `T` coercion error)
 - #99441 (Update mdbook)
 - #99453 (:arrow_up: rust-analyzer)
 - #99457 (use `par_for_each_in` in `par_body_owners` and `collect_crate_mono_items`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

2 years agoRollup merge of #99457 - SparrowLii:para_iter, r=fee1-dead
Matthias Krüger [Tue, 19 Jul 2022 11:30:52 +0000 (13:30 +0200)]
Rollup merge of #99457 - SparrowLii:para_iter, r=fee1-dead

use `par_for_each_in` in `par_body_owners` and `collect_crate_mono_items`

Using `par_iter` in non-parallel mode will cause the entire process to abort when any iteration panics.  So we can use `par_for_each_in` instead to make the error message consistent with parallel mode. This means that the compiler will output more error messages in some cases. This fixes the following ui tests when set `parallel-compiler = true`:
```
    [ui] src/test\ui\privacy\privacy2.rs
    [ui] src/test\ui\privacy\privacy3.rs
    [ui] src/test\ui\type_length_limit.rs
```

This refers to #68171

Updates #75760

2 years agoRollup merge of #99453 - lnicola:rust-analyzer-2022-07-19, r=lnicola
Matthias Krüger [Tue, 19 Jul 2022 11:30:51 +0000 (13:30 +0200)]
Rollup merge of #99453 - lnicola:rust-analyzer-2022-07-19, r=lnicola

:arrow_up: rust-analyzer

r? `@ghost`

2 years agoRollup merge of #99441 - ehuss:update-mdbook, r=Mark-Simulacrum
Matthias Krüger [Tue, 19 Jul 2022 11:30:50 +0000 (13:30 +0200)]
Rollup merge of #99441 - ehuss:update-mdbook, r=Mark-Simulacrum

Update mdbook

Updates mdbook from 0.4.18 to 0.4.20.
Changelog: https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-0420

This mainly includes some minor formatting and display changes.

2 years agoRollup merge of #99438 - WaffleLapkin:dont_wrap_in_non_zero, r=compiler-errors
Matthias Krüger [Tue, 19 Jul 2022 11:30:49 +0000 (13:30 +0200)]
Rollup merge of #99438 - WaffleLapkin:dont_wrap_in_non_zero, r=compiler-errors

Improve suggestions for `NonZeroT` <- `T` coercion error

Currently, when encountering a type mismatch error with `NonZeroT` and `T` (for example `NonZeroU8` and `u8`) we errorneusly suggest wrapping expression in `NonZeroT`:
```text
error[E0308]: mismatched types
 --> ./t.rs:7:35
  |
7 |     let _: std::num::NonZeroU64 = 1;
  |            --------------------   ^ expected struct `NonZeroU64`, found integer
  |            |
  |            expected due to this
  |
help: try wrapping the expression in `std::num::NonZeroU64`
  |
7 |     let _: std::num::NonZeroU64 = std::num::NonZeroU64(1);
  |                                   +++++++++++++++++++++ +
```

I've removed this suggestion and added suggestions to call `new` (for `Option<NonZeroT>` <- `T` case) or `new` and `unwrap` (for `NonZeroT` <- `T` case):

```text
error[E0308]: mismatched types
 --> ./t.rs:7:35
  |
7 |     let _: std::num::NonZeroU64 = 1;
  |            --------------------   ^ expected struct `NonZeroU64`, found integer
  |            |
  |            expected due to this
  |
help: Consider calling `NonZeroU64::new`
  |
7 |     let _: std::num::NonZeroU64 = NonZeroU64::new(1).unwrap();
  |                                   ++++++++++++++++ ++++++++++

error[E0308]: mismatched types
 --> ./t.rs:8:43
  |
8 |     let _: Option<std::num::NonZeroU64> = 1;
  |            ----------------------------   ^ expected enum `Option`, found integer
  |            |
  |            expected due to this
  |
  = note: expected enum `Option<NonZeroU64>`
             found type `{integer}`
help: Consider calling `NonZeroU64::new`
  |
8 |     let _: Option<std::num::NonZeroU64> = NonZeroU64::new(1);
  |                                           ++++++++++++++++ +
```

r? `@compiler-errors`

2 years agoRollup merge of #99435 - CAD97:revert-dollar-dollar-crate, r=Mark-Simulacrum
Matthias Krüger [Tue, 19 Jul 2022 11:30:48 +0000 (13:30 +0200)]
Rollup merge of #99435 - CAD97:revert-dollar-dollar-crate, r=Mark-Simulacrum

Revert "Stabilize $$ in Rust 1.63.0"

This mechanically reverts commit 9edaa76adce4de737db54194eb13d6c298827b37, the one commit from #95860.

https://github.com/rust-lang/rust/issues/99035; the behavior of `$$crate` is potentially unexpected and not ready to be stabilized. https://github.com/rust-lang/rust/pull/99193 attempts to forbid `$$crate` without also destabilizing `$$` more generally.

`@rustbot` modify labels +T-compiler +T-lang +P-medium +beta-nominated +relnotes

(applying the labels I think are accurate from the issue and alternative partial revert)

cc `@Mark-Simulacrum`

2 years agoRollup merge of #99419 - yoshuawuyts:stabilize-task-ready, r=Mark-Simulacrum
Matthias Krüger [Tue, 19 Jul 2022 11:30:47 +0000 (13:30 +0200)]
Rollup merge of #99419 - yoshuawuyts:stabilize-task-ready, r=Mark-Simulacrum

Stabilize `core::task::ready!`

This stabilizes `core::task::ready!` for Rust 1.64. The FCP for stabilization was just completed here https://github.com/rust-lang/rust/issues/70922#issuecomment-1186231855. Thanks!

Closes #70922

cc/ ``@rust-lang/libs-api``

2 years agoRollup merge of #99401 - TaKO8Ki:avoid-symbol-to-&str-conversions, r=nnethercote
Matthias Krüger [Tue, 19 Jul 2022 11:30:46 +0000 (13:30 +0200)]
Rollup merge of #99401 - TaKO8Ki:avoid-symbol-to-&str-conversions, r=nnethercote

Avoid `Symbol` to `&str` conversions

`Symbol::as_str` is a slowish operation, so this patch removes some usages of it.

2 years agoRollup merge of #99384 - compiler-errors:issue-99375, r=oli-obk
Matthias Krüger [Tue, 19 Jul 2022 11:30:45 +0000 (13:30 +0200)]
Rollup merge of #99384 - compiler-errors:issue-99375, r=oli-obk

use body's param-env when checking if type needs drop

The type comes from the body, so we should be using the body's param-env, as opposed to the ADT's param env, because we know less in the latter compared to the former.

Fixes #99375

2 years agoRollup merge of #98028 - aticu:master, r=estebank
Matthias Krüger [Tue, 19 Jul 2022 11:30:44 +0000 (13:30 +0200)]
Rollup merge of #98028 - aticu:master, r=estebank

Add E0790 as more specific variant of E0283

Fixes #81701

I think this should be good to go, there are only two things where I am somewhat unsure:
- Is there a better way to get the fully-qualified path for the suggestion? I tried `self.tcx.def_path_str`, but that didn't seem to always give a correct path for the context.
- Should all this be extracted into it's own method or is it fine where it is?

r? `@estebank`

2 years agoAuto merge of #98912 - nrc:provider-it, r=yaahc
bors [Tue, 19 Jul 2022 11:28:20 +0000 (11:28 +0000)]
Auto merge of #98912 - nrc:provider-it, r=yaahc

core::any: replace some generic types with impl Trait

This gives a cleaner API since the caller only specifies the concrete type they usually want to.

r? `@yaahc`

2 years agouse `par_for_each_in` in `par_body_owners` and `collect_crate_mono_items`
SparrowLii [Tue, 19 Jul 2022 09:00:51 +0000 (17:00 +0800)]
use `par_for_each_in` in `par_body_owners` and `collect_crate_mono_items`

2 years agoAuto merge of #99451 - Dylan-DPC:rollup-ceghu18, r=Dylan-DPC
bors [Tue, 19 Jul 2022 08:32:32 +0000 (08:32 +0000)]
Auto merge of #99451 - Dylan-DPC:rollup-ceghu18, r=Dylan-DPC

Rollup of 8 pull requests

Successful merges:

 - #97183 (wf-check generators)
 - #98320 (Mention first and last macro in backtrace)
 - #99335 (Use split_once in FromStr docs)
 - #99347 (Use `LocalDefId` in `OpaqueTypeKey`)
 - #99392 (Fix debuginfo tests.)
 - #99404 (Use span_bug for unexpected field projection type)
 - #99410 (Update invalid atomic ordering lint)
 - #99434 (Fix `Skip::next` for non-fused inner iterators)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

2 years agoDon't use main; improve example
aticu [Mon, 13 Jun 2022 07:32:54 +0000 (09:32 +0200)]
Don't use main; improve example

2 years agoAdd E0790 as more specific variant of E0283
aticu [Sun, 12 Jun 2022 15:46:57 +0000 (17:46 +0200)]
Add E0790 as more specific variant of E0283

2 years ago:arrow_up: rust-analyzer
Laurențiu Nicola [Tue, 19 Jul 2022 07:16:45 +0000 (10:16 +0300)]
:arrow_up: rust-analyzer

2 years agoint_macros was only using to_xe_bytes_doc and not from_xe_bytes_doc
Antoine PLASKOWSKI [Tue, 19 Jul 2022 06:32:08 +0000 (08:32 +0200)]
int_macros was only using to_xe_bytes_doc and not from_xe_bytes_doc

2 years agoRollup merge of #99434 - timvermeulen:skip_next_non_fused, r=scottmcm
Dylan DPC [Tue, 19 Jul 2022 06:08:58 +0000 (11:38 +0530)]
Rollup merge of #99434 - timvermeulen:skip_next_non_fused, r=scottmcm

Fix `Skip::next` for non-fused inner iterators

`iter.skip(n).next()` will currently call `nth` and `next` in succession on `iter`, without checking whether `nth` exhausts the iterator. Using `?` to propagate a `None` value returned by `nth` avoids this.

2 years agoRollup merge of #99410 - tmiasko:atomic-lint, r=fee1-dead
Dylan DPC [Tue, 19 Jul 2022 06:08:57 +0000 (11:38 +0530)]
Rollup merge of #99410 - tmiasko:atomic-lint, r=fee1-dead

Update invalid atomic ordering lint

The restriction that success ordering must be at least as strong as its
failure ordering in compare-exchange operations was lifted in #98383.

2 years agoRollup merge of #99404 - jmqd:master, r=compiler-errors
Dylan DPC [Tue, 19 Jul 2022 06:08:56 +0000 (11:38 +0530)]
Rollup merge of #99404 - jmqd:master, r=compiler-errors

Use span_bug for unexpected field projection type

Improves the compiler error backtrace information, as shown in #99363,
by using `span_bug` instead of `bug`.

New output:

```
build/aarch64-apple-darwin/stage1/bin/rustc /tmp/test.rs --edition=2021
error: internal compiler error: compiler/rustc_middle/src/ty/closure.rs:185:25: Unexpected type Opaque(DefId(0:5 ~ test[db0f]::main::T::{opaque#0}), []) for `Field` projection
  --> /tmp/test.rs:11:27
   |
11 |         let Foo((a, b)) = foo;
   |                           ^^^

thread 'rustc' panicked at 'Box<dyn Any>', /Users/jmq/src/forked/rust/compiler/rustc_errors/src/lib.rs:1331:9
stack backtrace:
```

(Remainder of output truncated.)

2 years agoRollup merge of #99392 - nnethercote:fix-debuginfo-tests, r=pnkfelix
Dylan DPC [Tue, 19 Jul 2022 06:08:55 +0000 (11:38 +0530)]
Rollup merge of #99392 - nnethercote:fix-debuginfo-tests, r=pnkfelix

Fix debuginfo tests.

This is needed for my Ubuntu 22.04 box due to a slight change in gdb
output. The fix is similar to the fix in #95063.

2 years agoRollup merge of #99347 - compiler-errors:opaque-type-key-local-def-id, r=oli-obk
Dylan DPC [Tue, 19 Jul 2022 06:08:54 +0000 (11:38 +0530)]
Rollup merge of #99347 - compiler-errors:opaque-type-key-local-def-id, r=oli-obk

Use `LocalDefId` in `OpaqueTypeKey`

Addresses a `// FIXME(oli-obk): make this a LocalDefId`

r? ``@oli-obk``

2 years agoRollup merge of #99335 - Dav1dde:fromstr-docs, r=JohnTitor
Dylan DPC [Tue, 19 Jul 2022 06:08:53 +0000 (11:38 +0530)]
Rollup merge of #99335 - Dav1dde:fromstr-docs, r=JohnTitor

Use split_once in FromStr docs

Current implementation:

```rust
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        let coords: Vec<&str> = s.trim_matches(|p| p == '(' || p == ')' )
                                 .split(',')
                                 .collect();

        let x_fromstr = coords[0].parse::<i32>()?;
        let y_fromstr = coords[1].parse::<i32>()?;

        Ok(Point { x: x_fromstr, y: y_fromstr })
    }
```

Creating the vector is not necessary, `split_once` does the job better.

Alternatively we could also remove `trim_matches` with `strip_prefix` and `strip_suffix`:

```rust
        let (x, y) = s
            .strip_prefix('(')
            .and_then(|s| s.strip_suffix(')'))
            .and_then(|s| s.split_once(','))
            .unwrap();
```

The question is how much 'correctness' is too much and distracts from the example. In a real implementation you would also not unwrap (or originally access the vector without bounds checks), but implementing a custom Error and adding a `From<ParseIntError>` and implementing the `Error` trait adds a lot of code to the example which is not relevant to the `FromStr` trait.

2 years agoRollup merge of #98320 - compiler-errors:macro-backtrace, r=estebank
Dylan DPC [Tue, 19 Jul 2022 06:08:52 +0000 (11:38 +0530)]
Rollup merge of #98320 - compiler-errors:macro-backtrace, r=estebank

Mention first and last macro in backtrace

Slight improvement to diagnostic mentioning what macro an error originates from. Not sure if it's worthwhile.