- 07 3月, 2021 16 次提交
-
-
由 bors 提交于
Rollup of 13 pull requests Successful merges: - #77916 (Change built-in kernel targets to be os = none throughout) - #82130 (Make some Option, Result methods unstably const) - #82292 (Prevent specialized ZipImpl from calling `__iterator_get_unchecked` twice with the same index) - #82402 (Remove RefCell around `module_trait_cache`) - #82592 (Improve transmute docs with further clarifications) - #82651 (Cleanup rustdoc warnings) - #82720 (Fix diagnostic suggests adding type `[type error]`) - #82751 (improve offset_from docs) - #82793 (Move some tests to more suitable subdirs) - #82803 (rustdoc: Add an unstable option to print all unversioned files) - #82808 (Sync rustc_codegen_cranelift) - #82822 (Fix typo) - #82837 (tweak MaybeUninit docs) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
-
由 Yuki Okushi 提交于
tweak MaybeUninit docs Explain what "(no) fixed value" means.
-
由 Yuki Okushi 提交于
Fix typo we need to actually -> we actually need to ````@rustbot```` label +C-cleanup
-
由 Yuki Okushi 提交于
Sync rustc_codegen_cranelift The main highlight of this sync is removal of support for the old x86 Cranelift backend. This made it possible to use native atomic instructions rather than hackishly using a global mutex. 128bit integer support has also seen a few bugfixes and performance improvements. And finally I have formatted everything using the same rustfmt config as the rest of this repo. r? ````@ghost```` ````@rustbot```` label +A-codegen +A-cranelift +T-compiler
-
由 Yuki Okushi 提交于
rustdoc: Add an unstable option to print all unversioned files This allows sharing those files between different doc invocations without having to know their names ahead of time. Helps with https://github.com/rust-lang/docs.rs/issues/1302. r? ````@GuillaumeGomez```` cc ````@pietroalbini```` ````@Nemo157````
-
由 Yuki Okushi 提交于
Move some tests to more suitable subdirs ## The results from classifui (The full results can be found here: https://gist.github.com/JohnTitor/c9e00840990b5e4a8fc562ec3571e427) - [lint-expr-stmt-attrs-for-early-lints.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/lint-expr-stmt-attrs-for-early-lints.rs) <sup>unknown</sup>: lint (1.566), feature-gates (-0.632), numbers-arithmetic (-0.955) - [try-block.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/try-block.rs) <sup>unknown</sup>: binding (1.385), try-block (-0.097), lint (-0.932) - [backtrace-debuginfo.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/backtrace-debuginfo.rs) <sup>unknown</sup>: macros (1.365), cfg (-0.279), drop (-0.291) - [issues/issue-3521.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-3521.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/3521)</sup>: consts (1.298), enum (-0.872), in-band-lifetimes (-0.978) - [impl-bounds-checking.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/impl-bounds-checking.rs) <sup>unknown</sup>: traits (1.243), for (-0.999), shadowed (-0.999) - [issues/issue-17718.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-17718.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/17718)</sup>: binding (1.236), consts (0.315), extern (-0.779) - [issue-6157.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issue-6157.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/6157)</sup>: regions (1.213), unboxed-closures (-0.285), traits (-0.510) - [issues/issue-44373.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-44373.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/44373)</sup>: consts (1.187), nll (0.427), borrowck (-0.704) - [nullable-pointer-ffi-compat.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/nullable-pointer-ffi-compat.rs) <sup>unknown</sup>: regions (1.184), consts (0.650), traits (-0.571) - [issues/issue-52992.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-52992.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/52992)</sup>: nll (1.132), associated-types (-0.628), parser (-0.893) - [issues/issue-2330.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-2330.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/2330)</sup>: traits (1.116), directory_ownership (-0.691), compare-method (-0.981) - [issue-74047.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issue-74047.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/74047)</sup>: async-await (1.109), impl-trait (-0.629), resolve (-0.781) - [issues/issue-33140.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-33140.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/33140)</sup>: traits (1.063), coherence (-0.832), codemap_tests (-0.944) - [issues/issue-28576.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-28576.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/28576)</sup>: traits (1.062), associated-types (-0.333), impl-trait (-0.697) - [issues/issue-7222.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-7222.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/7222)</sup>: binding (1.062), consts (-0.226), numbers-arithmetic (-0.294) - [tup.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/tup.rs) <sup>unknown</sup>: structs-enums (1.061), threads-sendsync (-0.550), moves (-0.790) - [issues/issue-15261.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-15261.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/15261)</sup>: consts (1.052), where-clauses (-0.833), macros (-0.862) - [issues/issue-76179.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-76179.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/76179)</sup>: associated-types (1.048), process (-0.887), rfc-2457 (-0.984) - [issues/issue-42344.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-42344.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/42344)</sup>: borrowck (1.043), macros (-0.481), specialization (-0.966) - [issues/issue-18661.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-18661.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/18661)</sup>: unboxed-closures (1.038), mir (-0.648), higher-rank-trait-bounds (-0.688) - [issues/issue-2633.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-2633.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/2633)</sup>: structs-enums (1.020), functions-closures (-0.722), lint (-0.967) Some notes: - If there are related tests (e.g. it's for the same issue), they are moved along with it. - Moved try-block.rs to the `try-block` dir. - Moved tup.rs to the `tuple` dir. - Moved some tests that classified as consts to the `statics` dir, as it seems they have statics actually. - Skipped backtrace-debuginfo.rs because I think classifui overrates their helper macros. cc #73494 r? ```@petrochenkov```
-
由 Yuki Okushi 提交于
improve offset_from docs `@thomcc` pointed out that the current docs leave it kind of unclear how one can satisfy the "no wrapping around `isize` or the address space" requirement of `offset_from`, so make the docs clearer about that. FWIW, I don't think I entirely agree with that second paragraph about large objects (that I left mostly unchanged here). LLVM, to my knowledge, fundamentally assumes that all allocations fit into an `isize::MAX`. So in that sense creating a larger allocation is simply UB. I would expect a guarantee that Rust heap allocation methods will never return allocations larger than `isize::MAX` (or rather, Rust heap allocation methods should require that the `Layout` is no larger than `isize::MAX`). However, I cannot find any such requirement documented currently. Large allocations are not mentioned at all in the allocator docs, which is quite surprising -- even if we say that such allocations are not insta-UB (which I think is incompatible with LLVM), they are still extremely footgunny since `ptr::offset`/`ptr::add` do not support offsetting by more than `isize::MAX` bytes. Furthermore, the allocator docs don't even say anything about allocations wrapping around the address space. But that is certainly something allocators must ensure never happens; we cannot expect clients to defend against this. Cc `@rust-lang/wg-allocators`
-
由 Yuki Okushi 提交于
Fix diagnostic suggests adding type `[type error]` Fixes #79040 ### Unresolved questions: <del>Why does this change output the diagnostic twice (`src/test/ui/79040.rs`)?</del> Thanks `````@oli-obk`````
-
由 Yuki Okushi 提交于
Cleanup rustdoc warnings ## Clean up error reporting for deprecated passes Using `error!` here goes all the way back to the original commit, https://github.com/rust-lang/rust/pull/8540. I don't see any reason to use logging; rustdoc should use diagnostics wherever possible. See https://github.com/rust-lang/rust/pull/81932#issuecomment-785291244 for further context. - Use spans for deprecated attributes - Use a proper diagnostic for unknown passes, instead of error logging - Add tests for unknown passes - Improve some wording in diagnostics ## Report that `doc(plugins)` doesn't work using diagnostics instead of `eprintln!` This also adds a test for the output. This was added in https://github.com/rust-lang/rust/pull/52194. I don't see any particular reason not to use diagnostics here, I think it was just missed in https://github.com/rust-lang/rust/pull/50541.
-
由 Yuki Okushi 提交于
Improve transmute docs with further clarifications Closes #82493. Please let me know if any of the new wording sounds off, English is not my mother tongue.
-
由 Yuki Okushi 提交于
Remove RefCell around `module_trait_cache` This builds on https://github.com/rust-lang/rust/pull/82018 and should not be merged before. ## Don't require a `DocContext` for `report_diagnostic` This is needed for the next commit, which needs mutable access to the `cx` from within the `decorate` closure. - Change `as_local_hir_id` to an associated function, since it only needs a `TyCtxt` - Change `source_span_for_markdown_range` to only take a `TyCtxt` ## Remove RefCell around module_trait_cache This is mostly just changing lots of functions from `&DocContext` to `&mut DocContext`.
-
由 Yuki Okushi 提交于
Prevent specialized ZipImpl from calling `__iterator_get_unchecked` twice with the same index Fixes #82291 It's open for review, but conflicts with #82289, wait before merging. The conflict involves only the new test, so it should be rather trivial to fix.
-
由 Yuki Okushi 提交于
Make some Option, Result methods unstably const The following methods are now unstably const: - Option::transpose - Option::flatten - Result::flatten While some methods for could likely be made `const` in the future, nearly all of them require something to be dropped at compile-time, which isn't currently supported. The functions listed above should have a trivial path to stabilization.
-
由 Yuki Okushi 提交于
Change built-in kernel targets to be os = none throughout Whether for Rust's own `target_os`, LLVM's triples, or GNU config's, the OS-related have fields have been for code running *on* that OS, not code hat is *part* of the OS. The difference is huge, as syscall interfaces are nothing like freestanding interfaces. Kernels are (hypervisors and other more exotic situations aside) freestanding programs that use the interfaces provided by the hardware. It's *those* interfaces, the ones external to the program being built and its software dependencies, that are the content of the target. For the Linux Kernel in particular, `target_env: "gnu"` is removed for the same reason: that `-gnu` refers to glibc or GNU/linux, neither of which applies to the kernel itself. Relates to #74247
-
由 bors 提交于
Move check only relevant in error case out of critical path Move the check for potentially forgotten `return` in a tail expression of arbitrary expressions into the coercion error branch to avoid computing unncessary coercion checks on successful code. Follow up to #81458.
-
由 Jacob Pratt 提交于
The following functions are now unstably const: - Option::transpose - Option::flatten - Result::transpose
-
- 06 3月, 2021 24 次提交
-
-
由 Ralf Jung 提交于
-
由 Lonami 提交于
Closes #82493.
-
由 Yuki Okushi 提交于
-
由 Henry Boisdequin 提交于
we need to actually -> we actually need to @rustbot label +C-cleanup
-
由 Henry Boisdequin 提交于
-
由 bors 提交于
Rollup of 7 pull requests Successful merges: - #80845 (Make ItemKind::ExternCrate looks like hir::ItemKind::ExternCrate to make transition over hir::ItemKind simpler) - #82708 (Warn on `#![doc(test(...))]` on items other than the crate root and use future incompatible lint) - #82714 (Detect match arm body without braces) - #82736 (Bump optimization from mir_opt_level 2 to 3 and 3 to 4 and make "release" be level 2 by default) - #82782 (Make rustc shim's verbose output include crate_name being compiled.) - #82797 (Update tests names to start with `issue-`) - #82809 (rustdoc: Use substrings instead of split to grab enum variant paths) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
-
由 Guillaume Gomez 提交于
rustdoc: Use substrings instead of split to grab enum variant paths Both versions are about equally readable, but this version avoids scanning the entire path and building an intermediate array (`split()` in Rust is a lazy iterator, but not in JavaScript).
-
由 Guillaume Gomez 提交于
Update tests names to start with `issue-` See ``@JohnTitor's`` [comment](https://github.com/rust-lang/rust/pull/82720#discussion_r586488083) ``@rustbot`` label +C-cleanup
-
由 Guillaume Gomez 提交于
Rollup merge of #82782 - pnkfelix:include-crate-being-compiled-in-bootstrap-verbose-output, r=Mark-Simulacrum Make rustc shim's verbose output include crate_name being compiled. This change is mainly motivated by an issue with the environment printing I added in PR 82403: multiple rustc invocations progress in parallel, and the environment output, spanning multiple lines, gets interleaved in ways make it difficult to extra the enviroment settings. (This aforementioned difficulty is more of a hiccup than an outright show-stopper, because the environment variables tend to be the same for all of the rustc invocations, so it doesn't matter too much if one mixes up which lines one is looking at. But still: Better to fix it.)
-
由 Guillaume Gomez 提交于
Bump optimization from mir_opt_level 2 to 3 and 3 to 4 and make "release" be level 2 by default r? `@oli-obk`
-
由 Guillaume Gomez 提交于
Detect match arm body without braces Fix #82524.
-
由 Guillaume Gomez 提交于
Warn on `#![doc(test(...))]` on items other than the crate root and use future incompatible lint Part of #82672. This PR does multiple things: * Create a new `INVALID_DOC_ATTRIBUTE` lint which is also "future incompatible", allowing us to use it as a warning for the moment until it turns (eventually) into a hard error. * Use this link when `#![doc(test(...))]` isn't used at the crate level. * Make #82702 use this new lint as well. r? ``@jyn514``
-
由 Guillaume Gomez 提交于
Make ItemKind::ExternCrate looks like hir::ItemKind::ExternCrate to make transition over hir::ItemKind simpler It was surprisingly difficult to make this change, mostly because of two issues: * We now store the `ExternCrate` name in the parent struct (`clean::Item`), which forced me to modify the json conversion code a bit more than expected. * The second problem was that, since we now have a `Some(name)`, it was trying to render it, ending up in a panic because we ended up in a `unreachable` statement. The solution was simply to add `!item.is_extern_crate()` in `formats::renderer` before calling `cx.item(item, &cache)?;`. I'll continue to replace all the `clean::ItemKind` variants one by one until it looks exactly like `hir::ItemKind`. Then we'll simply discard the rustdoc type. Once this done, we'll be able to discard `clean::Item` too to use `hir::Item`. r? ``@jyn514``
-
由 Santiago Pastorino 提交于
-
由 Joshua Nelson 提交于
This allows sharing those files between different doc invocations without having to know their names ahead of time.
-
由 Santiago Pastorino 提交于
-
由 Santiago Pastorino 提交于
-
由 Santiago Pastorino 提交于
-
由 Santiago Pastorino 提交于
-
由 Santiago Pastorino 提交于
-
由 Santiago Pastorino 提交于
-
由 Santiago Pastorino 提交于
-
由 Santiago Pastorino 提交于
-
由 Santiago Pastorino 提交于
-