summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2022-04-04switch channel to stablePietro Albini-1/+1
2022-03-30backport #94925lcnr-1/+22
2022-03-18remove statement that was forgotten when backporting #94438Michael Goulet-1/+8
2022-03-18Fix cmake build.Eric Huss-3/+3
(cherry picked from commit 8322cdb1da257652bf663ae335b190dc129e479f)
2022-03-17Do not recover from `Ty?` in macro parsingEsteban Kuber-0/+23
Follow up to #92746. Address #94510. (cherry picked from commit 004f2ed219378235c24a5d6bdb34337200e6eeed)
2022-03-17Revert accidental stabilizationOli Scherer-0/+15
(cherry picked from commit 5f7ca55df6a89e3caa3131a13490cc01956149e7)
2022-03-17Update the bootstrap compiler to 1.59.0Josh Stone-340/+283
2022-03-14only check method inputs onceMichael Goulet-8/+37
2022-03-14bootstrap: correct reading of flags for llvmJon Gjengset-29/+70
First, this reverts the `CFLAGS`/`CXXFLAGS` of #93918. Those flags are already read by `cc` and populated into `Build` earlier on in the process. We shouldn't be overriding that based on `CFLAGS`, since `cc` also respects overrides like `CFLAGS_{TARGET}` and `HOST_CFLAGS`, which we want to take into account. Second, this adds the same capability to specify target-specific versions of `LDFLAGS` as we have through `cc` for the `C*` flags: https://github.com/alexcrichton/cc-rs#external-configuration-via-environment-variables Note that this also necessitated an update to compiletest to treat CXXFLAGS separately from CFLAGS.
2022-03-14delay bug instead of skipping check_exprMichael Goulet-0/+34
2022-03-14Downgrade `#[test]` on macro call to warningEsteban Kuber-27/+15
Follow up to #92959. Address #94508.
2022-03-14Statically compile libstdc++ everywhere if askedJon Gjengset-12/+12
PR #93918 made it so that `-static-libstdc++` was only set in one place, and was only set during linking, but accidentally also made it so that it is no longer passed when building LLD or sanitizers, only when building LLVM itself. This moves the logic for setting `-static-libstdc++` in the linker flags back to `configure_cmake` so that it takes effect for all CMake invocations in `native.rs`. As a side-effect, this also causes libstdc++ to be statically compiled into sanitizers and LLD if `llvm-tools-enabled` is set but `llvm-static-stdcpp` is not, even though previously it was only linked statically if `llvm-static-stdcpp` was set explicitly. But that seems more like the expected behavior anyway.
2022-03-14Enable issue-23036.rs on wasm32Nikita Popov-1/+0
2022-03-14Update LLVM submoduleNikita Popov-0/+0
2022-03-07Auto merge of #94552 - lcnr:fix-94502, r=oli-obkbors-0/+45
[beta] backport fix for #94502 this issue was fixed as part of #93368, so i extracted the change from there closes #94502
2022-03-07backport fix for #94502lcnr-0/+45
2022-03-02Auto merge of #93516 - nagisa:branch-protection, r=cjgillotbors-25/+47
No branch protection metadata unless enabled Even if we emit metadata disabling branch protection, this metadata may conflict with other modules (e.g. during LTO) that have different branch protection metadata set. This is an unstable flag and feature, so ideally the flag not being specified should act as if the feature wasn't implemented in the first place. Additionally this PR also ensures we emit an error if `-Zbranch-protection` is set on targets other than the supported aarch64. For now the error is being output from codegen, but ideally it should be moved to earlier in the pipeline before stabilization.
2022-03-02Rollup merge of #94315 - lcnr:auto-trait-lint-update, r=oli-obkDylan DPC-7/+32
update auto trait lint for `PhantomData` cc https://github.com/rust-lang/rust/issues/93367#issuecomment-1047898410
2022-03-02[beta] Update cargoEric Huss-0/+0
2022-02-21Temporarily avoid errors on RLS failure in parallelMark Rousskov-0/+6
2022-02-21Fix up unused imports in rustfmt testsMark Rousskov-5/+4
2022-02-21Branch 1.60 betaMark Rousskov-1/+1
2022-02-19Rollup merge of #94086 - tmiasko:char-try-from-scalar-int, r=davidtwcoMatthias Krüger-18/+38
Fix ScalarInt to char conversion to avoid panic for invalid Unicode scalar values
2022-02-19Rollup merge of #93990 - lcnr:pre-89862-cleanup, r=estebankMatthias Krüger-4/+4
pre #89862 cleanup changes used in #89862 which can be landed without the rest of this PR being finished. r? `@estebank`
2022-02-19Rollup merge of #93954 - aDotInTheVoid:json-buffer, r=Mark-SimulacrumMatthias Krüger-3/+6
rustdoc-json: buffer output It turns out we were doing syscalls for each part of the json syntax Before: ``` ... [pid 1801267] write(5, "\"", 1) = 1 [pid 1801267] write(5, ",", 1) = 1 [pid 1801267] write(5, "\"", 1) = 1 ... ``` After: ``` [pid 1974821] write(5, "{\"root\":\"0:0\",\"crate_version\":nu"..., 1575) = 1575 ``` In one benchmark (one struct, almost all time in `std`), this gives ~2x perf r? `@CraftSpider` `@rustbot` modify labels: +A-rustdoc-json +T-rustdoc -A-testsuite
2022-02-19Rollup merge of #93658 - cchiw:issue-77443-fix, r=joshtriplettMatthias Krüger-74/+2
Stabilize `#[cfg(panic = "...")]` [Stabilization PR](https://rustc-dev-guide.rust-lang.org/stabilization_guide.html#stabilization-pr) for #77443
2022-02-19Auto merge of #94134 - matthiaskrgr:rollup-b132kjz, r=matthiaskrgrbors-393/+744
Rollup of 10 pull requests Successful merges: - #89892 (Suggest `impl Trait` return type when incorrectly using a generic return type) - #91675 (Add MemTagSanitizer Support) - #92806 (Add more information to `impl Trait` error) - #93497 (Pass `--test` flag through rustdoc to rustc so `#[test]` functions can be scraped) - #93814 (mips64-openwrt-linux-musl: correct soft-foat) - #93847 (kmc-solid: Use the filesystem thread-safety wrapper) - #93877 (asm: Allow the use of r8-r14 as clobbers on Thumb1) - #93892 (Only mark projection as ambiguous if GAT substs are constrained) - #93915 (Implement --check-cfg option (RFC 3013), take 2) - #93953 (Add the `known-bug` test directive, use it, and do some cleanup) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-02-18Auto merge of #94050 - michaelwoerister:fix-unsized-tuple-debuginfo, r=pnkfelixbors-0/+23
debuginfo: Support fat pointers to unsized tuples. This PR makes fat pointer debuginfo generation handle the case of unsized tuples. Fixes #93871
2022-02-18Rollup merge of #93953 - jackh726:known_bug, r=Mark-SimulacrumMatthias Krüger-248/+218
Add the `known-bug` test directive, use it, and do some cleanup cc rust-lang/compiler-team#476 Now tests can be annotated with `known-bug`, which should indicate that the test *should* pass (or at least that the current output is a bug). Adding it relaxes the requirement to add error annotations to the test (though it is still allowed). In the future, this could be extended with further relaxations - with the goal to make adding these tests need minimal effort. I've used this attribute for the GAT tests added in #93757. Finally, I've also cleaned up `header.rs` in compiletest a bit, by extracting out a bit of common logic. I've also split out some of the directives into their own consts. This removes a lot of very similar functions from `Config` and makes `TestProps::load_from` read nicer. I've split these into separate commits, so I in theory could split these into separate PRs if they're controversial, but I think they're pretty straightforward. r? ``@Mark-Simulacrum``
2022-02-18Rollup merge of #93915 - Urgau:rfc-3013, r=petrochenkovMatthias Krüger-1/+106
Implement --check-cfg option (RFC 3013), take 2 This pull-request implement RFC 3013: Checking conditional compilation at compile time (https://github.com/rust-lang/rfcs/pull/3013) and is based on the previous attempt https://github.com/rust-lang/rust/pull/89346 by `@mwkmwkmwk` that was closed due to inactivity. I have address all the review comments from the previous attempt and added some more tests. cc https://github.com/rust-lang/rust/issues/82450 r? `@petrochenkov`
2022-02-18Rollup merge of #93892 - compiler-errors:issue-92917, r=jackh726,nikomatsakisMatthias Krüger-10/+37
Only mark projection as ambiguous if GAT substs are constrained A slightly more targeted version of #92917, where we only give up with ambiguity if we infer something about the GATs substs when probing for a projection candidate. fixes #93874 also note (but like the previous PR, does not fix) #91762 r? `@jackh726` cc `@nikomatsakis` who reviewed #92917
2022-02-18Rollup merge of #93497 - willcrichton:rustdoc-scrape-test, r=GuillaumeGomezMatthias Krüger-5/+37
Pass `--test` flag through rustdoc to rustc so `#[test]` functions can be scraped As a part of stabilizing the scrape examples extension in Cargo, I uncovered a bug where examples cannot be scraped from tests. See this test: https://github.com/rust-lang/cargo/pull/10343/files#diff-27aa4f012ebfebaaee61498d91d2370de460628405d136b05e77efe61e044679R2496 The issue is that when rustdoc is run on a test file, because `--test` is not passed as a rustc option, then functions annotated with `#[test]` are ignored by the compiler. So this PR changes rustdoc so when `--test` is passed in conjunction with a `--scrape-example-<suffix>` flag, then the `test` field of `rustc_interface::Config` is true. r? `@camelid`
2022-02-18Rollup merge of #92806 - compiler-errors:better-impl-trait-deny, r=estebankMatthias Krüger-126/+126
Add more information to `impl Trait` error Fixes #92458 Let me know if I went overboard here, or if the suggestions could use some refinement. r? `@estebank` Feel free to reassign to someone else
2022-02-18Rollup merge of #91675 - ivanloz:memtagsan, r=nagisaMatthias Krüger-3/+36
Add MemTagSanitizer Support Add support for the LLVM [MemTagSanitizer](https://llvm.org/docs/MemTagSanitizer.html). On hardware which supports it (see caveats below), the MemTagSanitizer can catch bugs similar to AddressSanitizer and HardwareAddressSanitizer, but with lower overhead. On a tag mismatch, a SIGSEGV is signaled with code SEGV_MTESERR / SEGV_MTEAERR. # Usage `-Zsanitizer=memtag -C target-feature="+mte"` # Comments/Caveats * MemTagSanitizer is only supported on AArch64 targets with hardware support * Requires `-C target-feature="+mte"` * LLVM MemTagSanitizer currently only performs stack tagging. # TODO * Tests * Example
2022-02-18Rollup merge of #89892 - Nilstrieb:suggest-return-impl-trait, r=jackh726Matthias Krüger-0/+184
Suggest `impl Trait` return type when incorrectly using a generic return type Address #85991 When there is a type mismatch error and the return type is generic, and that generic parameter is not used in the function parameters, suggest replacing that generic with the `impl Trait` syntax. r? `@estebank`
2022-02-18Suggest `impl Trait` return typeNilstrieb-0/+184
Address #85991 Suggest the `impl Trait` return type syntax if the user tried to return a generic parameter and we get a type mismatch The suggestion is not emitted if the param appears in the function parameters, and only get the bounds that actually involve `T: ` directly It also checks whether the generic param is contained in any where bound (where it isn't the self type), and if one is found (like `Option<T>: Send`), it is not suggested. This also adds `TyS::contains`, which recursively vistits the type and looks if the other type is contained anywhere
2022-02-18Rollup merge of #93024 - compiler-errors:inline-mir-bad-bounds, r=estebankMatthias Krüger-0/+22
Do not ICE when inlining a function with un-satisfiable bounds Fixes #93008 This is kinda a hack... but it's the fix I thought had the least blast-radius. We use `normalize_param_env_or_error` to verify that the predicates in the param env are self-consistent, since with RevealAll, a bad predicate like `<&'static () as Clone>` will be evaluated with an empty ParamEnv (since it references no generics), and we'll raise an error for it.
2022-02-18Rollup merge of #92959 - asquared31415:test-non-fn-help, r=estebankMatthias Krüger-35/+265
Add more info and suggestions to use of #[test] on invalid items This pr changes the diagnostics for using `#[test]` on an item that can't be used as a test to explain that the attribute has no meaningful effect on non-functions and suggests the use of `#[cfg(test)]` for conditional compilation instead. Example change: ```rs #[test] mod test {} ``` previously output ``` error: only functions may be used as tests --> src/lib.rs:2:1 | 2 | mod test {} | ^^^^^^^^^^^ ``` now outputs ``` error: the `#[test]` attribute may only be used on a non-associated function --> $DIR/test-on-not-fn.rs:3:1 | LL | #[test] | ^^^^^^^ LL | mod test {} | ----------- expected a non-associated function, found a module | = note: the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions help: replace with conditional compilation to make the item only exist when tests are being run | LL | #[cfg(test)] | ~~~~~~~~~~~~ ```
2022-02-18Rollup merge of #92933 - bjorn3:no_bin_lib_mixing, r=estebankMatthias Krüger-14/+2
Deny mixing bin crate type with lib crate types The produced library would get a main shim too which conflicts with the main shim of the executable linking the library. ``` $ cat > main1.rs <<EOF fn main() {} pub fn bar() {} EOF $ cat > main2.rs <<EOF extern crate main1; fn main() { main1::bar(); } EOF $ rustc --crate-type bin --crate-type lib main1.rs $ rustc -L. main2.rs error: linking with `cc` failed: exit status: 1 [...] = note: /usr/bin/ld: /tmp/crate_bin_lib/libmain1.rlib(main1.main1.707747aa-cgu.0.rcgu.o): in function `main': main1.707747aa-cgu.0:(.text.main+0x0): multiple definition of `main'; main2.main2.02a148fe-cgu.0.rcgu.o:main2.02a148fe-cgu.0:(.text.main+0x0): first defined here collect2: error: ld returned 1 exit status ```
2022-02-18Rollup merge of #92683 - jackh726:issue-92033, r=estebankMatthias Krüger-25/+77
Suggest copying trait associated type bounds on lifetime error Closes #92033 Kind of the most simple suggestion to make - we don't try to be fancy. Turns out, it's still pretty useful (the couple existing tests that trigger this error end up fixed - for this error - upon applying the fix). r? ``@estebank`` cc ``@nikomatsakis``
2022-02-18Auto merge of #93766 - petrochenkov:doclinkregr, r=camelid,GuillaumeGomezbors-0/+44
rustdoc: Collect traits in scope for lang items Inherent impls on primitive types are not included in the list of all inherent impls in the crate (`inherent_impls_in_crate_untracked`), they are taken from the list of lang items instead, but such impls can also be inlined by rustdoc, e.g. if something derefs to a primitive type. r? `@camelid` Fixes https://github.com/rust-lang/rust/issues/93698
2022-02-18rustdoc: Collect traits in scope for lang itemsVadim Petrochenkov-0/+44
2022-02-18Auto merge of #94088 - oli-obk:revert, r=jackh726bors-149/+193
Revert #91403 fixes #94004 r? `@pnkfelix` `@cjgillot`
2022-02-17fix impl trait message, bless testsMichael Goulet-252/+126
2022-02-17Add more information to `impl Trait` deny errorMichael Goulet-120/+246
2022-02-17Rollup merge of #94085 - flip1995:clippy_needless_borrow_temp_fix, r=ManishearthMatthias Krüger-26/+8
Clippy: Don't lint `needless_borrow` in method receiver positions r? `@Manishearth` cc `@camsteffen` `@Jarcho` cc rust-lang/rust-clippy#8441 Let's get this fix in before the beta branching tomorrow.
2022-02-17Rollup merge of #94082 - bjorn3:remove_cfg_platform, r=Mark-SimulacrumMatthias Krüger-6/+0
Remove CFG_PLATFORM It seems to be unused and it is incorrect for arm/aarch64 anyway.
2022-02-17Rollup merge of #94043 - DrMeepster:box_alloc_ice, r=oli-obkMatthias Krüger-0/+6
Fix ICE when using Box<T, A> with pointer sized A Fixes #78459 Note that using `Box<T, A>` with a more than pointer sized `A` or using a pointer sized `A` with a Box of a DST will produce a different ICE (#92054) which is not fixed by this PR.
2022-02-17Rollup merge of #94011 - est31:let_else, r=lcnrMatthias Krüger-21/+7
Even more let_else adoptions Continuation of #89933, #91018, #91481, #93046, #93590.
2022-02-17Rollup merge of #93780 - GuillaumeGomez:links-in-sidebar, r=jshaMatthias Krüger-186/+168
Generate list instead of div items in sidebar Fixes #92986. Surprisingly, we didn't have much CSS for this... [Demo](https://rustdoc.crud.net/imperio/links-in-sidebar/std/index.html). r? `@jsha`