| Age | Commit message (Collapse) | Author | Lines |
|
rustdoc: Document CommonMark extensions.
This updates the rustdoc book to include some documentation on the CommonMark extensions that rustdoc supports.
|
|
typeck: Don't suggest converting LHS exprs
Converting LHS of an assignment does not work, so avoid suggesting that.
Fixes #81293
|
|
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``````
|
|
Account for generics when suggesting bound
Fix #81175.
|
|
Fix ICE with `ReadPointerAsBytes` validation error
Fixes #79690.
r? ``````@oli-obk``````
|
|
Converting LHS of an assignment does not work, so avoid suggesting that.
Fixes #81293
|
|
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.
|
|
|
|
update Miri
Fixes https://github.com/rust-lang/rust/issues/81341
Cc `@rust-lang/miri` r? `@ghost`
|
|
|
|
|
|
|
|
|
|
Fix #81175.
|
|
|
|
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
|
|
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.
|
|
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.
|
|
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`
|
|
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`
|
|
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`
|
|
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.
|
|
Permit mutable references in all const contexts
fixes #71212
cc `@rust-lang/wg-const-eval` `@christianpoveda`
|
|
|
|
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`
|
|
Generate metadata by iterating on DefId instead of traversing the HIR tree 1/N
Sample from #80347.
|
|
|
|
|
|
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.
|
|
|
|
rustdoc: Fix visibility of trait and impl items
Fixes #81274.
r? `@jyn514`
|
|
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`
|
|
Lower closure prototype after its body.
Fixes #79537.
r? `@Mark-Simulacrum`
|
|
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 -> artifacts (rust-lang/cargo#9081)
- Remove stray backtick from doc (rust-lang/cargo#9079)
|
|
mir: Improve size_of handling when arg is unsized
As discussed on Zulip with `@RalfJung.`
|
|
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
|
|
|
|
|
|
|
|
|
|
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.
|
|
- Show `create_renderer` and `renderer_after_crate` by default
- Don't rewrite `extra_verbose_generic_activity`
|
|
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`
|
|
|
|
|
|
|
|
|
|
mutability check
|
|
|
|
|