diff options
| author | bors <bors@rust-lang.org> | 2021-12-08 11:22:02 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-12-08 11:22:02 +0000 |
| commit | 4459e720bee5a741b962cfcd6f0593b32dc19009 (patch) | |
| tree | 8f971851dcee5e588231ca5d7af66e223af47b08 /src | |
| parent | ce0f7baf5651606c706b7014b5abdaa930cf2600 (diff) | |
| parent | 90690dae69b5213fb04b88408ad4d18a7130f40c (diff) | |
| download | rust-4459e720bee5a741b962cfcd6f0593b32dc19009.tar.gz rust-4459e720bee5a741b962cfcd6f0593b32dc19009.zip | |
Auto merge of #91656 - matthiaskrgr:rollup-lk96y6d, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #83744 (Deprecate crate_type and crate_name nested inside #![cfg_attr]) - #90550 (Update certificates in some Ubuntu 16 images.) - #91272 (Print a suggestion when comparing references to primitive types in `const fn`) - #91467 (Emphasise that an OsStr[ing] is not necessarily a platform string) - #91531 (Do not add `;` to expected tokens list when it's wrong) - #91577 (Address some FIXMEs left over from #91475) - #91638 (Remove `in_band_lifetimes` from `rustc_mir_transform`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src')
25 files changed, 246 insertions, 34 deletions
diff --git a/src/ci/docker/host-x86_64/dist-aarch64-linux/Dockerfile b/src/ci/docker/host-x86_64/dist-aarch64-linux/Dockerfile index e6b6b6e53b9..ab588ccc249 100644 --- a/src/ci/docker/host-x86_64/dist-aarch64-linux/Dockerfile +++ b/src/ci/docker/host-x86_64/dist-aarch64-linux/Dockerfile @@ -1,5 +1,18 @@ +FROM ubuntu:20.04 +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + curl \ + ca-certificates +WORKDIR /tmp +RUN curl -f https://curl.se/ca/cacert.pem -o cacert.pem + FROM ubuntu:16.04 +# The ca-certificates in ubuntu-16 is too old, so update the certificates +# with something more recent. +COPY --from=0 /tmp/cacert.pem /tmp/cacert.pem +ENV CURL_CA_BUNDLE /tmp/cacert.pem + COPY scripts/cross-apt-packages.sh /scripts/ RUN sh /scripts/cross-apt-packages.sh diff --git a/src/ci/docker/host-x86_64/dist-arm-linux/Dockerfile b/src/ci/docker/host-x86_64/dist-arm-linux/Dockerfile index 61cc000dca5..ee4fd759b46 100644 --- a/src/ci/docker/host-x86_64/dist-arm-linux/Dockerfile +++ b/src/ci/docker/host-x86_64/dist-arm-linux/Dockerfile @@ -1,5 +1,18 @@ +FROM ubuntu:20.04 +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + curl \ + ca-certificates +WORKDIR /tmp +RUN curl -f https://curl.se/ca/cacert.pem -o cacert.pem + FROM ubuntu:16.04 +# The ca-certificates in ubuntu-16 is too old, so update the certificates +# with something more recent. +COPY --from=0 /tmp/cacert.pem /tmp/cacert.pem +ENV CURL_CA_BUNDLE /tmp/cacert.pem + COPY scripts/cross-apt-packages.sh /scripts/ RUN sh /scripts/cross-apt-packages.sh diff --git a/src/ci/docker/host-x86_64/dist-armhf-linux/Dockerfile b/src/ci/docker/host-x86_64/dist-armhf-linux/Dockerfile index 66eb4137a87..b11a1d3feb2 100644 --- a/src/ci/docker/host-x86_64/dist-armhf-linux/Dockerfile +++ b/src/ci/docker/host-x86_64/dist-armhf-linux/Dockerfile @@ -1,5 +1,18 @@ +FROM ubuntu:20.04 +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + curl \ + ca-certificates +WORKDIR /tmp +RUN curl -f https://curl.se/ca/cacert.pem -o cacert.pem + FROM ubuntu:16.04 +# The ca-certificates in ubuntu-16 is too old, so update the certificates +# with something more recent. +COPY --from=0 /tmp/cacert.pem /tmp/cacert.pem +ENV CURL_CA_BUNDLE /tmp/cacert.pem + COPY scripts/cross-apt-packages.sh /scripts/ RUN sh /scripts/cross-apt-packages.sh diff --git a/src/ci/docker/host-x86_64/dist-armv7-linux/Dockerfile b/src/ci/docker/host-x86_64/dist-armv7-linux/Dockerfile index c13f63911f8..55ca23b293d 100644 --- a/src/ci/docker/host-x86_64/dist-armv7-linux/Dockerfile +++ b/src/ci/docker/host-x86_64/dist-armv7-linux/Dockerfile @@ -1,5 +1,18 @@ +FROM ubuntu:20.04 +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + curl \ + ca-certificates +WORKDIR /tmp +RUN curl -f https://curl.se/ca/cacert.pem -o cacert.pem + FROM ubuntu:16.04 +# The ca-certificates in ubuntu-16 is too old, so update the certificates +# with something more recent. +COPY --from=0 /tmp/cacert.pem /tmp/cacert.pem +ENV CURL_CA_BUNDLE /tmp/cacert.pem + COPY scripts/cross-apt-packages.sh /scripts/ RUN sh /scripts/cross-apt-packages.sh diff --git a/src/test/ui/cfg/auxiliary/crate-attributes-using-cfg_attr.rs b/src/test/ui/cfg/auxiliary/crate-attributes-using-cfg_attr.rs deleted file mode 100644 index 1e0f5d79c0b..00000000000 --- a/src/test/ui/cfg/auxiliary/crate-attributes-using-cfg_attr.rs +++ /dev/null @@ -1,6 +0,0 @@ -// no-prefer-dynamic -// compile-flags: --cfg foo - -#![cfg_attr(foo, crate_type="lib")] - -pub fn foo() {} diff --git a/src/test/ui/cfg/crate-attributes-using-cfg_attr.rs b/src/test/ui/cfg/crate-attributes-using-cfg_attr.rs deleted file mode 100644 index 43b266b778f..00000000000 --- a/src/test/ui/cfg/crate-attributes-using-cfg_attr.rs +++ /dev/null @@ -1,6 +0,0 @@ -// run-pass -// aux-build:crate-attributes-using-cfg_attr.rs - -extern crate crate_attributes_using_cfg_attr; - -pub fn main() {} diff --git a/src/test/ui/cfg/future-compat-crate-attributes-using-cfg_attr.rs b/src/test/ui/cfg/future-compat-crate-attributes-using-cfg_attr.rs new file mode 100644 index 00000000000..ef12b05fab2 --- /dev/null +++ b/src/test/ui/cfg/future-compat-crate-attributes-using-cfg_attr.rs @@ -0,0 +1,12 @@ +// check-fail +// compile-flags:--cfg foo + +#![deny(warnings)] +#![cfg_attr(foo, crate_type="bin")] +//~^ERROR `crate_type` within +//~| WARN this was previously accepted +#![cfg_attr(foo, crate_name="bar")] +//~^ERROR `crate_name` within +//~| WARN this was previously accepted + +fn main() {} diff --git a/src/test/ui/cfg/future-compat-crate-attributes-using-cfg_attr.stderr b/src/test/ui/cfg/future-compat-crate-attributes-using-cfg_attr.stderr new file mode 100644 index 00000000000..5df2eacc96e --- /dev/null +++ b/src/test/ui/cfg/future-compat-crate-attributes-using-cfg_attr.stderr @@ -0,0 +1,26 @@ +error: `crate_type` within an `#![cfg_attr] attribute is deprecated` + --> $DIR/future-compat-crate-attributes-using-cfg_attr.rs:5:18 + | +LL | #![cfg_attr(foo, crate_type="bin")] + | ^^^^^^^^^^^^^^^^ + | +note: the lint level is defined here + --> $DIR/future-compat-crate-attributes-using-cfg_attr.rs:4:9 + | +LL | #![deny(warnings)] + | ^^^^^^^^ + = note: `#[deny(deprecated_cfg_attr_crate_type_name)]` implied by `#[deny(warnings)]` + = 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 #91632 <https://github.com/rust-lang/rust/issues/91632> + +error: `crate_name` within an `#![cfg_attr] attribute is deprecated` + --> $DIR/future-compat-crate-attributes-using-cfg_attr.rs:8:18 + | +LL | #![cfg_attr(foo, crate_name="bar")] + | ^^^^^^^^^^^^^^^^ + | + = 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 #91632 <https://github.com/rust-lang/rust/issues/91632> + +error: aborting due to 2 previous errors + diff --git a/src/test/ui/consts/issue-90870.fixed b/src/test/ui/consts/issue-90870.fixed new file mode 100644 index 00000000000..e767effcdd0 --- /dev/null +++ b/src/test/ui/consts/issue-90870.fixed @@ -0,0 +1,34 @@ +// Regression test for issue #90870. + +// run-rustfix + +#![allow(dead_code)] + +const fn f(a: &u8, b: &u8) -> bool { + *a == *b + //~^ ERROR: calls in constant functions are limited to constant functions, tuple structs and tuple variants [E0015] + //~| HELP: consider dereferencing here +} + +const fn g(a: &&&&i64, b: &&&&i64) -> bool { + ****a == ****b + //~^ ERROR: calls in constant functions are limited to constant functions, tuple structs and tuple variants [E0015] + //~| HELP: consider dereferencing here +} + +const fn h(mut a: &[u8], mut b: &[u8]) -> bool { + while let ([l, at @ ..], [r, bt @ ..]) = (a, b) { + if *l == *r { + //~^ ERROR: calls in constant functions are limited to constant functions, tuple structs and tuple variants [E0015] + //~| HELP: consider dereferencing here + a = at; + b = bt; + } else { + return false; + } + } + + a.is_empty() && b.is_empty() +} + +fn main() {} diff --git a/src/test/ui/consts/issue-90870.rs b/src/test/ui/consts/issue-90870.rs new file mode 100644 index 00000000000..35b3c8242aa --- /dev/null +++ b/src/test/ui/consts/issue-90870.rs @@ -0,0 +1,34 @@ +// Regression test for issue #90870. + +// run-rustfix + +#![allow(dead_code)] + +const fn f(a: &u8, b: &u8) -> bool { + a == b + //~^ ERROR: calls in constant functions are limited to constant functions, tuple structs and tuple variants [E0015] + //~| HELP: consider dereferencing here +} + +const fn g(a: &&&&i64, b: &&&&i64) -> bool { + a == b + //~^ ERROR: calls in constant functions are limited to constant functions, tuple structs and tuple variants [E0015] + //~| HELP: consider dereferencing here +} + +const fn h(mut a: &[u8], mut b: &[u8]) -> bool { + while let ([l, at @ ..], [r, bt @ ..]) = (a, b) { + if l == r { + //~^ ERROR: calls in constant functions are limited to constant functions, tuple structs and tuple variants [E0015] + //~| HELP: consider dereferencing here + a = at; + b = bt; + } else { + return false; + } + } + + a.is_empty() && b.is_empty() +} + +fn main() {} diff --git a/src/test/ui/consts/issue-90870.stderr b/src/test/ui/consts/issue-90870.stderr new file mode 100644 index 00000000000..0e33e6ebe5a --- /dev/null +++ b/src/test/ui/consts/issue-90870.stderr @@ -0,0 +1,36 @@ +error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants + --> $DIR/issue-90870.rs:8:5 + | +LL | a == b + | ^^^^^^ + | +help: consider dereferencing here + | +LL | *a == *b + | + + + +error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants + --> $DIR/issue-90870.rs:14:5 + | +LL | a == b + | ^^^^^^ + | +help: consider dereferencing here + | +LL | ****a == ****b + | ++++ ++++ + +error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants + --> $DIR/issue-90870.rs:21:12 + | +LL | if l == r { + | ^^^^^^ + | +help: consider dereferencing here + | +LL | if *l == *r { + | + + + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0015`. diff --git a/src/test/ui/fn/fn-recover-return-sign2.rs b/src/test/ui/fn/fn-recover-return-sign2.rs index b6a6a1ec2a6..31f56565c49 100644 --- a/src/test/ui/fn/fn-recover-return-sign2.rs +++ b/src/test/ui/fn/fn-recover-return-sign2.rs @@ -3,6 +3,6 @@ fn foo() => impl Fn() => bool { //~^ ERROR return types are denoted using `->` - //~| ERROR expected one of `+`, `->`, `::`, `;`, `where`, or `{`, found `=>` + //~| ERROR expected one of `+`, `->`, `::`, `where`, or `{`, found `=>` unimplemented!() } diff --git a/src/test/ui/fn/fn-recover-return-sign2.stderr b/src/test/ui/fn/fn-recover-return-sign2.stderr index d62cacd4bf5..25ee8dd0c5d 100644 --- a/src/test/ui/fn/fn-recover-return-sign2.stderr +++ b/src/test/ui/fn/fn-recover-return-sign2.stderr @@ -4,11 +4,11 @@ error: return types are denoted using `->` LL | fn foo() => impl Fn() => bool { | ^^ help: use `->` instead -error: expected one of `+`, `->`, `::`, `;`, `where`, or `{`, found `=>` +error: expected one of `+`, `->`, `::`, `where`, or `{`, found `=>` --> $DIR/fn-recover-return-sign2.rs:4:23 | LL | fn foo() => impl Fn() => bool { - | ^^ expected one of `+`, `->`, `::`, `;`, `where`, or `{` + | ^^ expected one of `+`, `->`, `::`, `where`, or `{` error: aborting due to 2 previous errors diff --git a/src/test/ui/parser/issues/issue-24780.rs b/src/test/ui/parser/issues/issue-24780.rs index 480d9bc2bad..017521f570c 100644 --- a/src/test/ui/parser/issues/issue-24780.rs +++ b/src/test/ui/parser/issues/issue-24780.rs @@ -2,7 +2,7 @@ // to happen in #24780. For example, following should be an error: // expected one of ..., `>`, ... found `>`. -fn foo() -> Vec<usize>> { //~ ERROR expected one of `!`, `+`, `::`, `;`, `where`, or `{`, found `>` +fn foo() -> Vec<usize>> { //~ ERROR expected one of `!`, `+`, `::`, `where`, or `{`, found `>` Vec::new() } diff --git a/src/test/ui/parser/issues/issue-24780.stderr b/src/test/ui/parser/issues/issue-24780.stderr index bdd089bb7a1..d9470191b25 100644 --- a/src/test/ui/parser/issues/issue-24780.stderr +++ b/src/test/ui/parser/issues/issue-24780.stderr @@ -1,8 +1,8 @@ -error: expected one of `!`, `+`, `::`, `;`, `where`, or `{`, found `>` +error: expected one of `!`, `+`, `::`, `where`, or `{`, found `>` --> $DIR/issue-24780.rs:5:23 | LL | fn foo() -> Vec<usize>> { - | ^ expected one of `!`, `+`, `::`, `;`, `where`, or `{` + | ^ expected one of `!`, `+`, `::`, `where`, or `{` error: aborting due to previous error diff --git a/src/test/ui/parser/issues/issue-58856-1.rs b/src/test/ui/parser/issues/issue-58856-1.rs index 332a3014416..ea80eb8714f 100644 --- a/src/test/ui/parser/issues/issue-58856-1.rs +++ b/src/test/ui/parser/issues/issue-58856-1.rs @@ -2,7 +2,7 @@ impl A { //~^ ERROR cannot find type `A` in this scope fn b(self> //~^ ERROR expected one of `)`, `,`, or `:`, found `>` - //~| ERROR expected one of `->`, `;`, `where`, or `{`, found `>` + //~| ERROR expected one of `->`, `where`, or `{`, found `>` } fn main() {} diff --git a/src/test/ui/parser/issues/issue-58856-1.stderr b/src/test/ui/parser/issues/issue-58856-1.stderr index 2afb26d1758..96151f3fe07 100644 --- a/src/test/ui/parser/issues/issue-58856-1.stderr +++ b/src/test/ui/parser/issues/issue-58856-1.stderr @@ -6,14 +6,14 @@ LL | fn b(self> | | | unclosed delimiter -error: expected one of `->`, `;`, `where`, or `{`, found `>` +error: expected one of `->`, `where`, or `{`, found `>` --> $DIR/issue-58856-1.rs:3:14 | LL | impl A { | - while parsing this item list starting here LL | LL | fn b(self> - | ^ expected one of `->`, `;`, `where`, or `{` + | ^ expected one of `->`, `where`, or `{` ... LL | } | - the item list ends here diff --git a/src/test/ui/parser/issues/issue-84148-1.stderr b/src/test/ui/parser/issues/issue-84148-1.stderr index 98506568d82..77f0896e9c1 100644 --- a/src/test/ui/parser/issues/issue-84148-1.stderr +++ b/src/test/ui/parser/issues/issue-84148-1.stderr @@ -13,11 +13,11 @@ LL | fn f(t:for<>t?) | expected one of `(`, `)`, `+`, `,`, `::`, or `<` | help: missing `,` -error: expected one of `->`, `;`, `where`, or `{`, found `<eof>` +error: expected one of `->`, `where`, or `{`, found `<eof>` --> $DIR/issue-84148-1.rs:1:15 | LL | fn f(t:for<>t?) - | ^ expected one of `->`, `;`, `where`, or `{` + | ^ expected one of `->`, `where`, or `{` error: aborting due to 3 previous errors diff --git a/src/test/ui/parser/issues/issue-84148-2.stderr b/src/test/ui/parser/issues/issue-84148-2.stderr index 6f314da4360..396208316df 100644 --- a/src/test/ui/parser/issues/issue-84148-2.stderr +++ b/src/test/ui/parser/issues/issue-84148-2.stderr @@ -21,11 +21,11 @@ LL | fn f(t:for<>t? | expected one of `(`, `)`, `+`, `,`, `::`, or `<` | help: missing `,` -error: expected one of `->`, `;`, `where`, or `{`, found `<eof>` +error: expected one of `->`, `where`, or `{`, found `<eof>` --> $DIR/issue-84148-2.rs:4:16 | LL | fn f(t:for<>t? - | ^ expected one of `->`, `;`, `where`, or `{` + | ^ expected one of `->`, `where`, or `{` error: aborting due to 4 previous errors diff --git a/src/test/ui/parser/issues/issue-87635.rs b/src/test/ui/parser/issues/issue-87635.rs index da74c1877b1..f70a87fb0e8 100644 --- a/src/test/ui/parser/issues/issue-87635.rs +++ b/src/test/ui/parser/issues/issue-87635.rs @@ -2,8 +2,8 @@ struct Foo {} impl Foo { pub fn bar() - //~^ ERROR: expected `;`, found `}` - //~| ERROR: associated function in `impl` without body + //~^ ERROR: associated function in `impl` without body } +//~^ERROR expected one of `->`, `where`, or `{`, found `}` fn main() {} diff --git a/src/test/ui/parser/issues/issue-87635.stderr b/src/test/ui/parser/issues/issue-87635.stderr index 920a9f937dd..0a52d0687b2 100644 --- a/src/test/ui/parser/issues/issue-87635.stderr +++ b/src/test/ui/parser/issues/issue-87635.stderr @@ -1,11 +1,13 @@ -error: expected `;`, found `}` - --> $DIR/issue-87635.rs:4:17 +error: expected one of `->`, `where`, or `{`, found `}` + --> $DIR/issue-87635.rs:6:1 | LL | pub fn bar() - | ^ help: add `;` here -... + | --- - expected one of `->`, `where`, or `{` + | | + | while parsing this `fn` +LL | LL | } - | - unexpected token + | ^ unexpected token error: associated function in `impl` without body --> $DIR/issue-87635.rs:4:5 diff --git a/src/test/ui/parser/missing_right_paren.stderr b/src/test/ui/parser/missing_right_paren.stderr index 22e1c2f97e7..3fe0d0f4273 100644 --- a/src/test/ui/parser/missing_right_paren.stderr +++ b/src/test/ui/parser/missing_right_paren.stderr @@ -22,11 +22,11 @@ error: expected one of `:` or `|`, found `)` LL | fn main((ؼ | ^ expected one of `:` or `|` -error: expected one of `->`, `;`, `where`, or `{`, found `<eof>` +error: expected one of `->`, `where`, or `{`, found `<eof>` --> $DIR/missing_right_paren.rs:3:11 | LL | fn main((ؼ - | ^ expected one of `->`, `;`, `where`, or `{` + | ^ expected one of `->`, `where`, or `{` error: aborting due to 4 previous errors diff --git a/src/test/ui/suggestions/suggest-semicolon-for-fn-in-extern-block.fixed b/src/test/ui/suggestions/suggest-semicolon-for-fn-in-extern-block.fixed new file mode 100644 index 00000000000..5c55566ffe9 --- /dev/null +++ b/src/test/ui/suggestions/suggest-semicolon-for-fn-in-extern-block.fixed @@ -0,0 +1,9 @@ +// run-rustfix + +#[allow(dead_code)] + +extern "C" { + fn foo(); //~ERROR expected `;` +} + +fn main() {} diff --git a/src/test/ui/suggestions/suggest-semicolon-for-fn-in-extern-block.rs b/src/test/ui/suggestions/suggest-semicolon-for-fn-in-extern-block.rs new file mode 100644 index 00000000000..91971cba3e8 --- /dev/null +++ b/src/test/ui/suggestions/suggest-semicolon-for-fn-in-extern-block.rs @@ -0,0 +1,9 @@ +// run-rustfix + +#[allow(dead_code)] + +extern "C" { + fn foo() //~ERROR expected `;` +} + +fn main() {} diff --git a/src/test/ui/suggestions/suggest-semicolon-for-fn-in-extern-block.stderr b/src/test/ui/suggestions/suggest-semicolon-for-fn-in-extern-block.stderr new file mode 100644 index 00000000000..c5df72c4a47 --- /dev/null +++ b/src/test/ui/suggestions/suggest-semicolon-for-fn-in-extern-block.stderr @@ -0,0 +1,10 @@ +error: expected `;`, found `}` + --> $DIR/suggest-semicolon-for-fn-in-extern-block.rs:6:11 + | +LL | fn foo() + | ^ help: add `;` here +LL | } + | - unexpected token + +error: aborting due to previous error + |
