| Age | Commit message (Collapse) | Author | Lines |
|
Generator bugfixes
r? @nikomatsakis
|
|
elided lifetime
Closes #45992
Hey
Having a problem with my config so decided to make a WIP PR nevertheless. Will add some more tests.
|
|
Rollup of 10 pull requests
- Successful merges: #46156, #47829, #47842, #47898, #47914, #47916, #47919, #47942, #47951, #47973
- Failed merges: #47753
|
|
Tweak presentation on lifetime trait mismatch
- On trait/impl method discrepancy, add label pointing at trait signature.
- Point only at method definition when referring to named lifetimes on lifetime mismatch.
- When the sub and sup expectations are the same, tweak the output to avoid repeated spans.
Fix #30790, CC #18759.
|
|
spans involving macro context Sometimes the parser attempts to synthesize spans from within a macro context with the span for the captured argument, leading to non-sensical spans with very bad output. Given that an incorrect span is worse than a partially incomplete span, when detecting this situation return only one of the spans without merging them. Fix #32072, #47778. CC #23480.
|
|
r=petrochenkov Improve char escaping in lexer messages Currently ', " and \ are escaped as \', \" and \\ respectively. This leads to confusing messages such as `error: unknown start of token: \\` when encountering a single backslash. Fix by emitting printable ASCII characters directly. This will still escape \r, \n, \t and Unicode characters. Fixes #47902
|
|
when assigning references to a static mut with NLL is_unsafe_place only filters out statics in the rhs, not the lhs. Since it's possible to reach that 'Place::Static', we handle statics the same way as we do locals. Fixes #47789
|
|
value from `break` when invalid When attempting to use `break` with a value in a type of loop where it'd be invalid (any non-`loop`), suggest using `break` on its own. Close #34359.
|
|
Include space in suggestion `mut` in bindings
Fix #46614.
|
|
|
|
Sometimes the parser attempts to synthesize spans from within a macro
context with the span for the captured argument, leading to non-sensical
spans with very bad output. Given that an incorrect span is worse than
a partially incomplete span, when detecting this situation return only
one of the spans without mergin them.
|
|
remove intercrate ambiguity hints
The scheme was causing overflows during coherence checking (e.g. #47139). This is sort of a temporary fix; the proper fix I think involves reworking trait selection in deeper ways.
cc @sgrif -- this *should* fix diesel
cc @qnighy -- I'd like to discuss you with alternative techniques for achieving the same end. =) Actually, it might be good to put some energy into refactoring traits first.
r? @eddyb
|
|
Currently ', " and \ are escaped as \', \" and \\ respectively. This
leads to confusing messages such as `error: unknown start of token: \\`
when encountering a single backslash.
Fix by emitting printable ASCII characters directly. This will still
escape \r, \n, \t and Unicode characters.
Fixes #47902
|
|
Fix ICE when reading non-UTF-8 input from stdin
Fixes #22387.
|
|
|
|
|
|
rustc_trans: keep LLVM types for trait objects anonymous.
Fixes #47638 by reverting the addition of readable LLVM trait object type names.
r? @nikomatsakis
|
|
Ignore run-pass/sse2 when using system LLVM
This is a test of `target_feature`, which needs a rust-specific patch to
LLVM to add `MCSubtargetInfo::getFeatureTable()`.
|
|
Update associated constants error message
Fixes #47570.
|
|
Fix regression: account for trait methods in arg count mismatch error
Fixed #47706 (https://github.com/rust-lang/rust/issues/47706#issuecomment-361161495)
Original PR #47747 missed methods on trait definitions.
This edit was done in GitHub. I think I got the signature of the variant right, going by the ICE debug output and the other cases above.
|
|
use correct casing for rename suggestions
If the original name is uppercase, use camel case. Otherwise, use snake
case.
|
|
is_unsafe_place only filters out statics in the rhs, not the lhs. Since
it's possible to reach that 'Place::Static', we handle statics the same
way as we do locals.
Fixes #47789
|
|
Fixes #22387.
|
|
|
|
This is a test of `target_feature`, which needs a rust-specific patch to
LLVM to add `MCSubtargetInfo::getFeatureTable()`.
|
|
|
|
Fixes #47736
|
|
Rollup of 12 pull requests
- Successful merges: #47515, #47603, #47718, #47732, #47760, #47780, #47822, #47826, #47836, #47839, #47853, #47855
- Failed merges:
|
|
#47482, #46476
|
|
rustdoc: Fix link title rendering with hoedown
The link title needs to be HTML escaped.
It was broken by #47046.
r? @QuietMisdreavus
|
|
r=nikomatsakis
Increase test coverage of use_nested_groups
r? @nikomatsakis
|
|
Add line numbers and columns to error messages spanning multiple files
If an error message is emitted that spans several files, only the
primary file currently has line and column data attached. This is
useful information, even in files other than the one in which the error
occurs. We can often work out which line and column the error
corresponds to in other files — in this case it is helpful to add them
(in the case of ambiguity, the first relevant line/column is picked,
which is still helpful than none).
|
|
Make run-pass/env-home-dir.rs test more robust
Remove the assumption that home_dir always returns Some.
This allows the test to be executed with [cross](https://github.com/japaric/cross).
|
|
syntax: Lower priority of `+` in `impl Trait`/`dyn Trait`
Now you have to write `Fn() -> (impl A + B)` instead of `Fn() -> impl A + B`, this is consistent with priority of `+` in trait objects (`Fn() -> A + B` means `(Fn() -> A) + B`).
To make this viable I changed the syntax to also permit `+` in return types in function declarations
```
fn f() -> dyn A + B { ... } // OK, don't have to write `-> (dyn A + B)`
// This is acceptable, because `dyn A + B` here is an isolated type and
// not part of a larger type with various operator priorities in play
// like `dyn A + B` in `Fn() -> dyn A + B` despite syntax similarities.
```
but you still have to use `-> (dyn A + B)` in function types and function-like trait object types (see this PR's tests for examples).
This can be a breaking change for code using `impl Trait` on nightly. The thing that is most likely to break is `&impl A + B`, it needs to be rewritten as `&(impl A + B)`.
cc https://github.com/rust-lang/rust/issues/34511 https://github.com/rust-lang/rust/issues/44662 https://github.com/rust-lang/rfcs/pull/438
|
|
|
|
Replace "lvalue" terminology with "place".
See #46425 for the previous PR (which only changed MIR-related code).
r? @nikomatsakis
|
|
The link title needs to be HTML escaped.
|
|
|
|
Remove the assumption that home_dir always returns Some
This allows the test to be executed with
[cross](https://github.com/japaric/cross).
|
|
|
|
|
|
|
|
|
|
If the original name is uppercase, use camel case. Otherwise, use snake
case.
|
|
- On mismatch between impl and trait method, point at the trait
signature.
- Point only at the method signature instead of the whole body on
trait/impl mismatch errors.
|
|
When refering to named lifetime conflict, point only at the method's
signature span instead of the entire method.
When the expected and found sup and sub traces are the same, avoid
redundant text.
|
|
|
|
don't mention tasks in stability warnings of #[thread_local] #47755
This is a fix for issue #47755.
|
|
Fix ICE on const eval of union field
MIR's `Const::get_field()` attempts to retrieve the value for a given field in a constant. In the case of a union constant it was falling through to a generic `const_get_elt` based on the field index. As union fields don't have an index this caused an ICE in `llvm_field_index`.
Fix by simply returning the current value when accessing any field in a union. This works because all union fields start at byte offset 0.
The added test uses `const_fn` it ensure the field is extracted using MIR's const evaluation. The crash is reproducible without it, however.
Fixes #47788
r? @eddyb
|
|
Correctly format `extern crate` conflict resolution help
Closes #45799. Follow up to @Cldfire's #45820.
If the `extern` statement that will have a suggestion ends on a `;`, synthesize a new span that doesn't include it.
|