Rollup of 4 pull requests
Successful merges:
- #50177 (mark std::str::replace(,n) as #[must_use])
- #50207 (Hash EntryKind::AssociatedConst const data)
- #50214 (Js improvements)
- #50219 (Added missing `.` in docs.)
Failed merges:
- #50229 (Add setting to go to item if there is only one result)
Because they traverse data structures and build up strings, which is
wasted effort if those strings aren't printed.
The patch also removes some now-unnecessary log_enabled! tests at call
sites.
Allow variant discriminant initializers to refer to other initializer…
…s of the same enum
r? @eddyb
fixes the 2.4 failure of https://github.com/rust-lang/rust/issues/49765
cc @durka @retep998
Allow crate:: in local paths
Currently if you want to use `crate` locally you have to do `::crate::`. This shouldn't be necessary
(will fix up tests later)
r? @petrochenkov
… rather than the module’s.
Remove code definition of the Error trait from its doc-comment
It was out of date, and rustdoc already shows the same information.
Add a default impl for Error::description and document it as deprecated.
It is redundant with Display while being much less flexible for implementors.
This is only a "soft" deprecation: it is not worth the hassle of a warning to existing users.
Tweak Error trait docs to reflect actual requirements
Introduce compile-pass
r? @alexcrichton
The plan is to move things that cannot fail (no assert, unwrap, etc) out so we don't have to run them, and in the long term we can also stop running LLVM for them.
Out of 3215 tests...
```
Language Files Lines Code Comments Blanks
Rust 3215 119254 64688 35135 19431
```
16% of them has an empty main (which is already moved in this PR).
```
grep -rnPzl 'fn main\(\)\s*{\s*}' | xargs rg --files-without-match cfg | wc -l
547
```
And only 50% of the tests contains assertions:
```
rg -e assert -e unwrap -e expect -e panic -l | wc -l
1600
```
The remainder is likely able to get moved, but they need check by a human so I didn't touch them in PR.
cc @rust-lang/compiler
* [ ] Update documentation
Edition breakage lint for absolute paths starting with modules
We plan to enable `extern_absolute_paths` in the 2018 edition. To allow for that, folks must transition their paths in a previous edition to the new one. This makes paths which import module contents via `use module::` or `::module::` obsolete, and we must edition-lint these.
https://internals.rust-lang.org/t/the-great-module-adventure-continues/6678/205?u=manishearth is the current plan for paths.
r? @nikomatsakis
Fixes#48722