summary refs log tree commit diff
path: root/src/librustc_resolve/lib.rs
AgeCommit message (Collapse)AuthorLines
2018-08-25resolve: Continue search in outer scopes after applying derive resolution ↵Vadim Petrochenkov-13/+15
fallback
2018-07-30Auto merge of #52805 - ljedrz:format_str_literal, r=petrochenkovbors-5/+6
Don't format!() string literals Prefer `to_string()` to `format!()` take 2, this time targetting string literals. In some cases (`&format!("...")` -> `"..."`) also removes allocations. Occurences of `format!("")` are changed to `String::new()`.
2018-07-29Replace push loops with collect() and extend() where possibleljedrz-3/+3
2018-07-29Auto merge of #52764 - sinkuu:cleanup, r=nikomatsakisbors-2/+2
Misc cleanups
2018-07-28Don't format!() string literalsljedrz-5/+6
2018-07-27Remove unnecessary `.collect()`Shotaro Yamada-2/+2
2018-07-25Deny bare_trait_objects globallyTatsuyuki Ishi-2/+0
2018-07-23Auto merge of #52589 - petrochenkov:derlint, r=alexcrichtonbors-17/+33
Attach deprecation lint `proc_macro_derive_resolution_fallback` to a specific node id So it can be `allow`-ed from inside the derive. cc https://github.com/rust-lang/rust/pull/51952
2018-07-23Auto merge of #52568 - oli-obk:span_bug_error, r=varkorbors-0/+2
Fix loop label resolution around constants And make `delay_span_bug` a little more helpful r? @varkor fixes #52442 fixes #52443
2018-07-21Attach deprecation lint `proc_macro_derive_resolution_fallback` to a ↵Vadim Petrochenkov-17/+33
specific node id
2018-07-20Properly scope label resolutionOliver Schneider-0/+2
2018-07-20resolve: Rename `global_macros` to `macro_prelude`Vadim Petrochenkov-3/+3
Rename `shadows_glob` to `shadowed_glob`
2018-07-20resolve: Remove unused parameter from `resolve_ident_in_module`Vadim Petrochenkov-6/+5
2018-07-19Auto merge of #52024 - oli-obk:existential_parse, r=nikomatsakisbors-1/+15
Implement existential types (not for associated types yet) r? @nikomatsakis cc @Centril @varkor @alexreg
2018-07-18Implement existential typesOliver Schneider-1/+15
2018-07-17rustc: Fix a suggestion for the `proc_macro` featureAlex Crichton-1/+1
This feature is stable, we shouldn't suggest it any more! Instead suggest the real feature, `use_extern_macros`.
2018-07-16rustc: Stabilize much of the `proc_macro` featureAlex Crichton-6/+2
This commit stabilizes some of the `proc_macro` language feature as well as a number of APIs in the `proc_macro` crate as [previously discussed][1]. This means that on stable Rust you can now define custom procedural macros which operate as attributes attached to items or `macro_rules!`-like bang-style invocations. This extends the suite of currently stable procedural macros, custom derives, with custom attributes and custom bang macros. Note though that despite the stabilization in this commit procedural macros are still not usable on stable Rust. To stabilize that we'll need to stabilize at least part of the `use_extern_macros` feature. Currently you can define a procedural macro attribute but you can't import it to call it! A summary of the changes made in this PR (as well as the various consequences) is: * The `proc_macro` language and library features are now stable. * Other APIs not stabilized in the `proc_macro` crate are now named under a different feature, such as `proc_macro_diagnostic` or `proc_macro_span`. * A few checks in resolution for `proc_macro` being enabled have switched over to `use_extern_macros` being enabled. This means that code using `#![feature(proc_macro)]` today will likely need to move to `#![feature(use_extern_macros)]`. It's intended that this PR, once landed, will be followed up with an attempt to stabilize a small slice of `use_extern_macros` just for procedural macros to make this feature 100% usable on stable. [1]: https://internals.rust-lang.org/t/help-stabilize-a-subset-of-macros-2-0/7252
2018-07-14Remove most of `PartialEq` impls from AST and HIR structuresVadim Petrochenkov-1/+1
2018-07-12Deny bare trait objects in src/librustc_resolveljedrz-4/+6
2018-07-11Rollup merge of #51952 - petrochenkov:transmark, r=alexcrichtonMark Rousskov-30/+61
hygiene: Decouple transparencies from expansion IDs And remove fallback to parent modules during resolution of names in scope. This is a breaking change for users of unstable macros 2.0 (both procedural and declarative), code like this: ```rust #![feature(decl_macro)] macro m($S: ident) { struct $S; mod m { type A = $S; } } fn main() { m!(S); } ``` or equivalent ```rust #![feature(decl_macro)] macro m($S: ident) { mod m { type A = $S; } } fn main() { struct S; m!(S); } ``` stops working due to module boundaries being properly enforced. For proc macro derives this is still reported as a compatibility warning to give `actix_derive`, `diesel_derives` and `palette_derive` time to fix their issues. Fixes https://github.com/rust-lang/rust/issues/50504 in accordance with [this comment](https://github.com/rust-lang/rust/issues/50504#issuecomment-399764767).
2018-07-09in which `use` suggestions meet edition 2018Zack M. Davis-1/+12
The intent here is to resolve #52202.
2018-07-08Remove fallback to parent modules from lexical resolutionVadim Petrochenkov-26/+57
2018-07-08hygiene: Decouple transparencies from expansion IDsVadim Petrochenkov-4/+4
2018-07-01absoluate -> absoluteTakanori Ishibashi-1/+1
2018-06-30Auto merge of #51762 - petrochenkov:oh-hi-mark, r=oli-obkbors-15/+43
hygiene: Implement transparent marks and use them for call-site hygiene in proc-macros Fixes https://github.com/rust-lang/rust/issues/50050
2018-06-30Auto merge of #51806 - oli-obk:lowering_cleanups1, r=cramertjbors-4/+5
Lowering cleanups [1/N]
2018-06-30Address commentsVadim Petrochenkov-2/+1
2018-06-30Restore the old behavior of `$crate` in nested `macro_rules`Vadim Petrochenkov-1/+25
`$crate` is not resolved at def-site of a macro, but rather at "transitive def-site"
2018-06-30Fortify dummy span checkingVadim Petrochenkov-4/+4
2018-06-30hygiene: Implement transparent marksVadim Petrochenkov-3/+10
2018-06-30resolve: Cleanup `resolve_crate_root`Vadim Petrochenkov-8/+6
2018-06-28Fix rebaseVadim Petrochenkov-5/+5
2018-06-28Use `Ident`s for associated item definitions in HIRVadim Petrochenkov-1/+1
Remove emulation of hygiene with gensyms
2018-06-28Use `Ident`s for path segments in HIRVadim Petrochenkov-10/+8
2018-06-27Generate `DefId`s for the impl trait of `async` functionsOliver Schneider-4/+5
2018-06-23hygiene: Rename `MarkKind` to `Transparency`Vadim Petrochenkov-2/+2
Move `is_builtin` for `Mark` to a separate flag
2018-06-21PathParameters -> GenericArgs fixesTaylor Cramer-5/+5
2018-06-21Add path parameters to std_pathTaylor Cramer-5/+25
2018-06-21Async methodsTaylor Cramer-52/+25
2018-06-21async await desugaring and testsTaylor Cramer-3/+87
2018-06-20Address various commentsvarkor-19/+19
2018-06-20Use ParamBounds in WhereRegionPredicatevarkor-3/+3
2018-06-20Lift bounds into GenericParamvarkor-2/+2
2018-06-20Rename structures in astvarkor-6/+6
2018-06-20Refactor generic parameters in rustdoc/cleanvarkor-10/+5
2018-06-20Refactor ast::GenericParam as a structvarkor-29/+44
2018-06-20Rename ast::GenericParam and ast::GenericArgvarkor-5/+5
It's so confusing to have everything having the same name, at least while refactoring.
2018-06-18Auto merge of #51414 - oli-obk:impl_trait_type_def, r=pnkfelixbors-0/+1
Add existential type definitions Note: this does not allow creating named existential types, it just desugars `impl Trait` to a less (but still very) hacky version of actual `existential type` items. r? @nikomatsakis
2018-06-14create multiple HIR items for a use statementQuietMisdreavus-41/+10
2018-06-11Fix extern prelude failure in rustdocGuillaume Gomez-1/+6