Auto merge of #54457 - pietroalbini:rollup, r=pietroalbini
Rollup of 16 pull requests Successful merges: - #53652 (define copy_within on slices) - #54261 (Make `dyn` a keyword in the 2018 edition) - #54280 (remove (more) CAS API from Atomic* types where not natively supported) - #54323 (rustbuild: drop color handling) - #54350 (Support specifying edition in doc test) - #54370 (Improve handling of type bounds in `bit_set.rs`.) - #54371 (add -Zui-testing to rustdoc) - #54374 (Make 'proc_macro::MultiSpan' public.) - #54402 (Use no_default_libraries for all NetBSD flavors) - #54409 (Detect `for _ in in bar {}` typo) - #54412 (add applicability to span_suggestion call) - #54413 (Add UI test for deref recursion limit printing twice) - #54415 (parser: Tweak function parameter parsing to avoid rollback on succesfull path) - #54420 (Compress `Liveness` data some more.) - #54422 (Simplify slice's first(_mut) and last(_mut) with get) - #54446 (Unify christianpoveda's emails) Failed merges: - #54058 (Introduce the partition_dedup/by/by_key methods for slices) r? @ghost
This commit is contained in:
commit
af50e3822c
44 changed files with 911 additions and 446 deletions
|
|
@ -2,16 +2,20 @@ error: expected `{`, found `and`
|
|||
--> $DIR/issue-54109-and_instead_of_ampersands.rs:14:10
|
||||
|
|
||||
LL | if a and b {
|
||||
| -- ^^^ help: use `&&` instead of `and` for the boolean operator
|
||||
| |
|
||||
| -- ^^^
|
||||
| | |
|
||||
| | expected `{`
|
||||
| | help: use `&&` instead of `and` for the boolean operator
|
||||
| this `if` statement has a condition, but no block
|
||||
|
||||
error: expected `{`, found `or`
|
||||
--> $DIR/issue-54109-and_instead_of_ampersands.rs:23:10
|
||||
|
|
||||
LL | if a or b {
|
||||
| -- ^^ help: use `||` instead of `or` for the boolean operator
|
||||
| |
|
||||
| -- ^^
|
||||
| | |
|
||||
| | expected `{`
|
||||
| | help: use `||` instead of `or` for the boolean operator
|
||||
| this `if` statement has a condition, but no block
|
||||
|
||||
error: expected one of `!`, `)`, `,`, `.`, `::`, `?`, `{`, or an operator, found `and`
|
||||
|
|
|
|||
46
src/test/ui/issues/issue-38940.rs
Normal file
46
src/test/ui/issues/issue-38940.rs
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
// issue-38940: error printed twice for deref recursion limit exceeded
|
||||
// Test that the recursion limit can be changed. In this case, we have
|
||||
// deeply nested types that will fail the `Send` check by overflow
|
||||
// when the recursion limit is set very low.
|
||||
#![allow(dead_code)]
|
||||
#![recursion_limit="10"]
|
||||
macro_rules! link {
|
||||
($outer:ident, $inner:ident) => {
|
||||
struct $outer($inner);
|
||||
impl $outer {
|
||||
fn new() -> $outer {
|
||||
$outer($inner::new())
|
||||
}
|
||||
}
|
||||
impl std::ops::Deref for $outer {
|
||||
type Target = $inner;
|
||||
fn deref(&self) -> &$inner {
|
||||
&self.0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
struct Bottom;
|
||||
impl Bottom {
|
||||
fn new() -> Bottom {
|
||||
Bottom
|
||||
}
|
||||
}
|
||||
link!(Top, A);
|
||||
link!(A, B);
|
||||
link!(B, C);
|
||||
link!(C, D);
|
||||
link!(D, E);
|
||||
link!(E, F);
|
||||
link!(F, G);
|
||||
link!(G, H);
|
||||
link!(H, I);
|
||||
link!(I, J);
|
||||
link!(J, K);
|
||||
link!(K, Bottom);
|
||||
fn main() {
|
||||
let t = Top::new();
|
||||
let x: &Bottom = &t;
|
||||
//~^ ERROR mismatched types
|
||||
//~| ERROR reached the recursion limit while auto-dereferencing I
|
||||
}
|
||||
21
src/test/ui/issues/issue-38940.stderr
Normal file
21
src/test/ui/issues/issue-38940.stderr
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
error[E0055]: reached the recursion limit while auto-dereferencing I
|
||||
--> $DIR/issue-38940.rs:43:22
|
||||
|
|
||||
LL | let x: &Bottom = &t;
|
||||
| ^^ deref recursion limit reached
|
||||
|
|
||||
= help: consider adding a `#![recursion_limit="20"]` attribute to your crate
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-38940.rs:43:22
|
||||
|
|
||||
LL | let x: &Bottom = &t;
|
||||
| ^^ expected struct `Bottom`, found struct `Top`
|
||||
|
|
||||
= note: expected type `&Bottom`
|
||||
found type `&Top`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
Some errors occurred: E0055, E0308.
|
||||
For more information about an error, try `rustc --explain E0055`.
|
||||
5
src/test/ui/parser/if-in-in.rs
Normal file
5
src/test/ui/parser/if-in-in.rs
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
fn main() {
|
||||
for i in in 1..2 {
|
||||
println!("{}", i);
|
||||
}
|
||||
}
|
||||
13
src/test/ui/parser/if-in-in.stderr
Normal file
13
src/test/ui/parser/if-in-in.stderr
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
error: expected iterable, found keyword `in`
|
||||
--> $DIR/if-in-in.rs:2:14
|
||||
|
|
||||
LL | for i in in 1..2 {
|
||||
| ---^^
|
||||
| |
|
||||
| help: remove the duplicated `in`
|
||||
|
|
||||
= note: if you meant to use emplacement syntax, it is obsolete (for now, anyway)
|
||||
= note: for more information on the status of emplacement syntax, see <https://github.com/rust-lang/rust/issues/27779#issuecomment-378416911>
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
10
src/test/ui/rust-2018/dyn-keyword.fixed
Normal file
10
src/test/ui/rust-2018/dyn-keyword.fixed
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
// edition:2015
|
||||
// run-rustfix
|
||||
|
||||
#![allow(unused_variables)]
|
||||
#![deny(keyword_idents)]
|
||||
|
||||
fn main() {
|
||||
let r#dyn = (); //~ ERROR dyn
|
||||
//~^ WARN hard error in the 2018 edition
|
||||
}
|
||||
10
src/test/ui/rust-2018/dyn-keyword.rs
Normal file
10
src/test/ui/rust-2018/dyn-keyword.rs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
// edition:2015
|
||||
// run-rustfix
|
||||
|
||||
#![allow(unused_variables)]
|
||||
#![deny(keyword_idents)]
|
||||
|
||||
fn main() {
|
||||
let dyn = (); //~ ERROR dyn
|
||||
//~^ WARN hard error in the 2018 edition
|
||||
}
|
||||
16
src/test/ui/rust-2018/dyn-keyword.stderr
Normal file
16
src/test/ui/rust-2018/dyn-keyword.stderr
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
error: `dyn` is a keyword in the 2018 edition
|
||||
--> $DIR/dyn-keyword.rs:8:9
|
||||
|
|
||||
LL | let dyn = (); //~ ERROR dyn
|
||||
| ^^^ help: you can use a raw identifier to stay compatible: `r#dyn`
|
||||
|
|
||||
note: lint level defined here
|
||||
--> $DIR/dyn-keyword.rs:5:9
|
||||
|
|
||||
LL | #![deny(keyword_idents)]
|
||||
| ^^^^^^^^^^^^^^
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
|
||||
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
8
src/test/ui/rust-2018/dyn-trait-compatibility.rs
Normal file
8
src/test/ui/rust-2018/dyn-trait-compatibility.rs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
// edition:2018
|
||||
|
||||
type A0 = dyn;
|
||||
type A1 = dyn::dyn; //~ERROR expected identifier, found reserved keyword
|
||||
type A2 = dyn<dyn, dyn>; //~ERROR expected identifier, found `<`
|
||||
type A3 = dyn<<dyn as dyn>::dyn>;
|
||||
|
||||
fn main() {}
|
||||
14
src/test/ui/rust-2018/dyn-trait-compatibility.stderr
Normal file
14
src/test/ui/rust-2018/dyn-trait-compatibility.stderr
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
error: expected identifier, found reserved keyword `dyn`
|
||||
--> $DIR/dyn-trait-compatibility.rs:4:16
|
||||
|
|
||||
LL | type A1 = dyn::dyn; //~ERROR expected identifier, found reserved keyword
|
||||
| ^^^ expected identifier, found reserved keyword
|
||||
|
||||
error: expected identifier, found `<`
|
||||
--> $DIR/dyn-trait-compatibility.rs:5:14
|
||||
|
|
||||
LL | type A2 = dyn<dyn, dyn>; //~ERROR expected identifier, found `<`
|
||||
| ^ expected identifier
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue