summary refs log tree commit diff
path: root/src/librustc_resolve
AgeCommit message (Collapse)AuthorLines
2018-02-13Improve debuggability of #48116.kennytm-2/+13
1. When the invalid condition is hit, write out the relevant variables too 2. In compile-fail/parse-fail tests, check for ICE first, so the invalid error patterns won't mask our ICE output.
2018-02-10Explain unusual debugging code in librustcAlex Crichton-3/+8
Introduced in #47828 to help track down some bugs, it landed a bit hastily so this is intended on cleaning it up a bit.
2018-02-09rustc: Upgrade to LLVM 6Alex Crichton-2/+5
The following submodules have been updated for a new version of LLVM: - `src/llvm` - `src/libcompiler_builtins` - transitively contains compiler-rt - `src/dlmalloc` This also updates the docker container for dist-i686-freebsd as the old 16.04 container is no longer capable of building LLVM. The compiler-rt/compiler-builtins and dlmalloc updates are pretty routine without much interesting happening, but the LLVM update here is of particular note. Unlike previous updates I haven't cherry-picked all existing patches we had on top of our LLVM branch as we have a [huge amount][patches4] and have at this point forgotten what most of them are for. Instead I started from the current `release_60` branch in LLVM and only applied patches that were necessary to get our tests working and building. The current set of custom rustc-specific patches included in this LLVM update are: * rust-lang/llvm@1187443 - this is how we actually implement `cfg(target_feature)` for now and continues to not be upstreamed. While a hazard for SIMD stabilization this commit is otherwise keeping the status quo of a small rustc-specific feature. * rust-lang/llvm@013f2ec - this is a rustc-specific optimization that we haven't upstreamed, notably teaching LLVM about our allocation-related routines (which aren't malloc/free). Once we stabilize the global allocator routines we will likely want to upstream this patch, but for now it seems reasonable to keep it on our fork. * rust-lang/llvm@a65bbfd - I found this necessary to fix compilation of LLVM in our 32-bit linux container. I'm not really sure why it's necessary but my guess is that it's because of the absolutely ancient glibc that we're using. In any case it's only updating pieces we're not actually using in LLVM so I'm hoping it'll turn out alright. This doesn't seem like something we'll want to upstream.c * rust-lang/llvm@77ab1f0 - this is what's actually enabling LLVM to build in our i686-freebsd container, I'm not really sure what's going on but we for sure probably don't want to upstream this and otherwise it seems not too bad for now at least. * rust-lang/llvm@9eb9267 - we currently suffer on MSVC from an [upstream bug] which although diagnosed to a particular revision isn't currently fixed upstream (and the bug itself doesn't seem too active). This commit is a partial revert of the suspected cause of this regression (found via a bisection). I'm sort of hoping that this eventually gets fixed upstream with a similar fix (which we can replace in our branch), but for now I'm also hoping it's a relatively harmless change to have. After applying these patches (plus one [backport] which should be [backported upstream][llvm-back]) I believe we should have all tests working on all platforms in our current test suite. I'm like 99% sure that we'll need some more backports as issues are reported for LLVM 6 when this propagates through nightlies, but that's sort of just par for the course nowadays! In any case though some extra scrutiny of the patches here would definitely be welcome, along with scrutiny of the "missing patches" like a [change to pass manager order](rust-lang/llvm@27174447533), [another change to pass manager order](rust-lang/llvm@c782febb7b9), some [compile fixes for sparc](rust-lang/llvm@1a83de63c42), and some [fixes for solaris](rust-lang/llvm@c2bfe0abb). [patches4]: https://github.com/rust-lang/llvm/compare/5401fdf23...rust-llvm-release-4-0-1 [backport]: https://github.com/rust-lang/llvm/commit/5c54c252db [llvm-back]: https://bugs.llvm.org/show_bug.cgi?id=36114 [upstream bug]: https://bugs.llvm.org/show_bug.cgi?id=36096 --- The update to LLVM 6 is desirable for a number of reasons, notably: * This'll allow us to keep up with the upstream wasm backend, picking up new features as they start landing. * Upstream LLVM has fixed a number of SIMD-related compilation errors, especially around AVX-512 and such. * There's a few assorted known bugs which are fixed in LLVM 5 and aren't fixed in the LLVM 4 branch we're using. * Overall it's not a great idea to stagnate with our codegen backend! This update is mostly powered by #47730 which is allowing us to update LLVM *independent* of the version of LLVM that Emscripten is locked to. This means that when compiling code for Emscripten we'll still be using the old LLVM 4 backend, but when compiling code for any other target we'll be using the new LLVM 6 target. Once Emscripten updates we may no longer need this distinction, but we're not sure when that will happen! Closes #43370 Closes #43418 Closes #47015 Closes #47683 Closes rust-lang-nursery/stdsimd#157 Closes rust-lang-nursery/rust-wasm#3
2018-01-28use correct casing for rename suggestionsAndy Russell-3/+9
If the original name is uppercase, use camel case. Otherwise, use snake case.
2018-01-28Auto merge of #47767 - estebank:as-suggestion, r=petrochenkovbors-3/+9
Correctly format `extern crate` conflict resolution help Closes #45799. Follow up to @Cldfire's #45820. If the `extern` statement that will have a suggestion ends on a `;`, synthesize a new span that doesn't include it.
2018-01-27end_point handling multibyte characters correctly.David Wood-2/+2
2018-01-26Instead of modifying the item's span synthesize itEsteban Küber-1/+7
2018-01-25Correctly format `extern crate` conflict resolution helpCldfire-2/+2
2018-01-25Rollup merge of #47705 - pietroalbini:fix-47673, r=petrochenkovAlex Crichton-5/+5
Fix ICE when use trees have multiple empty nested groups The issue was caused by an oversight of mine in the original use_nested_groups PR, where different paths were resolved with the same `NodeId` in some cases (such as in `use {{}, {}};`). Fixes #47673 r? @petrochenkov
2018-01-25Rollup merge of #47502 - petrochenkov:label, r=eddybAlex Crichton-7/+7
AST/HIR: Add a separate structure for labels
2018-01-24Fix wrong span for nested empty groupsPietro Albini-1/+8
2018-01-24Fix ICE when use trees have multiple empty nested groupsPietro Albini-5/+5
2018-01-22AST/HIR: Add a separate structure for labelsVadim Petrochenkov-7/+7
2018-01-22Review fixesManish Goregaokar-2/+2
2018-01-22Store a list of local macros on the resolver; use for resolving intra-doc ↵Manish Goregaokar-1/+4
macro links
2018-01-22Resolve foreign macrosManish Goregaokar-1/+1
2018-01-22Fix tidyManish Goregaokar-1/+2
2018-01-22Handle relative pathsManish Goregaokar-28/+36
2018-01-22Make resolve_hir_path and resolve_str_path fallibleManish Goregaokar-10/+60
2018-01-21Rollup merge of #47512 - GuillaumeGomez:e0659, r=petrochenkovGuillaume Gomez-1/+54
Add E0659 for ambiguous names Still on the tracks of the "no error without error code" road.
2018-01-21Auto merge of #47116 - estebank:non-accessible-ctor, r=petrochenkovbors-18/+30
Tweaks to invalid ctor messages - Do not suggest using a constructor that isn't accessible - Suggest the appropriate syntax (`()`/`{}` as appropriate) - Add note when trying to use `Self` as a ctor CC #22488, fix #47085.
2018-01-20Fix tests by keepeing needed suggestionsEsteban Küber-1/+9
2018-01-18in which the unused-parens lint comes to cover function and method argsZack M. Davis-1/+1
Resolves #46137.
2018-01-18Add E0659 for ambiguous namesGuillaume Gomez-1/+54
2018-01-18Rollup merge of #47498 - dominikWin:missing-module-name, r=petrochenkovkennytm-8/+8
Make non-found module name optional No longer uses a magic string for missing or root module.
2018-01-18Rollup merge of #47444 - etaoins:dont-include-bang-in-macro-suggestion, ↵kennytm-2/+1
r=estebank Don't include bang in macro replacement suggestion When we suggest the replacement for a macro we include the "!" in the suggested replacement but the span only contains the name of the macro itself. Using that replacement would cause a duplicate "!" in the resulting code. I originally tried to extend the span to be replaced by 1 byte in rust-lang/rust#47424. However, @zackmdavis pointed out that there can be whitespace between the macro name and the bang. Instead, just remove the bang from the suggested replacement. Fixes #47418 r? @estebank
2018-01-16Make non-found module name optionalDominik Winecki-8/+8
No longer uses a magic string for missing or root module.
2018-01-15Review comments: remove enum suggestionEsteban Küber-25/+3
2018-01-15Further tweaks to the outputEsteban Küber-19/+16
- Properly address Variant Ctors - Show signature if span of trait method without `self` is not available
2018-01-15Reexport -> re-export in prose and documentation commentsCarol (Nichols || Goulding)-3/+3
2018-01-15Reexport -> re-export in error messagesCarol (Nichols || Goulding)-15/+16
2018-01-15address review commentsEsteban Küber-13/+10
2018-01-15Add note when trying to use `Self` as a ctorEsteban Küber-1/+5
2018-01-15Readd suggestion in enum variants with incorrect argsEsteban Küber-0/+12
2018-01-15Suggest the correct syntax for different struct typesEsteban Küber-12/+22
2018-01-15Hide suggestion to use struct ctor when it is not visibleEsteban Küber-5/+11
2018-01-15Don't include bang in macro replacement suggestionRyan Cumming-2/+1
When we suggest the replacement for a macro we include the "!" in the suggested replacement but the span only contains the name of the macro itself. Using that replacement would cause a duplicate "!" in the resulting code. I originally tried to extend the span to be replaced by 1 byte in rust-lang/rust#47424. However, @zackmdavis pointed out that there can be whitespace between the macro name and the bang. Instead, just remove the bang from the suggested replacement. Fixes #47418
2018-01-13Remove `impl Foo for ..` in favor of `auto trait Foo`leonardo.yvens-7/+1
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-13Auto merge of #47181 - michaelwoerister:var-len-def-index, r=eddybbors-3/+4
Use DefIndex encoding that works better with on-disk variable length integer representations. Use the least instead of the most significant bit for representing the address space. r? @eddyb
2018-01-12Auto merge of #46551 - jseyfried:improve_legacy_modern_macro_interaction, r=nrcbors-8/+17
macros: improve 1.0/2.0 interaction This PR supports using unhygienic macros from hygienic macros without breaking the latter's hygiene. ```rust // crate A: #[macro_export] macro_rules! m1 { () => { f(); // unhygienic: this macro needs `f` in its environment fn g() {} // (1) unhygienic: `g` is usable outside the macro definition } } // crate B: #![feature(decl_macro)] extern crate A; use A::m1; macro m2() { fn f() {} // (2) m1!(); // After this PR, `f()` in the expansion resolves to (2), not (3) g(); // After this PR, this resolves to `fn g() {}` from the above expansion. // Today, it is a resolution error. } fn test() { fn f() {} // (3) m2!(); // Today, `m2!()` can see (3) even though it should be hygienic. fn g() {} // Today, this conflicts with `fn g() {}` from the expansion, even though it should be hygienic. } ``` Once this PR lands, you can make an existing unhygienic macro hygienic by wrapping it in a hygienic macro. There is an [example](https://github.com/rust-lang/rust/pull/46551/commits/b766fa887dc0e4b923a38751fe4d570e35a75710) of this in the tests. r? @nrc
2018-01-08Use different DefIndex representation that is better suited for variable ↵Michael Woerister-3/+4
length integer encodings.
2018-01-07Try to fix a perf regression by updating logMalo Jaffré-1/+1
Upgrade `log` to `0.4` in multiple crates.
2018-01-07Auto merge of #47156 - petrochenkov:extpath, r=nikomatsakisbors-18/+26
Support `extern` in paths Implement the primary alternative to https://github.com/rust-lang/rust/pull/46613 + https://github.com/rust-lang/rust/pull/45771, achieving the same effect without requiring changes to other imports. Both need to be experimentally evaluated before making further progress. The PR also adds docs for all these related features into the unstable book. cc https://github.com/rust-lang/rust/issues/44660 r? @nikomatsakis
2018-01-07Rollup merge of #47170 - eddyb:us-vs-usize, r=nikomatsakiskennytm-2/+2
rustc: use {U,I}size instead of {U,I}s shorthands. `Us`/`Is` come from a time when `us` and `is` were the literal suffixes that are now `usize` / `isize`. r? @nikomatsakis
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.
2018-01-04rustc: use {U,I}size instead of {U,I}s shorthands.Eduard-Mihai Burtescu-2/+2
2018-01-03Support `extern` in pathsVadim Petrochenkov-18/+26
2017-12-28Auto merge of #47031 - topecongiro:issue-41719, r=jseyfriedbors-1/+9
Report an error when resolving non-ident macro path failed Closes #41719. Please feel free to bikeshed on the error message.
2017-12-28Prefer to use attr::contains_name() and attr::find_by_name()Seiichi Uchida-2/+1
2017-12-28Report an error when resolving non-ident macro path failedtopecongiro-1/+9