summary refs log tree commit diff
path: root/src/librustc_resolve
AgeCommit message (Collapse)AuthorLines
2017-01-17Unbreak beta.Jeffrey Seyfried-1/+2
2017-01-17Improve the warning cycle for `use $crate;`.Jeffrey Seyfried-1/+4
2017-01-06Don't `unused_qualifications`-check global paths.Jeffrey Seyfried-1/+1
2017-01-06Style fixesJosh Driver-2/+1
2017-01-06Stop macro calls in structs for proc_macro_derive from panicingJosh Driver-0/+5
2017-01-06Fix regression with duplicate `#[macro_export] macro_rules!`.Jeffrey Seyfried-1/+7
2016-12-30Demote most backwards incompatible ambiguity errors from RFC 1560 to warnings.Jeffrey Seyfried-28/+70
2016-12-30Fix non-termination in `resolve`.Jeffrey Seyfried-1/+2
2016-12-16Address falloutAaron Turon-6/+3
2016-12-15Fix regression in resolution of primitive typesVadim Petrochenkov-2/+4
2016-12-07Auto merge of #38191 - oli-obk:clippy_is_sad, r=eddybbors-22/+24
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-06annotate stricter lifetimes on LateLintPass methods to allow them to forward ↵Oliver Schneider-22/+24
to a Visitor
2016-12-05Warn when an import list is emptyEsteban Küber-0/+6
For a given file ```rust use std::*; use std::{}; ``` output the following warnings ``` warning: unused import: `use std::{};`, #[warn(unused_imports)] on by default --> file.rs:2:1 | 2 | use std::{}; | ^^^^^^^^^^^^ warning: unused import: `std::*;`, #[warn(unused_imports)] on by default --> file.rs:1:5 | 1 | use std::*; | ^^^^^^^ ```
2016-12-04Auto merge of #38082 - jseyfried:macro_invocation_paths, r=nrcbors-50/+124
macros: support invocation paths (e.g. `foo::bar!()`) behind `#![feature(use_extern_macros)]` r? @nrc
2016-11-30Support paths in macro invocations.Jeffrey Seyfried-47/+115
2016-11-30Minor cleanup.Jeffrey Seyfried-11/+17
2016-11-30Auto merge of #37800 - alexcrichton:new-bootstrap, r=eddybbors-1/+0
Update the bootstrap compiler Now that we've got a beta build, let's use it!
2016-11-30Update the bootstrap compilerAlex Crichton-1/+0
Now that we've got a beta build, let's use it!
2016-11-29Remove `resolver.record_resolution()`.Jeffrey Seyfried-5/+1
2016-11-29Simplify `binding.module()`.Jeffrey Seyfried-10/+8
2016-11-29Clean up formatting.Jeffrey Seyfried-134/+103
2016-11-29Refactor away `ResolveResult`.Jeffrey Seyfried-86/+45
2016-11-29Refactor path resoloution.Jeffrey Seyfried-543/+284
2016-11-28Use `Def::Err` to signal that an error has already been reported where possible.Jeffrey Seyfried-63/+48
2016-11-28Auto merge of #38024 - jseyfried:avoid_needless_proc_macro_deps, r=nrcbors-4/+10
Avoid loading needless proc-macro dependencies Fixes #37958 when no proc-macros are exported; in particular, without `pub extern crate proc_macros;`, `#![feature(macro_reexport)]`, or `#![feature(use_extern_macros)]`. I opened https://github.com/rust-lang/cargo/issues/3334 for exported proc macros. r? @alexcrichton
2016-11-28Avoid loading needless proc-macro dependencies.Jeffrey Seyfried-4/+10
2016-11-28rustc: embed path resolutions into the HIR instead of keeping DefMap.Eduard-Mihai Burtescu-4/+3
2016-11-24Auto merge of #37951 - jseyfried:improve_macro_resolution_perf, r=nrcbors-34/+21
macros: improve resolution performance Avoid quadratic legacy macro name resolution in more cases. r? @nrc
2016-11-23macros: improve performance of legacy name resolution.Jeffrey Seyfried-34/+21
2016-11-21Implement the `loop_break_value` feature.Geoffry Song-4/+7
This implements RFC 1624, tracking issue #37339. - `FnCtxt` (in typeck) gets a stack of `LoopCtxt`s, which store the currently deduced type of that loop, the desired type, and a list of break expressions currently seen. `loop` loops get a fresh type variable as their initial type (this logic is stolen from that for arrays). `while` loops get `()`. - `break {expr}` looks up the broken loop, and unifies the type of `expr` with the type of the loop. - `break` with no expr unifies the loop's type with `()`. - When building MIR, `loop` loops no longer construct a `()` value at termination of the loop; rather, the `break` expression assigns the result of the loop. `while` loops are unchanged. - `break` respects contexts in which expressions may not end with braced blocks. That is, `while break { break-value } { while-body }` is illegal; this preserves backwards compatibility. - The RFC did not make it clear, but I chose to make `break ()` inside of a `while` loop illegal, just in case we wanted to do anything with that design space in the future. This is my first time dealing with this part of rustc so I'm sure there's plenty of problems to pick on here ^_^
2016-11-21Auto merge of #37824 - jseyfried:symbols, r=eddybbors-25/+20
Clean up `ast::Attribute`, `ast::CrateConfig`, and string interning This PR - removes `ast::Attribute_` (changing `Attribute` from `Spanned<Attribute_>` to a struct), - moves a `MetaItem`'s name from the `MetaItemKind` variants to a field of `MetaItem`, - avoids needlessly wrapping `ast::MetaItem` with `P`, - moves string interning into `syntax::symbol` (`ast::Name` is a reexport of `symbol::Symbol` for now), - replaces `InternedString` with `Symbol` in the AST, HIR, and various other places, and - refactors `ast::CrateConfig` from a `Vec` to a `HashSet`. r? @eddyb
2016-11-21Cleanup.Jeffrey Seyfried-60/+22
2016-11-21Stabilize RFC 1560.Jeffrey Seyfried-2/+2
2016-11-21Cleanup `InternedString`.Jeffrey Seyfried-12/+10
2016-11-21Use `Symbol` instead of `InternedString` in the AST, HIR, and various other ↵Jeffrey Seyfried-3/+3
places.
2016-11-20Move `syntax::util::interner` -> `syntax::symbol`, cleanup.Jeffrey Seyfried-5/+5
2016-11-20Refactor `MetaItemKind` to use `Name`s instead of `InternedString`s.Jeffrey Seyfried-6/+3
2016-11-20Refactor away `ast::Attribute_`.Jeffrey Seyfried-1/+1
2016-11-17Cleanup formatting.Jeffrey Seyfried-23/+28
2016-11-17Add feature `use_extern_macros`.Jeffrey Seyfried-133/+234
2016-11-17Refactor out `PerNS`.Jeffrey Seyfried-176/+184
2016-11-17Add field `expansion: Mark` to `NameBinding`.Jeffrey Seyfried-43/+68
2016-11-17Refactor `Resolver::builtin_macros` to use `NameBinding`s instead of `DefId`s.Jeffrey Seyfried-12/+20
2016-11-17Resolve imports during expansion.Jeffrey Seyfried-20/+13
2016-11-17Add field `module.unresolved_invocations`.Jeffrey Seyfried-3/+14
2016-11-11Auto merge of #37456 - estebank:unused-imports-verbosity, r=jonathandturnerbors-12/+42
Group unused import warnings per import list Given a file ``` rust use std::collections::{BinaryHeap, BTreeMap, BTreeSet}; fn main() {} ``` Show a single warning, instead of three for each unused import: ``` nocode warning: unused imports, #[warn(unused_imports)] on by default --> file2.rs:1:24 | 1 | use std::collections::{BinaryHeap, BTreeMap, BTreeSet}; | ^^^^^^^^^^ ^^^^^^^^ ^^^^^^^^ ``` Include support for lints pointing at `MultilineSpan`s, instead of just `Span`s. Fixes #16132.
2016-11-11Auto merge of #37447 - estebank:non-duplicate-definition-error, r=nrcbors-1/+13
Show one error for duplicated type definitions For the following code: ``` rustc struct Bar; struct Bar; fn main () { } ``` show ``` nocode error[E0428]: a type named `Bar` has already been defined in this module --> src/test/compile-fail/E0428.rs:12:1 | 11 | struct Bar; | ----------- previous definition of `Bar` here 12 | struct Bar; | ^^^^^^^^^^^ error: aborting due to previous error ``` instead of ``` nocode error[E0428]: a type named `Bar` has already been defined in this module --> src/test/compile-fail/E0428.rs:12:1 | 11 | struct Bar; | ----------- previous definition of `Bar` here 12 | struct Bar; | ^^^^^^^^^^^ error[E0428]: a value named `Bar` has already been defined in this module --> src/test/compile-fail/E0428.rs:12:1 | 11 | struct Bar; | ----------- previous definition of `Bar` here 12 | struct Bar; | ^^^^^^^^^^^ error: aborting due to 2 previous errors ``` Fixes #35767.
2016-11-10Auto merge of #37645 - jseyfried:fix_crate_var_in_custom_derives, r=nrcbors-1/+28
Fix regression involving custom derives on items with `$crate` The regression was introduced in #37213. I believe we cannot make the improvements from #37213 work with the current custom derive setup (c.f. https://github.com/rust-lang/rust/issues/37637#issuecomment-258959145) -- we'll have to wait for `TokenStream`'s API to improve. Fixes #37637. r? @nrc
2016-11-10Support `#[macro_reexport]`ing custom derives.Jeffrey Seyfried-73/+48
2016-11-10Elimite `$crate` before invokng custom derives.Jeffrey Seyfried-1/+28