Skip to content

Rollup of 8 pull requests #65451

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

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
48fff6f
don't assume we can *always* find a return type hint in async fn
nikomatsakis Oct 9, 2019
061b906
Return `false` from `needs_drop` for all zero-sized arrays
ecstatic-morse Oct 13, 2019
8fd16ba
Remove special case for zero-sized arrays from indirectly mut locals
ecstatic-morse Oct 13, 2019
c08a871
Add regression test for #65348
ecstatic-morse Oct 13, 2019
f81b154
Add troubleshooting section to PGO chapter in rustc book.
michaelwoerister Oct 14, 2019
7528234
Add regression test for issue #64153.
michaelwoerister Oct 14, 2019
af05b23
Fix issue #64153 by checking for .rcgu.o suffix when trying to identi…
michaelwoerister Oct 15, 2019
53187c5
Slides path lifetime to the lifetime resolver
Phosphorus15 Oct 11, 2019
1fb8cfb
Organize `never_type` tests
Centril Oct 15, 2019
d82c1c5
Avoid unused lifetime warning for lifetimes introduced when desugerin…
gilescope Oct 15, 2019
fa3a4ae
Implement AsRef<[T]> for List<T>
spastorino Oct 15, 2019
c1f51b6
Rollup merge of #64603 - gilescope:unused-lifetime-warning, r=matthew…
Centril Oct 15, 2019
fd1cf87
Rollup merge of #65235 - nikomatsakis:issue-65159-async-fn-return-ice…
Centril Oct 15, 2019
2abce06
Rollup merge of #65307 - Phosphorus15:master, r=varkor
Centril Oct 15, 2019
2feabbb
Rollup merge of #65389 - ecstatic-morse:zero-sized-array-no-drop, r=e…
Centril Oct 15, 2019
a32fd51
Rollup merge of #65402 - michaelwoerister:pgo-troubleshooting-docs, r…
Centril Oct 15, 2019
d4e2f44
Rollup merge of #65435 - michaelwoerister:fix-issue-64153, r=alexcric…
Centril Oct 15, 2019
f46d291
Rollup merge of #65438 - Centril:almost, r=varkor
Centril Oct 15, 2019
453d011
Rollup merge of #65444 - spastorino:as-ref-for-list, r=Mark-Simulacrum
Centril Oct 15, 2019
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
12 changes: 8 additions & 4 deletions src/librustc/hir/lowering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3291,10 +3291,14 @@ impl<'a> LoweringContext<'a> {
let id = self.sess.next_node_id();
self.new_named_lifetime(id, span, hir::LifetimeName::Error)
}
// This is the normal case.
AnonymousLifetimeMode::PassThrough => self.new_implicit_lifetime(span),

AnonymousLifetimeMode::ReportError => self.new_error_lifetime(None, span),
// `PassThrough` is the normal case.
// `new_error_lifetime`, which would usually be used in the case of `ReportError`,
// is unsuitable here, as these can occur from missing lifetime parameters in a
// `PathSegment`, for which there is no associated `'_` or `&T` with no explicit
// lifetime. Instead, we simply create an implicit lifetime, which will be checked
// later, at which point a suitable error will be emitted.
| AnonymousLifetimeMode::PassThrough
| AnonymousLifetimeMode::ReportError => self.new_implicit_lifetime(span),
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#![crate_type="lib"]

struct Nested<K>(K);

fn should_error<T>() where T : Into<&u32> {}
//~^ ERROR `&` without an explicit lifetime name cannot be used here [E0637]

trait X<'a, K: 'a> {
fn foo<'b, L: X<&'b Nested<K>>>();
//~^ ERROR missing lifetime specifier [E0106]
}

fn bar<'b, L: X<&'b Nested<i32>>>(){}
//~^ ERROR missing lifetime specifier [E0106]
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
error[E0637]: `&` without an explicit lifetime name cannot be used here
--> $DIR/issue-65285-incorrect-explicit-lifetime-name-needed.rs:5:37
|
LL | fn should_error<T>() where T : Into<&u32> {}
| ^ explicit lifetime name needed here

error[E0106]: missing lifetime specifier
--> $DIR/issue-65285-incorrect-explicit-lifetime-name-needed.rs:9:19
|
LL | fn foo<'b, L: X<&'b Nested<K>>>();
| ^^^^^^^^^^^^^^^^ expected lifetime parameter

error[E0106]: missing lifetime specifier
--> $DIR/issue-65285-incorrect-explicit-lifetime-name-needed.rs:13:15
|
LL | fn bar<'b, L: X<&'b Nested<i32>>>(){}
| ^^^^^^^^^^^^^^^^^^ expected lifetime parameter

error: aborting due to 3 previous errors

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