Commit Graph

2115 Commits

Author SHA1 Message Date
bors
6d215fe04c Auto merge of #32169 - mitaa:anon-tip, r=nrc
Allow custom filenames for anonymous inputs

This came out of #29253 but doesn't fix it.

I thought it might be worth merging on its own nonetheless.
2016-03-14 14:44:55 -07:00
mitaa
ea7cf904b0 Allow custom filenames for anonymous inputs 2016-03-14 20:03:43 +01:00
bors
01118928fc Auto merge of #30587 - oli-obk:eager_const_eval2, r=nikomatsakis
typestrong const integers

~~It would be great if someone could run crater on this PR, as this has a high danger of breaking valid code~~ Crater ran. Good to go.

----

So this PR does a few things:

1. ~~const eval array values when const evaluating an array expression~~
2. ~~const eval repeat value when const evaluating a repeat expression~~
3. ~~const eval all struct and tuple fields when evaluating a struct/tuple expression~~
4. remove the `ConstVal::Int` and `ConstVal::Uint` variants and replace them with a single enum (`ConstInt`) which has variants for all integral types
  * `usize`/`isize` are also enums with variants for 32 and 64 bit. At creation and various usage steps there are assertions in place checking if the target bitwidth matches with the chosen enum variant
5. enum discriminants (`ty::Disr`) are now `ConstInt`
6. trans has its own `Disr` type now (newtype around `u64`)

This obviously can't be done without breaking changes (the ones that are noticable in stable)
We could probably write lints that find those situations and error on it for a cycle or two. But then again, those situations are rare and really bugs imo anyway:

```rust
let v10 = 10 as i8;
let v4 = 4 as isize;
assert_eq!(v10 << v4 as usize, 160 as i8);
 ```

stops compiling because 160 is not a valid i8

```rust
struct S<T, S> {
    a: T,
    b: u8,
    c: S
}
let s = S { a: 0xff_ff_ff_ffu32, b: 1, c: 0xaa_aa_aa_aa as i32 };
```

stops compiling because `0xaa_aa_aa_aa` is not a valid i32

----

cc @eddyb @pnkfelix

related: https://github.com/rust-lang/rfcs/issues/1071
2016-03-14 11:38:23 -07:00
bors
a2c56de764 Auto merge of #32112 - alexcrichton:fix-issues, r=aturon
std: Fix tracking issues and clean deprecated APIs

This PR fixes up a number of discrepancies found with tracking issues (some closed, some needed new ones, etc), and also cleans out all pre-1.8 deprecated APIs. The big beast here was dealing with `std::dynamic_lib`, and via many applications of a large hammer it's now out of the standard library.
2016-03-12 13:21:06 -08:00
Alex Crichton
b53764c73b std: Clean out deprecated APIs
Removes all unstable and deprecated APIs prior to the 1.8 release. All APIs that
are deprecated in the 1.8 release are sticking around for the rest of this
cycle.

Some notable changes are:

* The `dynamic_lib` module was moved into `rustc_back` as the compiler still
  relies on a few bits and pieces.
* The `DebugTuple` formatter now special-cases an empty struct name with only
  one field to append a trailing comma.
2016-03-12 12:31:13 -08:00
bors
beb444eaed Auto merge of #32142 - mitaa:rdoc-maybe-inline-local, r=alexcrichton
rustdoc: improve crate-local inlining

fixes #28537

r? @alexcrichton
2016-03-12 07:31:11 -08:00
bors
aeb85a9533 Auto merge of #32133 - alexcrichton:linkchecker, r=brson
Add a link validator to rustbuild

This commit was originally targeted at just adding a link checking script to the rustbuild system. This ended up snowballing a bit to extend rustbuild to be amenable to various tools we have as part of the build system in general.

There's a new `src/tools` directory which has a number of scripts/programs that are purely intended to be used as part of the build system and CI of this repository. This is currently inhabited by rustbook, the error index generator, and a new linkchecker script added as part of this PR. I suspect that more tools like compiletest, tidy scripts, snapshot scripts, etc will migrate their way into this directory over time.

The commit which adds the error index generator shows the steps necessary to add new tools to the build system, namely:

1. New steps are defined for building the tool and running the tool
2. The dependencies are configured
3. The steps are implemented

In terms of the link checker, these commits do a few things:

* A new `src/tools/linkchecker` script is added. This will read an entire documentation tree looking for broken relative links (HTTP links aren't followed yet).
* A large number of broken links throughout the documentation were fixed. Many of these were just broken when viewed from core as opposed to std, but were easily fixed.
* A few rustdoc bugs here and there were fixed
2016-03-11 04:38:04 -08:00
bors
c9629d61c6 Auto merge of #32117 - mitaa:patch-3, r=alexcrichton
rustdoc: correct src-link url

It would have been nice for htmldocck to catch this, especially since there are rustdoc tests specifically for checking src-links.

fixes #32113
2016-03-10 14:57:31 -08:00
bors
4b87655e69 Auto merge of #32101 - SimonSapin:patch-11, r=alexcrichton
Add info in `rustdoc --passes list`

CC @mitaa, https://github.com/rust-lang/rust/pull/32055/files#r55205006
2016-03-10 07:05:05 -08:00
Oliver Schneider
7003ed3fa7 fix rustdoc 2016-03-10 12:50:13 +01:00
bors
bcda58f491 Auto merge of #31710 - eddyb:reify, r=nikomatsakis
Distinguish fn item types to allow reification from nothing to fn pointers.

The first commit is a rebase of #26284, except for files that have moved since.

This is a [breaking-change], due to:
* each FFI function has a distinct type, like all other functions currently do
* all generic parameters on functions are recorded in their item types, e.g.:
`size_of::<u8>` & `size_of::<i8>`'s types differ despite their identical signature.
* function items are zero-sized, which will stop transmutes from working on them

The first two cases are handled in most cases with the new coerce-unify logic,
which will combine incompatible function item types into function pointers,
at the outer-most level of if-else chains, match arms and array literals.

The last case is specially handled during type-checking such that transmutes
from a function item type to a pointer or integer type will continue to work for
another release cycle, but are being linted against. To get rid of warnings and
ensure your code will continue to compile, cast to a pointer before transmuting.
2016-03-09 20:16:20 -08:00
mitaa
a20e6bb162 Consider doc(hidden) for crate-local inlining 2016-03-10 03:29:46 +01:00
Eduard Burtescu
ffa0860467 Track fn type and lifetime parameters in TyFnDef. 2016-03-09 16:45:28 +02:00
Eli Friedman
b423a0f9ef Split TyBareFn into TyFnDef and TyFnPtr.
There's a lot of stuff wrong with the representation of these types:
TyFnDef doesn't actually uniquely identify a function, TyFnPtr is used to
represent method calls, TyFnDef in the sub-expression of a cast isn't
correctly reified, and probably some other stuff I haven't discovered yet.
Splitting them seems like the right first step, though.
2016-03-09 16:45:28 +02:00
bors
cbbd3d9b92 Auto merge of #31631 - jonas-schievink:agoraphobia, r=nrc
[breaking-batch] Move more uses of `panictry!` out of libsyntax
2016-03-09 05:25:48 -08:00
mitaa
ae7fca1e1f Check for doc(inline) instead of .*(inline) 2016-03-09 02:05:39 +01:00
Alex Crichton
e9cb96a56a rustdoc: Don't inline all impls all at once
Right now whenever rustdoc inlines a struct or enum from another crate it ends
up inlining *all* `impl` items found in the other crate at the same time. The
rationale for this was to discover all trait impls which are otherwise not
probed for. This unfortunately picks up a lot of impls of public traits for
private types, causing lots of broken links.

This commit instead hoards all of those inlined impls into a temporary storage
location which is then selectively drawn from whenever we inline a new type.
This should ensure that we still inline all relevant impls while avoiding all
private ones.
2016-03-08 13:44:14 -08:00
Alex Crichton
16fefc5ead rustbuild: Fix stage1 rustdoc
Just always build stage1 rustdoc, it's really not that much more to build as
it's essentially just one library.
2016-03-08 13:44:14 -08:00
mitaa
f1cf2a6fcb rustdoc: correct src-link url 2016-03-08 08:07:57 +01:00
Simon Sapin
d9613237fd Add info in rustdoc --passes list
CC @mitaa, https://github.com/rust-lang/rust/pull/32055/files#r55205006
2016-03-07 16:40:23 +01:00
bors
72d588a620 Auto merge of #32055 - mitaa:rdoc-strip-priv-imports, r=alexcrichton
fixes #27104

r? @alexcrichton
2016-03-06 17:08:36 +00:00
bors
21fb3ce71b Auto merge of #31967 - mitaa:rdoc-refactor, r=alexcrichton
This is mostly cleanup of individual code bits and code reuse for `clean::Attribute` handling.

The only change in behaviour should be that emitted sources are now being recorded and queried when trying to create src-links to local source-files.

r? @alexcrichton
2016-03-06 09:16:32 +00:00
mitaa
688e52201e Split out rustdoc pass to strip private imports 2016-03-06 08:18:58 +01:00
mitaa
938c8c18c4 This doesn't seem necessary? 2016-03-04 19:40:01 +01:00
mitaa
d78f19ebbd Use const instead of function 2016-03-04 19:40:00 +01:00
mitaa
032156210d Use Item::is_* methods consistently 2016-03-04 19:40:00 +01:00
mitaa
2a28b69948 Refactor rustdocs attribute handling 2016-03-04 19:39:52 +01:00
mitaa
8f6e09a956 Simplify if let/match expressions 2016-03-04 19:07:35 +01:00
bors
85ad61c583 Auto merge of #32022 - gohyda:master, r=alexcrichton
- Empty `.sidebar .location` caused "grey line" on top of the documentation page (under 700px) fixed.
- `.sidebar .location` appearance improvement in responsive mode.
2016-03-04 13:47:02 +00:00
mitaa
62267470f6 Refactor src-link creation for local sources
Since we emit the sources beforhand we actually **know** whether we
can safely create src-links to these files and where they are stored.
2016-03-03 16:11:10 +01:00
Jeffrey Seyfried
37ba66a66e Rename middle::ty::ctxt to TyCtxt 2016-03-03 07:37:56 +00:00
gohyda
311ff0367d Responsive layout correction. 2016-03-03 04:46:30 +01:00
Vadim Petrochenkov
9047b201bf Move span into StructField
+ some cleanup in rustdoc
2016-03-02 10:32:04 +03:00
Vadim Petrochenkov
8b026a6e48 Use numeric field Names ("0", "1" etc) for positional fields 2016-03-02 10:31:19 +03:00
mitaa
0b3bc9b5e2 Correct plain-summary-line
For plaintext we don't actually need to render the Markdown before
shortening the string. (and this may have led to wrong output)
2016-02-27 06:42:30 +01:00
mitaa
2352c1c539 Clearly separate code blocks from other blocks
For summary descriptions we need the first paragraph (adjacent lines
until a blank line) - but the rendered markdown of a code block did not
leave a blank line in the html and was thus included in the summary line.
2016-02-27 06:42:21 +01:00
mitaa
eae9f4636c Don't inline impls from doc(hidden) modules 2016-02-26 15:56:46 +01:00
Manish Goregaokar
e584a492f3 Rollup merge of #31837 - mitaa:rdoc-inherent-assoc, r=alexcrichton
This effectively only records associated items from either inherent impls or trait definitions in the search-index.

fixes #31808

r? @alexcrichton
2016-02-25 15:06:07 +05:30
Manish Goregaokar
6078a86e2d Rollup merge of #31835 - mitaa:rdoc-global-src, r=alexcrichton
fixes #26995

r? @alexcrichton
2016-02-25 15:06:07 +05:30
Manish Goregaokar
ac02f9c18d Rollup merge of #31842 - dileepbapat:master, r=alexcrichton
I have made changes and built it after that. Please advise,

https://github.com/rust-lang/rust/issues/31820
2016-02-25 04:21:10 +05:30
mitaa
cf76fcf30d Fix source-links for files with absolute-paths
`clean_srcpath` tries to make the source-path relative to `src_root`,
but this didn't work since `src_root` itself wasn't absolute.
2016-02-24 19:43:02 +01:00
mitaa
27ca2507de Allow creation of src-links for device files 2016-02-24 19:41:56 +01:00
mitaa
f5df7e0865 Show associated types in inherent impls 2016-02-23 21:47:18 +01:00
mitaa
b38a856e38 Don't show associated consts from trait impls 2016-02-23 21:47:13 +01:00
dileepb
fbfe70e6ab #31820 - Utilize if..let instead of single match branch 2016-02-23 21:21:51 +05:30
mitaa
9d3bce38b4 Don't record self parameter for static methods 2016-02-23 12:17:12 +01:00
bors
37c6f2881c Auto merge of #31715 - mitaa:rdoc-index-crate, r=alexcrichton
This allows to search for crates in documentation and simplifies the json serialization of the search-index.

fixes #14077
2016-02-22 23:13:08 +00:00
mitaa
81f673d3bc Simplify search-index serialization 2016-02-22 20:07:09 +01:00
bors
0d1cd9bd6a Auto merge of #31685 - petrochenkov:patrefact2, r=eddyb
And split `PatKind::Enum` into `PatKind::TupleStruct` and `PatKind::Path`.
This is the HIR part of https://github.com/rust-lang/rust/pull/31581.
This is also kind of a preparation for https://github.com/rust-lang/rfcs/pull/1492.

r? @eddyb
2016-02-17 06:01:49 +00:00
mitaa
810a514029 Add crates to search-index 2016-02-16 20:00:57 +01:00