summary refs log tree commit diff
path: root/src/libsyntax/std_inject.rs
AgeCommit message (Collapse)AuthorLines
2017-08-30Make fields of `Span` privateVadim Petrochenkov-1/+1
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-3/+3
Like #43008 (f668999), but _much more aggressive_.
2017-08-12syntax: #[allow_internal_unsafe] bypasses the unsafe_code lint in macros.Eduard-Mihai Burtescu-0/+1
2017-07-28syntax: Add `tokens: Option<TokenStream>` to ItemAlex Crichton-0/+2
This commit adds a new field to the `Item` AST node in libsyntax to optionally contain the original token stream that the item itself was parsed from. This is currently `None` everywhere but is intended for use later with procedural macros.
2017-05-25Hygienize `librustc_resolve`.Jeffrey Seyfried-1/+1
2017-05-12Fix some clippy warnings in libsyntaxAndre Bogus-2/+2
This is mostly removing stray ampersands, needless returns and lifetimes.
2017-03-29Merge `ExpnId` and `SyntaxContext`.Jeffrey Seyfried-13/+8
2017-03-19Auto merge of #40346 - jseyfried:path_and_tokenstream_attr, r=nrcbors-5/+3
`TokenStream`-based attributes, paths in attribute and derive macro invocations This PR - refactors `Attribute` to use `Path` and `TokenStream` instead of `MetaItem`. - supports macro invocation paths for attribute procedural macros. - e.g. `#[::foo::attr_macro] struct S;`, `#[cfg_attr(all(), foo::attr_macro)] struct S;` - supports macro invocation paths for derive procedural macros. - e.g. `#[derive(foo::Bar, super::Baz)] struct S;` - supports arbitrary tokens as arguments to attribute procedural macros. - e.g. `#[foo::attr_macro arbitrary + tokens] struct S;` - supports using arbitrary tokens in "inert attributes" with derive procedural macros. - e.g. `#[derive(Foo)] struct S(#[inert arbitrary + tokens] i32);` where `#[proc_macro_derive(Foo, attributes(inert))]` r? @nrc
2017-03-14Refactor `Attribute` to use `Path` and `TokenStream` instead of `MetaItem`.Jeffrey Seyfried-5/+3
2017-03-10Give spans to individual path segments in ASTVadim Petrochenkov-1/+1
2017-02-03Switch logic to Span instead of HashMapGuillaume Gomez-1/+2
2016-12-22Refactor how global paths are represented (for both ast and hir).Jeffrey Seyfried-2/+1
2016-12-19Optimize `ast::PathSegment`.Jeffrey Seyfried-3/+2
2016-11-20Move `syntax::util::interner` -> `syntax::symbol`, cleanup.Jeffrey Seyfried-8/+8
2016-11-20Refactor `P<ast::MetaItem>` -> `ast::MetaItem`.Jeffrey Seyfried-2/+2
2016-11-20Move `MetaItemKind`'s `Name` to a field of `MetaItem`.Jeffrey Seyfried-1/+2
2016-11-20Refactor `MetaItemKind` to use `Name`s instead of `InternedString`s.Jeffrey Seyfried-3/+3
2016-11-20Refactor away `ast::Attribute_`.Jeffrey Seyfried-9/+7
2016-10-07Combine `std_inject::{no_core, no_std}` into `std_inject::injected_crate_name`.Jeffrey Seyfried-10/+12
2016-06-23Move errors from libsyntax to its own crateJonathan Turner-2/+2
2016-06-07Refactor away the prelude injection passJeffrey Seyfried-125/+47
2016-04-24syntax: Merge keywords and remaining special idents in one listVadim Petrochenkov-2/+2
Simplify the macro used for generation of keywords Make `Keyword::ident` private
2016-04-24syntax: Make static/super/self/Self keywords + special ident cleanupVadim Petrochenkov-2/+4
2016-02-11[breaking-change] don't glob export ast::Visibility variantsOliver 'ker' Schneider-2/+2
2016-02-11[breaking-change] don't glob export ast::MetaItem_Oliver 'ker' Schneider-1/+1
2016-02-11[breaking-change] don't glob export ast::Item_ variantsOliver 'ker' Schneider-2/+2
2015-10-01Stop re-exporting AttrStyle's variants and rename them.Ms2ger-1/+1
2015-08-28Move ExpnInfo to NameManish Goregaokar-3/+2
2015-08-27Enumify CompilerExpansion in ExpnInfoManish Goregaokar-2/+1
2015-08-03syntax: Implement #![no_core]Alex Crichton-30/+29
This commit is an implementation of [RFC 1184][rfc] which tweaks the behavior of the `#![no_std]` attribute and adds a new `#![no_core]` attribute. The `#![no_std]` attribute now injects `extern crate core` at the top of the crate as well as the libcore prelude into all modules (in the same manner as the standard library's prelude). The `#![no_core]` attribute disables both std and core injection. [rfc]: https://github.com/rust-lang/rfcs/pull/1184
2015-07-28remove `get_ident` and `get_name`, make `as_str` soundOliver Schneider-2/+1
2015-07-05Feature-gate #[prelude_import].Eduard Burtescu-15/+33
2015-03-27Unquote all crate names without underscoresRicho Healey-1/+1
2015-03-24rustc: Add support for `extern crate foo as bar`Alex Crichton-3/+3
The compiler will now issue a warning for crates that have syntax of the form `extern crate "foo" as bar`, but it will still continue to accept this syntax. Additionally, the string `foo-bar` will match the crate name `foo_bar` to assist in the transition period as well. This patch will land hopefully in tandem with a Cargo patch that will start translating all crate names to have underscores instead of hyphens. cc #23533
2015-02-20Remove remaining uses of `[]`. This time I tried to use deref coercions ↵Niko Matsakis-3/+3
where possible.
2015-02-18rollup merge of #22286: nikomatsakis/variance-4bAlex Crichton-5/+6
Conflicts: src/librustc/middle/infer/combine.rs src/librustc_typeck/check/wf.rs
2015-02-18Replace all uses of `&foo[]` with `&foo[..]` en masse.Niko Matsakis-1/+1
2015-02-18Fallout: remove unused type and region parameters.Niko Matsakis-5/+6
2015-02-07Fake up #![no_std] on pretty-printing; keep it out of ASTKeegan McAllister-13/+0
2015-02-07Don't use std:: paths in syntax extensions when compiling a #![no_std] crateKeegan McAllister-1/+1
Fixes #16803. Fixes #14342. Fixes half of #21827 -- slice syntax is still broken.
2015-01-21syntax: fix fallout of merging ast::ViewItem into ast::Item.Eduard Burtescu-32/+14
2015-01-07Test fixes and rebase conflictsAlex Crichton-13/+0
2015-01-07rollup merge of #20721: japaric/snapAlex Crichton-4/+17
Conflicts: src/libcollections/vec.rs src/libcore/fmt/mod.rs src/librustc/lint/builtin.rs src/librustc/session/config.rs src/librustc_trans/trans/base.rs src/librustc_trans/trans/context.rs src/librustc_trans/trans/type_.rs src/librustc_typeck/check/_match.rs src/librustdoc/html/format.rs src/libsyntax/std_inject.rs src/libsyntax/util/interner.rs src/test/compile-fail/mut-pattern-mismatched.rs
2015-01-07Preliminary feature stagingBrian Anderson-16/+5
This partially implements the feature staging described in the [release channel RFC][rc]. It does not yet fully conform to the RFC as written, but does accomplish its goals sufficiently for the 1.0 alpha release. It has three primary user-visible effects: * On the nightly channel, use of unstable APIs generates a warning. * On the beta channel, use of unstable APIs generates a warning. * On the beta channel, use of feature gates generates a warning. Code that does not trigger these warnings is considered 'stable', modulo pre-1.0 bugs. Disabling the warnings for unstable APIs continues to be done in the existing (i.e. old) style, via `#[allow(...)]`, not that specified in the RFC. I deem this marginally acceptable since any code that must do this is not using the stable dialect of Rust. Use of feature gates is itself gated with the new 'unstable_features' lint, on nightly set to 'allow', and on beta 'warn'. The attribute scheme used here corresponds to an older version of the RFC, with the `#[staged_api]` crate attribute toggling the staging behavior of the stability attributes, but the user impact is only in-tree so I'm not concerned about having to make design changes later (and I may ultimately prefer the scheme here after all, with the `#[staged_api]` crate attribute). Since the Rust codebase itself makes use of unstable features the compiler and build system to a midly elaborate dance to allow it to bootstrap while disobeying these lints (which would otherwise be errors because Rust builds with `-D warnings`). This patch includes one significant hack that causes a regression. Because the `format_args!` macro emits calls to unstable APIs it would trigger the lint. I added a hack to the lint to make it not trigger, but this in turn causes arguments to `println!` not to be checked for feature gates. I don't presently understand macro expansion well enough to fix. This is bug #20661. Closes #16678 [rc]: https://github.com/rust-lang/rfcs/blob/master/text/0507-release-channels.md
2015-01-07use slicing sugarJorge Aparicio-4/+4
2015-01-07Replace full slice notation with index callsNick Cameron-4/+4
2015-01-05Replace #[phase] with #[plugin] / #[macro_use] / #[no_link]Keegan McAllister-16/+2
2015-01-02std: Stabilize the prelude moduleAlex Crichton-2/+7
This commit is an implementation of [RFC 503][rfc] which is a stabilization story for the prelude. Most of the RFC was directly applied, removing reexports. Some reexports are kept around, however: * `range` remains until range syntax has landed to reduce churn. * `Path` and `GenericPath` remain until path reform lands. This is done to prevent many imports of `GenericPath` which will soon be removed. * All `io` traits remain until I/O reform lands so imports can be rewritten all at once to `std::io::prelude::*`. This is a breaking change because many prelude reexports have been removed, and the RFC can be consulted for the exact list of removed reexports, as well as to find the locations of where to import them. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0503-prelude-stabilization.md [breaking-change] Closes #20068
2014-12-30Fallout from stabilizationAaron Turon-1/+1
2014-12-21Fallout of std::str stabilizationAlex Crichton-4/+4