about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2021-01-27Rollup merge of #81389 - ehuss:rustdoc-cmark-extensions, r=GuillaumeGomezYuki Okushi-1/+65
rustdoc: Document CommonMark extensions. This updates the rustdoc book to include some documentation on the CommonMark extensions that rustdoc supports.
2021-01-27Rollup merge of #81325 - osa1:issue81293, r=estebankYuki Okushi-0/+33
typeck: Don't suggest converting LHS exprs Converting LHS of an assignment does not work, so avoid suggesting that. Fixes #81293
2021-01-27Rollup merge of #81299 - GuillaumeGomez:fix-eslint-detected-bugs, r=Nemo157Yuki Okushi-31/+33
Fix some bugs reported by eslint Simply went into `src/librustdoc/html/static/` and ran `eslint *.js` in case you want to reproduce. :) r? ``````@Nemo157``````
2021-01-27Rollup merge of #81195 - estebank:suggest-bound-on-trait-with-params, r=oli-obkYuki Okushi-3/+133
Account for generics when suggesting bound Fix #81175.
2021-01-27Rollup merge of #80900 - camelid:readpointerasbytes-ice, r=oli-obkYuki Okushi-0/+43
Fix ICE with `ReadPointerAsBytes` validation error Fixes #79690. r? ``````@oli-obk``````
2021-01-26typeck: Don't suggest converting LHS exprsÖmer Sinan Ağacan-0/+33
Converting LHS of an assignment does not work, so avoid suggesting that. Fixes #81293
2021-01-25Auto merge of #68828 - oli-obk:inline_cycle, r=wesleywiserbors-0/+194
Prevent query cycles in the MIR inliner r? `@eddyb` `@wesleywiser` cc `@rust-lang/wg-mir-opt` The general design is that we have a new query that is run on the `validated_mir` instead of on the `optimized_mir`. That query is forced before going into the optimization pipeline, so as to not try to read from a stolen MIR. The query should not be cached cross crate, as you should never call it for items from other crates. By its very design calls into other crates can never cause query cycles. This is a pessimistic approach to inlining, since we strictly have more calls in the `validated_mir` than we have in `optimized_mir`, but that's not a problem imo.
2021-01-25rustdoc: Document CommonMark extensions.Eric Huss-1/+65
2021-01-25Auto merge of #81375 - RalfJung:miri, r=RalfJungbors-7/+7
update Miri Fixes https://github.com/rust-lang/rust/issues/81341 Cc `@rust-lang/miri` r? `@ghost`
2021-01-25ci: use the monorepo's lockfile when building cargo for pgo profilingPietro Albini-0/+14
2021-01-25update MiriRalf Jung-7/+7
2021-01-25Ignore a test on wasm, because that changes landing padsoli-37/+39
2021-01-25Fix some bugs reported by eslintGuillaume Gomez-31/+33
2021-01-24Account for generics when suggesting boundEsteban Küber-3/+133
Fix #81175.
2021-01-24Ignore test on 32-bit architecturesCamelid-1/+4
2021-01-24Auto merge of #81355 - jonas-schievink:rollup-vpaadij, r=jonas-schievinkbors-240/+627
Rollup of 14 pull requests Successful merges: - #75180 (Implement Error for &(impl Error)) - #78578 (Permit mutable references in all const contexts) - #79174 (Make std::future a re-export of core::future) - #79884 (Replace magic numbers with existing constants) - #80855 (Expand assert!(expr, args..) to include $crate for hygiene on 2021.) - #80933 (Fix sysroot option not being honored across rustc) - #81259 (Replace version_check dependency with own version parsing code) - #81264 (Add unstable option to control doctest run directory) - #81279 (Small refactor in typeck) - #81297 (Don't provide backend_optimization_level query for extern crates) - #81302 (Fix rendering of stabilization version for trait implementors) - #81310 (Do not mark unit variants as used when in path pattern) - #81320 (Make bad shlex parsing a pretty error) - #81338 (Clean up `dominators_given_rpo`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-01-24Rollup merge of #81320 - CraftSpider:jsondoc-errors, r=jyn514Jonas Schievink-1/+16
Make bad shlex parsing a pretty error Closes #81319 Old Output: <details><summary>Backtrace</summary> <p> ``` thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src\too ls\jsondocck\src\main.rs:152:81 stack backtrace: 0: 0x7ff79a011405 - std::backtrace_rs::backtrace::dbghelp::trace at /rustc/05b6023675d77979637b04a350c85903fbf5925 7\/library\std\src\..\..\backtrace\src\backtrace\dbghelp.rs:98 1: 0x7ff79a011405 - std::backtrace_rs::backtrace::trace_unsynchronized at /rustc/05b6023675d77979637b04a350c85903fbf5925 7\/library\std\src\..\..\backtrace\src\backtrace\mod.rs:66 2: 0x7ff79a011405 - std::sys_common::backtrace::_print_fmt at /rustc/05b6023675d77979637b04a350c85903fbf5925 7\/library\std\src\sys_common\backtrace.rs:67 3: 0x7ff79a011405 - std::sys_common::backtrace::_print::{{impl}}::fmt at /rustc/05b6023675d77979637b04a350c85903fbf5925 7\/library\std\src\sys_common\backtrace.rs:46 4: 0x7ff79a026c7b - core::fmt::write at /rustc/05b6023675d77979637b04a350c85903fbf5925 7\/library\core\src\fmt\mod.rs:1078 5: 0x7ff79a00e74d - std::io::Write::write_fmt<std::sys::windows::stdio::S tderr> at /rustc/05b6023675d77979637b04a350c85903fbf5925 7\/library\std\src\io\mod.rs:1519 6: 0x7ff79a01413d - std::sys_common::backtrace::_print at /rustc/05b6023675d77979637b04a350c85903fbf5925 7\/library\std\src\sys_common\backtrace.rs:49 7: 0x7ff79a01413d - std::sys_common::backtrace::print at /rustc/05b6023675d77979637b04a350c85903fbf5925 7\/library\std\src\sys_common\backtrace.rs:36 8: 0x7ff79a01413d - std::panicking::default_hook::{{closure}} at /rustc/05b6023675d77979637b04a350c85903fbf5925 7\/library\std\src\panicking.rs:208 9: 0x7ff79a013c4a - std::panicking::default_hook at /rustc/05b6023675d77979637b04a350c85903fbf5925 7\/library\std\src\panicking.rs:225 10: 0x7ff79a014a7e - std::panicking::rust_panic_with_hook at /rustc/05b6023675d77979637b04a350c85903fbf5925 7\/library\std\src\panicking.rs:591 11: 0x7ff79a014573 - std::panicking::begin_panic_handler::{{closure}} at /rustc/05b6023675d77979637b04a350c85903fbf5925 7\/library\std\src\panicking.rs:495 12: 0x7ff79a011ddf - std::sys_common::backtrace::__rust_end_short_backtrac e<closure-0,!> at /rustc/05b6023675d77979637b04a350c85903fbf5925 7\/library\std\src\sys_common\backtrace.rs:141 13: 0x7ff79a0144f9 - std::panicking::begin_panic_handler at /rustc/05b6023675d77979637b04a350c85903fbf5925 7\/library\std\src\panicking.rs:493 14: 0x7ff79a025230 - core::panicking::panic_fmt at /rustc/05b6023675d77979637b04a350c85903fbf5925 7\/library\core\src\panicking.rs:92 15: 0x7ff79a02517c - core::panicking::panic at /rustc/05b6023675d77979637b04a350c85903fbf5925 7\/library\core\src\panicking.rs:50 16: 0x7ff799f5245f - indexmap::map::core::raw::<impl indexmap::map::core:: IndexMapCore<K,V>>::get_index_of::had34e726f99bd999 17: 0x7ff799f48fea - std::sys_common::backtrace::__rust_begin_short_backtr ace::h1ac92efa44350e74 18: 0x7ff799f41015 - std::rt::lang_start::{{closure}}::hdfe733a6a1ad9a18 19: 0x7ff79a014c34 - core::ops::function::impls::{{impl}}::call_once at /rustc/05b6023675d77979637b04a350c85903fbf5925 7\library\core\src\ops\function.rs:280 20: 0x7ff79a014c34 - std::panicking::try::do_call at /rustc/05b6023675d77979637b04a350c85903fbf5925 7\/library\std\src\panicking.rs:379 21: 0x7ff79a014c34 - std::panicking::try at /rustc/05b6023675d77979637b04a350c85903fbf5925 7\/library\std\src\panicking.rs:343 22: 0x7ff79a014c34 - std::panic::catch_unwind at /rustc/05b6023675d77979637b04a350c85903fbf5925 7\/library\std\src\panic.rs:396 23: 0x7ff79a014c34 - std::rt::lang_start_internal at /rustc/05b6023675d77979637b04a350c85903fbf5925 7\/library\std\src\rt.rs:51 24: 0x7ff799f536a7 - main 25: 0x7ff79a02d788 - invoke_main at d:\A01\_work\6\s\src\vctools\crt\vcstartup\src \startup\exe_common.inl:78 26: 0x7ff79a02d788 - __scrt_common_main_seh at d:\A01\_work\6\s\src\vctools\crt\vcstartup\src \startup\exe_common.inl:288 27: 0x7ffe6bf47034 - BaseThreadInitThunk 28: 0x7ffe6c89d241 - RtlUserThreadStart ``` </p> </details> New Output: ``` Invalid command: Invalid arguments to shlex::split: ` - "$foo` on line 26 ``` I've hit this a couple times, makes debugging a little nicer.
2021-01-24Rollup merge of #81310 - tmiasko:in-pattern, r=petrochenkovJonas Schievink-1/+40
Do not mark unit variants as used when in path pattern Record that we are processing a pattern so that code responsible for handling path resolution can correctly decide whether to mark it as used or not. Closes #76788.
2021-01-24Rollup merge of #81302 - LeSeulArtichaut:80777-trait-render, r=jyn514Jonas Schievink-30/+40
Fix rendering of stabilization version for trait implementors Rustdoc compares an item's stabilization version with its parent's to not render it if they are the same. Here, the implementor was compared with itself, resulting in the stabilization version never getting shown. This probably needs a test. Fixes #80777. r? `@jyn514`
2021-01-24Rollup merge of #81264 - Swatinem:doctest-run-directory, r=jyn514Jonas Schievink-0/+51
Add unstable option to control doctest run directory This option will allow splitting the compile-time from the run-time directory of doctest invocations and is one step to solve https://github.com/rust-lang/cargo/issues/8993#issuecomment-760088944 r? `@jyn514`
2021-01-24Rollup merge of #81259 - est31:cfg_version, r=petrochenkovJonas Schievink-30/+110
Replace version_check dependency with own version parsing code This gives compiler maintainers a better degree of control over how the version gets parsed and is a good way to ensure that there are no changes of behaviour in the future. Also, issue a warning if the version is invalid instead of erroring so that we stay forwards compatible with possible future changes of the versioning scheme. Last, this improves the present test a little. Fixes #79436 r? `@petrochenkov`
2021-01-24Rollup merge of #80855 - m-ou-se:assert-2021, r=petrochenkovJonas Schievink-0/+9
Expand assert!(expr, args..) to include $crate for hygiene on 2021. This makes `assert!(expr, args..)` properly hygienic in Rust 2021. This is part of rust-lang/rfcs#3007, see #80162. Before edition 2021, this was a breaking change, as `std::panic` and `core::panic` are different. In edition 2021 they will be identical, making it possible to apply proper hygiene here.
2021-01-24Rollup merge of #78578 - oli-obk:const_mut_refs, r=RalfJungJonas Schievink-178/+361
Permit mutable references in all const contexts fixes #71212 cc `@rust-lang/wg-const-eval` `@christianpoveda`
2021-01-24parser: Collect tokens for values in key-value attributesVadim Petrochenkov-2/+14
2021-01-24Auto merge of #80838 - nagisa:nagisa/stack-probe-type, r=cuviperbors-0/+1
Target stack-probe support configurable finely This adds capability to configure the target's stack probe support in a more precise manner than just on/off. In particular now we allow choosing between always inline-asm, always call or either one of those depending on the LLVM version. Note that this removes the ability to turn off the generation of the stack-probe attribute. This is valid to replace it with inline-asm for all targets because `probe-stack="inline-asm"` will not generate any machine code on targets that do not currently support stack probes. This makes support for stack probes on targets that don't have any right now automatic with LLVM upgrades in the future. (This is valid to do based on the fact that clang unconditionally sets this attribute when `-fstack-clash-protection` is used, AFAICT) cc #77885 r? `@cuviper`
2021-01-24Auto merge of #80919 - cjgillot:defkey-span, r=oli-obkbors-8/+2
Generate metadata by iterating on DefId instead of traversing the HIR tree 1/N Sample from #80347.
2021-01-23fmtRune Tynan-4/+6
2021-01-23Make bad shlex parsing a pretty errorRune Tynan-1/+14
2021-01-24Replace version_check dependency with own version parsing codeest31-30/+110
This gives compiler maintainers a better degree of control over how the version gets parsed and is a good way to ensure that there are no changes of behaviour in the future. Also, issue a warning if the version is invalid instead of erroring so that we stay forwards compatible with possible future changes of the versioning scheme. Last, this improves the present test a little.
2021-01-23Fix rendering of stabilization version for trait implementorsLeSeulArtichaut-4/+23
2021-01-23Rollup merge of #81288 - camelid:fix-trait-item-vis, r=jyn514Jonas Schievink-2/+51
rustdoc: Fix visibility of trait and impl items Fixes #81274. r? `@jyn514`
2021-01-23Rollup merge of #81275 - jyn514:time-render, r=wesleywiserJonas Schievink-14/+32
Fix <unknown> queries and add more timing info to render_html Closes https://github.com/rust-lang/rust/issues/81251. ## Fix `<unknown>` queries This happened because `alloc_query_strings` was never called. ## Add more timing info to render_html This still has some issues I'm not sure how to work out: - `create_renderer` and `renderer_after_krate` aren't shown by default. I want something like `verbose_generic_activity_with_arg`, but it doesn't exist. I'm also not sure how to show activities that aren't on by default - I tried `-Z self-profile -Z self-profile-args=all`, but it didn't show up. r? `@wesleywiser`
2021-01-23Rollup merge of #81249 - cjgillot:issue-79537, r=oli-obkJonas Schievink-0/+68
Lower closure prototype after its body. Fixes #79537. r? `@Mark-Simulacrum`
2021-01-23Rollup merge of #81245 - ehuss:update-cargo, r=ehussJonas Schievink-0/+0
Update cargo 5 commits in a73e5b7d567c3036b296fc6b33ed52c5edcd882e..783bc43c660bf39c1e562c8c429b32078ad3099b 2021-01-12 23:45:39 +0000 to 2021-01-20 19:02:26 +0000 - Fix some issues with `cargo doc` and the new feature resolver. (rust-lang/cargo#9077) - Implement support for rust-version field in project metadata (rust-lang/cargo#8037) - Fix a bug in Cargo's cyclic dep graph detection (rust-lang/cargo#9075) - Typo correction: artifcats -&gt; artifacts (rust-lang/cargo#9081) - Remove stray backtick from doc (rust-lang/cargo#9079)
2021-01-23Rollup merge of #81243 - osa1:fix_80742_2, r=RalfJungJonas Schievink-3/+31
mir: Improve size_of handling when arg is unsized As discussed on Zulip with `@RalfJung.`
2021-01-23Add option to control doctest run directoryArpad Borsos-0/+51
This option will allow splitting the compile-time from the run-time directory of doctest invocations and is one step to solve https://github.com/rust-lang/cargo/issues/8993#issuecomment-760088944
2021-01-23Cleanup `render_stability_since_raw` to remove code duplicationLeSeulArtichaut-26/+17
2021-01-23Move test to mir-opt so we actually see that no inlining is happeningoli-4/+95
2021-01-23Make sure that const prop does not produce unsilenceable lints after inliningoli-0/+15
2021-01-23Prevent query cycles during inliningoli-0/+86
2021-01-23Calculate self-profile strings in `Compiler::enter` instead in codegenJoshua Nelson-6/+3
This avoids each tool having to separately find and call `self_profile_alloc_strings`. - Don't compute the global context if it hasn't yet been computed This avoids giving extraneous errors about unresolved names if an error occurs during parsing.
2021-01-23Add more timing info to render_htmlJoshua Nelson-13/+31
- Show `create_renderer` and `renderer_after_crate` by default - Don't rewrite `extra_verbose_generic_activity`
2021-01-23Auto merge of #80579 - RalfJung:no-fallible-promotion, r=oli-obkbors-281/+238
avoid promoting division, modulo and indexing operations that could fail For division, `x / y` will still be promoted if `y` is a non-zero integer literal; however, `1/(1+1)` will not be promoted any more. While at it, also see if we can reject promoting floating-point arithmetic (which are [complicated](https://github.com/rust-lang/unsafe-code-guidelines/issues/237) so maybe we should not promote them). This will need a crater run to see if there's code out there that relies on these things being promoted. If we can land this, promoteds in `fn`/`const fn` cannot fail to evaluate any more, which should let us do some simplifications in codegen/Miri! Cc https://github.com/rust-lang/rfcs/pull/3027 Fixes https://github.com/rust-lang/rust/issues/61821 r? `@oli-obk`
2021-01-23Iterate DefId to encode spans.Camille GILLOT-8/+2
2021-01-23Put dynamic check tests into their own fileoli-24/+64
2021-01-23Cover more cases in the test suiteoli-38/+99
2021-01-23Adjust wording of a diagnosticoli-17/+17
2021-01-23Fix a comment that only made sense in the context of a dataflow based ↵oli-3/+2
mutability check
2021-01-23Rename tests to what their code actually doesoli-0/+0
2021-01-23Permit mutable references in all const contextsoli-143/+226