| Age | Commit message (Collapse) | Author | Lines |
|
r=nikomatsakis
Fix `range_covered_by_constructor` for exclusive ranges.
This resolves #43253
|
|
The produced paths aren't stable between builds, since
reporting paths inside resolve, before resolve is finished
might produce paths resolved to type aliases instead of
the concrete type.
Compile-fail tests can match just parts of messages, so they
don't "suffer" from this issue.
This is just a workaround, the instability should be fixed
in the future.
|
|
|
|
|
|
This resolves #43253
|
|
`rustc_on_unimplemented` supports referring to trait
Add support to `rustc_on_unimplemented` to reference the full path of
the annotated trait. For the following code:
```rust
pub mod Bar {
#[rustc_on_unimplemented = "test error `{Self}` with `{Bar}` `{Baz}` `{Quux}` in `{Foo}`"]
pub trait Foo<Bar, Baz, Quux> {}
}
```
the error message will be:
```
test error `std::string::String` with `u8` `_` `u32` in `Bar::Foo`
```
|
|
normalization works.
|
|
|
|
Fold E0612, E0613 into E0609
As discussed in #42945, with PR 1506 tuple indices are no longer considered a separate case from normal field. This PR folds E06012 ("tuple index out of bounds") and E0613 ("type is not a tuple") into E0609 ("type does not have field with that name")
Resolves #42945
|
|
|
|
|
|
Resolves #42945
|
|
remove associated_consts feature gate
Currently struggling to run tests locally (something about jemalloc target missing).
cc #29646
|
|
Fix spans, add some comments
|
|
|
|
|
|
|
|
When there're more than one suggestions in the same diagnostic, they are
displayed in their own block, instead of inline. In order to reduce
confusion, those blocks now display the line number.
|
|
|
|
|
|
Add support to `rustc_on_unimplemented` to reference the full path of
the annotated trait. For the following code:
```rust
pub mod Bar {
#[rustc_on_unimplemented = "test error `{Self}` with `{Bar}` `{Baz}` `{Quux}` in `{Foo}`"]
pub trait Foo<Bar, Baz, Quux> {}
}
```
the error message will be:
```
test error `std::string::String` with `u8` `_` `u32` in `Bar::Foo`
```
|
|
|
|
Prior to this PR, when we aborted because a "critical pass" failed, we
displayed the number of errors from that critical pass. While that's the
number of errors that caused compilation to abort in *that place*,
that's not what people really want to know. Instead, always report the
total number of errors, and don't bother to track the number of errors
from the last pass that failed.
This changes the compiler driver API to handle errors more smoothly,
and therefore is a compiler-api-[breaking-change].
Fixes #42793.
|
|
This reverts commit 5558c64f33446225739c1153b43d2e309bb4f50e.
|
|
Adding diagnostic code 0611 for lifetime errors with one named, one anonymous lifetime parameter
This is a fix for #42517
Note that this only handles the above case for **function declarations** and **traits**.
`impl items` and `closures` will be handled in a later PR.
Example
```
fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
if x > y { x } else { y }
}
```
now displays the following error message. ui tests have been added for the same.
```
error[E0611]: explicit lifetime required in the type of `x`
11 | fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
| ^ consider changing the type of `x` to `&'a i32`
12 | if x > y { x } else { y }
| - lifetime `'a` required
```
#42516
r? @nikomatsakis
|
|
Coerce fields to the expected field type
Fully fixes #31260.
This needs a crater run. I was supposed to do this last month but it slipped. Let's get this done.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
anonymous lifetime parameter
|
|
Move type parameter shadowing test to `ui`
Fix #20729.
|
|
r=eddyb
make lint on-by-default/implied-by messages appear only once
From review discussion on #38103 (https://github.com/rust-lang/rust/pull/38103#discussion_r94845060).

r? @nikomatsakis
|
|
|
|
Detect missing `;` on methods with return type `()`
- Point out the origin of a type requirement when it is the return type
of a method
- Point out possibly missing semicolon when the return type is `()` and
the implicit return makes sense as a statement
- Suggest changing the return type of methods with default return type
- Don't suggest changing the return type on `fn main()`
- Don't suggest changing the return type on impl fn
- Suggest removal of semicolon (instead of being help)
|
|
- Fix typo
- Add docstring
- Remove spurious test output file
|
|
only set "overruled by outer forbid" once for lint groups, by group name
Previously, conflicting forbid/allow attributes for a lint group would
result in a separate "allow(L) overruled by outer forbid(L)" error for
every lint L in the group. This was needlessly and annoyingly verbose;
we prefer to just have one error pointing out the conflicting
attributes.
(Also, while we're touching context.rs, clean up some unused arguments.)
Resolves #42873.
|
|
From review discussion on #38103
(https://github.com/rust-lang/rust/pull/38103#discussion_r94845060).
|
|
|
|
remove variant `Token::SubstNt` in favor of `quoted::TokenTree::MetaVar`.
|
|
|
|
|
|
|
|
|
|
|
|
|