about summary refs log tree commit diff
path: root/src/librustc_span
AgeCommit message (Collapse)AuthorLines
2020-05-22Remove `macro_defs` mapAaron Hill-3/+19
We store store the `DefId` directly in `ExpnData`. This will allow us to serialize `ExpnData` in PR #72121 without needing to manage a side table.
2020-05-20Implement `#[ffi_const]` and `#[ffi_pure]` function attributesMatthias Schiffer-0/+2
Introduce function attribute corresponding to the `const`/`pure` attributes supported by GCC, clang and other compilers. Based on the work of gnzlbg <gonzalobg88@gmail.com>.
2020-05-18Implement att_syntax optionAmanieu d'Antras-0/+1
2020-05-18Implement asm! in librustc_builtin_macrosAmanieu d'Antras-3/+15
2020-05-18Add RISC-V target featuresAmanieu d'Antras-0/+1
2020-05-16break out earlier on empty snippetcsmoe-8/+17
2020-05-10use min_specialization for some rustc crates where it requires no changesRalf Jung-1/+1
2020-05-08FIXME commentCameron Taggart-1/+1
2020-05-07#[allow(unused)]Cameron Taggart-0/+1
2020-05-07allow wasm target for rustc-ap-rustc_spanCameron Taggart-0/+3
2020-05-03Support liveness in `rustc_peek` testsDylan MacKenzie-0/+1
2020-05-03Rollup merge of #71314 - mibac138:cfg-version, r=petrochenkovDylan DPC-0/+2
Implement RFC 2523, `#[cfg(version(..))]` Hi! This is my first contribution to rust, I hope I didn't miss anything. I tried to implement this feature so that `#[cfg(version(1.44.0))]` works but the parser was printing an error that I wasn't sure how to fix so I just opted for implementing `#[cfg(version("1.44.0"))]` (note the quotes). Tracking issue: #64796
2020-05-03Implement RFC 2523, `#[cfg(version(..))]`mibac138-0/+2
2020-05-02Rollup merge of #71787 - tshepang:rustdoc-warnings, r=varkorDylan DPC-1/+1
fix rustdoc warnings
2020-05-02fix rustdoc warningsTshepang Lekhonkhobe-1/+1
2020-05-01Allow `#[target_feature]` on safe functionsLeSeulArtichaut-0/+1
2020-04-27Rollup merge of #71263 - shlevy:FileLoader-remove-abs_path, r=XanewokDylan DPC-12/+0
Remove unused abs_path method from rustc_span::source_map::FileLoader
2020-04-25Auto merge of #71439 - Mark-Simulacrum:stage0-next, r=jonas-schievinkbors-1/+1
Bump bootstrap compiler This bumps the bootstrap compiler and the rustfmt that x.py fmt uses.
2020-04-25Bump bootstrap compilerMark Rousskov-1/+1
2020-04-22Sort `MultiSpan`s on creationEsteban Küber-1/+2
2020-04-17Remove unused abs_path method from rustc_span::source_map::FileLoaderShea Levy-12/+0
2020-04-16Auto merge of #70831 - sfackler:shrink-future-stack, r=matthewjasperbors-1/+2
Remove a stack frame from .await calls The stack frames when `.await`ing one async fn from another currently look like this: ``` 12: foo::b::{{closure}} at src/main.rs:2 13: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll at /home/sfackler/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore/future/mod.rs:66 14: core::future::poll_with_context at /home/sfackler/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore/future/mod.rs:84 15: foo::a::{{closure}} at src/main.rs:6 ``` Since the move away from using TLS to pass the Context around, it's now easy to remove frame 14 by removing poll_with_context in favor of calling Future::poll directly. This still leaves the `GenFuture` frame, but that seems significantly harder to deal with. It also improves diagnostics a bit since they no longer talk about the private poll_with_context function.
2020-04-13Fix symbol sortingSteven Fackler-1/+1
2020-04-12Rollup merge of #71053 - phansch:update_kw_sym_docs, r=Dylan-DPCDylan DPC-0/+8
Add some basic docs to `sym` and `kw` modules I was looking into improving some Clippy documentation but was missing a place that explains the `kw` and `sym` modules from rustc. This adds some very basic usage documentation to these modules.
2020-04-12Rollup merge of #71048 - arlosi:normalize_ext_src, r=eddybDylan DPC-1/+59
Normalize source when loading external foreign source into SourceMap The compiler normalizes source when reading files initially (removes BOMs, etc), but not when loading external sources. This leads to the external source matching according to the `src_hash`, but differing internally because it was not normalized. Fixes #70874.
2020-04-12Add some basic docs to `sym` and `kw` modulesPhilipp Hansch-0/+8
I was looking into improving some Clippy documentation but was missing a place that explains the `kw` and `sym` modules from rustc.
2020-04-11Normalize source when loading external foreign source into SourceMapArlo Siemsen-1/+59
The compiler normalizes source when reading files initially (removes BOMs, etc), but not when loading external sources. Fixes #70874 by normalizing when loading external sources too. Adds a test to verify normalization.
2020-04-10Auto merge of #70986 - marmeladema:issue70853/librustc_middle-local-def-id, ↵bors-0/+5
r=eddyb rustc_middle: return `LocalDefId` where possible in hir::map module This changes the return type of the following functions to return a `LocalDefId` instead of a `DefId`: * opt_local_def_id_from_node_id * opt_local_def_id * body_owner_def_id * local_def_id_from_node_id * get_parent_id This is another step in the right direction for #70853 This pull request will be followed by another (substantial one) which changes the return type of `local_def_id` function but this change being more invasive, we might want to wait for #70956 or #70961 (or some other form it) to land first.
2020-04-10librustc_middle: return LocalDefId instead of DefId in get_parent_didmarmeladema-0/+5
2020-04-08Replace "rc"/"arc" lang items with Rc/Arc diagnostic items.Eduard-Mihai Burtescu-0/+2
2020-04-05Remove a stack frame from .await callsSteven Fackler-1/+2
2020-04-05Stop importing int/float modules in librustc_*Linus Färnstrand-1/+0
2020-04-02Add hash of source files in debug infoArlo Siemsen-19/+91
* Adds either an MD5 or SHA1 hash to the debug info. * Adds new unstable option `-Z src-hash-algorithm` to control the hashing algorithm.
2020-03-30rustc -> rustc_middle part 1Mazdak Farrokhzad-1/+1
2020-03-26Rename asm! to llvm_asm!Amanieu d'Antras-0/+1
asm! is left as a wrapper around llvm_asm! to maintain compatibility.
2020-03-26pacify the merciless x.py fmtNiko Matsakis-35/+7
2020-03-26introduce `negative_impls` feature gate and documentNiko Matsakis-7/+37
They used to be covered by `optin_builtin_traits` but negative impls are now applicable to all traits, not just auto traits. This also adds docs in the unstable book for the current state of auto traits.
2020-03-25Rename `def_span` to `guess_head_span`Esteban Küber-1/+8
2020-03-23Rollup merge of #70318 - anyska:multiple-derives, r=Dylan-DPCMazdak Farrokhzad-60/+10
Split long derive lists into two derive attributes.
2020-03-23Rollup merge of #70199 - ↵Mazdak Farrokhzad-0/+7
pnkfelix:issue-68808-dont-turn-dummy-spans-into-invalid-lines, r=estebank Revised span-to-lines conversion to produce an empty vec on DUMMY_SP. This required revising some of the client code to stop relying on the returned set of lines being non-empty. Fix #68808
2020-03-23Update src/librustc_span/source_map.rsFelix S Klock II-1/+1
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2020-03-23Split long derive lists into two derive attributes.Ana-Maria Mihalache-60/+10
2020-03-22Rollup merge of #70229 - matthiaskrgr:cl3ppy, r=Mark-SimulacrumDylan DPC-4/+4
more clippy fixes * remove unused unit values (clippy::unused_unit) * make some let-if-bindings more idiomatic (clippy::useless_let_if_seq) * clarify when we pass () to functions (clippy::unit_arg) * don't redundantly repeat field names (clippy::redundant_field_names) * remove redundant returns (clippy::needless_return) * use let instead of match for matches with single bindings (clippy::match_single_binding) * don't convert results to options just for matching (clippy::if_let_some_result)
2020-03-22Rollup merge of #70172 - eddyb:retokenize-external-src, r=petrochenkovDylan DPC-3/+3
parse/lexer: support `StringReader::retokenize` called on external files. This ~~should theoretically~~ fixes #69933, ~~but I'm not sure what the best way to test it is~~. **EDIT**: see https://github.com/rust-lang/rust/issues/69933#issuecomment-602019598. r? @petrochenkov cc @Xanewok @staktrace
2020-03-21remove redundant returns (clippy::needless_return)Matthias Krüger-4/+4
2020-03-21Rollup merge of #69901 - RalfJung:rustc_layout, r=eddybDylan DPC-0/+1
add #[rustc_layout(debug)] @eddyb recently told me about the `#[rustc_layout]` attribute, and I think it would be very useful if it could be used to print all the layout information Rust has about a type. When working with layouts (e.g. in Miri), it is often not clear how certain surface language features get represented internally. I have some awful hacks locally to be able to dump this debug information; with this attribute I could get it on the playground which is so much better. :)
2020-03-21Rollup merge of #70187 - matthiaskrgr:cl2ppy, r=Mark-SimulacrumMazdak Farrokhzad-14/+8
more clippy fixes * remove redundant returns (clippy::needless_return) * remove redundant import (clippy::single_component_path_imports) * remove redundant format!() call (clippy::useless_format) * don't use ok() before calling expect() (clippy::ok_expect)
2020-03-21Rollup merge of #69033 - jonas-schievink:resume-with-context, r=tmandryMazdak Farrokhzad-1/+2
Use generator resume arguments in the async/await lowering This removes the TLS requirement from async/await and enables it in `#![no_std]` crates. Closes https://github.com/rust-lang/rust/issues/56974 I'm not confident the HIR lowering is completely correct, there seem to be quite a few undocumented invariants in there. The `async-std` and tokio test suites are passing with these changes though.
2020-03-20remove redundant returns (clippy::needless_return)Matthias Krüger-14/+8
2020-03-20Revised span-to-lines conversion to produce an empty vec on DUMMY_SP.Felix S. Klock II-0/+7
This required revising some of the client code to stop relying on the returned set of lines being non-empty.