- 29 7月, 2017 1 次提交
-
-
由 Alex Crichton 提交于
This is then later used by `proc_macro` to generate a new `proc_macro::TokenTree` which preserves span information. Unfortunately this isn't a bullet-proof approach as it doesn't handle the case when there's still other attributes on the item, especially inner attributes. Despite this the intention here is to solve the primary use case for procedural attributes, attached to functions as outer attributes, likely bare. In this situation we should be able to now yield a lossless stream of tokens to preserve span information.
-
- 28 7月, 2017 17 次提交
-
-
由 Alex Crichton 提交于
This test currently fails because the tokenization of an AST item during the expansion of a procedural macro attribute rounds-trips through strings, losing span information.
-
由 Alex Crichton 提交于
This partly resolves the `FIXME` located in `src/libproc_macro/lib.rs` when interpreting interpolated tokens. All instances of `ast::Item` which have a list of tokens attached to them now use that list of tokens to losslessly get converted into a `TokenTree` instead of going through stringification and losing span information. cc #43081
-
由 Alex Crichton 提交于
This commit adds a new field to the `Item` AST node in libsyntax to optionally contain the original token stream that the item itself was parsed from. This is currently `None` everywhere but is intended for use later with procedural macros.
-
由 bors 提交于
Embed MSVC .natvis files into .pdbs and mangle debuginfo for &str, *T, and [T]. No idea if these changes are reasonable - please feel free to suggest changes/rewrites. And these are some of my first real commits to any rust codebase - *don't* be gentle, and nitpick away, I need to learn! ;) ### Overview Embedding `.natvis` files into `.pdb`s allows MSVC (and potentially other debuggers) to automatically pick up the visualizers without having to do any additional configuration (other than to perhaps add the relevant .pdb paths to symbol search paths.) The native debug engine for MSVC parses the type names, making various C++ish assumptions about what they mean and adding various limitations to valid type names. `&str` cannot be matched against a visualizer, but if we emit `str&` instead, it'll be recognized as a reference to a `str`, solving the problem. `[T]` is similarly problematic, but emitting `slice<T>` instead works fine as it looks like a template. I've been unable to get e.g. `slice<u32>&` to match visualizers in VS2015u3, so I've gone with `str*` and `slice<u32>*` instead. ### Possible Issues * I'm not sure if `slice<T>` is a great mangling for `[T]` or if I should worry about name collisions. * I'm not sure if `linker.rs` is the right place to be enumerating natvis files. * I'm not sure if these type name mangling changes should actually be MSVC specific. I recall seeing gdb visualizer tests that might be broken if made more general? I'm hesitant to mess with them without a gdb install. But perhaps I'm just wracking up technical debt. Should I try `pacman -S mingw-w64-x86_64-gdb` and to make things consistent? * I haven't touched `const` / `mut` yet, and I'm worried MSVC might trip up on `mut` or their placement. * I may like terse oneliners too much. * I don't know if there's broader implications for messing with debug type names here. * I may have been mistaken about bellow test failures being ignorable / unrelated to this changelist. ### Test Failures on `x86_64-pc-windows-gnu` ``` ---- [debuginfo-gdb] debuginfo-gdb\associated-types.rs stdout ---- thread '[debuginfo-gdb] debuginfo-gdb\associated-types.rs' panicked at 'gdb not available but debuginfo gdb debuginfo test requested', src\tools\compiletest\src\runtest.rs:48:16 note: Run with `RUST_BACKTRACE=1` for a backtrace. [...identical panic causes omitted...] ---- [debuginfo-gdb] debuginfo-gdb\vec.rs stdout ---- thread '[debuginfo-gdb] debuginfo-gdb\vec.rs' panicked at 'gdb not available but debuginfo gdb debuginfo test requested', src\tools\compiletest\src\runtest.rs:48:16 ``` ### Relevant Issues * https://github.com/rust-lang/rust/issues/40460 Metaissue for Visual Studio debugging Rust * https://github.com/rust-lang/rust/issues/36503 Investigate natvis for improved msvc debugging * https://github.com/PistonDevelopers/VisualRust/issues/160 Debug visualization of Rust data structures ### Pretty Pictures ![Collapsed Watch Window](https://user-images.githubusercontent.com/75894/28180998-e44c7516-67bb-11e7-8b48-d4f9605973ae.png) ![Expanded Watch Window](https://user-images.githubusercontent.com/75894/28181000-e8da252e-67bb-11e7-96b8-d613310c04dc.png)
-
由 bors 提交于
rustc_const_eval: always require Substs and a ParamEnv. Fixes #43357 by tracking the `Substs` and `ParamEnv` for const-evaluation in generic contexts.
-
由 bors 提交于
Use `rustc_on_unimplemented`'s trait name argument in `try` Follow up to #43000 and #43001. Fix #42694.
-
由 bors 提交于
Make the macro parser theory description more accurate The macro parser is described as an NFA, not an Earley parser.
-
由 Esteban Küber 提交于
-
由 bors 提交于
Add precondition to `Layout` that the `align` fit in a u32. Add precondition to `Layout` that the `align` not exceed 2^31. This precondition takes the form of a behavorial change in `Layout::from_size_align` (so it returns `None` if the input `align` is too large) and a new requirement for safe usage of `Layout::from_size_align_unchecked`. Fix #30170.
-
由 bors 提交于
syntax: Simplify parsing of paths Discern between `Path` and `Path<>` in AST (but not in HIR). Give span to angle bracketed generic arguments (`::<'a, T>` in `path::segment::<'a, T>`). This is a refactoring in preparation for https://internals.rust-lang.org/t/macro-path-uses-novel-syntax/5561/3, but it doesn't add anything to the grammar yet. r? @jseyfried
-
由 Vadim Petrochenkov 提交于
-
由 Vadim Petrochenkov 提交于
-
由 Vadim Petrochenkov 提交于
-
由 Vadim Petrochenkov 提交于
-
由 bors 提交于
Improve checking of conflicting packed and align representation hints on structs and unions. Fixes #43317 and improves #33626.
-
由 Eduard-Mihai Burtescu 提交于
-
由 bors 提交于
Compile rustdoc on-demand Fixes #43284, fixes #38318, and fixes #39505. Doesn't directly help with https://github.com/rust-lang/rust/issues/42686, since we need to rebuild just as much. In fact, this hurts it, since `./x.py doc --stage 0` will now fail. I'm not sure if it did before, but with these changes it runs into the problem where we attempt to use artifacts from bootstrap rustc with a non-bootstrap rustdoc, running into version conflicts. I believe this is solvable, but leaving for a future PR. This means that rustdoc will no longer be compiled when compiling rustc, by default. However, it is still built from `./x.py build` (for hosts, but not targets, since we don't produce compiler toolchains for them) and will be built for doc tests and crate tests. After this, the recommended workflow if you want a rustdoc is: `./x.py build --stage 1 src/tools/rustdoc` which will give you a working rustdoc in `build/triple/stage1/bin/rustdoc`. Note that you can add `src/libstd` onto the command to compile libstd as well so that the rustdoc can easily compile crates in the wild. `./x.py doc --stage 1 src/libstd` will document `libstd` with a freshly built rustdoc (if necessary), and will not rebuild rustc on modifications to rustdoc. r? @alexcrichton
-
- 27 7月, 2017 20 次提交
-
-
由 Mark Simulacrum 提交于
-
由 bors 提交于
Copyright/license headers (As discussed with @aturon and @est31. CC @rust-lang/core.) Currently, rust-lang/rust includes notices that say things like ``` The Rust Project is copyright 2010, The Rust Project Developers. ``` or ``` Copyright (c) 2010 The Rust Project Developers ``` or ``` // Copyright 2017 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. ``` These notices aren't accurate. "Copyright YYYY Some Name" has a specific legal meaning, and "The Rust Project Developers" isn't a legal entity. In practice, the actual legal structure is that all Rust contributors retain their copyrights when contributing to Rust, and just license them under MIT/Apache-2.0. Our legal notices should reflect that. This came up because of RFC 2044, which proposed fixing this for the RFC repository. That effort started out by copying the rust-lang/rust notices, propagating this issue. Based on discussion with @aturon, the two of us propose the following: - Delete the per-file notices entirely, for any files licensed under the standard terms. (Keep notices for anything that's *not* MIT/Apache-2.0.) - An alternative to that would be to just delete the first paragraph of the standard notice, and keep the second paragraph that points to the MIT and Apache 2.0 licenses. - Delete the first paragraph of LICENSE-MIT (the inaccurate pseudo-copyright line), leaving only the text of the MIT license. - Edit the COPYRIGHT file to more accurately describe the situation (changing the pseudo-copyright line immediately under "longer version", and editing the text that starts with "additional copyright may be ...", to just always state that copyrights are retained by the Rust contributors, and licensed under MIT/Apache-2.0 (with the exceptions to that explicitly noted in that file). If @rust-lang/core is fine with this proposal, I'd be happy to provide a pull request with the proposed fixes.
-
由 Mark Simulacrum 提交于
-
由 Mark Simulacrum 提交于
Previously we'd build libsyntax without it when documenting and that'd cause us to recompile it when building normally for no reason.
-
由 Mark Simulacrum 提交于
-
由 Mark Simulacrum 提交于
For most tests, rustdoc isn't needed, so avoid building it.
-
由 Mark Simulacrum 提交于
Rustdoc is no longer compiled in every stage, alongside rustc, instead it is only compiled when requested, and generally only for the last stage.
-
由 Mark Simulacrum 提交于
-
由 Mark Simulacrum 提交于
-
由 bors 提交于
Better diagnostics and recovery for `mut ref` in patterns Fixes https://github.com/rust-lang/rust/issues/43286 Supersedes https://github.com/rust-lang/rust/pull/43451 r? @GuillaumeGomez
-
由 Eduard-Mihai Burtescu 提交于
-
由 bors 提交于
Extended error message for mut borrow conflicts in loops RFC issue: https://github.com/rust-lang/rfcs/issues/2080 The error message for multiple mutable borrows on the same value over loop iterations now makes it clear that the conflict comes from the borrow outlasting the loop. The wording of the error is based on the special case of the moved-value error for a value moved in a loop. Following the example of that error, the code remains the same for the special case. This is mainly because I felt the current message is confusing in the loop case : https://github.com/rust-lang/rust/issues/43437. It's not clear that the two conflicting borrows are in different iterations of the loop, and instead it just looks like the compiler has an issue with a single line.
-
由 bors 提交于
Switch to begin_panic again In https://github.com/rust-lang/rust/pull/42938 we made the compiler emit a call to begin_panic_new in order to pass column info to it. Now with stage0 updated (https://github.com/rust-lang/rust/pull/43320), we can safely change begin_panic and start emitting calls for it again.
-
由 bors 提交于
rustdoc: make major section headers self-links The sidebar already has links to these h2's ids, but for convenience, the h2 itself should also be a link (retaining its present appearance). ![doc_sec_self-links](https://user-images.githubusercontent.com/1076988/28503806-cdce4e00-6fc1-11e7-832a-2ed1fc62808f.png) This should address most of #24484.
-
由 Isaac van Bakel 提交于
One set of tests is to ensure the current message is correct. The other set is to check the messages are generated correctly for every type of loop.
-
由 Josh Triplett 提交于
Avoid implying that any copyrights have been assigned to a separate entity (such as "The Rust Project Developers") Rust contributors retain their copyrights, and do not assign them to anyone by contributing. Remove the inaccurate notice, and provide a clear explanation. Avoid stating that all files contain copyright notices and/or license notices, and especially avoid suggesting that the license terms only apply to files marked as such. In the process, this also drops a separate notice that implies only some copyrights are retained by contributors (suggesting that others are not).
-
由 Josh Triplett 提交于
LICENSE-MIT contains the line "Copyright (c) 2015 The Rust Project Developers", which implies that an entity called "The Rust Project Developers" holds copyrights in Rust. Rust contributors retain their copyrights, and do not assign them to anyone by contributing. Remove the inaccurate notice.
-
由 bors 提交于
Stabilize more APIs for the 1.20.0 release In addition to the few stabilizations that have already landed, this cleans up the remaining APIs that are in `final-comment-period` right now to be stable by the 1.20.0 release
-
由 bors 提交于
Rollup of 10 pull requests - Successful merges: #42959, #43447, #43455, #43456, #43458, #43462, #43463, #43465, #43471, #43480 - Failed merges:
-
由 bors 提交于
Make compiletest set cwd before running js tests Proposed fix for #38800. Not all tests pass yet - I will mention failures here once the test suite has finished.
-
- 26 7月, 2017 2 次提交
-
-
由 Vadim Petrochenkov 提交于
-
由 bors 提交于
Update RLS This pulls in https://github.com/rust-lang-nursery/rls/commit/79d659e5699fbf7db5b4819e9a442fb3f550472a It should fix #43453. It increases the timeout for test runs and forces builds in RLS tests to happen sequentially, this prevents interference between env vars passed to Cargo or rustc. r? @Mark-Simulacrum
-