Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 9 pull requests #86960

Closed
wants to merge 112 commits into from
Closed

Conversation

JohnTitor
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

alessandrod and others added 30 commits May 23, 2021 18:03
This change adds the bpfel-unknown-none and bpfeb-unknown-none targets
which can be used to generate little endian and big endian BPF
Both cg_llvm and cg_clif don't override it. cg_spirv does override it,
so it needs to be preserved.
…k(kind = "raw-dylib")].

This does not yet support #[link_name] attributes on functions, the #[link_ordinal]
attribute, #[link(kind = "raw-dylib")] on extern blocks in bin crates, or
stdcall functions on 32-bit x86.
BPF target support

This adds `bpfel-unknown-none` and `bpfeb-unknown-none`, two new no_std targets that generate little and big endian BPF. The approach taken is very similar to the cuda target, where `TargetOptions::obj_is_bitcode` is enabled and code generation is done by the linker.

I added the targets to `dist-various-2`. There are [some tests](https://github.com/alessandrod/bpf-linker/tree/main/tests/assembly) in bpf-linker and I'm planning to add more. Those are currently not ran as part of rust CI.
…enkov

Partial support for raw-dylib linkage

First cut of functionality for issue rust-lang#58713: add support for `#[link(kind = "raw-dylib")]` on `extern` blocks in lib crates compiled to .rlib files.  Does not yet support `#[link_name]` attributes on functions, or the `#[link_ordinal]` attribute, or `#[link(kind = "raw-dylib")]` on `extern` blocks in bin crates; I intend to publish subsequent PRs to fill those gaps.  It's also not yet clear whether this works for functions in `extern "stdcall"` blocks; I also intend to investigate that shortly and make any necessary changes as a follow-on PR.

This implementation calls out to an LLVM function to construct the actual `.idata` sections as temporary `.lib` files on disk and then links those into the generated .rlib.
Driver improvements

This PR contains a couple of cleanups for the driver and a few small improvements for the custom codegen backend interface. It also implements `--version` and `-Cpasses=list` support for custom codegen backends.
…ochenkov

Unify duplicate linker_and_flavor methods in rustc_codegen_{cranelift,ssa}.

The two methods were exactly the same so this removes the cranelift copy. This will help make sure both they don't get out of sync.
Drop metadata_encoding_version.

Part of rust-lang#85153

r? `@Aaron1011`
bjorn3 and others added 19 commits July 7, 2021 11:14
Object started depending on it
This makes `fs::hard_link` use weak! for some platforms,
thereby preventing a linker error.
`weak!` is needed in a test in another module. With macros
1.0, importing `weak!` would require reordering module
declarations in `std/src/lib.rs`, which is a bit too
evil.
On old macos systems, `fs::hard_link()` will follow symlinks.
This changes the test `symlink_hard_link` to exit early on
these systems, so that tests can pass.
…s-hardlink, r=joshtriplett

Fix linker error

Currently, `fs::hard_link` determines whether platforms have `linkat` based on the OS, and uses `link` if they don't. However, this heuristic does not work well if a platform provides `linkat` on newer versions but not on older ones. On old MacOS, this currently causes a linking error.

This commit fixes `fs::hard_link` by telling it to use `weak!` on macOS This means that, on  that operating system, we now check for `linkat` at runtime and use `link` if it is not available.

Fixes rust-lang#80804.

`@rustbot` label T-libs-impl
…e_check_const, r=oli-obk

Checking that function is const if marked with rustc_const_unstable

Fixes rust-lang#69630

This one is still missing tests to check the behavior but I checked by hand and it seemed to work.
I would not mind some direction for writing those unit tests!
…e-error, r=JohnTitor

Add doc comment for `impl From<LayoutError> for TryReserveError`
…Simulacrum

Add self to mailmap

For personal reasons, I would currently prefer to be known by this name.
…jorn3

Sync rustc_codegen_cranelift

The main hightlight this sync is basic support for AArch64. Most things should work on Linux, but there does seem to be an ABI incompatibility causing proc-macros to crash, see https://github.com/bjorn3/rustc_codegen_cranelift/issues/1184. Thanks to `@afonso360` for implementing all Cranelift features that were necessary to compile for AArch64 using cg_clif. Also thanks to `@shamatar` for implementing the `llvm.x86.addcarry.64` and `llvm.x86.subborrow.64` llvm intrinsics used by num-bigint (https://github.com/bjorn3/rustc_codegen_cranelift/pull/1178) and `@eggyal` for implementing multi-threading support for the lazy jit mode. (https://github.com/bjorn3/rustc_codegen_cranelift/pull/1166)

r? `@ghost`

`@rustbot` label +A-codegen +A-cranelift +T-compiler
Fix ICE when misplaced visibility cannot be properly parsed

Fixes rust-lang#86895

The issue was that a failure to parse the visibility was causing the original error to be dropped before being emitted.

The resulting error isn't quite as nice as when the visibility is parsed properly, but I'm not sure which error to prioritize here. Displaying both errors might be too confusing.

r? `@estebank`
…ic-files, r=Manishearth

Clean up rustdoc static files

The `html/static` of rustdoc was starting to be quite a mess... So I moved files in sub-folders to make it easier to follow. Here what remains in `html/static` folder:

```
$ ls
COPYRIGHT.txt  css  fonts  images  js  LICENSE-APACHE.txt  LICENSE-MIT.txt
```

cc `@jyn514`
r? `@Manishearth`
Revert "Add "every" as a doc alias for "all"."

This reverts commit 3545036 (rust-lang#81697) for "every" and closes rust-lang#86554 in kind for "some".

The new [doc alias policy](https://std-dev-guide.rust-lang.org/documentation/doc-alias-policy.html) is that we don't want language-specific aliases like these JavaScript names, and we especially don't want to conflict with real names. While "every" is okay in the latter regard, its natural pair "some" makes a doc-search collision with `Option::Some`.

r? `@m-ou-se`
@rustbot rustbot added the rollup A PR which is a rollup label Jul 7, 2021
@JohnTitor
Copy link
Member Author

@bors r+ p=9 rollup=never

@bors
Copy link
Contributor

bors commented Jul 7, 2021

📌 Commit d7ba25a has been approved by JohnTitor

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jul 7, 2021
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-10 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
.....................................................i.i............................................ 12000/12062
..............................................................
failures:

---- [ui] ui/consts/rustc-const-stability-require-const.rs stdout ----


96 LL | pub extern "stdcall" fn foo_stdcall() {}
98 
- error: aborting due to 7 previous errors
+ warning: use of calling convention not supported on this target
+   --> $DIR/rustc-const-stability-require-const.rs:43:1
+   --> $DIR/rustc-const-stability-require-const.rs:43:1
+    |
+ LL | pub extern "stdcall" fn foo_stdcall() {}
+    |
Some tests failed in compiletest suite=ui mode=ui host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu
+    = note: `#[warn(unsupported_calling_conventions)]` on by default
+    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
---
To only update this specific test, also pass `--test-args consts/rustc-const-stability-require-const.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/consts/rustc-const-stability-require-const.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zemit-future-incompat-report" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/rustc-const-stability-require-const" "-A" "unused" "-Crpath" "-O" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/rustc-const-stability-require-const/auxiliary"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
error: attributes `#[rustc_const_unstable]` and `#[rustc_const_stable]` require the function or method to be `const`
  --> /checkout/src/test/ui/consts/rustc-const-stability-require-const.rs:7:1
   |
LL | #[rustc_const_unstable(feature = "const_foo", issue = "none")]
   | -------------------------------------------------------------- attribute specified here
LL | pub fn foo() {}
   |
help: make the function or method const
  --> /checkout/src/test/ui/consts/rustc-const-stability-require-const.rs:7:1
   |
   |
LL | pub fn foo() {}
   | ^^^^^^^^^^^^

error: attributes `#[rustc_const_unstable]` and `#[rustc_const_stable]` require the function or method to be `const`
  --> /checkout/src/test/ui/consts/rustc-const-stability-require-const.rs:12:1
   |
LL | #[rustc_const_stable(feature = "const_bar", since = "1.0.0")]
   | ------------------------------------------------------------- attribute specified here
LL | pub fn bar() {}
   |
help: make the function or method const
  --> /checkout/src/test/ui/consts/rustc-const-stability-require-const.rs:12:1
   |
   |
LL | pub fn bar() {}
   | ^^^^^^^^^^^^

error: attributes `#[rustc_const_unstable]` and `#[rustc_const_stable]` require the function or method to be `const`
  --> /checkout/src/test/ui/consts/rustc-const-stability-require-const.rs:21:5
   |
LL |     #[rustc_const_unstable(feature = "const_salad", issue = "none")]
   |     ---------------------------------------------------------------- attribute specified here
LL |     pub fn salad(&self) -> &'static str { "mmmmmm" }
   |
help: make the function or method const
  --> /checkout/src/test/ui/consts/rustc-const-stability-require-const.rs:21:5
   |
   |
LL |     pub fn salad(&self) -> &'static str { "mmmmmm" }


error: attributes `#[rustc_const_unstable]` and `#[rustc_const_stable]` require the function or method to be `const`
  --> /checkout/src/test/ui/consts/rustc-const-stability-require-const.rs:26:5
   |
LL |     #[rustc_const_unstable(feature = "const_roasted", issue = "none")]
   |     ------------------------------------------------------------------ attribute specified here
LL |     pub fn roasted(&self) -> &'static str { "mmmmmmmmmm" }
   |
help: make the function or method const
  --> /checkout/src/test/ui/consts/rustc-const-stability-require-const.rs:26:5
   |
   |
LL |     pub fn roasted(&self) -> &'static str { "mmmmmmmmmm" }


error: attributes `#[rustc_const_unstable]` and `#[rustc_const_stable]` require the function or method to be `const`
  --> /checkout/src/test/ui/consts/rustc-const-stability-require-const.rs:32:1
   |
LL | #[rustc_const_stable(feature = "const_bar", since = "1.0.0")]
   | ------------------------------------------------------------- attribute specified here
LL | pub extern "C" fn bar_c() {}
   |
help: make the function or method const
  --> /checkout/src/test/ui/consts/rustc-const-stability-require-const.rs:32:1
   |
   |
LL | pub extern "C" fn bar_c() {}


error: attributes `#[rustc_const_unstable]` and `#[rustc_const_stable]` require the function or method to be `const`
  --> /checkout/src/test/ui/consts/rustc-const-stability-require-const.rs:37:1
   |
LL | #[rustc_const_unstable(feature = "const_foo", issue = "none")]
   | -------------------------------------------------------------- attribute specified here
LL | pub extern "C" fn foo_c() {}
   |
help: make the function or method const
  --> /checkout/src/test/ui/consts/rustc-const-stability-require-const.rs:37:1
   |
   |
LL | pub extern "C" fn foo_c() {}


error: attributes `#[rustc_const_unstable]` and `#[rustc_const_stable]` require the function or method to be `const`
  --> /checkout/src/test/ui/consts/rustc-const-stability-require-const.rs:43:1
   |
LL | #[rustc_const_unstable(feature = "const_foo", issue = "none")]
   | -------------------------------------------------------------- attribute specified here
LL | pub extern "stdcall" fn foo_stdcall() {}
   |
help: make the function or method const
  --> /checkout/src/test/ui/consts/rustc-const-stability-require-const.rs:43:1
   |
   |
LL | pub extern "stdcall" fn foo_stdcall() {}

warning: use of calling convention not supported on this target
  --> /checkout/src/test/ui/consts/rustc-const-stability-require-const.rs:43:1
   |
   |
LL | pub extern "stdcall" fn foo_stdcall() {}
   |
   = note: `#[warn(unsupported_calling_conventions)]` on by default
   = 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 #00000 <https://github.com/rust-lang/rust/issues/00000>
---
test result: FAILED. 11961 passed; 1 failed; 100 ignored; 0 measured; 0 filtered out; finished in 125.76s



command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--suite" "ui" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-10/bin/FileCheck" "--nodejs" "/usr/bin/node" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python3" "--lldb-python" "/usr/bin/python3" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "10.0.0" "--llvm-components" "aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets amdgpu amdgpuasmparser amdgpucodegen amdgpudesc amdgpudisassembler amdgpuinfo amdgpuutils analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter bpf bpfasmparser bpfcodegen bpfdesc bpfdisassembler bpfinfo cfguard codegen core coroutines coverage debuginfocodeview debuginfodwarf debuginfogsym debuginfomsf debuginfopdb demangle dlltooldriver dwarflinker engine executionengine frontendopenmp fuzzmutate globalisel hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo instcombine instrumentation interpreter ipo irreader jitlink lanai lanaiasmparser lanaicodegen lanaidesc lanaidisassembler lanaiinfo libdriver lineeditor linker lto mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts object objectyaml option orcerror orcjit passes perfjitevents powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo riscvutils runtimedyld scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target textapi transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86utils xcore xcorecodegen xcoredesc xcoredisassembler xcoreinfo xray" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--channel" "nightly" "--color" "always"


Build completed unsuccessfully in 0:13:20

@JohnTitor
Copy link
Member Author

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 7, 2021
@JohnTitor JohnTitor closed this Jul 7, 2021
@JohnTitor JohnTitor deleted the rollup-svs6tge branch July 7, 2021 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.