forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#119256 - matthiaskrgr:rollup-q0q5c1d, r=matth…
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#119231 (Clairify `ast::PatKind::Struct` presese of `..` by using an enum instead of a bool) - rust-lang#119232 (Fix doc typos) - rust-lang#119245 (Improve documentation for using warning blocks in documentation) - rust-lang#119248 (remove dead inferred outlives testing code) - rust-lang#119249 (Add spastorino to users_on_vacation) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
18 changed files
with
74 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
#### This error code is internal to the compiler and will not be emitted with normal Rust code. | ||
#### Note: this error code is no longer emitted by the compiler. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,28 @@ | ||
use rustc_errors::struct_span_err; | ||
use rustc_middle::ty::TyCtxt; | ||
use rustc_middle::ty::{self, TyCtxt}; | ||
use rustc_span::symbol::sym; | ||
|
||
pub fn test_inferred_outlives(tcx: TyCtxt<'_>) { | ||
for id in tcx.hir().items() { | ||
// For unit testing: check for a special "rustc_outlives" | ||
// attribute and report an error with various results if found. | ||
if tcx.has_attr(id.owner_id, sym::rustc_outlives) { | ||
let inferred_outlives_of = tcx.inferred_outlives_of(id.owner_id); | ||
struct_span_err!( | ||
tcx.sess, | ||
tcx.def_span(id.owner_id), | ||
E0640, | ||
"{:?}", | ||
inferred_outlives_of | ||
) | ||
.emit(); | ||
let predicates = tcx.inferred_outlives_of(id.owner_id); | ||
let mut pred: Vec<String> = predicates | ||
.iter() | ||
.map(|(out_pred, _)| match out_pred.kind().skip_binder() { | ||
ty::ClauseKind::RegionOutlives(p) => p.to_string(), | ||
ty::ClauseKind::TypeOutlives(p) => p.to_string(), | ||
err => bug!("unexpected clause {:?}", err), | ||
}) | ||
.collect(); | ||
pred.sort(); | ||
|
||
let span = tcx.def_span(id.owner_id); | ||
let mut err = tcx.sess.struct_span_err(span, "rustc_outlives"); | ||
for p in pred { | ||
err.note(p); | ||
} | ||
err.emit(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters