Don't show for<'lt>
in force trimmed paths
This commit is contained in:
parent
3fa95b847b
commit
81973a39e0
@ -2346,6 +2346,7 @@ impl<'tcx> FmtPrinter<'_, 'tcx> {
|
||||
} else {
|
||||
let tcx = self.tcx;
|
||||
|
||||
let trim_path = FORCE_TRIMMED_PATH.with(|flag| flag.get());
|
||||
// Closure used in `RegionFolder` to create names for anonymous late-bound
|
||||
// regions. We use two `DebruijnIndex`es (one for the currently folded
|
||||
// late-bound region and the other for the binder level) to determine
|
||||
@ -2400,8 +2401,10 @@ impl<'tcx> FmtPrinter<'_, 'tcx> {
|
||||
}
|
||||
};
|
||||
|
||||
start_or_continue(&mut self, "for<", ", ");
|
||||
do_continue(&mut self, name);
|
||||
if !trim_path {
|
||||
start_or_continue(&mut self, "for<", ", ");
|
||||
do_continue(&mut self, name);
|
||||
}
|
||||
tcx.mk_region(ty::ReLateBound(ty::INNERMOST, ty::BoundRegion { var: br.var, kind }))
|
||||
};
|
||||
let mut folder = RegionFolder {
|
||||
@ -2412,7 +2415,9 @@ impl<'tcx> FmtPrinter<'_, 'tcx> {
|
||||
};
|
||||
let new_value = value.clone().skip_binder().fold_with(&mut folder);
|
||||
let region_map = folder.region_map;
|
||||
start_or_continue(&mut self, "", "> ");
|
||||
if !trim_path {
|
||||
start_or_continue(&mut self, "", "> ");
|
||||
}
|
||||
(new_value, region_map)
|
||||
};
|
||||
|
||||
|
@ -23,7 +23,7 @@ LL | foo::<for<'a> fn(&'a ()) -> (dyn std::fmt::Display + 'a), _>(None, (&()
|
||||
| required by a bound introduced by this call
|
||||
|
|
||||
= help: within `for<'a> fn(&'a ()) -> (dyn std::fmt::Display + 'a)`, the trait `for<'a> Sized` is not implemented for `(dyn std::fmt::Display + 'a)`
|
||||
= note: required because it appears within the type `for<'a> fn(&'a ()) -> (dyn Display + 'a)`
|
||||
= note: required because it appears within the type `fn(&'a ()) -> (dyn Display + 'a)`
|
||||
note: required by a bound in `foo`
|
||||
--> $DIR/unsized-ret.rs:5:11
|
||||
|
|
||||
|
@ -11,9 +11,9 @@ LL | | ),
|
||||
LL | | ) {
|
||||
| |_- expected `&dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn Fn(u32) + 'a)) + 'a)) + 'a)) + 'a)) + 'a)) + 'a)) + 'a)) + 'a)) + 'a)) + 'a)) + 'a))` because of return type
|
||||
LL | f
|
||||
| ^ expected `&dyn for<'a> Fn(&'a ...)`, found `&dyn Fn(u32)`
|
||||
| ^ expected `&dyn Fn(&'a (dyn Fn(&'a ...) + 'a))`, found `&dyn Fn(u32)`
|
||||
|
|
||||
= note: expected reference `&dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a (dyn for<'a> Fn(&'a ...) + 'a)) + 'a)) + 'a))`
|
||||
= note: expected reference `&dyn Fn(&'a (dyn Fn(&'a (dyn Fn(&'a (dyn Fn(&'a (dyn Fn(&'a (dyn Fn(...) + 'a)) + 'a)) + 'a)) + 'a)) + 'a))`
|
||||
the full type name has been written to '$TEST_BUILD_DIR/higher-rank-trait-bounds/hang-on-deeply-nested-dyn/hang-on-deeply-nested-dyn.long-type-hash.txt'
|
||||
found reference `&dyn Fn(u32)`
|
||||
|
||||
|
@ -19,7 +19,7 @@ note: the following trait bounds were not satisfied:
|
||||
LL | impl<T> StreamExt for T where for<'a> &'a mut T: Stream {}
|
||||
| --------- - ^^^^^^ unsatisfied trait bound introduced here
|
||||
|
||||
error[E0599]: the method `countx` exists for struct `Filter<Map<Repeat, for<'a> fn(&'a u64) -> &'a u64 {identity::<u64>}>, [closure@issue-30786.rs:129:30]>`, but its trait bounds were not satisfied
|
||||
error[E0599]: the method `countx` exists for struct `Filter<Map<Repeat, fn(&'a u64) -> &'a u64 {identity::<u64>}>, [closure@issue-30786.rs:129:30]>`, but its trait bounds were not satisfied
|
||||
--> $DIR/issue-30786.rs:130:24
|
||||
|
|
||||
LL | pub struct Filter<S, F> {
|
||||
|
@ -2,7 +2,7 @@ error[E0308]: mismatched types
|
||||
--> $DIR/issue-102964.rs:5:41
|
||||
|
|
||||
LL | fn bar_function<T>(function: Foo<T>) -> RcFoo<T> {
|
||||
| ------------ ^^^^^^^^ expected `Rc<&dyn for<'a> Fn(&'a T)>`, found `()`
|
||||
| ------------ ^^^^^^^^ expected `Rc<&dyn Fn(&'a T)>`, found `()`
|
||||
| |
|
||||
| implicitly returns `()` as its body has no tail or `return` expression
|
||||
|
|
||||
|
@ -2,7 +2,7 @@ error[E0308]: mismatched types
|
||||
--> $DIR/issue-24322.rs:8:29
|
||||
|
|
||||
LL | let x: &fn(&B) -> u32 = &B::func;
|
||||
| -------------- ^^^^^^^^ expected `&for<'a> fn(&'a B) -> u32`, found `&for<'a> fn(&'a B) -> u32 {B::func}`
|
||||
| -------------- ^^^^^^^^ expected `&fn(&'a B) -> u32`, found `&fn(&'a B) -> u32 {B::func}`
|
||||
| |
|
||||
| expected due to this
|
||||
|
|
||||
|
@ -1,8 +1,8 @@
|
||||
error[E0599]: the function or associated item `make_g` exists for fn pointer `for<'a> fn(&'a ())`, but its trait bounds were not satisfied
|
||||
error[E0599]: the function or associated item `make_g` exists for fn pointer `fn(&'a ())`, but its trait bounds were not satisfied
|
||||
--> $DIR/issue-57362-2.rs:22:25
|
||||
|
|
||||
LL | let x = <fn (&())>::make_g();
|
||||
| ^^^^^^ function or associated item cannot be called on `for<'a> fn(&'a ())` due to unsatisfied trait bounds
|
||||
| ^^^^^^ function or associated item cannot be called on `fn(&'a ())` due to unsatisfied trait bounds
|
||||
|
|
||||
= note: the following trait bounds were not satisfied:
|
||||
`for<'a> fn(&'a ()): X`
|
||||
|
@ -1,8 +1,8 @@
|
||||
error[E0599]: the function or associated item `make_g` exists for fn pointer `for<'a> fn(&'a ())`, but its trait bounds were not satisfied
|
||||
error[E0599]: the function or associated item `make_g` exists for fn pointer `fn(&'a ())`, but its trait bounds were not satisfied
|
||||
--> $DIR/issue-57642-higher-ranked-subtype.rs:31:25
|
||||
|
|
||||
LL | let x = <fn (&())>::make_g();
|
||||
| ^^^^^^ function or associated item cannot be called on `for<'a> fn(&'a ())` due to unsatisfied trait bounds
|
||||
| ^^^^^^ function or associated item cannot be called on `fn(&'a ())` due to unsatisfied trait bounds
|
||||
|
|
||||
= note: the following trait bounds were not satisfied:
|
||||
`for<'a> fn(&'a ()): X`
|
||||
@ -13,11 +13,11 @@ note: `X` defines an item `make_g`, perhaps you need to implement it
|
||||
LL | trait X {
|
||||
| ^^^^^^^
|
||||
|
||||
error[E0599]: no function or associated item named `make_f` found for fn pointer `for<'a> fn(&'a ())` in the current scope
|
||||
error[E0599]: no function or associated item named `make_f` found for fn pointer `fn(&'a ())` in the current scope
|
||||
--> $DIR/issue-57642-higher-ranked-subtype.rs:35:25
|
||||
|
|
||||
LL | let x = <fn (&())>::make_f();
|
||||
| ^^^^^^ function or associated item not found in `for<'a> fn(&'a ())`
|
||||
| ^^^^^^ function or associated item not found in `fn(&'a ())`
|
||||
|
|
||||
= help: items from traits can only be used if the trait is implemented and in scope
|
||||
note: `Y` defines an item `make_f`, perhaps you need to implement it
|
||||
|
@ -7,7 +7,7 @@ LL | f
|
||||
| ^ expected `i32`, found fn pointer
|
||||
|
|
||||
= note: expected type `i32`
|
||||
found fn pointer `for<'z1, 'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm, 'n, 'o, 'p, 'q, 'r, 's, 't, 'u, 'v, 'w, 'x, 'y, 'z, 'z0> fn(Cell<...>)`
|
||||
found fn pointer `fn(Cell<...>)`
|
||||
the full type name has been written to '$TEST_BUILD_DIR/regions/issue-102374/issue-102374.long-type-hash.txt'
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -4,7 +4,7 @@ error[E0308]: mismatched types
|
||||
LL | let (cmp, router) = self.router.at()?;
|
||||
| ^^^^^^^^^^^^^ ----------------- this expression has type `Match<&(for<'a> fn(&'a ()), Box<Wrapper>)>`
|
||||
| |
|
||||
| expected `Match<&(for<'a> fn(&'a ()), ...)>`, found `(_, _)`
|
||||
| expected `Match<&(fn(&'a ()), Box<Wrapper>)>`, found `(_, _)`
|
||||
|
|
||||
= note: expected struct `Match<&(for<'a> fn(&'a ()), Box<Wrapper>)>`
|
||||
found tuple `(_, _)`
|
||||
|
Loading…
x
Reference in New Issue
Block a user