about summary refs log tree commit diff
path: root/src/test/ui/lifetimes
AgeCommit message (Collapse)AuthorLines
2021-08-19Auto merge of #88143 - GuillaumeGomez:rollup-sgh318f, r=GuillaumeGomezbors-3/+3
Rollup of 10 pull requests Successful merges: - #87818 (Fix anchors display in rustdoc) - #87983 (Use more accurate spans when proposing adding lifetime to item) - #88012 (Change WASI's `RawFd` from `u32` to `c_int` (`i32`).) - #88031 (Make `BuildHasher` object safe) - #88036 (Fix dead code warning when inline const is used in pattern) - #88082 (Take into account jobs number for rustdoc GUI tests) - #88109 (Fix environment variable getter docs) - #88111 (Add background-color on clickable definitions in source code) - #88129 (Fix dataflow graphviz bug, make dataflow graphviz modules public) - #88136 (Move private_unused.rs test to impl-trait) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-08-18Auto merge of #86700 - lqd:matthews-nll-hrtb-errors, r=nikomatsakisbors-12/+42
Matthew's work on improving NLL's "higher-ranked subtype error"s This PR rebases `@matthewjasper's` [branch](https://github.com/matthewjasper/rust/tree/nll-hrtb-errors) which has great work to fix the obscure higher-ranked subtype errors that are tracked in #57374. These are a blocker to turning full NLLs on, and doing some internal cleanups to remove some of the old region code. The goal is so `@nikomatsakis` can take a look at this early, and I'll then do my best to help do the changes and followup work to land this work, and move closer to turning off the migration mode. I've only updated the branch and made it compile, removed a warning or two. r? `@nikomatsakis` (Here's the [zulip topic to discuss this](https://rust-lang.zulipchat.com/#narrow/stream/122657-t-compiler.2Fwg-nll/topic/.2357374.3A.20improving.20higher-ranked.20subtype.20errors.20via.20.2386700) that Niko wanted)
2021-08-18Use more accurate spans when proposing adding lifetime to itemEsteban Kuber-3/+3
2021-08-16Use note to point at bound introducing requirementEsteban Küber-3/+5
2021-08-15Report nicer errors for HRTB NLL errors from queriesMatthew Jasper-12/+42
2021-08-11Modify structured suggestion outputEsteban Küber-10/+10
* On suggestions that include deletions, use a diff inspired output format * When suggesting addition, use `+` as underline * Color highlight modified span
2021-07-30Use multispan suggestions more oftenEsteban Küber-1/+1
* Use more accurate span for `async move` suggestion * Use more accurate span for deref suggestion * Use `multipart_suggestion` more often
2021-05-12Show macro name in 'this error originates in macro' messageAaron Hill-1/+1
When there are multiple macros in use, it can be difficult to tell which one was responsible for producing an error.
2021-05-06Auto merge of #84559 - jackh726:issue-84398, r=nikomatsakisbors-0/+20
Deduplicate ParamCandidates with the same value except for bound vars Fixes #84398 This is kind of a hack. I wonder if we can get other types of candidates that are the same except for bound vars. This won't be a problem with Chalk, since we don't really need to know that there are two different "candidates" if they both give the same final substitution. r? `@nikomatsakis`
2021-04-28Add HAS_RE_LATE_BOUND if there are bound varsJack Huey-0/+23
2021-04-25Deduplicate ParamCandidates with the same value except for bound varsJack Huey-0/+20
2021-04-16Rollup merge of #84172 - jayaddison:compiler/E0384-reduce-assertiveness, ↵Dylan DPC-5/+5
r=petrochenkov Compiler error messages: reduce assertiveness of message E0384 This message is emitted as guidance by the compiler when a developer attempts to reassign a value to an immutable variable. Following the message will always currently work, but it may not always be the best course of action; following the 'consider ...' messaging pattern provides a hint to the developer that it could be wise to explore other alternatives. Resolves #84144
2021-04-16Rollup merge of #83944 - jackh726:binder-refactor-fix2, r=lcnrDylan DPC-0/+41
Fix a couple resolve bugs from binder refactor Fixes #83753 Fixes #83907
2021-04-12Compiler error messages: reduce assertiveness of message E0384James Addison-5/+5
This message is emitted as guidance by the compiler when a developer attempts to reassign a value to an immutable variable. Following the message will always currently work, but it may not always be the best course of action; following the 'consider ...' messaging pattern provides a hint to the developer that it could be wise to explore other alternatives.
2021-04-06Fix a couple resolve bugs from binder refactorJack Huey-0/+41
2021-04-05Don't concatenate binders across typesJack Huey-0/+14
2021-03-24resolve late lifetimes by itemJack Huey-10/+10
This reverts commit 22ae20733515d710c1134600bc1e29cdd76f6b9b.
2021-03-03reworded messageEsteban Küber-1/+3
2021-03-02Account for macros when suggesting adding lifetimeEsteban Küber-0/+54
Fix #70152.
2021-02-09Print closure signatures when reporting placeholder errorsMatthew Jasper-1/+1
2021-02-09Report "nice" placeholder errors more oftenMatthew Jasper-16/+5
If we have a cause containing `ValuePairs::PolyTraitRefs` but neither TraitRef has any escaping bound regions then we report the same error as for `ValuePairs::TraitRefs`.
2021-02-06path trimming: ignore type aliasesDan Aloni-2/+2
2021-02-02Update ui tests (nll)Jesus Rubio-0/+1
2021-01-14Auto merge of #79328 - c410-f3r:hir-if, r=matthewjasperbors-3/+3
Reintroduce hir::ExprKind::If Basically copied and paste #59288/https://github.com/rust-lang/rust-clippy/pull/4080 with some modifications. The vast majority of tests were fixed and now there are only a few remaining. Since I am still unable to figure out the missing pieces, any help with the following list is welcome. - [ ] **Unnecessary `typeck` exception**: [Cheated on this one to make CI green.](https://github.com/rust-lang/rust/pull/79328/files#diff-3faee9ba23fc54a12b7c43364ba81f8c5660045c7e1d7989a02a0cee1c5b2051) - [x] **Incorrect span**: [Span should reference `then` and `else` separately.](https://github.com/rust-lang/rust/pull/79328/files#diff-cf2c46e82222ee4b1037a68fff8a1af3c4f1de7a6b3fd798aacbf3c0475abe3d) - [x] **New note regarding `assert!`**: [Modified but not "wrong". Maybe can be a good thing?](https://github.com/rust-lang/rust/pull/79328/files#diff-9e0d7c89ed0224e2b62060c957177c27db43c30dfe3c2974cb6b5091cda9cfb5) - [x] **Inverted report location**: [Modified but not "wrong". Locations were inverted.](https://github.com/rust-lang/rust/pull/79328/files#diff-f637ce7c1f68d523a165aa9651765df05e36c4d7d279194b1a6b28b48a323691) - [x] **`src/test/ui/point-to-type-err-cause-on-impl-trait-return.rs` has weird errors**: [Not sure why this is happening.](https://github.com/rust-lang/rust/pull/79328/files#diff-c823c09660f5b112f95e97e8ff71f1797b6c7f37dbb3d16f8e98bbaea8072e95) - [x] **Missing diagnostic**: [???](https://github.com/rust-lang/rust/pull/79328/files#diff-6b8ab09360d725ba4513933827f9796b42ff9522b0690f80b76de067143af2fc)
2021-01-12Provide more information for HRTB lifetime errors involving closuresEsteban Küber-0/+169
2021-01-07Reintroduce hir::ExprKind::IfCaio-3/+3
2020-10-06Check opaque types satisfy their boundsMatthew Jasper-5/+0
2020-09-02pretty: trim paths of unique symbolsDan Aloni-6/+6
If a symbol name can only be imported from one place for a type, and as long as it was not glob-imported anywhere in the current crate, we can trim its printed path and print only the name. This has wide implications on error messages with types, for example, shortening `std::vec::Vec` to just `Vec`, as long as there is no other `Vec` importable anywhere. This adds a new '-Z trim-diagnostic-paths=false' option to control this feature. On the good path, with no diagnosis printed, we should try to avoid issuing this query, so we need to prevent trimmed_def_paths query on several cases. This change also relies on a previous commit that differentiates between `Debug` and `Display` on various rustc types, where the latter is trimmed and presented to the user and the former is not.
2020-07-14Suggest boxing or borrowing unsized fieldsEsteban Küber-2/+2
2020-06-27Use an 'approximate' universal upper bound when reporting region errorsAaron Hill-10/+16
Fixes #67765 When reporting errors during MIR region inference, we sometimes use `universal_upper_bound` to obtain a named universal region that we can display to the user. However, this is not always possible - in a case like `fn foo<'a, 'b>() { .. }`, the only upper bound for a region containing `'a` and `'b` is `'static`. When displaying diagnostics, it's usually better to display *some* named region (even if there are multiple involved) rather than fall back to a generic error involving `'static`. This commit adds a new `approx_universal_upper_bound` method, which uses the lowest-numbered universal region if the only alternative is to return `'static`.
2020-05-30Tweak type parameter errors to reduce verbosityEsteban Küber-39/+7
2020-05-27review comments: change wording and visual outputEsteban Küber-1/+1
2020-05-27Modify wordingEsteban Küber-2/+2
2020-05-27review commentsEsteban Küber-1/+1
2020-05-27Tweak output for mismatched impl itemEsteban Küber-2/+2
Detect type parameter that might require lifetime constraint. Do not name `ReVar`s in expected/found output. Reword text suggesting to check the lifetimes.
2020-05-27Name `RegionKind::ReVar` lifetimes in diagnosticsEsteban Küber-1/+3
2020-05-07Add test for #34979Yuki Okushi-0/+23
2020-04-22Tweak wordingEsteban Küber-4/+4
2020-04-22Tweak `'static` suggestion codeEsteban Küber-4/+20
Fix #71196.
2020-04-16outlives: ignore lifetimes shallowly found in `ty::FnDef`s.Eduard-Mihai Burtescu-0/+13
2020-03-12update testsMark Mansi-5/+5
2020-02-22update some testsMark Mansi-5/+5
2020-02-19Tweak binding lifetime suggestion textEsteban Küber-5/+5
We already have a structured suggestion, but the wording made it seem like that wasn't the case. Fix #65286. r? @varkor
2020-02-06rustc_macros: don't limit the -Zmacro-backtrace suggestion to extern macros.Eduard-Mihai Burtescu-1/+1
2020-02-06rustc: rename -Zexternal-macro-backtrace to -Zmacro-backtrace.Eduard-Mihai Burtescu-1/+1
2020-02-05Account for `fn()` types in lifetime suggestionsEsteban Küber-18/+6
2020-02-05review commentsEsteban Küber-3/+3
2020-02-05Suggest `'r` instead of `'lifetime`Esteban Küber-6/+6
2020-02-05When suggesting lifetimes, propose adding the new lifetime to all argumentsEsteban Küber-6/+6
2020-02-05Use spans for input borrowed types unrelated to return typeEsteban Küber-3/+15