1
Fork 0
Commit graph

20 commits

Author SHA1 Message Date
Mark Rousskov
17a393ee96 Bump rustfmt to most recently shipped 2020-04-25 09:25:33 -04:00
Mark Rousskov
93eed402ad Bump bootstrap compiler 2020-04-25 09:25:33 -04:00
Amanieu d'Antras
ce83b49d16 Deprecate the asm! macro 2020-04-15 18:09:00 +01:00
Amanieu d'Antras
3475be336f Update stdarch submodule to use llvm_asm! instead of asm! 2020-04-15 17:46:29 +01:00
Roberto Vidal
65fcc3f1cd Expand on platform details of include_xxx macros 2020-04-02 16:34:43 +02:00
Amanieu d'Antras
d162d096dd Rename asm! to llvm_asm!
asm! is left as a wrapper around llvm_asm! to maintain compatibility.
2020-03-26 15:49:22 +00:00
Mazdak Farrokhzad
9fc5c2d00d
Rollup merge of #69870 - petrochenkov:cfgacc, r=matthewjasper
expand: Implement something similar to `#[cfg(accessible(path))]`

cc https://github.com/rust-lang/rust/issues/64797

The feature is implemented as a `#[cfg_accessible(path)]` attribute macro rather than as `#[cfg(accessible(path))]` because it needs to wait until `path` becomes resolvable, and `cfg` cannot wait, but macros can wait.

Later we can think about desugaring or not desugaring `#[cfg(accessible(path))]` into `#[cfg_accessible(path)]`.

This implementation is also incomplete in the sense that it never returns "false" from `cfg_accessible(path)`, it requires some tweaks to resolve, which is not quite ready to answer queries like this during early resolution.

However, the most important part of this PR is not `cfg_accessible` itself, but expansion infrastructure for retrying expansions.
Before this PR we could say "we cannot resolve this macro path, let's try it later", with this PR we can say "we cannot expand this macro, let's try it later" as well.

This is a pre-requisite for
- turning `#[derive(...)]` into a regular attribute macro,
- properly supporting eager expansion for macros that cannot yet be resolved like
    ```
    fn main() {
        println!(not_available_yet!());
    }

    macro_rules! make_available {
        () => { #[macro_export] macro_rules! not_available_yet { () => { "Hello world!" } }}
    }

    make_available!();
    ```
2020-03-17 03:05:12 +01:00
Ralf Jung
0b2329da9a also make panic_fmt track_caller 2020-03-10 10:31:03 +01:00
Vadim Petrochenkov
2e6528961c builtin_macros: Add attribute macro #[cfg_accessible(path)] 2020-03-10 01:02:13 +03:00
Lucas Pardue
cb8c071eb5
macros: typo fix
spotted while reviewing the todo!macro docs
2020-01-06 01:55:24 +00:00
Adam Perry
eaccda009f core and std macros and panic internals use panic::Location::caller. 2020-01-04 10:02:17 -08:00
Simon Sapin
1c572a2d6e Stabilize the matches! macro
Fixes https://github.com/rust-lang/rust/issues/65721

FCP: https://github.com/rust-lang/rust/issues/65721#issuecomment-569118119
2019-12-27 14:07:16 +01:00
bors
a5bc786399 Auto merge of #67445 - llogiq:todo, r=dtolnay
Differentiate todo! and unimplemented!

This updates the panic message and docs to make it clear that `todo!` is for unfinished code and `unimplemented!` is for partial trait or enum impls.

r? @Centril
2019-12-24 21:16:45 +00:00
Andre Bogus
f4d0a04c64 Differentiate todo! and unimplemented! 2019-12-24 13:53:32 +01:00
Mazdak Farrokhzad
1de2705c79
Rollup merge of #67466 - oli-obk:const_intrinsic, r=Centril
Require const stability attributes on intrinsics to be able to use them in constant contexts

r? @Centril

finally fixes #61495

cc @RalfJung
2019-12-23 15:16:23 +01:00
Ross MacArthur
f7256d28d1
Require issue = "none" over issue = "0" in unstable attributes 2019-12-21 13:16:18 +02:00
Oliver Scherer
9ee16e14c5 Require const stability attributes on intrinsics to be able to use them in constant contexts 2019-12-20 23:15:50 +01:00
Jakub Kądziołka
df93bab135
Correct the todo! stabilization version 2019-12-19 19:09:20 +01:00
David Tolnay
95e00bfed8
Format libcore with rustfmt
This commit applies rustfmt with default settings to files in
src/libcore *that are not involved in any currently open PR* to minimize
merge conflicts. The list of files involved in open PRs was determined
by querying GitHub's GraphQL API with this script:
https://gist.github.com/dtolnay/aa9c34993dc051a4f344d1b10e4487e8

With the list of files from the script in `outstanding_files`, the
relevant commands were:

    $ find src/libcore -name '*.rs' | xargs rustfmt --edition=2018
    $ rg libcore outstanding_files | xargs git checkout --

Repeating this process several months apart should get us coverage of
most of the rest of libcore.
2019-11-26 23:02:11 -08:00
Chris Gregory
6fc18a9964
Centralize panic macro documentation 2019-11-14 01:33:45 +01:00
Renamed from src/libcore/macros.rs (Browse further)