Skip to content

Rollup of 11 pull requests #73235

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

Merged
merged 33 commits into from
Jun 11, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
72a2d35
fix is_const_context
lcnr May 20, 2020
ecb5933
refactor check_for_cast
lcnr May 20, 2020
6da17d2
`is_const_context` -> `is_inside_const_context`
lcnr May 20, 2020
6b1ee67
Ensure stack when building MIR for matches
nagisa Jun 3, 2020
c183c3f
Clean up E0642 explanation
GuillaumeGomez Jun 4, 2020
2650c5f
doc/rustdoc: Fix incorrect external_doc feature flag
Jun 7, 2020
7b94fdb
save_analysis: better handle paths
marmeladema Jun 5, 2020
51e1724
save_analysis: better handle functions signature
marmeladema Jun 6, 2020
58023fe
Fix more clippy warnings
matthiaskrgr Jun 9, 2020
c9f2cbf
Automatically prioritize unsoundness issues
LeSeulArtichaut Jun 9, 2020
9015c41
save_analysis: improve pretty printing of enum
marmeladema Jun 9, 2020
5bfa7f0
save_analysis: fix enum reference to point to variant rather than con…
marmeladema Jun 9, 2020
4eda3f7
intra-doc macro resolution should also handle proc macros
Manishearth Jun 9, 2020
e003c3e
Add test for proc macro resolution in intra doc links
Manishearth Jun 9, 2020
27dcb4a
Avoid collisions between traits and their derive macros
Manishearth Jun 10, 2020
1784655
Don't print bang diagnostics for derives
Manishearth Jun 10, 2020
50a42fe
Create new error code E0762 for unterminated char literals
GuillaumeGomez Jun 10, 2020
7bd87cf
Add tests for E0762
GuillaumeGomez Jun 10, 2020
5859f6e
Fix doctest template
qm3ster Jun 10, 2020
34c6b38
Add tests for macro@ and derive@
Manishearth Jun 10, 2020
f507748
x.py: with --json-output, forward cargo's JSON
RalfJung Jun 10, 2020
7dc19b0
Update src/libcore/num/mod.rs
Amanieu Jun 11, 2020
298467e
Rollup merge of #72380 - lcnr:const_context, r=estebank
Dylan-DPC Jun 11, 2020
adc92be
Rollup merge of #72941 - nagisa:ensure-stack-for-match, r=oli-obk
Dylan-DPC Jun 11, 2020
f4661e2
Rollup merge of #72976 - GuillaumeGomez:cleanup-e0642, r=Dylan-DPC
Dylan-DPC Jun 11, 2020
12e5a69
Rollup merge of #73080 - ertos-rs:sean.wilson/devel/external_doc-ref-…
Dylan-DPC Jun 11, 2020
b4af874
Rollup merge of #73155 - marmeladema:save-analysis-various-fixes, r=X…
Dylan-DPC Jun 11, 2020
70c14c2
Rollup merge of #73164 - GuillaumeGomez:add-e0761, r=petrochenkov
Dylan-DPC Jun 11, 2020
2ac1598
Rollup merge of #73172 - matthiaskrgr:cl9ppy, r=Dylan-DPC
Dylan-DPC Jun 11, 2020
6cc757e
Rollup merge of #73181 - LeSeulArtichaut:patch-1, r=spastorino
Dylan-DPC Jun 11, 2020
d9cf7a1
Rollup merge of #73183 - Manishearth:intra-doc-macro, r=GuillaumeGomez
Dylan-DPC Jun 11, 2020
822bb9a
Rollup merge of #73208 - qm3ster:patch-1, r=Amanieu
Dylan-DPC Jun 11, 2020
ba0a8d2
Rollup merge of #73219 - RalfJung:cargo-json, r=Mark-Simulacrum
Dylan-DPC Jun 11, 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
is_const_context -> is_inside_const_context
  • Loading branch information
lcnr committed May 20, 2020
commit 6da17d244b08e5f14edd1645fbd07d1f042d00b7
2 changes: 1 addition & 1 deletion src/librustc_middle/hir/map/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ impl<'hir> Map<'hir> {

/// Whether the expression pointed at by `hir_id` belongs to a `const` evaluation context.
/// Used exclusively for diagnostics, to avoid suggestion function calls.
pub fn is_const_context(&self, hir_id: HirId) -> bool {
pub fn is_inside_const_context(&self, hir_id: HirId) -> bool {
self.body_const_context(self.local_def_id(self.enclosing_body_owner(hir_id))).is_some()
}

Expand Down
4 changes: 2 additions & 2 deletions src/librustc_typeck/check/demand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -800,12 +800,12 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
if let hir::ExprKind::Lit(lit) = &expr.kind { lit.node.is_suffixed() } else { false }
};

let is_const_context = self.tcx.hir().is_const_context(expr.hir_id);
let in_const_context = self.tcx.hir().is_inside_const_context(expr.hir_id);
let suggest_to_change_suffix_or_into =
|err: &mut DiagnosticBuilder<'_>, is_fallible: bool| {
let msg = if literal_is_ty_suffixed(expr) {
&lit_msg
} else if is_const_context {
} else if in_const_context {
// Do not recommend `into` or `try_into` in const contexts.
return;
} else if is_fallible {
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_typeck/check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5097,7 +5097,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
expected: Ty<'tcx>,
found: Ty<'tcx>,
) {
if self.tcx.hir().is_const_context(expr.hir_id) {
if self.tcx.hir().is_inside_const_context(expr.hir_id) {
// Do not suggest `Box::new` in const context.
return;
}
Expand Down Expand Up @@ -5134,7 +5134,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
) -> bool {
// Handle #68197.

if self.tcx.hir().is_const_context(expr.hir_id) {
if self.tcx.hir().is_inside_const_context(expr.hir_id) {
// Do not suggest `Box::new` in const context.
return false;
}
Expand Down