Move ty::print methods to Drop-based scope guards
This commit is contained in:
parent
393fdc1048
commit
9763486034
30 changed files with 142 additions and 142 deletions
|
@ -2634,7 +2634,7 @@ impl<'tcx> LateLintPass<'tcx> for InvalidValue {
|
|||
// We are extremely conservative with what we warn about.
|
||||
let conjured_ty = cx.typeck_results().expr_ty(expr);
|
||||
if let Some((msg, span)) =
|
||||
with_no_trimmed_paths(|| ty_find_init_error(cx.tcx, conjured_ty, init))
|
||||
with_no_trimmed_paths!(ty_find_init_error(cx.tcx, conjured_ty, init))
|
||||
{
|
||||
cx.struct_span_lint(INVALID_VALUE, expr.span, |lint| {
|
||||
let mut err = lint.build(&format!(
|
||||
|
|
|
@ -994,7 +994,7 @@ impl<'tcx> LateContext<'tcx> {
|
|||
}
|
||||
|
||||
// This shouldn't ever be needed, but just in case:
|
||||
with_no_trimmed_paths(|| {
|
||||
with_no_trimmed_paths!({
|
||||
Ok(vec![match trait_ref {
|
||||
Some(trait_ref) => Symbol::intern(&format!("{:?}", trait_ref)),
|
||||
None => Symbol::intern(&format!("<{}>", self_ty)),
|
||||
|
@ -1013,15 +1013,15 @@ impl<'tcx> LateContext<'tcx> {
|
|||
|
||||
// This shouldn't ever be needed, but just in case:
|
||||
path.push(match trait_ref {
|
||||
Some(trait_ref) => with_no_trimmed_paths(|| {
|
||||
Symbol::intern(&format!(
|
||||
Some(trait_ref) => {
|
||||
with_no_trimmed_paths!(Symbol::intern(&format!(
|
||||
"<impl {} for {}>",
|
||||
trait_ref.print_only_trait_path(),
|
||||
self_ty
|
||||
))
|
||||
}),
|
||||
)))
|
||||
}
|
||||
None => {
|
||||
with_no_trimmed_paths(|| Symbol::intern(&format!("<impl {}>", self_ty)))
|
||||
with_no_trimmed_paths!(Symbol::intern(&format!("<impl {}>", self_ty)))
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue