Commit graph

152723 commits

Author SHA1 Message Date
Guillaume Gomez
ba11dc7fdd Fix URL conflict for std type 2021-08-05 23:33:43 +02:00
Guillaume Gomez
dfe4fec783 Remove LightSpan and use Span directly 2021-08-05 23:08:29 +02:00
Guillaume Gomez
5cf300d695 Remove warnings/errors from compiler when using typeck_body in rustdoc span map builder 2021-08-05 23:08:29 +02:00
Guillaume Gomez
0799528db7 * Rename LightSpan::empty into LightSpan::dummy
* Add Classifier::new_light_span to wrap LightSpan::new_in_file constructor
2021-08-05 23:08:29 +02:00
Guillaume Gomez
fd69fa8670 Add missing root_path when generating links using href 2021-08-05 23:08:29 +02:00
Guillaume Gomez
1a48d1a4de Add documentation and FIXME 2021-08-05 23:08:29 +02:00
Guillaume Gomez
b336f2801c Fix invalid generation of HTML in highlight 2021-08-05 23:08:29 +02:00
Guillaume Gomez
ef0d909f26 formatting 2021-08-05 23:08:29 +02:00
Guillaume Gomez
f233a70567 Use rustdoc Span in LinkFromSrc directly 2021-08-05 23:08:29 +02:00
Guillaume Gomez
dffc9c0a79 Move extra arguments for highlight URL generation into a new ContextInfo struct for better readability 2021-08-05 23:08:28 +02:00
Guillaume Gomez
e8869cb7a7 Wrap the span_map tuple index into a type called "LightSpan" 2021-08-05 23:08:28 +02:00
Guillaume Gomez
c5c927dfda Improve code readability 2021-08-05 23:08:28 +02:00
Guillaume Gomez
38444f61bb * Rename Span::from_rustc_span to Span::new
* Rename Span::wrap to Span::wrap_raw
* Improve documentation for Span::wrap_raw
2021-08-05 23:08:28 +02:00
Guillaume Gomez
2a3b71ae33 * Rename 'move_span' into 'local_span_to_global_span'
* Add documentation on new arguments/functions
2021-08-05 23:08:28 +02:00
Guillaume Gomez
b5c27b49d0 Underline source code links on hover 2021-08-05 23:08:28 +02:00
Guillaume Gomez
89bdc33781 Update rustdoc tests 2021-08-05 23:08:28 +02:00
Guillaume Gomez
1abb7faddb Generate links for modules as well 2021-08-05 23:08:28 +02:00
Guillaume Gomez
71763a52ff Add test for source code pages URLs 2021-08-05 23:08:28 +02:00
Guillaume Gomez
b689cedc0e Generate links for methods as well 2021-08-05 23:08:28 +02:00
Guillaume Gomez
83dcd30ee0 Ensure that --generate-link-to-definition is only used with HTML output and is unstable 2021-08-05 23:08:28 +02:00
Guillaume Gomez
2104bf27d4 Add an option for the source code link generation 2021-08-05 23:08:28 +02:00
Guillaume Gomez
023231a709 Add links on source types to go to definition 2021-08-05 23:08:27 +02:00
The8472
1c21373b50 add Box::try_new_uninit_slice for symmetry 2021-08-05 21:21:52 +02:00
Josh Stone
a292390854 Only allow LLVM element_type on Array and Vector 2021-08-05 11:06:32 -07:00
Josh Stone
41f27d903a Remove the decl arg from FnAbi::llvm_type
We can apply the `c_variadic` fix all the time, rather than trying to
distinguish between declarations and any other use.
2021-08-05 10:58:55 -07:00
Josh Stone
183d79cc09 Prepare call/invoke for opaque pointers
Rather than relying on `getPointerElementType()` from LLVM function
pointers, we now pass the function type explicitly when building `call`
or `invoke` instructions.
2021-08-05 10:58:55 -07:00
The8472
55def120a4 replace Vec<u8> with Box<[u8]> 2021-08-05 19:52:08 +02:00
bors
2f07ae408f Auto merge of #87768 - rust-lang:core-features-cleanup, r=dtolnay
Core features cleanup

This sorts and categorizes the `#![features]` in `core` and removes unused ones.

This is part of #87766

The following feature attributes were unnecessary and are removed:

```diff
// Library features:
-#![feature(bool_to_option)]
-#![feature(char_indices_offset)]
-#![feature(pin_deref_mut)]
-#![feature(str_split_as_str)]
-#![feature(str_split_inclusive_as_str)]

// Language features:
-#![feature(arbitrary_self_types)]
-#![feature(custom_inner_attributes)]
-#![feature(nll)]
```
2021-08-05 17:45:43 +00:00
The8472
6ed2d870fc remove cfg gate on use RawVec since it is now also used in fallible code 2021-08-05 19:45:02 +02:00
Niels Sascha Reedijk
d41df91215 Update socket2 dependency from 0.4.0 to 0.4.1 2021-08-05 15:54:18 +01:00
bors
61a941b8ba Auto merge of #87737 - LeSeulArtichaut:unsafeck-less-freeze, r=oli-obk
Only compute `is_freeze` for layout-constrained ADTs

Places are usually shallow and quick to visit. By contrast, computing `is_freeze` can be much costlier, involving inference and trait solving. Making sure to call `is_freeze` only when necessary should be beneficial for performance in most cases.

See [this comparison](https://perf.rust-lang.org/compare.html?start=81f08a4763e7537b92506fa5a597e6bf774d20cc&end=56a58d347b1c7dd0c2984b8fc3930c408e26fbc2&stat=instructions%3Au) from #87710.

r? `@oli-obk`
2021-08-05 14:45:09 +00:00
bjorn3
05677b6bd6 Rustup to rustc 1.56.0-nightly (25b764849 2021-08-04) 2021-08-05 15:32:02 +02:00
bjorn3
20491379c2 Sync from rust 2ddb65c322 2021-08-05 14:39:37 +02:00
Mara Bos
cdf83c030a Make rustfmt happy. 2021-08-05 12:55:35 +02:00
Mara Bos
1b318a2b49 Remove unnecessary #[unstable] from internal macro.
After this change, all library #![feature]s enabled in core are for
const fns.
2021-08-05 12:55:35 +02:00
Mara Bos
9decf6365d Remove unused langauge #![feature]s from core. 2021-08-05 12:55:35 +02:00
Mara Bos
37d402eadd Remove unused library #![feature]s from core. 2021-08-05 12:55:35 +02:00
Mara Bos
25d0c58e0a Sort and categorize lint and feature attributes in core. 2021-08-05 12:55:33 +02:00
bors
e21e1d6a41 Auto merge of #87740 - npmccallum:naked_args, r=Amanieu
Disable unused variable lint for naked functions

In most calling conventions, accessing function parameters may require
stack access. However, naked functions have no assembly prelude to set
up stack access.  This is why naked functions may only contain a single
`asm!()` block. All parameter access is done inside the `asm!()` block,
so we cannot validate the liveness of the input parameters. Therefore,
we should disable the lint for naked functions.

rust-lang/rfcs#2774
rust-lang/rfcs#2972

`@joshtriplett` `@Amanieu` `@haraldh`
2021-08-05 10:35:21 +00:00
hyd-dev
7520ea9046
Use C-unwind ABI for __rust_start_panic in panic_abort 2021-08-05 18:01:17 +08:00
bors
2ddb65c322 Auto merge of #87532 - tlyu:bootstrap-rev-list, r=jyn514
bootstrap.py: use `git rev-list` for robustness

Use `git rev-list` instead of `git log` to be more robust against
UI changes in git. Also, use the full email address for bors,
because `--author` uses a substring match.

Based on #87513, but is separate because it's less minimal and may require additional manual testing.

~Open questions:~
* ~Should the `merge_base` search also use `--first-parent`?~
* ~Do we exclude non-merge commits from bors? There are a few, and I'm not sure what they have in common. Some of them look like squashes, and some look like they're in rollup branches.~

r? `@jyn514`
`@rustbot` label +A-rustbuild +C-cleanup
2021-08-05 07:33:20 +00:00
The8472
f408d4bb8c use box->vec conversion API that doesn't reallocate 2021-08-05 09:32:41 +02:00
est31
1db8737f65 alloc: Use intra doc links for the reserve function
The sentence exists to highlight the existence of a
performance footgun of repeated calls of the
reserve_exact function.
2021-08-05 04:23:54 +02:00
Ellen
fa46715002 remove tywf relation 2021-08-05 03:09:01 +01:00
bors
d4ad1cfc63 Auto merge of #87641 - HackAttack:expand-unknown-option-message, r=wesleywiser
Allow more "unknown argument" strings from linker

Some toolchains emit slightly different errors, e.g.

    ppc-vle-gcc: error: unrecognized option '-no-pie'
2021-08-05 00:11:05 +00:00
Tomasz Miąsko
46f645b6d3 Make vec-shrink-panic test compatible with v0 mangling
The v0 mangling includes an instantiating crate in a mangled name,
which crates a false positive match for a word `panic`.
Rename crate name / test case to avoid the issue.
2021-08-05 00:00:00 +00:00
The8472
83b01b9f1a use zeroed allocation instead of eagerly initializing the memory 2021-08-05 00:24:31 +02:00
The8472
de91157389 add Box::try_new_zeroed_slice()
Currently there is no API that allows fallible zero-allocation of a Vec.
Vec.try_reserve is not appropriate for this job since it doesn't know
whether it should zero or arbitrary uninitialized memory is fine.

Since Box currently holds most of the zeroing/uninit/slice allocation APIs
it's the best place to add yet another entry into this feature matrix.
2021-08-05 00:23:19 +02:00
bors
25b7648496 Auto merge of #86155 - alexcrichton:abort-on-unwind, r=nikomatsakis
rustc: Fill out remaining parts of C-unwind ABI

This commit intends to fill out some of the remaining pieces of the
C-unwind ABI. This has a number of other changes with it though to move
this design space forward a bit. Notably contained within here is:

* On `panic=unwind`, the `extern "C"` ABI is now considered as "may
  unwind". This fixes a longstanding soundness issue where if you
  `panic!()` in an `extern "C"` function defined in Rust that's actually
  UB because the LLVM representation for the function has the `nounwind`
  attribute, but then you unwind.

* Whether or not a function unwinds now mainly considers the ABI of the
  function instead of first checking the panic strategy. This fixes a
  miscompile of `extern "C-unwind"` with `panic=abort` because that ABI
  can still unwind.

* The aborting stub for non-unwinding ABIs with `panic=unwind` has been
  reimplemented. Previously this was done as a small tweak during MIR
  generation, but this has been moved to a separate and dedicated MIR
  pass. This new pass will, for appropriate functions and function
  calls, insert a `cleanup` landing pad for any function call that may
  unwind within a function that is itself not allowed to unwind. Note
  that this subtly changes some behavior from before where previously on
  an unwind which was caught-to-abort it would run active destructors in
  the function, and now it simply immediately aborts the process.

* The `#[unwind]` attribute has been removed and all users in tests and
  such are now using `C-unwind` and `#![feature(c_unwind)]`.

I think this is largely the last piece of the RFC to implement.
Unfortunately I believe this is still not stabilizable as-is because
activating the feature gate changes the behavior of the existing `extern
"C"` ABI in a way that has no replacement. My thinking for how to enable
this is that we add support for the `C-unwind` ABI on stable Rust first,
and then after it hits stable we change the behavior of the `C` ABI.
That way anyone straddling stable/beta/nightly can switch to `C-unwind`
safely.
2021-08-04 21:09:53 +00:00
Noah Lev
42a417e49a
Fix typo 2021-08-04 14:04:58 -07:00