Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 9 pull requests #73643

Merged
merged 39 commits into from
Jun 23, 2020
Merged
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
1d08b1b
Clean up E0689 explanation
GuillaumeGomez Jun 18, 2020
9245ba8
Remove the const_raw_ptr_comparison feature gate.
oli-obk Jun 12, 2020
e09b620
Add fuzzy pointer comparison intrinsics
oli-obk Jun 16, 2020
84f1d73
Tidy got confused on `rustc_const_unstable` `issue`s
oli-obk Jun 18, 2020
e75fbae
add second message for livedrop errors
pvdrz Jun 19, 2020
562f496
Account for multiple impl/dyn Trait in return type when suggesting `'_`
estebank Jun 9, 2020
0624a5a
Squashed all commits
rakshith-ravi Jun 20, 2020
9e88b48
Refer just to the issue in the raw ptr cmp diagnostic instead of expl…
oli-obk Jun 20, 2020
53686b9
Satisfy tidy
oli-obk Jun 20, 2020
98e97a4
Address review comments
oli-obk Jun 20, 2020
9355168
update tests
Jun 20, 2020
a63eb3c
Clarify --extern documentation.
adetaylor Jun 21, 2020
6374054
Fix typos in doc comments
JOE1994 Jun 21, 2020
e465b22
`icmp` can handle raw pointers just fine, there's no need to cast to …
oli-obk Jun 21, 2020
893077c
Update src/librustc_mir/monomorphize/collector.rs
JOE1994 Jun 21, 2020
b60ec47
bootstrap: no `config.toml` exists regression
davidtwco Jun 21, 2020
bcc0a9c
modify leak-check to track only outgoing edges from placeholders
nikomatsakis May 18, 2020
4199b3a
Revert "modify leak-check to track only outgoing edges from placehold…
nikomatsakis May 18, 2020
f2cf994
rewrite leak check to be based on universes
nikomatsakis May 19, 2020
5a7a850
move leak-check to during coherence, candidate eval
nikomatsakis May 20, 2020
1e00e1b
upcasting traits requires only that things become more general
nikomatsakis May 20, 2020
70cf33f
remove snapshot calls from "match" operations during select
nikomatsakis May 22, 2020
6873a76
remove leak-check from project
nikomatsakis May 22, 2020
3a68d56
remove `leak_check` from the outlives predicate evaluations
nikomatsakis May 22, 2020
be0d10f
add new tests from MCP and the tracking issue
nikomatsakis May 22, 2020
93e2982
add new coherence tests and update the documentation
nikomatsakis Jun 5, 2020
c88a76e
WIP bless test and compare-mode=nll
nikomatsakis Jun 6, 2020
6929013
fix subtle bug in NLL type checker
nikomatsakis Jun 8, 2020
d57689f
cite issue 73154
nikomatsakis Jun 8, 2020
3eb8eb9
review comments
estebank Jun 22, 2020
59e87c0
Rollup merge of #72271 - rakshith-ravi:master, r=varkor
Manishearth Jun 23, 2020
903823c
Rollup merge of #72493 - nikomatsakis:move-leak-check, r=matthewjasper
Manishearth Jun 23, 2020
ae38698
Rollup merge of #73398 - oli-obk:const_raw_ptr_cmp, r=varkor,RalfJung…
Manishearth Jun 23, 2020
98aa34c
Rollup merge of #73472 - GuillaumeGomez:cleanup-e0689, r=Dylan-DPC
Manishearth Jun 23, 2020
cd18ac1
Rollup merge of #73496 - estebank:opaque-missing-lts-in-fn-3, r=nikom…
Manishearth Jun 23, 2020
0f9a6ed
Rollup merge of #73515 - christianpoveda:livedrop-diagnostics, r=oli-obk
Manishearth Jun 23, 2020
0560151
Rollup merge of #73567 - adetaylor:extern-doc-fix, r=dtolnay
Manishearth Jun 23, 2020
84bd1e7
Rollup merge of #73572 - JOE1994:patch-4, r=jonas-schievink
Manishearth Jun 23, 2020
44900f8
Rollup merge of #73590 - davidtwco:bootstrap-fix-config-env-var, r=Ma…
Manishearth Jun 23, 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
WIP bless test and compare-mode=nll
  • Loading branch information
nikomatsakis committed Jun 22, 2020
commit c88a76e37b869d6ca343c6ba5d9f0c65deddbca2
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
error: lifetime may not live long enough
--> $DIR/project-fn-ret-invariant.rs:55:4
--> $DIR/project-fn-ret-invariant.rs:56:5
|
LL | fn transmute<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
| -- -- lifetime `'b` defined here
LL | fn transmute<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
| -- -- lifetime `'b` defined here
| |
| lifetime `'a` defined here
...
LL | (a, b)
| ^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
LL | (a, b)
| ^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
|
= help: consider adding the following bound: `'a: 'b`

error: lifetime may not live long enough
--> $DIR/project-fn-ret-invariant.rs:55:4
--> $DIR/project-fn-ret-invariant.rs:56:5
|
LL | fn transmute<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
| -- -- lifetime `'b` defined here
LL | fn transmute<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
| -- -- lifetime `'b` defined here
| |
| lifetime `'a` defined here
...
LL | (a, b)
| ^^^^^^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
LL | (a, b)
| ^^^^^^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
|
= help: consider adding the following bound: `'b: 'a`

Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
error: lifetime may not live long enough
--> $DIR/project-fn-ret-invariant.rs:38:12
--> $DIR/project-fn-ret-invariant.rs:39:13
|
LL | fn baz<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
| -- -- lifetime `'b` defined here
LL | fn baz<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
| -- -- lifetime `'b` defined here
| |
| lifetime `'a` defined here
LL | let f = foo; // <-- No consistent type can be inferred for `f` here.
LL | let a = bar(f, x);
| ^^^^^^^^^ argument requires that `'a` must outlive `'b`
LL | let f = foo; // <-- No consistent type can be inferred for `f` here.
LL | let a = bar(f, x);
| ^^^^^^^^^ argument requires that `'a` must outlive `'b`
|
= help: consider adding the following bound: `'a: 'b`

error: lifetime may not live long enough
--> $DIR/project-fn-ret-invariant.rs:39:12
--> $DIR/project-fn-ret-invariant.rs:40:13
|
LL | fn baz<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
| -- -- lifetime `'b` defined here
LL | fn baz<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
| -- -- lifetime `'b` defined here
| |
| lifetime `'a` defined here
...
LL | let b = bar(f, y);
| ^^^^^^^^^ argument requires that `'b` must outlive `'a`
LL | let b = bar(f, y);
| ^^^^^^^^^ argument requires that `'b` must outlive `'a`
|
= help: consider adding the following bound: `'b: 'a`

Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
error: lifetime may not live long enough
--> $DIR/project-fn-ret-invariant.rs:48:4
--> $DIR/project-fn-ret-invariant.rs:49:5
|
LL | fn baz<'a,'b>(x: Type<'a>) -> Type<'static> {
LL | fn baz<'a, 'b>(x: Type<'a>) -> Type<'static> {
| -- lifetime `'a` defined here
...
LL | bar(foo, x)
| ^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
LL | bar(foo, x)
| ^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
|
= help: consider replacing `'a` with `'static`

63 changes: 32 additions & 31 deletions src/test/ui/closure-expected-type/expect-fn-supply-fn.nll.stderr
Original file line number Diff line number Diff line change
@@ -1,42 +1,43 @@
error[E0631]: type mismatch in closure arguments
--> $DIR/expect-fn-supply-fn.rs:30:5
error: lifetime may not live long enough
--> $DIR/expect-fn-supply-fn.rs:16:49
|
LL | fn with_closure_expecting_fn_with_free_region<F>(_: F)
| ------------------------------------------ required by a bound in this
LL | where F: for<'a> FnOnce(fn(&'a u32), &i32)
| ------------------------- required by this bound in `with_closure_expecting_fn_with_free_region`
LL | fn expect_free_supply_free_from_fn<'x>(x: &'x u32) {
| -- lifetime `'x` defined here
...
LL | with_closure_expecting_fn_with_free_region(|x: fn(&u32), y| {});
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ---------------- found signature of `fn(for<'r> fn(&'r u32), _) -> _`
| |
| expected signature of `fn(fn(&'a u32), &i32) -> _`
LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {});
| ^
| |
| has type `fn(&'1 u32)`
| requires that `'1` must outlive `'x`

error[E0631]: type mismatch in closure arguments
--> $DIR/expect-fn-supply-fn.rs:37:5
error: lifetime may not live long enough
--> $DIR/expect-fn-supply-fn.rs:16:49
|
LL | fn with_closure_expecting_fn_with_bound_region<F>(_: F)
| ------------------------------------------- required by a bound in this
LL | where F: FnOnce(fn(&u32), &i32)
| ---------------------- required by this bound in `with_closure_expecting_fn_with_bound_region`
LL | fn expect_free_supply_free_from_fn<'x>(x: &'x u32) {
| -- lifetime `'x` defined here
...
LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {});
| ^ requires that `'x` must outlive `'static`
|
= help: consider replacing `'x` with `'static`

error: higher-ranked subtype error
--> $DIR/expect-fn-supply-fn.rs:32:49
|
LL | with_closure_expecting_fn_with_free_region(|x: fn(&u32), y| {});
| ^

error: higher-ranked subtype error
--> $DIR/expect-fn-supply-fn.rs:39:50
|
LL | with_closure_expecting_fn_with_bound_region(|x: fn(&'x u32), y| {});
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ------------------- found signature of `fn(fn(&'x u32), _) -> _`
| |
| expected signature of `fn(for<'r> fn(&'r u32), &i32) -> _`
| ^

error[E0631]: type mismatch in closure arguments
--> $DIR/expect-fn-supply-fn.rs:46:5
error: higher-ranked subtype error
--> $DIR/expect-fn-supply-fn.rs:48:50
|
LL | fn with_closure_expecting_fn_with_bound_region<F>(_: F)
| ------------------------------------------- required by a bound in this
LL | where F: FnOnce(fn(&u32), &i32)
| ---------------------- required by this bound in `with_closure_expecting_fn_with_bound_region`
...
LL | with_closure_expecting_fn_with_bound_region(|x: Foo<'_>, y| {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ --------------- found signature of `for<'r> fn(fn(&'r u32), _) -> _`
| |
| expected signature of `fn(for<'r> fn(&'r u32), &i32) -> _`
| ^

error: aborting due to 3 previous errors
error: aborting due to 5 previous errors

For more information about this error, try `rustc --explain E0631`.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0119]: conflicting implementations of trait `Trait` for type `for<'r> fn(fn(&'r ()))`:
--> $DIR/coherence-fn-covariant-bound-vs-static.rs:14:1
--> $DIR/coherence-fn-covariant-bound-vs-static.rs:17:1
|
LL | impl Trait for for<'r> fn(fn(&'r ())) {}
| ------------------------------------- first implementation here
4 changes: 2 additions & 2 deletions src/test/ui/coherence/coherence-fn-implied-bounds.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: conflicting implementations of trait `Trait` for type `for<'a, 'b> fn(&'a &'b u32, &'b &'a u32) -> &'b u32`:
--> $DIR/coherence-fn-implied-bounds.rs:9:1
--> $DIR/coherence-fn-implied-bounds.rs:21:1
|
LL | impl Trait for for<'a, 'b> fn(&'a &'b u32, &'b &'a u32) -> &'b u32 {}
| ------------------------------------------------------------------ first implementation here
@@ -8,7 +8,7 @@ LL | impl Trait for for<'c> fn(&'c &'c u32, &'c &'c u32) -> &'c u32 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `for<'a, 'b> fn(&'a &'b u32, &'b &'a u32) -> &'b u32`
|
note: the lint level is defined here
--> $DIR/coherence-fn-implied-bounds.rs:3:9
--> $DIR/coherence-fn-implied-bounds.rs:15:9
|
LL | #![deny(coherence_leak_check)]
| ^^^^^^^^^^^^^^^^^^^^
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
error: lifetime may not live long enough
--> $DIR/hr-subtype.rs:33:13
--> $DIR/hr-subtype.rs:39:13
|
LL | fn subtype<'x,'y:'x,'z:'y>() {
| -- -- lifetime `'y` defined here
LL | fn subtype<'x, 'y: 'x, 'z: 'y>() {
| -- -- lifetime `'y` defined here
| |
| lifetime `'x` defined here
LL | gimme::<$t2>(None::<$t1>);
| ^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'x` must outlive `'y`
...
LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>),
LL | | fn(Inv<'y>)) }
| |__________________________________________________- in this macro invocation
LL | | fn(Inv<'y>)) }
| |______________- in this macro invocation
|
= help: consider adding the following bound: `'x: 'y`
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: lifetime may not live long enough
--> $DIR/hr-subtype.rs:39:13
--> $DIR/hr-subtype.rs:45:13
|
LL | fn supertype<'x,'y:'x,'z:'y>() {
| -- -- lifetime `'y` defined here
LL | fn supertype<'x, 'y: 'x, 'z: 'y>() {
| -- -- lifetime `'y` defined here
| |
| lifetime `'x` defined here
LL | gimme::<$t1>(None::<$t2>);
| ^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'x` must outlive `'y`
...
LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>),
LL | | fn(Inv<'y>)) }
| |__________________________________________________- in this macro invocation
LL | | fn(Inv<'y>)) }
| |______________- in this macro invocation
|
= help: consider adding the following bound: `'x: 'y`
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
10 changes: 5 additions & 5 deletions src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_y.nll.stderr
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
error: lifetime may not live long enough
--> $DIR/hr-subtype.rs:39:13
--> $DIR/hr-subtype.rs:45:13
|
LL | fn supertype<'x,'y:'x,'z:'y>() {
| -- -- lifetime `'y` defined here
LL | fn supertype<'x, 'y: 'x, 'z: 'y>() {
| -- -- lifetime `'y` defined here
| |
| lifetime `'x` defined here
LL | gimme::<$t1>(None::<$t2>);
| ^^^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'x` must outlive `'y`
...
LL | / check! { free_x_vs_free_y: (fn(&'x u32),
LL | | fn(&'y u32)) }
| |__________________________________________- in this macro invocation
LL | | fn(&'y u32)) }
| |______________- in this macro invocation
|
= help: consider adding the following bound: `'x: 'y`
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
Original file line number Diff line number Diff line change
@@ -1,14 +1,40 @@
error[E0308]: mismatched types
--> $DIR/region-lifetime-bounds-on-fns-where-clause.rs:20:43
error: lifetime may not live long enough
--> $DIR/region-lifetime-bounds-on-fns-where-clause.rs:8:5
|
LL | fn b<'a, 'b>(x: &mut &'a isize, y: &mut &'b isize) {
| -- -- lifetime `'b` defined here
| |
| lifetime `'a` defined here
LL | // Illegal now because there is no `'b:'a` declaration.
LL | *x = *y;
| ^^^^^^^ assignment requires that `'b` must outlive `'a`
|
= help: consider adding the following bound: `'b: 'a`

error: lifetime may not live long enough
--> $DIR/region-lifetime-bounds-on-fns-where-clause.rs:14:5
|
LL | fn c<'a,'b>(x: &mut &'a isize, y: &mut &'b isize) {
| -- -- lifetime `'b` defined here
| |
| lifetime `'a` defined here
...
LL | a(x, y);
| ^^^^^^^ argument requires that `'b` must outlive `'a`
|
= help: consider adding the following bound: `'b: 'a`

error: higher-ranked subtype error
--> $DIR/region-lifetime-bounds-on-fns-where-clause.rs:20:12
|
LL | let _: fn(&mut &isize, &mut &isize) = a;
| ---------------------------- ^ expected concrete lifetime, found bound lifetime parameter
| |
| expected due to this
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: higher-ranked subtype error
--> $DIR/region-lifetime-bounds-on-fns-where-clause.rs:20:12
|
= note: expected fn pointer `for<'r, 's, 't0, 't1> fn(&'r mut &'s isize, &'t0 mut &'t1 isize)`
found fn item `for<'r, 's> fn(&'r mut &isize, &'s mut &isize) {a::<'_, '_>}`
LL | let _: fn(&mut &isize, &mut &isize) = a;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error
error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0308`.
Original file line number Diff line number Diff line change
@@ -1,14 +1,46 @@
error[E0308]: mismatched types
--> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:22:56
error: lifetime may not live long enough
--> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:9:5
|
LL | fn b<'a, 'b, 'c>(x: &mut &'a isize, y: &mut &'b isize, z: &mut &'c isize) {
| -- -- lifetime `'b` defined here
| |
| lifetime `'a` defined here
LL | // Illegal now because there is no `'b:'a` declaration.
LL | *x = *y;
| ^^^^^^^ assignment requires that `'b` must outlive `'a`
|
= help: consider adding the following bound: `'b: 'a`

error: lifetime may not live long enough
--> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:16:5
|
LL | fn c<'a,'b, 'c>(x: &mut &'a isize, y: &mut &'b isize, z: &mut &'c isize) {
| -- -- lifetime `'b` defined here
| |
| lifetime `'a` defined here
...
LL | a(x, y, z);
| ^^^^^^^^^^ argument requires that `'b` must outlive `'a`
|
= help: consider adding the following bound: `'b: 'a`

error: higher-ranked subtype error
--> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:22:12
|
LL | let _: fn(&mut &isize, &mut &isize, &mut &isize) = a;
| ----------------------------------------- ^ expected concrete lifetime, found bound lifetime parameter
| |
| expected due to this
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: higher-ranked subtype error
--> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:22:12
|
= note: expected fn pointer `for<'r, 's, 't0, 't1, 't2, 't3> fn(&'r mut &'s isize, &'t0 mut &'t1 isize, &'t2 mut &'t3 isize)`
found fn item `for<'r, 's, 't0> fn(&'r mut &isize, &'s mut &isize, &'t0 mut &isize) {a::<'_, '_, '_>}`
LL | let _: fn(&mut &isize, &mut &isize, &mut &isize) = a;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: higher-ranked subtype error
--> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:22:12
|
LL | let _: fn(&mut &isize, &mut &isize, &mut &isize) = a;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error
error: aborting due to 5 previous errors

For more information about this error, try `rustc --explain E0308`.
Loading