summary refs log tree commit diff
path: root/src/librustc_borrowck
AgeCommit message (Collapse)AuthorLines
2015-08-02Added error explanation for E0384.Agoston Szepessy-1/+22
2015-07-28Auto merge of #27234 - oli-obk:move_get_name_get_ident_to_impl, r=eddybbors-2/+1
this has quite some fallout. but also made lots of stuff more readable imo [breaking-change] for plugin authors
2015-07-28remove `get_ident` and `get_name`, make `as_str` soundOliver Schneider-2/+1
2015-07-28build fragmented map earlier to make its dependencies clearer.Felix S. Klock II-4/+3
2015-07-28rustc and rustc::borrowck: pass fragment info down into trans.Felix S. Klock II-4/+98
2015-07-23Add long diagnostics for E0373Alisdair Owens-1/+50
2015-07-11Suggest using `ref` inline in an errorP1start-2/+13
2015-07-03Auto merge of #26378 - arielb1:unused-mut, r=pnkfelixbors-271/+135
This makes it somewhat more aggressive, so this is kind-of a [breaking-change] for these compiling with `#[deny(unused_mut)]`. r? @pnkfelix
2015-07-01Make the unused_mut lint smarter with respect to locals.Ariel Ben-Yehuda-17/+8
Fixes #26332
2015-07-01Clean-up assignment checking in borrowckAriel Ben-Yehuda-264/+137
2015-06-30Remove Typer and ClosureTyperJared Roesch-1/+0
This commit finalizes the work of the past commits by fully moving the fulfillment context into the InferCtxt, cleaning up related context interfaces, removing the Typer and ClosureTyper traits and cleaning up related intefaces
2015-06-30Remove Typer + ClosureTyper impls for ParameterEnvJared Roesch-7/+10
2015-06-26rustc: switch most remaining middle::ty functions to methods.Eduard Burtescu-27/+23
2015-06-24Use correct type for "use of moved value" error with closures.Nick Hamann-1/+1
Fixes #24357
2015-06-19rustc: remove Repr and UserString.Eduard Burtescu-98/+94
2015-06-19rustc: replace Repr/UserString impls with Debug/Display ones.Eduard Burtescu-32/+32
2015-06-19Clean up unused argument/variable warnings.Eduard Burtescu-6/+4
2015-06-19rustc: use the TLS type context in Repr and UserString.Eduard Burtescu-75/+75
2015-06-19rustc: leave only one free top-level function in ppaux, and private.Eduard Burtescu-2/+3
2015-06-19rustc: reduce ppaux's public footprint to 5 functions.Eduard Burtescu-20/+14
2015-06-16Remove unused type InteriorSafety.Eli Friedman-16/+4
2015-06-12Cleanup: rename middle::ty::sty and its variants.Eli Friedman-7/+7
Use camel-case naming, and use names which actually make sense in modern Rust.
2015-06-11Auto merge of #26190 - Veedrac:no-iter, r=alexcrichtonbors-3/+3
Pull request for #26188.
2015-06-11Conver reborrows to .iter() calls where appropriateJoshua Landau-2/+2
2015-06-10Removed many pointless calls to *iter() and iter_mut()Joshua Landau-1/+1
2015-06-10Auto merge of #26182 - Manishearth:rollup, r=Manishearthbors-9/+9
- Successful merges: #26142, #26143, #26145, #26146, #26164, #26174 - Failed merges:
2015-06-10Rollup merge of #26146 - steveklabnik:remove_unsafe_pointer, r=GankroManish Goregaokar-2/+2
Using two terms for one thing is confusing, these are called 'raw pointers' today.
2015-06-10syntax: move ast_map to librustc.Eduard Burtescu-2/+2
2015-06-09Exise 'unsafe pointer' in favor of 'raw pointer'Steve Klabnik-2/+2
Using two terms for one thing is confusing, these are called 'raw pointers' today.
2015-06-09Exise 'owned pointer' from the codebaseSteve Klabnik-7/+7
Still some references left to this old term, I've updated them to say boxes. Related to #25851
2015-05-27Auto merge of #25790 - eddyb:oh-snap-ctfe-arrived, r=alexcrichtonbors-3/+0
2015-05-27Remove #[cfg(stage0)] items.Eduard Burtescu-3/+0
2015-05-26Convert 15 diagnostics to have error codes (E0380-E0394).Nick Hamann-39/+59
Also adds explanations for E0380 and E0381.
2015-05-15libs: Move favicon URLs to HTTPSAlex Crichton-1/+1
Helps prevent mixed content warnings if accessing docs over HTTPS. Closes #25459
2015-05-03Update old uses of ~ in comments and debugging statementsCarol Nichols-1/+1
2015-04-30Auto merge of #24884 - michaelsproul:extended-errors, r=nrcbors-2/+5
I've been working on improving the diagnostic registration system so that it can: * Check uniqueness of error codes *across the whole compiler*. The current method using `errorck.py` is prone to failure as it relies on simple text search - I found that it breaks when referencing an error's ident within a string (e.g. `"See also E0303"`). * Provide JSON output of error metadata, to eventually facilitate HTML output, as well as tracking of which errors need descriptions. The current schema is: ``` <error code>: { "description": <long description>, "use_site": { "filename": <filename where error is used>, "line": <line in file where error is used> } } ``` [Here's][metadata-dump] a pretty-printed sample dump for `librustc`. One thing to note is that I had to move the diagnostics arrays out of the diagnostics modules. I really wanted to be able to capture error usage information, which only becomes available as a crate is compiled. Hence all invocations of `__build_diagnostics_array!` have been moved to the ends of their respective `lib.rs` files. I tried to avoid moving the array by making a plugin that expands to nothing but couldn't invoke it in item position and gave up on hackily generating a fake item. I also briefly considered using a lint, but it seemed like it would impossible to get access to the data stored in the thread-local storage. The next step will be to generate a web page that lists each error with its rendered description and use site. Simple mapping and filtering of the metadata files also allows us to work out which error numbers are absent, which errors are unused and which need descriptions. [metadata-dump]: https://gist.github.com/michaelsproul/3246846ff1bea71bd049
2015-04-30Add metadata output to the diagnostics system.Michael Sproul-2/+5
Diagnostic errors are now checked for uniqueness across the compiler and error metadata is written to JSON files.
2015-04-28Register new snapshotsTamir Duberstein-1/+0
2015-04-27Auto merge of #23606 - quantheory:associated_const, r=nikomatsakisbors-0/+14
Closes #17841. The majority of the work should be done, e.g. trait and inherent impls, different forms of UFCS syntax, defaults, and cross-crate usage. It's probably enough to replace the constants in `f32`, `i8`, and so on, or close to good enough. There is still some significant functionality missing from this commit: - ~~Associated consts can't be used in match patterns at all. This is simply because I haven't updated the relevant bits in the parser or `resolve`, but it's *probably* not hard to get working.~~ - Since you can't select an impl for trait-associated consts until partway through type-checking, there are some problems with code that assumes that you can check constants earlier. Associated consts that are not in inherent impls cause ICEs if you try to use them in array sizes or match ranges. For similar reasons, `check_static_recursion` doesn't check them properly, so the stack goes ka-blooey if you use an associated constant that's recursively defined. That's a bit trickier to solve; I'm not entirely sure what the best approach is yet. - Dealing with consts associated with type parameters will raise some new issues (e.g. if you have a `T: Int` type parameter and want to use `<T>::ZERO`). See rust-lang/rfcs#865. - ~~Unused associated consts don't seem to trigger the `dead_code` lint when they should. Probably easy to fix.~~ Also, this is the first time I've been spelunking in rustc to such a large extent, so I've probably done some silly things in a couple of places.
2015-04-23Functional changes for associated constants. Cross-crate usage of associated ↵Sean Patrick Santos-0/+14
constants is not yet working.
2015-04-18Rather than storing the relations between free-regions in a globalNiko Matsakis-7/+43
table, introduce a `FreeRegionMap` data structure. regionck computes the `FreeRegionMap` for each fn and stores the result into the tcx so that borrowck can use it (this could perhaps be refactored to have borrowck recompute the map, but it's a bid tedious to recompute due to the interaction of closures and free fns). The main reason to do this is because of #22779 -- using a global table was incorrect because when validating impl method signatures, we want to use the free region relationships from the *trait*, not the impl. Fixes #22779.
2015-04-15Dataflow changes and associated borrowck fix.Felix S. Klock II-6/+16
Revise rustc::middle::dataflow: one must select kill-kind when calling add_kill. The current kill-kinds are (1.) kills associated with ends-of-scopes and (2.) kills associated with the actual action of the expression/pattern. Then, use this to fix borrowck analysis so that it will not treat a break that pops through an assignment `x = { ... break; ... }` as a kill of the "moved-out" bit for `x`. Fix #24267. (incorporated review feedback.)
2015-04-10Improve error message where a closure escapes fn while trying to borrowNiko Matsakis-9/+74
from the current fn. Employ the new `span_suggestion` to show how you can use `move`.
2015-04-08Modify the ExprUseVisitor to walk each part of an AutoRef, and inNiko Matsakis-0/+3
particular to treat an AutoUnsize as as kind of "instantaneous" borrow of the value being unsized. This prevents us from feeding uninitialized data. This caused a problem for the eager reborrow of comparison traits, because that wound up introducing a "double AutoRef", which was not being thoroughly checked before but turned out not to type check. Fortunately, we can just remove that "eager reborrow" as it is no longer needed now that `PartialEq` doesn't force both LHS and RHS to have the same type (and even if we did have this problem, the better way would be to lean on introducing a common supertype).
2015-04-03In librustc*, convert many uses of ast::Ident to ast::Name, fixing much of ↵Jonathan S-3/+3
#6993.
2015-04-01Fallout out rustcNiko Matsakis-9/+9
2015-03-31Rollup merge of #23859 - pnkfelix:fsk-lesser-box, r=nikomatsakisManish Goregaokar-13/+39
Disallow writing through mutable pointers stored in non-mut Box. Fix #14270 The fix works by making `cmt::freely_aliasable` result more fine-grained. Instead of encoding the aliasability (i.e. whether the cmt is uniquely writable or not) as an option, now pass back an enum indicating either: 1. freely-aliasable (thus not uniquely-writable), 2. non-aliasable (thus uniquely writable), or 3. unique but immutable (and thus not uniquely writable, according to proposal from issue #14270.) This is all of course a giant hack that will hopefully go away with an eventually removal of special treatment of `Box<T>` (aka `ty_unique`) from the compiler.
2015-03-30Address Issue 14270 by making `cmt::freely_aliasable` result more fine-grained.Felix S. Klock II-9/+33
Instead of encoding the aliasability (i.e. whether the cmt is uniquely writable or not) as an option, now pass back an enum indicating either: 1. freely-aliasable (thus not uniquely-writable), 2. non-aliasble (thus uniquely writable), or 3. unique but immutable (and thus not uniquely writable, according to proposal from issue 14270.) This is all of course a giant hack that will hopefully go away with an eventually removal of special treatment of `Box<T>` (aka `ty_unique`) from the compiler.
2015-03-30Mucho debug instrumentation.Felix S. Klock II-4/+6
2015-03-28Rollup merge of #23803 - richo:unused-braces, r=ManishearthManish Goregaokar-4/+4
Pretty much what it says on the tin.