summary refs log tree commit diff
path: root/src/librustc_passes
AgeCommit message (Collapse)AuthorLines
2018-03-24Auto merge of #48482 - davidtwco:issue-47184, r=nikomatsakisbors-0/+1
NLL should identify and respect the lifetime annotations that the user wrote Part of #47184. r? @nikomatsakis
2018-03-23Merge branch 'master' of https://github.com/Lymia/rust into rollupAlex Crichton-2/+2
2018-03-22Added UserAssertTy statement.David Wood-0/+1
2018-03-21Fix type_dependent_defs ICE on method callsvarkor-4/+8
2018-03-19#49133 - Reworded the Error message: "`pub` not needed here" messageDileep Bapat-1/+1
2018-03-18Initial implementation of RFC 2151, Raw IdentifiersLymia Aluysia-2/+2
2018-03-17syntax: Make `_` an identifierVadim Petrochenkov-2/+4
2018-03-13refactor `ParamEnv::empty(Reveal)` into two distinct methodsNiko Matsakis-2/+1
- `ParamEnv::empty()` -- does not reveal all, good for typeck - `ParamEnv::reveal_all()` -- does, good for trans - `param_env.with_reveal_all()` -- converts an existing parameter environment
2018-03-09Auto merge of #48326 - RalfJung:generic-bounds, r=petrochenkovbors-0/+41
Warn about ignored generic bounds in `for` This adds a new lint to fix #42181. For consistency and to avoid code duplication, I also moved the existing "bounds in type aliases are ignored" here. Questions to the reviewer: * Is it okay to just remove a diagnostic error code like this? Should I instead keep the warning about type aliases where it is? The old code provided a detailed explanation of what's going on when asked, that information is now lost. On the other hand, `span_warn!` seems deprecated (after this patch, it has exactly one user left!). * Did I miss any syntactic construct that can appear as `for` in the surface syntax? I covered function types (`for<'a> fn(...)`), generic traits (`for <'a> Fn(...)`, can appear both as bounds as as trait objects) and bounds (`for<'a> F: ...`). * For the sake of backwards compatibility, this adds a warning, not an error. @nikomatsakis suggested an error in https://github.com/rust-lang/rust/issues/42181#issuecomment-306924389, but I feel that can only happen in a new epoch -- right? Cc @eddyb
2018-03-08Regenerate testsOliver Schneider-11/+2
2018-03-08TypoOliver Schneider-1/+1
2018-03-08rustc_passes::consts -> rvalue_promotionOliver Schneider-2/+2
2018-03-08Nuke ConstInt and Const*sizeOliver Schneider-8/+0
2018-03-08Nuke the entire ctfe from orbit, it's the only way to be sureOliver Schneider-147/+1
2018-03-08Move librustc_const_eval to librustc_mirOliver Schneider-3/+3
2018-03-08Produce instead of pointersOliver Schneider-9/+14
2018-03-06make bounds on higher-kinded lifetimes a hard error in ast_validationRalf Jung-0/+41
Also move the check for not having type parameters into ast_validation. I was not sure what to do with compile-fail/issue-23046.rs: The issue looks like maybe the bounds actually played a role in triggering the ICE, but that seems unlikely given that the compiler seems to entirely ignore them. However, I couldn't find a testcase without the bounds, so I figured the best I could do is to just remove the bounds and make sure at least that keeps working.
2018-03-02Replace Rc with Lrc for shared dataJohn Kåre Alsaker-3/+5
2018-02-24Rollup merge of #48084 - cramertj:impl-trait-errors, r=nikomatsakisManish Goregaokar-0/+137
Error on nested impl Trait and path projections from impl Trait cc #34511 r? @nikomatsakis
2018-02-24Rollup merge of #47987 - Zoxc:rm-recursion-checking, r=eddybManish Goregaokar-297/+0
Remove "static item recursion checking" in favor of relying on cycle checks in the query engine Tests are changed to use the cycle check error message instead. Some duplicate tests are removed. r? @eddyb
2018-02-23Auto merge of #47799 - topecongiro:fix-span-of-visibility, r=petrochenkovbors-15/+14
Fix span of visibility This PR 1. adds a closing parenthesis to the span of `Visibility::Crate` (e.g. `pub(crate)`). The current span only covers `pub(crate`. 2. adds a `span` field to `Visibility::Restricted`. This span covers the entire visibility expression (e.g. `pub (in self)`). Currently all we can have is a span for `Path`. This PR is motivated by the bug found in rustfmt (https://github.com/rust-lang-nursery/rustfmt/issues/2398). The first change is a strict improvement IMHO. The second change may not be desirable, as it adds a field which is currently not used by the compiler.
2018-02-20stage0 cfg cleanupMark Simulacrum-1/+0
2018-02-17Auto merge of #47408 - eddyb:deref-danger, r=nikomatsakisbors-13/+12
Don't promote to 'static the result of dereferences. This is a **breaking change**, removing copies out of dereferences from rvalue-to-`'static` promotion. With miri we won't easily know whether the dereference itself would see the same value at runtime as miri (e.g. after mutating a `static`) or even if it can be interpreted (e.g. integer pointers). One alternative to this ban is defining at least *some* of those situations as UB, i.e. you shouldn't have a reference in the first place, and you should work through raw pointers instead, to avoid promotion. **EDIT**: The other *may seem* to be to add some analysis which whitelists references-to-constant-values and assume any values produced by arbitrary computation to not be safe to promote dereferences thereof - but that means producing a reference from an associated constant or `const fn` would necessarily obscure it, and in the former case, this could still impact code that runs on stable today. What we do today to track "references to statics" only works because we restrict taking a reference to a `static` at all to other `static`s (which, again, are currently limited in that they can't be read at compile-time) and to runtime-only `fn`s (*not* `const fn`s). I'm primarily opening this PR with a conservative first approximation (e.g. `&(*r).a` is not allowed, only reborrows are, and in the old borrow only implicit ones from adjustments, at that) for cratering. r? @nikomatsakis
2018-02-18Change ast::Visibility to Spanned typeSeiichi Uchida-15/+14
2018-02-13Disallow projections from impl Trait typesTaylor Cramer-1/+68
2018-02-13Make nested impl Trait a hard errorTaylor Cramer-0/+70
2018-02-12Auto merge of #47843 - estebank:teach, r=nikomatsakisbors-4/+14
Add `-Zteach` documentation Add extra inline documentation to E0019, E0016, E0013, E0396, E0017, E0018, E0010, E0022, E0030, E0029, E0033, E0026 and E0027. Follow up to #47652.
2018-02-10Remove "static item recursion checking" in favor of relying on cycle checks ↵John Kåre Alsaker-297/+0
in the query engine
2018-02-07Add `-Zteach` documentationEsteban Küber-4/+14
Add extra inline documentation to E0019, E0016, E0013, E0396, E0017, E0018, E0010, E0022, E0030, E0029, E0033, E0026 and E0027.
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