Skip to content

Commit f54911c

Browse files
committedOct 15, 2019
Auto merge of #65454 - tmandry:rollup-0k6jiik, r=tmandry
Rollup of 14 pull requests Successful merges: - #64603 (Reducing spurious unused lifetime warnings.) - #64623 (Remove last uses of gensyms) - #65235 (don't assume we can *always* find a return type hint in async fn) - #65242 (Fix suggestion to constrain trait for method to be found) - #65265 (Cleanup librustc mir err codes) - #65293 (Optimize `try_expand_impl_trait_type`) - #65307 (Try fix incorrect "explicit lifetime name needed") - #65308 (Add long error explanation for E0574) - #65353 (save-analysis: Don't ICE when resolving qualified type paths in struct members) - #65389 (Return `false` from `needs_drop` for all zero-sized arrays.) - #65402 (Add troubleshooting section to PGO chapter in rustc book.) - #65425 (Optimize `BitIter`) - #65438 (Organize `never_type` tests) - #65444 (Implement AsRef<[T]> for List<T>) Failed merges: - #65390 (Add long error explanation for E0576) r? @ghost
2 parents 237d54f + 3182f73 commit f54911c

File tree

99 files changed

+1095
-507
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+1095
-507
lines changed
 

‎src/doc/rustc/src/profile-guided-optimization.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,17 @@ RUSTFLAGS="-Cprofile-use=/tmp/pgo-data/merged.profdata" \
125125
cargo build --release --target=x86_64-unknown-linux-gnu
126126
```
127127

128+
### Troubleshooting
129+
130+
- It is recommended to pass `-Cllvm-args=-pgo-warn-missing-function` during the
131+
`-Cprofile-use` phase. LLVM by default does not warn if it cannot find
132+
profiling data for a given function. Enabling this warning will make it
133+
easier to spot errors in your setup.
134+
135+
- There is a [known issue](https://github.com/rust-lang/cargo/issues/7416) in
136+
Cargo prior to version 1.39 that will prevent PGO from working correctly. Be
137+
sure to use Cargo 1.39 or newer when doing PGO.
138+
128139
## Further Reading
129140

130141
`rustc`'s PGO support relies entirely on LLVM's implementation of the feature

‎src/librustc/hir/lowering.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3291,10 +3291,14 @@ impl<'a> LoweringContext<'a> {
32913291
let id = self.sess.next_node_id();
32923292
self.new_named_lifetime(id, span, hir::LifetimeName::Error)
32933293
}
3294-
// This is the normal case.
3295-
AnonymousLifetimeMode::PassThrough => self.new_implicit_lifetime(span),
3296-
3297-
AnonymousLifetimeMode::ReportError => self.new_error_lifetime(None, span),
3294+
// `PassThrough` is the normal case.
3295+
// `new_error_lifetime`, which would usually be used in the case of `ReportError`,
3296+
// is unsuitable here, as these can occur from missing lifetime parameters in a
3297+
// `PathSegment`, for which there is no associated `'_` or `&T` with no explicit
3298+
// lifetime. Instead, we simply create an implicit lifetime, which will be checked
3299+
// later, at which point a suitable error will be emitted.
3300+
| AnonymousLifetimeMode::PassThrough
3301+
| AnonymousLifetimeMode::ReportError => self.new_implicit_lifetime(span),
32983302
}
32993303
}
33003304

0 commit comments

Comments
 (0)