summary refs log tree commit diff
path: root/compiler/rustc_span/src
AgeCommit message (Collapse)AuthorLines
2020-09-30Add support for cmse_nonsecure_entry attributeHugues de Valon-0/+1
This patch adds support for the LLVM cmse_nonsecure_entry attribute. This is a target-dependent attribute that only has sense for the thumbv8m Rust targets. You can find more information about this attribute here: https://developer.arm.com/documentation/ecm0359818/latest/ Signed-off-by: Hugues de Valon <hugues.devalon@arm.com>
2020-09-28Rollup merge of #77170 - ecstatic-morse:const-fn-ptr, r=oli-obkRalf Jung-1/+1
Remove `#[rustc_allow_const_fn_ptr]` and add `#![feature(const_fn_fn_ptr_basics)]` `rustc_allow_const_fn_ptr` was a hack to work around the lack of an escape hatch for the "min `const fn`" checks in const-stable functions. Now that we have co-opted `allow_internal_unstable` for this purpose, we no longer need a bespoke attribute. Now this functionality is gated under `const_fn_fn_ptr_basics` (how concise!), and `#[allow_internal_unstable(const_fn_fn_ptr_basics)]` replaces `#[rustc_allow_const_fn_ptr]`. `const_fn_fn_ptr_basics` allows function pointer types to appear in the arguments and locals of a `const fn` as well as function pointer casts to be performed inside a `const fn`. Both of these were allowed in constants and statics already. Notably, this does **not** allow users to invoke function pointers in a const context. Presumably, we will use a nicer name for that (`const_fn_ptr`?). r? @oli-obk
2020-09-27Remove `rustc_allow_const_fn_ptr`Dylan MacKenzie-1/+0
This was a hack to work around the lack of an escape hatch for the "min `const fn`" checks in const-stable functions. Now that we have co-opted `allow_internal_unstable` for this purpose, we no longer need the bespoke attribute.
2020-09-27Add a feature gate for basic function pointer use in `const fn`Dylan MacKenzie-0/+1
2020-09-27Rollup merge of #77263 - bugadani:cleanup, r=lcnrJonas Schievink-1/+1
Clean up trivial if let
2020-09-27Rollup merge of #77256 - jyn514:typo, r=Aaron1011Jonas Schievink-1/+1
Fix typo in ExpnData documentation This mis-highlighted the entire documentation as code: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_span/hygiene/struct.ExpnData.html#structfield.krate
2020-09-27Clean up trivial if letDániel Buga-1/+1
2020-09-27Fix typo in ExpnData documentationJoshua Nelson-1/+1
This mis-highlighted the entire documentation as code.
2020-09-26Rollup merge of #77122 - ecstatic-morse:const-fn-arithmetic, r=RalfJung,oli-obkRalf Jung-0/+1
Add `#![feature(const_fn_floating_point_arithmetic)]` cc #76618 This is a template for splitting up `const_fn` into granular feature gates. I think this will make it easier, both for us and for users, to track stabilization of each individual feature. We don't *have* to do this, however. We could also keep stabilizing things out from under `const_fn`. cc @rust-lang/wg-const-eval r? @oli-obk
2020-09-25Remove now unused `double_braced_*` symbolsmarmeladema-7/+0
2020-09-25Move from {{closure}}#0 syntax to {closure#0} for (def) path componentsmarmeladema-0/+4
2020-09-25Add `const_fn_floating_point_arithmetic`Dylan MacKenzie-0/+1
2020-09-25Rollup merge of #77121 - duckymirror:html-root-url, r=jyn514Jonas Schievink-1/+1
Updated html_root_url for compiler crates Closes #77103 r? @jyn514
2020-09-23/nightly/nightly-rustcErik Hofmayer-1/+1
2020-09-23Updated html_root_url for compiler cratesErik Hofmayer-1/+1
2020-09-23Rollup merge of #76994 - yuk1ty:fix-small-typo, r=estebankDylan DPC-1/+1
fix small typo in docs and comments Fixed `the the` to `the`, as far as I found.
2020-09-23Rollup merge of #76965 - fusion-engineering-forks:fix-atomic-from-mut, r=AmanieuDylan DPC-0/+1
Add cfg(target_has_atomic_equal_alignment) and use it for Atomic::from_mut. Fixes some platform-specific problems with #74532 by using the actual alignment of the types instead of hardcoding a few `target_arch`s. r? @RalfJung
2020-09-21Remove cast to usize for BytePos and CharPosJames Whaley-2/+2
The case shouldn't be necessary and implicitly truncating BytePos is not desirable.
2020-09-21Add cfg(target_has_atomic_equal_alignment).Mara Bos-0/+1
This is needed for Atomic::from_mut.
2020-09-21Reduce boilerplate for BytePos and CharPosJames Whaley-82/+55
2020-09-21fix typo in docs and commentsyuk1ty-1/+1
2020-09-21Auto merge of #76295 - mati865:remove-mmx, r=Amanieu,oli-obkbors-1/+0
Remove MMX from Rust Follow-up to https://github.com/rust-lang/stdarch/pull/890 This removes most of MMX from Rust (tests pass with small changes), keeping stable `is_x86_feature_detected!("mmx")` working.
2020-09-20Remove MMX from RustMateusz Mikuła-1/+0
2020-09-20Rollup merge of #76825 - lcnr:array-windows-apply, r=varkorRalf Jung-2/+8
use `array_windows` instead of `windows` in the compiler I do think these changes are beautiful, but do have to admit that using type inference for the window length can easily be confusing. This seems like a general issue with const generics, where inferring constants adds an additional complexity which users have to learn and keep in mind.
2020-09-20use `array_windows` instead of `windows` in the compilerBastian Kauschke-2/+8
2020-09-17Remove redundant #![feature(...)] 's from compiler/est31-2/+0
2020-09-16Rollup merge of #75304 - Aaron1011:feature/diag-deref-move-out, r=estebankDylan DPC-0/+2
Note when a a move/borrow error is caused by a deref coercion Fixes #73268 When a deref coercion occurs, we may end up with a move error if the base value has been partially moved out of. However, we do not indicate anywhere that a deref coercion is occuring, resulting in an error message with a confusing span. This PR adds an explicit note to move errors when a deref coercion is involved. We mention the name of the type that the deref-coercion resolved to, as well as the `Deref::Target` associated type being used.
2020-09-13Add visualization of rustc span in docIvan Tham-1/+19
It took me quite some time to figure out what Span::to means. A picture is worth a thousand words.
2020-09-10Note when a a move/borrow error is caused by a deref coercionAaron Hill-0/+2
Fixes #73268 When a deref coercion occurs, we may end up with a move error if the base value has been partially moved out of. However, we do not indicate anywhere that a deref coercion is occuring, resulting in an error message with a confusing span. This PR adds an explicit note to move errors when a deref coercion is involved. We mention the name of the type that the deref-coercion resolved to, as well as the `Deref::Target` associated type being used.
2020-09-10implement `const_evaluatable_checked` feature MVPBastian Kauschke-0/+1
2020-08-31Adds two source span utility functions used in source-based coverageRich Kadel-0/+16
`span.is_empty()` - returns true if `lo()` and `hi()` are equal. This is not only a convenience, but makes it clear that a `Span` can be empty (that is, retrieving the source for an empty `Span` will return an empty string), and codifies the (otherwise undocumented--in the rustc_span package, at least) fact that `Span` is a half-open interval (where `hi()` is the open end). `source_map.lookup_file_span()` - returns an enclosing `Span` representing the start and end positions of the file enclosing the given `BytePos`. This gives developers a clear way to quickly determine if any any other `BytePos` or `Span` is also from the same file (for example, by simply calling `file_span.contains(span)`). This results in much simpler code and is much more runtime efficient compared with the obvious alternative: calling `source_map.lookup_line()` for any two `Span`'s byte positions, handle both arms of the `Result` (both contain the file), and then compare files. It is also more efficient than the non-public method `lookup_source_file_idx()` for each `BytePos`, because, while comparing the internal source file indexes would be efficient, looking up the source file index for every `BytePos` or `Span` to be compared requires a binary search (worst case performance being O(log n) for every lookup). `source_map.lookup_file_span()` performs the binary search only once, to get the `file_span` result that can be used to compare to any number of other `BytePos` or `Span` values and those comparisons are always O(1).
2020-08-30mv compiler to compiler/mark-0/+7270