Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 9 pull requests #66143

Merged
merged 34 commits into from
Nov 6, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
c17f89d
caller_location: point to macro invocation sites, like file!/line!.
eddyb Oct 30, 2019
49f9626
caller_location: use in core::panic!.
eddyb Oct 30, 2019
1b154a3
Rename `LocalInternedString` as `SymbolStr`.
nnethercote Oct 21, 2019
2f7d7c2
Remove an erroneous comment.
nnethercote Oct 21, 2019
e6d541a
Add some explanatory comments.
nnethercote Oct 22, 2019
9cf59b5
Remove some unnecessary renamings of constants.
nnethercote Oct 21, 2019
5bc7084
Convert `x.as_str().to_string()` to `x.to_string()` where possible.
nnethercote Oct 21, 2019
b9cef69
Simplify various `Symbol` use points.
nnethercote Oct 22, 2019
d0db290
Remove the `AsRef` impl for `SymbolStr`.
nnethercote Oct 22, 2019
0825b35
librustc_lexer: Add methods "first" and "second" to the "Cursor"
popzxc Nov 3, 2019
72767a8
librustc_lexer: Introduce "eat_while" and "eat_identifier" methods
popzxc Nov 3, 2019
e0c45f7
librustc_lexer: Make "eat_float_exponent" return bool instead of result
popzxc Nov 3, 2019
649a524
librustc_lexer: Simplify "single_quoted_string" method
popzxc Nov 3, 2019
d6f722d
librustc_lexer: Simplify "double_quoted_string" method
popzxc Nov 3, 2019
6e350bd
librustc_lexer: Simplify "raw_double_quoted_string" method
popzxc Nov 3, 2019
1943079
Configure LLVM module PIC level
smaeul Nov 3, 2019
ecd2673
librustc_lexer: Simplify "lifetime_or_char" method
popzxc Nov 3, 2019
e8b8d2a
librustc_lexer: Reorder imports in lib.rs
popzxc Nov 3, 2019
31735b0
librustc_lexer: Make nth_char method private
popzxc Nov 3, 2019
90b8d34
bump smallvec to 1.0
RalfJung Nov 4, 2019
23d2211
Use KERN_ARND syscall for random numbers on NetBSD, same as FreeBSD.
alarixnia Nov 4, 2019
b4f92ea
Use any() in code shared between FreeBSD and NetBSD
alarixnia Nov 4, 2019
d01ebbb
Add target thumbv7neon-unknown-linux-musleabihf
smaeul Nov 5, 2019
73df5c5
Update the bundled `wasi-libc` repository
alexcrichton Nov 5, 2019
ad550b8
use American spelling for `pluralize!`
euclio Nov 5, 2019
a0b4b4d
Rollup merge of #65776 - nnethercote:rename-LocalInternedString-and-m…
Centril Nov 6, 2019
24af0c9
Rollup merge of #65973 - eddyb:caller-location-panic, r=petrochenkov
Centril Nov 6, 2019
81550a0
Rollup merge of #66015 - popzxc:refactor-librustc_parser, r=matklad
Centril Nov 6, 2019
98cbe17
Rollup merge of #66062 - smaeul:patch/pic-level, r=estebank
Centril Nov 6, 2019
167b8fe
Rollup merge of #66086 - RalfJung:smallvec, r=nagisa
Centril Nov 6, 2019
828a3ee
Rollup merge of #66092 - niacat:master, r=nagisa
Centril Nov 6, 2019
40558c3
Rollup merge of #66103 - smaeul:patch/thumb-musl, r=nagisa
Centril Nov 6, 2019
7f7218f
Rollup merge of #66133 - alexcrichton:update-wasi-libc, r=Mark-Simula…
Centril Nov 6, 2019
4f9651b
Rollup merge of #66139 - euclio:pluralize, r=nagisa
Centril Nov 6, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove the AsRef impl for SymbolStr.
Because it's highly magical, which goes against the goal of keeping
`SymbolStr` simple. Plus it's only used in a handful of places that
only require minor changes.
  • Loading branch information
nnethercote committed Nov 1, 2019
commit d0db29003975d8c4b3a552ff8c3a68435173cdc7
2 changes: 1 addition & 1 deletion src/librustc_codegen_ssa/back/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl Command {
}

pub fn sym_arg(&mut self, arg: Symbol) -> &mut Command {
self.arg(&arg.as_str());
self.arg(&*arg.as_str());
self
}

Expand Down
8 changes: 4 additions & 4 deletions src/libsyntax/parse/parser/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ impl<'a> Parser<'a> {
// `/` to `\`.
#[cfg(windows)]
let s = s.replace("/", "\\");
Some(dir_path.join(s))
Some(dir_path.join(&*s))
} else {
None
}
Expand Down Expand Up @@ -314,7 +314,7 @@ impl<'a> Parser<'a> {

fn push_directory(&mut self, id: Ident, attrs: &[Attribute]) {
if let Some(path) = attr::first_attr_value_str_by_name(attrs, sym::path) {
self.directory.path.to_mut().push(&path.as_str());
self.directory.path.to_mut().push(&*path.as_str());
self.directory.ownership = DirectoryOwnership::Owned { relative: None };
} else {
// We have to push on the current module name in the case of relative
Expand All @@ -325,10 +325,10 @@ impl<'a> Parser<'a> {
// directory path to `/x/y/z`, not `/x/z` with a relative offset of `y`.
if let DirectoryOwnership::Owned { relative } = &mut self.directory.ownership {
if let Some(ident) = relative.take() { // remove the relative offset
self.directory.path.to_mut().push(ident.as_str());
self.directory.path.to_mut().push(&*ident.as_str());
}
}
self.directory.path.to_mut().push(&id.as_str());
self.directory.path.to_mut().push(&*id.as_str());
}
}
}
10 changes: 0 additions & 10 deletions src/libsyntax_pos/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1099,16 +1099,6 @@ pub struct SymbolStr {
string: &'static str,
}

impl<U: ?Sized> std::convert::AsRef<U> for SymbolStr
where
str: std::convert::AsRef<U>
{
#[inline]
fn as_ref(&self) -> &U {
self.string.as_ref()
}
}

// This impl allows a `SymbolStr` to be directly equated with a `String` or
// `&str`.
impl<T: std::ops::Deref<Target = str>> std::cmp::PartialEq<T> for SymbolStr {
Expand Down