summary refs log tree commit diff
path: root/src/librustc_resolve
AgeCommit message (Collapse)AuthorLines
2015-05-14Rollup merge of #25398 - nham:E0066_E0069, r=huonwManish Goregaokar-6/+84
Adds explanations for E0053, E0066, E0069, E0251, E0252, E0255, E0256, E0368. cc #24407
2015-05-14Improve examples in the E0255/E0256 error explanations.Nick Hamann-5/+5
2015-05-14Add error explanations for E0053, E0251, E0252, E0255, E0256, E0368.Nick Hamann-6/+84
2015-05-14Auto merge of #25065 - quantheory:fix_associated_const_ambiguity_message, ↵bors-2/+5
r=nikomatsakis This fixes #24922 and #25017, and reduces the number of error messages that talk about "methods" when associated constants rather than methods are involved. I will admit that I haven't thought very carefully about the error messages. My goal has been to make more of the messages technically correct in all situations, and to avoid ICEs. But in some cases we could probably talk specifically about "methods" rather than "items".
2015-05-13Allow `T::C` syntax in match patterns to refer to trait-assosociated constants.Sean Patrick Santos-2/+5
2015-05-13Markdown formatting for error explanations.Ricardo Martins-0/+5
2015-05-12Rollup merge of #25267 - meqif:explain_e0317, r=alexcrichtonManish Goregaokar-4/+104
Add diagnostic message for E0317, E0154, E0259 and E0260; part of #24407. About E0317, I was unsure if I should add an example of what could be wrong, such as `struct i64`, `enum char { A, B }` or `type isize = i64`. I decided against it, since the diagnostic message looks clear enough to me. What do you think?
2015-05-12Auto merge of #25171 - quantheory:associated_time_long_paths, r=nikomatsakisbors-10/+13
It is currently broken to use syntax such as `<T as Foo>::U::static_method()` where `<T as Foo>::U` is an associated type. I was able to fix this and simplify the parser a bit at the same time. This also fixes the corresponding issue with associated types (#22139), but that's somewhat irrelevant because #22519 is still open, so this syntax still causes an error in type checking. Similarly, although this fix applies to associated consts, #25046 forbids associated constants from using type parameters or `Self`, while #19559 means that associated types have to always have one of those two. Therefore, I think that you can't use an associated const from an associated type anyway.
2015-05-12Auto merge of #24818 - tbelaire:double-import, r=nrcbors-12/+19
This isn't quite right, but it's interesting.
2015-05-11Add missing keyword in `extern crate` declarations.Ricardo Martins-7/+7
2015-05-11Improve wording in error explanation.Ricardo Martins-2/+2
2015-05-10Add error explanation for E0260.Ricardo Martins-1/+34
2015-05-10Add error explanation for E0259.Ricardo Martins-1/+20
2015-05-10Add error explanation for E0154.Ricardo Martins-1/+32
2015-05-10Fix documentation URL in diagnostic message.Ricardo Martins-1/+1
2015-05-10Add error explanation for E0317.Ricardo Martins-1/+18
2015-05-07Fix use of UFCS syntax to call methods on associated types.Sean Patrick Santos-10/+13
2015-05-01Fixed some nitsTheo Belaire-8/+5
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-29FalloutTamir Duberstein-26/+50
2015-04-25Fixed types, and slimmed down codeTheo Belaire-12/+4
I don't this we need to print the definition of the imported value too, though it's quite possible.
2015-04-25Maybe it worksTheo Belaire-3/+13
Still compiling, but I think I have it!
2015-04-25Now passing in the ImportResolver to check_conflict...Theo Belaire-17/+14
It compiles, yay.
2015-04-25First attempt at fixing #20591Theo Belaire-0/+11
This isn't quite right, but it's interesting.
2015-04-23Get associated consts working in match patterns.Sean Patrick Santos-67/+158
2015-04-23Functional changes for associated constants. Cross-crate usage of associated ↵Sean Patrick Santos-10/+32
constants is not yet working.
2015-04-23Structural changes for associated constantsSean Patrick Santos-4/+15
Introduces new variants and types in syntax::ast, middle::ty, and middle::def.
2015-04-21Change a few error messages to give code suggestionsP1start-2/+2
PR #24242 added the ability to the compiler to directly give suggestions about how to modify code to fix an error. The new errors look like this: foobar.rs:5:12: 5:25 error: expected a path on the left-hand side of `+`, not `&'static Copy` [E0178] foobar.rs:5 let x: &'static Copy + 'static; ^~~~~~~~~~~~~ foobar.rs:5:12: 5:35 help: try adding parentheses (per RFC 438): foobar.rs: let x: &'static (Copy + 'static); foobar.rs:2:13: 2:23 error: cast to unsized type: `&_` as `core::marker::Copy` foobar.rs:2 let x = &1 as Copy; ^~~~~~~~~~ foobar.rs:2:19: 2:23 help: try casting to a reference instead: foobar.rs: let x = &1 as &Copy; foobar.rs:7:24: 7:25 error: expected expression, found `;` foobar.rs:7 let x = box (1 + 1); ^ foobar.rs:7:13: 7:16 help: try using `box()` instead: foobar.rs: let x = box() (1 + 1); This also modifies compiletest to give the ability to directly test suggestions given by error messages.
2015-04-14Negative case of `len()` -> `is_empty()`Tamir Duberstein-2/+2
`s/([^\(\s]+\.)len\(\) [(?:!=)>] 0/!$1is_empty()/g`
2015-04-14Positive case of `len()` -> `is_empty()`Tamir Duberstein-4/+4
`s/(?<!\{ self)(?<=\.)len\(\) == 0/is_empty()/g`
2015-04-14Expose visibility for fns in syntax::visitNick Cameron-2/+2
2015-04-07Work with assoc types in a super trait.Nick Cameron-6/+6
And fix a bug with type param visibility though the Self rib.
2015-04-03Check uses of `Self` in impls in the compiler rather than during expansionNick Cameron-83/+94
Closes #23909
2015-04-01rollup merge of #23860: nikomatsakis/copy-requires-cloneAlex Crichton-13/+13
Conflicts: src/test/compile-fail/coherence-impls-copy.rs
2015-04-01Fallout out rustcNiko Matsakis-13/+13
2015-04-01Tidying up and reformattingNick Cameron-53/+41
2015-03-28Rollup merge of #23803 - richo:unused-braces, r=ManishearthManish Goregaokar-2/+2
Pretty much what it says on the tin.
2015-03-28cleanup: Remove unused braces in use statementsRicho Healey-2/+2
2015-03-27Test fixes and rebase conflicts, round 1Alex Crichton-1/+0
2015-03-27rollup merge of #23741: alexcrichton/remove-int-uintAlex Crichton-13/+10
Conflicts: src/librustc/middle/ty.rs src/librustc_trans/trans/adt.rs src/librustc_typeck/check/mod.rs src/libserialize/json.rs src/test/run-pass/spawn-fn.rs
2015-03-27default => or_insert per RFCAlexis Beingessner-6/+2
2015-03-26Mass rename uint/int to usize/isizeAlex Crichton-9/+8
Now that support has been removed, all lingering use cases are renamed.
2015-03-25rustc: Remove support for int/uintAlex Crichton-4/+2
This commit removes all parsing, resolve, and compiler support for the old and long-deprecated int/uint types.
2015-03-20Future-proof indexing on maps: remove IndexMutAaron Turon-2/+2
This commit removes the `IndexMut` impls on `HashMap` and `BTreeMap`, in order to future-proof the API against the eventual inclusion of an `IndexSet` trait. Ideally, we would eventually be able to support: ```rust map[owned_key] = val; map[borrowed_key].mutating_method(arguments); &mut map[borrowed_key]; ``` but to keep the design space as unconstrained as possible, we do not currently want to support `IndexMut`, in case some other strategy will eventually be needed. Code currently using mutating index notation can use `get_mut` instead. [breaking-change] Closes #23448
2015-03-18Fix private module loophole in the 'private type in public item' checkNick Cameron-3/+3
2015-03-16Reviewer changesNick Cameron-1/+1
2015-03-16resolve: factor out resolve imports to its own moduleNick Cameron-1063/+1118
2015-03-16Error if `pub use` references a private item.Nick Cameron-5/+31
[breaking-change] Closes #23266
2015-03-16Misc tidy ups in resolveNick Cameron-63/+56