Skip to content

Rollup of 11 pull requests #104845

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 22 commits into from
Nov 25, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
85c9985
Allow power10-vector feature in PowerPC
ecnelises Nov 22, 2022
5fc359f
resolve: Don't use constructor def ids in the map for field names
petrochenkov Nov 22, 2022
46b37e2
OpaqueCast projections are always overlapping, they can't possibly be…
oli-obk Nov 23, 2022
6c2719a
Bump the const eval step limit
oli-obk Nov 23, 2022
2185f49
rustdoc: simplify `.search-results-title` CSS
notriddle Nov 23, 2022
97d95d4
lint: do not warn unused parens around higher-ranked function pointers
notriddle Nov 24, 2022
ecea94e
fix #104513, Use node_ty_opt to avoid ICE in visit_ty
chenyukang Nov 17, 2022
72d8879
make `error_reported` check for delayed bugs
BoxyUwU Nov 24, 2022
1930c77
Remove normalize_projection_type
spastorino Nov 23, 2022
66b4b8b
with_query_mode -> new
spastorino Nov 24, 2022
07ccf67
Document split{_ascii,}_whitespace() for empty strings
vojtechkral Nov 23, 2022
80dc91c
Rollup merge of #104514 - chenyukang:yukang/fix-104513-ice, r=petroch…
matthiaskrgr Nov 24, 2022
7a17d61
Rollup merge of #104704 - ecnelises:p10vec, r=jackh726
matthiaskrgr Nov 24, 2022
0e4eb0d
Rollup merge of #104747 - petrochenkov:ctorfields, r=cjgillot
matthiaskrgr Nov 24, 2022
9a558b6
Rollup merge of #104773 - oli-obk:overlap, r=lcnr
matthiaskrgr Nov 24, 2022
d4e5418
Rollup merge of #104774 - vojtechkral:doc-str-empty-split-whitespace,…
matthiaskrgr Nov 24, 2022
4843946
Rollup merge of #104780 - BoxyUwU:error_reported_not_be_bad, r=oli-obk
matthiaskrgr Nov 24, 2022
679f1b7
Rollup merge of #104782 - oli-obk:const_eval_limit_bump, r=pnkfelix
matthiaskrgr Nov 24, 2022
ed2d936
Rollup merge of #104792 - notriddle:notriddle/crate-search-title-disp…
matthiaskrgr Nov 24, 2022
83d1aab
Rollup merge of #104796 - notriddle:notriddle/unused-issue-104397, r=…
matthiaskrgr Nov 24, 2022
73f01ff
Rollup merge of #104820 - spastorino:remove-normalize_projection_type…
matthiaskrgr Nov 24, 2022
1048a85
Rollup merge of #104822 - spastorino:selctx-new-instead-of-with_query…
matthiaskrgr Nov 24, 2022
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
make error_reported check for delayed bugs
  • Loading branch information
BoxyUwU committed Nov 24, 2022
commit 72d8879c29570ee18cc3ab2c3e96bfd97221d0bb
21 changes: 18 additions & 3 deletions compiler/rustc_errors/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1044,13 +1044,24 @@ impl Handler {
}
pub fn has_errors_or_lint_errors(&self) -> Option<ErrorGuaranteed> {
if self.inner.borrow().has_errors_or_lint_errors() {
Some(ErrorGuaranteed(()))
Some(ErrorGuaranteed::unchecked_claim_error_was_emitted())
} else {
None
}
}
pub fn has_errors_or_delayed_span_bugs(&self) -> Option<ErrorGuaranteed> {
if self.inner.borrow().has_errors_or_delayed_span_bugs() {
Some(ErrorGuaranteed::unchecked_claim_error_was_emitted())
} else {
None
}
}
pub fn has_errors_or_delayed_span_bugs(&self) -> bool {
self.inner.borrow().has_errors_or_delayed_span_bugs()
pub fn is_compilation_going_to_fail(&self) -> Option<ErrorGuaranteed> {
if self.inner.borrow().is_compilation_going_to_fail() {
Some(ErrorGuaranteed::unchecked_claim_error_was_emitted())
} else {
None
}
}

pub fn print_error_count(&self, registry: &Registry) {
Expand Down Expand Up @@ -1484,6 +1495,10 @@ impl HandlerInner {
self.err_count() > 0 || self.lint_err_count > 0 || self.warn_count > 0
}

fn is_compilation_going_to_fail(&self) -> bool {
self.has_errors() || self.lint_err_count > 0 || !self.delayed_span_bugs.is_empty()
}

fn abort_if_errors(&mut self) {
self.emit_stashed_diagnostics();

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_incremental/src/persist/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ pub fn finalize_session_directory(sess: &Session, svh: Svh) {

let incr_comp_session_dir: PathBuf = sess.incr_comp_session_dir().clone();

if sess.has_errors_or_delayed_span_bugs() {
if let Some(_) = sess.has_errors_or_delayed_span_bugs() {
// If there have been any errors during compilation, we don't want to
// publish this session directory. Rather, we'll just delete it.

Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_incremental/src/persist/save.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub fn save_dep_graph(tcx: TyCtxt<'_>) {
return;
}
// This is going to be deleted in finalize_session_directory, so let's not create it
if sess.has_errors_or_delayed_span_bugs() {
if let Some(_) = sess.has_errors_or_delayed_span_bugs() {
return;
}

Expand Down Expand Up @@ -89,7 +89,7 @@ pub fn save_work_product_index(
return;
}
// This is going to be deleted in finalize_session_directory, so let's not create it
if sess.has_errors_or_delayed_span_bugs() {
if let Some(_) = sess.has_errors_or_delayed_span_bugs() {
return;
}

Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_middle/src/ty/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ pub trait TypeVisitable<'tcx>: fmt::Debug + Clone {
}
fn error_reported(&self) -> Result<(), ErrorGuaranteed> {
if self.references_error() {
if let Some(reported) = ty::tls::with(|tcx| tcx.sess.has_errors()) {
if let Some(reported) = ty::tls::with(|tcx| tcx.sess.is_compilation_going_to_fail()) {
Err(reported)
} else {
bug!("expect tcx.sess.has_errors return true");
bug!("expect tcx.sess.is_compilation_going_to_fail return `Some`");
}
} else {
Ok(())
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_query_system/src/dep_graph/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ impl<K: DepKind> DepGraph<K> {
None => {}
}

if !qcx.dep_context().sess().has_errors_or_delayed_span_bugs() {
if let None = qcx.dep_context().sess().has_errors_or_delayed_span_bugs() {
panic!("try_mark_previous_green() - Forcing the DepNode should have set its color")
}

Expand Down
5 changes: 4 additions & 1 deletion compiler/rustc_session/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -538,9 +538,12 @@ impl Session {
pub fn has_errors(&self) -> Option<ErrorGuaranteed> {
self.diagnostic().has_errors()
}
pub fn has_errors_or_delayed_span_bugs(&self) -> bool {
pub fn has_errors_or_delayed_span_bugs(&self) -> Option<ErrorGuaranteed> {
self.diagnostic().has_errors_or_delayed_span_bugs()
}
pub fn is_compilation_going_to_fail(&self) -> Option<ErrorGuaranteed> {
self.diagnostic().is_compilation_going_to_fail()
}
pub fn abort_if_errors(&self) {
self.diagnostic().abort_if_errors();
}
Expand Down
4 changes: 4 additions & 0 deletions src/test/ui/consts/issue-104768.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
const A: &_ = 0_u32;
//~^ ERROR: the placeholder `_` is not allowed within types on item signatures for constants

fn main() {}
12 changes: 12 additions & 0 deletions src/test/ui/consts/issue-104768.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
error[E0121]: the placeholder `_` is not allowed within types on item signatures for constants
--> $DIR/issue-104768.rs:1:10
|
LL | const A: &_ = 0_u32;
| ^^
| |
| not allowed in type signatures
| help: replace with the correct type: `u32`

error: aborting due to previous error

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