Merge from rustc
This commit is contained in:
commit
4a26aa4439
196 changed files with 2507 additions and 1673 deletions
|
|
@ -18,7 +18,7 @@ error[E0107]: associated type takes 0 generic arguments but 1 generic argument w
|
|||
--> $DIR/invalid_const_in_lifetime_position.rs:4:26
|
||||
|
|
||||
LL | fn f<'a>(arg : Box<dyn X<Y<1> = &'a ()>>) {}
|
||||
| ^--- help: remove these generics
|
||||
| ^--- help: remove the unnecessary generics
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
|
|
||||
|
|
@ -49,7 +49,7 @@ error[E0107]: associated type takes 0 generic arguments but 1 generic argument w
|
|||
--> $DIR/invalid_const_in_lifetime_position.rs:4:26
|
||||
|
|
||||
LL | fn f<'a>(arg : Box<dyn X<Y<1> = &'a ()>>) {}
|
||||
| ^--- help: remove these generics
|
||||
| ^--- help: remove the unnecessary generics
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
|
|
||||
|
|
@ -81,7 +81,7 @@ error[E0107]: associated type takes 0 generic arguments but 1 generic argument w
|
|||
--> $DIR/invalid_const_in_lifetime_position.rs:4:26
|
||||
|
|
||||
LL | fn f<'a>(arg : Box<dyn X<Y<1> = &'a ()>>) {}
|
||||
| ^--- help: remove these generics
|
||||
| ^--- help: remove the unnecessary generics
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
|
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0107]: type alias takes 1 lifetime argument but 2 lifetime arguments were
|
|||
--> $DIR/mismatched_arg_count.rs:7:29
|
||||
|
|
||||
LL | fn bar<'a, T: Trait<'a>>(_: Alias<'a, 'a, T>) {}
|
||||
| ^^^^^ -- help: remove this lifetime argument
|
||||
| ^^^^^ ---- help: remove the lifetime argument
|
||||
| |
|
||||
| expected 1 lifetime argument
|
||||
|
|
||||
|
|
|
|||
|
|
@ -46,9 +46,11 @@ use thin_vec::{thin_vec, ThinVec};
|
|||
fn parse_expr(psess: &ParseSess, src: &str) -> Option<P<Expr>> {
|
||||
let src_as_string = src.to_string();
|
||||
|
||||
let mut p = unwrap_or_emit_fatal(
|
||||
new_parser_from_source_str(psess, FileName::Custom(src_as_string.clone()), src_as_string)
|
||||
);
|
||||
let mut p = unwrap_or_emit_fatal(new_parser_from_source_str(
|
||||
psess,
|
||||
FileName::Custom(src_as_string.clone()),
|
||||
src_as_string,
|
||||
));
|
||||
p.parse_expr().map_err(|e| e.cancel()).ok()
|
||||
}
|
||||
|
||||
|
|
@ -181,10 +183,9 @@ fn iter_exprs(depth: usize, f: &mut dyn FnMut(P<Expr>)) {
|
|||
18 => {
|
||||
let pat =
|
||||
P(Pat { id: DUMMY_NODE_ID, kind: PatKind::Wild, span: DUMMY_SP, tokens: None });
|
||||
iter_exprs(
|
||||
depth - 1,
|
||||
&mut |e| g(ExprKind::Let(pat.clone(), e, DUMMY_SP, Recovered::No))
|
||||
)
|
||||
iter_exprs(depth - 1, &mut |e| {
|
||||
g(ExprKind::Let(pat.clone(), e, DUMMY_SP, Recovered::No))
|
||||
})
|
||||
}
|
||||
_ => panic!("bad counter value in iter_exprs"),
|
||||
}
|
||||
|
|
@ -202,7 +203,7 @@ impl MutVisitor for RemoveParens {
|
|||
ExprKind::Paren(inner) => *e = inner,
|
||||
_ => {}
|
||||
};
|
||||
mut_visit::noop_visit_expr(e, self);
|
||||
mut_visit::walk_expr(self, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -211,7 +212,7 @@ struct AddParens;
|
|||
|
||||
impl MutVisitor for AddParens {
|
||||
fn visit_expr(&mut self, e: &mut P<Expr>) {
|
||||
mut_visit::noop_visit_expr(e, self);
|
||||
mut_visit::walk_expr(self, e);
|
||||
visit_clobber(e, |e| {
|
||||
P(Expr {
|
||||
id: DUMMY_NODE_ID,
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0107]: function takes 0 generic arguments but 1 generic argument was supp
|
|||
--> $DIR/issue-100154.rs:4:5
|
||||
|
|
||||
LL | foo::<()>(());
|
||||
| ^^^------ help: remove these generics
|
||||
| ^^^------ help: remove the unnecessary generics
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
|
|
||||
|
|
|
|||
|
|
@ -3,5 +3,7 @@ fn foo(x: impl async Fn()) -> impl async Fn() { x }
|
|||
//~| ERROR `async` trait bounds are only allowed in Rust 2018 or later
|
||||
//~| ERROR async closures are unstable
|
||||
//~| ERROR async closures are unstable
|
||||
//~| ERROR use of unstable library feature 'async_closure'
|
||||
//~| ERROR use of unstable library feature 'async_closure'
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -38,6 +38,26 @@ LL | fn foo(x: impl async Fn()) -> impl async Fn() { x }
|
|||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
= help: to use an async block, remove the `||`: `async {`
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
error[E0658]: use of unstable library feature 'async_closure'
|
||||
--> $DIR/edition-2015.rs:1:22
|
||||
|
|
||||
LL | fn foo(x: impl async Fn()) -> impl async Fn() { x }
|
||||
| ^^^^
|
||||
|
|
||||
= note: see issue #62290 <https://github.com/rust-lang/rust/issues/62290> for more information
|
||||
= help: add `#![feature(async_closure)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
|
||||
error[E0658]: use of unstable library feature 'async_closure'
|
||||
--> $DIR/edition-2015.rs:1:42
|
||||
|
|
||||
LL | fn foo(x: impl async Fn()) -> impl async Fn() { x }
|
||||
| ^^^^
|
||||
|
|
||||
= note: see issue #62290 <https://github.com/rust-lang/rust/issues/62290> for more information
|
||||
= help: add `#![feature(async_closure)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
//@ edition: 2021
|
||||
//@ build-pass
|
||||
|
||||
#![feature(async_fn_traits)]
|
||||
#![feature(async_closure)]
|
||||
|
||||
extern crate block_on;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
//@ known-bug: #119272
|
||||
//! used to ICE: #119272
|
||||
|
||||
//@ check-pass
|
||||
|
||||
#![feature(type_alias_impl_trait)]
|
||||
mod defining_scope {
|
||||
use super::*;
|
||||
|
|
@ -2,7 +2,7 @@ error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supp
|
|||
--> $DIR/issue-82126-mismatched-subst-and-hir.rs:16:59
|
||||
|
|
||||
LL | async fn buy_lock(coroutine: &Mutex<MarketMultiplier>) -> LockedMarket<'_> {
|
||||
| ^^^^^^^^^^^^---- help: remove these generics
|
||||
| ^^^^^^^^^^^^---- help: remove the unnecessary generics
|
||||
| |
|
||||
| expected 0 lifetime arguments
|
||||
|
|
||||
|
|
@ -32,7 +32,7 @@ error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supp
|
|||
--> $DIR/issue-82126-mismatched-subst-and-hir.rs:16:59
|
||||
|
|
||||
LL | async fn buy_lock(coroutine: &Mutex<MarketMultiplier>) -> LockedMarket<'_> {
|
||||
| ^^^^^^^^^^^^---- help: remove these generics
|
||||
| ^^^^^^^^^^^^---- help: remove the unnecessary generics
|
||||
| |
|
||||
| expected 0 lifetime arguments
|
||||
|
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0107]: trait takes at most 2 generic arguments but 3 generic arguments we
|
|||
--> $DIR/transmutable-ice-110969.rs:11:14
|
||||
|
|
||||
LL | Dst: BikeshedIntrinsicFrom<Src, Context, ASSUME>,
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ ------ help: remove this generic argument
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ -------- help: remove the unnecessary generic argument
|
||||
| |
|
||||
| expected at most 2 generic arguments
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ error[E0107]: struct takes 2 generic arguments but 3 generic arguments were supp
|
|||
--> $DIR/infer-arg-test.rs:18:10
|
||||
|
|
||||
LL | let a: All<_, _, _>;
|
||||
| ^^^ - help: remove this generic argument
|
||||
| ^^^ --- help: remove the unnecessary generic argument
|
||||
| |
|
||||
| expected 2 generic arguments
|
||||
|
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0107]: function takes 1 generic argument but 2 generic arguments were sup
|
|||
--> $DIR/issue_114151.rs:17:5
|
||||
|
|
||||
LL | foo::<_, L>([(); L + 1 + L]);
|
||||
| ^^^ - help: remove this generic argument
|
||||
| ^^^ --- help: remove the unnecessary generic argument
|
||||
| |
|
||||
| expected 1 generic argument
|
||||
|
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ error[E0107]: associated type takes 0 generic arguments but 1 generic argument w
|
|||
--> $DIR/issue-102768.rs:9:30
|
||||
|
|
||||
LL | fn f2<'a>(arg: Box<dyn X<Y<1> = &'a ()>>) {}
|
||||
| ^--- help: remove these generics
|
||||
| ^--- help: remove the unnecessary generics
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
|
|
||||
|
|
@ -49,7 +49,7 @@ error[E0107]: associated type takes 0 generic arguments but 1 generic argument w
|
|||
--> $DIR/issue-102768.rs:9:30
|
||||
|
|
||||
LL | fn f2<'a>(arg: Box<dyn X<Y<1> = &'a ()>>) {}
|
||||
| ^--- help: remove these generics
|
||||
| ^--- help: remove the unnecessary generics
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
|
|
||||
|
|
@ -81,7 +81,7 @@ error[E0107]: associated type takes 0 generic arguments but 1 generic argument w
|
|||
--> $DIR/issue-102768.rs:9:30
|
||||
|
|
||||
LL | fn f2<'a>(arg: Box<dyn X<Y<1> = &'a ()>>) {}
|
||||
| ^--- help: remove these generics
|
||||
| ^--- help: remove the unnecessary generics
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
|
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ error[E0107]: function takes 2 generic arguments but 3 generic arguments were su
|
|||
--> $DIR/incorrect-number-of-const-args.rs:9:5
|
||||
|
|
||||
LL | foo::<0, 0, 0>();
|
||||
| ^^^ - help: remove this generic argument
|
||||
| ^^^ --- help: remove the unnecessary generic argument
|
||||
| |
|
||||
| expected 2 generic arguments
|
||||
|
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ help: consider moving this generic argument to the `TryInto` trait, which takes
|
|||
|
|
||||
LL | let _: u32 = TryInto::<32>::try_into(5i32).unwrap();
|
||||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
help: remove these generics
|
||||
help: remove the unnecessary generics
|
||||
|
|
||||
LL - let _: u32 = 5i32.try_into::<32>().unwrap();
|
||||
LL + let _: u32 = 5i32.try_into().unwrap();
|
||||
|
|
@ -27,7 +27,7 @@ error[E0107]: struct takes 0 generic arguments but 1 generic argument was suppli
|
|||
--> $DIR/invalid-const-arg-for-type-param.rs:12:5
|
||||
|
|
||||
LL | S::<0>;
|
||||
| ^----- help: remove these generics
|
||||
| ^----- help: remove the unnecessary generics
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
|
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0107]: struct takes 1 generic argument but 2 generic arguments were suppl
|
|||
--> $DIR/invalid-constant-in-args.rs:4:12
|
||||
|
|
||||
LL | let _: Cell<&str, "a"> = Cell::new("");
|
||||
| ^^^^ --- help: remove this generic argument
|
||||
| ^^^^ ----- help: remove the unnecessary generic argument
|
||||
| |
|
||||
| expected 1 generic argument
|
||||
|
||||
|
|
|
|||
|
|
@ -122,8 +122,6 @@ note: ...which requires const checking `main::{constant#0}`...
|
|||
|
|
||||
LL | foo::<42>();
|
||||
| ^^
|
||||
= note: ...which requires computing whether `Foo` is freeze...
|
||||
= note: ...which requires evaluating trait selection obligation `Foo: core::marker::Freeze`...
|
||||
= note: ...which again requires computing type of opaque `Foo::{opaque#0}`, completing the cycle
|
||||
note: cycle used when computing type of `Foo::{opaque#0}`
|
||||
--> $DIR/opaque_types.rs:3:12
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ error[E0107]: struct takes 2 lifetime arguments but 3 lifetime arguments were su
|
|||
--> $DIR/constructor-lifetime-args.rs:19:5
|
||||
|
|
||||
LL | S::<'static, 'static, 'static>(&0, &0);
|
||||
| ^ ------- help: remove this lifetime argument
|
||||
| ^ --------- help: remove the lifetime argument
|
||||
| |
|
||||
| expected 2 lifetime arguments
|
||||
|
|
||||
|
|
@ -52,7 +52,7 @@ error[E0107]: enum takes 2 lifetime arguments but 3 lifetime arguments were supp
|
|||
--> $DIR/constructor-lifetime-args.rs:24:8
|
||||
|
|
||||
LL | E::V::<'static, 'static, 'static>(&0);
|
||||
| ^ ------- help: remove this lifetime argument
|
||||
| ^ --------- help: remove the lifetime argument
|
||||
| |
|
||||
| expected 2 lifetime arguments
|
||||
|
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@
|
|||
/// to end up revealing opaque types (the RPIT in `many`'s return type),
|
||||
/// which can quickly lead to cycles.
|
||||
|
||||
//@ check-pass
|
||||
|
||||
pub struct Parser<H>(H);
|
||||
|
||||
impl<H, T> Parser<H>
|
||||
|
|
@ -18,7 +20,6 @@ where
|
|||
}
|
||||
|
||||
pub const fn many<'s>(&'s self) -> Parser<impl for<'a> Fn(&'a str) -> Vec<T> + 's> {
|
||||
//~^ ERROR: cycle detected
|
||||
Parser::new(|_| unimplemented!())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,34 +0,0 @@
|
|||
error[E0391]: cycle detected when computing type of opaque `<impl at $DIR/const-fn-cycle.rs:12:1: 14:33>::many::{opaque#0}`
|
||||
--> $DIR/const-fn-cycle.rs:20:47
|
||||
|
|
||||
LL | pub const fn many<'s>(&'s self) -> Parser<impl for<'a> Fn(&'a str) -> Vec<T> + 's> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
note: ...which requires borrow-checking `<impl at $DIR/const-fn-cycle.rs:12:1: 14:33>::many`...
|
||||
--> $DIR/const-fn-cycle.rs:20:5
|
||||
|
|
||||
LL | pub const fn many<'s>(&'s self) -> Parser<impl for<'a> Fn(&'a str) -> Vec<T> + 's> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
note: ...which requires promoting constants in MIR for `<impl at $DIR/const-fn-cycle.rs:12:1: 14:33>::many`...
|
||||
--> $DIR/const-fn-cycle.rs:20:5
|
||||
|
|
||||
LL | pub const fn many<'s>(&'s self) -> Parser<impl for<'a> Fn(&'a str) -> Vec<T> + 's> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
note: ...which requires const checking `<impl at $DIR/const-fn-cycle.rs:12:1: 14:33>::many`...
|
||||
--> $DIR/const-fn-cycle.rs:20:5
|
||||
|
|
||||
LL | pub const fn many<'s>(&'s self) -> Parser<impl for<'a> Fn(&'a str) -> Vec<T> + 's> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
= note: ...which requires computing whether `Parser<<impl at $DIR/const-fn-cycle.rs:12:1: 14:33>::many::{opaque#0}>` is freeze...
|
||||
= note: ...which requires evaluating trait selection obligation `Parser<<impl at $DIR/const-fn-cycle.rs:12:1: 14:33>::many::{opaque#0}>: core::marker::Freeze`...
|
||||
= note: ...which again requires computing type of opaque `<impl at $DIR/const-fn-cycle.rs:12:1: 14:33>::many::{opaque#0}`, completing the cycle
|
||||
note: cycle used when computing type of `<impl at $DIR/const-fn-cycle.rs:12:1: 14:33>::many::{opaque#0}`
|
||||
--> $DIR/const-fn-cycle.rs:20:47
|
||||
|
|
||||
LL | pub const fn many<'s>(&'s self) -> Parser<impl for<'a> Fn(&'a str) -> Vec<T> + 's> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0391`.
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
error[E0658]: cannot borrow here, since the borrowed element may contain interior mutability
|
||||
--> $DIR/const-promoted-opaque.rs:29:25
|
||||
--> $DIR/const-promoted-opaque.rs:28:25
|
||||
|
|
||||
LL | let _: &'static _ = &FOO;
|
||||
| ^^^^
|
||||
|
|
@ -9,7 +9,7 @@ LL | let _: &'static _ = &FOO;
|
|||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
|
||||
error[E0493]: destructor of `helper::Foo` cannot be evaluated at compile-time
|
||||
--> $DIR/const-promoted-opaque.rs:29:26
|
||||
--> $DIR/const-promoted-opaque.rs:28:26
|
||||
|
|
||||
LL | let _: &'static _ = &FOO;
|
||||
| ^^^ the destructor for this type cannot be evaluated in constants
|
||||
|
|
@ -18,13 +18,13 @@ LL | };
|
|||
| - value is dropped here
|
||||
|
||||
error[E0492]: constants cannot refer to interior mutable data
|
||||
--> $DIR/const-promoted-opaque.rs:34:19
|
||||
--> $DIR/const-promoted-opaque.rs:33:19
|
||||
|
|
||||
LL | const BAZ: &Foo = &FOO;
|
||||
| ^^^^ this borrow of an interior mutable value may end up in the final value
|
||||
|
||||
error[E0716]: temporary value dropped while borrowed
|
||||
--> $DIR/const-promoted-opaque.rs:38:26
|
||||
--> $DIR/const-promoted-opaque.rs:37:26
|
||||
|
|
||||
LL | let _: &'static _ = &FOO;
|
||||
| ---------- ^^^ creates a temporary value which is freed while still in use
|
||||
|
|
@ -34,38 +34,7 @@ LL |
|
|||
LL | }
|
||||
| - temporary value is freed at the end of this statement
|
||||
|
||||
error[E0391]: cycle detected when computing type of opaque `helper::Foo::{opaque#0}`
|
||||
--> $DIR/const-promoted-opaque.rs:14:20
|
||||
|
|
||||
LL | pub type Foo = impl Sized;
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
note: ...which requires borrow-checking `helper::FOO`...
|
||||
--> $DIR/const-promoted-opaque.rs:21:5
|
||||
|
|
||||
LL | pub const FOO: Foo = std::sync::atomic::AtomicU8::new(42);
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
note: ...which requires promoting constants in MIR for `helper::FOO`...
|
||||
--> $DIR/const-promoted-opaque.rs:21:5
|
||||
|
|
||||
LL | pub const FOO: Foo = std::sync::atomic::AtomicU8::new(42);
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
note: ...which requires const checking `helper::FOO`...
|
||||
--> $DIR/const-promoted-opaque.rs:21:5
|
||||
|
|
||||
LL | pub const FOO: Foo = std::sync::atomic::AtomicU8::new(42);
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
= note: ...which requires computing whether `helper::Foo` is freeze...
|
||||
= note: ...which requires evaluating trait selection obligation `helper::Foo: core::marker::Freeze`...
|
||||
= note: ...which again requires computing type of opaque `helper::Foo::{opaque#0}`, completing the cycle
|
||||
note: cycle used when computing type of `helper::Foo::{opaque#0}`
|
||||
--> $DIR/const-promoted-opaque.rs:14:20
|
||||
|
|
||||
LL | pub type Foo = impl Sized;
|
||||
| ^^^^^^^^^^
|
||||
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0391, E0492, E0493, E0658, E0716.
|
||||
For more information about an error, try `rustc --explain E0391`.
|
||||
Some errors have detailed explanations: E0492, E0493, E0658, E0716.
|
||||
For more information about an error, try `rustc --explain E0492`.
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@
|
|||
|
||||
mod helper {
|
||||
pub type Foo = impl Sized;
|
||||
//[string,atomic]~^ ERROR cycle detected
|
||||
|
||||
#[cfg(string)]
|
||||
pub const FOO: Foo = String::new();
|
||||
|
|
@ -28,11 +27,11 @@ use helper::*;
|
|||
const BAR: () = {
|
||||
let _: &'static _ = &FOO;
|
||||
//[string,atomic]~^ ERROR: destructor of `helper::Foo` cannot be evaluated at compile-time
|
||||
//[string,atomic]~| ERROR: cannot borrow here
|
||||
//[atomic]~| ERROR: cannot borrow here
|
||||
};
|
||||
|
||||
const BAZ: &Foo = &FOO;
|
||||
//[string,atomic]~^ ERROR: constants cannot refer to interior mutable data
|
||||
//[atomic]~^ ERROR: constants cannot refer to interior mutable data
|
||||
|
||||
fn main() {
|
||||
let _: &'static _ = &FOO;
|
||||
|
|
|
|||
|
|
@ -1,15 +1,5 @@
|
|||
error[E0658]: cannot borrow here, since the borrowed element may contain interior mutability
|
||||
--> $DIR/const-promoted-opaque.rs:29:25
|
||||
|
|
||||
LL | let _: &'static _ = &FOO;
|
||||
| ^^^^
|
||||
|
|
||||
= note: see issue #80384 <https://github.com/rust-lang/rust/issues/80384> for more information
|
||||
= help: add `#![feature(const_refs_to_cell)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
|
||||
error[E0493]: destructor of `helper::Foo` cannot be evaluated at compile-time
|
||||
--> $DIR/const-promoted-opaque.rs:29:26
|
||||
--> $DIR/const-promoted-opaque.rs:28:26
|
||||
|
|
||||
LL | let _: &'static _ = &FOO;
|
||||
| ^^^ the destructor for this type cannot be evaluated in constants
|
||||
|
|
@ -17,14 +7,8 @@ LL | let _: &'static _ = &FOO;
|
|||
LL | };
|
||||
| - value is dropped here
|
||||
|
||||
error[E0492]: constants cannot refer to interior mutable data
|
||||
--> $DIR/const-promoted-opaque.rs:34:19
|
||||
|
|
||||
LL | const BAZ: &Foo = &FOO;
|
||||
| ^^^^ this borrow of an interior mutable value may end up in the final value
|
||||
|
||||
error[E0716]: temporary value dropped while borrowed
|
||||
--> $DIR/const-promoted-opaque.rs:38:26
|
||||
--> $DIR/const-promoted-opaque.rs:37:26
|
||||
|
|
||||
LL | let _: &'static _ = &FOO;
|
||||
| ---------- ^^^ creates a temporary value which is freed while still in use
|
||||
|
|
@ -34,38 +18,7 @@ LL |
|
|||
LL | }
|
||||
| - temporary value is freed at the end of this statement
|
||||
|
||||
error[E0391]: cycle detected when computing type of opaque `helper::Foo::{opaque#0}`
|
||||
--> $DIR/const-promoted-opaque.rs:14:20
|
||||
|
|
||||
LL | pub type Foo = impl Sized;
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
note: ...which requires borrow-checking `helper::FOO`...
|
||||
--> $DIR/const-promoted-opaque.rs:18:5
|
||||
|
|
||||
LL | pub const FOO: Foo = String::new();
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
note: ...which requires promoting constants in MIR for `helper::FOO`...
|
||||
--> $DIR/const-promoted-opaque.rs:18:5
|
||||
|
|
||||
LL | pub const FOO: Foo = String::new();
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
note: ...which requires const checking `helper::FOO`...
|
||||
--> $DIR/const-promoted-opaque.rs:18:5
|
||||
|
|
||||
LL | pub const FOO: Foo = String::new();
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
= note: ...which requires computing whether `helper::Foo` is freeze...
|
||||
= note: ...which requires evaluating trait selection obligation `helper::Foo: core::marker::Freeze`...
|
||||
= note: ...which again requires computing type of opaque `helper::Foo::{opaque#0}`, completing the cycle
|
||||
note: cycle used when computing type of `helper::Foo::{opaque#0}`
|
||||
--> $DIR/const-promoted-opaque.rs:14:20
|
||||
|
|
||||
LL | pub type Foo = impl Sized;
|
||||
| ^^^^^^^^^^
|
||||
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0391, E0492, E0493, E0658, E0716.
|
||||
For more information about an error, try `rustc --explain E0391`.
|
||||
Some errors have detailed explanations: E0493, E0716.
|
||||
For more information about an error, try `rustc --explain E0493`.
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0107]: method takes 0 generic arguments but 1 generic argument was suppli
|
|||
--> $DIR/effect_param.rs:11:9
|
||||
|
|
||||
LL | i8::checked_sub::<false>(42, 43);
|
||||
| ^^^^^^^^^^^--------- help: remove these generics
|
||||
| ^^^^^^^^^^^--------- help: remove the unnecessary generics
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
|
||||
|
|
@ -10,7 +10,7 @@ error[E0107]: method takes 0 generic arguments but 1 generic argument was suppli
|
|||
--> $DIR/effect_param.rs:13:9
|
||||
|
|
||||
LL | i8::checked_sub::<true>(42, 43);
|
||||
| ^^^^^^^^^^^-------- help: remove these generics
|
||||
| ^^^^^^^^^^^-------- help: remove the unnecessary generics
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
|
||||
|
|
@ -18,7 +18,7 @@ error[E0107]: method takes 0 generic arguments but 1 generic argument was suppli
|
|||
--> $DIR/effect_param.rs:4:9
|
||||
|
|
||||
LL | i8::checked_sub::<true>(42, 43);
|
||||
| ^^^^^^^^^^^-------- help: remove these generics
|
||||
| ^^^^^^^^^^^-------- help: remove the unnecessary generics
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
|
||||
|
|
@ -26,7 +26,7 @@ error[E0107]: method takes 0 generic arguments but 1 generic argument was suppli
|
|||
--> $DIR/effect_param.rs:6:9
|
||||
|
|
||||
LL | i8::checked_sub::<false>(42, 43);
|
||||
| ^^^^^^^^^^^--------- help: remove these generics
|
||||
| ^^^^^^^^^^^--------- help: remove the unnecessary generics
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
|
||||
|
|
|
|||
|
|
@ -16,35 +16,35 @@ struct Baz<'a, 'b, 'c> {
|
|||
|
||||
bar: Bar<'a>,
|
||||
//~^ ERROR enum takes 0 lifetime arguments
|
||||
//~| HELP remove these generics
|
||||
//~| HELP remove the unnecessary generics
|
||||
|
||||
foo2: Foo<'a, 'b, 'c>,
|
||||
//~^ ERROR struct takes 1 lifetime argument
|
||||
//~| HELP remove these lifetime arguments
|
||||
//~| HELP remove the lifetime arguments
|
||||
|
||||
qux1: Qux<'a, 'b, i32>,
|
||||
//~^ ERROR struct takes 1 lifetime argument
|
||||
//~| HELP remove this lifetime argument
|
||||
//~| HELP remove the lifetime argument
|
||||
|
||||
qux2: Qux<'a, i32, 'b>,
|
||||
//~^ ERROR struct takes 1 lifetime argument
|
||||
//~| HELP remove this lifetime argument
|
||||
//~| HELP remove the lifetime argument
|
||||
|
||||
qux3: Qux<'a, 'b, 'c, i32>,
|
||||
//~^ ERROR struct takes 1 lifetime argument
|
||||
//~| HELP remove these lifetime arguments
|
||||
//~| HELP remove the lifetime arguments
|
||||
|
||||
qux4: Qux<'a, i32, 'b, 'c>,
|
||||
//~^ ERROR struct takes 1 lifetime argument
|
||||
//~| HELP remove these lifetime arguments
|
||||
//~| HELP remove the lifetime arguments
|
||||
|
||||
qux5: Qux<'a, 'b, i32, 'c>,
|
||||
//~^ ERROR struct takes 1 lifetime argument
|
||||
//~| HELP remove this lifetime argument
|
||||
//~| HELP remove the lifetime argument
|
||||
|
||||
quux: Quux<'a, i32, 'b>,
|
||||
//~^ ERROR struct takes 0 lifetime arguments
|
||||
//~| HELP remove this lifetime argument
|
||||
//~| HELP remove the lifetime argument
|
||||
}
|
||||
|
||||
pub trait T {
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ error[E0107]: enum takes 0 lifetime arguments but 1 lifetime argument was suppli
|
|||
--> $DIR/E0107.rs:17:10
|
||||
|
|
||||
LL | bar: Bar<'a>,
|
||||
| ^^^---- help: remove these generics
|
||||
| ^^^---- help: remove the unnecessary generics
|
||||
| |
|
||||
| expected 0 lifetime arguments
|
||||
|
|
||||
|
|
@ -34,7 +34,7 @@ error[E0107]: struct takes 1 lifetime argument but 3 lifetime arguments were sup
|
|||
--> $DIR/E0107.rs:21:11
|
||||
|
|
||||
LL | foo2: Foo<'a, 'b, 'c>,
|
||||
| ^^^ ------ help: remove these lifetime arguments
|
||||
| ^^^ -------- help: remove the lifetime arguments
|
||||
| |
|
||||
| expected 1 lifetime argument
|
||||
|
|
||||
|
|
@ -48,7 +48,7 @@ error[E0107]: struct takes 1 lifetime argument but 2 lifetime arguments were sup
|
|||
--> $DIR/E0107.rs:25:11
|
||||
|
|
||||
LL | qux1: Qux<'a, 'b, i32>,
|
||||
| ^^^ -- help: remove this lifetime argument
|
||||
| ^^^ ---- help: remove the lifetime argument
|
||||
| |
|
||||
| expected 1 lifetime argument
|
||||
|
|
||||
|
|
@ -62,7 +62,7 @@ error[E0107]: struct takes 1 lifetime argument but 2 lifetime arguments were sup
|
|||
--> $DIR/E0107.rs:29:11
|
||||
|
|
||||
LL | qux2: Qux<'a, i32, 'b>,
|
||||
| ^^^ -- help: remove this lifetime argument
|
||||
| ^^^ --------- help: remove the lifetime argument
|
||||
| |
|
||||
| expected 1 lifetime argument
|
||||
|
|
||||
|
|
@ -76,7 +76,7 @@ error[E0107]: struct takes 1 lifetime argument but 3 lifetime arguments were sup
|
|||
--> $DIR/E0107.rs:33:11
|
||||
|
|
||||
LL | qux3: Qux<'a, 'b, 'c, i32>,
|
||||
| ^^^ ------ help: remove these lifetime arguments
|
||||
| ^^^ -------- help: remove the lifetime arguments
|
||||
| |
|
||||
| expected 1 lifetime argument
|
||||
|
|
||||
|
|
@ -90,7 +90,7 @@ error[E0107]: struct takes 1 lifetime argument but 3 lifetime arguments were sup
|
|||
--> $DIR/E0107.rs:37:11
|
||||
|
|
||||
LL | qux4: Qux<'a, i32, 'b, 'c>,
|
||||
| ^^^ ------ help: remove these lifetime arguments
|
||||
| ^^^ ------------- help: remove the lifetime arguments
|
||||
| |
|
||||
| expected 1 lifetime argument
|
||||
|
|
||||
|
|
@ -104,7 +104,7 @@ error[E0107]: struct takes 1 lifetime argument but 3 lifetime arguments were sup
|
|||
--> $DIR/E0107.rs:41:11
|
||||
|
|
||||
LL | qux5: Qux<'a, 'b, i32, 'c>,
|
||||
| ^^^ -- help: remove this lifetime argument
|
||||
| ^^^ ---- help: remove the lifetime argument
|
||||
| |
|
||||
| expected 1 lifetime argument
|
||||
|
|
||||
|
|
@ -118,7 +118,7 @@ error[E0107]: struct takes 0 lifetime arguments but 2 lifetime arguments were su
|
|||
--> $DIR/E0107.rs:45:11
|
||||
|
|
||||
LL | quux: Quux<'a, i32, 'b>,
|
||||
| ^^^^ -- help: remove this lifetime argument
|
||||
| ^^^^ -- help: remove the lifetime argument
|
||||
| |
|
||||
| expected 0 lifetime arguments
|
||||
|
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ error[E0107]: associated type takes 0 generic arguments but 1 generic argument w
|
|||
--> $DIR/gat-trait-path-parenthesised-args.rs:5:27
|
||||
|
|
||||
LL | fn foo<'a>(arg: Box<dyn X<Y('a) = &'a ()>>) {}
|
||||
| ^---- help: remove these generics
|
||||
| ^---- help: remove the unnecessary generics
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
|
|
||||
|
|
@ -74,7 +74,7 @@ error[E0107]: associated type takes 0 generic arguments but 1 generic argument w
|
|||
--> $DIR/gat-trait-path-parenthesised-args.rs:5:27
|
||||
|
|
||||
LL | fn foo<'a>(arg: Box<dyn X<Y('a) = &'a ()>>) {}
|
||||
| ^---- help: remove these generics
|
||||
| ^---- help: remove the unnecessary generics
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
|
|
||||
|
|
@ -106,7 +106,7 @@ error[E0107]: associated type takes 0 generic arguments but 1 generic argument w
|
|||
--> $DIR/gat-trait-path-parenthesised-args.rs:5:27
|
||||
|
|
||||
LL | fn foo<'a>(arg: Box<dyn X<Y('a) = &'a ()>>) {}
|
||||
| ^---- help: remove these generics
|
||||
| ^---- help: remove the unnecessary generics
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
|
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0107]: associated type takes 1 lifetime argument but 2 lifetime arguments
|
|||
--> $DIR/parameter_number_and_kind.rs:11:24
|
||||
|
|
||||
LL | type FErr1 = Self::E<'static, 'static>;
|
||||
| ^ ------- help: remove this lifetime argument
|
||||
| ^ --------- help: remove the lifetime argument
|
||||
| |
|
||||
| expected 1 lifetime argument
|
||||
|
|
||||
|
|
@ -32,7 +32,7 @@ error[E0107]: associated type takes 1 generic argument but 2 generic arguments w
|
|||
--> $DIR/parameter_number_and_kind.rs:14:27
|
||||
|
|
||||
LL | type FErr2<T> = Self::E<'static, T, u32>;
|
||||
| ^ --- help: remove this generic argument
|
||||
| ^ ----- help: remove the unnecessary generic argument
|
||||
| |
|
||||
| expected 1 generic argument
|
||||
|
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ error[E0107]: associated type takes 0 generic arguments but 1 generic argument w
|
|||
--> $DIR/trait-path-type-error-once-implemented.rs:6:29
|
||||
|
|
||||
LL | fn f2<'a>(arg : Box<dyn X<Y<1> = &'a ()>>) {}
|
||||
| ^--- help: remove these generics
|
||||
| ^--- help: remove the unnecessary generics
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
|
|
||||
|
|
@ -49,7 +49,7 @@ error[E0107]: associated type takes 0 generic arguments but 1 generic argument w
|
|||
--> $DIR/trait-path-type-error-once-implemented.rs:6:29
|
||||
|
|
||||
LL | fn f2<'a>(arg : Box<dyn X<Y<1> = &'a ()>>) {}
|
||||
| ^--- help: remove these generics
|
||||
| ^--- help: remove the unnecessary generics
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
|
|
||||
|
|
@ -81,7 +81,7 @@ error[E0107]: associated type takes 0 generic arguments but 1 generic argument w
|
|||
--> $DIR/trait-path-type-error-once-implemented.rs:6:29
|
||||
|
|
||||
LL | fn f2<'a>(arg : Box<dyn X<Y<1> = &'a ()>>) {}
|
||||
| ^--- help: remove these generics
|
||||
| ^--- help: remove the unnecessary generics
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
|
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0107]: associated function takes 1 generic argument but 2 generic argumen
|
|||
--> $DIR/bad-mid-path-type-params.rs:30:16
|
||||
|
|
||||
LL | let _ = S::new::<isize,f64>(1, 1.0);
|
||||
| ^^^ --- help: remove this generic argument
|
||||
| ^^^ ---- help: remove the unnecessary generic argument
|
||||
| |
|
||||
| expected 1 generic argument
|
||||
|
|
||||
|
|
@ -16,7 +16,7 @@ error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supp
|
|||
--> $DIR/bad-mid-path-type-params.rs:33:13
|
||||
|
|
||||
LL | let _ = S::<'a,isize>::new::<f64>(1, 1.0);
|
||||
| ^ -- help: remove this lifetime argument
|
||||
| ^ -- help: remove the lifetime argument
|
||||
| |
|
||||
| expected 0 lifetime arguments
|
||||
|
|
||||
|
|
@ -30,7 +30,7 @@ error[E0107]: associated function takes 1 generic argument but 2 generic argumen
|
|||
--> $DIR/bad-mid-path-type-params.rs:36:24
|
||||
|
|
||||
LL | let _: S2 = Trait::new::<isize,f64>(1, 1.0);
|
||||
| ^^^ --- help: remove this generic argument
|
||||
| ^^^ ---- help: remove the unnecessary generic argument
|
||||
| |
|
||||
| expected 1 generic argument
|
||||
|
|
||||
|
|
@ -44,7 +44,7 @@ error[E0107]: trait takes 0 lifetime arguments but 1 lifetime argument was suppl
|
|||
--> $DIR/bad-mid-path-type-params.rs:39:17
|
||||
|
|
||||
LL | let _: S2 = Trait::<'a,isize>::new::<f64,f64>(1, 1.0);
|
||||
| ^^^^^ -- help: remove this lifetime argument
|
||||
| ^^^^^ -- help: remove the lifetime argument
|
||||
| |
|
||||
| expected 0 lifetime arguments
|
||||
|
|
||||
|
|
@ -58,7 +58,7 @@ error[E0107]: associated function takes 1 generic argument but 2 generic argumen
|
|||
--> $DIR/bad-mid-path-type-params.rs:39:36
|
||||
|
|
||||
LL | let _: S2 = Trait::<'a,isize>::new::<f64,f64>(1, 1.0);
|
||||
| ^^^ --- help: remove this generic argument
|
||||
| ^^^ ---- help: remove the unnecessary generic argument
|
||||
| |
|
||||
| expected 1 generic argument
|
||||
|
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ error[E0107]: function takes 1 lifetime argument but 2 lifetime arguments were s
|
|||
--> $DIR/foreign-generic-mismatch.rs:8:31
|
||||
|
|
||||
LL | foreign_generic_mismatch::lt_arg::<'static, 'static>();
|
||||
| ^^^^^^ ------- help: remove this lifetime argument
|
||||
| ^^^^^^ --------- help: remove the lifetime argument
|
||||
| |
|
||||
| expected 1 lifetime argument
|
||||
|
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0107]: struct takes 1 lifetime argument but 2 lifetime arguments were sup
|
|||
--> $DIR/generic-arg-mismatch-recover.rs:6:5
|
||||
|
|
||||
LL | Foo::<'static, 'static, ()>(&0);
|
||||
| ^^^ ------- help: remove this lifetime argument
|
||||
| ^^^ --------- help: remove the lifetime argument
|
||||
| |
|
||||
| expected 1 lifetime argument
|
||||
|
|
||||
|
|
@ -16,7 +16,7 @@ error[E0107]: struct takes 1 lifetime argument but 2 lifetime arguments were sup
|
|||
--> $DIR/generic-arg-mismatch-recover.rs:9:5
|
||||
|
|
||||
LL | Bar::<'static, 'static, ()>(&());
|
||||
| ^^^ ------- help: remove this lifetime argument
|
||||
| ^^^ --------- help: remove the lifetime argument
|
||||
| |
|
||||
| expected 1 lifetime argument
|
||||
|
|
||||
|
|
@ -30,7 +30,7 @@ error[E0107]: struct takes 0 generic arguments but 1 generic argument was suppli
|
|||
--> $DIR/generic-arg-mismatch-recover.rs:9:5
|
||||
|
|
||||
LL | Bar::<'static, 'static, ()>(&());
|
||||
| ^^^ -- help: remove this generic argument
|
||||
| ^^^ -- help: remove the unnecessary generic argument
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
|
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0107]: struct takes at most 2 generic arguments but 3 generic arguments w
|
|||
--> $DIR/generic-impl-more-params-with-defaults.rs:13:5
|
||||
|
|
||||
LL | Vec::<isize, Heap, bool>::new();
|
||||
| ^^^ ---- help: remove this generic argument
|
||||
| ^^^ ------ help: remove the unnecessary generic argument
|
||||
| |
|
||||
| expected at most 2 generic arguments
|
||||
|
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0107]: struct takes at most 2 generic arguments but 3 generic arguments w
|
|||
--> $DIR/generic-type-more-params-with-defaults.rs:9:12
|
||||
|
|
||||
LL | let _: Vec<isize, Heap, bool>;
|
||||
| ^^^ ---- help: remove this generic argument
|
||||
| ^^^ ------ help: remove the unnecessary generic argument
|
||||
| |
|
||||
| expected at most 2 generic arguments
|
||||
|
|
||||
|
|
|
|||
|
|
@ -5,19 +5,19 @@ mod no_generics {
|
|||
|
||||
type B = Ty<'static>;
|
||||
//~^ ERROR struct takes 0 lifetime arguments but 1 lifetime argument
|
||||
//~| HELP remove these generics
|
||||
//~| HELP remove the unnecessary generics
|
||||
|
||||
type C = Ty<'static, usize>;
|
||||
//~^ ERROR struct takes 0 lifetime arguments but 1 lifetime argument
|
||||
//~| ERROR struct takes 0 generic arguments but 1 generic argument
|
||||
//~| HELP remove this lifetime argument
|
||||
//~| HELP remove this generic argument
|
||||
//~| HELP remove the lifetime argument
|
||||
//~| HELP remove the unnecessary generic argument
|
||||
|
||||
type D = Ty<'static, usize, { 0 }>;
|
||||
//~^ ERROR struct takes 0 lifetime arguments but 1 lifetime argument
|
||||
//~| ERROR struct takes 0 generic arguments but 2 generic arguments
|
||||
//~| HELP remove this lifetime argument
|
||||
//~| HELP remove these generic arguments
|
||||
//~| HELP remove the lifetime argument
|
||||
//~| HELP remove the unnecessary generic arguments
|
||||
}
|
||||
|
||||
mod type_and_type {
|
||||
|
|
@ -35,7 +35,7 @@ mod type_and_type {
|
|||
|
||||
type D = Ty<usize, String, char>;
|
||||
//~^ ERROR struct takes 2 generic arguments but 3 generic arguments
|
||||
//~| HELP remove this
|
||||
//~| HELP remove the
|
||||
|
||||
type E = Ty<>;
|
||||
//~^ ERROR struct takes 2 generic arguments but 0 generic arguments were supplied
|
||||
|
|
@ -70,8 +70,8 @@ mod lifetime_and_type {
|
|||
type F = Ty<'static, usize, 'static, usize>;
|
||||
//~^ ERROR struct takes 1 lifetime argument but 2 lifetime arguments
|
||||
//~| ERROR struct takes 1 generic argument but 2 generic arguments
|
||||
//~| HELP remove this lifetime argument
|
||||
//~| HELP remove this generic argument
|
||||
//~| HELP remove the lifetime argument
|
||||
//~| HELP remove the unnecessary generic argument
|
||||
}
|
||||
|
||||
mod type_and_type_and_type {
|
||||
|
|
@ -317,13 +317,13 @@ mod stdlib {
|
|||
|
||||
type C = HashMap<'static>;
|
||||
//~^ ERROR struct takes 0 lifetime arguments but 1 lifetime argument
|
||||
//~| HELP remove these generics
|
||||
//~| HELP remove the
|
||||
//~| ERROR struct takes at least 2
|
||||
//~| HELP add missing
|
||||
|
||||
type D = HashMap<usize, String, char, f64>;
|
||||
//~^ ERROR struct takes at most 3
|
||||
//~| HELP remove this
|
||||
//~| HELP remove the
|
||||
|
||||
type E = HashMap<>;
|
||||
//~^ ERROR struct takes at least 2 generic arguments but 0 generic arguments
|
||||
|
|
@ -341,7 +341,7 @@ mod stdlib {
|
|||
|
||||
type C = Result<'static>;
|
||||
//~^ ERROR enum takes 0 lifetime arguments but 1 lifetime argument
|
||||
//~| HELP remove these generics
|
||||
//~| HELP remove the unnecessary generics
|
||||
//~| ERROR enum takes 2 generic arguments but 0 generic arguments
|
||||
//~| HELP add missing
|
||||
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supp
|
|||
--> $DIR/wrong-number-of-args.rs:6:14
|
||||
|
|
||||
LL | type B = Ty<'static>;
|
||||
| ^^--------- help: remove these generics
|
||||
| ^^--------- help: remove the unnecessary generics
|
||||
| |
|
||||
| expected 0 lifetime arguments
|
||||
|
|
||||
|
|
@ -185,7 +185,7 @@ error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supp
|
|||
--> $DIR/wrong-number-of-args.rs:10:14
|
||||
|
|
||||
LL | type C = Ty<'static, usize>;
|
||||
| ^^ ------- help: remove this lifetime argument
|
||||
| ^^ ------- help: remove the lifetime argument
|
||||
| |
|
||||
| expected 0 lifetime arguments
|
||||
|
|
||||
|
|
@ -199,7 +199,7 @@ error[E0107]: struct takes 0 generic arguments but 1 generic argument was suppli
|
|||
--> $DIR/wrong-number-of-args.rs:10:14
|
||||
|
|
||||
LL | type C = Ty<'static, usize>;
|
||||
| ^^ ----- help: remove this generic argument
|
||||
| ^^ ----- help: remove the unnecessary generic argument
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
|
|
||||
|
|
@ -213,7 +213,7 @@ error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supp
|
|||
--> $DIR/wrong-number-of-args.rs:16:14
|
||||
|
|
||||
LL | type D = Ty<'static, usize, { 0 }>;
|
||||
| ^^ ------- help: remove this lifetime argument
|
||||
| ^^ ------- help: remove the lifetime argument
|
||||
| |
|
||||
| expected 0 lifetime arguments
|
||||
|
|
||||
|
|
@ -227,7 +227,7 @@ error[E0107]: struct takes 0 generic arguments but 2 generic arguments were supp
|
|||
--> $DIR/wrong-number-of-args.rs:16:14
|
||||
|
|
||||
LL | type D = Ty<'static, usize, { 0 }>;
|
||||
| ^^ ------------ help: remove these generic arguments
|
||||
| ^^ ------- help: remove the unnecessary generic arguments
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
|
|
||||
|
|
@ -275,7 +275,7 @@ error[E0107]: struct takes 2 generic arguments but 3 generic arguments were supp
|
|||
--> $DIR/wrong-number-of-args.rs:36:14
|
||||
|
|
||||
LL | type D = Ty<usize, String, char>;
|
||||
| ^^ ---- help: remove this generic argument
|
||||
| ^^ ------ help: remove the unnecessary generic argument
|
||||
| |
|
||||
| expected 2 generic arguments
|
||||
|
|
||||
|
|
@ -353,7 +353,7 @@ error[E0107]: struct takes 1 lifetime argument but 2 lifetime arguments were sup
|
|||
--> $DIR/wrong-number-of-args.rs:70:14
|
||||
|
|
||||
LL | type F = Ty<'static, usize, 'static, usize>;
|
||||
| ^^ ------- help: remove this lifetime argument
|
||||
| ^^ ---------------- help: remove the lifetime argument
|
||||
| |
|
||||
| expected 1 lifetime argument
|
||||
|
|
||||
|
|
@ -367,7 +367,7 @@ error[E0107]: struct takes 1 generic argument but 2 generic arguments were suppl
|
|||
--> $DIR/wrong-number-of-args.rs:70:14
|
||||
|
|
||||
LL | type F = Ty<'static, usize, 'static, usize>;
|
||||
| ^^ ----- help: remove this generic argument
|
||||
| ^^ ---------------- help: remove the unnecessary generic argument
|
||||
| |
|
||||
| expected 1 generic argument
|
||||
|
|
||||
|
|
@ -415,7 +415,7 @@ error[E0107]: struct takes at most 3 generic arguments but 4 generic arguments w
|
|||
--> $DIR/wrong-number-of-args.rs:92:14
|
||||
|
|
||||
LL | type E = Ty<usize, String, char, f64>;
|
||||
| ^^ --- help: remove this generic argument
|
||||
| ^^ ----- help: remove the unnecessary generic argument
|
||||
| |
|
||||
| expected at most 3 generic arguments
|
||||
|
|
||||
|
|
@ -445,7 +445,7 @@ error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplie
|
|||
--> $DIR/wrong-number-of-args.rs:116:22
|
||||
|
|
||||
LL | type A = Box<dyn NonGeneric<usize>>;
|
||||
| ^^^^^^^^^^------- help: remove these generics
|
||||
| ^^^^^^^^^^------- help: remove the unnecessary generics
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
|
|
||||
|
|
@ -459,7 +459,7 @@ error[E0107]: trait takes 1 lifetime argument but 2 lifetime arguments were supp
|
|||
--> $DIR/wrong-number-of-args.rs:125:22
|
||||
|
|
||||
LL | type C = Box<dyn GenericLifetime<'static, 'static>>;
|
||||
| ^^^^^^^^^^^^^^^ ------- help: remove this lifetime argument
|
||||
| ^^^^^^^^^^^^^^^ --------- help: remove the lifetime argument
|
||||
| |
|
||||
| expected 1 lifetime argument
|
||||
|
|
||||
|
|
@ -489,7 +489,7 @@ error[E0107]: trait takes 1 generic argument but 2 generic arguments were suppli
|
|||
--> $DIR/wrong-number-of-args.rs:133:22
|
||||
|
|
||||
LL | type E = Box<dyn GenericType<String, usize>>;
|
||||
| ^^^^^^^^^^^ ----- help: remove this generic argument
|
||||
| ^^^^^^^^^^^ ------- help: remove the unnecessary generic argument
|
||||
| |
|
||||
| expected 1 generic argument
|
||||
|
|
||||
|
|
@ -519,7 +519,7 @@ error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplie
|
|||
--> $DIR/wrong-number-of-args.rs:153:26
|
||||
|
|
||||
LL | type A = Box<dyn NonGenericAT<usize, AssocTy=()>>;
|
||||
| ^^^^^^^^^^^^------------------- help: remove these generics
|
||||
| ^^^^^^^^^^^^------------------- help: remove the unnecessary generics
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
|
|
||||
|
|
@ -533,7 +533,7 @@ error[E0107]: trait takes 1 lifetime argument but 2 lifetime arguments were supp
|
|||
--> $DIR/wrong-number-of-args.rs:168:26
|
||||
|
|
||||
LL | type B = Box<dyn GenericLifetimeAT<'static, 'static, AssocTy=()>>;
|
||||
| ^^^^^^^^^^^^^^^^^ ------- help: remove this lifetime argument
|
||||
| ^^^^^^^^^^^^^^^^^ --------- help: remove the lifetime argument
|
||||
| |
|
||||
| expected 1 lifetime argument
|
||||
|
|
||||
|
|
@ -547,7 +547,7 @@ error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplie
|
|||
--> $DIR/wrong-number-of-args.rs:172:26
|
||||
|
|
||||
LL | type C = Box<dyn GenericLifetimeAT<(), AssocTy=()>>;
|
||||
| ^^^^^^^^^^^^^^^^^ -- help: remove this generic argument
|
||||
| ^^^^^^^^^^^^^^^^^ -- help: remove the unnecessary generic argument
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
|
|
||||
|
|
@ -577,7 +577,7 @@ error[E0107]: trait takes 1 generic argument but 2 generic arguments were suppli
|
|||
--> $DIR/wrong-number-of-args.rs:189:26
|
||||
|
|
||||
LL | type B = Box<dyn GenericTypeAT<(), (), AssocTy=()>>;
|
||||
| ^^^^^^^^^^^^^ -- help: remove this generic argument
|
||||
| ^^^^^^^^^^^^^ ---- help: remove the unnecessary generic argument
|
||||
| |
|
||||
| expected 1 generic argument
|
||||
|
|
||||
|
|
@ -591,7 +591,7 @@ error[E0107]: trait takes 0 lifetime arguments but 1 lifetime argument was suppl
|
|||
--> $DIR/wrong-number-of-args.rs:193:26
|
||||
|
|
||||
LL | type C = Box<dyn GenericTypeAT<'static, AssocTy=()>>;
|
||||
| ^^^^^^^^^^^^^--------------------- help: remove these generics
|
||||
| ^^^^^^^^^^^^^--------------------- help: remove the unnecessary generics
|
||||
| |
|
||||
| expected 0 lifetime arguments
|
||||
|
|
||||
|
|
@ -653,7 +653,7 @@ error[E0107]: trait takes 1 lifetime argument but 2 lifetime arguments were supp
|
|||
--> $DIR/wrong-number-of-args.rs:216:26
|
||||
|
|
||||
LL | type C = Box<dyn GenericLifetimeTypeAT<'static, 'static, AssocTy=()>>;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ ------- help: remove this lifetime argument
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ --------- help: remove the lifetime argument
|
||||
| |
|
||||
| expected 1 lifetime argument
|
||||
|
|
||||
|
|
@ -683,7 +683,7 @@ error[E0107]: trait takes 1 generic argument but 2 generic arguments were suppli
|
|||
--> $DIR/wrong-number-of-args.rs:227:26
|
||||
|
|
||||
LL | type E = Box<dyn GenericLifetimeTypeAT<(), (), AssocTy=()>>;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ -- help: remove this generic argument
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ ---- help: remove the unnecessary generic argument
|
||||
| |
|
||||
| expected 1 generic argument
|
||||
|
|
||||
|
|
@ -697,7 +697,7 @@ error[E0107]: trait takes 1 lifetime argument but 2 lifetime arguments were supp
|
|||
--> $DIR/wrong-number-of-args.rs:234:26
|
||||
|
|
||||
LL | type F = Box<dyn GenericLifetimeTypeAT<'static, 'static, (), AssocTy=()>>;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ ------- help: remove this lifetime argument
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ --------- help: remove the lifetime argument
|
||||
| |
|
||||
| expected 1 lifetime argument
|
||||
|
|
||||
|
|
@ -711,7 +711,7 @@ error[E0107]: trait takes 1 generic argument but 2 generic arguments were suppli
|
|||
--> $DIR/wrong-number-of-args.rs:238:26
|
||||
|
|
||||
LL | type G = Box<dyn GenericLifetimeTypeAT<'static, (), (), AssocTy=()>>;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ -- help: remove this generic argument
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ ---- help: remove the unnecessary generic argument
|
||||
| |
|
||||
| expected 1 generic argument
|
||||
|
|
||||
|
|
@ -725,7 +725,7 @@ error[E0107]: trait takes 1 lifetime argument but 2 lifetime arguments were supp
|
|||
--> $DIR/wrong-number-of-args.rs:242:26
|
||||
|
|
||||
LL | type H = Box<dyn GenericLifetimeTypeAT<'static, 'static, (), (), AssocTy=()>>;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ ------- help: remove this lifetime argument
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ --------- help: remove the lifetime argument
|
||||
| |
|
||||
| expected 1 lifetime argument
|
||||
|
|
||||
|
|
@ -739,7 +739,7 @@ error[E0107]: trait takes 1 generic argument but 2 generic arguments were suppli
|
|||
--> $DIR/wrong-number-of-args.rs:242:26
|
||||
|
|
||||
LL | type H = Box<dyn GenericLifetimeTypeAT<'static, 'static, (), (), AssocTy=()>>;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ -- help: remove this generic argument
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ ---- help: remove the unnecessary generic argument
|
||||
| |
|
||||
| expected 1 generic argument
|
||||
|
|
||||
|
|
@ -787,7 +787,7 @@ error[E0107]: trait takes 2 generic arguments but 3 generic arguments were suppl
|
|||
--> $DIR/wrong-number-of-args.rs:262:26
|
||||
|
|
||||
LL | type C = Box<dyn GenericTypeTypeAT<(), (), (), AssocTy=()>>;
|
||||
| ^^^^^^^^^^^^^^^^^ -- help: remove this generic argument
|
||||
| ^^^^^^^^^^^^^^^^^ ---- help: remove the unnecessary generic argument
|
||||
| |
|
||||
| expected 2 generic arguments
|
||||
|
|
||||
|
|
@ -911,7 +911,7 @@ error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supp
|
|||
--> $DIR/wrong-number-of-args.rs:318:18
|
||||
|
|
||||
LL | type C = HashMap<'static>;
|
||||
| ^^^^^^^--------- help: remove these generics
|
||||
| ^^^^^^^--------- help: remove the unnecessary generics
|
||||
| |
|
||||
| expected 0 lifetime arguments
|
||||
|
||||
|
|
@ -930,7 +930,7 @@ error[E0107]: struct takes at most 3 generic arguments but 4 generic arguments w
|
|||
--> $DIR/wrong-number-of-args.rs:324:18
|
||||
|
|
||||
LL | type D = HashMap<usize, String, char, f64>;
|
||||
| ^^^^^^^ --- help: remove this generic argument
|
||||
| ^^^^^^^ ----- help: remove the unnecessary generic argument
|
||||
| |
|
||||
| expected at most 3 generic arguments
|
||||
|
||||
|
|
@ -973,7 +973,7 @@ error[E0107]: enum takes 0 lifetime arguments but 1 lifetime argument was suppli
|
|||
--> $DIR/wrong-number-of-args.rs:342:18
|
||||
|
|
||||
LL | type C = Result<'static>;
|
||||
| ^^^^^^--------- help: remove these generics
|
||||
| ^^^^^^--------- help: remove the unnecessary generics
|
||||
| |
|
||||
| expected 0 lifetime arguments
|
||||
|
||||
|
|
@ -992,7 +992,7 @@ error[E0107]: enum takes 2 generic arguments but 3 generic arguments were suppli
|
|||
--> $DIR/wrong-number-of-args.rs:348:18
|
||||
|
|
||||
LL | type D = Result<usize, String, char>;
|
||||
| ^^^^^^ ---- help: remove this generic argument
|
||||
| ^^^^^^ ------ help: remove the unnecessary generic argument
|
||||
| |
|
||||
| expected 2 generic arguments
|
||||
|
||||
|
|
|
|||
22
tests/ui/impl-trait/auto-trait-selection-freeze.next.stderr
Normal file
22
tests/ui/impl-trait/auto-trait-selection-freeze.next.stderr
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
error[E0283]: type annotations needed
|
||||
--> $DIR/auto-trait-selection-freeze.rs:19:16
|
||||
|
|
||||
LL | if false { is_trait(foo()) } else { Default::default() }
|
||||
| ^^^^^^^^ ----- type must be known at this point
|
||||
| |
|
||||
| cannot infer type of the type parameter `T` declared on the function `is_trait`
|
||||
|
|
||||
= note: cannot satisfy `_: Trait<_>`
|
||||
note: required by a bound in `is_trait`
|
||||
--> $DIR/auto-trait-selection-freeze.rs:11:16
|
||||
|
|
||||
LL | fn is_trait<T: Trait<U>, U: Default>(_: T) -> U {
|
||||
| ^^^^^^^^ required by this bound in `is_trait`
|
||||
help: consider specifying the generic arguments
|
||||
|
|
||||
LL | if false { is_trait::<T, U>(foo()) } else { Default::default() }
|
||||
| ++++++++
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0283`.
|
||||
26
tests/ui/impl-trait/auto-trait-selection-freeze.old.stderr
Normal file
26
tests/ui/impl-trait/auto-trait-selection-freeze.old.stderr
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
error[E0283]: type annotations needed
|
||||
--> $DIR/auto-trait-selection-freeze.rs:19:16
|
||||
|
|
||||
LL | if false { is_trait(foo()) } else { Default::default() }
|
||||
| ^^^^^^^^ cannot infer type of the type parameter `U` declared on the function `is_trait`
|
||||
|
|
||||
note: multiple `impl`s satisfying `impl Sized: Trait<_>` found
|
||||
--> $DIR/auto-trait-selection-freeze.rs:16:1
|
||||
|
|
||||
LL | impl<T: Freeze> Trait<u32> for T {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
LL | impl<T> Trait<i32> for T {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
note: required by a bound in `is_trait`
|
||||
--> $DIR/auto-trait-selection-freeze.rs:11:16
|
||||
|
|
||||
LL | fn is_trait<T: Trait<U>, U: Default>(_: T) -> U {
|
||||
| ^^^^^^^^ required by this bound in `is_trait`
|
||||
help: consider specifying the generic arguments
|
||||
|
|
||||
LL | if false { is_trait::<_, U>(foo()) } else { Default::default() }
|
||||
| ++++++++
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0283`.
|
||||
23
tests/ui/impl-trait/auto-trait-selection-freeze.rs
Normal file
23
tests/ui/impl-trait/auto-trait-selection-freeze.rs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
//! This test shows how we fail selection in a way that can influence
|
||||
//! selection in a code path that succeeds.
|
||||
|
||||
//@ revisions: next old
|
||||
//@[next] compile-flags: -Znext-solver
|
||||
|
||||
#![feature(freeze)]
|
||||
|
||||
use std::marker::Freeze;
|
||||
|
||||
fn is_trait<T: Trait<U>, U: Default>(_: T) -> U {
|
||||
Default::default()
|
||||
}
|
||||
|
||||
trait Trait<T> {}
|
||||
impl<T: Freeze> Trait<u32> for T {}
|
||||
impl<T> Trait<i32> for T {}
|
||||
fn foo() -> impl Sized {
|
||||
if false { is_trait(foo()) } else { Default::default() }
|
||||
//~^ ERROR: type annotations needed
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
22
tests/ui/impl-trait/auto-trait-selection.next.stderr
Normal file
22
tests/ui/impl-trait/auto-trait-selection.next.stderr
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
error[E0283]: type annotations needed
|
||||
--> $DIR/auto-trait-selection.rs:15:16
|
||||
|
|
||||
LL | if false { is_trait(foo()) } else { Default::default() }
|
||||
| ^^^^^^^^ ----- type must be known at this point
|
||||
| |
|
||||
| cannot infer type of the type parameter `T` declared on the function `is_trait`
|
||||
|
|
||||
= note: cannot satisfy `_: Trait<_>`
|
||||
note: required by a bound in `is_trait`
|
||||
--> $DIR/auto-trait-selection.rs:7:16
|
||||
|
|
||||
LL | fn is_trait<T: Trait<U>, U: Default>(_: T) -> U {
|
||||
| ^^^^^^^^ required by this bound in `is_trait`
|
||||
help: consider specifying the generic arguments
|
||||
|
|
||||
LL | if false { is_trait::<T, U>(foo()) } else { Default::default() }
|
||||
| ++++++++
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0283`.
|
||||
26
tests/ui/impl-trait/auto-trait-selection.old.stderr
Normal file
26
tests/ui/impl-trait/auto-trait-selection.old.stderr
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
error[E0283]: type annotations needed
|
||||
--> $DIR/auto-trait-selection.rs:15:16
|
||||
|
|
||||
LL | if false { is_trait(foo()) } else { Default::default() }
|
||||
| ^^^^^^^^ cannot infer type of the type parameter `U` declared on the function `is_trait`
|
||||
|
|
||||
note: multiple `impl`s satisfying `impl Sized: Trait<_>` found
|
||||
--> $DIR/auto-trait-selection.rs:12:1
|
||||
|
|
||||
LL | impl<T: Send> Trait<u32> for T {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
LL | impl<T> Trait<i32> for T {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
note: required by a bound in `is_trait`
|
||||
--> $DIR/auto-trait-selection.rs:7:16
|
||||
|
|
||||
LL | fn is_trait<T: Trait<U>, U: Default>(_: T) -> U {
|
||||
| ^^^^^^^^ required by this bound in `is_trait`
|
||||
help: consider specifying the generic arguments
|
||||
|
|
||||
LL | if false { is_trait::<_, U>(foo()) } else { Default::default() }
|
||||
| ++++++++
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0283`.
|
||||
19
tests/ui/impl-trait/auto-trait-selection.rs
Normal file
19
tests/ui/impl-trait/auto-trait-selection.rs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
//! This test shows how we fail selection in a way that can influence
|
||||
//! selection in a code path that succeeds.
|
||||
|
||||
//@ revisions: next old
|
||||
//@[next] compile-flags: -Znext-solver
|
||||
|
||||
fn is_trait<T: Trait<U>, U: Default>(_: T) -> U {
|
||||
Default::default()
|
||||
}
|
||||
|
||||
trait Trait<T> {}
|
||||
impl<T: Send> Trait<u32> for T {}
|
||||
impl<T> Trait<i32> for T {}
|
||||
fn foo() -> impl Sized {
|
||||
if false { is_trait(foo()) } else { Default::default() }
|
||||
//~^ ERROR: type annotations needed
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
error[E0599]: no method named `my_debug` found for opaque type `impl Debug` in the current scope
|
||||
--> $DIR/call_method_on_inherent_impl_ref.rs:20:11
|
||||
--> $DIR/call_method_on_inherent_impl_ref.rs:19:11
|
||||
|
|
||||
LL | fn my_debug(&self);
|
||||
| -------- the method is available for `&impl Debug` here
|
||||
|
|
@ -14,27 +14,6 @@ note: `MyDebug` defines an item `my_debug`, perhaps you need to implement it
|
|||
LL | trait MyDebug {
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error[E0391]: cycle detected when computing type of opaque `my_foo::{opaque#0}`
|
||||
--> $DIR/call_method_on_inherent_impl_ref.rs:15:16
|
||||
|
|
||||
LL | fn my_foo() -> impl std::fmt::Debug {
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
note: ...which requires type-checking `my_foo`...
|
||||
--> $DIR/call_method_on_inherent_impl_ref.rs:20:9
|
||||
|
|
||||
LL | x.my_debug();
|
||||
| ^
|
||||
= note: ...which requires evaluating trait selection obligation `my_foo::{opaque#0}: core::marker::Unpin`...
|
||||
= note: ...which again requires computing type of opaque `my_foo::{opaque#0}`, completing the cycle
|
||||
note: cycle used when computing type of `my_foo::{opaque#0}`
|
||||
--> $DIR/call_method_on_inherent_impl_ref.rs:15:16
|
||||
|
|
||||
LL | fn my_foo() -> impl std::fmt::Debug {
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0391, E0599.
|
||||
For more information about an error, try `rustc --explain E0391`.
|
||||
For more information about this error, try `rustc --explain E0599`.
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
error[E0282]: type annotations needed
|
||||
--> $DIR/call_method_on_inherent_impl_ref.rs:18:13
|
||||
--> $DIR/call_method_on_inherent_impl_ref.rs:17:13
|
||||
|
|
||||
LL | let x = my_foo();
|
||||
| ^
|
||||
|
|
@ -13,7 +13,7 @@ LL | let x: /* Type */ = my_foo();
|
|||
| ++++++++++++
|
||||
|
||||
error[E0282]: type annotations needed for `&_`
|
||||
--> $DIR/call_method_on_inherent_impl_ref.rs:28:13
|
||||
--> $DIR/call_method_on_inherent_impl_ref.rs:27:13
|
||||
|
|
||||
LL | let x = &my_bar();
|
||||
| ^
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ where
|
|||
}
|
||||
|
||||
fn my_foo() -> impl std::fmt::Debug {
|
||||
//[current]~^ cycle
|
||||
if false {
|
||||
let x = my_foo();
|
||||
//[next]~^ type annotations needed
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0107]: function takes 1 generic argument but 2 generic arguments were sup
|
|||
--> $DIR/explicit-generic-args-for-impl.rs:4:5
|
||||
|
|
||||
LL | foo::<str, String>("".to_string());
|
||||
| ^^^ ------ help: remove this generic argument
|
||||
| ^^^ -------- help: remove the unnecessary generic argument
|
||||
| |
|
||||
| expected 1 generic argument
|
||||
|
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ error[E0107]: struct takes 0 generic arguments but 1 generic argument was suppli
|
|||
--> $DIR/opaque-and-lifetime-mismatch.rs:4:17
|
||||
|
|
||||
LL | fn bar() -> Wrapper<impl Sized>;
|
||||
| ^^^^^^^ ---------- help: remove this generic argument
|
||||
| ^^^^^^^ ---------- help: remove the unnecessary generic argument
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
|
|
||||
|
|
@ -52,7 +52,7 @@ error[E0107]: struct takes 0 generic arguments but 1 generic argument was suppli
|
|||
--> $DIR/opaque-and-lifetime-mismatch.rs:18:17
|
||||
|
|
||||
LL | fn foo() -> Wrapper<impl Sized>;
|
||||
| ^^^^^^^ ---------- help: remove this generic argument
|
||||
| ^^^^^^^ ---------- help: remove the unnecessary generic argument
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
|
|
||||
|
|
@ -93,7 +93,7 @@ error[E0107]: struct takes 0 generic arguments but 1 generic argument was suppli
|
|||
--> $DIR/opaque-and-lifetime-mismatch.rs:24:17
|
||||
|
|
||||
LL | fn foo() -> Wrapper<impl Sized> {
|
||||
| ^^^^^^^ ---------- help: remove this generic argument
|
||||
| ^^^^^^^ ---------- help: remove the unnecessary generic argument
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
|
|
||||
|
|
|
|||
14
tests/ui/impl-trait/rpit/const_check_false_cycle.rs
Normal file
14
tests/ui/impl-trait/rpit/const_check_false_cycle.rs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
//! This test caused a cycle error when checking whether the
|
||||
//! return type is `Freeze` during const checking, even though
|
||||
//! the information is readily available.
|
||||
|
||||
//@ revisions: current next
|
||||
//@[next] compile-flags: -Znext-solver
|
||||
//@ check-pass
|
||||
|
||||
const fn f() -> impl Eq {
|
||||
g()
|
||||
}
|
||||
const fn g() {}
|
||||
|
||||
fn main() {}
|
||||
|
|
@ -5,7 +5,7 @@ LL | let x = hello();
|
|||
| ^^^^^^^ types differ
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/unsized_coercion3.rs:19:14
|
||||
--> $DIR/unsized_coercion3.rs:18:14
|
||||
|
|
||||
LL | fn hello() -> Box<impl Trait + ?Sized> {
|
||||
| ------------------- the expected opaque type
|
||||
|
|
@ -21,7 +21,7 @@ note: associated function defined here
|
|||
--> $SRC_DIR/alloc/src/boxed.rs:LL:COL
|
||||
|
||||
error[E0277]: the size for values of type `impl Trait + ?Sized` cannot be known at compilation time
|
||||
--> $DIR/unsized_coercion3.rs:19:14
|
||||
--> $DIR/unsized_coercion3.rs:18:14
|
||||
|
|
||||
LL | Box::new(1u32)
|
||||
| -------- ^^^^ doesn't have a size known at compile-time
|
||||
|
|
|
|||
|
|
@ -1,17 +1,3 @@
|
|||
error: cannot check whether the hidden type of opaque type satisfies auto traits
|
||||
--> $DIR/unsized_coercion3.rs:15:32
|
||||
|
|
||||
LL | let y: Box<dyn Send> = x;
|
||||
| ^
|
||||
|
|
||||
= note: fetching the hidden types of an opaque inside of the defining scope is not supported. You can try moving the opaque type and the item that actually registers a hidden type into a new submodule
|
||||
note: opaque type is declared here
|
||||
--> $DIR/unsized_coercion3.rs:11:19
|
||||
|
|
||||
LL | fn hello() -> Box<impl Trait + ?Sized> {
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
= note: required for the cast from `Box<impl Trait + ?Sized>` to `Box<dyn Send>`
|
||||
|
||||
error[E0277]: the size for values of type `impl Trait + ?Sized` cannot be known at compilation time
|
||||
--> $DIR/unsized_coercion3.rs:15:32
|
||||
|
|
||||
|
|
@ -21,6 +7,6 @@ LL | let y: Box<dyn Send> = x;
|
|||
= help: the trait `Sized` is not implemented for `impl Trait + ?Sized`
|
||||
= note: required for the cast from `Box<impl Trait + ?Sized>` to `Box<dyn Send>`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0277`.
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ fn hello() -> Box<impl Trait + ?Sized> {
|
|||
//[next]~^ ERROR: type mismatch resolving `impl Trait + ?Sized <: dyn Send`
|
||||
let y: Box<dyn Send> = x;
|
||||
//[old]~^ ERROR: the size for values of type `impl Trait + ?Sized` cannot be know
|
||||
//[old]~| ERROR: cannot check whether the hidden type of opaque type satisfies auto traits
|
||||
}
|
||||
Box::new(1u32)
|
||||
//[next]~^ ERROR: mismatched types
|
||||
|
|
|
|||
|
|
@ -9,20 +9,6 @@ LL | let y: Box<dyn Send> = x as Box<dyn Trait + Send>;
|
|||
= note: expected struct `Box<dyn Send>`
|
||||
found struct `Box<dyn Trait + Send>`
|
||||
|
||||
error: cannot check whether the hidden type of opaque type satisfies auto traits
|
||||
--> $DIR/unsized_coercion5.rs:16:32
|
||||
|
|
||||
LL | let y: Box<dyn Send> = x as Box<dyn Trait + Send>;
|
||||
| ^
|
||||
|
|
||||
= note: fetching the hidden types of an opaque inside of the defining scope is not supported. You can try moving the opaque type and the item that actually registers a hidden type into a new submodule
|
||||
note: opaque type is declared here
|
||||
--> $DIR/unsized_coercion5.rs:13:19
|
||||
|
|
||||
LL | fn hello() -> Box<impl Trait + ?Sized> {
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
= note: required for the cast from `Box<impl Trait + ?Sized>` to `Box<dyn Trait + Send>`
|
||||
|
||||
error[E0277]: the size for values of type `impl Trait + ?Sized` cannot be known at compilation time
|
||||
--> $DIR/unsized_coercion5.rs:16:32
|
||||
|
|
||||
|
|
@ -32,7 +18,7 @@ LL | let y: Box<dyn Send> = x as Box<dyn Trait + Send>;
|
|||
= help: the trait `Sized` is not implemented for `impl Trait + ?Sized`
|
||||
= note: required for the cast from `Box<impl Trait + ?Sized>` to `Box<dyn Trait + Send>`
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0277, E0308.
|
||||
For more information about an error, try `rustc --explain E0277`.
|
||||
|
|
|
|||
|
|
@ -15,8 +15,7 @@ fn hello() -> Box<impl Trait + ?Sized> {
|
|||
let x = hello();
|
||||
let y: Box<dyn Send> = x as Box<dyn Trait + Send>;
|
||||
//[old]~^ ERROR: the size for values of type `impl Trait + ?Sized` cannot be know
|
||||
//[old]~| ERROR: cannot check whether the hidden type of opaque type satisfies auto traits
|
||||
//~^^^ ERROR: mismatched types
|
||||
//~^^ ERROR: mismatched types
|
||||
}
|
||||
Box::new(1u32)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supp
|
|||
--> $DIR/issue-18423.rs:4:8
|
||||
|
|
||||
LL | x: Box<'a, isize>
|
||||
| ^^^ -- help: remove this lifetime argument
|
||||
| ^^^ -- help: remove the lifetime argument
|
||||
| |
|
||||
| expected 0 lifetime arguments
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0107]: associated function takes 0 generic arguments but 1 generic argume
|
|||
--> $DIR/issue-53251.rs:11:20
|
||||
|
|
||||
LL | S::f::<i64>();
|
||||
| ^------- help: remove these generics
|
||||
| ^------- help: remove the unnecessary generics
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
...
|
||||
|
|
@ -20,7 +20,7 @@ error[E0107]: associated function takes 0 generic arguments but 1 generic argume
|
|||
--> $DIR/issue-53251.rs:11:20
|
||||
|
|
||||
LL | S::f::<i64>();
|
||||
| ^------- help: remove these generics
|
||||
| ^------- help: remove the unnecessary generics
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
...
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ error[E0107]: method takes 0 generic arguments but 1 generic argument was suppli
|
|||
--> $DIR/issue-60622.rs:10:7
|
||||
|
|
||||
LL | b.a::<'_, T>();
|
||||
| ^ - help: remove this generic argument
|
||||
| ^ - help: remove the unnecessary generic argument
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
|
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0107]: type alias takes 1 lifetime argument but 2 lifetime arguments were
|
|||
--> $DIR/mismatched_arg_count.rs:9:29
|
||||
|
|
||||
LL | fn bar<'a, T: Trait<'a>>(_: Alias<'a, 'a, T>) {}
|
||||
| ^^^^^ -- help: remove this lifetime argument
|
||||
| ^^^^^ ---- help: remove the lifetime argument
|
||||
| |
|
||||
| expected 1 lifetime argument
|
||||
|
|
||||
|
|
|
|||
18
tests/ui/layout/size-of-val-raw-too-big.rs
Normal file
18
tests/ui/layout/size-of-val-raw-too-big.rs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
//@ build-fail
|
||||
//@ compile-flags: --crate-type lib
|
||||
//@ only-32bit Layout computation rejects this layout for different reasons on 64-bit.
|
||||
//@ error-pattern: too big for the current architecture
|
||||
#![feature(core_intrinsics)]
|
||||
#![allow(internal_features)]
|
||||
|
||||
// isize::MAX is fine, but with the padding for the unsized tail it is too big.
|
||||
#[repr(C)]
|
||||
pub struct Example([u8; isize::MAX as usize], [u16]);
|
||||
|
||||
// We guarantee that with length 0, `size_of_val_raw` (which calls the `size_of_val` intrinsic)
|
||||
// is safe to call. The compiler aborts compilation if a length of 0 would overflow.
|
||||
// So let's construct a case where length 0 just barely overflows, and ensure that
|
||||
// does abort compilation.
|
||||
pub fn check(x: *const Example) -> usize {
|
||||
unsafe { std::intrinsics::size_of_val(x) }
|
||||
}
|
||||
4
tests/ui/layout/size-of-val-raw-too-big.stderr
Normal file
4
tests/ui/layout/size-of-val-raw-too-big.stderr
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
error: values of the type `Example` are too big for the current architecture
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
|
|
@ -2,7 +2,7 @@ error[E0107]: struct takes 2 lifetime arguments but 3 lifetime arguments were su
|
|||
--> $DIR/noisy-follow-up-erro.rs:12:30
|
||||
|
|
||||
LL | fn boom(&self, foo: &mut Foo<'_, '_, 'a>) -> Result<(), &'a ()> {
|
||||
| ^^^ -- help: remove this lifetime argument
|
||||
| ^^^ ---- help: remove the lifetime argument
|
||||
| |
|
||||
| expected 2 lifetime arguments
|
||||
|
|
||||
|
|
|
|||
|
|
@ -55,6 +55,21 @@ LL | #[warn(incomplete_include)]
|
|||
warning: 4 warnings emitted
|
||||
|
||||
Future incompatibility report: Future breakage diagnostic:
|
||||
warning: missing fragment specifier
|
||||
--> $DIR/expansion-time.rs:9:19
|
||||
|
|
||||
LL | macro_rules! m { ($i) => {} }
|
||||
| ^^
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #40107 <https://github.com/rust-lang/rust/issues/40107>
|
||||
note: the lint level is defined here
|
||||
--> $DIR/expansion-time.rs:8:8
|
||||
|
|
||||
LL | #[warn(missing_fragment_specifier)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Future breakage diagnostic:
|
||||
warning: use of unstable library feature 'test': `bench` is a part of custom test frameworks which are unstable
|
||||
--> $DIR/expansion-time.rs:14:7
|
||||
|
|
||||
|
|
|
|||
|
|
@ -10,3 +10,14 @@ LL | macro_rules! m { ($i) => {} }
|
|||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
Future incompatibility report: Future breakage diagnostic:
|
||||
error: missing fragment specifier
|
||||
--> $DIR/issue-39404.rs:3:19
|
||||
|
|
||||
LL | macro_rules! m { ($i) => {} }
|
||||
| ^^
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #40107 <https://github.com/rust-lang/rust/issues/40107>
|
||||
= note: `#[deny(missing_fragment_specifier)]` on by default
|
||||
|
||||
|
|
|
|||
|
|
@ -25,3 +25,25 @@ LL | ($a, $b) => {
|
|||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
Future incompatibility report: Future breakage diagnostic:
|
||||
error: missing fragment specifier
|
||||
--> $DIR/macro-match-nonterminal.rs:2:8
|
||||
|
|
||||
LL | ($a, $b) => {
|
||||
| ^
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #40107 <https://github.com/rust-lang/rust/issues/40107>
|
||||
= note: `#[deny(missing_fragment_specifier)]` on by default
|
||||
|
||||
Future breakage diagnostic:
|
||||
error: missing fragment specifier
|
||||
--> $DIR/macro-match-nonterminal.rs:2:10
|
||||
|
|
||||
LL | ($a, $b) => {
|
||||
| ^^
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #40107 <https://github.com/rust-lang/rust/issues/40107>
|
||||
= note: `#[deny(missing_fragment_specifier)]` on by default
|
||||
|
||||
|
|
|
|||
|
|
@ -16,3 +16,14 @@ LL | ($name) => {}
|
|||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
Future incompatibility report: Future breakage diagnostic:
|
||||
error: missing fragment specifier
|
||||
--> $DIR/macro-missing-fragment-deduplication.rs:4:6
|
||||
|
|
||||
LL | ($name) => {}
|
||||
| ^^^^^
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #40107 <https://github.com/rust-lang/rust/issues/40107>
|
||||
= note: `#[deny(missing_fragment_specifier)]` on by default
|
||||
|
||||
|
|
|
|||
|
|
@ -38,3 +38,48 @@ LL | ( $name ) => {};
|
|||
|
||||
error: aborting due to 1 previous error; 3 warnings emitted
|
||||
|
||||
Future incompatibility report: Future breakage diagnostic:
|
||||
warning: missing fragment specifier
|
||||
--> $DIR/macro-missing-fragment.rs:4:20
|
||||
|
|
||||
LL | ( $( any_token $field_rust_type )* ) => {};
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #40107 <https://github.com/rust-lang/rust/issues/40107>
|
||||
note: the lint level is defined here
|
||||
--> $DIR/macro-missing-fragment.rs:1:9
|
||||
|
|
||||
LL | #![warn(missing_fragment_specifier)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Future breakage diagnostic:
|
||||
warning: missing fragment specifier
|
||||
--> $DIR/macro-missing-fragment.rs:12:7
|
||||
|
|
||||
LL | ( $name ) => {};
|
||||
| ^^^^^
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #40107 <https://github.com/rust-lang/rust/issues/40107>
|
||||
note: the lint level is defined here
|
||||
--> $DIR/macro-missing-fragment.rs:1:9
|
||||
|
|
||||
LL | #![warn(missing_fragment_specifier)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Future breakage diagnostic:
|
||||
warning: missing fragment specifier
|
||||
--> $DIR/macro-missing-fragment.rs:18:7
|
||||
|
|
||||
LL | ( $name ) => {};
|
||||
| ^^^^^
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #40107 <https://github.com/rust-lang/rust/issues/40107>
|
||||
note: the lint level is defined here
|
||||
--> $DIR/macro-missing-fragment.rs:1:9
|
||||
|
|
||||
LL | #![warn(missing_fragment_specifier)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ error[E0107]: method takes 2 lifetime arguments but 3 lifetime arguments were su
|
|||
--> $DIR/method-call-lifetime-args-fail.rs:18:7
|
||||
|
|
||||
LL | S.early::<'static, 'static, 'static>();
|
||||
| ^^^^^ ------- help: remove this lifetime argument
|
||||
| ^^^^^ --------- help: remove the lifetime argument
|
||||
| |
|
||||
| expected 2 lifetime arguments
|
||||
|
|
||||
|
|
@ -220,7 +220,7 @@ error[E0107]: method takes 2 lifetime arguments but 3 lifetime arguments were su
|
|||
--> $DIR/method-call-lifetime-args-fail.rs:65:8
|
||||
|
|
||||
LL | S::early::<'static, 'static, 'static>(S);
|
||||
| ^^^^^ ------- help: remove this lifetime argument
|
||||
| ^^^^^ --------- help: remove the lifetime argument
|
||||
| |
|
||||
| expected 2 lifetime arguments
|
||||
|
|
||||
|
|
|
|||
|
|
@ -28,3 +28,14 @@ LL | { $+ } => {
|
|||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
Future incompatibility report: Future breakage diagnostic:
|
||||
error: missing fragment specifier
|
||||
--> $DIR/issue-33569.rs:2:8
|
||||
|
|
||||
LL | { $+ } => {
|
||||
| ^
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #40107 <https://github.com/rust-lang/rust/issues/40107>
|
||||
= note: `#[deny(missing_fragment_specifier)]` on by default
|
||||
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
|
|||
span: $DIR/cfg-eval-inner.rs:19:40: 19:54 (#0),
|
||||
},
|
||||
],
|
||||
span: $DIR/cfg-eval-inner.rs:19:5: 19:6 (#0),
|
||||
span: $DIR/cfg-eval-inner.rs:19:7: 19:56 (#0),
|
||||
},
|
||||
Punct {
|
||||
ch: '#',
|
||||
|
|
@ -168,7 +168,7 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
|
|||
span: $DIR/cfg-eval-inner.rs:23:48: 23:70 (#0),
|
||||
},
|
||||
],
|
||||
span: $DIR/cfg-eval-inner.rs:23:13: 23:14 (#0),
|
||||
span: $DIR/cfg-eval-inner.rs:23:15: 23:72 (#0),
|
||||
},
|
||||
Literal {
|
||||
kind: Integer,
|
||||
|
|
@ -233,7 +233,7 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
|
|||
span: $DIR/cfg-eval-inner.rs:32:40: 32:56 (#0),
|
||||
},
|
||||
],
|
||||
span: $DIR/cfg-eval-inner.rs:32:5: 32:6 (#0),
|
||||
span: $DIR/cfg-eval-inner.rs:32:7: 32:58 (#0),
|
||||
},
|
||||
Ident {
|
||||
ident: "fn",
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
|
|||
span: $DIR/cfg-eval.rs:22:36: 22:38 (#0),
|
||||
},
|
||||
],
|
||||
span: $DIR/cfg-eval.rs:22:5: 22:6 (#0),
|
||||
span: $DIR/cfg-eval.rs:22:6: 22:40 (#0),
|
||||
},
|
||||
Ident {
|
||||
ident: "field_true",
|
||||
|
|
@ -99,7 +99,7 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
|
|||
span: $DIR/cfg-eval.rs:35:62: 35:73 (#0),
|
||||
},
|
||||
],
|
||||
span: $DIR/cfg-eval.rs:35:39: 35:40 (#0),
|
||||
span: $DIR/cfg-eval.rs:35:40: 35:75 (#0),
|
||||
},
|
||||
Group {
|
||||
delimiter: Parenthesis,
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [
|
|||
span: $DIR/expand-to-derive.rs:27:28: 27:39 (#0),
|
||||
},
|
||||
],
|
||||
span: $DIR/expand-to-derive.rs:27:5: 27:6 (#0),
|
||||
span: $DIR/expand-to-derive.rs:27:6: 27:41 (#0),
|
||||
},
|
||||
Ident {
|
||||
ident: "struct",
|
||||
|
|
|
|||
|
|
@ -674,7 +674,7 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [
|
|||
span: $DIR/inner-attrs.rs:41:52: 41:59 (#0),
|
||||
},
|
||||
],
|
||||
span: $DIR/inner-attrs.rs:41:17: 41:18 (#0),
|
||||
span: $DIR/inner-attrs.rs:41:19: 41:61 (#0),
|
||||
},
|
||||
Ident {
|
||||
ident: "true",
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
|
|||
span: $DIR/issue-75930-derive-cfg.rs:50:29: 50:40 (#0),
|
||||
},
|
||||
],
|
||||
span: $DIR/issue-75930-derive-cfg.rs:50:1: 50:2 (#0),
|
||||
span: $DIR/issue-75930-derive-cfg.rs:50:2: 50:42 (#0),
|
||||
},
|
||||
Punct {
|
||||
ch: '#',
|
||||
|
|
@ -1395,7 +1395,7 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [
|
|||
span: $DIR/issue-75930-derive-cfg.rs:50:29: 50:40 (#0),
|
||||
},
|
||||
],
|
||||
span: $DIR/issue-75930-derive-cfg.rs:50:1: 50:2 (#0),
|
||||
span: $DIR/issue-75930-derive-cfg.rs:50:2: 50:42 (#0),
|
||||
},
|
||||
Punct {
|
||||
ch: '#',
|
||||
|
|
@ -1571,7 +1571,7 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [
|
|||
span: $DIR/issue-75930-derive-cfg.rs:63:41: 63:51 (#0),
|
||||
},
|
||||
],
|
||||
span: $DIR/issue-75930-derive-cfg.rs:63:13: 63:14 (#0),
|
||||
span: $DIR/issue-75930-derive-cfg.rs:63:14: 63:53 (#0),
|
||||
},
|
||||
Ident {
|
||||
ident: "false",
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [
|
|||
span: $DIR/macro-rules-derive-cfg.rs:19:59: 19:66 (#3),
|
||||
},
|
||||
],
|
||||
span: $DIR/macro-rules-derive-cfg.rs:19:25: 19:26 (#3),
|
||||
span: $DIR/macro-rules-derive-cfg.rs:19:26: 19:68 (#3),
|
||||
},
|
||||
Punct {
|
||||
ch: '#',
|
||||
|
|
@ -113,7 +113,7 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [
|
|||
span: $DIR/macro-rules-derive-cfg.rs:26:47: 26:55 (#0),
|
||||
},
|
||||
],
|
||||
span: $DIR/macro-rules-derive-cfg.rs:26:13: 26:14 (#0),
|
||||
span: $DIR/macro-rules-derive-cfg.rs:26:14: 26:57 (#0),
|
||||
},
|
||||
Group {
|
||||
delimiter: Brace,
|
||||
|
|
@ -146,7 +146,7 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [
|
|||
span: $DIR/macro-rules-derive-cfg.rs:27:34: 27:42 (#0),
|
||||
},
|
||||
],
|
||||
span: $DIR/macro-rules-derive-cfg.rs:27:5: 27:6 (#0),
|
||||
span: $DIR/macro-rules-derive-cfg.rs:27:7: 27:44 (#0),
|
||||
},
|
||||
Literal {
|
||||
kind: Integer,
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ error[E0107]: struct takes 0 generic arguments but 1 generic argument was suppli
|
|||
--> $DIR/issue-3214.rs:6:22
|
||||
|
|
||||
LL | impl<T> Drop for Foo<T> {
|
||||
| ^^^--- help: remove these generics
|
||||
| ^^^--- help: remove the unnecessary generics
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
|
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0107]: function takes 0 generic arguments but 1 generic argument was supp
|
|||
--> $DIR/no-explicit-const-params-cross-crate.rs:14:5
|
||||
|
|
||||
LL | foo::<false>();
|
||||
| ^^^--------- help: remove these generics
|
||||
| ^^^--------- help: remove the unnecessary generics
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
|
|
||||
|
|
@ -32,7 +32,7 @@ error[E0107]: function takes 0 generic arguments but 1 generic argument was supp
|
|||
--> $DIR/no-explicit-const-params-cross-crate.rs:7:5
|
||||
|
|
||||
LL | foo::<true>();
|
||||
| ^^^-------- help: remove these generics
|
||||
| ^^^-------- help: remove the unnecessary generics
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
|
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ error[E0107]: function takes 0 generic arguments but 1 generic argument was supp
|
|||
--> $DIR/no-explicit-const-params.rs:22:5
|
||||
|
|
||||
LL | foo::<false>();
|
||||
| ^^^--------- help: remove these generics
|
||||
| ^^^--------- help: remove the unnecessary generics
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
|
|
||||
|
|
@ -55,7 +55,7 @@ error[E0107]: function takes 0 generic arguments but 1 generic argument was supp
|
|||
--> $DIR/no-explicit-const-params.rs:15:5
|
||||
|
|
||||
LL | foo::<true>();
|
||||
| ^^^-------- help: remove these generics
|
||||
| ^^^-------- help: remove the unnecessary generics
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
|
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ impl MyTrait for i32 {
|
|||
//~| ERROR functions in trait impls cannot be declared const
|
||||
//~| ERROR functions cannot be both `const` and `async`
|
||||
//~| ERROR method `bar` is not a member
|
||||
//~| ERROR cycle detected when computing type
|
||||
main8().await;
|
||||
//~^ ERROR cannot find function
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ error: using `#![feature(effects)]` without enabling next trait solver globally
|
|||
= help: use `-Znext-solver` to enable
|
||||
|
||||
error[E0425]: cannot find function `main8` in this scope
|
||||
--> $DIR/ice-120503-async-const-method.rs:13:9
|
||||
--> $DIR/ice-120503-async-const-method.rs:12:9
|
||||
|
|
||||
LL | main8().await;
|
||||
| ^^^^^ help: a function with a similar name exists: `main`
|
||||
|
|
@ -69,38 +69,7 @@ LL | main8().await;
|
|||
LL | fn main() {}
|
||||
| --------- similarly named function `main` defined here
|
||||
|
||||
error[E0391]: cycle detected when computing type of opaque `<impl at $DIR/ice-120503-async-const-method.rs:6:1: 6:21>::bar::{opaque#0}`
|
||||
--> $DIR/ice-120503-async-const-method.rs:7:5
|
||||
|
|
||||
LL | async const fn bar(&self) {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
note: ...which requires borrow-checking `<impl at $DIR/ice-120503-async-const-method.rs:6:1: 6:21>::bar`...
|
||||
--> $DIR/ice-120503-async-const-method.rs:7:5
|
||||
|
|
||||
LL | async const fn bar(&self) {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
note: ...which requires promoting constants in MIR for `<impl at $DIR/ice-120503-async-const-method.rs:6:1: 6:21>::bar`...
|
||||
--> $DIR/ice-120503-async-const-method.rs:7:5
|
||||
|
|
||||
LL | async const fn bar(&self) {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
note: ...which requires const checking `<impl at $DIR/ice-120503-async-const-method.rs:6:1: 6:21>::bar`...
|
||||
--> $DIR/ice-120503-async-const-method.rs:7:5
|
||||
|
|
||||
LL | async const fn bar(&self) {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
= note: ...which requires computing whether `<impl at $DIR/ice-120503-async-const-method.rs:6:1: 6:21>::bar::{opaque#0}` is freeze...
|
||||
= note: ...which requires evaluating trait selection obligation `<impl at $DIR/ice-120503-async-const-method.rs:6:1: 6:21>::bar::{opaque#0}: core::marker::Freeze`...
|
||||
= note: ...which again requires computing type of opaque `<impl at $DIR/ice-120503-async-const-method.rs:6:1: 6:21>::bar::{opaque#0}`, completing the cycle
|
||||
note: cycle used when computing type of `<impl at $DIR/ice-120503-async-const-method.rs:6:1: 6:21>::bar::{opaque#0}`
|
||||
--> $DIR/ice-120503-async-const-method.rs:7:5
|
||||
|
|
||||
LL | async const fn bar(&self) {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
|
||||
error: aborting due to 6 previous errors; 1 warning emitted
|
||||
|
||||
error: aborting due to 7 previous errors; 1 warning emitted
|
||||
|
||||
Some errors have detailed explanations: E0379, E0391, E0407, E0425.
|
||||
Some errors have detailed explanations: E0379, E0407, E0425.
|
||||
For more information about an error, try `rustc --explain E0379`.
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplie
|
|||
--> $DIR/seq-args.rs:4:13
|
||||
|
|
||||
LL | impl<T> Seq<T> for Vec<T> {
|
||||
| ^^^--- help: remove these generics
|
||||
| ^^^--- help: remove the unnecessary generics
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
|
|
||||
|
|
@ -16,7 +16,7 @@ error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplie
|
|||
--> $DIR/seq-args.rs:9:10
|
||||
|
|
||||
LL | impl Seq<bool> for u32 {
|
||||
| ^^^------ help: remove these generics
|
||||
| ^^^------ help: remove the unnecessary generics
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
|
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ error[E0107]: associated type takes 0 generic arguments but 1 generic argument w
|
|||
--> $DIR/struct-path-associated-type.rs:14:16
|
||||
|
|
||||
LL | let z = T::A::<u8> {};
|
||||
| ^------ help: remove these generics
|
||||
| ^------ help: remove the unnecessary generics
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
|
|
||||
|
|
@ -34,7 +34,7 @@ error[E0107]: associated type takes 0 generic arguments but 1 generic argument w
|
|||
--> $DIR/struct-path-associated-type.rs:25:16
|
||||
|
|
||||
LL | let z = T::A::<u8> {};
|
||||
| ^------ help: remove these generics
|
||||
| ^------ help: remove the unnecessary generics
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
|
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ error[E0107]: type alias takes 0 generic arguments but 1 generic argument was su
|
|||
--> $DIR/structure-constructor-type-mismatch.rs:48:15
|
||||
|
|
||||
LL | let pt3 = PointF::<i32> {
|
||||
| ^^^^^^------- help: remove these generics
|
||||
| ^^^^^^------- help: remove the unnecessary generics
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
|
|
||||
|
|
@ -104,7 +104,7 @@ error[E0107]: type alias takes 0 generic arguments but 1 generic argument was su
|
|||
--> $DIR/structure-constructor-type-mismatch.rs:54:9
|
||||
|
|
||||
LL | PointF::<u32> { .. } => {}
|
||||
| ^^^^^^------- help: remove these generics
|
||||
| ^^^^^^------- help: remove the unnecessary generics
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
|
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0107]: method takes 0 generic arguments but 1 generic argument was suppli
|
|||
--> $DIR/issue-101421.rs:10:8
|
||||
|
|
||||
LL | ().f::<()>(());
|
||||
| ^------ help: remove these generics
|
||||
| ^------ help: remove the unnecessary generics
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
|
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0107]: method takes 0 generic arguments but 1 generic argument was suppli
|
|||
--> $DIR/issue-104287.rs:10:5
|
||||
|
|
||||
LL | foo::<()>(x);
|
||||
| ^^^------ help: remove these generics
|
||||
| ^^^------ help: remove the unnecessary generics
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
|
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@
|
|||
|
||||
fn foo(x: &str) -> bool {
|
||||
x.starts_with(&("hi".to_string() + " you"))
|
||||
//~^ ERROR the trait bound `String: Pattern<'_>` is not satisfied [E0277]
|
||||
//~^ ERROR the trait bound `String: Pattern` is not satisfied [E0277]
|
||||
}
|
||||
|
||||
fn foo2(x: &str) -> bool {
|
||||
x.starts_with(&"hi".to_string())
|
||||
//~^ ERROR the trait bound `String: Pattern<'_>` is not satisfied [E0277]
|
||||
//~^ ERROR the trait bound `String: Pattern` is not satisfied [E0277]
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@
|
|||
|
||||
fn foo(x: &str) -> bool {
|
||||
x.starts_with("hi".to_string() + " you")
|
||||
//~^ ERROR the trait bound `String: Pattern<'_>` is not satisfied [E0277]
|
||||
//~^ ERROR the trait bound `String: Pattern` is not satisfied [E0277]
|
||||
}
|
||||
|
||||
fn foo2(x: &str) -> bool {
|
||||
x.starts_with("hi".to_string())
|
||||
//~^ ERROR the trait bound `String: Pattern<'_>` is not satisfied [E0277]
|
||||
//~^ ERROR the trait bound `String: Pattern` is not satisfied [E0277]
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
error[E0277]: the trait bound `String: Pattern<'_>` is not satisfied
|
||||
error[E0277]: the trait bound `String: Pattern` is not satisfied
|
||||
--> $DIR/issue-104961.rs:4:19
|
||||
|
|
||||
LL | x.starts_with("hi".to_string() + " you")
|
||||
| ----------- ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Pattern<'_>` is not implemented for `String`
|
||||
| ----------- ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Pattern` is not implemented for `String`
|
||||
| |
|
||||
| required by a bound introduced by this call
|
||||
|
|
||||
= note: required for `String` to implement `Pattern<'_>`
|
||||
= note: required for `String` to implement `Pattern`
|
||||
note: required by a bound in `core::str::<impl str>::starts_with`
|
||||
--> $SRC_DIR/core/src/str/mod.rs:LL:COL
|
||||
help: consider borrowing here
|
||||
|
|
@ -14,15 +14,15 @@ help: consider borrowing here
|
|||
LL | x.starts_with(&("hi".to_string() + " you"))
|
||||
| ++ +
|
||||
|
||||
error[E0277]: the trait bound `String: Pattern<'_>` is not satisfied
|
||||
error[E0277]: the trait bound `String: Pattern` is not satisfied
|
||||
--> $DIR/issue-104961.rs:9:19
|
||||
|
|
||||
LL | x.starts_with("hi".to_string())
|
||||
| ----------- ^^^^^^^^^^^^^^^^ the trait `Pattern<'_>` is not implemented for `String`
|
||||
| ----------- ^^^^^^^^^^^^^^^^ the trait `Pattern` is not implemented for `String`
|
||||
| |
|
||||
| required by a bound introduced by this call
|
||||
|
|
||||
= note: required for `String` to implement `Pattern<'_>`
|
||||
= note: required for `String` to implement `Pattern`
|
||||
note: required by a bound in `core::str::<impl str>::starts_with`
|
||||
--> $SRC_DIR/core/src/str/mod.rs:LL:COL
|
||||
help: consider borrowing here
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
error[E0277]: the trait bound `String: Pattern<'_>` is not satisfied
|
||||
error[E0277]: the trait bound `String: Pattern` is not satisfied
|
||||
--> $DIR/issue-62843.rs:4:32
|
||||
|
|
||||
LL | println!("{:?}", line.find(pattern));
|
||||
| ---- ^^^^^^^ the trait `Pattern<'_>` is not implemented for `String`
|
||||
| ---- ^^^^^^^ the trait `Pattern` is not implemented for `String`
|
||||
| |
|
||||
| required by a bound introduced by this call
|
||||
|
|
||||
= note: required for `String` to implement `Pattern<'_>`
|
||||
= note: required for `String` to implement `Pattern`
|
||||
note: required by a bound in `core::str::<impl str>::find`
|
||||
--> $SRC_DIR/core/src/str/mod.rs:LL:COL
|
||||
help: consider borrowing here
|
||||
|
|
|
|||
|
|
@ -16,20 +16,20 @@ impl<T, U> B<T, U> for S {}
|
|||
fn main() {
|
||||
let _ = A::foo::<S>();
|
||||
//~^ ERROR
|
||||
//~| HELP remove these generics
|
||||
//~| HELP remove the unnecessary generics
|
||||
//~| HELP consider moving this generic argument
|
||||
|
||||
let _ = B::bar::<S, S>();
|
||||
//~^ ERROR
|
||||
//~| HELP remove these generics
|
||||
//~| HELP remove the unnecessary generics
|
||||
//~| HELP consider moving these generic arguments
|
||||
|
||||
let _ = A::<S>::foo::<S>();
|
||||
//~^ ERROR
|
||||
//~| HELP remove these generics
|
||||
//~| HELP remove the unnecessary generics
|
||||
|
||||
let _ = 42.into::<Option<_>>();
|
||||
//~^ ERROR
|
||||
//~| HELP remove these generics
|
||||
//~| HELP remove the unnecessary generics
|
||||
//~| HELP consider moving this generic argument
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ help: consider moving this generic argument to the `A` trait, which takes up to
|
|||
LL - let _ = A::foo::<S>();
|
||||
LL + let _ = A::<S>::foo();
|
||||
|
|
||||
help: remove these generics
|
||||
help: remove the unnecessary generics
|
||||
|
|
||||
LL - let _ = A::foo::<S>();
|
||||
LL + let _ = A::foo();
|
||||
|
|
@ -36,7 +36,7 @@ help: consider moving these generic arguments to the `B` trait, which takes up t
|
|||
LL - let _ = B::bar::<S, S>();
|
||||
LL + let _ = B::<S, S>::bar();
|
||||
|
|
||||
help: remove these generics
|
||||
help: remove the unnecessary generics
|
||||
|
|
||||
LL - let _ = B::bar::<S, S>();
|
||||
LL + let _ = B::bar();
|
||||
|
|
@ -46,7 +46,7 @@ error[E0107]: associated function takes 0 generic arguments but 1 generic argume
|
|||
--> $DIR/issue-89064.rs:27:21
|
||||
|
|
||||
LL | let _ = A::<S>::foo::<S>();
|
||||
| ^^^----- help: remove these generics
|
||||
| ^^^----- help: remove the unnecessary generics
|
||||
| |
|
||||
| expected 0 generic arguments
|
||||
|
|
||||
|
|
@ -66,7 +66,7 @@ help: consider moving this generic argument to the `Into` trait, which takes up
|
|||
|
|
||||
LL | let _ = Into::<Option<_>>::into(42);
|
||||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
help: remove these generics
|
||||
help: remove the unnecessary generics
|
||||
|
|
||||
LL - let _ = 42.into::<Option<_>>();
|
||||
LL + let _ = 42.into();
|
||||
|
|
|
|||
|
|
@ -14,5 +14,5 @@ fn main() {
|
|||
1.bar::<i32>(0);
|
||||
//~^ ERROR method takes 0 generic arguments but 1 generic argument was supplied
|
||||
//~| HELP consider moving this generic argument to the `Foo` trait, which takes up to 1 argument
|
||||
//~| HELP remove these generics
|
||||
//~| HELP remove the unnecessary generics
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ help: consider moving this generic argument to the `Foo` trait, which takes up t
|
|||
|
|
||||
LL | Foo::<i32>::bar(1, 0);
|
||||
| ~~~~~~~~~~~~~~~~~~~~~
|
||||
help: remove these generics
|
||||
help: remove the unnecessary generics
|
||||
|
|
||||
LL - 1.bar::<i32>(0);
|
||||
LL + 1.bar(0);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,39 @@
|
|||
// Regression test for #127441
|
||||
|
||||
// Tests that we make the correct suggestion
|
||||
// in case there are more than one `?Sized`
|
||||
// bounds on a function parameter
|
||||
|
||||
use std::fmt::Debug;
|
||||
|
||||
fn foo1<T: ?Sized>(a: T) {}
|
||||
//~^ ERROR he size for values of type `T` cannot be known at compilation time
|
||||
|
||||
fn foo2<T: ?Sized + ?Sized>(a: T) {}
|
||||
//~^ ERROR type parameter has more than one relaxed default bound, only one is supported
|
||||
//~| ERROR the size for values of type `T` cannot be known at compilation time
|
||||
|
||||
fn foo3<T: ?Sized + ?Sized + Debug>(a: T) {}
|
||||
//~^ ERROR type parameter has more than one relaxed default bound, only one is supported
|
||||
//~| ERROR he size for values of type `T` cannot be known at compilation time
|
||||
|
||||
fn foo4<T: ?Sized + Debug + ?Sized >(a: T) {}
|
||||
//~^ ERROR type parameter has more than one relaxed default bound, only one is supported
|
||||
//~| ERROR the size for values of type `T` cannot be known at compilation time
|
||||
|
||||
fn foo5(_: impl ?Sized) {}
|
||||
//~^ ERROR the size for values of type `impl ?Sized` cannot be known at compilation time
|
||||
|
||||
fn foo6(_: impl ?Sized + ?Sized) {}
|
||||
//~^ ERROR type parameter has more than one relaxed default bound, only one is supported
|
||||
//~| ERROR the size for values of type `impl ?Sized + ?Sized` cannot be known at compilation tim
|
||||
|
||||
fn foo7(_: impl ?Sized + ?Sized + Debug) {}
|
||||
//~^ ERROR type parameter has more than one relaxed default bound, only one is supported
|
||||
//~| ERROR the size for values of type `impl ?Sized + ?Sized + Debug` cannot be known at compilation time
|
||||
|
||||
fn foo8(_: impl ?Sized + Debug + ?Sized ) {}
|
||||
//~^ ERROR type parameter has more than one relaxed default bound, only one is supported
|
||||
//~| ERROR the size for values of type `impl ?Sized + Debug + ?Sized` cannot be known at compilation time
|
||||
|
||||
fn main() {}
|
||||
|
|
@ -0,0 +1,192 @@
|
|||
error[E0203]: type parameter has more than one relaxed default bound, only one is supported
|
||||
--> $DIR/bad-suggestionf-for-repeated-unsized-bound-127441.rs:12:12
|
||||
|
|
||||
LL | fn foo2<T: ?Sized + ?Sized>(a: T) {}
|
||||
| ^^^^^^ ^^^^^^
|
||||
|
||||
error[E0203]: type parameter has more than one relaxed default bound, only one is supported
|
||||
--> $DIR/bad-suggestionf-for-repeated-unsized-bound-127441.rs:16:12
|
||||
|
|
||||
LL | fn foo3<T: ?Sized + ?Sized + Debug>(a: T) {}
|
||||
| ^^^^^^ ^^^^^^
|
||||
|
||||
error[E0203]: type parameter has more than one relaxed default bound, only one is supported
|
||||
--> $DIR/bad-suggestionf-for-repeated-unsized-bound-127441.rs:20:12
|
||||
|
|
||||
LL | fn foo4<T: ?Sized + Debug + ?Sized >(a: T) {}
|
||||
| ^^^^^^ ^^^^^^
|
||||
|
||||
error[E0203]: type parameter has more than one relaxed default bound, only one is supported
|
||||
--> $DIR/bad-suggestionf-for-repeated-unsized-bound-127441.rs:27:17
|
||||
|
|
||||
LL | fn foo6(_: impl ?Sized + ?Sized) {}
|
||||
| ^^^^^^ ^^^^^^
|
||||
|
||||
error[E0203]: type parameter has more than one relaxed default bound, only one is supported
|
||||
--> $DIR/bad-suggestionf-for-repeated-unsized-bound-127441.rs:31:17
|
||||
|
|
||||
LL | fn foo7(_: impl ?Sized + ?Sized + Debug) {}
|
||||
| ^^^^^^ ^^^^^^
|
||||
|
||||
error[E0203]: type parameter has more than one relaxed default bound, only one is supported
|
||||
--> $DIR/bad-suggestionf-for-repeated-unsized-bound-127441.rs:35:17
|
||||
|
|
||||
LL | fn foo8(_: impl ?Sized + Debug + ?Sized ) {}
|
||||
| ^^^^^^ ^^^^^^
|
||||
|
||||
error[E0277]: the size for values of type `T` cannot be known at compilation time
|
||||
--> $DIR/bad-suggestionf-for-repeated-unsized-bound-127441.rs:9:20
|
||||
|
|
||||
LL | fn foo1<T: ?Sized>(a: T) {}
|
||||
| - ^ doesn't have a size known at compile-time
|
||||
| |
|
||||
| this type parameter needs to be `Sized`
|
||||
|
|
||||
= help: unsized fn params are gated as an unstable feature
|
||||
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
||||
|
|
||||
LL - fn foo1<T: ?Sized>(a: T) {}
|
||||
LL + fn foo1<T>(a: T) {}
|
||||
|
|
||||
help: function arguments must have a statically known size, borrowed types always have a known size
|
||||
|
|
||||
LL | fn foo1<T: ?Sized>(a: &T) {}
|
||||
| +
|
||||
|
||||
error[E0277]: the size for values of type `T` cannot be known at compilation time
|
||||
--> $DIR/bad-suggestionf-for-repeated-unsized-bound-127441.rs:12:29
|
||||
|
|
||||
LL | fn foo2<T: ?Sized + ?Sized>(a: T) {}
|
||||
| - ^ doesn't have a size known at compile-time
|
||||
| |
|
||||
| this type parameter needs to be `Sized`
|
||||
|
|
||||
= help: unsized fn params are gated as an unstable feature
|
||||
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
||||
|
|
||||
LL - fn foo2<T: ?Sized + ?Sized>(a: T) {}
|
||||
LL + fn foo2<T>(a: T) {}
|
||||
|
|
||||
help: function arguments must have a statically known size, borrowed types always have a known size
|
||||
|
|
||||
LL | fn foo2<T: ?Sized + ?Sized>(a: &T) {}
|
||||
| +
|
||||
|
||||
error[E0277]: the size for values of type `T` cannot be known at compilation time
|
||||
--> $DIR/bad-suggestionf-for-repeated-unsized-bound-127441.rs:16:37
|
||||
|
|
||||
LL | fn foo3<T: ?Sized + ?Sized + Debug>(a: T) {}
|
||||
| - ^ doesn't have a size known at compile-time
|
||||
| |
|
||||
| this type parameter needs to be `Sized`
|
||||
|
|
||||
= help: unsized fn params are gated as an unstable feature
|
||||
help: consider restricting type parameters
|
||||
|
|
||||
LL - fn foo3<T: ?Sized + ?Sized + Debug>(a: T) {}
|
||||
LL + fn foo3<T: Debug>(a: T) {}
|
||||
|
|
||||
help: function arguments must have a statically known size, borrowed types always have a known size
|
||||
|
|
||||
LL | fn foo3<T: ?Sized + ?Sized + Debug>(a: &T) {}
|
||||
| +
|
||||
|
||||
error[E0277]: the size for values of type `T` cannot be known at compilation time
|
||||
--> $DIR/bad-suggestionf-for-repeated-unsized-bound-127441.rs:20:38
|
||||
|
|
||||
LL | fn foo4<T: ?Sized + Debug + ?Sized >(a: T) {}
|
||||
| - ^ doesn't have a size known at compile-time
|
||||
| |
|
||||
| this type parameter needs to be `Sized`
|
||||
|
|
||||
= help: unsized fn params are gated as an unstable feature
|
||||
help: consider restricting type parameters
|
||||
|
|
||||
LL - fn foo4<T: ?Sized + Debug + ?Sized >(a: T) {}
|
||||
LL + fn foo4<T: Debug >(a: T) {}
|
||||
|
|
||||
help: function arguments must have a statically known size, borrowed types always have a known size
|
||||
|
|
||||
LL | fn foo4<T: ?Sized + Debug + ?Sized >(a: &T) {}
|
||||
| +
|
||||
|
||||
error[E0277]: the size for values of type `impl ?Sized` cannot be known at compilation time
|
||||
--> $DIR/bad-suggestionf-for-repeated-unsized-bound-127441.rs:24:9
|
||||
|
|
||||
LL | fn foo5(_: impl ?Sized) {}
|
||||
| ^ ----------- this type parameter needs to be `Sized`
|
||||
| |
|
||||
| doesn't have a size known at compile-time
|
||||
|
|
||||
= help: unsized fn params are gated as an unstable feature
|
||||
help: consider replacing `?Sized` with `Sized`
|
||||
|
|
||||
LL - fn foo5(_: impl ?Sized) {}
|
||||
LL + fn foo5(_: impl Sized) {}
|
||||
|
|
||||
help: function arguments must have a statically known size, borrowed types always have a known size
|
||||
|
|
||||
LL | fn foo5(_: &impl ?Sized) {}
|
||||
| +
|
||||
|
||||
error[E0277]: the size for values of type `impl ?Sized + ?Sized` cannot be known at compilation time
|
||||
--> $DIR/bad-suggestionf-for-repeated-unsized-bound-127441.rs:27:9
|
||||
|
|
||||
LL | fn foo6(_: impl ?Sized + ?Sized) {}
|
||||
| ^ -------------------- this type parameter needs to be `Sized`
|
||||
| |
|
||||
| doesn't have a size known at compile-time
|
||||
|
|
||||
= help: unsized fn params are gated as an unstable feature
|
||||
help: consider restricting type parameters
|
||||
|
|
||||
LL - fn foo6(_: impl ?Sized + ?Sized) {}
|
||||
LL + fn foo6(_: impl Sized) {}
|
||||
|
|
||||
help: function arguments must have a statically known size, borrowed types always have a known size
|
||||
|
|
||||
LL | fn foo6(_: &impl ?Sized + ?Sized) {}
|
||||
| +
|
||||
|
||||
error[E0277]: the size for values of type `impl ?Sized + ?Sized + Debug` cannot be known at compilation time
|
||||
--> $DIR/bad-suggestionf-for-repeated-unsized-bound-127441.rs:31:9
|
||||
|
|
||||
LL | fn foo7(_: impl ?Sized + ?Sized + Debug) {}
|
||||
| ^ ---------------------------- this type parameter needs to be `Sized`
|
||||
| |
|
||||
| doesn't have a size known at compile-time
|
||||
|
|
||||
= help: unsized fn params are gated as an unstable feature
|
||||
help: consider restricting type parameters
|
||||
|
|
||||
LL - fn foo7(_: impl ?Sized + ?Sized + Debug) {}
|
||||
LL + fn foo7(_: impl Debug) {}
|
||||
|
|
||||
help: function arguments must have a statically known size, borrowed types always have a known size
|
||||
|
|
||||
LL | fn foo7(_: &impl ?Sized + ?Sized + Debug) {}
|
||||
| +
|
||||
|
||||
error[E0277]: the size for values of type `impl ?Sized + Debug + ?Sized` cannot be known at compilation time
|
||||
--> $DIR/bad-suggestionf-for-repeated-unsized-bound-127441.rs:35:9
|
||||
|
|
||||
LL | fn foo8(_: impl ?Sized + Debug + ?Sized ) {}
|
||||
| ^ ---------------------------- this type parameter needs to be `Sized`
|
||||
| |
|
||||
| doesn't have a size known at compile-time
|
||||
|
|
||||
= help: unsized fn params are gated as an unstable feature
|
||||
help: consider restricting type parameters
|
||||
|
|
||||
LL - fn foo8(_: impl ?Sized + Debug + ?Sized ) {}
|
||||
LL + fn foo8(_: impl Debug ) {}
|
||||
|
|
||||
help: function arguments must have a statically known size, borrowed types always have a known size
|
||||
|
|
||||
LL | fn foo8(_: &impl ?Sized + Debug + ?Sized ) {}
|
||||
| +
|
||||
|
||||
error: aborting due to 14 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0203, E0277.
|
||||
For more information about an error, try `rustc --explain E0203`.
|
||||
|
|
@ -117,7 +117,7 @@ error[E0107]: struct takes 1 generic argument but 2 generic arguments were suppl
|
|||
--> $DIR/116464-invalid-assoc-type-suggestion-in-trait-impl.rs:40:58
|
||||
|
|
||||
LL | impl<T: Trait<u32, Assoc=String>, U> YetAnotherTrait for Struct<T, U> {}
|
||||
| ^^^^^^ - help: remove this generic argument
|
||||
| ^^^^^^ --- help: remove the unnecessary generic argument
|
||||
| |
|
||||
| expected 1 generic argument
|
||||
|
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
fn strip_lf(s: &str) -> &str {
|
||||
s.strip_suffix(b'\n').unwrap_or(s)
|
||||
//~^ ERROR expected a `FnMut(char)` closure, found `u8`
|
||||
//~| NOTE expected an `FnMut(char)` closure, found `u8`
|
||||
//~| HELP the trait `FnMut(char)` is not implemented for `u8`
|
||||
//~| HELP the following other types implement trait `Pattern<'a>`:
|
||||
//~| NOTE required for `u8` to implement `Pattern<'_>`
|
||||
|
||||
//~^ ERROR the trait bound `u8: Pattern` is not satisfied
|
||||
//~| NOTE required by a bound introduced by this call
|
||||
//~| NOTE the trait `FnMut(char)` is not implemented for `u8`, which is required by `u8: Pattern`
|
||||
//~| HELP the following other types implement trait `Pattern`:
|
||||
//~| NOTE required for `u8` to implement `Pattern`
|
||||
//~| NOTE required by a bound in `core::str::<impl str>::strip_suffix`
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
error[E0277]: expected a `FnMut(char)` closure, found `u8`
|
||||
--> $DIR/assoc-fn-bound-root-obligation.rs:2:7
|
||||
error[E0277]: the trait bound `u8: Pattern` is not satisfied
|
||||
--> $DIR/assoc-fn-bound-root-obligation.rs:2:20
|
||||
|
|
||||
LL | s.strip_suffix(b'\n').unwrap_or(s)
|
||||
| ^^^^^^^^^^^^ expected an `FnMut(char)` closure, found `u8`
|
||||
| ------------ ^^^^^ the trait `FnMut(char)` is not implemented for `u8`, which is required by `u8: Pattern`
|
||||
| |
|
||||
| required by a bound introduced by this call
|
||||
|
|
||||
= help: the trait `FnMut(char)` is not implemented for `u8`, which is required by `u8: Pattern<'_>`
|
||||
= help: the following other types implement trait `Pattern<'a>`:
|
||||
= help: the following other types implement trait `Pattern`:
|
||||
&'b String
|
||||
&'b [char; N]
|
||||
&'b [char]
|
||||
|
|
@ -13,7 +14,9 @@ LL | s.strip_suffix(b'\n').unwrap_or(s)
|
|||
&'c &'b str
|
||||
[char; N]
|
||||
char
|
||||
= note: required for `u8` to implement `Pattern<'_>`
|
||||
= note: required for `u8` to implement `Pattern`
|
||||
note: required by a bound in `core::str::<impl str>::strip_suffix`
|
||||
--> $SRC_DIR/core/src/str/mod.rs:LL:COL
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ error[E0107]: struct takes 1 lifetime argument but 2 lifetime arguments were sup
|
|||
--> $DIR/vs-lifetime.rs:11:12
|
||||
|
|
||||
LL | let _: S<'static, 'static>;
|
||||
| ^ ------- help: remove this lifetime argument
|
||||
| ^ --------- help: remove the lifetime argument
|
||||
| |
|
||||
| expected 1 lifetime argument
|
||||
|
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ fn get_vowel_count(string: &str) -> usize {
|
|||
string
|
||||
.chars()
|
||||
.filter(|c| "aeiou".contains(*c))
|
||||
//~^ ERROR the trait bound `&char: Pattern<'_>` is not satisfied
|
||||
//~^ ERROR the trait bound `&char: Pattern` is not satisfied
|
||||
.count()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ fn get_vowel_count(string: &str) -> usize {
|
|||
string
|
||||
.chars()
|
||||
.filter(|c| "aeiou".contains(c))
|
||||
//~^ ERROR the trait bound `&char: Pattern<'_>` is not satisfied
|
||||
//~^ ERROR the trait bound `&char: Pattern` is not satisfied
|
||||
.count()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
error[E0277]: the trait bound `&char: Pattern<'_>` is not satisfied
|
||||
error[E0277]: the trait bound `&char: Pattern` is not satisfied
|
||||
--> $DIR/root-obligation.rs:6:38
|
||||
|
|
||||
LL | .filter(|c| "aeiou".contains(c))
|
||||
| -------- ^ the trait `Fn(char)` is not implemented for `char`, which is required by `&char: Pattern<'_>`
|
||||
| -------- ^ the trait `Fn(char)` is not implemented for `char`, which is required by `&char: Pattern`
|
||||
| |
|
||||
| required by a bound introduced by this call
|
||||
|
|
||||
= note: required for `&char` to implement `FnOnce(char)`
|
||||
= note: required for `&char` to implement `Pattern<'_>`
|
||||
= note: required for `&char` to implement `Pattern`
|
||||
note: required by a bound in `core::str::<impl str>::contains`
|
||||
--> $SRC_DIR/core/src/str/mod.rs:LL:COL
|
||||
help: consider dereferencing here
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue