about summary refs log tree commit diff
path: root/src/librustc_passes
AgeCommit message (Collapse)AuthorLines
2018-02-05mir: Add TerminatorKind::FalseUnwindbobtwinkles-0/+1
Sometimes a simple goto misses the cleanup/unwind edges. Specifically, in the case of infinite loops such as those introduced by a loop statement without any other out edges. Analogous to TerminatorKind::FalseEdges; this new terminator kind is used when we want borrowck to consider an unwind path, but real control flow should never actually take it.
2018-01-28Suggest removing value from `break` when invalidEsteban Küber-0/+5
2018-01-22AST/HIR: Add a separate structure for labelsVadim Petrochenkov-8/+5
2018-01-15Rollup merge of #47417 - petrochenkov:noasm, r=estebankkennytm-48/+3
Move "no asm" check into AST validation
2018-01-14syntax: Rewrite parsing of implsVadim Petrochenkov-2/+60
Properly parse impls for the never type `!` Recover from missing `for` in `impl Trait for Type` Prohibit inherent default impls and default impls of auto traits Change wording in more diagnostics to use "auto traits" Some minor code cleanups in the parser
2018-01-13Move "no asm" check into AST validationVadim Petrochenkov-48/+3
2018-01-13Re-add support for `impl Trait for ..` to the parserVadim Petrochenkov-1/+6
2018-01-13Address review.leonardo.yvens-5/+5
2018-01-13Remove wfcheck for auto traits, remove dead error codesleonardo.yvens-6/+15
The WF checks are now done as an AST validation.
2018-01-13Remove `impl Foo for ..` in favor of `auto trait Foo`leonardo.yvens-3/+0
No longer parse it. Remove AutoTrait variant from AST and HIR. Remove backwards compatibility lint. Remove coherence checks, they make no sense for the new syntax. Remove from rustdoc.
2018-01-13Don't promote to 'static the result of dereferences.Eduard-Mihai Burtescu-13/+12
2018-01-07Try to fix a perf regression by updating logMalo Jaffré-1/+1
Upgrade `log` to `0.4` in multiple crates.
2018-01-04rustc: Don't use relative paths for extended errorsAlex Crichton-0/+1
These no longer work now that Cargo changes the cwd of rustc while it's running. Instead use an absolute path that's set by rustbuild.
2017-12-28Prefer to use attr::contains_name() and attr::find_by_name()Seiichi Uchida-3/+2
2017-12-24Auto merge of #46833 - diwic:7c-abort-ffi, r=arielb1bors-0/+1
Prevent unwinding past FFI boundaries Second attempt to write a patch to solve this. r? @nikomatsakis ~~So, my biggest issue with this patch is the way the patch determines *what* functions should have an abort landing pad (in `construct_fn`). I would ideally have this code match [src/librustc_trans/callee.rs::get_fn](https://github.com/rust-lang/rust/blob/master/src/librustc_trans/callee.rs#L107-L115) but couldn't find an id that returns true for `is_foreign_item`. Also tried `tcx.has_attr("unwind")` with no luck.~~ FIXED Other issues: * llvm.trap is an SIGILL on amd64. Ideally we could use panic-abort's version of aborting which is nicer but we don't want to depend on that library... * ~~Mir inlining is a stub currently.~~ FIXED (no-op) Also, when reviewing please take into account that I'm new to the code and only partially know what I'm doing... and that I've mostly made made matches on `TerminatorKind::Abort` match either `TerminatorKind::Resume` or `TerminatorKind::Unreachable` based on what looked best.
2017-12-21Add GenericParam, refactor Generics in ast, hir, rustdocJonas Platte-23/+34
The Generics now contain one Vec of an enum for the generic parameters, rather than two separate Vec's for lifetime and type parameters. Additionally, places that previously used Vec<LifetimeDef> now use Vec<GenericParam> instead.
2017-12-21Mir: Add Terminatorkind::AbortDavid Henningsson-0/+1
The Abort Terminatorkind will cause an llvm.trap function call to be emitted. Signed-off-by: David Henningsson <diwic@ubuntu.com>
2017-12-14add trait aliases to ASTAlex Burka-0/+14
2017-12-12Auto merge of #46570 - AgustinCB:issue-46553, r=oli-obkbors-0/+1
Ignore `unsopported constant expr` error Fixes #46553
2017-12-07Ignore `unsopported constant expr` errorAgustin Chiappe Berrini-0/+1
2017-12-07remove unnecessary changeAgustin Chiappe Berrini-1/+1
2017-12-07address commentsAgustin Chiappe Berrini-18/+15
2017-12-06and refactor to just move the checkingAgustin Chiappe Berrini-6/+23
2017-12-01MIR: s/lv(al(ue)?)?/place in function/variable/module names.Eduard-Mihai Burtescu-14/+14
2017-12-01MIR: s/Lvalue/Place in type names.Eduard-Mihai Burtescu-19/+19
2017-11-30Implement RFC 2128 (use_nested_groups)Pietro Albini-14/+19
This commit adds support for nested groups inside `use` declarations, such as `use foo::{bar, sub::{baz::Foo, *}};`.
2017-11-28MIR: split Operand::Consume into Copy and Move.Eduard-Mihai Burtescu-1/+2
2017-11-21Support `::crate` in pathsVadim Petrochenkov-13/+0
2017-11-14rustc: split off BodyOwnerKind from MirSource.Eduard-Mihai Burtescu-4/+3
2017-11-11Always report patterns more complex than `mut IDENT` as errorsVadim Petrochenkov-10/+17
2017-11-11Accept interpolated patterns in trait method parametersVadim Petrochenkov-25/+10
Remove some outdated messages from "no patterns allowed" errors
2017-11-09Auto merge of #45736 - oli-obk:rvalue_promotable_map, r=nikomatsakisbors-7/+9
Use a `Set<T>` instead of a `Map<T, bool>` r? @nikomatsakis introduced in #44501
2017-11-06Auto merge of #45668 - nikomatsakis:nll-free-region, r=arielb1bors-2/+3
extend NLL with preliminary support for free regions on functions This PR extends https://github.com/rust-lang/rust/pull/45538 with support for free regions. This is pretty preliminary and will no doubt want to change in various ways, particularly as we add support for closures, but it's enough to get the basic idea in place: - We now create specific regions to represent each named lifetime declared on the function. - Region values can contain references to these regions (represented for now as a `BTreeSet<RegionIndex>`). - If we wind up trying to infer that `'a: 'b` must hold, but no such relationship was declared, we report an error. It also does a number of drive-by refactorings. r? @arielb1 cc @spastorino
2017-11-04Auto merge of #45394 - davidtwco:rfc-2008, r=petrochenkovbors-0/+10
RFC 2008: Future-proofing enums/structs with #[non_exhaustive] attribute This work-in-progress pull request contains my changes to implement [RFC 2008](https://github.com/rust-lang/rfcs/pull/2008). The related tracking issue is #44109. As of writing, enum-related functionality is not included and there are some issues related to tuple/unit structs. Enum related tests are currently ignored. WIP PR requested by @nikomatsakis [in Gitter](https://gitter.im/rust-impl-period/WG-compiler-middle?at=59e90e6297cedeb0482ade3e).
2017-11-04Auto merge of #45384 - mikhail-m1:mir_add_false_edges_terminator_kind, r=arielb1bors-0/+1
add TerminatorKind::FalseEdges and use it in matches impl #45184 and fixes #45043 right way. False edges unexpectedly affects uninitialized variables analysis in MIR borrowck.
2017-11-03Implemented RFC 2008 for enums (not including variants) and structs.David Wood-0/+10
2017-11-03Parse auto traits the same as traits.leonardo.yvens-1/+16
This moves the well formedness checks to the AST validation pass. Tests were adjusted. The auto keyword should be back-compat now.
2017-11-03[Syntax Breaking] Rename DefaultImpl to AutoImplleonardo.yvens-1/+1
DefaultImpl is a highly confusing name for what we now call auto impls, as in `impl Send for ..`. The name auto impl is not formally decided but for sanity anything is better than `DefaultImpl` which refers neither to `default impl` nor to `impl Default`.
2017-11-03Use a `Set<T>` instead of a `Map<T, bool>`Oliver Schneider-7/+9
2017-11-02rename `Lookup` to `TyContext` and pass more info when visiting tysNiko Matsakis-2/+3
2017-11-02add TerminatorKind::FalseEdges and use it in matchesMikhail Modin-0/+1
2017-10-29Add several lints into `unused` lint groupVadim Petrochenkov-2/+1
Remove a couple of obsolete lints
2017-10-27Implement RFC 1861: Extern typesPaul Lietar-1/+1
2017-10-16convert constant promotion into a queryNiko Matsakis-33/+76
2017-10-16invoke const only on body-idsNiko Matsakis-14/+17
2017-10-14Implement `dyn Trait` syntaxVadim Petrochenkov-1/+1
2017-09-20Implement underscore lifetimesTaylor Cramer-8/+0
2017-09-12Auto merge of #44275 - eddyb:deferred-ctfe, r=nikomatsakisbors-8/+6
Evaluate fixed-length array length expressions lazily. This is in preparation for polymorphic array lengths (aka `[T; T::A]`) and const generics. We need deferred const-evaluation to break cycles when array types show up in positions which require knowing the array type to typeck the array length, e.g. the array type is in a `where` clause. The final step - actually passing bounds in scope to array length expressions from the parent - is not done because it still produces cycles when *normalizing* `ParamEnv`s, and @nikomatsakis' in-progress lazy normalization work is needed to deal with that uniformly. However, the changes here are still useful to unlock work on const generics, which @EpicatSupercell manifested interest in, and I might be mentoring them for that, but we need this baseline first. r? @nikomatsakis cc @oli-obk
2017-09-11Update comment to properly describe static promotion restrictionsAaron Hill-3/+4
2017-09-11rustc: use ConstVal::Unevaluated instead of mir::Literal::Item.Eduard-Mihai Burtescu-1/+0