Do not mention lifetime names in force trimmed paths
This commit is contained in:
parent
81973a39e0
commit
252c43b42b
23 changed files with 44 additions and 40 deletions
|
@ -2070,6 +2070,10 @@ impl<'tcx> PrettyPrinter<'tcx> for FmtPrinter<'_, 'tcx> {
|
|||
return true;
|
||||
}
|
||||
|
||||
if FORCE_TRIMMED_PATH.with(|flag| flag.get()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
let identify_regions = self.tcx.sess.opts.unstable_opts.identify_regions;
|
||||
|
||||
match *region {
|
||||
|
|
|
@ -95,7 +95,7 @@ LL | union U1 { f: ManuallyDrop<dyn Iterator<Item: Copy>> }
|
|||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
||||
|
|
||||
= help: within `ManuallyDrop<(dyn Iterator<Item = impl Copy> + 'static)>`, the trait `Sized` is not implemented for `(dyn Iterator<Item = impl Copy> + 'static)`
|
||||
= note: required because it appears within the type `ManuallyDrop<(dyn Iterator<Item = impl Copy> + 'static)>`
|
||||
= note: required because it appears within the type `ManuallyDrop<dyn Iterator<Item = impl Copy>>`
|
||||
= note: no field of a union may have a dynamically sized type
|
||||
= help: change the field's type to have a statically known size
|
||||
help: borrowed types always have a statically known size
|
||||
|
@ -114,7 +114,7 @@ LL | union U3 { f: ManuallyDrop<dyn Iterator<Item: 'static>> }
|
|||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
||||
|
|
||||
= help: within `ManuallyDrop<(dyn Iterator<Item = impl Sized + 'static> + 'static)>`, the trait `Sized` is not implemented for `(dyn Iterator<Item = impl Sized + 'static> + 'static)`
|
||||
= note: required because it appears within the type `ManuallyDrop<(dyn Iterator<Item = impl Sized + 'static> + 'static)>`
|
||||
= note: required because it appears within the type `ManuallyDrop<dyn Iterator<Item = impl Sized + 'static>>`
|
||||
= note: no field of a union may have a dynamically sized type
|
||||
= help: change the field's type to have a statically known size
|
||||
help: borrowed types always have a statically known size
|
||||
|
|
|
@ -10,11 +10,11 @@ note: required by a bound in `Foo::Out`
|
|||
LL | type Out: Default + ToString + ?Sized = dyn ToString;
|
||||
| ^^^^^^^ required by this bound in `Foo::Out`
|
||||
|
||||
error[E0599]: no function or associated item named `default` found for trait object `(dyn ToString + 'static)` in the current scope
|
||||
error[E0599]: no function or associated item named `default` found for trait object `dyn ToString` in the current scope
|
||||
--> $DIR/issue-43924.rs:14:39
|
||||
|
|
||||
LL | assert_eq!(<() as Foo<u32>>::Out::default().to_string(), "false");
|
||||
| ^^^^^^^ function or associated item not found in `(dyn ToString + 'static)`
|
||||
| ^^^^^^^ function or associated item not found in `dyn ToString`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
|
@ -43,8 +43,8 @@ impl Runtime {
|
|||
fn main() {
|
||||
Runtime.block_on(async {
|
||||
StructAsync { callback }.await;
|
||||
//~^ ERROR expected `fn() -> impl Future<Output = ()> {callback}` to be a fn item that returns `Pin<Box<(dyn Future<Output = ()> + 'static)>>`, but it returns `impl Future<Output = ()>`
|
||||
//~| ERROR expected `fn() -> impl Future<Output = ()> {callback}` to be a fn item that returns `Pin<Box<(dyn Future<Output = ()> + 'static)>>`, but it returns `impl Future<Output = ()>`
|
||||
//~| ERROR expected `fn() -> impl Future<Output = ()> {callback}` to be a fn item that returns `Pin<Box<(dyn Future<Output = ()> + 'static)>>`, but it returns `impl Future<Output = ()>`
|
||||
//~^ ERROR expected `fn() -> impl Future<Output = ()> {callback}` to be a fn item that returns `Pin<Box<dyn Future<Output = ()>>>`, but it returns `impl Future<Output = ()>`
|
||||
//~| ERROR expected `fn() -> impl Future<Output = ()> {callback}` to be a fn item that returns `Pin<Box<dyn Future<Output = ()>>>`, but it returns `impl Future<Output = ()>`
|
||||
//~| ERROR expected `fn() -> impl Future<Output = ()> {callback}` to be a fn item that returns `Pin<Box<dyn Future<Output = ()>>>`, but it returns `impl Future<Output = ()>`
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
error[E0271]: expected `fn() -> impl Future<Output = ()> {callback}` to be a fn item that returns `Pin<Box<(dyn Future<Output = ()> + 'static)>>`, but it returns `impl Future<Output = ()>`
|
||||
error[E0271]: expected `fn() -> impl Future<Output = ()> {callback}` to be a fn item that returns `Pin<Box<dyn Future<Output = ()>>>`, but it returns `impl Future<Output = ()>`
|
||||
--> $DIR/issue-98634.rs:45:23
|
||||
|
|
||||
LL | StructAsync { callback }.await;
|
||||
|
@ -17,7 +17,7 @@ note: required by a bound in `StructAsync`
|
|||
LL | pub struct StructAsync<F: Fn() -> Pin<Box<dyn Future<Output = ()>>>> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `StructAsync`
|
||||
|
||||
error[E0271]: expected `fn() -> impl Future<Output = ()> {callback}` to be a fn item that returns `Pin<Box<(dyn Future<Output = ()> + 'static)>>`, but it returns `impl Future<Output = ()>`
|
||||
error[E0271]: expected `fn() -> impl Future<Output = ()> {callback}` to be a fn item that returns `Pin<Box<dyn Future<Output = ()>>>`, but it returns `impl Future<Output = ()>`
|
||||
--> $DIR/issue-98634.rs:45:9
|
||||
|
|
||||
LL | StructAsync { callback }.await;
|
||||
|
@ -36,7 +36,7 @@ note: required by a bound in `StructAsync`
|
|||
LL | pub struct StructAsync<F: Fn() -> Pin<Box<dyn Future<Output = ()>>>> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `StructAsync`
|
||||
|
||||
error[E0271]: expected `fn() -> impl Future<Output = ()> {callback}` to be a fn item that returns `Pin<Box<(dyn Future<Output = ()> + 'static)>>`, but it returns `impl Future<Output = ()>`
|
||||
error[E0271]: expected `fn() -> impl Future<Output = ()> {callback}` to be a fn item that returns `Pin<Box<dyn Future<Output = ()>>>`, but it returns `impl Future<Output = ()>`
|
||||
--> $DIR/issue-98634.rs:45:33
|
||||
|
|
||||
LL | StructAsync { callback }.await;
|
||||
|
|
|
@ -95,7 +95,7 @@ LL | fn unsized_local() where Dst<dyn A>: Sized {
|
|||
| ^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
||||
|
|
||||
= help: within `Dst<(dyn A + 'static)>`, the trait `Sized` is not implemented for `(dyn A + 'static)`
|
||||
note: required because it appears within the type `Dst<(dyn A + 'static)>`
|
||||
note: required because it appears within the type `Dst<dyn A>`
|
||||
--> $DIR/feature-gate-trivial_bounds.rs:48:8
|
||||
|
|
||||
LL | struct Dst<X: ?Sized> {
|
||||
|
|
|
@ -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 `fn(&'a ()) -> (dyn Display + 'a)`
|
||||
= note: required because it appears within the type `fn(&()) -> dyn Display`
|
||||
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 Fn(&'a (dyn Fn(&'a ...) + 'a))`, found `&dyn Fn(u32)`
|
||||
| ^ expected `&dyn Fn(&dyn Fn(&dyn Fn(&...)))`, found `&dyn Fn(u32)`
|
||||
|
|
||||
= 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))`
|
||||
= note: expected reference `&dyn Fn(&dyn Fn(&dyn Fn(&dyn Fn(&dyn Fn(&dyn Fn(&dyn Fn(&dyn Fn(&dyn Fn(&dyn Fn(&dyn Fn(&...)))))))))))`
|
||||
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, 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(&u64) -> &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> {
|
||||
|
|
|
@ -16,7 +16,7 @@ LL | fn fuz() -> (usize, Trait) { (42, Struct) }
|
|||
| doesn't have a size known at compile-time
|
||||
|
|
||||
= help: within `(usize, (dyn Trait + 'static))`, the trait `Sized` is not implemented for `(dyn Trait + 'static)`
|
||||
= note: required because it appears within the type `(usize, (dyn Trait + 'static))`
|
||||
= note: required because it appears within the type `(usize, dyn Trait)`
|
||||
= note: the return type of a function must have a statically known size
|
||||
|
||||
error[E0308]: mismatched types
|
||||
|
@ -37,7 +37,7 @@ LL | fn bar() -> (usize, dyn Trait) { (42, Struct) }
|
|||
| doesn't have a size known at compile-time
|
||||
|
|
||||
= help: within `(usize, (dyn Trait + 'static))`, the trait `Sized` is not implemented for `(dyn Trait + 'static)`
|
||||
= note: required because it appears within the type `(usize, (dyn Trait + 'static))`
|
||||
= note: required because it appears within the type `(usize, dyn Trait)`
|
||||
= note: the return type of a function must have a statically known size
|
||||
|
||||
error[E0746]: return type cannot have an unboxed trait object
|
||||
|
|
|
@ -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 Fn(&'a T)>`, found `()`
|
||||
| ------------ ^^^^^^^^ expected `Rc<&dyn Fn(&T)>`, found `()`
|
||||
| |
|
||||
| implicitly returns `()` as its body has no tail or `return` expression
|
||||
|
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
error[E0599]: no method named `homura` found for reference `&'static str` in the current scope
|
||||
error[E0599]: no method named `homura` found for reference `&str` in the current scope
|
||||
--> $DIR/issue-19521.rs:2:8
|
||||
|
|
||||
LL | "".homura()();
|
||||
| ^^^^^^ method not found in `&'static str`
|
||||
| ^^^^^^ method not found in `&str`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ error[E0308]: mismatched types
|
|||
--> $DIR/issue-24322.rs:8:29
|
||||
|
|
||||
LL | let x: &fn(&B) -> u32 = &B::func;
|
||||
| -------------- ^^^^^^^^ expected `&fn(&'a B) -> u32`, found `&fn(&'a B) -> u32 {B::func}`
|
||||
| -------------- ^^^^^^^^ expected `&fn(&B) -> u32`, found `&fn(&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 `fn(&'a ())`, but its trait bounds were not satisfied
|
||||
error[E0599]: the function or associated item `make_g` exists for fn pointer `fn(&())`, 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 `fn(&'a ())` due to unsatisfied trait bounds
|
||||
| ^^^^^^ function or associated item cannot be called on `fn(&())` due to unsatisfied trait bounds
|
||||
|
|
||||
= note: the following trait bounds were not satisfied:
|
||||
`for<'a> fn(&'a ()): X`
|
||||
|
|
|
@ -20,7 +20,7 @@ LL | assert_send::<Box<dyn Dummy + 'a>>();
|
|||
|
|
||||
= help: the trait `Send` is not implemented for `(dyn Dummy + 'a)`
|
||||
= note: required for `Unique<(dyn Dummy + 'a)>` to implement `Send`
|
||||
= note: required because it appears within the type `Box<(dyn Dummy + 'a)>`
|
||||
= note: required because it appears within the type `Box<dyn Dummy>`
|
||||
note: required by a bound in `assert_send`
|
||||
--> $DIR/kindck-send-object1.rs:5:18
|
||||
|
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
error[E0599]: the function or associated item `make_g` exists for fn pointer `fn(&'a ())`, but its trait bounds were not satisfied
|
||||
error[E0599]: the function or associated item `make_g` exists for fn pointer `fn(&())`, 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 `fn(&'a ())` due to unsatisfied trait bounds
|
||||
| ^^^^^^ function or associated item cannot be called on `fn(&())` 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 `fn(&'a ())` in the current scope
|
||||
error[E0599]: no function or associated item named `make_f` found for fn pointer `fn(&())` 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 `fn(&'a ())`
|
||||
| ^^^^^^ function or associated item not found in `fn(&())`
|
||||
|
|
||||
= 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
|
||||
|
|
|
@ -16,11 +16,11 @@ LL | fn owned(self: Box<Self>);
|
|||
LL | x.owned();
|
||||
| ^^^^^ method not found in `&mut dyn Foo`
|
||||
|
||||
error[E0599]: no method named `managed` found for struct `Box<(dyn Foo + 'static)>` in the current scope
|
||||
error[E0599]: no method named `managed` found for struct `Box<dyn Foo>` in the current scope
|
||||
--> $DIR/object-pointer-types.rs:23:7
|
||||
|
|
||||
LL | x.managed();
|
||||
| ^^^^^^^ method not found in `Box<(dyn Foo + 'static)>`
|
||||
| ^^^^^^^ method not found in `Box<dyn Foo>`
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
|
|
|
@ -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<&(fn(&'a ()), Box<Wrapper>)>`, found `(_, _)`
|
||||
| expected `Match<&(fn(&()), Box<Wrapper>)>`, found `(_, _)`
|
||||
|
|
||||
= note: expected struct `Match<&(for<'a> fn(&'a ()), Box<Wrapper>)>`
|
||||
found tuple `(_, _)`
|
||||
|
|
|
@ -4,7 +4,7 @@ error[E0599]: no method named `as_str` found for reference `&str` in the current
|
|||
LL | s.as_str();
|
||||
| -^^^^^^-- help: remove this method call
|
||||
|
||||
error[E0599]: no method named `as_str` found for reference `&'a str` in the current scope
|
||||
error[E0599]: no method named `as_str` found for reference `&str` in the current scope
|
||||
--> $DIR/remove-as_str.rs:7:7
|
||||
|
|
||||
LL | s.as_str();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
pub fn main() {
|
||||
let _ = "foo".iter(); //~ ERROR no method named `iter` found for reference `&'static str` in the current scope
|
||||
let _ = "foo".foo(); //~ ERROR no method named `foo` found for reference `&'static str` in the current scope
|
||||
let _ = "foo".iter(); //~ ERROR no method named `iter` found for reference `&str` in the current scope
|
||||
let _ = "foo".foo(); //~ ERROR no method named `foo` found for reference `&str` in the current scope
|
||||
let _ = String::from("bar").iter(); //~ ERROR no method named `iter` found for struct `String` in the current scope
|
||||
let _ = (&String::from("bar")).iter(); //~ ERROR no method named `iter` found for reference `&String` in the current scope
|
||||
let _ = 0.iter(); //~ ERROR no method named `iter` found for type `{integer}` in the current scope
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
error[E0599]: no method named `iter` found for reference `&'static str` in the current scope
|
||||
error[E0599]: no method named `iter` found for reference `&str` in the current scope
|
||||
--> $DIR/suggest-using-chars.rs:2:19
|
||||
|
|
||||
LL | let _ = "foo".iter();
|
||||
| ^^^^ method not found in `&'static str`
|
||||
| ^^^^ method not found in `&str`
|
||||
|
|
||||
help: because of the in-memory representation of `&str`, to obtain an `Iterator` over each of its codepoint use method `chars`
|
||||
|
|
||||
LL | let _ = "foo".chars();
|
||||
| ~~~~~
|
||||
|
||||
error[E0599]: no method named `foo` found for reference `&'static str` in the current scope
|
||||
error[E0599]: no method named `foo` found for reference `&str` in the current scope
|
||||
--> $DIR/suggest-using-chars.rs:3:19
|
||||
|
|
||||
LL | let _ = "foo".foo();
|
||||
| ^^^ method not found in `&'static str`
|
||||
| ^^^ method not found in `&str`
|
||||
|
||||
error[E0599]: no method named `iter` found for struct `String` in the current scope
|
||||
--> $DIR/suggest-using-chars.rs:4:33
|
||||
|
|
|
@ -7,5 +7,5 @@ async fn test() {}
|
|||
#[allow(unused_must_use)]
|
||||
fn main() {
|
||||
Box::new(test) as AsyncFnPtr;
|
||||
//~^ ERROR expected `fn() -> impl Future<Output = ()> {test}` to be a fn item that returns `Pin<Box<(dyn Future<Output = ()> + 'static)>>`, but it returns `impl Future<Output = ()>`
|
||||
//~^ ERROR expected `fn() -> impl Future<Output = ()> {test}` to be a fn item that returns `Pin<Box<dyn Future<Output = ()>>>`, but it returns `impl Future<Output = ()>
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
error[E0271]: expected `fn() -> impl Future<Output = ()> {test}` to be a fn item that returns `Pin<Box<(dyn Future<Output = ()> + 'static)>>`, but it returns `impl Future<Output = ()>`
|
||||
error[E0271]: expected `fn() -> impl Future<Output = ()> {test}` to be a fn item that returns `Pin<Box<dyn Future<Output = ()>>>`, but it returns `impl Future<Output = ()>`
|
||||
--> $DIR/issue-98604.rs:9:5
|
||||
|
|
||||
LL | Box::new(test) as AsyncFnPtr;
|
||||
|
|
Loading…
Add table
Reference in a new issue