diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/bootstrap/compile.rs | 11 | ||||
| -rw-r--r-- | src/doc/unstable-book/src/library-features/asm.md | 6 | ||||
| -rw-r--r-- | src/test/assembly/asm/arm-modifiers.rs | 6 | ||||
| -rw-r--r-- | src/test/assembly/asm/arm-types.rs | 30 | ||||
| -rw-r--r-- | src/test/ui/feature-gates/feature-gate-concat_bytes.rs | 4 | ||||
| -rw-r--r-- | src/test/ui/feature-gates/feature-gate-concat_bytes.stderr | 12 | ||||
| -rw-r--r-- | src/test/ui/macros/concat-bytes-error.rs | 42 | ||||
| -rw-r--r-- | src/test/ui/macros/concat-bytes-error.stderr | 131 | ||||
| -rw-r--r-- | src/test/ui/macros/concat-bytes.rs | 7 | ||||
| -rw-r--r-- | src/test/ui/parser/issues/issue-91461.rs | 6 | ||||
| -rw-r--r-- | src/test/ui/parser/issues/issue-91461.stderr | 31 |
11 files changed, 245 insertions, 41 deletions
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs index 007ca9f7f5a..186b5e92d33 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs @@ -28,6 +28,7 @@ use crate::dist; use crate::native; use crate::tool::SourceType; use crate::util::{exe, is_debug_info, is_dylib, symlink_dir}; +use crate::LLVM_TOOLS; use crate::{Compiler, DependencyType, GitRepo, Mode}; #[derive(Debug, PartialOrd, Ord, Copy, Clone, PartialEq, Eq, Hash)] @@ -1164,6 +1165,16 @@ impl Step for Assemble { let llvm_bin_dir = output(Command::new(llvm_config_bin).arg("--bindir")); let llvm_bin_dir = Path::new(llvm_bin_dir.trim()); builder.copy(&llvm_bin_dir.join(&src_exe), &libdir_bin.join(&dst_exe)); + + // Since we've already built the LLVM tools, install them to the sysroot. + // This is the equivalent of installing the `llvm-tools-preview` component via + // rustup, and lets developers use a locally built toolchain to + // build projects that expect llvm tools to be present in the sysroot + // (e.g. the `bootimage` crate). + for tool in LLVM_TOOLS { + let tool_exe = exe(tool, target_compiler.host); + builder.copy(&llvm_bin_dir.join(&tool_exe), &libdir_bin.join(&tool_exe)); + } } } diff --git a/src/doc/unstable-book/src/library-features/asm.md b/src/doc/unstable-book/src/library-features/asm.md index dffa3a8b80f..59987cccde6 100644 --- a/src/doc/unstable-book/src/library-features/asm.md +++ b/src/doc/unstable-book/src/library-features/asm.md @@ -564,12 +564,8 @@ Here is the list of currently supported register classes: | AArch64 | `vreg` | `v[0-31]` | `w` | | AArch64 | `vreg_low16` | `v[0-15]` | `x` | | AArch64 | `preg` | `p[0-15]`, `ffr` | Only clobbers | -| ARM (ARM) | `reg` | `r[0-12]`, `r14` | `r` | -| ARM (Thumb2) | `reg` | `r[0-12]`, `r14` | `r` | +| ARM (ARM/Thumb2) | `reg` | `r[0-12]`, `r14` | `r` | | ARM (Thumb1) | `reg` | `r[0-7]` | `r` | -| ARM (ARM) | `reg_thumb` | `r[0-r12]`, `r14` | `l` | -| ARM (Thumb2) | `reg_thumb` | `r[0-7]` | `l` | -| ARM (Thumb1) | `reg_thumb` | `r[0-7]` | `l` | | ARM | `sreg` | `s[0-31]` | `t` | | ARM | `sreg_low16` | `s[0-15]` | `x` | | ARM | `dreg` | `d[0-31]` | `w` | diff --git a/src/test/assembly/asm/arm-modifiers.rs b/src/test/assembly/asm/arm-modifiers.rs index a6985a3bf5c..88ffeaecfec 100644 --- a/src/test/assembly/asm/arm-modifiers.rs +++ b/src/test/assembly/asm/arm-modifiers.rs @@ -59,12 +59,6 @@ macro_rules! check { // CHECK: @NO_APP check!(reg "" reg i32 "mov"); -// CHECK-LABEL: reg_thumb: -// CHECK: @APP -// CHECK: mov r0, r0 -// CHECK: @NO_APP -check!(reg_thumb "" reg_thumb i32 "mov"); - // CHECK-LABEL: sreg: // CHECK: @APP // CHECK: vmov.f32 s0, s0 diff --git a/src/test/assembly/asm/arm-types.rs b/src/test/assembly/asm/arm-types.rs index 0c57b1fc478..5ac1af6afd6 100644 --- a/src/test/assembly/asm/arm-types.rs +++ b/src/test/assembly/asm/arm-types.rs @@ -163,36 +163,6 @@ check!(reg_f32 f32 reg "mov"); // CHECK: @NO_APP check!(reg_ptr ptr reg "mov"); -// CHECK-LABEL: reg_thumb_i8: -// CHECK: @APP -// CHECK: mov {{[a-z0-9]+}}, {{[a-z0-9]+}} -// CHECK: @NO_APP -check!(reg_thumb_i8 i8 reg_thumb "mov"); - -// CHECK-LABEL: reg_thumb_i16: -// CHECK: @APP -// CHECK: mov {{[a-z0-9]+}}, {{[a-z0-9]+}} -// CHECK: @NO_APP -check!(reg_thumb_i16 i16 reg_thumb "mov"); - -// CHECK-LABEL: reg_thumb_i32: -// CHECK: @APP -// CHECK: mov {{[a-z0-9]+}}, {{[a-z0-9]+}} -// CHECK: @NO_APP -check!(reg_thumb_i32 i32 reg_thumb "mov"); - -// CHECK-LABEL: reg_thumb_f32: -// CHECK: @APP -// CHECK: mov {{[a-z0-9]+}}, {{[a-z0-9]+}} -// CHECK: @NO_APP -check!(reg_thumb_f32 f32 reg_thumb "mov"); - -// CHECK-LABEL: reg_thumb_ptr: -// CHECK: @APP -// CHECK: mov {{[a-z0-9]+}}, {{[a-z0-9]+}} -// CHECK: @NO_APP -check!(reg_thumb_ptr ptr reg_thumb "mov"); - // CHECK-LABEL: sreg_i32: // CHECK: @APP // CHECK: vmov.f32 s{{[0-9]+}}, s{{[0-9]+}} diff --git a/src/test/ui/feature-gates/feature-gate-concat_bytes.rs b/src/test/ui/feature-gates/feature-gate-concat_bytes.rs new file mode 100644 index 00000000000..07d63cb11e0 --- /dev/null +++ b/src/test/ui/feature-gates/feature-gate-concat_bytes.rs @@ -0,0 +1,4 @@ +fn main() { + let a = concat_bytes!(b'A', b"BC"); //~ ERROR use of unstable library feature 'concat_bytes' + assert_eq!(a, &[65, 66, 67]); +} diff --git a/src/test/ui/feature-gates/feature-gate-concat_bytes.stderr b/src/test/ui/feature-gates/feature-gate-concat_bytes.stderr new file mode 100644 index 00000000000..4b3ee4c19ce --- /dev/null +++ b/src/test/ui/feature-gates/feature-gate-concat_bytes.stderr @@ -0,0 +1,12 @@ +error[E0658]: use of unstable library feature 'concat_bytes' + --> $DIR/feature-gate-concat_bytes.rs:2:13 + | +LL | let a = concat_bytes!(b'A', b"BC"); + | ^^^^^^^^^^^^ + | + = note: see issue #87555 <https://github.com/rust-lang/rust/issues/87555> for more information + = help: add `#![feature(concat_bytes)]` to the crate attributes to enable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/macros/concat-bytes-error.rs b/src/test/ui/macros/concat-bytes-error.rs new file mode 100644 index 00000000000..9b4a9c2cf81 --- /dev/null +++ b/src/test/ui/macros/concat-bytes-error.rs @@ -0,0 +1,42 @@ +#![feature(concat_bytes)] + +fn main() { + concat_bytes!(pie); //~ ERROR expected a byte literal + concat_bytes!(pie, pie); //~ ERROR expected a byte literal + concat_bytes!("tnrsi", "tnri"); //~ ERROR cannot concatenate string literals + concat_bytes!(2.8); //~ ERROR cannot concatenate float literals + concat_bytes!(300); //~ ERROR cannot concatenate numeric literals + concat_bytes!('a'); //~ ERROR cannot concatenate character literals + concat_bytes!(true, false); //~ ERROR cannot concatenate boolean literals + concat_bytes!(42, b"va", b'l'); //~ ERROR cannot concatenate numeric literals + concat_bytes!(42, b"va", b'l', [1, 2]); //~ ERROR cannot concatenate numeric literals + concat_bytes!([ + "hi", //~ ERROR cannot concatenate string literals + ]); + concat_bytes!([ + 'a', //~ ERROR cannot concatenate character literals + ]); + concat_bytes!([ + true, //~ ERROR cannot concatenate boolean literals + ]); + concat_bytes!([ + false, //~ ERROR cannot concatenate boolean literals + ]); + concat_bytes!([ + 2.6, //~ ERROR cannot concatenate float literals + ]); + concat_bytes!([ + 265, //~ ERROR numeric literal is out of bounds + ]); + concat_bytes!([ + -33, //~ ERROR expected a byte literal + ]); + concat_bytes!([ + b"hi!", //~ ERROR cannot concatenate doubly nested array + ]); + concat_bytes!([ + [5, 6, 7], //~ ERROR cannot concatenate doubly nested array + ]); + concat_bytes!(5u16); //~ ERROR cannot concatenate numeric literals + concat_bytes!([5u16]); //~ ERROR numeric literal is not a `u8` +} diff --git a/src/test/ui/macros/concat-bytes-error.stderr b/src/test/ui/macros/concat-bytes-error.stderr new file mode 100644 index 00000000000..1fc2d5c4843 --- /dev/null +++ b/src/test/ui/macros/concat-bytes-error.stderr @@ -0,0 +1,131 @@ +error: expected a byte literal + --> $DIR/concat-bytes-error.rs:4:19 + | +LL | concat_bytes!(pie); + | ^^^ + | + = note: only byte literals (like `b"foo"`, `b's'`, and `[3, 4, 5]`) can be passed to `concat_bytes!()` + +error: expected a byte literal + --> $DIR/concat-bytes-error.rs:5:19 + | +LL | concat_bytes!(pie, pie); + | ^^^ ^^^ + | + = note: only byte literals (like `b"foo"`, `b's'`, and `[3, 4, 5]`) can be passed to `concat_bytes!()` + +error: cannot concatenate string literals + --> $DIR/concat-bytes-error.rs:6:19 + | +LL | concat_bytes!("tnrsi", "tnri"); + | ^^^^^^^ help: try using a byte string: `b"tnrsi"` + +error: cannot concatenate float literals + --> $DIR/concat-bytes-error.rs:7:19 + | +LL | concat_bytes!(2.8); + | ^^^ + +error: cannot concatenate numeric literals + --> $DIR/concat-bytes-error.rs:8:19 + | +LL | concat_bytes!(300); + | ^^^ help: try wrapping the number in an array: `[300]` + +error: cannot concatenate character literals + --> $DIR/concat-bytes-error.rs:9:19 + | +LL | concat_bytes!('a'); + | ^^^ help: try using a byte character: `b'a'` + +error: cannot concatenate boolean literals + --> $DIR/concat-bytes-error.rs:10:19 + | +LL | concat_bytes!(true, false); + | ^^^^ + +error: cannot concatenate numeric literals + --> $DIR/concat-bytes-error.rs:11:19 + | +LL | concat_bytes!(42, b"va", b'l'); + | ^^ help: try wrapping the number in an array: `[42]` + +error: cannot concatenate numeric literals + --> $DIR/concat-bytes-error.rs:12:19 + | +LL | concat_bytes!(42, b"va", b'l', [1, 2]); + | ^^ help: try wrapping the number in an array: `[42]` + +error: cannot concatenate string literals + --> $DIR/concat-bytes-error.rs:14:9 + | +LL | "hi", + | ^^^^ + +error: cannot concatenate character literals + --> $DIR/concat-bytes-error.rs:17:9 + | +LL | 'a', + | ^^^ help: try using a byte character: `b'a'` + +error: cannot concatenate boolean literals + --> $DIR/concat-bytes-error.rs:20:9 + | +LL | true, + | ^^^^ + +error: cannot concatenate boolean literals + --> $DIR/concat-bytes-error.rs:23:9 + | +LL | false, + | ^^^^^ + +error: cannot concatenate float literals + --> $DIR/concat-bytes-error.rs:26:9 + | +LL | 2.6, + | ^^^ + +error: numeric literal is out of bounds + --> $DIR/concat-bytes-error.rs:29:9 + | +LL | 265, + | ^^^ + +error: expected a byte literal + --> $DIR/concat-bytes-error.rs:32:9 + | +LL | -33, + | ^^^ + | + = note: only byte literals (like `b"foo"`, `b's'`, and `[3, 4, 5]`) can be passed to `concat_bytes!()` + +error: cannot concatenate doubly nested array + --> $DIR/concat-bytes-error.rs:35:9 + | +LL | b"hi!", + | ^^^^^^ + | + = note: byte strings are treated as arrays of bytes + = help: try flattening the array + +error: cannot concatenate doubly nested array + --> $DIR/concat-bytes-error.rs:38:9 + | +LL | [5, 6, 7], + | ^^^^^^^^^ + +error: cannot concatenate numeric literals + --> $DIR/concat-bytes-error.rs:40:19 + | +LL | concat_bytes!(5u16); + | ^^^^ help: try wrapping the number in an array: `[5u16]` + +error: numeric literal is not a `u8` + --> $DIR/concat-bytes-error.rs:41:20 + | +LL | concat_bytes!([5u16]); + | ^^^^ + +error: aborting due to 20 previous errors + diff --git a/src/test/ui/macros/concat-bytes.rs b/src/test/ui/macros/concat-bytes.rs new file mode 100644 index 00000000000..5415cf3fe22 --- /dev/null +++ b/src/test/ui/macros/concat-bytes.rs @@ -0,0 +1,7 @@ +// run-pass +#![feature(concat_bytes)] + +fn main() { + assert_eq!(concat_bytes!(), &[]); + assert_eq!(concat_bytes!(b'A', b"BC", [68, b'E', 70]), b"ABCDEF"); +} diff --git a/src/test/ui/parser/issues/issue-91461.rs b/src/test/ui/parser/issues/issue-91461.rs new file mode 100644 index 00000000000..3e3c411c478 --- /dev/null +++ b/src/test/ui/parser/issues/issue-91461.rs @@ -0,0 +1,6 @@ +fn main() { + a(_:b:,) + //~^ ERROR: expected identifier, found reserved identifier `_` + //~| ERROR: expected type, found `,` + //~| ERROR: expected type, found `,` +} diff --git a/src/test/ui/parser/issues/issue-91461.stderr b/src/test/ui/parser/issues/issue-91461.stderr new file mode 100644 index 00000000000..94fcf1721d8 --- /dev/null +++ b/src/test/ui/parser/issues/issue-91461.stderr @@ -0,0 +1,31 @@ +error: expected identifier, found reserved identifier `_` + --> $DIR/issue-91461.rs:2:7 + | +LL | a(_:b:,) + | ^ expected identifier, found reserved identifier + +error: expected type, found `,` + --> $DIR/issue-91461.rs:2:11 + | +LL | a(_:b:,) + | - -^ expected type + | | | + | | tried to parse a type due to this type ascription + | while parsing this struct + | + = note: `#![feature(type_ascription)]` lets you annotate an expression with a type: `<expr>: <type>` + = note: see issue #23416 <https://github.com/rust-lang/rust/issues/23416> for more information + +error: expected type, found `,` + --> $DIR/issue-91461.rs:2:11 + | +LL | a(_:b:,) + | -^ expected type + | | + | tried to parse a type due to this type ascription + | + = note: `#![feature(type_ascription)]` lets you annotate an expression with a type: `<expr>: <type>` + = note: see issue #23416 <https://github.com/rust-lang/rust/issues/23416> for more information + +error: aborting due to 3 previous errors + |
