about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2021-04-12Stabilize duration_zero.Mara Bos-7/+2
2021-04-12Auto merge of #84068 - Amanieu:fix_lint, r=lcnrbors-12/+16
Add `bad_asm_style` to HardwiredLints This was missed when the lint was added, which prevents the lint from being ignored with `#[allow]`.
2021-04-12Auto merge of #84095 - infinity0:master, r=Mark-Simulacrumbors-4/+6
bootstrap: check local_rebuild before adding --cfg=bootstrap, closes #84057
2021-04-12Auto merge of #84090 - marmeladema:stabilize-duration-saturating-ops, r=m-ou-sebors-8/+3
Stabilize feature `duration_saturating_ops` FCP here: https://github.com/rust-lang/rust/issues/76416#issuecomment-817201314 Closes #76416 r? `@m-ou-se`
2021-04-12Auto merge of #84085 - m-ou-se:stabilize-atomic-fetch-update, r=kennytmbors-4/+2
Stabilize atomic_fetch_update methods on AtomicBool and AtomicPtr. FCP completed here: https://github.com/rust-lang/rust/issues/78639#issuecomment-817201315
2021-04-12Auto merge of #84112 - Dylan-DPC:rollup-tapsrzz, r=Dylan-DPCbors-332/+671
Rollup of 7 pull requests Successful merges: - #83669 (Issue 81508 fix) - #84014 (Improve trait/impl method discrepancy errors) - #84059 (Bump libc dependency of std to 0.2.93) - #84067 (clean up example on read_to_string) - #84079 (Improve test for `rustdoc::bare_urls` lint) - #84094 (Remove FixedSizeArray) - #84101 (rustdoc: Move crate loader to collect_intra_doc_links::early ) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-04-12Rollup merge of #84101 - jyn514:early-pass, r=ManishearthDylan DPC-133/+220
rustdoc: Move crate loader to collect_intra_doc_links::early This groups the similar code together, and also allows making most of collect_intra_doc_links private again. This builds on https://github.com/rust-lang/rust/pull/84066, but it wouldn't be too hard to base it off master if you want this to land first. Helps with https://github.com/rust-lang/rust/issues/83761. r? manishearth Fixes https://github.com/rust-lang/rust/issues/84046
2021-04-12Rollup merge of #84094 - tmiasko:remove-fixed-size-array, r=m-ou-seDylan DPC-57/+1
Remove FixedSizeArray Remove `FixedSizeArray` trait, it has been superseded by const generics. Closes #27778.
2021-04-12Rollup merge of #84079 - camelid:improve-bare-urls-test, r=jyn514Dylan DPC-18/+80
Improve test for `rustdoc::bare_urls` lint - Rename `url-improvements` test to `bare-urls` - Run rustfix for `bare-urls` test
2021-04-12Rollup merge of #84067 - rust-lang:steveklabnik-patch-1, r=joshtriplettDylan DPC-1/+2
clean up example on read_to_string This is the same thing, but simpler. This came out of a comment from a user: https://news.ycombinator.com/item?id=25318117 but rather than hide the signature of main, I think a `use` plus not including the `'static` makes more sense.
2021-04-12Rollup merge of #84059 - zvirja:update-libc, r=JohnTitorDylan DPC-3/+3
Bump libc dependency of std to 0.2.93 Update `libc` dependency of `std` to the latest version. That allows to consume the https://github.com/rust-lang/libc/pull/2131 fix and fix build for the `mipsel-unknown-linux-uclibc` target. r? `@JohnTitor`
2021-04-12Rollup merge of #84014 - estebank:cool-bears-hot-tip, r=varkorDylan DPC-117/+258
Improve trait/impl method discrepancy errors * Use more accurate spans * Clean up some code by removing previous hack * Provide structured suggestions Structured suggestions are particularly useful for cases where arbitrary self types are used, like in custom `Future`s, because the way to write `self: Pin<&mut Self>` is not necessarily self-evident when first encountered.
2021-04-12Rollup merge of #83669 - kwj2104:issue-81508-fix, r=varkorDylan DPC-3/+107
Issue 81508 fix Fix #81508 **Problem**: When variable name is used incorrectly as path, error and warning point to undeclared/unused name, when in fact the name is used, just incorrectly (should be used as a variable, not part of a path). **Summary for fix**: When path resolution errs, diagnostics checks for variables in ```ValueNS``` that have the same name (e.g., variable rather than path named Foo), and adds additional suggestion that user may actually intend to use the variable name rather than a path. The fix does not suppress or otherwise change the *warning* that results. I did not find a straightforward way in the code to modify this, but would love to make changes here as well with any guidance.
2021-04-11Auto merge of #84100 - sjakobi:77548-reenable-check, r=jyn514bors-5/+3
tidy: Re-enable the "ignoring line length unnecessarily" check Closes #77548.
2021-04-11Move crate loader to collect_intra_doc_links::earlyJoshua Nelson-61/+80
This groups the similar code together, and also allows making most of collect_intra_doc_links private again
2021-04-11Auto merge of #83482 - hyd-dev:uwtable, r=nagisabors-27/+74
Allow using `-C force-unwind-tables=no` when `panic=unwind` It seems LLVM still generates proper unwind tables even there is no `uwtable` attribute, unless I looked at the wrong place :thinking:: https://github.com/llvm/llvm-project/blob/c21016715f0ee4a36affdf7150ac135ca98b0eae/llvm/include/llvm/IR/Function.h#L666 Therefore, I *assume* it's safe to omit `uwtable` even when `panic=unwind`, and this PR removes the restriction that disallows using `-C force-unwind-tables=no` when `panic=unwind`.
2021-04-11tidy: Re-enable the "ignoring file length unnecessarily" checkSimon Jakobi-5/+3
Closes #77548.
2021-04-11Allow using `-C force-unwind-tables=no` when `panic=unwind`hyd-dev-27/+74
2021-04-11Add test to allow bad_asm_styleAmanieu d'Antras-12/+15
2021-04-11bootstrap: check local_rebuild before adding --cfg=bootstrap, closes #84057Ximin Luo-4/+6
2021-04-11Auto merge of #81469 - tweksteen:android_set_message, r=m-ou-sebors-0/+58
android: set abort message Android has the ability to supply an abort message [1]. This message is automatically included in the debug trace, which helps debugging [2]. Modify panic_abort to populate this message before calling abort(). [1] https://android.googlesource.com/platform/bionic/+/master/libc/include/android/set_abort_message.h [2] https://source.android.com/devices/tech/debug/native-crash
2021-04-11Stabilize feature `duration_saturating_ops`marmeladema-8/+3
Closes #76416
2021-04-11Auto merge of #84063 - LingMan:patch-1, r=nagisabors-0/+3
Add note about reverting a workaround in the future The root cause was fixed upstream in LLVM main. This adds a reminder to revert the workaround once the LLVM rustc depends on is new enough. Since I'm not sure how such optimizations get routed to LLVM releases, I used the conservative assumption that it will only show up with LLVM 13.
2021-04-11Stabilize atomic_fetch_update methods on AtomicBool and AtomicPtr.Mara Bos-4/+2
2021-04-11Auto merge of #82608 - Aaron1011:feature/final-preexp-tts, r=petrochenkovbors-1187/+2041
Implement token-based handling of attributes during expansion This PR modifies the macro expansion infrastructure to handle attributes in a fully token-based manner. As a result: * Derives macros no longer lose spans when their input is modified by eager cfg-expansion. This is accomplished by performing eager cfg-expansion on the token stream that we pass to the derive proc-macro * Inner attributes now preserve spans in all cases, including when we have multiple inner attributes in a row. This is accomplished through the following changes: * New structs `AttrAnnotatedTokenStream` and `AttrAnnotatedTokenTree` are introduced. These are very similar to a normal `TokenTree`, but they also track the position of attributes and attribute targets within the stream. They are built when we collect tokens during parsing. An `AttrAnnotatedTokenStream` is converted to a regular `TokenStream` when we invoke a macro. * Token capturing and `LazyTokenStream` are modified to work with `AttrAnnotatedTokenStream`. A new `ReplaceRange` type is introduced, which is created during the parsing of a nested AST node to make the 'outer' AST node aware of the attributes and attribute target stored deeper in the token stream. * When we need to perform eager cfg-expansion (either due to `#[derive]` or `#[cfg_eval]`), we tokenize and reparse our target, capturing additional information about the locations of `#[cfg]` and `#[cfg_attr]` attributes at any depth within the target. This is a performance optimization, allowing us to perform less work in the typical case where captured tokens never have eager cfg-expansion run.
2021-04-11Implement token-based handling of attributes during expansionAaron Hill-1187/+2041
This PR modifies the macro expansion infrastructure to handle attributes in a fully token-based manner. As a result: * Derives macros no longer lose spans when their input is modified by eager cfg-expansion. This is accomplished by performing eager cfg-expansion on the token stream that we pass to the derive proc-macro * Inner attributes now preserve spans in all cases, including when we have multiple inner attributes in a row. This is accomplished through the following changes: * New structs `AttrAnnotatedTokenStream` and `AttrAnnotatedTokenTree` are introduced. These are very similar to a normal `TokenTree`, but they also track the position of attributes and attribute targets within the stream. They are built when we collect tokens during parsing. An `AttrAnnotatedTokenStream` is converted to a regular `TokenStream` when we invoke a macro. * Token capturing and `LazyTokenStream` are modified to work with `AttrAnnotatedTokenStream`. A new `ReplaceRange` type is introduced, which is created during the parsing of a nested AST node to make the 'outer' AST node aware of the attributes and attribute target stored deeper in the token stream. * When we need to perform eager cfg-expansion (either due to `#[derive]` or `#[cfg_eval]`), we tokenize and reparse our target, capturing additional information about the locations of `#[cfg]` and `#[cfg_attr]` attributes at any depth within the target. This is a performance optimization, allowing us to perform less work in the typical case where captured tokens never have eager cfg-expansion run.
2021-04-11Auto merge of #83806 - JohnTitor:issue-51446, r=estebankbors-0/+34
Add a regression test for issue-51446 Closes #51446 r? `@estebank`
2021-04-11Auto merge of #84071 - nagisa:nixos-patching-fix, r=Mark-Simulacrumbors-48/+41
Fix NixOS patching Moving the `.nix-deps` has resulted in rpath links being broken and therefore bootstrap on NixOS broken entirely. This PR still produces a `.nix-deps` but only for the purposes of producing a gc root. We rpath a symlink-resolved result instead. For purposes of simplicity we also use joinSymlink to produce a single merged output directory so that we don't need to update multiple locations every time we add a library or something. Fixes a regression from https://github.com/rust-lang/rust/pull/82739.
2021-04-10Preprocess intra-doc links consistentlyJoshua Nelson-92/+160
Previously, rustdoc would panic on links to external crates if they were surrounded by backticks.
2021-04-10Run rustfix for `bare-urls` testCamelid-18/+80
This will help us ensure that it emits valid suggestions.
2021-04-10Rename `url-improvements` test to `bare-urls`Camelid-18/+18
The lint used to be called `non-autolinks`, and linted more than just bare URLs. Now, it is called `bare-urls` and only lints against bare URLs. So, `bare-urls` is a better name for the test.
2021-04-11Auto merge of #84053 - RalfJung:liballoc-miri, r=Manishearthbors-1/+1
fix incorrect Box::from_raw_in doctest Now that Miri can run doctests, I ran it on liballoc, and found exactly one problem: this test creates a `Box<u8>` to deallocate a 4-byte allocation! Introduced by https://github.com/rust-lang/rust/pull/80310 so r? `@Manishearth` `@kennytm`
2021-04-11Remove FixedSizeArrayTomasz Miąsko-57/+1
2021-04-10Auto merge of #84023 - Aaron1011:derive-invoc-order, r=petrochenkovbors-65/+112
Expand derive invocations in left-to-right order While derives were being collected in left-to-order order, the corresponding `Invocation`s were being pushed in the wrong order.
2021-04-10Expand derive invocations in left-to-right orderAaron Hill-65/+112
While derives were being collected in left-to-order order, the corresponding `Invocation`s were being pushed in the wrong order.
2021-04-10Fix NixOS patchingSimonas Kazlauskas-48/+41
Moving the `.nix-deps` has resulted in rpath links being broken and therefore bootstrap on NixOS broken entirely. This PR still produces a `.nix-deps` but only for the purposes of producing a gc root. We rpath a symlink-resolved result instead. For purposes of simplicity we also use joinSymlink to produce a single merged output directory so that we don't need to update multiple locations every time we add a library or something.
2021-04-10Auto merge of #84016 - Aaron1011:new-preexp-tests, r=petrochenkovbors-66/+1199
Add some proc-macro attribute token handling tests Split out from https://github.com/rust-lang/rust/pull/82608 r? `@petrochenkov`
2021-04-10Add some proc-macro attribute token handling testsAaron Hill-66/+1199
2021-04-10Add `bad_asm_style` to HardwiredLintsAmanieu d'Antras-0/+1
2021-04-10clean up example on read_to_stringSteve Klabnik-1/+2
This is the same thing, but simpler.
2021-04-10Add note about reverting a workaround in the futureLingMan-0/+3
The root cause was fixed upstream in LLVM main. This adds a reminder to revert the workaround once the LLVM rustc depends on is new enough. Since I'm not sure how such optimizations get routed to LLVM releases, I used the conservative assumption that it will only show up with LLVM 13.
2021-04-10Auto merge of #84052 - RalfJung:libcore-miri, r=Mark-Simulacrumbors-15/+22
fix Miri errors in libcore doctests Now that Miri can run doctests, it found some issues in the libcore doctests: * The `AtomicPtr` tests accessed dangling memory! `AtomicPtr::new(&mut 10);` makes the `10` a temporary that is deallocated after the end of this expression. * The tests for `set_ptr_value` used `&array[0] as *const _` to get a pointer to the array; this needs to be `array.as_ptr()` instead (Cc https://github.com/rust-lang/unsafe-code-guidelines/issues/134). * I reduced a buffer size in a `MaybeUninit` test to make it less slow in Miri, and added a spin loop hint to fix a diverging loop in Miri.
2021-04-10Bump libc dependency of std to 0.2.93Oleksandr Povar-3/+3
2021-04-10Auto merge of #84055 - kornelski:z-edition, r=petrochenkovbors-8/+11
Don't tell users to use a nightly flag on the stable channel When a crate requires a newer edition, currently rustc tells users to use `-Z unstable-options`. This is not ideal, because: * This flag doesn't work on the stable channel, so solution to one error only causes another error, which is frustrating. * Directs users towards the nightly channel, which is not necessarily the correct solution. Once the next edition is released, this message will be mostly seen by users of out-of-date stable Rust versions who merely need to update their Rust to the latest stable.
2021-04-10Don't tell users to use a nightly flag on the stable channelKornel-8/+11
Hint upgrading to a newer Rust version instead
2021-04-10Auto merge of #84051 - Amanieu:update_llvm, r=nikicbors-0/+0
Update LLVM submodule Fixes #84028
2021-04-10fix incorrect from_raw_in doctestRalf Jung-1/+1
2021-04-10fix Miri errors in libcore doctestsRalf Jung-15/+22
2021-04-10Update LLVM submoduleAmanieu d'Antras-0/+0
2021-04-10Auto merge of #84050 - RalfJung:miri, r=RalfJungbors-10/+8
update Miri Let's ship https://github.com/rust-lang/miri/pull/1761. Cc `@rust-lang/miri` r? `@ghost`