summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2016-12-29Use `?` instead of `try!` macro in `print::pprust`Esteban Küber-857/+857
2016-12-28hir: lower `ImplicitSelf` to resolved `Self` TyQPath's.Eduard-Mihai Burtescu-8/+7
2016-12-26PTX supportJorge Aparicio-1/+18
- `--emit=asm --target=nvptx64-nvidia-cuda` can be used to turn a crate into a PTX module (a `.s` file). - intrinsics like `__syncthreads` and `blockIdx.x` are exposed as `"platform-intrinsics"`. - "cabi" has been implemented for the nvptx and nvptx64 architectures. i.e. `extern "C"` works. - a new ABI, `"ptx-kernel"`. That can be used to generate "global" functions. Example: `extern "ptx-kernel" fn kernel() { .. }`. All other functions are "device" functions.
2016-12-25Auto merge of #38566 - jseyfried:fix_import_resolution_bug, r=eddybbors-15/+14
Fix bug in import resolution Fixes #38535 and fixes #38556. r? @nrc
2016-12-24Auto merge of #38268 - withoutboats:parse_where_higher_rank_hack, r=eddybbors-0/+17
Prevent where < ident > from parsing. In order to be forward compatible with `where<'a>` syntax for higher rank parameters, prevent potential conflicts with UFCS from parsing correctly for the near term.
2016-12-23Auto merge of #38533 - jseyfried:legacy_custom_derive_deprecation, r=nrcbors-0/+2
Allow legacy custom derive authors to disable warnings in downstream crates This PR allows legacy custom derive authors to use a pre-deprecated method `registry.register_custom_derive()` instead of `registry.register_syntax_extension()` to avoid downstream deprecation warnings. r? @nrc
2016-12-23Auto merge of #38232 - jseyfried:refactor_global_paths, r=nrcbors-57/+84
Refactor global paths This PR removes the field `global: bool` from `ast::Path` and `hir::Path`, instead representing a global path `::foo::bar` as `{{root}}::foo::bar`, where `{{root}}` is a virtual keyword `keywords::CrateRoot`. Also, fixes #38016. r? @nrc
2016-12-23Allow legacy custom derive authors to disable warnings in downstream crates.Jeffrey Seyfried-0/+2
2016-12-23Fix import resolution bug and fold all idents in the AST.Jeffrey Seyfried-15/+14
2016-12-22Remove outdated FIXME commentEsteban Küber-4/+0
Removed FIXME comment referencing #3300.
2016-12-22Pretty-print `$crate::foo::bar` as `::foo::bar`.Jeffrey Seyfried-1/+2
2016-12-22Refactor how global paths are represented (for both ast and hir).Jeffrey Seyfried-57/+83
2016-12-21Auto merge of #38099 - GuillaumeGomez:cast_suggestions, r=nikomatsakisbors-0/+4
Cast suggestions r? @nikomatsakis
2016-12-20Rollup merge of #38171 - jseyfried:cleanup, r=nrcAlex Crichton-344/+145
Miscellaneous cleanup/refactoring in `resolve` and `syntax::ext` r? @nrc
2016-12-20Create check_ref method to allow to check coercion with & typesGuillaume Gomez-6/+0
2016-12-20Fix coercion ICEGuillaume Gomez-1/+2
2016-12-20Add safe_suggestion attributeGuillaume Gomez-0/+9
2016-12-19Optimize `ast::PathSegment`.Jeffrey Seyfried-184/+66
2016-12-19Auto merge of #38194 - sgrif:sg-no-span-mangling, r=nrcbors-15/+3
Don't perform span mangling when building field/tup access nodes There are no guarantees that the two spans used to create the new one come from the same place or are even valid. Fixes #36081.
2016-12-18Refactor out `mark.as_placeholder_id()`.Jeffrey Seyfried-5/+9
2016-12-18Avoid including attributes in bang macro invocations.Jeffrey Seyfried-25/+19
2016-12-18Remove scope placeholders, remove method `add_macro` of `ext::base::Resolver`.Jeffrey Seyfried-85/+38
2016-12-18Remove `MacroDef`'s fields `imported_from` and `allow_internal_unstable`,Jeffrey Seyfried-10/+4
remove `export` argument of `resolver.add_macro()`.
2016-12-18Add `ident.unhygienize()` and use `Ident` more instead of `Name` in `resolve`.Jeffrey Seyfried-4/+8
2016-12-18Remove some unused functions and fix formatting.Jeffrey Seyfried-36/+6
2016-12-17Auto merge of #38279 - KalitaAlexey:issue-8521, r=jseyfriedbors-1/+1
macros: allow a `path` fragment to be parsed as a type parameter bound Allow a `path` fragment to be parsed as a type parameter bound. Fixes #8521.
2016-12-17Auto merge of #38205 - jseyfried:fix_module_directory_regression, r=eddybbors-23/+30
macros: fix the expected paths for a non-inline module matched by an `item` fragment Fixes #38190. r? @nrc
2016-12-16Allow path fragments to be parsed as type parameter bounds in macro expansionKalita Alexey-1/+1
2016-12-12Auto merge of #38049 - frewsxcv:libunicode, r=alexcrichtonbors-2/+2
Rename 'librustc_unicode' crate to 'libstd_unicode'. Fixes https://github.com/rust-lang/rust/issues/26554.
2016-12-09Fix mistake.Without Boats-1/+1
2016-12-09Improve error message.Without Boats-1/+1
2016-12-09Prevent where < ident > from parsing.Without Boats-0/+17
In order to be forward compatible with `where<'a>` syntax for higher rank parameters, prevent potential conflicts with UFCS from parsing correctly for the near term.
2016-12-07Auto merge of #38191 - oli-obk:clippy_is_sad, r=eddybbors-104/+117
annotate stricter lifetimes on LateLintPass methods to allow them to forward to a Visitor this unblocks clippy (rustup blocked after #37918) clippy has lots of lints that internally call an `intravisit::Visitor`, but the current lifetimes on `LateLintPass` methods conflicted with the required lifetimes (there was no connection between the HIR elements and the `TyCtxt`) r? @Manishearth
2016-12-07macros: fix the expected paths for a non-inline module matched by an `item` ↵Jeffrey Seyfried-23/+30
fragment.
2016-12-06Don't perform span mangling when building field/tup access nodesSean Griffin-15/+3
There are no guarantees that the two spans used to create the new one come from the same place or are even valid. Fixes #36081.
2016-12-06Auto merge of #37973 - vadimcn:dllimport, r=alexcrichtonbors-7/+0
Implement RFC 1717 Implement the first two points from #37403. r? @alexcrichton
2016-12-06annotate stricter lifetimes on LateLintPass methods to allow them to forward ↵Oliver Schneider-104/+117
to a Visitor
2016-12-04Auto merge of #38087 - jooert:remove_unmarked, r=petrochenkovbors-4/+3
Remove the `unmarked_api` feature Closes #37981.
2016-12-04Auto merge of #38082 - jseyfried:macro_invocation_paths, r=nrcbors-6/+1
macros: support invocation paths (e.g. `foo::bar!()`) behind `#![feature(use_extern_macros)]` r? @nrc
2016-12-03Auto merge of #38079 - BurntSushi:attrtarget, r=alexcrichtonbors-0/+7
Add new #[target_feature = "..."] attribute. This commit adds a new attribute that instructs the compiler to emit target specific code for a single function. For example, the following function is permitted to use instructions that are part of SSE 4.2: #[target_feature = "+sse4.2"] fn foo() { ... } In particular, use of this attribute does not require setting the -C target-feature or -C target-cpu options on rustc. This attribute does not have any protections built into it. For example, nothing stops one from calling the above `foo` function on hosts without SSE 4.2 support. Doing so may result in a SIGILL. I've also expanded the x86 target feature whitelist.
2016-12-01Remove the "linked_from" feature.Vadim Chugunov-7/+0
2016-12-02limit the length of types in monomorphizationAriel Ben-Yehuda-0/+1
This adds the new insta-stable `#![type_size_limit]` crate attribute to control the limit, and is obviously a [breaking-change] fixable by that.
2016-11-30Support paths in macro invocations.Jeffrey Seyfried-6/+1
2016-11-30Update the bootstrap compilerAlex Crichton-2/+0
Now that we've got a beta build, let's use it!
2016-11-30Remove the `unmarked_api` featureJohannes Oertel-4/+3
Closes #37981.
2016-11-30Rename 'librustc_unicode' crate to 'libstd_unicode'.Corey Farwell-2/+2
Fixes #26554.
2016-11-29Add new #[target_feature = "..."] attribute.Andrew Gallant-0/+7
This commit adds a new attribute that instructs the compiler to emit target specific code for a single function. For example, the following function is permitted to use instructions that are part of SSE 4.2: #[target_feature = "+sse4.2"] fn foo() { ... } In particular, use of this attribute does not require setting the -C target-feature or -C target-cpu options on rustc. This attribute does not have any protections built into it. For example, nothing stops one from calling the above `foo` function on hosts without SSE 4.2 support. Doing so may result in a SIGILL. This commit also expands the target feature whitelist to include lzcnt, popcnt and sse4a. Namely, lzcnt and popcnt have their own CPUID bits, but were introduced with SSE4.
2016-11-29Auto merge of #37369 - estebank:multiline-span, r=nikomatsakisbors-0/+549
Show multiline spans in full if short enough When dealing with multiline spans that span few lines, show the complete span instead of restricting to the first character of the first line. For example, instead of: ``` % ./rustc file2.rs error[E0277]: the trait bound `{integer}: std::ops::Add<()>` is not satisfied --> file2.rs:13:9 | 13 | foo(1 + bar(x, | ^ trait `{integer}: std::ops::Add<()>` not satisfied | ``` show ``` % ./rustc file2.rs error[E0277]: the trait bound `{integer}: std::ops::Add<()>` is not satisfied --> file2.rs:13:9 | 13 | foo(1 + bar(x, | ________^ starting here... 14 | | y), | |_____________^ ...ending here: trait `{integer}: std::ops::Add<()>` not satisfied | ``` The [proposal in internals](https://internals.rust-lang.org/t/proposal-for-multiline-span-comments/4242/6) outlines the reasoning behind this.
2016-11-28Auto merge of #37791 - petrochenkov:where, r=nikomatsakisbors-27/+10
Support `?Sized` in where clauses Implemented as described in https://github.com/rust-lang/rust/issues/20503#issuecomment-258677026 - `?Trait` bounds are moved on type parameter definitions when possible, reported as errors otherwise. (It'd be nice to unify bounds and where clauses in HIR, but this is mostly blocked by rustdoc now - it needs to render bounds in pleasant way and the best way to do it so far is to mirror what was written in source code.) Fixes https://github.com/rust-lang/rust/issues/20503 r? @nikomatsakis
2016-11-28rustc: rework stability to be on-demand for type-directed lookup.Eduard Burtescu-3/+4