Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
9cee22c
Display information about captured variable in `FnMut` error
Aaron1011 May 24, 2020
4548eb8
Clarify the behaviour of Pattern when used with methods like str::con…
poliorcetics Jun 2, 2020
6f6620b
Rename "cyclone" to "apple-a7" per changes in upstream LLVM
trevyn Jun 7, 2020
fb58b7b
Add compare-mode=chalk and add a little bit more implementations and …
jackh726 May 13, 2020
045dfc0
Update chalk
jackh726 May 13, 2020
6ba003e
Update chalk
jackh726 May 27, 2020
3d73030
Use builtin types for Never, Array, and FnDef
jackh726 May 27, 2020
2544b8c
Implement fn_def_datum
jackh726 May 27, 2020
7f2708c
Remove RustDefId
jackh726 May 27, 2020
ebdc950
Test error order is non-deterministic
jackh726 May 27, 2020
1d8264a
Update Chalk
jackh726 May 27, 2020
6172e9a
Update chalk and add LifetimeOutlives and ObjectSafe lowering
jackh726 May 30, 2020
7a5b939
Lower consts
jackh726 May 30, 2020
4028c21
Fix building
jackh726 May 30, 2020
8aa2898
Update chalk to 0.11.0
jackh726 Jun 2, 2020
852313a
Nits and change skip_binder to no_bound_vars for fndef
jackh726 Jun 3, 2020
645af62
Change InternedAdtDef to &'tcx AdtDef
jackh726 Jun 3, 2020
4cf2833
Return type is bound too
jackh726 Jun 3, 2020
687767a
Suggest substituting `'static` lifetime in impl/dyn `Trait + 'static`…
estebank May 29, 2020
c91320f
When `'static` is explicit, suggest constraining argument with it
estebank May 30, 2020
abf74b9
Reduce verbosity of suggestion message and mention lifetime in label
estebank May 30, 2020
50c422e
Move overlapping span to a note
estebank May 30, 2020
17951e2
Tweak output for overlapping required/captured spans
estebank May 30, 2020
19bb589
Tweak wording and add error code
estebank May 30, 2020
3cfecde
review comments: wording
estebank Jun 1, 2020
bdfb9b1
Use note for requirement source span
estebank Jun 2, 2020
215de3b
Register new eror code
estebank Jun 2, 2020
187e105
small tweaks
estebank Jun 2, 2020
6145918
Change E0758 to E0759 to avoid conflict with #72912
estebank Jun 3, 2020
975f7df
compiletest: Add directives to detect sanitizer support
tmiasko Jun 5, 2020
754da88
Make `fn_arg_names` return `Ident` instead of symbol
Aaron1011 Jun 11, 2020
2c11c35
Explain move errors that occur due to method calls involving `self`
Aaron1011 Jun 11, 2020
5902b2f
Use `fn_span` to point to the actual method call
Aaron1011 Jun 11, 2020
4646e2d
Run fmt
Aaron1011 Jun 12, 2020
57b54c4
Use the built cargo for cargotest.
ehuss Jun 12, 2020
b126f32
Fix links when pinging notification groups
LeSeulArtichaut Jun 12, 2020
249a46f
pretty/asm.rs should only be tested for x86_64 and not AArch64
yerke Jun 13, 2020
62d33dc
Rollup merge of #72389 - Aaron1011:feature/move-fn-self-msg, r=nikoma…
RalfJung Jun 13, 2020
449e69a
Rollup merge of #72598 - Aaron1011:feature/fnmut-capture-span, r=niko…
RalfJung Jun 13, 2020
7230a64
Rollup merge of #72804 - estebank:opaque-missing-lts-in-fn-2, r=nikom…
RalfJung Jun 13, 2020
1f14b08
Rollup merge of #72932 - poliorcetics:pattern-contains-behaviour, r=h…
RalfJung Jun 13, 2020
2460626
Rollup merge of #72936 - jackh726:chalk-more, r=nikomatsakis
RalfJung Jun 13, 2020
4dbb652
Rollup merge of #73044 - tmiasko:compiletest-san, r=nikomatsakis
RalfJung Jun 13, 2020
0642d72
Rollup merge of #73086 - trevyn:apple-a7, r=nikic
RalfJung Jun 13, 2020
c3ae20d
Rollup merge of #73267 - ehuss:cargotest-this-cargo, r=Mark-Simulacrum
RalfJung Jun 13, 2020
9d9b31a
Rollup merge of #73290 - LeSeulArtichaut:patch-1, r=Dylan-DPC
RalfJung Jun 13, 2020
dd43c02
Rollup merge of #73308 - yerke:fix-pretty-asm-rs-test-for-aarch64, r=…
RalfJung Jun 13, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Tweak output for overlapping required/captured spans
  • Loading branch information
estebank committed Jun 9, 2020
commit 17951e21d4c690ad70e79a40d223a0d0984c0f35
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,10 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
// | |
// | this data with the anonymous lifetime `'_`...
// |
// note: ...is required to be `'static` by this
// |
// LL | fn elided3(x: &i32) -> Box<dyn Debug> { Box::new(x) }
// | ^^^^^^^^^^^
err.span_label(sup_origin.span(), "...is captured here...");
err.span_note(return_sp, "...and required to be `'static` by this");
err.span_label(
sup_origin.span(),
"...is captured here with a `'static` requirement",
);
} else if sup_origin.span() <= return_sp {
err.span_label(sup_origin.span(), "...is captured here...");
err.span_label(return_sp, "...and required to be `'static` by this");
Expand Down
28 changes: 4 additions & 24 deletions src/test/ui/impl-trait/must_outlive_least_region_or_bound.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,10 @@ error: cannot infer an appropriate lifetime
--> $DIR/must_outlive_least_region_or_bound.rs:18:50
|
LL | fn elided3(x: &i32) -> Box<dyn Debug> { Box::new(x) }
| ---- ^ ...is captured here...
| ---- ^ ...is captured here with a `'static` requirement
| |
| this data with the anonymous lifetime `'_`...
|
note: ...and required to be `'static` by this
--> $DIR/must_outlive_least_region_or_bound.rs:18:41
|
LL | fn elided3(x: &i32) -> Box<dyn Debug> { Box::new(x) }
| ^^^^^^^^^^^
help: to permit non-static references in a trait object value, you can add an explicit bound for the anonymous lifetime `'_`
|
LL | fn elided3(x: &i32) -> Box<dyn Debug + '_> { Box::new(x) }
Expand All @@ -127,15 +122,10 @@ error: cannot infer an appropriate lifetime
--> $DIR/must_outlive_least_region_or_bound.rs:21:59
|
LL | fn explicit3<'a>(x: &'a i32) -> Box<dyn Debug> { Box::new(x) }
| ------- ^ ...is captured here...
| ------- ^ ...is captured here with a `'static` requirement
| |
| this data with lifetime `'a`...
|
note: ...and required to be `'static` by this
--> $DIR/must_outlive_least_region_or_bound.rs:21:50
|
LL | fn explicit3<'a>(x: &'a i32) -> Box<dyn Debug> { Box::new(x) }
| ^^^^^^^^^^^
help: to permit non-static references in a trait object value, you can add an explicit bound for lifetime `'a`
|
LL | fn explicit3<'a>(x: &'a i32) -> Box<dyn Debug + 'a> { Box::new(x) }
Expand All @@ -145,15 +135,10 @@ error: cannot infer an appropriate lifetime
--> $DIR/must_outlive_least_region_or_bound.rs:24:60
|
LL | fn elided4(x: &i32) -> Box<dyn Debug + 'static> { Box::new(x) }
| ---- ^ ...is captured here...
| ---- ^ ...is captured here with a `'static` requirement
| |
| this data with the anonymous lifetime `'_`...
|
note: ...and required to be `'static` by this
--> $DIR/must_outlive_least_region_or_bound.rs:24:51
|
LL | fn elided4(x: &i32) -> Box<dyn Debug + 'static> { Box::new(x) }
| ^^^^^^^^^^^
help: consider changing the trait object's explicit `'static` bound to the anonymous lifetime `'_`
|
LL | fn elided4(x: &i32) -> Box<dyn Debug + '_> { Box::new(x) }
Expand All @@ -167,13 +152,8 @@ error: cannot infer an appropriate lifetime
--> $DIR/must_outlive_least_region_or_bound.rs:27:69
|
LL | fn explicit4<'a>(x: &'a i32) -> Box<dyn Debug + 'static> { Box::new(x) }
| ------- this data with lifetime `'a`... ^ ...is captured here...
| ------- this data with lifetime `'a`... ^ ...is captured here with a `'static` requirement
|
note: ...and required to be `'static` by this
--> $DIR/must_outlive_least_region_or_bound.rs:27:60
|
LL | fn explicit4<'a>(x: &'a i32) -> Box<dyn Debug + 'static> { Box::new(x) }
| ^^^^^^^^^^^
help: consider changing the trait object's explicit `'static` bound to lifetime `'a`
|
LL | fn explicit4<'a>(x: &'a i32) -> Box<dyn Debug + 'a> { Box::new(x) }
Expand Down
7 changes: 1 addition & 6 deletions src/test/ui/issues/issue-16922.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@ error: cannot infer an appropriate lifetime
LL | fn foo<T: Any>(value: &T) -> Box<dyn Any> {
| -- this data with the anonymous lifetime `'_`...
LL | Box::new(value) as Box<dyn Any>
| ^^^^^ ...is captured here...
| ^^^^^ ...is captured here with a `'static` requirement
|
note: ...and required to be `'static` by this
--> $DIR/issue-16922.rs:4:5
|
LL | Box::new(value) as Box<dyn Any>
| ^^^^^^^^^^^^^^^
help: to permit non-static references in a trait object value, you can add an explicit bound for the anonymous lifetime `'_`
|
LL | fn foo<T: Any>(value: &T) -> Box<dyn Any + '_> {
Expand Down
21 changes: 3 additions & 18 deletions src/test/ui/regions/region-object-lifetime-in-coercion.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@ error: cannot infer an appropriate lifetime
LL | fn a(v: &[u8]) -> Box<dyn Foo + 'static> {
| ----- this data with the anonymous lifetime `'_`...
LL | let x: Box<dyn Foo + 'static> = Box::new(v);
| ^ ...is captured here...
| ^ ...is captured here with a `'static` requirement
|
note: ...and required to be `'static` by this
--> $DIR/region-object-lifetime-in-coercion.rs:8:37
|
LL | let x: Box<dyn Foo + 'static> = Box::new(v);
| ^^^^^^^^^^^
help: consider changing the trait object's explicit `'static` bound to the anonymous lifetime `'_`
|
LL | fn a(v: &[u8]) -> Box<dyn Foo + '_> {
Expand All @@ -26,13 +21,8 @@ error: cannot infer an appropriate lifetime
LL | fn b(v: &[u8]) -> Box<dyn Foo + 'static> {
| ----- this data with the anonymous lifetime `'_`...
LL | Box::new(v)
| ^ ...is captured here...
| ^ ...is captured here with a `'static` requirement
|
note: ...and required to be `'static` by this
--> $DIR/region-object-lifetime-in-coercion.rs:13:5
|
LL | Box::new(v)
| ^^^^^^^^^^^
help: consider changing the trait object's explicit `'static` bound to the anonymous lifetime `'_`
|
LL | fn b(v: &[u8]) -> Box<dyn Foo + '_> {
Expand All @@ -49,13 +39,8 @@ LL | fn c(v: &[u8]) -> Box<dyn Foo> {
| ----- this data with the anonymous lifetime `'_`...
...
LL | Box::new(v)
| ^ ...is captured here...
|
note: ...and required to be `'static` by this
--> $DIR/region-object-lifetime-in-coercion.rs:19:5
| ^ ...is captured here with a `'static` requirement
|
LL | Box::new(v)
| ^^^^^^^^^^^
help: to permit non-static references in a trait object value, you can add an explicit bound for the anonymous lifetime `'_`
|
LL | fn c(v: &[u8]) -> Box<dyn Foo + '_> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@ error: cannot infer an appropriate lifetime
LL | fn g<'a, T: 'static>(v: Box<dyn A<T> + 'a>) -> Box<dyn X + 'static> {
| ------------------ this data with lifetime `'a`...
LL | box B(&*v) as Box<dyn X>
| ^^^ ...is captured here...
| ^^^ ...is captured here with a `'static` requirement
|
note: ...and required to be `'static` by this
--> $DIR/regions-close-object-into-object-2.rs:10:5
|
LL | box B(&*v) as Box<dyn X>
| ^^^^^^^^^^^^^^^^^^^^^^^^
help: consider changing the trait object's explicit `'static` bound to lifetime `'a`
|
LL | fn g<'a, T: 'static>(v: Box<dyn A<T> + 'a>) -> Box<dyn X + 'a> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@ error: cannot infer an appropriate lifetime
LL | fn i<'a, T, U>(v: Box<dyn A<U>+'a>) -> Box<dyn X + 'static> {
| ---------------- this data with lifetime `'a`...
LL | box B(&*v) as Box<dyn X>
| ^^^ ...is captured here...
| ^^^ ...is captured here with a `'static` requirement
|
note: ...and required to be `'static` by this
--> $DIR/regions-close-object-into-object-4.rs:10:5
|
LL | box B(&*v) as Box<dyn X>
| ^^^^^^^^^^^^^^^^^^^^^^^^
help: consider changing the trait object's explicit `'static` bound to lifetime `'a`
|
LL | fn i<'a, T, U>(v: Box<dyn A<U>+'a>) -> Box<dyn X + 'a> {
Expand Down
7 changes: 1 addition & 6 deletions src/test/ui/regions/regions-proc-bound-capture.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,8 @@ LL | fn static_proc(x: &isize) -> Box<dyn FnMut() -> (isize) + 'static> {
| ------ this data with the anonymous lifetime `'_`...
LL | // This is illegal, because the region bound on `proc` is 'static.
LL | Box::new(move || { *x })
| ^^^^^^^^^^^^^^ ...is captured here...
| ^^^^^^^^^^^^^^ ...is captured here with a `'static` requirement
|
note: ...and required to be `'static` by this
--> $DIR/regions-proc-bound-capture.rs:9:5
|
LL | Box::new(move || { *x })
| ^^^^^^^^^^^^^^^^^^^^^^^^
help: consider changing the trait object's explicit `'static` bound to the anonymous lifetime `'_`
|
LL | fn static_proc(x: &isize) -> Box<dyn FnMut() -> (isize) + '_> {
Expand Down