about summary refs log tree commit diff
path: root/src/libsyntax_pos
AgeCommit message (Collapse)AuthorLines
2019-08-11add basic lint testing for misuse of mem::zeroed and mem::uninitializedRalf Jung-0/+3
2019-08-03Move special treatment of `derive(Copy, PartialEq, Eq)` from expansion ↵Vadim Petrochenkov-1/+0
infrastructure to elsewhere
2019-08-03Auto merge of #63180 - varkor:trait-alias-impl-trait, r=Centrilbors-4/+4
Change opaque type syntax from `existential type` to type alias `impl Trait` This implements a new feature gate `type_alias_impl_trait` (this is slightly different from the originally proposed feature name, but matches what has been used in discussion since), deprecating the old `existential_types` feature. The syntax for opaque types has been changed. In addition, the "existential" terminology has been replaced with "opaque", as per previous discussion and the RFC. This makes partial progress towards implementing https://github.com/rust-lang/rust/issues/63063. r? @Centril
2019-08-03Rollup merge of #63121 - estebank:formatting-pos, r=alexcrichtonMazdak Farrokhzad-0/+1
On `format!()` arg count mismatch provide extra info When positional width and precision formatting flags are present in a formatting string that has an argument count mismatch, provide extra information pointing at them making it easiser to understand where the problem may lay: ``` error: 4 positional arguments in format string, but there are 3 arguments --> $DIR/ifmt-bad-arg.rs:78:15 | LL | println!("{} {:.*} {}", 1, 3.2, 4); | ^^ ^^--^ ^^ --- this parameter corresponds to the precision flag | | | this precision flag adds an extra required argument at position 1, which is why there are 4 arguments expected | = note: positional arguments are zero-based = note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html error: 4 positional arguments in format string, but there are 3 arguments --> $DIR/ifmt-bad-arg.rs:81:15 | LL | println!("{} {:07$.*} {}", 1, 3.2, 4); | ^^ ^^-----^ ^^ --- this parameter corresponds to the precision flag | | | | | this precision flag adds an extra required argument at position 1, which is why there are 4 arguments expected | this width flag expects an `usize` argument at position 7, but there are 3 arguments | = note: positional arguments are zero-based = note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html error: invalid reference to positional argument 7 (there are 3 arguments) --> $DIR/ifmt-bad-arg.rs:84:18 | LL | println!("{} {:07$} {}", 1, 3.2, 4); | ^^^--^ | | | this width flag expects an `usize` argument at position 7, but there are 3 arguments | = note: positional arguments are zero-based = note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html ``` Fix #49384.
2019-08-02Replace "existential" by "opaque"varkor-4/+3
2019-08-02Switch existential_type to type_alias_impl_traitvarkor-0/+1
2019-08-02libsyntax_pos: Unconfigure tests during normal buildVadim Petrochenkov-210/+210
2019-07-29review commentsEsteban Küber-0/+1
2019-07-28Deny `unused_lifetimes` through rustbuildVadim Petrochenkov-2/+0
2019-07-28Remove lint annotations in specific crates that are already enforced by ↵Vadim Petrochenkov-1/+0
rustbuild Remove some random unnecessary lint `allow`s
2019-07-27Remove run-pass test suitesVadim Petrochenkov-1/+1
2019-07-23cleanup: Remove `extern crate serialize as rustc_serialize`sVadim Petrochenkov-9/+6
2019-07-19hygiene: Tweak naming some moreVadim Petrochenkov-48/+49
2019-07-19Adjust other names after the `Mark` renamingVadim Petrochenkov-111/+115
2019-07-19libsyntax: Remove `Mark` into `ExpnId`Vadim Petrochenkov-58/+58
2019-07-19Auto merge of #62684 - petrochenkov:scopevisit, r=davidtwcobors-0/+1
resolve: Improve candidate search for unresolved macro suggestions Use same scope visiting machinery for both collecting suggestion candidates and actually resolving the names. The PR is better read in per-commit fashion with whitespace changes ignored (the first commit in particular moves some code around). This should be the last pre-requisite for https://github.com/rust-lang/rust/pull/62086. r? @davidtwco
2019-07-18Auto merge of #61749 - davidtwco:rfc-2203-const-array-repeat-exprs, r=eddybbors-0/+1
rustc/rustc_mir: Implement RFC 2203. This PR implements RFC 2203, allowing constants in array repeat expressions. Part of #49147. r? @eddyb
2019-07-18resolve: Visit all scopes to collect suggestion candidates for unresolved macrosVadim Petrochenkov-0/+1
2019-07-11Remove feature gate `dropck_parametricity` completelyLzu Tao-1/+0
Therefore we also remove `#[unsafe_destructor_blind_to_params]` attribute completly.
2019-07-11hygiene: Make sure each `Mark` has an associated expansion infoVadim Petrochenkov-4/+19
The root expansion was missing one. Expansions created for "derive containers" (see one of the next commits for the description) also didn't get expansion info.
2019-07-11hygiene: Fix wording of desugaring descriptionsVadim Petrochenkov-9/+10
Use variant names rather than descriptions for identifying desugarings in `#[rustc_on_unimplemented]`. Both are highly unstable, but variant name is at least a single identifier.
2019-07-11hygiene: Introduce a helper method for creating new expansionsVadim Petrochenkov-35/+26
Creating a fresh expansion and immediately generating a span from it is the most common scenario. Also avoid allocating `allow_internal_unstable` lists for derive markers repeatedly. And rename `ExpnInfo::with_unstable` to `ExpnInfo::allow_unstable`, seems to be a better fitting name.
2019-07-11expand: Do not overwrite existing `ExpnInfo` when injecting derive markersVadim Petrochenkov-1/+5
Create a fresh expansion for them instead - this is the usual way to allow unstable features for generated/desugared code. Fixes https://github.com/rust-lang/rust/issues/52363
2019-07-11hygiene: Reuse `MacroKind` in `ExpnKind`Vadim Petrochenkov-21/+22
Orthogonality and reuse are good.
2019-07-11hygiene: Remove some unused implsVadim Petrochenkov-7/+7
2019-07-11syntax: Make def-site span mandatory in ↵Vadim Petrochenkov-8/+6
ExpnInfo/MacroBacktrace/DiagnosticSpanMacroExpansion We have to deal with dummy spans anyway Remove def-site span from expander interfaces. It's not used by the expansion infra, only by specific expanders, which can keep it themselves if they want it.
2019-07-11hygiene: Remove some dead codeVadim Petrochenkov-27/+1
2019-07-11Rename some things in `syntax_pos/hygiene`Vadim Petrochenkov-34/+34
More consistent with other naming: ExpnFormat -> ExpnKind ExpnKind::name -> ExpnKind::descr DesugaringKind::name -> DesugaringKind::descr Shorter, no tautology: CompilerDesugaring -> Desugaring CompilerDesugaringKind -> DesugaringKind
2019-07-11Move `MacroKind` into `libsyntax_pos`Vadim Petrochenkov-0/+28
So it can be eventually used in `ExpnInfo`
2019-07-09Resolve `$crate` in all hygienic contexts for pretty-pringingVadim Petrochenkov-12/+18
Stop visiting AST to discover those contexts, just iterate through hygiene data instead
2019-07-07syntax: Add feature gate.David Wood-0/+1
This commit adds a `const_in_array_repeat_expressions` feature gate and only create `Candidate::Repeat` if it is enabled.
2019-07-07Rollup merge of #62213 - QuietMisdreavus:cfg-doctest, r=GuillaumeGomezMazdak Farrokhzad-0/+2
rustdoc: set cfg(doctest) when collecting doctests Note: This PR builds on top of https://github.com/rust-lang/rust/pull/61199; only the last commit is specific to this PR. As discussed in https://github.com/rust-lang/rust/pull/61199, we want the ability to isolate items to only when rustdoc is collecting doctests, but we can't use `cfg(test)` because of libcore's `#![cfg(not(test))]`. This PR proposes a new cfg flag, `cfg(doctest)`, specific to this situation, rather than reusing an existing flag. I've isolated it behind a feature gate so that we can contain the effects to nightly only. (A stable workaround that can be used in lieu of `#[cfg(doctest)]` is `#[cfg(rustdoc)] #[doc(hidden)]`, at least once https://github.com/rust-lang/rust/pull/61351 lands.) Tracking issue: https://github.com/rust-lang/rust/issues/62210
2019-07-07Rollup merge of #62042 - petrochenkov:macstab, r=matthewjasperMazdak Farrokhzad-1/+19
Support stability and deprecation checking for all macros RELNOTES: Deprecation attributes on macros now have effect. Fixes https://github.com/rust-lang/rust/issues/34079 Fixes https://github.com/rust-lang/rust/issues/49912 Unblocks https://github.com/rust-lang/rust/pull/62086 Unblocks https://github.com/rust-lang/rust/pull/61000
2019-07-07syntax: Pre-intern names of all built-in macrosVadim Petrochenkov-1/+19
They always end up interned anyway
2019-07-06rustdoc: set cfg(doctest) when collecting doctestsQuietMisdreavus-0/+2
2019-07-07rustc: Remove `dylib` crate type from most rustc cratesAlex Crichton-1/+1
Now that procedural macros no longer link transitively to libsyntax, this shouldn't be needed any more! This commit is an experiment in removing all dynamic libraries from rustc except for librustc_driver itself. Let's see how far we can get with that!
2019-07-06`#[rustc_transparent_macro]` -> `#[rustc_macro_transparency = ...]`Vadim Petrochenkov-1/+1
2019-07-06`#[rustc_doc_only_macro]` -> `#[rustc_builtin_macro]`Vadim Petrochenkov-1/+1
2019-07-06Enforce 'cond: bool' in while-expr + improve reachability diags.Mazdak Farrokhzad-2/+3
2019-07-05Rollup merge of #61545 - flip1995:internal_lints, r=oli-obkMazdak Farrokhzad-1/+4
Implement another internal lints cc #49509 This adds ~~two~~ one internal lint~~s~~: 1. LINT_PASS_IMPL_WITHOUT_MACRO: Make sure, that the `{declare,impl}_lint_pass` macro is used to implement lint passes. cc #59669 2. ~~USAGE_OF_TYCTXT_AND_SPAN_ARGS: item 2 on the list in #49509~~ ~~With 2. I wasn't sure, if this lint should be applied everywhere. That means a careful review of 0955835 would be great. Also 73fb9b4 allows this lint on some functions. Should I also apply this lint there?~~ TODO (not directly relevant for review): - [ ] https://github.com/rust-lang/rust/pull/59316#discussion_r280186517 (not sure yet, if this works or how to query for `rustc_private`, since it's not in [`Features`](https://doc.rust-lang.org/nightly/nightly-rustc/syntax/feature_gate/struct.Features.html) :thinking: cc @eddyb) - [x] https://github.com/rust-lang/rust/pull/61735#discussion_r292389870 - [x] Check explicitly for the `{declare,impl}_lint_pass!` macros r? @oli-obk
2019-07-03Add separate 'async_closure' feature gate.Mazdak Farrokhzad-0/+1
2019-07-02feature-gate member constraints outside of async-awaitNiko Matsakis-0/+1
Minimizes risk.
2019-06-29Rollup merge of #62104 - Zoxc:query-info, r=eddybMazdak Farrokhzad-0/+3
Inform the query system about properties of queries at compile time
2019-06-25Auto merge of #60732 - jswrenn:arbitrary_enum_discriminant, r=pnkfelixbors-0/+1
Implement arbitrary_enum_discriminant Implements RFC rust-lang/rfcs#2363 (tracking issue #60553).
2019-06-25Add some #[inline] attributesJohn Kåre Alsaker-0/+3
2019-06-24Use symbols in lint tool listflip1995-0/+1
2019-06-24Enable internal lints in bootstrapflip1995-1/+0
2019-06-24Only allow {declare,impl}_lint_pass macros for implementing LintPassflip1995-0/+3
2019-06-23let_chains: Add feature gate.Mazdak Farrokhzad-0/+1
2019-06-21Implement arbitrary_enum_discriminantJohn Wrenn-0/+1